From 75ac49435dfe14fe05ef457f09d3ca739f4cbba9 Mon Sep 17 00:00:00 2001 From: Itay Bavly Date: Wed, 20 Aug 2025 13:40:16 -0400 Subject: [PATCH 01/16] ugly rewrite --- end_to_end_tests/__init__.py | 3 +- .../api/responses/__init__.py | 6 +- .../my_test_api_client/client.py | 36 +- .../generated_code_execution/test_arrays.py | 42 +- .../generated_code_execution/test_defaults.py | 17 +- .../test_docstrings.py | 30 +- .../test_enums_and_consts.py | 105 +- .../test_properties.py | 45 +- .../generated_code_execution/test_unions.py | 40 +- .../test_invalid_arrays.py | 21 +- .../test_invalid_defaults.py | 9 +- .../test_invalid_enums_and_consts.py | 62 +- .../test_invalid_spec_format.py | 39 +- .../test_invalid_unions.py | 21 +- end_to_end_tests/functional_tests/helpers.py | 50 +- end_to_end_tests/generated_client.py | 27 +- .../api/bodies/json_like.py | 8 +- .../api/bodies/post_bodies_multiple.py | 8 +- .../my_test_api_client/api/bodies/refs.py | 8 +- .../api/config/content_type_override.py | 8 +- .../api/default/get_common_parameters.py | 8 +- .../get_models_oneof_with_required_const.py | 41 +- .../api/default/post_common_parameters.py | 8 +- .../api/default/reserved_parameters.py | 8 +- .../enums/bool_enum_tests_bool_enum_post.py | 8 +- .../api/enums/int_enum_tests_int_enum_post.py | 8 +- .../api/location/get_location_header_types.py | 16 +- .../get_location_query_optionality.py | 8 +- .../api/naming/hyphen_in_path.py | 8 +- ...st_naming_property_conflict_with_import.py | 8 +- .../get_parameter_references_path_param.py | 8 +- ...lete_common_parameters_overriding_param.py | 8 +- .../get_common_parameters_overriding_param.py | 8 +- .../get_same_name_multiple_locations_param.py | 8 +- .../parameters/multiple_path_parameters.py | 8 +- ..._responses_unions_simple_before_complex.py | 4 +- .../api/responses/reference_response.py | 8 +- .../api/responses/text_response.py | 8 +- .../api/tag1/get_tag_with_number.py | 8 +- .../api/tag2/get_tag_with_number.py | 8 +- .../api/tests/description_with_backslash.py | 8 +- .../api/tests/get_basic_list_of_booleans.py | 8 +- .../api/tests/get_basic_list_of_floats.py | 8 +- .../api/tests/get_basic_list_of_integers.py | 8 +- .../api/tests/get_basic_list_of_strings.py | 8 +- .../no_response_tests_no_response_get.py | 8 +- .../octet_stream_tests_octet_stream_get.py | 8 +- .../octet_stream_tests_octet_stream_post.py | 8 +- .../api/tests/post_form_data.py | 8 +- .../api/tests/post_form_data_inline.py | 8 +- ..._with_cookie_auth_token_with_cookie_get.py | 8 +- ...d_content_tests_unsupported_content_get.py | 8 +- .../my_test_api_client/api/true_/false_.py | 8 +- .../my_test_api_client/client.py | 36 +- .../my_test_api_client/models/__init__.py | 108 +- .../my_test_api_client/models/a_model.py | 112 +- ...roperties_reference_that_are_not_object.py | 68 +- .../all_of_has_properties_but_no_type.py | 4 +- ...h_a_circular_ref_in_items_object_a_item.py | 24 +- ...ems_object_additional_properties_a_item.py | 36 +- ...ems_object_additional_properties_b_item.py | 36 +- ...h_a_circular_ref_in_items_object_b_item.py | 24 +- ...items_object_additional_properties_item.py | 30 +- ...th_a_recursive_ref_in_items_object_item.py | 20 +- .../body_upload_file_tests_upload_post.py | 191 +- ..._tests_upload_post_some_nullable_object.py | 4 +- ..._tests_upload_post_some_optional_object.py | 4 +- .../my_test_api_client/models/extended.py | 112 +- ...with_required_const_response_200_type_0.py | 4 +- ...with_required_const_response_200_type_1.py | 4 +- ...odel_with_additional_properties_inlined.py | 24 +- ..._properties_inlined_additional_property.py | 4 +- .../model_with_additional_properties_refed.py | 4 +- .../models/model_with_any_json_properties.py | 55 +- ...n_properties_additional_property_type_0.py | 4 +- ...circular_ref_in_additional_properties_a.py | 20 +- ...circular_ref_in_additional_properties_b.py | 20 +- .../models/model_with_discriminated_union.py | 25 +- .../models/model_with_merged_properties.py | 8 +- ...el_with_primitive_additional_properties.py | 8 +- ...ive_additional_properties_a_date_holder.py | 8 +- ..._recursive_ref_in_additional_properties.py | 16 +- .../model_with_union_property_inlined.py | 32 +- ...ions_simple_before_complex_response_200.py | 19 +- ...ple_before_complex_response_200a_type_1.py | 4 +- .../enums/bool_enum_tests_bool_enum_post.py | 8 +- .../api/enums/int_enum_tests_int_enum_post.py | 8 +- .../my_enum_api_client/client.py | 36 +- .../my_enum_api_client/models/a_model.py | 20 +- .../models/an_all_of_enum.py | 4 +- .../models/an_enum_with_null.py | 4 +- .../my_enum_api_client/models/an_int_enum.py | 4 +- .../models/different_enum.py | 4 +- .../models/get_user_list_int_enum_header.py | 4 +- .../get_user_list_string_enum_header.py | 4 +- .../models/post_user_list_body.py | 100 +- end_to_end_tests/metadata_snapshots/setup.py | 6 +- end_to_end_tests/regen_golden_record.py | 16 +- .../api/const/post_const_path.py | 4 +- .../api/prefix_items/post_prefix_items.py | 8 +- .../test_3_1_features_client/client.py | 36 +- .../models/post_const_path_body.py | 21 +- .../models/post_prefix_items_body.py | 20 +- end_to_end_tests/test_end_to_end.py | 50 +- .../api/parameters/post_parameters_header.py | 4 +- integration-tests/integration_tests/client.py | 36 +- .../models/post_body_multipart_body.py | 19 +- .../test_body/test_post_body_multipart.py | 17 +- .../test_post_parameters_header.py | 4 +- openapi/README_internal.md | 20 + openapi/class_overrides.yaml | 11 + openapi/openapi_project/README.md | 124 + .../openapi_package/__init__.py | 8 + .../openapi_package/api/__init__.py | 1 + .../api/application_service/__init__.py | 1 + .../post_application_login.py | 154 + .../api/order_service/__init__.py | 1 + .../api/order_service/get_orders.py | 121 + .../order_service/get_orders_searchhistory.py | 243 + .../order_service/get_orders_tradeconfirms.py | 213 + .../order_service/post_orders_cancelorder.py | 154 + .../post_orders_createmultilegorder.py | 154 + .../post_orders_createmultilegordercross.py | 158 + .../order_service/post_orders_createorder.py | 154 + .../post_orders_createordercross.py | 154 + .../post_orders_replacemultilegorder.py | 158 + .../order_service/post_orders_replaceorder.py | 154 + ...orders_validaterisk_createmultilegorder.py | 154 + ...s_validaterisk_createmultilegordercross.py | 156 + .../post_orders_validaterisk_createorder.py | 154 + ...st_orders_validaterisk_createordercross.py | 154 + ...rders_validaterisk_replacemultilegorder.py | 156 + .../post_orders_validaterisk_replaceorder.py | 154 + .../api/portfolio_service/__init__.py | 1 + .../get_portfolio_positions.py | 198 + .../post_portfolio_analyzepositions.py | 154 + .../post_portfolio_calculatemargins.py | 154 + .../post_portfolio_riskradar.py | 154 + .../api/security_service/__init__.py | 1 + .../get_securities_exchanges.py | 121 + .../post_securities_easytoborrowsecurities.py | 158 + .../post_securities_flexoption.py | 154 + .../post_securities_optionchains.py | 154 + .../post_securities_securities.py | 154 + .../api/user_data_service/__init__.py | 1 + .../get_userdata_accounts.py | 121 + .../get_userdata_activeuser.py | 121 + .../get_userdata_affiliatedtradingfirms.py | 123 + .../get_userdata_p2paccounts.py | 121 + .../user_data_service/get_userdata_routes.py | 121 + .../get_userdata_tradingfirms.py | 121 + .../api/utility_service/__init__.py | 1 + .../utility_service/get_utility_serverinfo.py | 121 + .../utility_service/get_utility_servertime.py | 121 + .../get_utility_tradingholidays.py | 121 + .../openapi_project/openapi_package/client.py | 282 + .../openapi_project/openapi_package/errors.py | 16 + .../openapi_package/models/__init__.py | 547 ++ .../openapi_package/models/account.py | 371 + .../openapi_package/models/account_script.py | 49 + .../openapi_package/models/account_status.py | 11 + .../openapi_package/models/account_type.py | 10 + .../models/analyze_position_item.py | 67 + .../models/analyze_positions_request.py | 136 + .../models/analyze_positions_response.py | 79 + .../openapi_package/models/any_model.py | 59 + .../models/calculate_margin_request.py | 126 + .../calculate_margin_request_position.py | 58 + .../calculate_margin_request_position_list.py | 71 + .../models/calculate_margin_response.py | 82 + .../models/cancel_order_request.py | 96 + .../cancel_order_request_optional_data.py | 59 + .../models/cancel_order_response.py | 75 + .../cancel_replace_multi_leg_order_request.py | 245 + ...el_replace_multi_leg_order_request_algo.py | 61 + ...ulti_leg_order_request_market_condition.py | 61 + ...e_multi_leg_order_request_optional_data.py | 61 + ...cancel_replace_multi_leg_order_response.py | 75 + .../models/cancel_replace_order_request.py | 221 + .../cancel_replace_order_request_algo.py | 59 + ..._replace_order_request_market_condition.py | 61 + ...cel_replace_order_request_optional_data.py | 61 + .../models/cancel_replace_order_response.py | 75 + .../openapi_package/models/capacity_code.py | 10 + .../openapi_package/models/claim_type.py | 11 + .../openapi_package/models/clearing_info.py | 216 + .../openapi_package/models/clearing_range.py | 21 + .../openapi_package/models/country.py | 14 + .../models/create_flex_option_request.py | 182 + .../models/create_flex_option_response.py | 79 + ...create_multi_leg_order_cross_allocation.py | 156 + ...eg_order_cross_allocation_optional_data.py | 61 + .../create_multi_leg_order_cross_request.py | 295 + ...eate_multi_leg_order_cross_request_algo.py | 61 + ...eg_order_cross_request_market_condition.py | 61 + ...i_leg_order_cross_request_optional_data.py | 61 + .../create_multi_leg_order_cross_response.py | 79 + .../models/create_multi_leg_order_leg.py | 160 + ...te_multi_leg_order_leg_market_condition.py | 61 + ...reate_multi_leg_order_leg_optional_data.py | 61 + .../models/create_multi_leg_order_request.py | 297 + .../create_multi_leg_order_request_algo.py | 61 + ...ulti_leg_order_request_market_condition.py | 61 + ...e_multi_leg_order_request_optional_data.py | 61 + .../models/create_multi_leg_order_response.py | 79 + .../models/create_order_cross_allocation.py | 167 + ...te_order_cross_allocation_optional_data.py | 61 + .../models/create_order_cross_request.py | 312 + .../models/create_order_cross_request_algo.py | 59 + ...te_order_cross_request_market_condition.py | 61 + ...reate_order_cross_request_optional_data.py | 61 + .../models/create_order_cross_response.py | 79 + .../models/create_order_request.py | 331 + .../models/create_order_request_algo.py | 59 + .../create_order_request_market_condition.py | 61 + .../create_order_request_optional_data.py | 59 + .../models/create_order_response.py | 79 + .../openapi_package/models/cross_side_type.py | 10 + .../openapi_package/models/cross_type.py | 20 + .../openapi_package/models/crypto.py | 289 + .../openapi_package/models/crypto_aliases.py | 59 + .../openapi_package/models/currency.py | 180 + .../models/cxl_rej_response_to.py | 14 + .../openapi_package/models/date.py | 58 + .../models/easy_to_borrow_security.py | 49 + .../openapi_package/models/empty.py | 22 + .../openapi_package/models/exchange.py | 157 + .../openapi_package/models/exchange_code.py | 72 + .../openapi_package/models/exec_type.py | 30 + .../openapi_package/models/execution.py | 641 ++ .../openapi_package/models/execution_algo.py | 59 + .../models/execution_optional_data.py | 59 + .../openapi_package/models/flex_option.py | 445 + .../models/flex_option_aliases.py | 59 + .../models/flex_settlement_type.py | 12 + .../openapi_package/models/future.py | 364 + .../openapi_package/models/future_aliases.py | 59 + .../openapi_package/models/future_root.py | 364 + .../models/future_root_aliases.py | 59 + .../openapi_package/models/future_spread.py | 385 + .../models/future_spread_aliases.py | 59 + .../models/future_spread_leg.py | 114 + .../openapi_package/models/fx.py | 289 + .../openapi_package/models/fx_aliases.py | 59 + .../openapi_package/models/generic_order.py | 107 + .../models/get_active_user_response.py | 79 + .../models/get_server_info_response.py | 139 + ...et_server_info_response_system_settings.py | 61 + .../models/get_server_time_response.py | 66 + .../models/get_trading_holidays_response.py | 82 + .../openapi_package/models/header.py | 103 + .../openapi_package/models/index.py | 273 + .../openapi_package/models/index_aliases.py | 59 + .../models/list_accounts_response.py | 82 + .../list_affiliated_trading_firms_response.py | 84 + .../list_easy_to_borrow_securities_request.py | 49 + ...list_easy_to_borrow_securities_response.py | 82 + .../models/list_exchanges_response.py | 82 + .../models/list_option_chains_repsonse.py | 82 + .../models/list_option_chains_request.py | 42 + .../models/list_orders_response.py | 82 + .../models/list_positions_response.py | 82 + .../models/list_routes_response.py | 105 + .../models/list_securities_request.py | 42 + .../models/list_securities_response.py | 82 + .../models/list_trade_confirms_response.py | 82 + .../models/list_trading_firms_response.py | 82 + .../openapi_package/models/login_request.py | 76 + .../openapi_package/models/login_response.py | 204 + .../models/login_response_system_settings.py | 59 + .../openapi_package/models/login_status.py | 19 + .../openapi_package/models/margin_data.py | 80 + .../models/margin_data_type.py | 10 + .../openapi_package/models/multi_leg_order.py | 545 ++ .../models/multi_leg_order_algo.py | 59 + .../multi_leg_order_cancel_replace_request.py | 377 + ...i_leg_order_cancel_replace_request_algo.py | 61 + ...cancel_replace_request_market_condition.py | 61 + ...er_cancel_replace_request_optional_data.py | 61 + .../models/multi_leg_order_cross.py | 484 + .../models/multi_leg_order_cross_algo.py | 59 + .../multi_leg_order_cross_allocation.py | 261 + ...eg_order_cross_allocation_optional_data.py | 61 + .../multi_leg_order_cross_market_condition.py | 61 + .../multi_leg_order_cross_optional_data.py | 61 + .../models/multi_leg_order_leg.py | 260 + .../multi_leg_order_leg_market_condition.py | 61 + .../multi_leg_order_leg_optional_data.py | 59 + .../multi_leg_order_market_condition.py | 59 + .../models/multi_leg_order_optional_data.py | 59 + .../models/multi_leg_reporting_type.py | 10 + .../models/numeric_display_format.py | 32 + .../openapi_package/models/option.py | 391 + .../openapi_package/models/option_aliases.py | 59 + .../openapi_package/models/option_chain.py | 128 + .../models/option_chain_option.py | 219 + .../models/option_chain_option_aliases.py | 59 + .../models/option_chain_options.py | 59 + .../models/option_chain_roots.py | 59 + .../models/option_exercise_style.py | 11 + .../models/option_expiration_style.py | 19 + .../openapi_package/models/option_root.py | 418 + .../models/option_root_aliases.py | 59 + .../openapi_package/models/option_series.py | 227 + .../models/option_series_product_type.py | 9 + .../models/option_series_type.py | 13 + .../models/option_settlement_type.py | 12 + .../openapi_package/models/ord_status.py | 30 + .../openapi_package/models/ord_type.py | 14 + .../openapi_package/models/order.py | 583 ++ .../openapi_package/models/order_algo.py | 59 + .../models/order_cancel_reject.py | 187 + .../order_cancel_reject_optional_data.py | 59 + .../models/order_cancel_replace_request.py | 353 + .../order_cancel_replace_request_algo.py | 59 + ...cancel_replace_request_market_condition.py | 61 + ...er_cancel_replace_request_optional_data.py | 61 + .../models/order_cancel_request.py | 176 + .../order_cancel_request_optional_data.py | 59 + .../openapi_package/models/order_cross.py | 497 + .../models/order_cross_algo.py | 59 + .../models/order_cross_allocation.py | 263 + .../order_cross_allocation_optional_data.py | 61 + .../models/order_cross_market_condition.py | 59 + .../models/order_cross_optional_data.py | 59 + .../openapi_package/models/order_delete.py | 106 + .../models/order_delete_optional_data.py | 59 + .../models/order_instruction.py | 57 + .../models/order_instruction_type.py | 91 + .../models/order_market_condition.py | 59 + .../models/order_optional_data.py | 59 + .../openapi_package/models/order_type.py | 12 + .../openapi_package/models/order_update.py | 623 ++ .../models/order_update_algo.py | 59 + .../models/order_update_event.py | 181 + .../models/order_update_optional_data.py | 59 + .../models/origination_type.py | 39 + .../openapi_package/models/position.py | 193 + .../models/position_analysis.py | 74 + .../openapi_package/models/position_effect.py | 11 + .../openapi_package/models/position_source.py | 9 + .../openapi_package/models/position_theo.py | 206 + .../models/position_theo_leg.py | 154 + .../openapi_package/models/price_type.py | 14 + .../openapi_package/models/product_group.py | 19 + .../models/product_sub_group.py | 8 + .../openapi_package/models/put_call.py | 10 + .../models/risk_calculation_type.py | 11 + .../openapi_package/models/risk_eval_mode.py | 9 + .../models/risk_radar_account_group.py | 114 + .../models/risk_radar_class_group.py | 178 + .../openapi_package/models/risk_radar_data.py | 67 + .../models/risk_radar_position.py | 182 + .../models/risk_radar_product_group.py | 104 + .../models/risk_radar_request.py | 194 + .../models/risk_radar_request_position.py | 58 + .../risk_radar_request_position_list.py | 65 + .../models/risk_radar_response.py | 79 + .../models/risk_radar_scenario_order.py | 9 + .../openapi_package/models/risk_reject.py | 137 + .../models/risk_reject_type.py | 120 + .../openapi_package/models/route.py | 178 + .../models/route_applicability.py | 120 + .../openapi_package/models/route_property.py | 66 + .../models/route_property_type.py | 19 + .../openapi_package/models/route_type.py | 16 + .../models/routing_session_group.py | 66 + .../models/routing_session_group_type.py | 15 + .../openapi_package/models/scenario.py | 83 + .../openapi_package/models/scenario_leg.py | 112 + .../models/scenario_position.py | 112 + .../openapi_package/models/scenario_theo.py | 74 + .../models/search_order_history_response.py | 82 + .../openapi_package/models/security.py | 215 + .../models/security_category.py | 39 + .../openapi_package/models/security_type.py | 19 + .../models/settlement_deliverable_type.py | 11 + .../openapi_package/models/settlement_info.py | 66 + .../openapi_package/models/shock_value.py | 98 + .../models/shock_value_flags.py | 58 + .../openapi_package/models/side.py | 13 + .../openapi_package/models/spread_leg_side.py | 10 + .../openapi_package/models/spread_leg_type.py | 10 + .../openapi_package/models/status.py | 74 + .../openapi_package/models/status_code.py | 19 + .../openapi_package/models/stock.py | 309 + .../openapi_package/models/stock_aliases.py | 59 + .../openapi_package/models/tif.py | 17 + .../openapi_package/models/time_of_day.py | 67 + .../models/tims_class_group.py | 202 + .../models/tims_margin_data.py | 220 + .../models/tims_position_group.py | 159 + .../models/tims_product_group.py | 177 + .../openapi_package/models/trade_confirm.py | 935 ++ .../openapi_package/models/trading_firm.py | 67 + .../models/trading_firm_slim.py | 49 + .../openapi_package/models/trading_holiday.py | 97 + .../openapi_package/models/trading_session.py | 105 + .../models/trading_session_group.py | 74 + .../openapi_package/models/user.py | 242 + .../openapi_package/models/user_location.py | 10 + .../openapi_package/models/user_permission.py | 66 + .../openapi_package/models/user_status.py | 12 + .../openapi_package/models/user_type.py | 10 + .../models/validate_risk_response.py | 91 + .../models/volatility_shock_skew.py | 9 + .../models/volatility_shock_type.py | 9 + .../openapi_project/openapi_package/py.typed | 1 + .../openapi_project/openapi_package/types.py | 55 + openapi/swagger_cleaned.json | 8122 +++++++++++++++++ openapi/templates/api_init.py.jinja | 1 + openapi/templates/client.py.jinja | 191 + openapi/templates/endpoint_init.py.jinja | 1 + openapi/templates/endpoint_macros.py.jinja | 186 + openapi/templates/endpoint_module.py.jinja | 149 + openapi/templates/model.py.jinja | 236 + openapi/templates/models_init.py.jinja | 13 + openapi/templates/package_init.py.jinja | 9 + openapi/templates/types.py.jinja | 53 + openapi_project/.gitignore | 0 openapi_project/README.md | 124 + openapi_project/openapi_package/__init__.py | 8 + .../openapi_package/api/__init__.py | 1 + .../api/application_service/__init__.py | 1 + .../post_application_login.py | 157 + .../api/order_service/__init__.py | 1 + .../api/order_service/get_orders.py | 125 + .../order_service/get_orders_searchhistory.py | 248 + .../order_service/get_orders_tradeconfirms.py | 218 + .../order_service/post_orders_cancelorder.py | 157 + .../post_orders_createmultilegorder.py | 157 + .../post_orders_createmultilegordercross.py | 161 + .../order_service/post_orders_createorder.py | 157 + .../post_orders_createordercross.py | 157 + .../post_orders_replacemultilegorder.py | 161 + .../order_service/post_orders_replaceorder.py | 157 + ...orders_validaterisk_createmultilegorder.py | 157 + ...s_validaterisk_createmultilegordercross.py | 159 + .../post_orders_validaterisk_createorder.py | 157 + ...st_orders_validaterisk_createordercross.py | 157 + ...rders_validaterisk_replacemultilegorder.py | 159 + .../post_orders_validaterisk_replaceorder.py | 157 + .../api/portfolio_service/__init__.py | 1 + .../get_portfolio_positions.py | 203 + .../post_portfolio_analyzepositions.py | 157 + .../post_portfolio_calculatemargins.py | 157 + .../post_portfolio_riskradar.py | 157 + .../api/security_service/__init__.py | 1 + .../get_securities_exchanges.py | 125 + .../post_securities_easytoborrowsecurities.py | 161 + .../post_securities_flexoption.py | 157 + .../post_securities_optionchains.py | 157 + .../post_securities_securities.py | 157 + .../api/user_data_service/__init__.py | 1 + .../get_userdata_accounts.py | 125 + .../get_userdata_activeuser.py | 125 + .../get_userdata_affiliatedtradingfirms.py | 127 + .../get_userdata_p2paccounts.py | 125 + .../user_data_service/get_userdata_routes.py | 125 + .../get_userdata_tradingfirms.py | 125 + .../api/utility_service/__init__.py | 1 + .../utility_service/get_utility_serverinfo.py | 125 + .../utility_service/get_utility_servertime.py | 125 + .../get_utility_tradingholidays.py | 125 + openapi_project/openapi_package/client.py | 282 + openapi_project/openapi_package/errors.py | 16 + .../openapi_package/models/__init__.py | 547 ++ .../openapi_package/models/account.py | 372 + .../openapi_package/models/account_script.py | 53 + .../openapi_package/models/account_status.py | 11 + .../openapi_package/models/account_type.py | 10 + .../models/analyze_position_item.py | 71 + .../models/analyze_positions_request.py | 138 + .../models/analyze_positions_response.py | 81 + .../openapi_package/models/any_model.py | 62 + .../models/calculate_margin_request.py | 126 + .../calculate_margin_request_position.py | 62 + .../calculate_margin_request_position_list.py | 71 + .../models/calculate_margin_response.py | 84 + .../models/cancel_order_request.py | 95 + .../cancel_order_request_optional_data.py | 81 + .../models/cancel_order_response.py | 79 + .../cancel_replace_multi_leg_order_request.py | 235 + ...el_replace_multi_leg_order_request_algo.py | 81 + ...ulti_leg_order_request_market_condition.py | 81 + ...e_multi_leg_order_request_optional_data.py | 81 + ...cancel_replace_multi_leg_order_response.py | 79 + .../models/cancel_replace_order_request.py | 213 + .../cancel_replace_order_request_algo.py | 81 + ..._replace_order_request_market_condition.py | 81 + ...cel_replace_order_request_optional_data.py | 81 + .../models/cancel_replace_order_response.py | 79 + .../openapi_package/models/capacity_code.py | 10 + .../openapi_package/models/claim_type.py | 11 + .../openapi_package/models/clearing_info.py | 220 + .../openapi_package/models/clearing_range.py | 21 + .../openapi_package/models/country.py | 14 + .../models/create_flex_option_request.py | 184 + .../models/create_flex_option_response.py | 81 + ...create_multi_leg_order_cross_allocation.py | 151 + ...eg_order_cross_allocation_optional_data.py | 81 + .../create_multi_leg_order_cross_request.py | 283 + ...eate_multi_leg_order_cross_request_algo.py | 81 + ...eg_order_cross_request_market_condition.py | 81 + ...i_leg_order_cross_request_optional_data.py | 81 + .../create_multi_leg_order_cross_response.py | 81 + .../models/create_multi_leg_order_leg.py | 156 + ...te_multi_leg_order_leg_market_condition.py | 81 + ...reate_multi_leg_order_leg_optional_data.py | 81 + .../models/create_multi_leg_order_request.py | 288 + .../create_multi_leg_order_request_algo.py | 81 + ...ulti_leg_order_request_market_condition.py | 81 + ...e_multi_leg_order_request_optional_data.py | 81 + .../models/create_multi_leg_order_response.py | 81 + .../models/create_order_cross_allocation.py | 165 + ...te_order_cross_allocation_optional_data.py | 81 + .../models/create_order_cross_request.py | 305 + .../models/create_order_cross_request_algo.py | 81 + ...te_order_cross_request_market_condition.py | 81 + ...reate_order_cross_request_optional_data.py | 81 + .../models/create_order_cross_response.py | 81 + .../models/create_order_request.py | 324 + .../models/create_order_request_algo.py | 81 + .../create_order_request_market_condition.py | 81 + .../create_order_request_optional_data.py | 81 + .../models/create_order_response.py | 81 + .../openapi_package/models/cross_side_type.py | 10 + .../openapi_package/models/cross_type.py | 20 + .../openapi_package/models/crypto.py | 290 + .../openapi_package/models/crypto_aliases.py | 81 + .../openapi_package/models/currency.py | 180 + .../models/cxl_rej_response_to.py | 14 + .../openapi_package/models/date.py | 62 + .../models/easy_to_borrow_security.py | 53 + .../openapi_package/models/empty.py | 27 + .../openapi_package/models/exchange.py | 161 + .../openapi_package/models/exchange_code.py | 72 + .../openapi_package/models/exec_type.py | 30 + .../openapi_package/models/execution.py | 638 ++ .../openapi_package/models/execution_algo.py | 81 + .../models/execution_optional_data.py | 81 + .../openapi_package/models/flex_option.py | 446 + .../models/flex_option_aliases.py | 81 + .../models/flex_settlement_type.py | 12 + .../openapi_package/models/future.py | 364 + .../openapi_package/models/future_aliases.py | 81 + .../openapi_package/models/future_root.py | 364 + .../models/future_root_aliases.py | 81 + .../openapi_package/models/future_spread.py | 385 + .../models/future_spread_aliases.py | 81 + .../models/future_spread_leg.py | 116 + openapi_project/openapi_package/models/fx.py | 290 + .../openapi_package/models/fx_aliases.py | 81 + .../openapi_package/models/generic_order.py | 106 + .../models/get_active_user_response.py | 81 + .../models/get_server_info_response.py | 139 + ...et_server_info_response_system_settings.py | 81 + .../models/get_server_time_response.py | 70 + .../models/get_trading_holidays_response.py | 84 + .../openapi_package/models/header.py | 107 + .../openapi_package/models/index.py | 274 + .../openapi_package/models/index_aliases.py | 81 + .../models/list_accounts_response.py | 84 + .../list_affiliated_trading_firms_response.py | 86 + .../list_easy_to_borrow_securities_request.py | 53 + ...list_easy_to_borrow_securities_response.py | 84 + .../models/list_exchanges_response.py | 84 + .../models/list_option_chains_repsonse.py | 84 + .../models/list_option_chains_request.py | 47 + .../models/list_orders_response.py | 84 + .../models/list_positions_response.py | 84 + .../models/list_routes_response.py | 106 + .../models/list_securities_request.py | 47 + .../models/list_securities_response.py | 84 + .../models/list_trade_confirms_response.py | 84 + .../models/list_trading_firms_response.py | 84 + .../openapi_package/models/login_request.py | 80 + .../openapi_package/models/login_response.py | 205 + .../models/login_response_system_settings.py | 81 + .../openapi_package/models/login_status.py | 19 + .../openapi_package/models/margin_data.py | 81 + .../models/margin_data_type.py | 10 + .../openapi_package/models/multi_leg_order.py | 538 ++ .../models/multi_leg_order_algo.py | 81 + .../multi_leg_order_cancel_replace_request.py | 366 + ...i_leg_order_cancel_replace_request_algo.py | 81 + ...cancel_replace_request_market_condition.py | 81 + ...er_cancel_replace_request_optional_data.py | 81 + .../models/multi_leg_order_cross.py | 474 + .../models/multi_leg_order_cross_algo.py | 81 + .../multi_leg_order_cross_allocation.py | 258 + ...eg_order_cross_allocation_optional_data.py | 81 + .../multi_leg_order_cross_market_condition.py | 81 + .../multi_leg_order_cross_optional_data.py | 81 + .../models/multi_leg_order_leg.py | 255 + .../multi_leg_order_leg_market_condition.py | 81 + .../multi_leg_order_leg_optional_data.py | 81 + .../multi_leg_order_market_condition.py | 81 + .../models/multi_leg_order_optional_data.py | 81 + .../models/multi_leg_reporting_type.py | 10 + .../models/numeric_display_format.py | 32 + .../openapi_package/models/option.py | 391 + .../openapi_package/models/option_aliases.py | 81 + .../openapi_package/models/option_chain.py | 127 + .../models/option_chain_option.py | 220 + .../models/option_chain_option_aliases.py | 81 + .../models/option_chain_options.py | 79 + .../models/option_chain_roots.py | 79 + .../models/option_exercise_style.py | 11 + .../models/option_expiration_style.py | 19 + .../openapi_package/models/option_root.py | 417 + .../models/option_root_aliases.py | 81 + .../openapi_package/models/option_series.py | 229 + .../models/option_series_product_type.py | 9 + .../models/option_series_type.py | 13 + .../models/option_settlement_type.py | 12 + .../openapi_package/models/ord_status.py | 30 + .../openapi_package/models/ord_type.py | 14 + .../openapi_package/models/order.py | 578 ++ .../openapi_package/models/order_algo.py | 81 + .../models/order_cancel_reject.py | 187 + .../order_cancel_reject_optional_data.py | 81 + .../models/order_cancel_replace_request.py | 344 + .../order_cancel_replace_request_algo.py | 81 + ...cancel_replace_request_market_condition.py | 81 + ...er_cancel_replace_request_optional_data.py | 81 + .../models/order_cancel_request.py | 175 + .../order_cancel_request_optional_data.py | 81 + .../openapi_package/models/order_cross.py | 492 + .../models/order_cross_algo.py | 81 + .../models/order_cross_allocation.py | 261 + .../order_cross_allocation_optional_data.py | 81 + .../models/order_cross_market_condition.py | 81 + .../models/order_cross_optional_data.py | 81 + .../openapi_package/models/order_delete.py | 108 + .../models/order_delete_optional_data.py | 81 + .../models/order_instruction.py | 61 + .../models/order_instruction_type.py | 91 + .../models/order_market_condition.py | 81 + .../models/order_optional_data.py | 81 + .../openapi_package/models/order_type.py | 12 + .../openapi_package/models/order_update.py | 620 ++ .../models/order_update_algo.py | 81 + .../models/order_update_event.py | 175 + .../models/order_update_optional_data.py | 81 + .../models/origination_type.py | 39 + .../openapi_package/models/position.py | 197 + .../models/position_analysis.py | 75 + .../openapi_package/models/position_effect.py | 11 + .../openapi_package/models/position_source.py | 9 + .../openapi_package/models/position_theo.py | 208 + .../models/position_theo_leg.py | 159 + .../openapi_package/models/price_type.py | 14 + .../openapi_package/models/product_group.py | 19 + .../models/product_sub_group.py | 8 + .../openapi_package/models/put_call.py | 10 + .../models/risk_calculation_type.py | 11 + .../openapi_package/models/risk_eval_mode.py | 9 + .../models/risk_radar_account_group.py | 115 + .../models/risk_radar_class_group.py | 179 + .../openapi_package/models/risk_radar_data.py | 69 + .../models/risk_radar_position.py | 184 + .../models/risk_radar_product_group.py | 105 + .../models/risk_radar_request.py | 194 + .../models/risk_radar_request_position.py | 62 + .../risk_radar_request_position_list.py | 67 + .../models/risk_radar_response.py | 81 + .../models/risk_radar_scenario_order.py | 9 + .../openapi_package/models/risk_reject.py | 141 + .../models/risk_reject_type.py | 120 + .../openapi_package/models/route.py | 180 + .../models/route_applicability.py | 125 + .../openapi_package/models/route_property.py | 70 + .../models/route_property_type.py | 19 + .../openapi_package/models/route_type.py | 16 + .../models/routing_session_group.py | 70 + .../models/routing_session_group_type.py | 15 + .../openapi_package/models/scenario.py | 84 + .../openapi_package/models/scenario_leg.py | 116 + .../models/scenario_position.py | 116 + .../openapi_package/models/scenario_theo.py | 76 + .../models/search_order_history_response.py | 84 + .../openapi_package/models/security.py | 208 + .../models/security_category.py | 39 + .../openapi_package/models/security_type.py | 19 + .../models/settlement_deliverable_type.py | 11 + .../openapi_package/models/settlement_info.py | 70 + .../openapi_package/models/shock_value.py | 100 + .../models/shock_value_flags.py | 62 + .../openapi_package/models/side.py | 13 + .../openapi_package/models/spread_leg_side.py | 10 + .../openapi_package/models/spread_leg_type.py | 10 + .../openapi_package/models/status.py | 76 + .../openapi_package/models/status_code.py | 19 + .../openapi_package/models/stock.py | 310 + .../openapi_package/models/stock_aliases.py | 81 + openapi_project/openapi_package/models/tif.py | 17 + .../openapi_package/models/time_of_day.py | 71 + .../models/tims_class_group.py | 204 + .../models/tims_margin_data.py | 221 + .../models/tims_position_group.py | 164 + .../models/tims_product_group.py | 182 + .../openapi_package/models/trade_confirm.py | 937 ++ .../openapi_package/models/trading_firm.py | 71 + .../models/trading_firm_slim.py | 53 + .../openapi_package/models/trading_holiday.py | 99 + .../openapi_package/models/trading_session.py | 107 + .../models/trading_session_group.py | 76 + .../openapi_package/models/user.py | 244 + .../openapi_package/models/user_location.py | 10 + .../openapi_package/models/user_permission.py | 70 + .../openapi_package/models/user_status.py | 12 + .../openapi_package/models/user_type.py | 10 + .../models/validate_risk_response.py | 93 + .../models/volatility_shock_skew.py | 9 + .../models/volatility_shock_type.py | 9 + openapi_project/openapi_package/py.typed | 1 + openapi_project/openapi_package/types.py | 55 + openapi_project/pyproject.toml | 0 openapi_python_client/__init__.py | 101 +- openapi_python_client/cli.py | 39 +- openapi_python_client/parser/bodies.py | 17 +- openapi_python_client/parser/errors.py | 8 +- openapi_python_client/parser/openapi.py | 153 +- .../parser/properties/__init__.py | 75 +- .../parser/properties/date.py | 8 +- .../parser/properties/datetime.py | 8 +- .../parser/properties/enum_property.py | 60 +- .../parser/properties/file.py | 4 +- .../parser/properties/list_property.py | 6 +- .../properties/literal_enum_property.py | 60 +- .../parser/properties/merge_properties.py | 78 +- .../parser/properties/model_property.py | 77 +- .../parser/properties/protocol.py | 37 +- .../parser/properties/schemas.py | 49 +- .../parser/properties/string.py | 4 +- .../parser/properties/union.py | 47 +- openapi_python_client/parser/responses.py | 42 +- .../openapi_schema_pydantic/components.py | 24 +- .../schema/openapi_schema_pydantic/contact.py | 6 +- .../schema/openapi_schema_pydantic/example.py | 5 +- .../external_documentation.py | 6 +- .../schema/openapi_schema_pydantic/header.py | 5 +- .../schema/openapi_schema_pydantic/info.py | 5 +- .../schema/openapi_schema_pydantic/license.py | 7 +- .../schema/openapi_schema_pydantic/link.py | 5 +- .../openapi_schema_pydantic/media_type.py | 4 +- .../openapi_schema_pydantic/oauth_flow.py | 10 +- .../openapi_schema_pydantic/parameter.py | 15 +- .../openapi_schema_pydantic/path_item.py | 17 +- .../openapi_schema_pydantic/reference.py | 9 +- .../openapi_schema_pydantic/request_body.py | 6 +- .../openapi_schema_pydantic/response.py | 16 +- .../schema/openapi_schema_pydantic/schema.py | 15 +- .../security_scheme.py | 5 +- .../schema/openapi_schema_pydantic/server.py | 5 +- .../schema/openapi_schema_pydantic/tag.py | 5 +- .../templates/.gitignore.jinja | 3 + .../templates/client.py.jinja | 10 +- .../templates/endpoint_macros.py.jinja | 8 +- .../templates/endpoint_module.py.jinja | 10 +- .../templates/model.py.jinja | 32 +- .../templates/pyproject.toml.jinja | 4 + .../templates/types.py.jinja | 18 +- openapi_python_client/utils.py | 8 +- pyproject.toml | 143 +- tests/conftest.py | 12 +- tests/test___init__.py | 20 +- tests/test_cli.py | 8 +- tests/test_parser/test_bodies.py | 6 +- tests/test_parser/test_openapi.py | 194 +- .../test_parser/test_properties/test_init.py | 268 +- .../test_properties/test_merge_properties.py | 65 +- .../test_properties/test_model_property.py | 363 +- .../test_properties/test_protocol.py | 21 +- .../test_properties/test_schemas.py | 48 +- .../test_parser/test_properties/test_union.py | 27 +- tests/test_parser/test_responses.py | 62 +- tests/test_schema/test_noisy_refs.py | 9 +- tests/test_schema/test_open_api.py | 10 +- tests/test_schema/test_schema.py | 25 +- tests/test_templates/conftest.py | 6 +- .../test_date_property/required_not_null.py | 3 +- .../test_date_property/test_date_property.py | 10 +- .../required_not_null.py | 3 +- .../test_datetime_property.py | 10 +- tests/test_utils.py | 13 +- 787 files changed, 81731 insertions(+), 1209 deletions(-) create mode 100644 openapi/README_internal.md create mode 100644 openapi/class_overrides.yaml create mode 100644 openapi/openapi_project/README.md create mode 100644 openapi/openapi_project/openapi_package/__init__.py create mode 100644 openapi/openapi_project/openapi_package/api/__init__.py create mode 100644 openapi/openapi_project/openapi_package/api/application_service/__init__.py create mode 100644 openapi/openapi_project/openapi_package/api/application_service/post_application_login.py create mode 100644 openapi/openapi_project/openapi_package/api/order_service/__init__.py create mode 100644 openapi/openapi_project/openapi_package/api/order_service/get_orders.py create mode 100644 openapi/openapi_project/openapi_package/api/order_service/get_orders_searchhistory.py create mode 100644 openapi/openapi_project/openapi_package/api/order_service/get_orders_tradeconfirms.py create mode 100644 openapi/openapi_project/openapi_package/api/order_service/post_orders_cancelorder.py create mode 100644 openapi/openapi_project/openapi_package/api/order_service/post_orders_createmultilegorder.py create mode 100644 openapi/openapi_project/openapi_package/api/order_service/post_orders_createmultilegordercross.py create mode 100644 openapi/openapi_project/openapi_package/api/order_service/post_orders_createorder.py create mode 100644 openapi/openapi_project/openapi_package/api/order_service/post_orders_createordercross.py create mode 100644 openapi/openapi_project/openapi_package/api/order_service/post_orders_replacemultilegorder.py create mode 100644 openapi/openapi_project/openapi_package/api/order_service/post_orders_replaceorder.py create mode 100644 openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegorder.py create mode 100644 openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegordercross.py create mode 100644 openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createorder.py create mode 100644 openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createordercross.py create mode 100644 openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replacemultilegorder.py create mode 100644 openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replaceorder.py create mode 100644 openapi/openapi_project/openapi_package/api/portfolio_service/__init__.py create mode 100644 openapi/openapi_project/openapi_package/api/portfolio_service/get_portfolio_positions.py create mode 100644 openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_analyzepositions.py create mode 100644 openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_calculatemargins.py create mode 100644 openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_riskradar.py create mode 100644 openapi/openapi_project/openapi_package/api/security_service/__init__.py create mode 100644 openapi/openapi_project/openapi_package/api/security_service/get_securities_exchanges.py create mode 100644 openapi/openapi_project/openapi_package/api/security_service/post_securities_easytoborrowsecurities.py create mode 100644 openapi/openapi_project/openapi_package/api/security_service/post_securities_flexoption.py create mode 100644 openapi/openapi_project/openapi_package/api/security_service/post_securities_optionchains.py create mode 100644 openapi/openapi_project/openapi_package/api/security_service/post_securities_securities.py create mode 100644 openapi/openapi_project/openapi_package/api/user_data_service/__init__.py create mode 100644 openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_accounts.py create mode 100644 openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_activeuser.py create mode 100644 openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_affiliatedtradingfirms.py create mode 100644 openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_p2paccounts.py create mode 100644 openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_routes.py create mode 100644 openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_tradingfirms.py create mode 100644 openapi/openapi_project/openapi_package/api/utility_service/__init__.py create mode 100644 openapi/openapi_project/openapi_package/api/utility_service/get_utility_serverinfo.py create mode 100644 openapi/openapi_project/openapi_package/api/utility_service/get_utility_servertime.py create mode 100644 openapi/openapi_project/openapi_package/api/utility_service/get_utility_tradingholidays.py create mode 100644 openapi/openapi_project/openapi_package/client.py create mode 100644 openapi/openapi_project/openapi_package/errors.py create mode 100644 openapi/openapi_project/openapi_package/models/__init__.py create mode 100644 openapi/openapi_project/openapi_package/models/account.py create mode 100644 openapi/openapi_project/openapi_package/models/account_script.py create mode 100644 openapi/openapi_project/openapi_package/models/account_status.py create mode 100644 openapi/openapi_project/openapi_package/models/account_type.py create mode 100644 openapi/openapi_project/openapi_package/models/analyze_position_item.py create mode 100644 openapi/openapi_project/openapi_package/models/analyze_positions_request.py create mode 100644 openapi/openapi_project/openapi_package/models/analyze_positions_response.py create mode 100644 openapi/openapi_project/openapi_package/models/any_model.py create mode 100644 openapi/openapi_project/openapi_package/models/calculate_margin_request.py create mode 100644 openapi/openapi_project/openapi_package/models/calculate_margin_request_position.py create mode 100644 openapi/openapi_project/openapi_package/models/calculate_margin_request_position_list.py create mode 100644 openapi/openapi_project/openapi_package/models/calculate_margin_response.py create mode 100644 openapi/openapi_project/openapi_package/models/cancel_order_request.py create mode 100644 openapi/openapi_project/openapi_package/models/cancel_order_request_optional_data.py create mode 100644 openapi/openapi_project/openapi_package/models/cancel_order_response.py create mode 100644 openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py create mode 100644 openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py create mode 100644 openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py create mode 100644 openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py create mode 100644 openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py create mode 100644 openapi/openapi_project/openapi_package/models/cancel_replace_order_request.py create mode 100644 openapi/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py create mode 100644 openapi/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py create mode 100644 openapi/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py create mode 100644 openapi/openapi_project/openapi_package/models/cancel_replace_order_response.py create mode 100644 openapi/openapi_project/openapi_package/models/capacity_code.py create mode 100644 openapi/openapi_project/openapi_package/models/claim_type.py create mode 100644 openapi/openapi_project/openapi_package/models/clearing_info.py create mode 100644 openapi/openapi_project/openapi_package/models/clearing_range.py create mode 100644 openapi/openapi_project/openapi_package/models/country.py create mode 100644 openapi/openapi_project/openapi_package/models/create_flex_option_request.py create mode 100644 openapi/openapi_project/openapi_package/models/create_flex_option_response.py create mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py create mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py create mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py create mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py create mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py create mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py create mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py create mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_leg.py create mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py create mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py create mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_request.py create mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py create mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py create mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py create mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_response.py create mode 100644 openapi/openapi_project/openapi_package/models/create_order_cross_allocation.py create mode 100644 openapi/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py create mode 100644 openapi/openapi_project/openapi_package/models/create_order_cross_request.py create mode 100644 openapi/openapi_project/openapi_package/models/create_order_cross_request_algo.py create mode 100644 openapi/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py create mode 100644 openapi/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py create mode 100644 openapi/openapi_project/openapi_package/models/create_order_cross_response.py create mode 100644 openapi/openapi_project/openapi_package/models/create_order_request.py create mode 100644 openapi/openapi_project/openapi_package/models/create_order_request_algo.py create mode 100644 openapi/openapi_project/openapi_package/models/create_order_request_market_condition.py create mode 100644 openapi/openapi_project/openapi_package/models/create_order_request_optional_data.py create mode 100644 openapi/openapi_project/openapi_package/models/create_order_response.py create mode 100644 openapi/openapi_project/openapi_package/models/cross_side_type.py create mode 100644 openapi/openapi_project/openapi_package/models/cross_type.py create mode 100644 openapi/openapi_project/openapi_package/models/crypto.py create mode 100644 openapi/openapi_project/openapi_package/models/crypto_aliases.py create mode 100644 openapi/openapi_project/openapi_package/models/currency.py create mode 100644 openapi/openapi_project/openapi_package/models/cxl_rej_response_to.py create mode 100644 openapi/openapi_project/openapi_package/models/date.py create mode 100644 openapi/openapi_project/openapi_package/models/easy_to_borrow_security.py create mode 100644 openapi/openapi_project/openapi_package/models/empty.py create mode 100644 openapi/openapi_project/openapi_package/models/exchange.py create mode 100644 openapi/openapi_project/openapi_package/models/exchange_code.py create mode 100644 openapi/openapi_project/openapi_package/models/exec_type.py create mode 100644 openapi/openapi_project/openapi_package/models/execution.py create mode 100644 openapi/openapi_project/openapi_package/models/execution_algo.py create mode 100644 openapi/openapi_project/openapi_package/models/execution_optional_data.py create mode 100644 openapi/openapi_project/openapi_package/models/flex_option.py create mode 100644 openapi/openapi_project/openapi_package/models/flex_option_aliases.py create mode 100644 openapi/openapi_project/openapi_package/models/flex_settlement_type.py create mode 100644 openapi/openapi_project/openapi_package/models/future.py create mode 100644 openapi/openapi_project/openapi_package/models/future_aliases.py create mode 100644 openapi/openapi_project/openapi_package/models/future_root.py create mode 100644 openapi/openapi_project/openapi_package/models/future_root_aliases.py create mode 100644 openapi/openapi_project/openapi_package/models/future_spread.py create mode 100644 openapi/openapi_project/openapi_package/models/future_spread_aliases.py create mode 100644 openapi/openapi_project/openapi_package/models/future_spread_leg.py create mode 100644 openapi/openapi_project/openapi_package/models/fx.py create mode 100644 openapi/openapi_project/openapi_package/models/fx_aliases.py create mode 100644 openapi/openapi_project/openapi_package/models/generic_order.py create mode 100644 openapi/openapi_project/openapi_package/models/get_active_user_response.py create mode 100644 openapi/openapi_project/openapi_package/models/get_server_info_response.py create mode 100644 openapi/openapi_project/openapi_package/models/get_server_info_response_system_settings.py create mode 100644 openapi/openapi_project/openapi_package/models/get_server_time_response.py create mode 100644 openapi/openapi_project/openapi_package/models/get_trading_holidays_response.py create mode 100644 openapi/openapi_project/openapi_package/models/header.py create mode 100644 openapi/openapi_project/openapi_package/models/index.py create mode 100644 openapi/openapi_project/openapi_package/models/index_aliases.py create mode 100644 openapi/openapi_project/openapi_package/models/list_accounts_response.py create mode 100644 openapi/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py create mode 100644 openapi/openapi_project/openapi_package/models/list_easy_to_borrow_securities_request.py create mode 100644 openapi/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py create mode 100644 openapi/openapi_project/openapi_package/models/list_exchanges_response.py create mode 100644 openapi/openapi_project/openapi_package/models/list_option_chains_repsonse.py create mode 100644 openapi/openapi_project/openapi_package/models/list_option_chains_request.py create mode 100644 openapi/openapi_project/openapi_package/models/list_orders_response.py create mode 100644 openapi/openapi_project/openapi_package/models/list_positions_response.py create mode 100644 openapi/openapi_project/openapi_package/models/list_routes_response.py create mode 100644 openapi/openapi_project/openapi_package/models/list_securities_request.py create mode 100644 openapi/openapi_project/openapi_package/models/list_securities_response.py create mode 100644 openapi/openapi_project/openapi_package/models/list_trade_confirms_response.py create mode 100644 openapi/openapi_project/openapi_package/models/list_trading_firms_response.py create mode 100644 openapi/openapi_project/openapi_package/models/login_request.py create mode 100644 openapi/openapi_project/openapi_package/models/login_response.py create mode 100644 openapi/openapi_project/openapi_package/models/login_response_system_settings.py create mode 100644 openapi/openapi_project/openapi_package/models/login_status.py create mode 100644 openapi/openapi_project/openapi_package/models/margin_data.py create mode 100644 openapi/openapi_project/openapi_package/models/margin_data_type.py create mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order.py create mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_algo.py create mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py create mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py create mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py create mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py create mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_cross.py create mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py create mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py create mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py create mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py create mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py create mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_leg.py create mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py create mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py create mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_market_condition.py create mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_optional_data.py create mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_reporting_type.py create mode 100644 openapi/openapi_project/openapi_package/models/numeric_display_format.py create mode 100644 openapi/openapi_project/openapi_package/models/option.py create mode 100644 openapi/openapi_project/openapi_package/models/option_aliases.py create mode 100644 openapi/openapi_project/openapi_package/models/option_chain.py create mode 100644 openapi/openapi_project/openapi_package/models/option_chain_option.py create mode 100644 openapi/openapi_project/openapi_package/models/option_chain_option_aliases.py create mode 100644 openapi/openapi_project/openapi_package/models/option_chain_options.py create mode 100644 openapi/openapi_project/openapi_package/models/option_chain_roots.py create mode 100644 openapi/openapi_project/openapi_package/models/option_exercise_style.py create mode 100644 openapi/openapi_project/openapi_package/models/option_expiration_style.py create mode 100644 openapi/openapi_project/openapi_package/models/option_root.py create mode 100644 openapi/openapi_project/openapi_package/models/option_root_aliases.py create mode 100644 openapi/openapi_project/openapi_package/models/option_series.py create mode 100644 openapi/openapi_project/openapi_package/models/option_series_product_type.py create mode 100644 openapi/openapi_project/openapi_package/models/option_series_type.py create mode 100644 openapi/openapi_project/openapi_package/models/option_settlement_type.py create mode 100644 openapi/openapi_project/openapi_package/models/ord_status.py create mode 100644 openapi/openapi_project/openapi_package/models/ord_type.py create mode 100644 openapi/openapi_project/openapi_package/models/order.py create mode 100644 openapi/openapi_project/openapi_package/models/order_algo.py create mode 100644 openapi/openapi_project/openapi_package/models/order_cancel_reject.py create mode 100644 openapi/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py create mode 100644 openapi/openapi_project/openapi_package/models/order_cancel_replace_request.py create mode 100644 openapi/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py create mode 100644 openapi/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py create mode 100644 openapi/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py create mode 100644 openapi/openapi_project/openapi_package/models/order_cancel_request.py create mode 100644 openapi/openapi_project/openapi_package/models/order_cancel_request_optional_data.py create mode 100644 openapi/openapi_project/openapi_package/models/order_cross.py create mode 100644 openapi/openapi_project/openapi_package/models/order_cross_algo.py create mode 100644 openapi/openapi_project/openapi_package/models/order_cross_allocation.py create mode 100644 openapi/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py create mode 100644 openapi/openapi_project/openapi_package/models/order_cross_market_condition.py create mode 100644 openapi/openapi_project/openapi_package/models/order_cross_optional_data.py create mode 100644 openapi/openapi_project/openapi_package/models/order_delete.py create mode 100644 openapi/openapi_project/openapi_package/models/order_delete_optional_data.py create mode 100644 openapi/openapi_project/openapi_package/models/order_instruction.py create mode 100644 openapi/openapi_project/openapi_package/models/order_instruction_type.py create mode 100644 openapi/openapi_project/openapi_package/models/order_market_condition.py create mode 100644 openapi/openapi_project/openapi_package/models/order_optional_data.py create mode 100644 openapi/openapi_project/openapi_package/models/order_type.py create mode 100644 openapi/openapi_project/openapi_package/models/order_update.py create mode 100644 openapi/openapi_project/openapi_package/models/order_update_algo.py create mode 100644 openapi/openapi_project/openapi_package/models/order_update_event.py create mode 100644 openapi/openapi_project/openapi_package/models/order_update_optional_data.py create mode 100644 openapi/openapi_project/openapi_package/models/origination_type.py create mode 100644 openapi/openapi_project/openapi_package/models/position.py create mode 100644 openapi/openapi_project/openapi_package/models/position_analysis.py create mode 100644 openapi/openapi_project/openapi_package/models/position_effect.py create mode 100644 openapi/openapi_project/openapi_package/models/position_source.py create mode 100644 openapi/openapi_project/openapi_package/models/position_theo.py create mode 100644 openapi/openapi_project/openapi_package/models/position_theo_leg.py create mode 100644 openapi/openapi_project/openapi_package/models/price_type.py create mode 100644 openapi/openapi_project/openapi_package/models/product_group.py create mode 100644 openapi/openapi_project/openapi_package/models/product_sub_group.py create mode 100644 openapi/openapi_project/openapi_package/models/put_call.py create mode 100644 openapi/openapi_project/openapi_package/models/risk_calculation_type.py create mode 100644 openapi/openapi_project/openapi_package/models/risk_eval_mode.py create mode 100644 openapi/openapi_project/openapi_package/models/risk_radar_account_group.py create mode 100644 openapi/openapi_project/openapi_package/models/risk_radar_class_group.py create mode 100644 openapi/openapi_project/openapi_package/models/risk_radar_data.py create mode 100644 openapi/openapi_project/openapi_package/models/risk_radar_position.py create mode 100644 openapi/openapi_project/openapi_package/models/risk_radar_product_group.py create mode 100644 openapi/openapi_project/openapi_package/models/risk_radar_request.py create mode 100644 openapi/openapi_project/openapi_package/models/risk_radar_request_position.py create mode 100644 openapi/openapi_project/openapi_package/models/risk_radar_request_position_list.py create mode 100644 openapi/openapi_project/openapi_package/models/risk_radar_response.py create mode 100644 openapi/openapi_project/openapi_package/models/risk_radar_scenario_order.py create mode 100644 openapi/openapi_project/openapi_package/models/risk_reject.py create mode 100644 openapi/openapi_project/openapi_package/models/risk_reject_type.py create mode 100644 openapi/openapi_project/openapi_package/models/route.py create mode 100644 openapi/openapi_project/openapi_package/models/route_applicability.py create mode 100644 openapi/openapi_project/openapi_package/models/route_property.py create mode 100644 openapi/openapi_project/openapi_package/models/route_property_type.py create mode 100644 openapi/openapi_project/openapi_package/models/route_type.py create mode 100644 openapi/openapi_project/openapi_package/models/routing_session_group.py create mode 100644 openapi/openapi_project/openapi_package/models/routing_session_group_type.py create mode 100644 openapi/openapi_project/openapi_package/models/scenario.py create mode 100644 openapi/openapi_project/openapi_package/models/scenario_leg.py create mode 100644 openapi/openapi_project/openapi_package/models/scenario_position.py create mode 100644 openapi/openapi_project/openapi_package/models/scenario_theo.py create mode 100644 openapi/openapi_project/openapi_package/models/search_order_history_response.py create mode 100644 openapi/openapi_project/openapi_package/models/security.py create mode 100644 openapi/openapi_project/openapi_package/models/security_category.py create mode 100644 openapi/openapi_project/openapi_package/models/security_type.py create mode 100644 openapi/openapi_project/openapi_package/models/settlement_deliverable_type.py create mode 100644 openapi/openapi_project/openapi_package/models/settlement_info.py create mode 100644 openapi/openapi_project/openapi_package/models/shock_value.py create mode 100644 openapi/openapi_project/openapi_package/models/shock_value_flags.py create mode 100644 openapi/openapi_project/openapi_package/models/side.py create mode 100644 openapi/openapi_project/openapi_package/models/spread_leg_side.py create mode 100644 openapi/openapi_project/openapi_package/models/spread_leg_type.py create mode 100644 openapi/openapi_project/openapi_package/models/status.py create mode 100644 openapi/openapi_project/openapi_package/models/status_code.py create mode 100644 openapi/openapi_project/openapi_package/models/stock.py create mode 100644 openapi/openapi_project/openapi_package/models/stock_aliases.py create mode 100644 openapi/openapi_project/openapi_package/models/tif.py create mode 100644 openapi/openapi_project/openapi_package/models/time_of_day.py create mode 100644 openapi/openapi_project/openapi_package/models/tims_class_group.py create mode 100644 openapi/openapi_project/openapi_package/models/tims_margin_data.py create mode 100644 openapi/openapi_project/openapi_package/models/tims_position_group.py create mode 100644 openapi/openapi_project/openapi_package/models/tims_product_group.py create mode 100644 openapi/openapi_project/openapi_package/models/trade_confirm.py create mode 100644 openapi/openapi_project/openapi_package/models/trading_firm.py create mode 100644 openapi/openapi_project/openapi_package/models/trading_firm_slim.py create mode 100644 openapi/openapi_project/openapi_package/models/trading_holiday.py create mode 100644 openapi/openapi_project/openapi_package/models/trading_session.py create mode 100644 openapi/openapi_project/openapi_package/models/trading_session_group.py create mode 100644 openapi/openapi_project/openapi_package/models/user.py create mode 100644 openapi/openapi_project/openapi_package/models/user_location.py create mode 100644 openapi/openapi_project/openapi_package/models/user_permission.py create mode 100644 openapi/openapi_project/openapi_package/models/user_status.py create mode 100644 openapi/openapi_project/openapi_package/models/user_type.py create mode 100644 openapi/openapi_project/openapi_package/models/validate_risk_response.py create mode 100644 openapi/openapi_project/openapi_package/models/volatility_shock_skew.py create mode 100644 openapi/openapi_project/openapi_package/models/volatility_shock_type.py create mode 100644 openapi/openapi_project/openapi_package/py.typed create mode 100644 openapi/openapi_project/openapi_package/types.py create mode 100644 openapi/swagger_cleaned.json create mode 100644 openapi/templates/api_init.py.jinja create mode 100644 openapi/templates/client.py.jinja create mode 100644 openapi/templates/endpoint_init.py.jinja create mode 100644 openapi/templates/endpoint_macros.py.jinja create mode 100644 openapi/templates/endpoint_module.py.jinja create mode 100644 openapi/templates/model.py.jinja create mode 100644 openapi/templates/models_init.py.jinja create mode 100644 openapi/templates/package_init.py.jinja create mode 100644 openapi/templates/types.py.jinja create mode 100644 openapi_project/.gitignore create mode 100644 openapi_project/README.md create mode 100644 openapi_project/openapi_package/__init__.py create mode 100644 openapi_project/openapi_package/api/__init__.py create mode 100644 openapi_project/openapi_package/api/application_service/__init__.py create mode 100644 openapi_project/openapi_package/api/application_service/post_application_login.py create mode 100644 openapi_project/openapi_package/api/order_service/__init__.py create mode 100644 openapi_project/openapi_package/api/order_service/get_orders.py create mode 100644 openapi_project/openapi_package/api/order_service/get_orders_searchhistory.py create mode 100644 openapi_project/openapi_package/api/order_service/get_orders_tradeconfirms.py create mode 100644 openapi_project/openapi_package/api/order_service/post_orders_cancelorder.py create mode 100644 openapi_project/openapi_package/api/order_service/post_orders_createmultilegorder.py create mode 100644 openapi_project/openapi_package/api/order_service/post_orders_createmultilegordercross.py create mode 100644 openapi_project/openapi_package/api/order_service/post_orders_createorder.py create mode 100644 openapi_project/openapi_package/api/order_service/post_orders_createordercross.py create mode 100644 openapi_project/openapi_package/api/order_service/post_orders_replacemultilegorder.py create mode 100644 openapi_project/openapi_package/api/order_service/post_orders_replaceorder.py create mode 100644 openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegorder.py create mode 100644 openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegordercross.py create mode 100644 openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createorder.py create mode 100644 openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createordercross.py create mode 100644 openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replacemultilegorder.py create mode 100644 openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replaceorder.py create mode 100644 openapi_project/openapi_package/api/portfolio_service/__init__.py create mode 100644 openapi_project/openapi_package/api/portfolio_service/get_portfolio_positions.py create mode 100644 openapi_project/openapi_package/api/portfolio_service/post_portfolio_analyzepositions.py create mode 100644 openapi_project/openapi_package/api/portfolio_service/post_portfolio_calculatemargins.py create mode 100644 openapi_project/openapi_package/api/portfolio_service/post_portfolio_riskradar.py create mode 100644 openapi_project/openapi_package/api/security_service/__init__.py create mode 100644 openapi_project/openapi_package/api/security_service/get_securities_exchanges.py create mode 100644 openapi_project/openapi_package/api/security_service/post_securities_easytoborrowsecurities.py create mode 100644 openapi_project/openapi_package/api/security_service/post_securities_flexoption.py create mode 100644 openapi_project/openapi_package/api/security_service/post_securities_optionchains.py create mode 100644 openapi_project/openapi_package/api/security_service/post_securities_securities.py create mode 100644 openapi_project/openapi_package/api/user_data_service/__init__.py create mode 100644 openapi_project/openapi_package/api/user_data_service/get_userdata_accounts.py create mode 100644 openapi_project/openapi_package/api/user_data_service/get_userdata_activeuser.py create mode 100644 openapi_project/openapi_package/api/user_data_service/get_userdata_affiliatedtradingfirms.py create mode 100644 openapi_project/openapi_package/api/user_data_service/get_userdata_p2paccounts.py create mode 100644 openapi_project/openapi_package/api/user_data_service/get_userdata_routes.py create mode 100644 openapi_project/openapi_package/api/user_data_service/get_userdata_tradingfirms.py create mode 100644 openapi_project/openapi_package/api/utility_service/__init__.py create mode 100644 openapi_project/openapi_package/api/utility_service/get_utility_serverinfo.py create mode 100644 openapi_project/openapi_package/api/utility_service/get_utility_servertime.py create mode 100644 openapi_project/openapi_package/api/utility_service/get_utility_tradingholidays.py create mode 100644 openapi_project/openapi_package/client.py create mode 100644 openapi_project/openapi_package/errors.py create mode 100644 openapi_project/openapi_package/models/__init__.py create mode 100644 openapi_project/openapi_package/models/account.py create mode 100644 openapi_project/openapi_package/models/account_script.py create mode 100644 openapi_project/openapi_package/models/account_status.py create mode 100644 openapi_project/openapi_package/models/account_type.py create mode 100644 openapi_project/openapi_package/models/analyze_position_item.py create mode 100644 openapi_project/openapi_package/models/analyze_positions_request.py create mode 100644 openapi_project/openapi_package/models/analyze_positions_response.py create mode 100644 openapi_project/openapi_package/models/any_model.py create mode 100644 openapi_project/openapi_package/models/calculate_margin_request.py create mode 100644 openapi_project/openapi_package/models/calculate_margin_request_position.py create mode 100644 openapi_project/openapi_package/models/calculate_margin_request_position_list.py create mode 100644 openapi_project/openapi_package/models/calculate_margin_response.py create mode 100644 openapi_project/openapi_package/models/cancel_order_request.py create mode 100644 openapi_project/openapi_package/models/cancel_order_request_optional_data.py create mode 100644 openapi_project/openapi_package/models/cancel_order_response.py create mode 100644 openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py create mode 100644 openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py create mode 100644 openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py create mode 100644 openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py create mode 100644 openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py create mode 100644 openapi_project/openapi_package/models/cancel_replace_order_request.py create mode 100644 openapi_project/openapi_package/models/cancel_replace_order_request_algo.py create mode 100644 openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py create mode 100644 openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py create mode 100644 openapi_project/openapi_package/models/cancel_replace_order_response.py create mode 100644 openapi_project/openapi_package/models/capacity_code.py create mode 100644 openapi_project/openapi_package/models/claim_type.py create mode 100644 openapi_project/openapi_package/models/clearing_info.py create mode 100644 openapi_project/openapi_package/models/clearing_range.py create mode 100644 openapi_project/openapi_package/models/country.py create mode 100644 openapi_project/openapi_package/models/create_flex_option_request.py create mode 100644 openapi_project/openapi_package/models/create_flex_option_response.py create mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py create mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py create mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py create mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py create mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py create mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py create mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py create mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_leg.py create mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py create mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py create mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_request.py create mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py create mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py create mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py create mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_response.py create mode 100644 openapi_project/openapi_package/models/create_order_cross_allocation.py create mode 100644 openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py create mode 100644 openapi_project/openapi_package/models/create_order_cross_request.py create mode 100644 openapi_project/openapi_package/models/create_order_cross_request_algo.py create mode 100644 openapi_project/openapi_package/models/create_order_cross_request_market_condition.py create mode 100644 openapi_project/openapi_package/models/create_order_cross_request_optional_data.py create mode 100644 openapi_project/openapi_package/models/create_order_cross_response.py create mode 100644 openapi_project/openapi_package/models/create_order_request.py create mode 100644 openapi_project/openapi_package/models/create_order_request_algo.py create mode 100644 openapi_project/openapi_package/models/create_order_request_market_condition.py create mode 100644 openapi_project/openapi_package/models/create_order_request_optional_data.py create mode 100644 openapi_project/openapi_package/models/create_order_response.py create mode 100644 openapi_project/openapi_package/models/cross_side_type.py create mode 100644 openapi_project/openapi_package/models/cross_type.py create mode 100644 openapi_project/openapi_package/models/crypto.py create mode 100644 openapi_project/openapi_package/models/crypto_aliases.py create mode 100644 openapi_project/openapi_package/models/currency.py create mode 100644 openapi_project/openapi_package/models/cxl_rej_response_to.py create mode 100644 openapi_project/openapi_package/models/date.py create mode 100644 openapi_project/openapi_package/models/easy_to_borrow_security.py create mode 100644 openapi_project/openapi_package/models/empty.py create mode 100644 openapi_project/openapi_package/models/exchange.py create mode 100644 openapi_project/openapi_package/models/exchange_code.py create mode 100644 openapi_project/openapi_package/models/exec_type.py create mode 100644 openapi_project/openapi_package/models/execution.py create mode 100644 openapi_project/openapi_package/models/execution_algo.py create mode 100644 openapi_project/openapi_package/models/execution_optional_data.py create mode 100644 openapi_project/openapi_package/models/flex_option.py create mode 100644 openapi_project/openapi_package/models/flex_option_aliases.py create mode 100644 openapi_project/openapi_package/models/flex_settlement_type.py create mode 100644 openapi_project/openapi_package/models/future.py create mode 100644 openapi_project/openapi_package/models/future_aliases.py create mode 100644 openapi_project/openapi_package/models/future_root.py create mode 100644 openapi_project/openapi_package/models/future_root_aliases.py create mode 100644 openapi_project/openapi_package/models/future_spread.py create mode 100644 openapi_project/openapi_package/models/future_spread_aliases.py create mode 100644 openapi_project/openapi_package/models/future_spread_leg.py create mode 100644 openapi_project/openapi_package/models/fx.py create mode 100644 openapi_project/openapi_package/models/fx_aliases.py create mode 100644 openapi_project/openapi_package/models/generic_order.py create mode 100644 openapi_project/openapi_package/models/get_active_user_response.py create mode 100644 openapi_project/openapi_package/models/get_server_info_response.py create mode 100644 openapi_project/openapi_package/models/get_server_info_response_system_settings.py create mode 100644 openapi_project/openapi_package/models/get_server_time_response.py create mode 100644 openapi_project/openapi_package/models/get_trading_holidays_response.py create mode 100644 openapi_project/openapi_package/models/header.py create mode 100644 openapi_project/openapi_package/models/index.py create mode 100644 openapi_project/openapi_package/models/index_aliases.py create mode 100644 openapi_project/openapi_package/models/list_accounts_response.py create mode 100644 openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py create mode 100644 openapi_project/openapi_package/models/list_easy_to_borrow_securities_request.py create mode 100644 openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py create mode 100644 openapi_project/openapi_package/models/list_exchanges_response.py create mode 100644 openapi_project/openapi_package/models/list_option_chains_repsonse.py create mode 100644 openapi_project/openapi_package/models/list_option_chains_request.py create mode 100644 openapi_project/openapi_package/models/list_orders_response.py create mode 100644 openapi_project/openapi_package/models/list_positions_response.py create mode 100644 openapi_project/openapi_package/models/list_routes_response.py create mode 100644 openapi_project/openapi_package/models/list_securities_request.py create mode 100644 openapi_project/openapi_package/models/list_securities_response.py create mode 100644 openapi_project/openapi_package/models/list_trade_confirms_response.py create mode 100644 openapi_project/openapi_package/models/list_trading_firms_response.py create mode 100644 openapi_project/openapi_package/models/login_request.py create mode 100644 openapi_project/openapi_package/models/login_response.py create mode 100644 openapi_project/openapi_package/models/login_response_system_settings.py create mode 100644 openapi_project/openapi_package/models/login_status.py create mode 100644 openapi_project/openapi_package/models/margin_data.py create mode 100644 openapi_project/openapi_package/models/margin_data_type.py create mode 100644 openapi_project/openapi_package/models/multi_leg_order.py create mode 100644 openapi_project/openapi_package/models/multi_leg_order_algo.py create mode 100644 openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py create mode 100644 openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py create mode 100644 openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py create mode 100644 openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py create mode 100644 openapi_project/openapi_package/models/multi_leg_order_cross.py create mode 100644 openapi_project/openapi_package/models/multi_leg_order_cross_algo.py create mode 100644 openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py create mode 100644 openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py create mode 100644 openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py create mode 100644 openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py create mode 100644 openapi_project/openapi_package/models/multi_leg_order_leg.py create mode 100644 openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py create mode 100644 openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py create mode 100644 openapi_project/openapi_package/models/multi_leg_order_market_condition.py create mode 100644 openapi_project/openapi_package/models/multi_leg_order_optional_data.py create mode 100644 openapi_project/openapi_package/models/multi_leg_reporting_type.py create mode 100644 openapi_project/openapi_package/models/numeric_display_format.py create mode 100644 openapi_project/openapi_package/models/option.py create mode 100644 openapi_project/openapi_package/models/option_aliases.py create mode 100644 openapi_project/openapi_package/models/option_chain.py create mode 100644 openapi_project/openapi_package/models/option_chain_option.py create mode 100644 openapi_project/openapi_package/models/option_chain_option_aliases.py create mode 100644 openapi_project/openapi_package/models/option_chain_options.py create mode 100644 openapi_project/openapi_package/models/option_chain_roots.py create mode 100644 openapi_project/openapi_package/models/option_exercise_style.py create mode 100644 openapi_project/openapi_package/models/option_expiration_style.py create mode 100644 openapi_project/openapi_package/models/option_root.py create mode 100644 openapi_project/openapi_package/models/option_root_aliases.py create mode 100644 openapi_project/openapi_package/models/option_series.py create mode 100644 openapi_project/openapi_package/models/option_series_product_type.py create mode 100644 openapi_project/openapi_package/models/option_series_type.py create mode 100644 openapi_project/openapi_package/models/option_settlement_type.py create mode 100644 openapi_project/openapi_package/models/ord_status.py create mode 100644 openapi_project/openapi_package/models/ord_type.py create mode 100644 openapi_project/openapi_package/models/order.py create mode 100644 openapi_project/openapi_package/models/order_algo.py create mode 100644 openapi_project/openapi_package/models/order_cancel_reject.py create mode 100644 openapi_project/openapi_package/models/order_cancel_reject_optional_data.py create mode 100644 openapi_project/openapi_package/models/order_cancel_replace_request.py create mode 100644 openapi_project/openapi_package/models/order_cancel_replace_request_algo.py create mode 100644 openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py create mode 100644 openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py create mode 100644 openapi_project/openapi_package/models/order_cancel_request.py create mode 100644 openapi_project/openapi_package/models/order_cancel_request_optional_data.py create mode 100644 openapi_project/openapi_package/models/order_cross.py create mode 100644 openapi_project/openapi_package/models/order_cross_algo.py create mode 100644 openapi_project/openapi_package/models/order_cross_allocation.py create mode 100644 openapi_project/openapi_package/models/order_cross_allocation_optional_data.py create mode 100644 openapi_project/openapi_package/models/order_cross_market_condition.py create mode 100644 openapi_project/openapi_package/models/order_cross_optional_data.py create mode 100644 openapi_project/openapi_package/models/order_delete.py create mode 100644 openapi_project/openapi_package/models/order_delete_optional_data.py create mode 100644 openapi_project/openapi_package/models/order_instruction.py create mode 100644 openapi_project/openapi_package/models/order_instruction_type.py create mode 100644 openapi_project/openapi_package/models/order_market_condition.py create mode 100644 openapi_project/openapi_package/models/order_optional_data.py create mode 100644 openapi_project/openapi_package/models/order_type.py create mode 100644 openapi_project/openapi_package/models/order_update.py create mode 100644 openapi_project/openapi_package/models/order_update_algo.py create mode 100644 openapi_project/openapi_package/models/order_update_event.py create mode 100644 openapi_project/openapi_package/models/order_update_optional_data.py create mode 100644 openapi_project/openapi_package/models/origination_type.py create mode 100644 openapi_project/openapi_package/models/position.py create mode 100644 openapi_project/openapi_package/models/position_analysis.py create mode 100644 openapi_project/openapi_package/models/position_effect.py create mode 100644 openapi_project/openapi_package/models/position_source.py create mode 100644 openapi_project/openapi_package/models/position_theo.py create mode 100644 openapi_project/openapi_package/models/position_theo_leg.py create mode 100644 openapi_project/openapi_package/models/price_type.py create mode 100644 openapi_project/openapi_package/models/product_group.py create mode 100644 openapi_project/openapi_package/models/product_sub_group.py create mode 100644 openapi_project/openapi_package/models/put_call.py create mode 100644 openapi_project/openapi_package/models/risk_calculation_type.py create mode 100644 openapi_project/openapi_package/models/risk_eval_mode.py create mode 100644 openapi_project/openapi_package/models/risk_radar_account_group.py create mode 100644 openapi_project/openapi_package/models/risk_radar_class_group.py create mode 100644 openapi_project/openapi_package/models/risk_radar_data.py create mode 100644 openapi_project/openapi_package/models/risk_radar_position.py create mode 100644 openapi_project/openapi_package/models/risk_radar_product_group.py create mode 100644 openapi_project/openapi_package/models/risk_radar_request.py create mode 100644 openapi_project/openapi_package/models/risk_radar_request_position.py create mode 100644 openapi_project/openapi_package/models/risk_radar_request_position_list.py create mode 100644 openapi_project/openapi_package/models/risk_radar_response.py create mode 100644 openapi_project/openapi_package/models/risk_radar_scenario_order.py create mode 100644 openapi_project/openapi_package/models/risk_reject.py create mode 100644 openapi_project/openapi_package/models/risk_reject_type.py create mode 100644 openapi_project/openapi_package/models/route.py create mode 100644 openapi_project/openapi_package/models/route_applicability.py create mode 100644 openapi_project/openapi_package/models/route_property.py create mode 100644 openapi_project/openapi_package/models/route_property_type.py create mode 100644 openapi_project/openapi_package/models/route_type.py create mode 100644 openapi_project/openapi_package/models/routing_session_group.py create mode 100644 openapi_project/openapi_package/models/routing_session_group_type.py create mode 100644 openapi_project/openapi_package/models/scenario.py create mode 100644 openapi_project/openapi_package/models/scenario_leg.py create mode 100644 openapi_project/openapi_package/models/scenario_position.py create mode 100644 openapi_project/openapi_package/models/scenario_theo.py create mode 100644 openapi_project/openapi_package/models/search_order_history_response.py create mode 100644 openapi_project/openapi_package/models/security.py create mode 100644 openapi_project/openapi_package/models/security_category.py create mode 100644 openapi_project/openapi_package/models/security_type.py create mode 100644 openapi_project/openapi_package/models/settlement_deliverable_type.py create mode 100644 openapi_project/openapi_package/models/settlement_info.py create mode 100644 openapi_project/openapi_package/models/shock_value.py create mode 100644 openapi_project/openapi_package/models/shock_value_flags.py create mode 100644 openapi_project/openapi_package/models/side.py create mode 100644 openapi_project/openapi_package/models/spread_leg_side.py create mode 100644 openapi_project/openapi_package/models/spread_leg_type.py create mode 100644 openapi_project/openapi_package/models/status.py create mode 100644 openapi_project/openapi_package/models/status_code.py create mode 100644 openapi_project/openapi_package/models/stock.py create mode 100644 openapi_project/openapi_package/models/stock_aliases.py create mode 100644 openapi_project/openapi_package/models/tif.py create mode 100644 openapi_project/openapi_package/models/time_of_day.py create mode 100644 openapi_project/openapi_package/models/tims_class_group.py create mode 100644 openapi_project/openapi_package/models/tims_margin_data.py create mode 100644 openapi_project/openapi_package/models/tims_position_group.py create mode 100644 openapi_project/openapi_package/models/tims_product_group.py create mode 100644 openapi_project/openapi_package/models/trade_confirm.py create mode 100644 openapi_project/openapi_package/models/trading_firm.py create mode 100644 openapi_project/openapi_package/models/trading_firm_slim.py create mode 100644 openapi_project/openapi_package/models/trading_holiday.py create mode 100644 openapi_project/openapi_package/models/trading_session.py create mode 100644 openapi_project/openapi_package/models/trading_session_group.py create mode 100644 openapi_project/openapi_package/models/user.py create mode 100644 openapi_project/openapi_package/models/user_location.py create mode 100644 openapi_project/openapi_package/models/user_permission.py create mode 100644 openapi_project/openapi_package/models/user_status.py create mode 100644 openapi_project/openapi_package/models/user_type.py create mode 100644 openapi_project/openapi_package/models/validate_risk_response.py create mode 100644 openapi_project/openapi_package/models/volatility_shock_skew.py create mode 100644 openapi_project/openapi_package/models/volatility_shock_type.py create mode 100644 openapi_project/openapi_package/py.typed create mode 100644 openapi_project/openapi_package/types.py create mode 100644 openapi_project/pyproject.toml diff --git a/end_to_end_tests/__init__.py b/end_to_end_tests/__init__.py index 3793e0395..f165cc2c5 100644 --- a/end_to_end_tests/__init__.py +++ b/end_to_end_tests/__init__.py @@ -1,4 +1,5 @@ -""" Generate a complete client and verify that it is correct """ +"""Generate a complete client and verify that it is correct""" + import pytest pytest.register_assert_rewrite("end_to_end_tests.end_to_end_test_helpers") diff --git a/end_to_end_tests/custom-templates-golden-record/my_test_api_client/api/responses/__init__.py b/end_to_end_tests/custom-templates-golden-record/my_test_api_client/api/responses/__init__.py index e09dee3e3..ef90e48e4 100644 --- a/end_to_end_tests/custom-templates-golden-record/my_test_api_client/api/responses/__init__.py +++ b/end_to_end_tests/custom-templates-golden-record/my_test_api_client/api/responses/__init__.py @@ -2,7 +2,11 @@ import types -from . import post_responses_unions_simple_before_complex, reference_response, text_response +from . import ( + post_responses_unions_simple_before_complex, + reference_response, + text_response, +) class ResponsesEndpoints: diff --git a/end_to_end_tests/docstrings-on-attributes-golden-record/my_test_api_client/client.py b/end_to_end_tests/docstrings-on-attributes-golden-record/my_test_api_client/client.py index e05334a5f..c6e6296ed 100644 --- a/end_to_end_tests/docstrings-on-attributes-golden-record/my_test_api_client/client.py +++ b/end_to_end_tests/docstrings-on-attributes-golden-record/my_test_api_client/client.py @@ -34,9 +34,15 @@ class Client: _base_url: str = field(alias="base_url") _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") - _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout") - _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl") - _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _timeout: Optional[httpx.Timeout] = field( + default=None, kw_only=True, alias="timeout" + ) + _verify_ssl: Union[str, bool, ssl.SSLContext] = field( + default=True, kw_only=True, alias="verify_ssl" + ) + _follow_redirects: bool = field( + default=False, kw_only=True, alias="follow_redirects" + ) _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") _client: Optional[httpx.Client] = field(default=None, init=False) _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) @@ -157,9 +163,15 @@ class AuthenticatedClient: _base_url: str = field(alias="base_url") _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") - _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout") - _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl") - _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _timeout: Optional[httpx.Timeout] = field( + default=None, kw_only=True, alias="timeout" + ) + _verify_ssl: Union[str, bool, ssl.SSLContext] = field( + default=True, kw_only=True, alias="verify_ssl" + ) + _follow_redirects: bool = field( + default=False, kw_only=True, alias="follow_redirects" + ) _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") _client: Optional[httpx.Client] = field(default=None, init=False) _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) @@ -206,7 +218,9 @@ def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient": def get_httpx_client(self) -> httpx.Client: """Get the underlying httpx.Client, constructing a new one if not previously set""" if self._client is None: - self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token + self._headers[self.auth_header_name] = ( + f"{self.prefix} {self.token}" if self.prefix else self.token + ) self._client = httpx.Client( base_url=self._base_url, cookies=self._cookies, @@ -227,7 +241,9 @@ def __exit__(self, *args: Any, **kwargs: Any) -> None: """Exit a context manager for internal httpx.Client (see httpx docs)""" self.get_httpx_client().__exit__(*args, **kwargs) - def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "AuthenticatedClient": + def set_async_httpx_client( + self, async_client: httpx.AsyncClient + ) -> "AuthenticatedClient": """Manually the underlying httpx.AsyncClient **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. @@ -238,7 +254,9 @@ def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Authentica def get_async_httpx_client(self) -> httpx.AsyncClient: """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" if self._async_client is None: - self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token + self._headers[self.auth_header_name] = ( + f"{self.prefix} {self.token}" if self.prefix else self.token + ) self._async_client = httpx.AsyncClient( base_url=self._base_url, cookies=self._cookies, diff --git a/end_to_end_tests/functional_tests/generated_code_execution/test_arrays.py b/end_to_end_tests/functional_tests/generated_code_execution/test_arrays.py index 443d764c5..ce0ebd005 100644 --- a/end_to_end_tests/functional_tests/generated_code_execution/test_arrays.py +++ b/end_to_end_tests/functional_tests/generated_code_execution/test_arrays.py @@ -9,7 +9,7 @@ @with_generated_client_fixture( -""" + """ components: schemas: SimpleObject: @@ -31,7 +31,8 @@ arrayProp: type: array items: {"$ref": "#/components/schemas/SimpleObject"} -""") +""" +) @with_generated_code_imports( ".models.ModelWithArrayOfAny", ".models.ModelWithArrayOfInts", @@ -61,17 +62,27 @@ def test_array_of_object(self, ModelWithArrayOfObjects, SimpleObject): assert_model_decode_encode( ModelWithArrayOfObjects, {"arrayProp": [{"name": "a"}, {"name": "b"}]}, - ModelWithArrayOfObjects(array_prop=[SimpleObject(name="a"), SimpleObject(name="b")]), + ModelWithArrayOfObjects( + array_prop=[SimpleObject(name="a"), SimpleObject(name="b")] + ), ) - def test_type_hints(self, ModelWithArrayOfAny, ModelWithArrayOfInts, ModelWithArrayOfObjects, Unset): - assert_model_property_type_hint(ModelWithArrayOfAny, "array_prop", Union[list[Any], Unset]) - assert_model_property_type_hint(ModelWithArrayOfInts, "array_prop", Union[list[int], Unset]) - assert_model_property_type_hint(ModelWithArrayOfObjects, "array_prop", Union[list["SimpleObject"], Unset]) + def test_type_hints( + self, ModelWithArrayOfAny, ModelWithArrayOfInts, ModelWithArrayOfObjects, Unset + ): + assert_model_property_type_hint( + ModelWithArrayOfAny, "array_prop", Union[list[Any], Unset] + ) + assert_model_property_type_hint( + ModelWithArrayOfInts, "array_prop", Union[list[int], Unset] + ) + assert_model_property_type_hint( + ModelWithArrayOfObjects, "array_prop", Union[list["SimpleObject"], Unset] + ) @with_generated_client_fixture( -""" + """ components: schemas: SimpleObject: @@ -102,7 +113,8 @@ def test_type_hints(self, ModelWithArrayOfAny, ModelWithArrayOfInts, ModelWithAr - $ref: "#/components/schemas/SimpleObject" items: type: string -""") +""" +) @with_generated_code_imports( ".models.ModelWithSinglePrefixItem", ".models.ModelWithPrefixItems", @@ -132,8 +144,16 @@ def test_prefix_items_and_regular_items(self, ModelWithMixedItems, SimpleObject) ModelWithMixedItems(array_prop=[SimpleObject(name="a"), "b"]), ) - def test_type_hints(self, ModelWithSinglePrefixItem, ModelWithPrefixItems, ModelWithMixedItems, Unset): - assert_model_property_type_hint(ModelWithSinglePrefixItem, "array_prop", Union[list[str], Unset]) + def test_type_hints( + self, + ModelWithSinglePrefixItem, + ModelWithPrefixItems, + ModelWithMixedItems, + Unset, + ): + assert_model_property_type_hint( + ModelWithSinglePrefixItem, "array_prop", Union[list[str], Unset] + ) assert_model_property_type_hint( ModelWithPrefixItems, "array_prop", diff --git a/end_to_end_tests/functional_tests/generated_code_execution/test_defaults.py b/end_to_end_tests/functional_tests/generated_code_execution/test_defaults.py index 5f8affb25..06311c03b 100644 --- a/end_to_end_tests/functional_tests/generated_code_execution/test_defaults.py +++ b/end_to_end_tests/functional_tests/generated_code_execution/test_defaults.py @@ -8,7 +8,7 @@ @with_generated_client_fixture( -""" + """ components: schemas: MyModel: @@ -38,7 +38,8 @@ unionWithValidDefaultForType2: anyOf: [{"type": "boolean"}, {"type": "integer"}] default: 3 -""") +""" +) @with_generated_code_imports(".models.MyModel") class TestSimpleDefaults: # Note, the null/None type is not covered here due to a known bug: @@ -51,7 +52,9 @@ def test_defaults_in_initializer(self, MyModel): number_prop=1.5, int_prop=2, date_prop=datetime.date(2024, 1, 2), - date_time_prop=datetime.datetime(2024, 1, 2, 3, 4, 5, tzinfo=datetime.timezone.utc), + date_time_prop=datetime.datetime( + 2024, 1, 2, 3, 4, 5, tzinfo=datetime.timezone.utc + ), uuid_prop=uuid.UUID("07EF8B4D-AA09-4FFA-898D-C710796AFF41"), any_prop_with_string="b", any_prop_with_int=3, @@ -69,9 +72,8 @@ def test_defaults_in_initializer(self, MyModel): ) - @with_generated_client_fixture( -""" + """ components: schemas: MyEnum: @@ -85,7 +87,8 @@ def test_defaults_in_initializer(self, MyModel): - $ref: "#/components/schemas/MyEnum" default: "a" -""") +""" +) @with_generated_code_imports(".models.MyEnum", ".models.MyModel") class TestEnumDefaults: def test_enum_default(self, MyEnum, MyModel): @@ -93,7 +96,7 @@ def test_enum_default(self, MyEnum, MyModel): @with_generated_client_fixture( -""" + """ components: schemas: MyEnum: diff --git a/end_to_end_tests/functional_tests/generated_code_execution/test_docstrings.py b/end_to_end_tests/functional_tests/generated_code_execution/test_docstrings.py index d2d560780..faed1dcf9 100644 --- a/end_to_end_tests/functional_tests/generated_code_execution/test_docstrings.py +++ b/end_to_end_tests/functional_tests/generated_code_execution/test_docstrings.py @@ -13,12 +13,12 @@ def __init__(self, item: Any): self.lines = [line.lstrip() for line in item.__doc__.split("\n")] def get_section(self, header_line: str) -> list[str]: - lines = self.lines[self.lines.index(header_line)+1:] - return lines[0:lines.index("")] + lines = self.lines[self.lines.index(header_line) + 1 :] + return lines[0 : lines.index("")] @with_generated_client_fixture( -""" + """ components: schemas: MyModel: @@ -34,7 +34,8 @@ def get_section(self, header_line: str) -> list[str]: undescribedProp: type: string required: ["reqStr", "undescribedProp"] -""") +""" +) @with_generated_code_import(".models.MyModel") class TestSchemaDocstrings: def test_model_description(self, MyModel): @@ -49,7 +50,7 @@ def test_model_properties(self, MyModel): @with_generated_client_fixture( -""" + """ tags: - name: service1 paths: @@ -130,10 +131,17 @@ def test_model_properties(self, MyModel): Thing: type: object description: The thing. -""") -@with_generated_code_import(".api.service1.get_simple_thing.sync", alias="get_simple_thing_sync") -@with_generated_code_import(".api.service1.post_simple_thing.sync", alias="post_simple_thing_sync") -@with_generated_code_import(".api.service1.get_attribute_by_index.sync", alias="get_attribute_by_index_sync") +""" +) +@with_generated_code_import( + ".api.service1.get_simple_thing.sync", alias="get_simple_thing_sync" +) +@with_generated_code_import( + ".api.service1.post_simple_thing.sync", alias="post_simple_thing_sync" +) +@with_generated_code_import( + ".api.service1.get_attribute_by_index.sync", alias="get_attribute_by_index_sync" +) class TestEndpointDocstrings: def test_description(self, get_simple_thing_sync): assert DocstringParser(get_simple_thing_sync).lines[0] == "Get a simple thing." @@ -144,7 +152,9 @@ def test_response_single_type(self, get_simple_thing_sync): ] def test_response_union_type(self, post_simple_thing_sync): - returns_line = DocstringParser(post_simple_thing_sync).get_section("Returns:")[0] + returns_line = DocstringParser(post_simple_thing_sync).get_section("Returns:")[ + 0 + ] assert returns_line in ( "Union[GoodResponse, ErrorResponse]", "Union[ErrorResponse, GoodResponse]", diff --git a/end_to_end_tests/functional_tests/generated_code_execution/test_enums_and_consts.py b/end_to_end_tests/functional_tests/generated_code_execution/test_enums_and_consts.py index 605e47e7b..3cd0985f4 100644 --- a/end_to_end_tests/functional_tests/generated_code_execution/test_enums_and_consts.py +++ b/end_to_end_tests/functional_tests/generated_code_execution/test_enums_and_consts.py @@ -10,7 +10,7 @@ @with_generated_client_fixture( -""" + """ components: schemas: MyEnum: @@ -26,7 +26,8 @@ properties: enumProp: {"$ref": "#/components/schemas/MyEnum"} required: ["enumProp"] -""") +""" +) @with_generated_code_imports( ".models.MyEnum", ".models.MyModel", @@ -46,12 +47,14 @@ class TestStringEnumClass: ("A_THING_WITH_SPACES", "a Thing WIth spaces"), ("VALUE_6", ""), ], - ) + ) def test_enum_values(self, MyEnum, expected_name, expected_value): assert getattr(MyEnum, expected_name) == MyEnum(expected_value) def test_enum_prop_in_object(self, MyEnum, MyModel, MyModelInlineEnumProp): - assert_model_decode_encode(MyModel, {"enumProp": "B"}, MyModel(enum_prop=MyEnum.B)) + assert_model_decode_encode( + MyModel, {"enumProp": "B"}, MyModel(enum_prop=MyEnum.B) + ) assert_model_decode_encode( MyModel, {"inlineEnumProp": "a"}, @@ -60,7 +63,7 @@ def test_enum_prop_in_object(self, MyEnum, MyModel, MyModelInlineEnumProp): def test_type_hints(self, MyModel, MyModelWithRequired, MyEnum, Unset): optional_type = Union[Unset, MyEnum] - assert_model_property_type_hint(MyModel,"enum_prop", optional_type) + assert_model_property_type_hint(MyModel, "enum_prop", optional_type) assert_model_property_type_hint(MyModelWithRequired, "enum_prop", MyEnum) def test_invalid_values(self, MyModel): @@ -73,7 +76,7 @@ def test_invalid_values(self, MyModel): @with_generated_client_fixture( -""" + """ components: schemas: MyEnum: @@ -89,7 +92,8 @@ def test_invalid_values(self, MyModel): properties: enumProp: {"$ref": "#/components/schemas/MyEnum"} required: ["enumProp"] -""") +""" +) @with_generated_code_imports( ".models.MyEnum", ".models.MyModel", @@ -105,12 +109,14 @@ class TestIntEnumClass: ("VALUE_3", 3), ("VALUE_NEGATIVE_4", -4), ], - ) + ) def test_enum_values(self, MyEnum, expected_name, expected_value): assert getattr(MyEnum, expected_name) == MyEnum(expected_value) def test_enum_prop_in_object(self, MyEnum, MyModel, MyModelInlineEnumProp): - assert_model_decode_encode(MyModel, {"enumProp": 2}, MyModel(enum_prop=MyEnum.VALUE_2)) + assert_model_decode_encode( + MyModel, {"enumProp": 2}, MyModel(enum_prop=MyEnum.VALUE_2) + ) assert_model_decode_encode( MyModel, {"inlineEnumProp": 2}, @@ -119,7 +125,7 @@ def test_enum_prop_in_object(self, MyEnum, MyModel, MyModelInlineEnumProp): def test_type_hints(self, MyModel, MyModelWithRequired, MyEnum, Unset): optional_type = Union[Unset, MyEnum] - assert_model_property_type_hint(MyModel,"enum_prop", optional_type) + assert_model_property_type_hint(MyModel, "enum_prop", optional_type) assert_model_property_type_hint(MyModelWithRequired, "enum_prop", MyEnum) def test_invalid_values(self, MyModel): @@ -130,7 +136,7 @@ def test_invalid_values(self, MyModel): @with_generated_client_fixture( -""" + """ components: schemas: MyEnum: @@ -141,7 +147,8 @@ def test_invalid_values(self, MyModel): "Three", "Negative Four" ] -""") +""" +) @with_generated_code_imports( ".models.MyEnum", ) @@ -159,7 +166,7 @@ def test_enum_values(self, MyEnum, expected_name, expected_value): @with_generated_client_fixture( -""" + """ components: schemas: MyEnum: @@ -178,10 +185,11 @@ def test_enum_values(self, MyEnum, expected_name, expected_value): - type: "null" enumIncludingNullProp: {"$ref": "#/components/schemas/MyEnumIncludingNull"} nullOnlyEnumProp: {"$ref": "#/components/schemas/MyNullOnlyEnum"} -""") +""" +) @with_generated_code_imports( ".models.MyEnum", - ".models.MyEnumIncludingNullType1", # see comment in test_nullable_enum_prop + ".models.MyEnumIncludingNullType1", # see comment in test_nullable_enum_prop ".models.MyModel", ".types.Unset", ) @@ -189,23 +197,33 @@ class TestNullableEnums: def test_nullable_enum_prop(self, MyModel, MyEnum, MyEnumIncludingNullType1): # Note, MyEnumIncludingNullType1 should be named just MyEnumIncludingNull - # known bug: https://github.com/openapi-generators/openapi-python-client/issues/1120 - assert_model_decode_encode(MyModel, {"nullableEnumProp": "b"}, MyModel(nullable_enum_prop=MyEnum.B)) - assert_model_decode_encode(MyModel, {"nullableEnumProp": None}, MyModel(nullable_enum_prop=None)) + assert_model_decode_encode( + MyModel, {"nullableEnumProp": "b"}, MyModel(nullable_enum_prop=MyEnum.B) + ) + assert_model_decode_encode( + MyModel, {"nullableEnumProp": None}, MyModel(nullable_enum_prop=None) + ) assert_model_decode_encode( MyModel, {"enumIncludingNullProp": "a"}, MyModel(enum_including_null_prop=MyEnumIncludingNullType1.A), ) - assert_model_decode_encode( MyModel, {"enumIncludingNullProp": None}, MyModel(enum_including_null_prop=None)) - assert_model_decode_encode(MyModel, {"nullOnlyEnumProp": None}, MyModel(null_only_enum_prop=None)) - + assert_model_decode_encode( + MyModel, + {"enumIncludingNullProp": None}, + MyModel(enum_including_null_prop=None), + ) + assert_model_decode_encode( + MyModel, {"nullOnlyEnumProp": None}, MyModel(null_only_enum_prop=None) + ) + def test_type_hints(self, MyModel, MyEnum, Unset): expected_type = Union[MyEnum, None, Unset] assert_model_property_type_hint(MyModel, "nullable_enum_prop", expected_type) - + @with_generated_client_fixture( -""" + """ components: schemas: MyModel: @@ -244,8 +262,9 @@ def test_invalid_int(self, MyModel): # The following tests of literal enums use basically the same specs as the tests above, but # the "literal_enums" option is enabled in the test configuration. + @with_generated_client_fixture( -""" + """ components: schemas: MyEnum: @@ -273,8 +292,10 @@ class TestStringLiteralEnum: def test_enum_prop(self, MyModel): assert_model_decode_encode(MyModel, {"enumProp": "a"}, MyModel(enum_prop="a")) assert_model_decode_encode(MyModel, {"enumProp": "A"}, MyModel(enum_prop="A")) - assert_model_decode_encode(MyModel, {"inlineEnumProp": "a"}, MyModel(inline_enum_prop="a")) - + assert_model_decode_encode( + MyModel, {"inlineEnumProp": "a"}, MyModel(inline_enum_prop="a") + ) + def test_type_hints(self, MyModel, MyModelWithRequired, Unset): literal_type = Literal["a", "A", "b"] optional_type = Union[Unset, literal_type] @@ -289,7 +310,7 @@ def test_invalid_values(self, MyModel): @with_generated_client_fixture( -""" + """ components: schemas: MyEnum: @@ -317,8 +338,10 @@ class TestIntLiteralEnum: def test_enum_prop(self, MyModel): assert_model_decode_encode(MyModel, {"enumProp": 2}, MyModel(enum_prop=2)) assert_model_decode_encode(MyModel, {"enumProp": -4}, MyModel(enum_prop=-4)) - assert_model_decode_encode(MyModel, {"inlineEnumProp": 2}, MyModel(inline_enum_prop=2)) - + assert_model_decode_encode( + MyModel, {"inlineEnumProp": 2}, MyModel(inline_enum_prop=2) + ) + def test_type_hints(self, MyModel, MyModelWithRequired, Unset): literal_type = Literal[2, 3, -4] optional_type = Union[Unset, literal_type] @@ -333,7 +356,7 @@ def test_invalid_values(self, MyModel): @with_generated_client_fixture( -""" + """ components: schemas: MyEnum: @@ -359,8 +382,22 @@ def test_invalid_values(self, MyModel): @with_generated_code_imports(".models.MyModel") class TestNullableLiteralEnum: def test_nullable_enum_prop(self, MyModel): - assert_model_decode_encode(MyModel, {"nullableEnumProp": "B"}, MyModel(nullable_enum_prop="B")) - assert_model_decode_encode(MyModel, {"nullableEnumProp": None}, MyModel(nullable_enum_prop=None)) - assert_model_decode_encode(MyModel, {"enumIncludingNullProp": "a"}, MyModel(enum_including_null_prop="a")) - assert_model_decode_encode(MyModel, {"enumIncludingNullProp": None}, MyModel(enum_including_null_prop=None)) - assert_model_decode_encode(MyModel, {"nullOnlyEnumProp": None}, MyModel(null_only_enum_prop=None)) + assert_model_decode_encode( + MyModel, {"nullableEnumProp": "B"}, MyModel(nullable_enum_prop="B") + ) + assert_model_decode_encode( + MyModel, {"nullableEnumProp": None}, MyModel(nullable_enum_prop=None) + ) + assert_model_decode_encode( + MyModel, + {"enumIncludingNullProp": "a"}, + MyModel(enum_including_null_prop="a"), + ) + assert_model_decode_encode( + MyModel, + {"enumIncludingNullProp": None}, + MyModel(enum_including_null_prop=None), + ) + assert_model_decode_encode( + MyModel, {"nullOnlyEnumProp": None}, MyModel(null_only_enum_prop=None) + ) diff --git a/end_to_end_tests/functional_tests/generated_code_execution/test_properties.py b/end_to_end_tests/functional_tests/generated_code_execution/test_properties.py index e1cfce9a5..017915a9d 100644 --- a/end_to_end_tests/functional_tests/generated_code_execution/test_properties.py +++ b/end_to_end_tests/functional_tests/generated_code_execution/test_properties.py @@ -12,7 +12,7 @@ @with_generated_client_fixture( -""" + """ components: schemas: MyModel: @@ -29,7 +29,8 @@ properties: req3: {"type": "string"} required: ["req3"] -""") +""" +) @with_generated_code_imports( ".models.MyModel", ".models.DerivedModel", @@ -74,7 +75,7 @@ def test_type_hints(self, MyModel, Unset): @with_generated_client_fixture( -""" + """ components: schemas: MyModel: @@ -89,7 +90,8 @@ def test_type_hints(self, MyModel, Unset): anyProp: {} AnyObject: type: object -""") +""" +) @with_generated_code_imports( ".models.MyModel", ".models.AnyObject", @@ -104,7 +106,7 @@ def test_decode_encode(self, MyModel, AnyObject): "intProp": 2, "anyObjectProp": {"d": 3}, "nullProp": None, - "anyProp": "e" + "anyProp": "e", } expected_any_object = AnyObject() expected_any_object.additional_properties = {"d": 3} @@ -116,10 +118,10 @@ def test_decode_encode(self, MyModel, AnyObject): string_prop="a", number_prop=1.5, int_prop=2, - any_object_prop = expected_any_object, + any_object_prop=expected_any_object, null_prop=None, any_prop="e", - ) + ), ) @pytest.mark.parametrize( @@ -138,13 +140,15 @@ def test_type_hints(self, MyModel, Unset): assert_model_property_type_hint(MyModel, "string_prop", Union[str, Unset]) assert_model_property_type_hint(MyModel, "number_prop", Union[float, Unset]) assert_model_property_type_hint(MyModel, "int_prop", Union[int, Unset]) - assert_model_property_type_hint(MyModel, "any_object_prop", Union[ForwardRef("AnyObject"), Unset]) + assert_model_property_type_hint( + MyModel, "any_object_prop", Union[ForwardRef("AnyObject"), Unset] + ) assert_model_property_type_hint(MyModel, "null_prop", Union[None, Unset]) assert_model_property_type_hint(MyModel, "any_prop", Union[Any, Unset]) @with_generated_client_fixture( -""" + """ components: schemas: MyModel: @@ -154,7 +158,8 @@ def test_type_hints(self, MyModel, Unset): dateTimeProp: {"type": "string", "format": "date-time"} uuidProp: {"type": "string", "format": "uuid"} unknownFormatProp: {"type": "string", "format": "weird"} -""") +""" +) @with_generated_code_imports( ".models.MyModel", ".types.Unset", @@ -168,7 +173,9 @@ def test_date(self, MyModel): def test_date_time(self, MyModel): date_time_value = datetime.datetime.now(datetime.timezone.utc) json_data = {"dateTimeProp": date_time_value.isoformat()} - assert_model_decode_encode(MyModel, json_data, MyModel(date_time_prop=date_time_value)) + assert_model_decode_encode( + MyModel, json_data, MyModel(date_time_prop=date_time_value) + ) def test_uuid(self, MyModel): uuid_value = uuid.uuid1() @@ -177,10 +184,18 @@ def test_uuid(self, MyModel): def test_unknown_format(self, MyModel): json_data = {"unknownFormatProp": "whatever"} - assert_model_decode_encode(MyModel, json_data, MyModel(unknown_format_prop="whatever")) + assert_model_decode_encode( + MyModel, json_data, MyModel(unknown_format_prop="whatever") + ) def test_type_hints(self, MyModel, Unset): - assert_model_property_type_hint(MyModel, "date_prop", Union[datetime.date, Unset]) - assert_model_property_type_hint(MyModel, "date_time_prop", Union[datetime.datetime, Unset]) + assert_model_property_type_hint( + MyModel, "date_prop", Union[datetime.date, Unset] + ) + assert_model_property_type_hint( + MyModel, "date_time_prop", Union[datetime.datetime, Unset] + ) assert_model_property_type_hint(MyModel, "uuid_prop", Union[uuid.UUID, Unset]) - assert_model_property_type_hint(MyModel, "unknown_format_prop", Union[str, Unset]) + assert_model_property_type_hint( + MyModel, "unknown_format_prop", Union[str, Unset] + ) diff --git a/end_to_end_tests/functional_tests/generated_code_execution/test_unions.py b/end_to_end_tests/functional_tests/generated_code_execution/test_unions.py index 9a9b49e4c..28e7ee099 100644 --- a/end_to_end_tests/functional_tests/generated_code_execution/test_unions.py +++ b/end_to_end_tests/functional_tests/generated_code_execution/test_unions.py @@ -9,7 +9,7 @@ @with_generated_client_fixture( -""" + """ components: schemas: StringOrInt: @@ -21,21 +21,24 @@ type: ["string", "integer"] """ ) -@with_generated_code_imports( - ".models.MyModel", - ".types.Unset" -) +@with_generated_code_imports(".models.MyModel", ".types.Unset") class TestSimpleTypeList: def test_decode_encode(self, MyModel): - assert_model_decode_encode(MyModel, {"stringOrIntProp": "a"}, MyModel(string_or_int_prop="a")) - assert_model_decode_encode(MyModel, {"stringOrIntProp": 1}, MyModel(string_or_int_prop=1)) + assert_model_decode_encode( + MyModel, {"stringOrIntProp": "a"}, MyModel(string_or_int_prop="a") + ) + assert_model_decode_encode( + MyModel, {"stringOrIntProp": 1}, MyModel(string_or_int_prop=1) + ) def test_type_hints(self, MyModel, Unset): - assert_model_property_type_hint(MyModel, "string_or_int_prop", Union[str, int, Unset]) + assert_model_property_type_hint( + MyModel, "string_or_int_prop", Union[str, int, Unset] + ) @with_generated_client_fixture( -""" + """ components: schemas: ThingA: @@ -84,7 +87,8 @@ def test_type_hints(self, MyModel, Unset): oneOf: - $ref: "#/components/schemas/ThingA" required: ["requiredThing"] -""") +""" +) @with_generated_code_imports( ".models.ThingA", ".models.ThingB", @@ -92,10 +96,12 @@ def test_type_hints(self, MyModel, Unset): ".models.ModelWithRequiredUnion", ".models.ModelWithNestedUnion", ".models.ModelWithUnionOfOne", - ".types.Unset" + ".types.Unset", ) class TestOneOf: - def test_disambiguate_objects_via_required_properties(self, ThingA, ThingB, ModelWithUnion): + def test_disambiguate_objects_via_required_properties( + self, ThingA, ThingB, ModelWithUnion + ): assert_model_decode_encode( ModelWithUnion, {"thing": {"propA": "x"}}, @@ -118,7 +124,7 @@ def test_disambiguate_object_and_non_object(self, ThingA, ModelWithUnion): {"thingOrString": "x"}, ModelWithUnion(thing_or_string="x"), ) - + def test_disambiguate_nested_union(self, ThingA, ThingB, ModelWithNestedUnion): assert_model_decode_encode( ModelWithNestedUnion, @@ -131,7 +137,9 @@ def test_disambiguate_nested_union(self, ThingA, ThingB, ModelWithNestedUnion): ModelWithNestedUnion(thing_or_value=3), ) - def test_type_hints(self, ModelWithUnion, ModelWithRequiredUnion, ModelWithUnionOfOne, ThingA, Unset): + def test_type_hints( + self, ModelWithUnion, ModelWithRequiredUnion, ModelWithUnionOfOne, ThingA, Unset + ): assert_model_property_type_hint( ModelWithUnion, "thing", @@ -145,6 +153,4 @@ def test_type_hints(self, ModelWithUnion, ModelWithRequiredUnion, ModelWithUnion assert_model_property_type_hint( ModelWithUnionOfOne, "thing", Union[ForwardRef("ThingA"), Unset] ) - assert_model_property_type_hint( - ModelWithUnionOfOne, "required_thing", "ThingA" - ) + assert_model_property_type_hint(ModelWithUnionOfOne, "required_thing", "ThingA") diff --git a/end_to_end_tests/functional_tests/generator_failure_cases/test_invalid_arrays.py b/end_to_end_tests/functional_tests/generator_failure_cases/test_invalid_arrays.py index e4ef0cffd..026742b5d 100644 --- a/end_to_end_tests/functional_tests/generator_failure_cases/test_invalid_arrays.py +++ b/end_to_end_tests/functional_tests/generator_failure_cases/test_invalid_arrays.py @@ -1,10 +1,13 @@ import pytest -from end_to_end_tests.functional_tests.helpers import assert_bad_schema, with_generated_client_fixture +from end_to_end_tests.functional_tests.helpers import ( + assert_bad_schema, + with_generated_client_fixture, +) @with_generated_client_fixture( -""" + """ components: schemas: ArrayWithNoItems: @@ -13,11 +16,19 @@ type: array items: $ref: "#/components/schemas/DoesntExist" -""" +""" ) class TestArrayInvalidSchemas: def test_no_items(self, generated_client): - assert_bad_schema(generated_client, "ArrayWithNoItems", "must have items or prefixItems defined") + assert_bad_schema( + generated_client, + "ArrayWithNoItems", + "must have items or prefixItems defined", + ) def test_invalid_items_ref(self, generated_client): - assert_bad_schema(generated_client, "ArrayWithInvalidItemsRef", "invalid data in items of array") + assert_bad_schema( + generated_client, + "ArrayWithInvalidItemsRef", + "invalid data in items of array", + ) diff --git a/end_to_end_tests/functional_tests/generator_failure_cases/test_invalid_defaults.py b/end_to_end_tests/functional_tests/generator_failure_cases/test_invalid_defaults.py index 93f5e11d4..49331e9dc 100644 --- a/end_to_end_tests/functional_tests/generator_failure_cases/test_invalid_defaults.py +++ b/end_to_end_tests/functional_tests/generator_failure_cases/test_invalid_defaults.py @@ -1,10 +1,13 @@ import pytest -from end_to_end_tests.functional_tests.helpers import assert_bad_schema, with_generated_client_fixture +from end_to_end_tests.functional_tests.helpers import ( + assert_bad_schema, + with_generated_client_fixture, +) @with_generated_client_fixture( -""" + """ components: schemas: WithBadBoolean: @@ -82,7 +85,7 @@ class TestInvalidDefaultValues: ("WithBadEnum", "Value x is not valid for enum"), ("OverriddenEnumWithBadDefault", "Value x is not valid for enum"), ("UnionWithNoValidDefault", "Invalid int value"), - ] + ], ) def test_bad_default_warning(self, model_name, message, generated_client): assert_bad_schema(generated_client, model_name, message) diff --git a/end_to_end_tests/functional_tests/generator_failure_cases/test_invalid_enums_and_consts.py b/end_to_end_tests/functional_tests/generator_failure_cases/test_invalid_enums_and_consts.py index 7f1586f29..7eefb0762 100644 --- a/end_to_end_tests/functional_tests/generator_failure_cases/test_invalid_enums_and_consts.py +++ b/end_to_end_tests/functional_tests/generator_failure_cases/test_invalid_enums_and_consts.py @@ -6,7 +6,7 @@ @with_generated_client_fixture( -""" + """ components: schemas: WithBadDefaultValue: @@ -32,31 +32,44 @@ properties: "2": enum: ["c", "d"] -""" +""" ) class TestEnumAndConstInvalidSchemas: def test_enum_bad_default_value(self, generated_client): - assert_bad_schema(generated_client, "WithBadDefaultValue", "Value B is not valid") + assert_bad_schema( + generated_client, "WithBadDefaultValue", "Value B is not valid" + ) def test_enum_bad_default_type(self, generated_client): - assert_bad_schema(generated_client, "WithBadDefaultType", "Cannot convert 123 to enum") + assert_bad_schema( + generated_client, "WithBadDefaultType", "Cannot convert 123 to enum" + ) def test_enum_mixed_types(self, generated_client): - assert_bad_schema(generated_client, "WithMixedTypes", "Enum values must all be the same type") + assert_bad_schema( + generated_client, "WithMixedTypes", "Enum values must all be the same type" + ) def test_enum_unsupported_type(self, generated_client): - assert_bad_schema(generated_client, "WithUnsupportedType", "Unsupported enum type") + assert_bad_schema( + generated_client, "WithUnsupportedType", "Unsupported enum type" + ) def test_const_default_not_matching(self, generated_client): - assert_bad_schema(generated_client, "DefaultNotMatchingConst", "Invalid value for const") + assert_bad_schema( + generated_client, "DefaultNotMatchingConst", "Invalid value for const" + ) def test_conflicting_inline_class_names(self, generated_client): - assert "Found conflicting enums named WithConflictingInlineNames12 with incompatible values" in generated_client.generator_result.output + assert ( + "Found conflicting enums named WithConflictingInlineNames12 with incompatible values" + in generated_client.generator_result.output + ) def test_enum_duplicate_values(self): # This one currently causes a full generator failure rather than a warning result = inline_spec_should_fail( -""" + """ components: schemas: WithDuplicateValues: @@ -67,7 +80,7 @@ def test_enum_duplicate_values(self): @with_generated_client_fixture( -""" + """ components: schemas: WithBadDefaultValue: @@ -94,31 +107,44 @@ def test_enum_duplicate_values(self): "2": enum: ["c", "d"] """, - config="literal_enums: true", + config="literal_enums: true", ) class TestLiteralEnumInvalidSchemas: def test_literal_enum_bad_default_value(self, generated_client): - assert_bad_schema(generated_client, "WithBadDefaultValue", "Value B is not valid") + assert_bad_schema( + generated_client, "WithBadDefaultValue", "Value B is not valid" + ) def test_literal_enum_bad_default_type(self, generated_client): - assert_bad_schema(generated_client, "WithBadDefaultType", "Cannot convert 123 to enum") + assert_bad_schema( + generated_client, "WithBadDefaultType", "Cannot convert 123 to enum" + ) def test_literal_enum_mixed_types(self, generated_client): - assert_bad_schema(generated_client, "WithMixedTypes", "Enum values must all be the same type") + assert_bad_schema( + generated_client, "WithMixedTypes", "Enum values must all be the same type" + ) def test_literal_enum_unsupported_type(self, generated_client): - assert_bad_schema(generated_client, "WithUnsupportedType", "Unsupported enum type") + assert_bad_schema( + generated_client, "WithUnsupportedType", "Unsupported enum type" + ) def test_const_default_not_matching(self, generated_client): - assert_bad_schema(generated_client, "DefaultNotMatchingConst", "Invalid value for const") + assert_bad_schema( + generated_client, "DefaultNotMatchingConst", "Invalid value for const" + ) def test_conflicting_inline_literal_enum_names(self, generated_client): - assert "Found conflicting enums named WithConflictingInlineNames12 with incompatible values" in generated_client.generator_result.output + assert ( + "Found conflicting enums named WithConflictingInlineNames12 with incompatible values" + in generated_client.generator_result.output + ) def test_literal_enum_duplicate_values(self): # This one currently causes a full generator failure rather than a warning result = inline_spec_should_fail( -""" + """ components: schemas: WithDuplicateValues: diff --git a/end_to_end_tests/functional_tests/generator_failure_cases/test_invalid_spec_format.py b/end_to_end_tests/functional_tests/generator_failure_cases/test_invalid_spec_format.py index 2b0dfdda9..9f8e9c3d5 100644 --- a/end_to_end_tests/functional_tests/generator_failure_cases/test_invalid_spec_format.py +++ b/end_to_end_tests/functional_tests/generator_failure_cases/test_invalid_spec_format.py @@ -8,19 +8,25 @@ class TestInvalidSpecFormats: @pytest.mark.parametrize( ("filename_suffix", "content", "expected_error"), ( - (".yaml", "not a valid openapi document", "Failed to parse OpenAPI document"), + ( + ".yaml", + "not a valid openapi document", + "Failed to parse OpenAPI document", + ), (".json", "Invalid JSON", "Invalid JSON"), (".yaml", "{", "Invalid YAML"), ), ids=("invalid_openapi", "invalid_json", "invalid_yaml"), ) def test_unparseable_file(self, filename_suffix, content, expected_error): - result = inline_spec_should_fail(content, filename_suffix=filename_suffix, add_missing_sections=False) + result = inline_spec_should_fail( + content, filename_suffix=filename_suffix, add_missing_sections=False + ) assert expected_error in result.output - + def test_missing_openapi_version(self): result = inline_spec_should_fail( -""" + """ info: title: My API version: "1.0" @@ -28,12 +34,16 @@ def test_missing_openapi_version(self): """, add_missing_sections=False, ) - for text in ["Failed to parse OpenAPI document", "1 validation error", "openapi"]: + for text in [ + "Failed to parse OpenAPI document", + "1 validation error", + "openapi", + ]: assert text in result.output def test_missing_title(self): result = inline_spec_should_fail( -""" + """ info: version: "1.0" openapi: "3.1.0" @@ -46,7 +56,7 @@ def test_missing_title(self): def test_missing_version(self): result = inline_spec_should_fail( -""" + """ info: title: My API openapi: "3.1.0" @@ -54,12 +64,16 @@ def test_missing_version(self): """, add_missing_sections=False, ) - for text in ["Failed to parse OpenAPI document", "1 validation error", "version"]: + for text in [ + "Failed to parse OpenAPI document", + "1 validation error", + "version", + ]: assert text in result.output def test_missing_paths(self): result = inline_spec_should_fail( -""" + """ info: title: My API version: "1.0" @@ -72,7 +86,7 @@ def test_missing_paths(self): def test_swagger_unsupported(self): result = inline_spec_should_fail( -""" + """ swagger: "2.0" info: title: My API @@ -83,4 +97,7 @@ def test_swagger_unsupported(self): """, add_missing_sections=False, ) - assert "You may be trying to use a Swagger document; this is not supported by this project." in result.output + assert ( + "You may be trying to use a Swagger document; this is not supported by this project." + in result.output + ) diff --git a/end_to_end_tests/functional_tests/generator_failure_cases/test_invalid_unions.py b/end_to_end_tests/functional_tests/generator_failure_cases/test_invalid_unions.py index 75621a094..03288c0b5 100644 --- a/end_to_end_tests/functional_tests/generator_failure_cases/test_invalid_unions.py +++ b/end_to_end_tests/functional_tests/generator_failure_cases/test_invalid_unions.py @@ -1,8 +1,11 @@ -from end_to_end_tests.functional_tests.helpers import assert_bad_schema, with_generated_client_fixture +from end_to_end_tests.functional_tests.helpers import ( + assert_bad_schema, + with_generated_client_fixture, +) @with_generated_client_fixture( -""" + """ components: schemas: UnionWithInvalidReference: @@ -15,14 +18,20 @@ anyOf: - type: string - type: array # invalid because no items -""" +""" ) class TestUnionInvalidSchemas: def test_invalid_reference(self, generated_client): - assert_bad_schema(generated_client, "UnionWithInvalidReference", "Could not find reference") + assert_bad_schema( + generated_client, "UnionWithInvalidReference", "Could not find reference" + ) def test_invalid_default(self, generated_client): - assert_bad_schema(generated_client, "UnionWithInvalidDefault", "Invalid int value: aaa") + assert_bad_schema( + generated_client, "UnionWithInvalidDefault", "Invalid int value: aaa" + ) def test_invalid_property(self, generated_client): - assert_bad_schema(generated_client, "UnionWithMalformedVariant", "Invalid property in union") + assert_bad_schema( + generated_client, "UnionWithMalformedVariant", "Invalid property in union" + ) diff --git a/end_to_end_tests/functional_tests/helpers.py b/end_to_end_tests/functional_tests/helpers.py index cb63da11b..5320c7fe8 100644 --- a/end_to_end_tests/functional_tests/helpers.py +++ b/end_to_end_tests/functional_tests/helpers.py @@ -1,28 +1,36 @@ -from typing import Any, Dict +from typing import Any import re from typing import Optional from click.testing import Result import pytest -from end_to_end_tests.generated_client import generate_client_from_inline_spec, GeneratedClientContext +from end_to_end_tests.generated_client import ( + generate_client_from_inline_spec, + GeneratedClientContext, +) def with_generated_client_fixture( openapi_spec: str, - name: str="generated_client", - config: str="", + name: str = "generated_client", + config: str = "", extra_args: list[str] = [], ): """Decorator to apply to a test class to create a fixture inside it called 'generated_client'. - + The fixture value will be a GeneratedClientContext created by calling generate_client_from_inline_spec(). """ + def _decorator(cls): def generated_client(self): - with generate_client_from_inline_spec(openapi_spec, extra_args=extra_args, config=config) as g: - print(g.generator_result.stdout) # so we'll see the output if a test failed + with generate_client_from_inline_spec( + openapi_spec, extra_args=extra_args, config=config + ) as g: + print( + g.generator_result.stdout + ) # so we'll see the output if a test failed yield g setattr(cls, name, pytest.fixture(scope="class")(generated_client)) @@ -33,7 +41,7 @@ def generated_client(self): def with_generated_code_import(import_path: str, alias: Optional[str] = None): """Decorator to apply to a test class to create a fixture from a generated code import. - + The 'generated_client' fixture must also be present. If import_path is "a.b.c", then the fixture's value is equal to "from a.b import c", and @@ -48,12 +56,12 @@ def _decorator(cls): def _func(self, generated_client): return generated_client.import_symbol(module_name, import_name) - + alias = alias or import_name _func.__name__ = alias setattr(cls, alias, pytest.fixture(scope="class")(_func)) return cls - + return _decorator @@ -67,13 +75,17 @@ def _decorator(cls): return _decorator -def assert_model_decode_encode(model_class: Any, json_data: dict, expected_instance: Any) -> None: +def assert_model_decode_encode( + model_class: Any, json_data: dict, expected_instance: Any +) -> None: instance = model_class.from_dict(json_data) assert instance == expected_instance assert instance.to_dict() == json_data -def assert_model_property_type_hint(model_class: Any, name: str, expected_type_hint: Any) -> None: +def assert_model_property_type_hint( + model_class: Any, name: str, expected_type_hint: Any +) -> None: assert model_class.__annotations__[name] == expected_type_hint @@ -82,10 +94,10 @@ def inline_spec_should_fail( extra_args: list[str] = [], config: str = "", filename_suffix: str = "", - add_missing_sections = True, + add_missing_sections=True, ) -> Result: """Asserts that the generator could not process the spec. - + Returns the command result, which could include stdout data or an exception. """ with generate_client_from_inline_spec( @@ -106,13 +118,15 @@ def assert_bad_schema( expected_message_str: str, ) -> None: warnings = _GeneratorWarningsParser(generated_client) - assert schema_name in warnings.by_schema, f"Did not find warning for schema {schema_name} in output: {warnings.output}" + assert ( + schema_name in warnings.by_schema + ), f"Did not find warning for schema {schema_name} in output: {warnings.output}" assert expected_message_str in warnings.by_schema[schema_name] class _GeneratorWarningsParser: output: str - by_schema: Dict[str, str] + by_schema: dict[str, str] def __init__(self, generated_client: GeneratedClientContext) -> None: """Runs the generator, asserts that it printed warnings, and parses the warnings.""" @@ -128,8 +142,8 @@ def __init__(self, generated_client: GeneratedClientContext) -> None: if not (match := re.search(bad_schema_regex, output)): break if last_name: - self.by_schema[last_name] = output[0:match.start()] - output = output[match.end():] + self.by_schema[last_name] = output[0 : match.start()] + output = output[match.end() :] last_name = match.group(2) if last_name: self.by_schema[last_name] = output diff --git a/end_to_end_tests/generated_client.py b/end_to_end_tests/generated_client.py index d7cb16fc7..63daa5cb9 100644 --- a/end_to_end_tests/generated_client.py +++ b/end_to_end_tests/generated_client.py @@ -18,7 +18,7 @@ @define class GeneratedClientContext: """A context manager with helpers for tests that run against generated client code. - + On entering this context, sys.path is changed to include the root directory of the generated code, so its modules can be imported. On exit, the original sys.path is restored, and any modules that were loaded within the context are removed. @@ -50,13 +50,16 @@ def import_symbol(self, module_path: str, name: str) -> Any: try: return getattr(module, name) except AttributeError: - existing = ", ".join(name for name in dir(module) if not name.startswith("_")) + existing = ", ".join( + name for name in dir(module) if not name.startswith("_") + ) assert False, ( - f"Couldn't find import \"{name}\" in \"{self.base_module}{module_path}\".\n" + f'Couldn\'t find import "{name}" in "{self.base_module}{module_path}".\n' f"Available imports in that module are: {existing}\n" f"Output from generator was: {self.generator_result.stdout}" ) + def _run_command( command: str, extra_args: Optional[list[str]] = None, @@ -78,7 +81,11 @@ def _run_command( args.extend(extra_args) result = runner.invoke(app, args) if result.exit_code != 0 and raise_on_error: - message = f"{result.stdout}\n{result.exception}" if result.exception else result.stdout + message = ( + f"{result.stdout}\n{result.exception}" + if result.exception + else result.stdout + ) raise Exception(message) return result @@ -101,7 +108,9 @@ def generate_client( args = [*args, "--output-path", str(full_output_path)] if overwrite: args = [*args, "--overwrite"] - generator_result = _run_command("generate", args, openapi_document, raise_on_error=raise_on_error) + generator_result = _run_command( + "generate", args, openapi_document, raise_on_error=raise_on_error + ) return GeneratedClientContext( full_output_path, generator_result, @@ -116,11 +125,11 @@ def generate_client_from_inline_spec( config: str = "", filename_suffix: Optional[str] = None, base_module: str = "testapi_client", - add_missing_sections = True, + add_missing_sections=True, raise_on_error: bool = True, ) -> GeneratedClientContext: """Run the generator on a temporary file created with the specified contents. - + You can also optionally tell it to create a temporary config file. """ if add_missing_sections: @@ -133,12 +142,12 @@ def generate_client_from_inline_spec( output_path = tempfile.mkdtemp() file = tempfile.NamedTemporaryFile(suffix=filename_suffix, delete=False) - file.write(openapi_spec.encode('utf-8')) + file.write(openapi_spec.encode("utf-8")) file.close() if config: config_file = tempfile.NamedTemporaryFile(delete=False) - config_file.write(config.encode('utf-8')) + config_file.write(config.encode("utf-8")) config_file.close() extra_args = [*extra_args, "--config", config_file.name] diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/bodies/json_like.py b/end_to_end_tests/golden-record/my_test_api_client/api/bodies/json_like.py index e49c19427..25518c70a 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/bodies/json_like.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/bodies/json_like.py @@ -28,7 +28,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 200: return None if client.raise_on_unexpected_status: @@ -37,7 +39,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/bodies/post_bodies_multiple.py b/end_to_end_tests/golden-record/my_test_api_client/api/bodies/post_bodies_multiple.py index 652e2c6db..740683d7e 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/bodies/post_bodies_multiple.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/bodies/post_bodies_multiple.py @@ -48,7 +48,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 200: return None if client.raise_on_unexpected_status: @@ -57,7 +59,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/bodies/refs.py b/end_to_end_tests/golden-record/my_test_api_client/api/bodies/refs.py index 81812cdea..fa6e3860f 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/bodies/refs.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/bodies/refs.py @@ -28,7 +28,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 200: return None if client.raise_on_unexpected_status: @@ -37,7 +39,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/config/content_type_override.py b/end_to_end_tests/golden-record/my_test_api_client/api/config/content_type_override.py index d2757f759..bc22ac97f 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/config/content_type_override.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/config/content_type_override.py @@ -27,7 +27,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[str]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[str]: if response.status_code == 200: response_200 = cast(str, response.json()) return response_200 @@ -37,7 +39,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[str]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[str]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/default/get_common_parameters.py b/end_to_end_tests/golden-record/my_test_api_client/api/default/get_common_parameters.py index 7de222f55..46b5b00e1 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/default/get_common_parameters.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/default/get_common_parameters.py @@ -27,7 +27,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 200: return None if client.raise_on_unexpected_status: @@ -36,7 +38,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/default/get_models_oneof_with_required_const.py b/end_to_end_tests/golden-record/my_test_api_client/api/default/get_models_oneof_with_required_const.py index 85f68fb7c..1f82d3aa7 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/default/get_models_oneof_with_required_const.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/default/get_models_oneof_with_required_const.py @@ -26,26 +26,34 @@ def _get_kwargs() -> dict[str, Any]: def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[ - Union["GetModelsOneofWithRequiredConstResponse200Type0", "GetModelsOneofWithRequiredConstResponse200Type1"] + Union[ + "GetModelsOneofWithRequiredConstResponse200Type0", + "GetModelsOneofWithRequiredConstResponse200Type1", + ] ]: if response.status_code == 200: def _parse_response_200( data: object, ) -> Union[ - "GetModelsOneofWithRequiredConstResponse200Type0", "GetModelsOneofWithRequiredConstResponse200Type1" + "GetModelsOneofWithRequiredConstResponse200Type0", + "GetModelsOneofWithRequiredConstResponse200Type1", ]: try: if not isinstance(data, dict): raise TypeError() - response_200_type_0 = GetModelsOneofWithRequiredConstResponse200Type0.from_dict(data) + response_200_type_0 = ( + GetModelsOneofWithRequiredConstResponse200Type0.from_dict(data) + ) return response_200_type_0 except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() - response_200_type_1 = GetModelsOneofWithRequiredConstResponse200Type1.from_dict(data) + response_200_type_1 = ( + GetModelsOneofWithRequiredConstResponse200Type1.from_dict(data) + ) return response_200_type_1 @@ -61,7 +69,10 @@ def _parse_response_200( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[ - Union["GetModelsOneofWithRequiredConstResponse200Type0", "GetModelsOneofWithRequiredConstResponse200Type1"] + Union[ + "GetModelsOneofWithRequiredConstResponse200Type0", + "GetModelsOneofWithRequiredConstResponse200Type1", + ] ]: return Response( status_code=HTTPStatus(response.status_code), @@ -75,7 +86,10 @@ def sync_detailed( *, client: Union[AuthenticatedClient, Client], ) -> Response[ - Union["GetModelsOneofWithRequiredConstResponse200Type0", "GetModelsOneofWithRequiredConstResponse200Type1"] + Union[ + "GetModelsOneofWithRequiredConstResponse200Type0", + "GetModelsOneofWithRequiredConstResponse200Type1", + ] ]: """ Raises: @@ -99,7 +113,10 @@ def sync( *, client: Union[AuthenticatedClient, Client], ) -> Optional[ - Union["GetModelsOneofWithRequiredConstResponse200Type0", "GetModelsOneofWithRequiredConstResponse200Type1"] + Union[ + "GetModelsOneofWithRequiredConstResponse200Type0", + "GetModelsOneofWithRequiredConstResponse200Type1", + ] ]: """ Raises: @@ -119,7 +136,10 @@ async def asyncio_detailed( *, client: Union[AuthenticatedClient, Client], ) -> Response[ - Union["GetModelsOneofWithRequiredConstResponse200Type0", "GetModelsOneofWithRequiredConstResponse200Type1"] + Union[ + "GetModelsOneofWithRequiredConstResponse200Type0", + "GetModelsOneofWithRequiredConstResponse200Type1", + ] ]: """ Raises: @@ -141,7 +161,10 @@ async def asyncio( *, client: Union[AuthenticatedClient, Client], ) -> Optional[ - Union["GetModelsOneofWithRequiredConstResponse200Type0", "GetModelsOneofWithRequiredConstResponse200Type1"] + Union[ + "GetModelsOneofWithRequiredConstResponse200Type0", + "GetModelsOneofWithRequiredConstResponse200Type1", + ] ]: """ Raises: diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/default/post_common_parameters.py b/end_to_end_tests/golden-record/my_test_api_client/api/default/post_common_parameters.py index 5bd941c69..16fc81c9f 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/default/post_common_parameters.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/default/post_common_parameters.py @@ -27,7 +27,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 200: return None if client.raise_on_unexpected_status: @@ -36,7 +38,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/default/reserved_parameters.py b/end_to_end_tests/golden-record/my_test_api_client/api/default/reserved_parameters.py index fe7adf04c..cf68128fc 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/default/reserved_parameters.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/default/reserved_parameters.py @@ -30,7 +30,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 200: return None if client.raise_on_unexpected_status: @@ -39,7 +41,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/enums/bool_enum_tests_bool_enum_post.py b/end_to_end_tests/golden-record/my_test_api_client/api/enums/bool_enum_tests_bool_enum_post.py index 52385855c..6da45ec10 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/enums/bool_enum_tests_bool_enum_post.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/enums/bool_enum_tests_bool_enum_post.py @@ -27,7 +27,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 200: return None if client.raise_on_unexpected_status: @@ -36,7 +38,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/enums/int_enum_tests_int_enum_post.py b/end_to_end_tests/golden-record/my_test_api_client/api/enums/int_enum_tests_int_enum_post.py index 26c3729fe..f45f96976 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/enums/int_enum_tests_int_enum_post.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/enums/int_enum_tests_int_enum_post.py @@ -29,7 +29,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 200: return None if client.raise_on_unexpected_status: @@ -38,7 +40,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_header_types.py b/end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_header_types.py index ad9428a72..43040de58 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_header_types.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_header_types.py @@ -5,8 +5,12 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.get_location_header_types_int_enum_header import GetLocationHeaderTypesIntEnumHeader -from ...models.get_location_header_types_string_enum_header import GetLocationHeaderTypesStringEnumHeader +from ...models.get_location_header_types_int_enum_header import ( + GetLocationHeaderTypesIntEnumHeader, +) +from ...models.get_location_header_types_string_enum_header import ( + GetLocationHeaderTypesStringEnumHeader, +) from ...types import UNSET, Response, Unset @@ -47,7 +51,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 200: return None if client.raise_on_unexpected_status: @@ -56,7 +62,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_query_optionality.py b/end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_query_optionality.py index e28e37a36..9682664ec 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_query_optionality.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_query_optionality.py @@ -53,7 +53,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 200: return None if client.raise_on_unexpected_status: @@ -62,7 +64,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/naming/hyphen_in_path.py b/end_to_end_tests/golden-record/my_test_api_client/api/naming/hyphen_in_path.py index a0caba2d6..5276b2589 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/naming/hyphen_in_path.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/naming/hyphen_in_path.py @@ -19,7 +19,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 200: return None if client.raise_on_unexpected_status: @@ -28,7 +30,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/naming/post_naming_property_conflict_with_import.py b/end_to_end_tests/golden-record/my_test_api_client/api/naming/post_naming_property_conflict_with_import.py index bf1ebf6ca..6f849f0a6 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/naming/post_naming_property_conflict_with_import.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/naming/post_naming_property_conflict_with_import.py @@ -5,7 +5,9 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.post_naming_property_conflict_with_import_body import PostNamingPropertyConflictWithImportBody +from ...models.post_naming_property_conflict_with_import_body import ( + PostNamingPropertyConflictWithImportBody, +) from ...models.post_naming_property_conflict_with_import_response_200 import ( PostNamingPropertyConflictWithImportResponse200, ) @@ -35,7 +37,9 @@ def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[PostNamingPropertyConflictWithImportResponse200]: if response.status_code == 200: - response_200 = PostNamingPropertyConflictWithImportResponse200.from_dict(response.json()) + response_200 = PostNamingPropertyConflictWithImportResponse200.from_dict( + response.json() + ) return response_200 if client.raise_on_unexpected_status: diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/parameter_references/get_parameter_references_path_param.py b/end_to_end_tests/golden-record/my_test_api_client/api/parameter_references/get_parameter_references_path_param.py index e7a8e2712..17c44c125 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/parameter_references/get_parameter_references_path_param.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/parameter_references/get_parameter_references_path_param.py @@ -43,7 +43,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 200: return None if client.raise_on_unexpected_status: @@ -52,7 +54,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/parameters/delete_common_parameters_overriding_param.py b/end_to_end_tests/golden-record/my_test_api_client/api/parameters/delete_common_parameters_overriding_param.py index 704996107..f3023e05f 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/parameters/delete_common_parameters_overriding_param.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/parameters/delete_common_parameters_overriding_param.py @@ -28,7 +28,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 200: return None if client.raise_on_unexpected_status: @@ -37,7 +39,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_common_parameters_overriding_param.py b/end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_common_parameters_overriding_param.py index b6efbba9b..aad25b05b 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_common_parameters_overriding_param.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_common_parameters_overriding_param.py @@ -28,7 +28,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 200: return None if client.raise_on_unexpected_status: @@ -37,7 +39,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_same_name_multiple_locations_param.py b/end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_same_name_multiple_locations_param.py index 6a7ed7fd5..9d6a6d020 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_same_name_multiple_locations_param.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_same_name_multiple_locations_param.py @@ -40,7 +40,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 200: return None if client.raise_on_unexpected_status: @@ -49,7 +51,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/parameters/multiple_path_parameters.py b/end_to_end_tests/golden-record/my_test_api_client/api/parameters/multiple_path_parameters.py index 44345aa26..230365a33 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/parameters/multiple_path_parameters.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/parameters/multiple_path_parameters.py @@ -22,7 +22,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 200: return None if client.raise_on_unexpected_status: @@ -31,7 +33,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/responses/post_responses_unions_simple_before_complex.py b/end_to_end_tests/golden-record/my_test_api_client/api/responses/post_responses_unions_simple_before_complex.py index cf0599306..74754346d 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/responses/post_responses_unions_simple_before_complex.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/responses/post_responses_unions_simple_before_complex.py @@ -24,7 +24,9 @@ def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[PostResponsesUnionsSimpleBeforeComplexResponse200]: if response.status_code == 200: - response_200 = PostResponsesUnionsSimpleBeforeComplexResponse200.from_dict(response.json()) + response_200 = PostResponsesUnionsSimpleBeforeComplexResponse200.from_dict( + response.json() + ) return response_200 if client.raise_on_unexpected_status: diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/responses/reference_response.py b/end_to_end_tests/golden-record/my_test_api_client/api/responses/reference_response.py index ac71e9e50..eddfa3b65 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/responses/reference_response.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/responses/reference_response.py @@ -18,7 +18,9 @@ def _get_kwargs() -> dict[str, Any]: return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[AModel]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AModel]: if response.status_code == 200: response_200 = AModel.from_dict(response.json()) @@ -29,7 +31,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[AModel]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/responses/text_response.py b/end_to_end_tests/golden-record/my_test_api_client/api/responses/text_response.py index 057ceb2de..fc2f2bdaa 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/responses/text_response.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/responses/text_response.py @@ -17,7 +17,9 @@ def _get_kwargs() -> dict[str, Any]: return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[str]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[str]: if response.status_code == 200: response_200 = response.text return response_200 @@ -27,7 +29,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[str]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[str]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tag1/get_tag_with_number.py b/end_to_end_tests/golden-record/my_test_api_client/api/tag1/get_tag_with_number.py index 62631355f..f8fdc0555 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tag1/get_tag_with_number.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tag1/get_tag_with_number.py @@ -17,7 +17,9 @@ def _get_kwargs() -> dict[str, Any]: return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 200: return None if client.raise_on_unexpected_status: @@ -26,7 +28,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tag2/get_tag_with_number.py b/end_to_end_tests/golden-record/my_test_api_client/api/tag2/get_tag_with_number.py index 62631355f..f8fdc0555 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tag2/get_tag_with_number.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tag2/get_tag_with_number.py @@ -17,7 +17,9 @@ def _get_kwargs() -> dict[str, Any]: return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 200: return None if client.raise_on_unexpected_status: @@ -26,7 +28,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/description_with_backslash.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/description_with_backslash.py index e7cd44f70..e36149671 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/description_with_backslash.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/description_with_backslash.py @@ -17,7 +17,9 @@ def _get_kwargs() -> dict[str, Any]: return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 200: return None if client.raise_on_unexpected_status: @@ -26,7 +28,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_booleans.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_booleans.py index 147eed3a7..735df7873 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_booleans.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_booleans.py @@ -17,7 +17,9 @@ def _get_kwargs() -> dict[str, Any]: return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[list[bool]]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[list[bool]]: if response.status_code == 200: response_200 = cast(list[bool], response.json()) @@ -28,7 +30,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[list[bool]]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[list[bool]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_floats.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_floats.py index 02b3abb1f..0b1a38bbf 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_floats.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_floats.py @@ -17,7 +17,9 @@ def _get_kwargs() -> dict[str, Any]: return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[list[float]]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[list[float]]: if response.status_code == 200: response_200 = cast(list[float], response.json()) @@ -28,7 +30,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[list[float]]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[list[float]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_integers.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_integers.py index e71537363..c9706d1a5 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_integers.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_integers.py @@ -17,7 +17,9 @@ def _get_kwargs() -> dict[str, Any]: return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[list[int]]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[list[int]]: if response.status_code == 200: response_200 = cast(list[int], response.json()) @@ -28,7 +30,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[list[int]]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[list[int]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_strings.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_strings.py index 70f153829..25d2397a6 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_strings.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_strings.py @@ -17,7 +17,9 @@ def _get_kwargs() -> dict[str, Any]: return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[list[str]]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[list[str]]: if response.status_code == 200: response_200 = cast(list[str], response.json()) @@ -28,7 +30,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[list[str]]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[list[str]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/no_response_tests_no_response_get.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/no_response_tests_no_response_get.py index 586947f49..eb5909daa 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/no_response_tests_no_response_get.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/no_response_tests_no_response_get.py @@ -17,7 +17,9 @@ def _get_kwargs() -> dict[str, Any]: return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 200: return None if client.raise_on_unexpected_status: @@ -26,7 +28,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/octet_stream_tests_octet_stream_get.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/octet_stream_tests_octet_stream_get.py index efb0f4ae5..30a6f02fa 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/octet_stream_tests_octet_stream_get.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/octet_stream_tests_octet_stream_get.py @@ -18,7 +18,9 @@ def _get_kwargs() -> dict[str, Any]: return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[File]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[File]: if response.status_code == 200: response_200 = File(payload=BytesIO(response.content)) @@ -29,7 +31,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[File]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[File]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/octet_stream_tests_octet_stream_post.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/octet_stream_tests_octet_stream_post.py index bf4a1fcb0..33e355a9a 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/octet_stream_tests_octet_stream_post.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/octet_stream_tests_octet_stream_post.py @@ -6,7 +6,9 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError -from ...models.octet_stream_tests_octet_stream_post_response_200 import OctetStreamTestsOctetStreamPostResponse200 +from ...models.octet_stream_tests_octet_stream_post_response_200 import ( + OctetStreamTestsOctetStreamPostResponse200, +) from ...types import File, Response @@ -33,7 +35,9 @@ def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[Union[HTTPValidationError, OctetStreamTestsOctetStreamPostResponse200]]: if response.status_code == 200: - response_200 = OctetStreamTestsOctetStreamPostResponse200.from_dict(response.json()) + response_200 = OctetStreamTestsOctetStreamPostResponse200.from_dict( + response.json() + ) return response_200 if response.status_code == 422: diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_form_data.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_form_data.py index 41610afc0..94ff03d01 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_form_data.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_form_data.py @@ -28,7 +28,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 200: return None if client.raise_on_unexpected_status: @@ -37,7 +39,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_form_data_inline.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_form_data_inline.py index 9bb3cd7c0..9eae179da 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_form_data_inline.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_form_data_inline.py @@ -28,7 +28,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 200: return None if client.raise_on_unexpected_status: @@ -37,7 +39,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/token_with_cookie_auth_token_with_cookie_get.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/token_with_cookie_auth_token_with_cookie_get.py index 22ac00650..6d8dd617a 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/token_with_cookie_auth_token_with_cookie_get.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/token_with_cookie_auth_token_with_cookie_get.py @@ -24,7 +24,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 200: return None if response.status_code == 401: @@ -35,7 +37,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/unsupported_content_tests_unsupported_content_get.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/unsupported_content_tests_unsupported_content_get.py index 61e8434e6..db910c797 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/unsupported_content_tests_unsupported_content_get.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/unsupported_content_tests_unsupported_content_get.py @@ -17,7 +17,9 @@ def _get_kwargs() -> dict[str, Any]: return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 200: return None if client.raise_on_unexpected_status: @@ -26,7 +28,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/true_/false_.py b/end_to_end_tests/golden-record/my_test_api_client/api/true_/false_.py index b46550153..1836efbf1 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/true_/false_.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/true_/false_.py @@ -27,7 +27,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 200: return None if client.raise_on_unexpected_status: @@ -36,7 +38,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/golden-record/my_test_api_client/client.py b/end_to_end_tests/golden-record/my_test_api_client/client.py index e80446f10..eeffd00c8 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/client.py +++ b/end_to_end_tests/golden-record/my_test_api_client/client.py @@ -38,9 +38,15 @@ class Client: _base_url: str = field(alias="base_url") _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") - _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout") - _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl") - _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _timeout: Optional[httpx.Timeout] = field( + default=None, kw_only=True, alias="timeout" + ) + _verify_ssl: Union[str, bool, ssl.SSLContext] = field( + default=True, kw_only=True, alias="verify_ssl" + ) + _follow_redirects: bool = field( + default=False, kw_only=True, alias="follow_redirects" + ) _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") _client: Optional[httpx.Client] = field(default=None, init=False) _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) @@ -168,9 +174,15 @@ class AuthenticatedClient: _base_url: str = field(alias="base_url") _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") - _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout") - _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl") - _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _timeout: Optional[httpx.Timeout] = field( + default=None, kw_only=True, alias="timeout" + ) + _verify_ssl: Union[str, bool, ssl.SSLContext] = field( + default=True, kw_only=True, alias="verify_ssl" + ) + _follow_redirects: bool = field( + default=False, kw_only=True, alias="follow_redirects" + ) _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") _client: Optional[httpx.Client] = field(default=None, init=False) _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) @@ -214,7 +226,9 @@ def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient": def get_httpx_client(self) -> httpx.Client: """Get the underlying httpx.Client, constructing a new one if not previously set""" if self._client is None: - self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token + self._headers[self.auth_header_name] = ( + f"{self.prefix} {self.token}" if self.prefix else self.token + ) self._client = httpx.Client( base_url=self._base_url, cookies=self._cookies, @@ -235,7 +249,9 @@ def __exit__(self, *args: Any, **kwargs: Any) -> None: """Exit a context manager for internal httpx.Client (see httpx docs)""" self.get_httpx_client().__exit__(*args, **kwargs) - def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "AuthenticatedClient": + def set_async_httpx_client( + self, async_client: httpx.AsyncClient + ) -> "AuthenticatedClient": """Manually the underlying httpx.AsyncClient **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. @@ -246,7 +262,9 @@ def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Authentica def get_async_httpx_client(self) -> httpx.AsyncClient: """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" if self._async_client is None: - self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token + self._headers[self.auth_header_name] = ( + f"{self.prefix} {self.token}" if self.prefix else self.token + ) self._async_client = httpx.AsyncClient( base_url=self._base_url, cookies=self._cookies, diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/__init__.py b/end_to_end_tests/golden-record/my_test_api_client/models/__init__.py index 4d7471400..1c528ec8c 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/__init__.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/__init__.py @@ -4,24 +4,34 @@ from .a_discriminated_union_type_2 import ADiscriminatedUnionType2 from .a_form_data import AFormData from .a_model import AModel -from .a_model_with_properties_reference_that_are_not_object import AModelWithPropertiesReferenceThatAreNotObject +from .a_model_with_properties_reference_that_are_not_object import ( + AModelWithPropertiesReferenceThatAreNotObject, +) from .all_of_has_properties_but_no_type import AllOfHasPropertiesButNoType -from .all_of_has_properties_but_no_type_type_enum import AllOfHasPropertiesButNoTypeTypeEnum +from .all_of_has_properties_but_no_type_type_enum import ( + AllOfHasPropertiesButNoTypeTypeEnum, +) from .all_of_sub_model import AllOfSubModel from .all_of_sub_model_type_enum import AllOfSubModelTypeEnum from .an_all_of_enum import AnAllOfEnum -from .an_array_with_a_circular_ref_in_items_object_a_item import AnArrayWithACircularRefInItemsObjectAItem +from .an_array_with_a_circular_ref_in_items_object_a_item import ( + AnArrayWithACircularRefInItemsObjectAItem, +) from .an_array_with_a_circular_ref_in_items_object_additional_properties_a_item import ( AnArrayWithACircularRefInItemsObjectAdditionalPropertiesAItem, ) from .an_array_with_a_circular_ref_in_items_object_additional_properties_b_item import ( AnArrayWithACircularRefInItemsObjectAdditionalPropertiesBItem, ) -from .an_array_with_a_circular_ref_in_items_object_b_item import AnArrayWithACircularRefInItemsObjectBItem +from .an_array_with_a_circular_ref_in_items_object_b_item import ( + AnArrayWithACircularRefInItemsObjectBItem, +) from .an_array_with_a_recursive_ref_in_items_object_additional_properties_item import ( AnArrayWithARecursiveRefInItemsObjectAdditionalPropertiesItem, ) -from .an_array_with_a_recursive_ref_in_items_object_item import AnArrayWithARecursiveRefInItemsObjectItem +from .an_array_with_a_recursive_ref_in_items_object_item import ( + AnArrayWithARecursiveRefInItemsObjectItem, +) from .an_enum import AnEnum from .an_enum_with_null import AnEnumWithNull from .an_int_enum import AnIntEnum @@ -29,18 +39,34 @@ from .another_all_of_sub_model_type import AnotherAllOfSubModelType from .another_all_of_sub_model_type_enum import AnotherAllOfSubModelTypeEnum from .body_upload_file_tests_upload_post import BodyUploadFileTestsUploadPost -from .body_upload_file_tests_upload_post_additional_property import BodyUploadFileTestsUploadPostAdditionalProperty -from .body_upload_file_tests_upload_post_some_nullable_object import BodyUploadFileTestsUploadPostSomeNullableObject -from .body_upload_file_tests_upload_post_some_object import BodyUploadFileTestsUploadPostSomeObject -from .body_upload_file_tests_upload_post_some_optional_object import BodyUploadFileTestsUploadPostSomeOptionalObject +from .body_upload_file_tests_upload_post_additional_property import ( + BodyUploadFileTestsUploadPostAdditionalProperty, +) +from .body_upload_file_tests_upload_post_some_nullable_object import ( + BodyUploadFileTestsUploadPostSomeNullableObject, +) +from .body_upload_file_tests_upload_post_some_object import ( + BodyUploadFileTestsUploadPostSomeObject, +) +from .body_upload_file_tests_upload_post_some_optional_object import ( + BodyUploadFileTestsUploadPostSomeOptionalObject, +) from .different_enum import DifferentEnum from .extended import Extended from .free_form_model import FreeFormModel -from .get_location_header_types_int_enum_header import GetLocationHeaderTypesIntEnumHeader -from .get_location_header_types_string_enum_header import GetLocationHeaderTypesStringEnumHeader +from .get_location_header_types_int_enum_header import ( + GetLocationHeaderTypesIntEnumHeader, +) +from .get_location_header_types_string_enum_header import ( + GetLocationHeaderTypesStringEnumHeader, +) from .get_models_allof_response_200 import GetModelsAllofResponse200 -from .get_models_oneof_with_required_const_response_200_type_0 import GetModelsOneofWithRequiredConstResponse200Type0 -from .get_models_oneof_with_required_const_response_200_type_1 import GetModelsOneofWithRequiredConstResponse200Type1 +from .get_models_oneof_with_required_const_response_200_type_0 import ( + GetModelsOneofWithRequiredConstResponse200Type0, +) +from .get_models_oneof_with_required_const_response_200_type_1 import ( + GetModelsOneofWithRequiredConstResponse200Type1, +) from .http_validation_error import HTTPValidationError from .import_ import Import from .json_like_body import JsonLikeBody @@ -48,41 +74,69 @@ from .model_from_all_of import ModelFromAllOf from .model_name import ModelName from .model_reference_with_periods import ModelReferenceWithPeriods -from .model_with_additional_properties_inlined import ModelWithAdditionalPropertiesInlined +from .model_with_additional_properties_inlined import ( + ModelWithAdditionalPropertiesInlined, +) from .model_with_additional_properties_inlined_additional_property import ( ModelWithAdditionalPropertiesInlinedAdditionalProperty, ) from .model_with_additional_properties_refed import ModelWithAdditionalPropertiesRefed from .model_with_any_json_properties import ModelWithAnyJsonProperties -from .model_with_any_json_properties_additional_property_type_0 import ModelWithAnyJsonPropertiesAdditionalPropertyType0 +from .model_with_any_json_properties_additional_property_type_0 import ( + ModelWithAnyJsonPropertiesAdditionalPropertyType0, +) from .model_with_backslash_in_description import ModelWithBackslashInDescription from .model_with_circular_ref_a import ModelWithCircularRefA from .model_with_circular_ref_b import ModelWithCircularRefB -from .model_with_circular_ref_in_additional_properties_a import ModelWithCircularRefInAdditionalPropertiesA -from .model_with_circular_ref_in_additional_properties_b import ModelWithCircularRefInAdditionalPropertiesB +from .model_with_circular_ref_in_additional_properties_a import ( + ModelWithCircularRefInAdditionalPropertiesA, +) +from .model_with_circular_ref_in_additional_properties_b import ( + ModelWithCircularRefInAdditionalPropertiesB, +) from .model_with_date_time_property import ModelWithDateTimeProperty from .model_with_discriminated_union import ModelWithDiscriminatedUnion from .model_with_merged_properties import ModelWithMergedProperties -from .model_with_merged_properties_string_to_enum import ModelWithMergedPropertiesStringToEnum +from .model_with_merged_properties_string_to_enum import ( + ModelWithMergedPropertiesStringToEnum, +) from .model_with_no_properties import ModelWithNoProperties -from .model_with_primitive_additional_properties import ModelWithPrimitiveAdditionalProperties -from .model_with_primitive_additional_properties_a_date_holder import ModelWithPrimitiveAdditionalPropertiesADateHolder +from .model_with_primitive_additional_properties import ( + ModelWithPrimitiveAdditionalProperties, +) +from .model_with_primitive_additional_properties_a_date_holder import ( + ModelWithPrimitiveAdditionalPropertiesADateHolder, +) from .model_with_property_ref import ModelWithPropertyRef from .model_with_recursive_ref import ModelWithRecursiveRef -from .model_with_recursive_ref_in_additional_properties import ModelWithRecursiveRefInAdditionalProperties +from .model_with_recursive_ref_in_additional_properties import ( + ModelWithRecursiveRefInAdditionalProperties, +) from .model_with_union_property import ModelWithUnionProperty from .model_with_union_property_inlined import ModelWithUnionPropertyInlined -from .model_with_union_property_inlined_apples import ModelWithUnionPropertyInlinedApples -from .model_with_union_property_inlined_bananas import ModelWithUnionPropertyInlinedBananas +from .model_with_union_property_inlined_apples import ( + ModelWithUnionPropertyInlinedApples, +) +from .model_with_union_property_inlined_bananas import ( + ModelWithUnionPropertyInlinedBananas, +) from .none import None_ -from .octet_stream_tests_octet_stream_post_response_200 import OctetStreamTestsOctetStreamPostResponse200 +from .octet_stream_tests_octet_stream_post_response_200 import ( + OctetStreamTestsOctetStreamPostResponse200, +) from .post_bodies_multiple_data_body import PostBodiesMultipleDataBody from .post_bodies_multiple_files_body import PostBodiesMultipleFilesBody from .post_bodies_multiple_json_body import PostBodiesMultipleJsonBody from .post_form_data_inline_body import PostFormDataInlineBody -from .post_naming_property_conflict_with_import_body import PostNamingPropertyConflictWithImportBody -from .post_naming_property_conflict_with_import_response_200 import PostNamingPropertyConflictWithImportResponse200 -from .post_responses_unions_simple_before_complex_response_200 import PostResponsesUnionsSimpleBeforeComplexResponse200 +from .post_naming_property_conflict_with_import_body import ( + PostNamingPropertyConflictWithImportBody, +) +from .post_naming_property_conflict_with_import_response_200 import ( + PostNamingPropertyConflictWithImportResponse200, +) +from .post_responses_unions_simple_before_complex_response_200 import ( + PostResponsesUnionsSimpleBeforeComplexResponse200, +) from .post_responses_unions_simple_before_complex_response_200a_type_1 import ( PostResponsesUnionsSimpleBeforeComplexResponse200AType1, ) diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/a_model.py b/end_to_end_tests/golden-record/my_test_api_client/models/a_model.py index db3c56629..8cf1a1a28 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/a_model.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/a_model.py @@ -74,8 +74,12 @@ class AModel: attr_leading_underscore: Union[Unset, str] = UNSET not_required_nullable: Union[None, Unset, str] = UNSET not_required_not_nullable: Union[Unset, str] = UNSET - not_required_one_of_models: Union["FreeFormModel", "ModelWithUnionProperty", Unset] = UNSET - not_required_nullable_one_of_models: Union["FreeFormModel", "ModelWithUnionProperty", None, Unset, str] = UNSET + not_required_one_of_models: Union[ + "FreeFormModel", "ModelWithUnionProperty", Unset + ] = UNSET + not_required_nullable_one_of_models: Union[ + "FreeFormModel", "ModelWithUnionProperty", None, Unset, str + ] = UNSET not_required_model: Union[Unset, "ModelWithUnionProperty"] = UNSET not_required_nullable_model: Union["ModelWithUnionProperty", None, Unset] = UNSET @@ -85,7 +89,9 @@ def to_dict(self) -> dict[str, Any]: an_enum_value = self.an_enum_value.value - an_allof_enum_with_overridden_default = self.an_allof_enum_with_overridden_default.value + an_allof_enum_with_overridden_default = ( + self.an_allof_enum_with_overridden_default.value + ) a_camel_date_time: str if isinstance(self.a_camel_date_time, datetime.datetime): @@ -149,8 +155,12 @@ def to_dict(self) -> dict[str, Any]: nested_list_of_enums = [] for nested_list_of_enums_item_data in self.nested_list_of_enums: nested_list_of_enums_item = [] - for nested_list_of_enums_item_item_data in nested_list_of_enums_item_data: - nested_list_of_enums_item_item = nested_list_of_enums_item_item_data.value + for ( + nested_list_of_enums_item_item_data + ) in nested_list_of_enums_item_data: + nested_list_of_enums_item_item = ( + nested_list_of_enums_item_item_data.value + ) nested_list_of_enums_item.append(nested_list_of_enums_item_item) nested_list_of_enums.append(nested_list_of_enums_item) @@ -187,11 +197,19 @@ def to_dict(self) -> dict[str, Any]: if isinstance(self.not_required_nullable_one_of_models, Unset): not_required_nullable_one_of_models = UNSET elif isinstance(self.not_required_nullable_one_of_models, FreeFormModel): - not_required_nullable_one_of_models = self.not_required_nullable_one_of_models.to_dict() - elif isinstance(self.not_required_nullable_one_of_models, ModelWithUnionProperty): - not_required_nullable_one_of_models = self.not_required_nullable_one_of_models.to_dict() + not_required_nullable_one_of_models = ( + self.not_required_nullable_one_of_models.to_dict() + ) + elif isinstance( + self.not_required_nullable_one_of_models, ModelWithUnionProperty + ): + not_required_nullable_one_of_models = ( + self.not_required_nullable_one_of_models.to_dict() + ) else: - not_required_nullable_one_of_models = self.not_required_nullable_one_of_models + not_required_nullable_one_of_models = ( + self.not_required_nullable_one_of_models + ) not_required_model: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.not_required_model, Unset): @@ -245,7 +263,9 @@ def to_dict(self) -> dict[str, Any]: if not_required_one_of_models is not UNSET: field_dict["not_required_one_of_models"] = not_required_one_of_models if not_required_nullable_one_of_models is not UNSET: - field_dict["not_required_nullable_one_of_models"] = not_required_nullable_one_of_models + field_dict["not_required_nullable_one_of_models"] = ( + not_required_nullable_one_of_models + ) if not_required_model is not UNSET: field_dict["not_required_model"] = not_required_model if not_required_nullable_model is not UNSET: @@ -261,9 +281,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) an_enum_value = AnEnum(d.pop("an_enum_value")) - an_allof_enum_with_overridden_default = AnAllOfEnum(d.pop("an_allof_enum_with_overridden_default")) + an_allof_enum_with_overridden_default = AnAllOfEnum( + d.pop("an_allof_enum_with_overridden_default") + ) - def _parse_a_camel_date_time(data: object) -> Union[datetime.date, datetime.datetime]: + def _parse_a_camel_date_time( + data: object, + ) -> Union[datetime.date, datetime.datetime]: try: if not isinstance(data, str): raise TypeError() @@ -323,7 +347,9 @@ def _parse_required_nullable(data: object) -> Union[None, str]: required_not_nullable = d.pop("required_not_nullable") - def _parse_one_of_models(data: object) -> Union["FreeFormModel", "ModelWithUnionProperty", Any]: + def _parse_one_of_models( + data: object, + ) -> Union["FreeFormModel", "ModelWithUnionProperty", Any]: try: if not isinstance(data, dict): raise TypeError() @@ -344,7 +370,9 @@ def _parse_one_of_models(data: object) -> Union["FreeFormModel", "ModelWithUnion one_of_models = _parse_one_of_models(d.pop("one_of_models")) - def _parse_nullable_one_of_models(data: object) -> Union["FreeFormModel", "ModelWithUnionProperty", None]: + def _parse_nullable_one_of_models( + data: object, + ) -> Union["FreeFormModel", "ModelWithUnionProperty", None]: if data is None: return data try: @@ -365,11 +393,15 @@ def _parse_nullable_one_of_models(data: object) -> Union["FreeFormModel", "Model pass return cast(Union["FreeFormModel", "ModelWithUnionProperty", None], data) - nullable_one_of_models = _parse_nullable_one_of_models(d.pop("nullable_one_of_models")) + nullable_one_of_models = _parse_nullable_one_of_models( + d.pop("nullable_one_of_models") + ) model = ModelWithUnionProperty.from_dict(d.pop("model")) - def _parse_nullable_model(data: object) -> Union["ModelWithUnionProperty", None]: + def _parse_nullable_model( + data: object, + ) -> Union["ModelWithUnionProperty", None]: if data is None: return data try: @@ -399,7 +431,9 @@ def _parse_nullable_model(data: object) -> Union["ModelWithUnionProperty", None] nested_list_of_enums_item = [] _nested_list_of_enums_item = nested_list_of_enums_item_data for nested_list_of_enums_item_item_data in _nested_list_of_enums_item: - nested_list_of_enums_item_item = DifferentEnum(nested_list_of_enums_item_item_data) + nested_list_of_enums_item_item = DifferentEnum( + nested_list_of_enums_item_item_data + ) nested_list_of_enums_item.append(nested_list_of_enums_item_item) @@ -430,11 +464,15 @@ def _parse_not_required_nullable(data: object) -> Union[None, Unset, str]: return data return cast(Union[None, Unset, str], data) - not_required_nullable = _parse_not_required_nullable(d.pop("not_required_nullable", UNSET)) + not_required_nullable = _parse_not_required_nullable( + d.pop("not_required_nullable", UNSET) + ) not_required_not_nullable = d.pop("not_required_not_nullable", UNSET) - def _parse_not_required_one_of_models(data: object) -> Union["FreeFormModel", "ModelWithUnionProperty", Unset]: + def _parse_not_required_one_of_models( + data: object, + ) -> Union["FreeFormModel", "ModelWithUnionProperty", Unset]: if isinstance(data, Unset): return data try: @@ -451,7 +489,9 @@ def _parse_not_required_one_of_models(data: object) -> Union["FreeFormModel", "M return not_required_one_of_models_type_1 - not_required_one_of_models = _parse_not_required_one_of_models(d.pop("not_required_one_of_models", UNSET)) + not_required_one_of_models = _parse_not_required_one_of_models( + d.pop("not_required_one_of_models", UNSET) + ) def _parse_not_required_nullable_one_of_models( data: object, @@ -463,7 +503,9 @@ def _parse_not_required_nullable_one_of_models( try: if not isinstance(data, dict): raise TypeError() - not_required_nullable_one_of_models_type_0 = FreeFormModel.from_dict(data) + not_required_nullable_one_of_models_type_0 = FreeFormModel.from_dict( + data + ) return not_required_nullable_one_of_models_type_0 except: # noqa: E722 @@ -471,15 +513,21 @@ def _parse_not_required_nullable_one_of_models( try: if not isinstance(data, dict): raise TypeError() - not_required_nullable_one_of_models_type_1 = ModelWithUnionProperty.from_dict(data) + not_required_nullable_one_of_models_type_1 = ( + ModelWithUnionProperty.from_dict(data) + ) return not_required_nullable_one_of_models_type_1 except: # noqa: E722 pass - return cast(Union["FreeFormModel", "ModelWithUnionProperty", None, Unset, str], data) - - not_required_nullable_one_of_models = _parse_not_required_nullable_one_of_models( - d.pop("not_required_nullable_one_of_models", UNSET) + return cast( + Union["FreeFormModel", "ModelWithUnionProperty", None, Unset, str], data + ) + + not_required_nullable_one_of_models = ( + _parse_not_required_nullable_one_of_models( + d.pop("not_required_nullable_one_of_models", UNSET) + ) ) _not_required_model = d.pop("not_required_model", UNSET) @@ -489,7 +537,9 @@ def _parse_not_required_nullable_one_of_models( else: not_required_model = ModelWithUnionProperty.from_dict(_not_required_model) - def _parse_not_required_nullable_model(data: object) -> Union["ModelWithUnionProperty", None, Unset]: + def _parse_not_required_nullable_model( + data: object, + ) -> Union["ModelWithUnionProperty", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -497,14 +547,18 @@ def _parse_not_required_nullable_model(data: object) -> Union["ModelWithUnionPro try: if not isinstance(data, dict): raise TypeError() - not_required_nullable_model_type_1 = ModelWithUnionProperty.from_dict(data) + not_required_nullable_model_type_1 = ModelWithUnionProperty.from_dict( + data + ) return not_required_nullable_model_type_1 except: # noqa: E722 pass return cast(Union["ModelWithUnionProperty", None, Unset], data) - not_required_nullable_model = _parse_not_required_nullable_model(d.pop("not_required_nullable_model", UNSET)) + not_required_nullable_model = _parse_not_required_nullable_model( + d.pop("not_required_nullable_model", UNSET) + ) a_model = cls( an_enum_value=an_enum_value, diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/a_model_with_properties_reference_that_are_not_object.py b/end_to_end_tests/golden-record/my_test_api_client/models/a_model_with_properties_reference_that_are_not_object.py index 2d165b50e..90b0e7029 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/a_model_with_properties_reference_that_are_not_object.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/a_model_with_properties_reference_that_are_not_object.py @@ -83,25 +83,35 @@ class AModelWithPropertiesReferenceThatAreNotObject: def to_dict(self) -> dict[str, Any]: enum_properties_ref = [] - for componentsschemas_an_other_array_of_enum_item_data in self.enum_properties_ref: - componentsschemas_an_other_array_of_enum_item = componentsschemas_an_other_array_of_enum_item_data.value + for ( + componentsschemas_an_other_array_of_enum_item_data + ) in self.enum_properties_ref: + componentsschemas_an_other_array_of_enum_item = ( + componentsschemas_an_other_array_of_enum_item_data.value + ) enum_properties_ref.append(componentsschemas_an_other_array_of_enum_item) str_properties_ref = self.str_properties_ref date_properties_ref = [] - for componentsschemas_an_other_array_of_date_item_data in self.date_properties_ref: + for ( + componentsschemas_an_other_array_of_date_item_data + ) in self.date_properties_ref: componentsschemas_an_other_array_of_date_item = ( componentsschemas_an_other_array_of_date_item_data.isoformat() ) date_properties_ref.append(componentsschemas_an_other_array_of_date_item) datetime_properties_ref = [] - for componentsschemas_an_other_array_of_date_time_item_data in self.datetime_properties_ref: + for ( + componentsschemas_an_other_array_of_date_time_item_data + ) in self.datetime_properties_ref: componentsschemas_an_other_array_of_date_time_item = ( componentsschemas_an_other_array_of_date_time_item_data.isoformat() ) - datetime_properties_ref.append(componentsschemas_an_other_array_of_date_time_item) + datetime_properties_ref.append( + componentsschemas_an_other_array_of_date_time_item + ) int32_properties_ref = self.int32_properties_ref @@ -112,7 +122,9 @@ def to_dict(self) -> dict[str, Any]: double_properties_ref = self.double_properties_ref file_properties_ref = [] - for componentsschemas_an_other_array_of_file_item_data in self.file_properties_ref: + for ( + componentsschemas_an_other_array_of_file_item_data + ) in self.file_properties_ref: componentsschemas_an_other_array_of_file_item = ( componentsschemas_an_other_array_of_file_item_data.to_tuple() ) @@ -123,19 +135,27 @@ def to_dict(self) -> dict[str, Any]: enum_properties = [] for componentsschemas_an_array_of_enum_item_data in self.enum_properties: - componentsschemas_an_array_of_enum_item = componentsschemas_an_array_of_enum_item_data.value + componentsschemas_an_array_of_enum_item = ( + componentsschemas_an_array_of_enum_item_data.value + ) enum_properties.append(componentsschemas_an_array_of_enum_item) str_properties = self.str_properties date_properties = [] for componentsschemas_an_array_of_date_item_data in self.date_properties: - componentsschemas_an_array_of_date_item = componentsschemas_an_array_of_date_item_data.isoformat() + componentsschemas_an_array_of_date_item = ( + componentsschemas_an_array_of_date_item_data.isoformat() + ) date_properties.append(componentsschemas_an_array_of_date_item) datetime_properties = [] - for componentsschemas_an_array_of_date_time_item_data in self.datetime_properties: - componentsschemas_an_array_of_date_time_item = componentsschemas_an_array_of_date_time_item_data.isoformat() + for ( + componentsschemas_an_array_of_date_time_item_data + ) in self.datetime_properties: + componentsschemas_an_array_of_date_time_item = ( + componentsschemas_an_array_of_date_time_item_data.isoformat() + ) datetime_properties.append(componentsschemas_an_array_of_date_time_item) int32_properties = self.int32_properties @@ -148,7 +168,9 @@ def to_dict(self) -> dict[str, Any]: file_properties = [] for componentsschemas_an_array_of_file_item_data in self.file_properties: - componentsschemas_an_array_of_file_item = componentsschemas_an_array_of_file_item_data.to_tuple() + componentsschemas_an_array_of_file_item = ( + componentsschemas_an_array_of_file_item_data.to_tuple() + ) file_properties.append(componentsschemas_an_array_of_file_item) @@ -219,7 +241,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enum_properties_ref = [] _enum_properties_ref = d.pop("enum_properties_ref") for componentsschemas_an_other_array_of_enum_item_data in _enum_properties_ref: - componentsschemas_an_other_array_of_enum_item = AnEnum(componentsschemas_an_other_array_of_enum_item_data) + componentsschemas_an_other_array_of_enum_item = AnEnum( + componentsschemas_an_other_array_of_enum_item_data + ) enum_properties_ref.append(componentsschemas_an_other_array_of_enum_item) @@ -236,12 +260,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: datetime_properties_ref = [] _datetime_properties_ref = d.pop("datetime_properties_ref") - for componentsschemas_an_other_array_of_date_time_item_data in _datetime_properties_ref: + for ( + componentsschemas_an_other_array_of_date_time_item_data + ) in _datetime_properties_ref: componentsschemas_an_other_array_of_date_time_item = isoparse( componentsschemas_an_other_array_of_date_time_item_data ) - datetime_properties_ref.append(componentsschemas_an_other_array_of_date_time_item) + datetime_properties_ref.append( + componentsschemas_an_other_array_of_date_time_item + ) int32_properties_ref = cast(list[int], d.pop("int32_properties_ref")) @@ -265,7 +293,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enum_properties = [] _enum_properties = d.pop("enum_properties") for componentsschemas_an_array_of_enum_item_data in _enum_properties: - componentsschemas_an_array_of_enum_item = AnEnum(componentsschemas_an_array_of_enum_item_data) + componentsschemas_an_array_of_enum_item = AnEnum( + componentsschemas_an_array_of_enum_item_data + ) enum_properties.append(componentsschemas_an_array_of_enum_item) @@ -274,14 +304,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: date_properties = [] _date_properties = d.pop("date_properties") for componentsschemas_an_array_of_date_item_data in _date_properties: - componentsschemas_an_array_of_date_item = isoparse(componentsschemas_an_array_of_date_item_data).date() + componentsschemas_an_array_of_date_item = isoparse( + componentsschemas_an_array_of_date_item_data + ).date() date_properties.append(componentsschemas_an_array_of_date_item) datetime_properties = [] _datetime_properties = d.pop("datetime_properties") for componentsschemas_an_array_of_date_time_item_data in _datetime_properties: - componentsschemas_an_array_of_date_time_item = isoparse(componentsschemas_an_array_of_date_time_item_data) + componentsschemas_an_array_of_date_time_item = isoparse( + componentsschemas_an_array_of_date_time_item_data + ) datetime_properties.append(componentsschemas_an_array_of_date_time_item) diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/all_of_has_properties_but_no_type.py b/end_to_end_tests/golden-record/my_test_api_client/models/all_of_has_properties_but_no_type.py index 7ff816bd4..1bb9de0f2 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/all_of_has_properties_but_no_type.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/all_of_has_properties_but_no_type.py @@ -4,7 +4,9 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..models.all_of_has_properties_but_no_type_type_enum import AllOfHasPropertiesButNoTypeTypeEnum +from ..models.all_of_has_properties_but_no_type_type_enum import ( + AllOfHasPropertiesButNoTypeTypeEnum, +) from ..types import UNSET, Unset T = TypeVar("T", bound="AllOfHasPropertiesButNoType") diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_a_item.py b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_a_item.py index 54c4da080..dfe56ab9d 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_a_item.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_a_item.py @@ -7,7 +7,9 @@ from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.an_array_with_a_circular_ref_in_items_object_b_item import AnArrayWithACircularRefInItemsObjectBItem + from ..models.an_array_with_a_circular_ref_in_items_object_b_item import ( + AnArrayWithACircularRefInItemsObjectBItem, + ) T = TypeVar("T", bound="AnArrayWithACircularRefInItemsObjectAItem") @@ -27,11 +29,13 @@ def to_dict(self) -> dict[str, Any]: circular: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.circular, Unset): circular = [] - for componentsschemas_an_array_with_a_circular_ref_in_items_object_b_item_data in self.circular: + for componentsschemas_an_array_with_a_circular_ref_in_items_object_b_item_data in (self.circular): componentsschemas_an_array_with_a_circular_ref_in_items_object_b_item = ( componentsschemas_an_array_with_a_circular_ref_in_items_object_b_item_data.to_dict() ) - circular.append(componentsschemas_an_array_with_a_circular_ref_in_items_object_b_item) + circular.append( + componentsschemas_an_array_with_a_circular_ref_in_items_object_b_item + ) field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -50,14 +54,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) circular = [] _circular = d.pop("circular", UNSET) - for componentsschemas_an_array_with_a_circular_ref_in_items_object_b_item_data in _circular or []: - componentsschemas_an_array_with_a_circular_ref_in_items_object_b_item = ( - AnArrayWithACircularRefInItemsObjectBItem.from_dict( - componentsschemas_an_array_with_a_circular_ref_in_items_object_b_item_data - ) + for ( + componentsschemas_an_array_with_a_circular_ref_in_items_object_b_item_data + ) in (_circular or []): + componentsschemas_an_array_with_a_circular_ref_in_items_object_b_item = AnArrayWithACircularRefInItemsObjectBItem.from_dict( + componentsschemas_an_array_with_a_circular_ref_in_items_object_b_item_data ) - circular.append(componentsschemas_an_array_with_a_circular_ref_in_items_object_b_item) + circular.append( + componentsschemas_an_array_with_a_circular_ref_in_items_object_b_item + ) an_array_with_a_circular_ref_in_items_object_a_item = cls( circular=circular, diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_additional_properties_a_item.py b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_additional_properties_a_item.py index 70aa27507..968f53b6e 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_additional_properties_a_item.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_additional_properties_a_item.py @@ -17,18 +17,18 @@ class AnArrayWithACircularRefInItemsObjectAdditionalPropertiesAItem: """ """ - additional_properties: dict[str, list["AnArrayWithACircularRefInItemsObjectAdditionalPropertiesBItem"]] = ( - _attrs_field(init=False, factory=dict) - ) + additional_properties: dict[ + str, list["AnArrayWithACircularRefInItemsObjectAdditionalPropertiesBItem"] + ] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} for prop_name, prop in self.additional_properties.items(): field_dict[prop_name] = [] - for ( - componentsschemas_an_array_with_a_circular_ref_in_items_object_additional_properties_b_item_data - ) in prop: - componentsschemas_an_array_with_a_circular_ref_in_items_object_additional_properties_b_item = componentsschemas_an_array_with_a_circular_ref_in_items_object_additional_properties_b_item_data.to_dict() + for componentsschemas_an_array_with_a_circular_ref_in_items_object_additional_properties_b_item_data in (prop): + componentsschemas_an_array_with_a_circular_ref_in_items_object_additional_properties_b_item = ( + componentsschemas_an_array_with_a_circular_ref_in_items_object_additional_properties_b_item_data.to_dict() + ) field_dict[prop_name].append( componentsschemas_an_array_with_a_circular_ref_in_items_object_additional_properties_b_item ) @@ -42,19 +42,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) d = dict(src_dict) - an_array_with_a_circular_ref_in_items_object_additional_properties_a_item = cls() + an_array_with_a_circular_ref_in_items_object_additional_properties_a_item = ( + cls() + ) additional_properties = {} for prop_name, prop_dict in d.items(): additional_property = [] _additional_property = prop_dict - for ( - componentsschemas_an_array_with_a_circular_ref_in_items_object_additional_properties_b_item_data - ) in _additional_property: - componentsschemas_an_array_with_a_circular_ref_in_items_object_additional_properties_b_item = ( - AnArrayWithACircularRefInItemsObjectAdditionalPropertiesBItem.from_dict( - componentsschemas_an_array_with_a_circular_ref_in_items_object_additional_properties_b_item_data - ) + for componentsschemas_an_array_with_a_circular_ref_in_items_object_additional_properties_b_item_data in (_additional_property): + componentsschemas_an_array_with_a_circular_ref_in_items_object_additional_properties_b_item = AnArrayWithACircularRefInItemsObjectAdditionalPropertiesBItem.from_dict( + componentsschemas_an_array_with_a_circular_ref_in_items_object_additional_properties_b_item_data ) additional_property.append( @@ -72,11 +70,15 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) - def __getitem__(self, key: str) -> list["AnArrayWithACircularRefInItemsObjectAdditionalPropertiesBItem"]: + def __getitem__( + self, key: str + ) -> list["AnArrayWithACircularRefInItemsObjectAdditionalPropertiesBItem"]: return self.additional_properties[key] def __setitem__( - self, key: str, value: list["AnArrayWithACircularRefInItemsObjectAdditionalPropertiesBItem"] + self, + key: str, + value: list["AnArrayWithACircularRefInItemsObjectAdditionalPropertiesBItem"], ) -> None: self.additional_properties[key] = value diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_additional_properties_b_item.py b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_additional_properties_b_item.py index 119557650..f63ee6324 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_additional_properties_b_item.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_additional_properties_b_item.py @@ -17,18 +17,18 @@ class AnArrayWithACircularRefInItemsObjectAdditionalPropertiesBItem: """ """ - additional_properties: dict[str, list["AnArrayWithACircularRefInItemsObjectAdditionalPropertiesAItem"]] = ( - _attrs_field(init=False, factory=dict) - ) + additional_properties: dict[ + str, list["AnArrayWithACircularRefInItemsObjectAdditionalPropertiesAItem"] + ] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} for prop_name, prop in self.additional_properties.items(): field_dict[prop_name] = [] - for ( - componentsschemas_an_array_with_a_circular_ref_in_items_object_additional_properties_a_item_data - ) in prop: - componentsschemas_an_array_with_a_circular_ref_in_items_object_additional_properties_a_item = componentsschemas_an_array_with_a_circular_ref_in_items_object_additional_properties_a_item_data.to_dict() + for componentsschemas_an_array_with_a_circular_ref_in_items_object_additional_properties_a_item_data in (prop): + componentsschemas_an_array_with_a_circular_ref_in_items_object_additional_properties_a_item = ( + componentsschemas_an_array_with_a_circular_ref_in_items_object_additional_properties_a_item_data.to_dict() + ) field_dict[prop_name].append( componentsschemas_an_array_with_a_circular_ref_in_items_object_additional_properties_a_item ) @@ -42,19 +42,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) d = dict(src_dict) - an_array_with_a_circular_ref_in_items_object_additional_properties_b_item = cls() + an_array_with_a_circular_ref_in_items_object_additional_properties_b_item = ( + cls() + ) additional_properties = {} for prop_name, prop_dict in d.items(): additional_property = [] _additional_property = prop_dict - for ( - componentsschemas_an_array_with_a_circular_ref_in_items_object_additional_properties_a_item_data - ) in _additional_property: - componentsschemas_an_array_with_a_circular_ref_in_items_object_additional_properties_a_item = ( - AnArrayWithACircularRefInItemsObjectAdditionalPropertiesAItem.from_dict( - componentsschemas_an_array_with_a_circular_ref_in_items_object_additional_properties_a_item_data - ) + for componentsschemas_an_array_with_a_circular_ref_in_items_object_additional_properties_a_item_data in (_additional_property): + componentsschemas_an_array_with_a_circular_ref_in_items_object_additional_properties_a_item = AnArrayWithACircularRefInItemsObjectAdditionalPropertiesAItem.from_dict( + componentsschemas_an_array_with_a_circular_ref_in_items_object_additional_properties_a_item_data ) additional_property.append( @@ -72,11 +70,15 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) - def __getitem__(self, key: str) -> list["AnArrayWithACircularRefInItemsObjectAdditionalPropertiesAItem"]: + def __getitem__( + self, key: str + ) -> list["AnArrayWithACircularRefInItemsObjectAdditionalPropertiesAItem"]: return self.additional_properties[key] def __setitem__( - self, key: str, value: list["AnArrayWithACircularRefInItemsObjectAdditionalPropertiesAItem"] + self, + key: str, + value: list["AnArrayWithACircularRefInItemsObjectAdditionalPropertiesAItem"], ) -> None: self.additional_properties[key] = value diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_b_item.py b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_b_item.py index e9b891737..84acd9cfb 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_b_item.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_b_item.py @@ -7,7 +7,9 @@ from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.an_array_with_a_circular_ref_in_items_object_a_item import AnArrayWithACircularRefInItemsObjectAItem + from ..models.an_array_with_a_circular_ref_in_items_object_a_item import ( + AnArrayWithACircularRefInItemsObjectAItem, + ) T = TypeVar("T", bound="AnArrayWithACircularRefInItemsObjectBItem") @@ -27,11 +29,13 @@ def to_dict(self) -> dict[str, Any]: circular: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.circular, Unset): circular = [] - for componentsschemas_an_array_with_a_circular_ref_in_items_object_a_item_data in self.circular: + for componentsschemas_an_array_with_a_circular_ref_in_items_object_a_item_data in (self.circular): componentsschemas_an_array_with_a_circular_ref_in_items_object_a_item = ( componentsschemas_an_array_with_a_circular_ref_in_items_object_a_item_data.to_dict() ) - circular.append(componentsschemas_an_array_with_a_circular_ref_in_items_object_a_item) + circular.append( + componentsschemas_an_array_with_a_circular_ref_in_items_object_a_item + ) field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -50,14 +54,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) circular = [] _circular = d.pop("circular", UNSET) - for componentsschemas_an_array_with_a_circular_ref_in_items_object_a_item_data in _circular or []: - componentsschemas_an_array_with_a_circular_ref_in_items_object_a_item = ( - AnArrayWithACircularRefInItemsObjectAItem.from_dict( - componentsschemas_an_array_with_a_circular_ref_in_items_object_a_item_data - ) + for ( + componentsschemas_an_array_with_a_circular_ref_in_items_object_a_item_data + ) in (_circular or []): + componentsschemas_an_array_with_a_circular_ref_in_items_object_a_item = AnArrayWithACircularRefInItemsObjectAItem.from_dict( + componentsschemas_an_array_with_a_circular_ref_in_items_object_a_item_data ) - circular.append(componentsschemas_an_array_with_a_circular_ref_in_items_object_a_item) + circular.append( + componentsschemas_an_array_with_a_circular_ref_in_items_object_a_item + ) an_array_with_a_circular_ref_in_items_object_b_item = cls( circular=circular, diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_recursive_ref_in_items_object_additional_properties_item.py b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_recursive_ref_in_items_object_additional_properties_item.py index 262617c7a..f4dfef8bc 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_recursive_ref_in_items_object_additional_properties_item.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_recursive_ref_in_items_object_additional_properties_item.py @@ -11,16 +11,18 @@ class AnArrayWithARecursiveRefInItemsObjectAdditionalPropertiesItem: """ """ - additional_properties: dict[str, list["AnArrayWithARecursiveRefInItemsObjectAdditionalPropertiesItem"]] = ( - _attrs_field(init=False, factory=dict) - ) + additional_properties: dict[ + str, list["AnArrayWithARecursiveRefInItemsObjectAdditionalPropertiesItem"] + ] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} for prop_name, prop in self.additional_properties.items(): field_dict[prop_name] = [] - for componentsschemas_an_array_with_a_recursive_ref_in_items_object_additional_properties_item_data in prop: - componentsschemas_an_array_with_a_recursive_ref_in_items_object_additional_properties_item = componentsschemas_an_array_with_a_recursive_ref_in_items_object_additional_properties_item_data.to_dict() + for componentsschemas_an_array_with_a_recursive_ref_in_items_object_additional_properties_item_data in (prop): + componentsschemas_an_array_with_a_recursive_ref_in_items_object_additional_properties_item = ( + componentsschemas_an_array_with_a_recursive_ref_in_items_object_additional_properties_item_data.to_dict() + ) field_dict[prop_name].append( componentsschemas_an_array_with_a_recursive_ref_in_items_object_additional_properties_item ) @@ -36,13 +38,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: for prop_name, prop_dict in d.items(): additional_property = [] _additional_property = prop_dict - for ( - componentsschemas_an_array_with_a_recursive_ref_in_items_object_additional_properties_item_data - ) in _additional_property: - componentsschemas_an_array_with_a_recursive_ref_in_items_object_additional_properties_item = ( - AnArrayWithARecursiveRefInItemsObjectAdditionalPropertiesItem.from_dict( - componentsschemas_an_array_with_a_recursive_ref_in_items_object_additional_properties_item_data - ) + for componentsschemas_an_array_with_a_recursive_ref_in_items_object_additional_properties_item_data in (_additional_property): + componentsschemas_an_array_with_a_recursive_ref_in_items_object_additional_properties_item = AnArrayWithARecursiveRefInItemsObjectAdditionalPropertiesItem.from_dict( + componentsschemas_an_array_with_a_recursive_ref_in_items_object_additional_properties_item_data ) additional_property.append( @@ -60,11 +58,15 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) - def __getitem__(self, key: str) -> list["AnArrayWithARecursiveRefInItemsObjectAdditionalPropertiesItem"]: + def __getitem__( + self, key: str + ) -> list["AnArrayWithARecursiveRefInItemsObjectAdditionalPropertiesItem"]: return self.additional_properties[key] def __setitem__( - self, key: str, value: list["AnArrayWithARecursiveRefInItemsObjectAdditionalPropertiesItem"] + self, + key: str, + value: list["AnArrayWithARecursiveRefInItemsObjectAdditionalPropertiesItem"], ) -> None: self.additional_properties[key] = value diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_recursive_ref_in_items_object_item.py b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_recursive_ref_in_items_object_item.py index 792994018..2e9140606 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_recursive_ref_in_items_object_item.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_recursive_ref_in_items_object_item.py @@ -23,11 +23,13 @@ def to_dict(self) -> dict[str, Any]: recursive: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.recursive, Unset): recursive = [] - for componentsschemas_an_array_with_a_recursive_ref_in_items_object_item_data in self.recursive: + for componentsschemas_an_array_with_a_recursive_ref_in_items_object_item_data in (self.recursive): componentsschemas_an_array_with_a_recursive_ref_in_items_object_item = ( componentsschemas_an_array_with_a_recursive_ref_in_items_object_item_data.to_dict() ) - recursive.append(componentsschemas_an_array_with_a_recursive_ref_in_items_object_item) + recursive.append( + componentsschemas_an_array_with_a_recursive_ref_in_items_object_item + ) field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -42,14 +44,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) recursive = [] _recursive = d.pop("recursive", UNSET) - for componentsschemas_an_array_with_a_recursive_ref_in_items_object_item_data in _recursive or []: - componentsschemas_an_array_with_a_recursive_ref_in_items_object_item = ( - AnArrayWithARecursiveRefInItemsObjectItem.from_dict( - componentsschemas_an_array_with_a_recursive_ref_in_items_object_item_data - ) + for ( + componentsschemas_an_array_with_a_recursive_ref_in_items_object_item_data + ) in (_recursive or []): + componentsschemas_an_array_with_a_recursive_ref_in_items_object_item = AnArrayWithARecursiveRefInItemsObjectItem.from_dict( + componentsschemas_an_array_with_a_recursive_ref_in_items_object_item_data ) - recursive.append(componentsschemas_an_array_with_a_recursive_ref_in_items_object_item) + recursive.append( + componentsschemas_an_array_with_a_recursive_ref_in_items_object_item + ) an_array_with_a_recursive_ref_in_items_object_item = cls( recursive=recursive, diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post.py b/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post.py index 5dcb8c936..316c0bed4 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post.py @@ -20,7 +20,9 @@ from ..models.body_upload_file_tests_upload_post_some_nullable_object import ( BodyUploadFileTestsUploadPostSomeNullableObject, ) - from ..models.body_upload_file_tests_upload_post_some_object import BodyUploadFileTestsUploadPostSomeObject + from ..models.body_upload_file_tests_upload_post_some_object import ( + BodyUploadFileTestsUploadPostSomeObject, + ) from ..models.body_upload_file_tests_upload_post_some_optional_object import ( BodyUploadFileTestsUploadPostSomeOptionalObject, ) @@ -61,11 +63,13 @@ class BodyUploadFileTestsUploadPost: some_nullable_number: Union[None, Unset, float] = UNSET some_int_array: Union[Unset, list[Union[None, int]]] = UNSET some_array: Union[None, Unset, list["AFormData"]] = UNSET - some_optional_object: Union[Unset, "BodyUploadFileTestsUploadPostSomeOptionalObject"] = UNSET + some_optional_object: Union[ + Unset, "BodyUploadFileTestsUploadPostSomeOptionalObject" + ] = UNSET some_enum: Union[Unset, DifferentEnum] = UNSET - additional_properties: dict[str, "BodyUploadFileTestsUploadPostAdditionalProperty"] = _attrs_field( - init=False, factory=dict - ) + additional_properties: dict[ + str, "BodyUploadFileTestsUploadPostAdditionalProperty" + ] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: from ..models.body_upload_file_tests_upload_post_some_nullable_object import ( @@ -79,7 +83,9 @@ def to_dict(self) -> dict[str, Any]: some_object = self.some_object.to_dict() some_nullable_object: Union[None, dict[str, Any]] - if isinstance(self.some_nullable_object, BodyUploadFileTestsUploadPostSomeNullableObject): + if isinstance( + self.some_nullable_object, BodyUploadFileTestsUploadPostSomeNullableObject + ): some_nullable_object = self.some_nullable_object.to_dict() else: some_nullable_object = self.some_nullable_object @@ -174,47 +180,111 @@ def to_multipart(self) -> types.RequestFiles: files.append(("some_file", self.some_file.to_tuple())) - files.append(("some_required_number", (None, str(self.some_required_number).encode(), "text/plain"))) + files.append( + ( + "some_required_number", + (None, str(self.some_required_number).encode(), "text/plain"), + ) + ) - files.append(("some_object", (None, json.dumps(self.some_object.to_dict()).encode(), "application/json"))) + files.append( + ( + "some_object", + ( + None, + json.dumps(self.some_object.to_dict()).encode(), + "application/json", + ), + ) + ) - if isinstance(self.some_nullable_object, BodyUploadFileTestsUploadPostSomeNullableObject): + if isinstance( + self.some_nullable_object, BodyUploadFileTestsUploadPostSomeNullableObject + ): files.append( ( "some_nullable_object", - (None, json.dumps(self.some_nullable_object.to_dict()).encode(), "application/json"), + ( + None, + json.dumps(self.some_nullable_object.to_dict()).encode(), + "application/json", + ), ) ) else: - files.append(("some_nullable_object", (None, str(self.some_nullable_object).encode(), "text/plain"))) + files.append( + ( + "some_nullable_object", + (None, str(self.some_nullable_object).encode(), "text/plain"), + ) + ) if not isinstance(self.some_optional_file, Unset): files.append(("some_optional_file", self.some_optional_file.to_tuple())) if not isinstance(self.some_string, Unset): - files.append(("some_string", (None, str(self.some_string).encode(), "text/plain"))) + files.append( + ("some_string", (None, str(self.some_string).encode(), "text/plain")) + ) if not isinstance(self.a_datetime, Unset): - files.append(("a_datetime", (None, self.a_datetime.isoformat().encode(), "text/plain"))) + files.append( + ( + "a_datetime", + (None, self.a_datetime.isoformat().encode(), "text/plain"), + ) + ) if not isinstance(self.a_date, Unset): - files.append(("a_date", (None, self.a_date.isoformat().encode(), "text/plain"))) + files.append( + ("a_date", (None, self.a_date.isoformat().encode(), "text/plain")) + ) if not isinstance(self.some_number, Unset): - files.append(("some_number", (None, str(self.some_number).encode(), "text/plain"))) + files.append( + ("some_number", (None, str(self.some_number).encode(), "text/plain")) + ) if not isinstance(self.some_nullable_number, Unset): if isinstance(self.some_nullable_number, float): - files.append(("some_nullable_number", (None, str(self.some_nullable_number).encode(), "text/plain"))) + files.append( + ( + "some_nullable_number", + (None, str(self.some_nullable_number).encode(), "text/plain"), + ) + ) else: - files.append(("some_nullable_number", (None, str(self.some_nullable_number).encode(), "text/plain"))) + files.append( + ( + "some_nullable_number", + (None, str(self.some_nullable_number).encode(), "text/plain"), + ) + ) if not isinstance(self.some_int_array, Unset): for some_int_array_item_element in self.some_int_array: if isinstance(some_int_array_item_element, int): - files.append(("some_int_array", (None, str(some_int_array_item_element).encode(), "text/plain"))) + files.append( + ( + "some_int_array", + ( + None, + str(some_int_array_item_element).encode(), + "text/plain", + ), + ) + ) else: - files.append(("some_int_array", (None, str(some_int_array_item_element).encode(), "text/plain"))) + files.append( + ( + "some_int_array", + ( + None, + str(some_int_array_item_element).encode(), + "text/plain", + ), + ) + ) if not isinstance(self.some_array, Unset): if isinstance(self.some_array, list): @@ -222,25 +292,44 @@ def to_multipart(self) -> types.RequestFiles: files.append( ( "some_array", - (None, json.dumps(some_array_type_0_item_element.to_dict()).encode(), "application/json"), + ( + None, + json.dumps( + some_array_type_0_item_element.to_dict() + ).encode(), + "application/json", + ), ) ) else: - files.append(("some_array", (None, str(self.some_array).encode(), "text/plain"))) + files.append( + ("some_array", (None, str(self.some_array).encode(), "text/plain")) + ) if not isinstance(self.some_optional_object, Unset): files.append( ( "some_optional_object", - (None, json.dumps(self.some_optional_object.to_dict()).encode(), "application/json"), + ( + None, + json.dumps(self.some_optional_object.to_dict()).encode(), + "application/json", + ), ) ) if not isinstance(self.some_enum, Unset): - files.append(("some_enum", (None, str(self.some_enum.value).encode(), "text/plain"))) + files.append( + ("some_enum", (None, str(self.some_enum.value).encode(), "text/plain")) + ) for prop_name, prop in self.additional_properties.items(): - files.append((prop_name, (None, json.dumps(prop.to_dict()).encode(), "application/json"))) + files.append( + ( + prop_name, + (None, json.dumps(prop.to_dict()).encode(), "application/json"), + ) + ) return files @@ -253,7 +342,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.body_upload_file_tests_upload_post_some_nullable_object import ( BodyUploadFileTestsUploadPostSomeNullableObject, ) - from ..models.body_upload_file_tests_upload_post_some_object import BodyUploadFileTestsUploadPostSomeObject + from ..models.body_upload_file_tests_upload_post_some_object import ( + BodyUploadFileTestsUploadPostSomeObject, + ) from ..models.body_upload_file_tests_upload_post_some_optional_object import ( BodyUploadFileTestsUploadPostSomeOptionalObject, ) @@ -263,22 +354,32 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: some_required_number = d.pop("some_required_number") - some_object = BodyUploadFileTestsUploadPostSomeObject.from_dict(d.pop("some_object")) + some_object = BodyUploadFileTestsUploadPostSomeObject.from_dict( + d.pop("some_object") + ) - def _parse_some_nullable_object(data: object) -> Union["BodyUploadFileTestsUploadPostSomeNullableObject", None]: + def _parse_some_nullable_object( + data: object, + ) -> Union["BodyUploadFileTestsUploadPostSomeNullableObject", None]: if data is None: return data try: if not isinstance(data, dict): raise TypeError() - some_nullable_object_type_0 = BodyUploadFileTestsUploadPostSomeNullableObject.from_dict(data) + some_nullable_object_type_0 = ( + BodyUploadFileTestsUploadPostSomeNullableObject.from_dict(data) + ) return some_nullable_object_type_0 except: # noqa: E722 pass - return cast(Union["BodyUploadFileTestsUploadPostSomeNullableObject", None], data) + return cast( + Union["BodyUploadFileTestsUploadPostSomeNullableObject", None], data + ) - some_nullable_object = _parse_some_nullable_object(d.pop("some_nullable_object")) + some_nullable_object = _parse_some_nullable_object( + d.pop("some_nullable_object") + ) _some_optional_file = d.pop("some_optional_file", UNSET) some_optional_file: Union[Unset, File] @@ -312,7 +413,9 @@ def _parse_some_nullable_number(data: object) -> Union[None, Unset, float]: return data return cast(Union[None, Unset, float], data) - some_nullable_number = _parse_some_nullable_number(d.pop("some_nullable_number", UNSET)) + some_nullable_number = _parse_some_nullable_number( + d.pop("some_nullable_number", UNSET) + ) some_int_array = [] _some_int_array = d.pop("some_int_array", UNSET) @@ -338,7 +441,9 @@ def _parse_some_array(data: object) -> Union[None, Unset, list["AFormData"]]: some_array_type_0 = [] _some_array_type_0 = data for some_array_type_0_item_data in _some_array_type_0: - some_array_type_0_item = AFormData.from_dict(some_array_type_0_item_data) + some_array_type_0_item = AFormData.from_dict( + some_array_type_0_item_data + ) some_array_type_0.append(some_array_type_0_item) @@ -350,11 +455,17 @@ def _parse_some_array(data: object) -> Union[None, Unset, list["AFormData"]]: some_array = _parse_some_array(d.pop("some_array", UNSET)) _some_optional_object = d.pop("some_optional_object", UNSET) - some_optional_object: Union[Unset, BodyUploadFileTestsUploadPostSomeOptionalObject] + some_optional_object: Union[ + Unset, BodyUploadFileTestsUploadPostSomeOptionalObject + ] if isinstance(_some_optional_object, Unset): some_optional_object = UNSET else: - some_optional_object = BodyUploadFileTestsUploadPostSomeOptionalObject.from_dict(_some_optional_object) + some_optional_object = ( + BodyUploadFileTestsUploadPostSomeOptionalObject.from_dict( + _some_optional_object + ) + ) _some_enum = d.pop("some_enum", UNSET) some_enum: Union[Unset, DifferentEnum] @@ -382,7 +493,9 @@ def _parse_some_array(data: object) -> Union[None, Unset, list["AFormData"]]: additional_properties = {} for prop_name, prop_dict in d.items(): - additional_property = BodyUploadFileTestsUploadPostAdditionalProperty.from_dict(prop_dict) + additional_property = ( + BodyUploadFileTestsUploadPostAdditionalProperty.from_dict(prop_dict) + ) additional_properties[prop_name] = additional_property @@ -393,10 +506,14 @@ def _parse_some_array(data: object) -> Union[None, Unset, list["AFormData"]]: def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) - def __getitem__(self, key: str) -> "BodyUploadFileTestsUploadPostAdditionalProperty": + def __getitem__( + self, key: str + ) -> "BodyUploadFileTestsUploadPostAdditionalProperty": return self.additional_properties[key] - def __setitem__(self, key: str, value: "BodyUploadFileTestsUploadPostAdditionalProperty") -> None: + def __setitem__( + self, key: str, value: "BodyUploadFileTestsUploadPostAdditionalProperty" + ) -> None: self.additional_properties[key] = value def __delitem__(self, key: str) -> None: diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_nullable_object.py b/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_nullable_object.py index b04e030aa..3fac02e39 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_nullable_object.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_nullable_object.py @@ -39,7 +39,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: bar=bar, ) - body_upload_file_tests_upload_post_some_nullable_object.additional_properties = d + body_upload_file_tests_upload_post_some_nullable_object.additional_properties = ( + d + ) return body_upload_file_tests_upload_post_some_nullable_object @property diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_optional_object.py b/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_optional_object.py index 8e6eb4e83..85d1d0d8f 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_optional_object.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_optional_object.py @@ -39,7 +39,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: foo=foo, ) - body_upload_file_tests_upload_post_some_optional_object.additional_properties = d + body_upload_file_tests_upload_post_some_optional_object.additional_properties = ( + d + ) return body_upload_file_tests_upload_post_some_optional_object @property diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/extended.py b/end_to_end_tests/golden-record/my_test_api_client/models/extended.py index a3d2773a4..00143ca43 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/extended.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/extended.py @@ -75,8 +75,12 @@ class Extended: attr_leading_underscore: Union[Unset, str] = UNSET not_required_nullable: Union[None, Unset, str] = UNSET not_required_not_nullable: Union[Unset, str] = UNSET - not_required_one_of_models: Union["FreeFormModel", "ModelWithUnionProperty", Unset] = UNSET - not_required_nullable_one_of_models: Union["FreeFormModel", "ModelWithUnionProperty", None, Unset, str] = UNSET + not_required_one_of_models: Union[ + "FreeFormModel", "ModelWithUnionProperty", Unset + ] = UNSET + not_required_nullable_one_of_models: Union[ + "FreeFormModel", "ModelWithUnionProperty", None, Unset, str + ] = UNSET not_required_model: Union[Unset, "ModelWithUnionProperty"] = UNSET not_required_nullable_model: Union["ModelWithUnionProperty", None, Unset] = UNSET from_extended: Union[Unset, str] = UNSET @@ -88,7 +92,9 @@ def to_dict(self) -> dict[str, Any]: an_enum_value = self.an_enum_value.value - an_allof_enum_with_overridden_default = self.an_allof_enum_with_overridden_default.value + an_allof_enum_with_overridden_default = ( + self.an_allof_enum_with_overridden_default.value + ) a_camel_date_time: str if isinstance(self.a_camel_date_time, datetime.datetime): @@ -152,8 +158,12 @@ def to_dict(self) -> dict[str, Any]: nested_list_of_enums = [] for nested_list_of_enums_item_data in self.nested_list_of_enums: nested_list_of_enums_item = [] - for nested_list_of_enums_item_item_data in nested_list_of_enums_item_data: - nested_list_of_enums_item_item = nested_list_of_enums_item_item_data.value + for ( + nested_list_of_enums_item_item_data + ) in nested_list_of_enums_item_data: + nested_list_of_enums_item_item = ( + nested_list_of_enums_item_item_data.value + ) nested_list_of_enums_item.append(nested_list_of_enums_item_item) nested_list_of_enums.append(nested_list_of_enums_item) @@ -190,11 +200,19 @@ def to_dict(self) -> dict[str, Any]: if isinstance(self.not_required_nullable_one_of_models, Unset): not_required_nullable_one_of_models = UNSET elif isinstance(self.not_required_nullable_one_of_models, FreeFormModel): - not_required_nullable_one_of_models = self.not_required_nullable_one_of_models.to_dict() - elif isinstance(self.not_required_nullable_one_of_models, ModelWithUnionProperty): - not_required_nullable_one_of_models = self.not_required_nullable_one_of_models.to_dict() + not_required_nullable_one_of_models = ( + self.not_required_nullable_one_of_models.to_dict() + ) + elif isinstance( + self.not_required_nullable_one_of_models, ModelWithUnionProperty + ): + not_required_nullable_one_of_models = ( + self.not_required_nullable_one_of_models.to_dict() + ) else: - not_required_nullable_one_of_models = self.not_required_nullable_one_of_models + not_required_nullable_one_of_models = ( + self.not_required_nullable_one_of_models + ) not_required_model: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.not_required_model, Unset): @@ -250,7 +268,9 @@ def to_dict(self) -> dict[str, Any]: if not_required_one_of_models is not UNSET: field_dict["not_required_one_of_models"] = not_required_one_of_models if not_required_nullable_one_of_models is not UNSET: - field_dict["not_required_nullable_one_of_models"] = not_required_nullable_one_of_models + field_dict["not_required_nullable_one_of_models"] = ( + not_required_nullable_one_of_models + ) if not_required_model is not UNSET: field_dict["not_required_model"] = not_required_model if not_required_nullable_model is not UNSET: @@ -268,9 +288,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) an_enum_value = AnEnum(d.pop("an_enum_value")) - an_allof_enum_with_overridden_default = AnAllOfEnum(d.pop("an_allof_enum_with_overridden_default")) + an_allof_enum_with_overridden_default = AnAllOfEnum( + d.pop("an_allof_enum_with_overridden_default") + ) - def _parse_a_camel_date_time(data: object) -> Union[datetime.date, datetime.datetime]: + def _parse_a_camel_date_time( + data: object, + ) -> Union[datetime.date, datetime.datetime]: try: if not isinstance(data, str): raise TypeError() @@ -330,7 +354,9 @@ def _parse_required_nullable(data: object) -> Union[None, str]: required_not_nullable = d.pop("required_not_nullable") - def _parse_one_of_models(data: object) -> Union["FreeFormModel", "ModelWithUnionProperty", Any]: + def _parse_one_of_models( + data: object, + ) -> Union["FreeFormModel", "ModelWithUnionProperty", Any]: try: if not isinstance(data, dict): raise TypeError() @@ -351,7 +377,9 @@ def _parse_one_of_models(data: object) -> Union["FreeFormModel", "ModelWithUnion one_of_models = _parse_one_of_models(d.pop("one_of_models")) - def _parse_nullable_one_of_models(data: object) -> Union["FreeFormModel", "ModelWithUnionProperty", None]: + def _parse_nullable_one_of_models( + data: object, + ) -> Union["FreeFormModel", "ModelWithUnionProperty", None]: if data is None: return data try: @@ -372,11 +400,15 @@ def _parse_nullable_one_of_models(data: object) -> Union["FreeFormModel", "Model pass return cast(Union["FreeFormModel", "ModelWithUnionProperty", None], data) - nullable_one_of_models = _parse_nullable_one_of_models(d.pop("nullable_one_of_models")) + nullable_one_of_models = _parse_nullable_one_of_models( + d.pop("nullable_one_of_models") + ) model = ModelWithUnionProperty.from_dict(d.pop("model")) - def _parse_nullable_model(data: object) -> Union["ModelWithUnionProperty", None]: + def _parse_nullable_model( + data: object, + ) -> Union["ModelWithUnionProperty", None]: if data is None: return data try: @@ -406,7 +438,9 @@ def _parse_nullable_model(data: object) -> Union["ModelWithUnionProperty", None] nested_list_of_enums_item = [] _nested_list_of_enums_item = nested_list_of_enums_item_data for nested_list_of_enums_item_item_data in _nested_list_of_enums_item: - nested_list_of_enums_item_item = DifferentEnum(nested_list_of_enums_item_item_data) + nested_list_of_enums_item_item = DifferentEnum( + nested_list_of_enums_item_item_data + ) nested_list_of_enums_item.append(nested_list_of_enums_item_item) @@ -437,11 +471,15 @@ def _parse_not_required_nullable(data: object) -> Union[None, Unset, str]: return data return cast(Union[None, Unset, str], data) - not_required_nullable = _parse_not_required_nullable(d.pop("not_required_nullable", UNSET)) + not_required_nullable = _parse_not_required_nullable( + d.pop("not_required_nullable", UNSET) + ) not_required_not_nullable = d.pop("not_required_not_nullable", UNSET) - def _parse_not_required_one_of_models(data: object) -> Union["FreeFormModel", "ModelWithUnionProperty", Unset]: + def _parse_not_required_one_of_models( + data: object, + ) -> Union["FreeFormModel", "ModelWithUnionProperty", Unset]: if isinstance(data, Unset): return data try: @@ -458,7 +496,9 @@ def _parse_not_required_one_of_models(data: object) -> Union["FreeFormModel", "M return not_required_one_of_models_type_1 - not_required_one_of_models = _parse_not_required_one_of_models(d.pop("not_required_one_of_models", UNSET)) + not_required_one_of_models = _parse_not_required_one_of_models( + d.pop("not_required_one_of_models", UNSET) + ) def _parse_not_required_nullable_one_of_models( data: object, @@ -470,7 +510,9 @@ def _parse_not_required_nullable_one_of_models( try: if not isinstance(data, dict): raise TypeError() - not_required_nullable_one_of_models_type_0 = FreeFormModel.from_dict(data) + not_required_nullable_one_of_models_type_0 = FreeFormModel.from_dict( + data + ) return not_required_nullable_one_of_models_type_0 except: # noqa: E722 @@ -478,15 +520,21 @@ def _parse_not_required_nullable_one_of_models( try: if not isinstance(data, dict): raise TypeError() - not_required_nullable_one_of_models_type_1 = ModelWithUnionProperty.from_dict(data) + not_required_nullable_one_of_models_type_1 = ( + ModelWithUnionProperty.from_dict(data) + ) return not_required_nullable_one_of_models_type_1 except: # noqa: E722 pass - return cast(Union["FreeFormModel", "ModelWithUnionProperty", None, Unset, str], data) - - not_required_nullable_one_of_models = _parse_not_required_nullable_one_of_models( - d.pop("not_required_nullable_one_of_models", UNSET) + return cast( + Union["FreeFormModel", "ModelWithUnionProperty", None, Unset, str], data + ) + + not_required_nullable_one_of_models = ( + _parse_not_required_nullable_one_of_models( + d.pop("not_required_nullable_one_of_models", UNSET) + ) ) _not_required_model = d.pop("not_required_model", UNSET) @@ -496,7 +544,9 @@ def _parse_not_required_nullable_one_of_models( else: not_required_model = ModelWithUnionProperty.from_dict(_not_required_model) - def _parse_not_required_nullable_model(data: object) -> Union["ModelWithUnionProperty", None, Unset]: + def _parse_not_required_nullable_model( + data: object, + ) -> Union["ModelWithUnionProperty", None, Unset]: if data is None: return data if isinstance(data, Unset): @@ -504,14 +554,18 @@ def _parse_not_required_nullable_model(data: object) -> Union["ModelWithUnionPro try: if not isinstance(data, dict): raise TypeError() - not_required_nullable_model_type_1 = ModelWithUnionProperty.from_dict(data) + not_required_nullable_model_type_1 = ModelWithUnionProperty.from_dict( + data + ) return not_required_nullable_model_type_1 except: # noqa: E722 pass return cast(Union["ModelWithUnionProperty", None, Unset], data) - not_required_nullable_model = _parse_not_required_nullable_model(d.pop("not_required_nullable_model", UNSET)) + not_required_nullable_model = _parse_not_required_nullable_model( + d.pop("not_required_nullable_model", UNSET) + ) from_extended = d.pop("fromExtended", UNSET) diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/get_models_oneof_with_required_const_response_200_type_0.py b/end_to_end_tests/golden-record/my_test_api_client/models/get_models_oneof_with_required_const_response_200_type_0.py index 54531a7f8..0f7b4b8da 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/get_models_oneof_with_required_const_response_200_type_0.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/get_models_oneof_with_required_const_response_200_type_0.py @@ -52,7 +52,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: color=color, ) - get_models_oneof_with_required_const_response_200_type_0.additional_properties = d + get_models_oneof_with_required_const_response_200_type_0.additional_properties = ( + d + ) return get_models_oneof_with_required_const_response_200_type_0 @property diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/get_models_oneof_with_required_const_response_200_type_1.py b/end_to_end_tests/golden-record/my_test_api_client/models/get_models_oneof_with_required_const_response_200_type_1.py index 69f11cca0..4a37460e4 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/get_models_oneof_with_required_const_response_200_type_1.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/get_models_oneof_with_required_const_response_200_type_1.py @@ -52,7 +52,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: texture=texture, ) - get_models_oneof_with_required_const_response_200_type_1.additional_properties = d + get_models_oneof_with_required_const_response_200_type_1.additional_properties = ( + d + ) return get_models_oneof_with_required_const_response_200_type_1 @property diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_inlined.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_inlined.py index bb70f94a8..4aac0aa27 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_inlined.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_inlined.py @@ -23,9 +23,9 @@ class ModelWithAdditionalPropertiesInlined: """ a_number: Union[Unset, float] = UNSET - additional_properties: dict[str, "ModelWithAdditionalPropertiesInlinedAdditionalProperty"] = _attrs_field( - init=False, factory=dict - ) + additional_properties: dict[ + str, "ModelWithAdditionalPropertiesInlinedAdditionalProperty" + ] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: a_number = self.a_number @@ -55,21 +55,31 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: additional_properties = {} for prop_name, prop_dict in d.items(): - additional_property = ModelWithAdditionalPropertiesInlinedAdditionalProperty.from_dict(prop_dict) + additional_property = ( + ModelWithAdditionalPropertiesInlinedAdditionalProperty.from_dict( + prop_dict + ) + ) additional_properties[prop_name] = additional_property - model_with_additional_properties_inlined.additional_properties = additional_properties + model_with_additional_properties_inlined.additional_properties = ( + additional_properties + ) return model_with_additional_properties_inlined @property def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) - def __getitem__(self, key: str) -> "ModelWithAdditionalPropertiesInlinedAdditionalProperty": + def __getitem__( + self, key: str + ) -> "ModelWithAdditionalPropertiesInlinedAdditionalProperty": return self.additional_properties[key] - def __setitem__(self, key: str, value: "ModelWithAdditionalPropertiesInlinedAdditionalProperty") -> None: + def __setitem__( + self, key: str, value: "ModelWithAdditionalPropertiesInlinedAdditionalProperty" + ) -> None: self.additional_properties[key] = value def __delitem__(self, key: str) -> None: diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_inlined_additional_property.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_inlined_additional_property.py index e4fc6a09f..26113d4f7 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_inlined_additional_property.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_inlined_additional_property.py @@ -39,7 +39,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: extra_props_prop=extra_props_prop, ) - model_with_additional_properties_inlined_additional_property.additional_properties = d + model_with_additional_properties_inlined_additional_property.additional_properties = ( + d + ) return model_with_additional_properties_inlined_additional_property @property diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_refed.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_refed.py index 2bbd16327..1d18d70b2 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_refed.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_refed.py @@ -33,7 +33,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: additional_properties[prop_name] = additional_property - model_with_additional_properties_refed.additional_properties = additional_properties + model_with_additional_properties_refed.additional_properties = ( + additional_properties + ) return model_with_additional_properties_refed @property diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_any_json_properties.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_any_json_properties.py index e1aa63d45..1799ec8d7 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_any_json_properties.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_any_json_properties.py @@ -18,7 +18,15 @@ class ModelWithAnyJsonProperties: """ """ additional_properties: dict[ - str, Union["ModelWithAnyJsonPropertiesAdditionalPropertyType0", bool, float, int, list[str], str] + str, + Union[ + "ModelWithAnyJsonPropertiesAdditionalPropertyType0", + bool, + float, + int, + list[str], + str, + ], ] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -52,11 +60,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_additional_property( data: object, - ) -> Union["ModelWithAnyJsonPropertiesAdditionalPropertyType0", bool, float, int, list[str], str]: + ) -> Union[ + "ModelWithAnyJsonPropertiesAdditionalPropertyType0", + bool, + float, + int, + list[str], + str, + ]: try: if not isinstance(data, dict): raise TypeError() - additional_property_type_0 = ModelWithAnyJsonPropertiesAdditionalPropertyType0.from_dict(data) + additional_property_type_0 = ( + ModelWithAnyJsonPropertiesAdditionalPropertyType0.from_dict( + data + ) + ) return additional_property_type_0 except: # noqa: E722 @@ -70,7 +89,15 @@ def _parse_additional_property( except: # noqa: E722 pass return cast( - Union["ModelWithAnyJsonPropertiesAdditionalPropertyType0", bool, float, int, list[str], str], data + Union[ + "ModelWithAnyJsonPropertiesAdditionalPropertyType0", + bool, + float, + int, + list[str], + str, + ], + data, ) additional_property = _parse_additional_property(prop_dict) @@ -84,15 +111,27 @@ def _parse_additional_property( def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) - def __getitem__( - self, key: str - ) -> Union["ModelWithAnyJsonPropertiesAdditionalPropertyType0", bool, float, int, list[str], str]: + def __getitem__(self, key: str) -> Union[ + "ModelWithAnyJsonPropertiesAdditionalPropertyType0", + bool, + float, + int, + list[str], + str, + ]: return self.additional_properties[key] def __setitem__( self, key: str, - value: Union["ModelWithAnyJsonPropertiesAdditionalPropertyType0", bool, float, int, list[str], str], + value: Union[ + "ModelWithAnyJsonPropertiesAdditionalPropertyType0", + bool, + float, + int, + list[str], + str, + ], ) -> None: self.additional_properties[key] = value diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_any_json_properties_additional_property_type_0.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_any_json_properties_additional_property_type_0.py index 9cdda2b79..09c5a25a1 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_any_json_properties_additional_property_type_0.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_any_json_properties_additional_property_type_0.py @@ -24,7 +24,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) model_with_any_json_properties_additional_property_type_0 = cls() - model_with_any_json_properties_additional_property_type_0.additional_properties = d + model_with_any_json_properties_additional_property_type_0.additional_properties = ( + d + ) return model_with_any_json_properties_additional_property_type_0 @property diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_in_additional_properties_a.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_in_additional_properties_a.py index b5c3ca2e1..3d4f4dba9 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_in_additional_properties_a.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_in_additional_properties_a.py @@ -5,7 +5,9 @@ from attrs import field as _attrs_field if TYPE_CHECKING: - from ..models.model_with_circular_ref_in_additional_properties_b import ModelWithCircularRefInAdditionalPropertiesB + from ..models.model_with_circular_ref_in_additional_properties_b import ( + ModelWithCircularRefInAdditionalPropertiesB, + ) T = TypeVar("T", bound="ModelWithCircularRefInAdditionalPropertiesA") @@ -15,8 +17,8 @@ class ModelWithCircularRefInAdditionalPropertiesA: """ """ - additional_properties: dict[str, "ModelWithCircularRefInAdditionalPropertiesB"] = _attrs_field( - init=False, factory=dict + additional_properties: dict[str, "ModelWithCircularRefInAdditionalPropertiesB"] = ( + _attrs_field(init=False, factory=dict) ) def to_dict(self) -> dict[str, Any]: @@ -37,11 +39,15 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: additional_properties = {} for prop_name, prop_dict in d.items(): - additional_property = ModelWithCircularRefInAdditionalPropertiesB.from_dict(prop_dict) + additional_property = ModelWithCircularRefInAdditionalPropertiesB.from_dict( + prop_dict + ) additional_properties[prop_name] = additional_property - model_with_circular_ref_in_additional_properties_a.additional_properties = additional_properties + model_with_circular_ref_in_additional_properties_a.additional_properties = ( + additional_properties + ) return model_with_circular_ref_in_additional_properties_a @property @@ -51,7 +57,9 @@ def additional_keys(self) -> list[str]: def __getitem__(self, key: str) -> "ModelWithCircularRefInAdditionalPropertiesB": return self.additional_properties[key] - def __setitem__(self, key: str, value: "ModelWithCircularRefInAdditionalPropertiesB") -> None: + def __setitem__( + self, key: str, value: "ModelWithCircularRefInAdditionalPropertiesB" + ) -> None: self.additional_properties[key] = value def __delitem__(self, key: str) -> None: diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_in_additional_properties_b.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_in_additional_properties_b.py index a6e963ca6..67ee04656 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_in_additional_properties_b.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_in_additional_properties_b.py @@ -5,7 +5,9 @@ from attrs import field as _attrs_field if TYPE_CHECKING: - from ..models.model_with_circular_ref_in_additional_properties_a import ModelWithCircularRefInAdditionalPropertiesA + from ..models.model_with_circular_ref_in_additional_properties_a import ( + ModelWithCircularRefInAdditionalPropertiesA, + ) T = TypeVar("T", bound="ModelWithCircularRefInAdditionalPropertiesB") @@ -15,8 +17,8 @@ class ModelWithCircularRefInAdditionalPropertiesB: """ """ - additional_properties: dict[str, "ModelWithCircularRefInAdditionalPropertiesA"] = _attrs_field( - init=False, factory=dict + additional_properties: dict[str, "ModelWithCircularRefInAdditionalPropertiesA"] = ( + _attrs_field(init=False, factory=dict) ) def to_dict(self) -> dict[str, Any]: @@ -37,11 +39,15 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: additional_properties = {} for prop_name, prop_dict in d.items(): - additional_property = ModelWithCircularRefInAdditionalPropertiesA.from_dict(prop_dict) + additional_property = ModelWithCircularRefInAdditionalPropertiesA.from_dict( + prop_dict + ) additional_properties[prop_name] = additional_property - model_with_circular_ref_in_additional_properties_b.additional_properties = additional_properties + model_with_circular_ref_in_additional_properties_b.additional_properties = ( + additional_properties + ) return model_with_circular_ref_in_additional_properties_b @property @@ -51,7 +57,9 @@ def additional_keys(self) -> list[str]: def __getitem__(self, key: str) -> "ModelWithCircularRefInAdditionalPropertiesA": return self.additional_properties[key] - def __setitem__(self, key: str, value: "ModelWithCircularRefInAdditionalPropertiesA") -> None: + def __setitem__( + self, key: str, value: "ModelWithCircularRefInAdditionalPropertiesA" + ) -> None: self.additional_properties[key] = value def __delitem__(self, key: str) -> None: diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_discriminated_union.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_discriminated_union.py index 203e321dd..ed8b54569 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_discriminated_union.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_discriminated_union.py @@ -21,7 +21,9 @@ class ModelWithDiscriminatedUnion: discriminated_union (Union['ADiscriminatedUnionType1', 'ADiscriminatedUnionType2', None, Unset]): """ - discriminated_union: Union["ADiscriminatedUnionType1", "ADiscriminatedUnionType2", None, Unset] = UNSET + discriminated_union: Union[ + "ADiscriminatedUnionType1", "ADiscriminatedUnionType2", None, Unset + ] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -63,7 +65,9 @@ def _parse_discriminated_union( try: if not isinstance(data, dict): raise TypeError() - componentsschemas_a_discriminated_union_type_0 = ADiscriminatedUnionType1.from_dict(data) + componentsschemas_a_discriminated_union_type_0 = ( + ADiscriminatedUnionType1.from_dict(data) + ) return componentsschemas_a_discriminated_union_type_0 except: # noqa: E722 @@ -71,14 +75,23 @@ def _parse_discriminated_union( try: if not isinstance(data, dict): raise TypeError() - componentsschemas_a_discriminated_union_type_1 = ADiscriminatedUnionType2.from_dict(data) + componentsschemas_a_discriminated_union_type_1 = ( + ADiscriminatedUnionType2.from_dict(data) + ) return componentsschemas_a_discriminated_union_type_1 except: # noqa: E722 pass - return cast(Union["ADiscriminatedUnionType1", "ADiscriminatedUnionType2", None, Unset], data) - - discriminated_union = _parse_discriminated_union(d.pop("discriminated_union", UNSET)) + return cast( + Union[ + "ADiscriminatedUnionType1", "ADiscriminatedUnionType2", None, Unset + ], + data, + ) + + discriminated_union = _parse_discriminated_union( + d.pop("discriminated_union", UNSET) + ) model_with_discriminated_union = cls( discriminated_union=discriminated_union, diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_merged_properties.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_merged_properties.py index a740022a6..86c0abf7e 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_merged_properties.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_merged_properties.py @@ -6,7 +6,9 @@ from attrs import field as _attrs_field from dateutil.parser import isoparse -from ..models.model_with_merged_properties_string_to_enum import ModelWithMergedPropertiesStringToEnum +from ..models.model_with_merged_properties_string_to_enum import ( + ModelWithMergedPropertiesStringToEnum, +) from ..types import UNSET, Unset T = TypeVar("T", bound="ModelWithMergedProperties") @@ -25,7 +27,9 @@ class ModelWithMergedProperties: """ simple_string: Union[Unset, str] = "new default" - string_to_enum: Union[Unset, ModelWithMergedPropertiesStringToEnum] = ModelWithMergedPropertiesStringToEnum.A + string_to_enum: Union[Unset, ModelWithMergedPropertiesStringToEnum] = ( + ModelWithMergedPropertiesStringToEnum.A + ) string_to_date: Union[Unset, datetime.date] = UNSET number_to_int: Union[Unset, int] = UNSET any_to_string: Union[Unset, str] = "x" diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_primitive_additional_properties.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_primitive_additional_properties.py index ccd515142..51ae3443f 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_primitive_additional_properties.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_primitive_additional_properties.py @@ -22,7 +22,9 @@ class ModelWithPrimitiveAdditionalProperties: a_date_holder (Union[Unset, ModelWithPrimitiveAdditionalPropertiesADateHolder]): """ - a_date_holder: Union[Unset, "ModelWithPrimitiveAdditionalPropertiesADateHolder"] = UNSET + a_date_holder: Union[Unset, "ModelWithPrimitiveAdditionalPropertiesADateHolder"] = ( + UNSET + ) additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -50,7 +52,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: if isinstance(_a_date_holder, Unset): a_date_holder = UNSET else: - a_date_holder = ModelWithPrimitiveAdditionalPropertiesADateHolder.from_dict(_a_date_holder) + a_date_holder = ModelWithPrimitiveAdditionalPropertiesADateHolder.from_dict( + _a_date_holder + ) model_with_primitive_additional_properties = cls( a_date_holder=a_date_holder, diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_primitive_additional_properties_a_date_holder.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_primitive_additional_properties_a_date_holder.py index 9d2776403..b4a462e6b 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_primitive_additional_properties_a_date_holder.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_primitive_additional_properties_a_date_holder.py @@ -13,7 +13,9 @@ class ModelWithPrimitiveAdditionalPropertiesADateHolder: """ """ - additional_properties: dict[str, datetime.datetime] = _attrs_field(init=False, factory=dict) + additional_properties: dict[str, datetime.datetime] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} @@ -33,7 +35,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: additional_properties[prop_name] = additional_property - model_with_primitive_additional_properties_a_date_holder.additional_properties = additional_properties + model_with_primitive_additional_properties_a_date_holder.additional_properties = ( + additional_properties + ) return model_with_primitive_additional_properties_a_date_holder @property diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_recursive_ref_in_additional_properties.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_recursive_ref_in_additional_properties.py index 208111a60..375d3ac0d 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_recursive_ref_in_additional_properties.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_recursive_ref_in_additional_properties.py @@ -11,8 +11,8 @@ class ModelWithRecursiveRefInAdditionalProperties: """ """ - additional_properties: dict[str, "ModelWithRecursiveRefInAdditionalProperties"] = _attrs_field( - init=False, factory=dict + additional_properties: dict[str, "ModelWithRecursiveRefInAdditionalProperties"] = ( + _attrs_field(init=False, factory=dict) ) def to_dict(self) -> dict[str, Any]: @@ -29,11 +29,15 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: additional_properties = {} for prop_name, prop_dict in d.items(): - additional_property = ModelWithRecursiveRefInAdditionalProperties.from_dict(prop_dict) + additional_property = ModelWithRecursiveRefInAdditionalProperties.from_dict( + prop_dict + ) additional_properties[prop_name] = additional_property - model_with_recursive_ref_in_additional_properties.additional_properties = additional_properties + model_with_recursive_ref_in_additional_properties.additional_properties = ( + additional_properties + ) return model_with_recursive_ref_in_additional_properties @property @@ -43,7 +47,9 @@ def additional_keys(self) -> list[str]: def __getitem__(self, key: str) -> "ModelWithRecursiveRefInAdditionalProperties": return self.additional_properties[key] - def __setitem__(self, key: str, value: "ModelWithRecursiveRefInAdditionalProperties") -> None: + def __setitem__( + self, key: str, value: "ModelWithRecursiveRefInAdditionalProperties" + ) -> None: self.additional_properties[key] = value def __delitem__(self, key: str) -> None: diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property_inlined.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property_inlined.py index 420405539..d509aec1a 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property_inlined.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property_inlined.py @@ -6,8 +6,12 @@ from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.model_with_union_property_inlined_apples import ModelWithUnionPropertyInlinedApples - from ..models.model_with_union_property_inlined_bananas import ModelWithUnionPropertyInlinedBananas + from ..models.model_with_union_property_inlined_apples import ( + ModelWithUnionPropertyInlinedApples, + ) + from ..models.model_with_union_property_inlined_bananas import ( + ModelWithUnionPropertyInlinedBananas, + ) T = TypeVar("T", bound="ModelWithUnionPropertyInlined") @@ -20,10 +24,16 @@ class ModelWithUnionPropertyInlined: fruit (Union['ModelWithUnionPropertyInlinedApples', 'ModelWithUnionPropertyInlinedBananas', Unset]): """ - fruit: Union["ModelWithUnionPropertyInlinedApples", "ModelWithUnionPropertyInlinedBananas", Unset] = UNSET + fruit: Union[ + "ModelWithUnionPropertyInlinedApples", + "ModelWithUnionPropertyInlinedBananas", + Unset, + ] = UNSET def to_dict(self) -> dict[str, Any]: - from ..models.model_with_union_property_inlined_apples import ModelWithUnionPropertyInlinedApples + from ..models.model_with_union_property_inlined_apples import ( + ModelWithUnionPropertyInlinedApples, + ) fruit: Union[Unset, dict[str, Any]] if isinstance(self.fruit, Unset): @@ -43,14 +53,22 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.model_with_union_property_inlined_apples import ModelWithUnionPropertyInlinedApples - from ..models.model_with_union_property_inlined_bananas import ModelWithUnionPropertyInlinedBananas + from ..models.model_with_union_property_inlined_apples import ( + ModelWithUnionPropertyInlinedApples, + ) + from ..models.model_with_union_property_inlined_bananas import ( + ModelWithUnionPropertyInlinedBananas, + ) d = dict(src_dict) def _parse_fruit( data: object, - ) -> Union["ModelWithUnionPropertyInlinedApples", "ModelWithUnionPropertyInlinedBananas", Unset]: + ) -> Union[ + "ModelWithUnionPropertyInlinedApples", + "ModelWithUnionPropertyInlinedBananas", + Unset, + ]: if isinstance(data, Unset): return data try: diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/post_responses_unions_simple_before_complex_response_200.py b/end_to_end_tests/golden-record/my_test_api_client/models/post_responses_unions_simple_before_complex_response_200.py index 66717f670..dc612aac3 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/post_responses_unions_simple_before_complex_response_200.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/post_responses_unions_simple_before_complex_response_200.py @@ -52,16 +52,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_a(data: object) -> Union["PostResponsesUnionsSimpleBeforeComplexResponse200AType1", str]: + def _parse_a( + data: object, + ) -> Union["PostResponsesUnionsSimpleBeforeComplexResponse200AType1", str]: try: if not isinstance(data, dict): raise TypeError() - a_type_1 = PostResponsesUnionsSimpleBeforeComplexResponse200AType1.from_dict(data) + a_type_1 = ( + PostResponsesUnionsSimpleBeforeComplexResponse200AType1.from_dict( + data + ) + ) return a_type_1 except: # noqa: E722 pass - return cast(Union["PostResponsesUnionsSimpleBeforeComplexResponse200AType1", str], data) + return cast( + Union["PostResponsesUnionsSimpleBeforeComplexResponse200AType1", str], + data, + ) a = _parse_a(d.pop("a")) @@ -69,7 +78,9 @@ def _parse_a(data: object) -> Union["PostResponsesUnionsSimpleBeforeComplexRespo a=a, ) - post_responses_unions_simple_before_complex_response_200.additional_properties = d + post_responses_unions_simple_before_complex_response_200.additional_properties = ( + d + ) return post_responses_unions_simple_before_complex_response_200 @property diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/post_responses_unions_simple_before_complex_response_200a_type_1.py b/end_to_end_tests/golden-record/my_test_api_client/models/post_responses_unions_simple_before_complex_response_200a_type_1.py index f2c1d3216..11a3ae351 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/post_responses_unions_simple_before_complex_response_200a_type_1.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/post_responses_unions_simple_before_complex_response_200a_type_1.py @@ -24,7 +24,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) post_responses_unions_simple_before_complex_response_200a_type_1 = cls() - post_responses_unions_simple_before_complex_response_200a_type_1.additional_properties = d + post_responses_unions_simple_before_complex_response_200a_type_1.additional_properties = ( + d + ) return post_responses_unions_simple_before_complex_response_200a_type_1 @property diff --git a/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/api/enums/bool_enum_tests_bool_enum_post.py b/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/api/enums/bool_enum_tests_bool_enum_post.py index 52385855c..6da45ec10 100644 --- a/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/api/enums/bool_enum_tests_bool_enum_post.py +++ b/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/api/enums/bool_enum_tests_bool_enum_post.py @@ -27,7 +27,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 200: return None if client.raise_on_unexpected_status: @@ -36,7 +38,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/api/enums/int_enum_tests_int_enum_post.py b/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/api/enums/int_enum_tests_int_enum_post.py index af4c4ca22..0b4979d08 100644 --- a/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/api/enums/int_enum_tests_int_enum_post.py +++ b/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/api/enums/int_enum_tests_int_enum_post.py @@ -29,7 +29,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 200: return None if client.raise_on_unexpected_status: @@ -38,7 +40,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/client.py b/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/client.py index e80446f10..eeffd00c8 100644 --- a/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/client.py +++ b/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/client.py @@ -38,9 +38,15 @@ class Client: _base_url: str = field(alias="base_url") _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") - _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout") - _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl") - _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _timeout: Optional[httpx.Timeout] = field( + default=None, kw_only=True, alias="timeout" + ) + _verify_ssl: Union[str, bool, ssl.SSLContext] = field( + default=True, kw_only=True, alias="verify_ssl" + ) + _follow_redirects: bool = field( + default=False, kw_only=True, alias="follow_redirects" + ) _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") _client: Optional[httpx.Client] = field(default=None, init=False) _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) @@ -168,9 +174,15 @@ class AuthenticatedClient: _base_url: str = field(alias="base_url") _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") - _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout") - _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl") - _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _timeout: Optional[httpx.Timeout] = field( + default=None, kw_only=True, alias="timeout" + ) + _verify_ssl: Union[str, bool, ssl.SSLContext] = field( + default=True, kw_only=True, alias="verify_ssl" + ) + _follow_redirects: bool = field( + default=False, kw_only=True, alias="follow_redirects" + ) _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") _client: Optional[httpx.Client] = field(default=None, init=False) _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) @@ -214,7 +226,9 @@ def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient": def get_httpx_client(self) -> httpx.Client: """Get the underlying httpx.Client, constructing a new one if not previously set""" if self._client is None: - self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token + self._headers[self.auth_header_name] = ( + f"{self.prefix} {self.token}" if self.prefix else self.token + ) self._client = httpx.Client( base_url=self._base_url, cookies=self._cookies, @@ -235,7 +249,9 @@ def __exit__(self, *args: Any, **kwargs: Any) -> None: """Exit a context manager for internal httpx.Client (see httpx docs)""" self.get_httpx_client().__exit__(*args, **kwargs) - def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "AuthenticatedClient": + def set_async_httpx_client( + self, async_client: httpx.AsyncClient + ) -> "AuthenticatedClient": """Manually the underlying httpx.AsyncClient **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. @@ -246,7 +262,9 @@ def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Authentica def get_async_httpx_client(self) -> httpx.AsyncClient: """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" if self._async_client is None: - self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token + self._headers[self.auth_header_name] = ( + f"{self.prefix} {self.token}" if self.prefix else self.token + ) self._async_client = httpx.AsyncClient( base_url=self._base_url, cookies=self._cookies, diff --git a/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/a_model.py b/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/a_model.py index 5c3508cf5..023c20c74 100644 --- a/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/a_model.py +++ b/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/a_model.py @@ -32,7 +32,9 @@ class AModel: def to_dict(self) -> dict[str, Any]: an_enum_value: str = self.an_enum_value - an_allof_enum_with_overridden_default: str = self.an_allof_enum_with_overridden_default + an_allof_enum_with_overridden_default: str = ( + self.an_allof_enum_with_overridden_default + ) any_value = self.any_value @@ -45,8 +47,12 @@ def to_dict(self) -> dict[str, Any]: nested_list_of_enums = [] for nested_list_of_enums_item_data in self.nested_list_of_enums: nested_list_of_enums_item = [] - for nested_list_of_enums_item_item_data in nested_list_of_enums_item_data: - nested_list_of_enums_item_item: str = nested_list_of_enums_item_item_data + for ( + nested_list_of_enums_item_item_data + ) in nested_list_of_enums_item_data: + nested_list_of_enums_item_item: str = ( + nested_list_of_enums_item_item_data + ) nested_list_of_enums_item.append(nested_list_of_enums_item_item) nested_list_of_enums.append(nested_list_of_enums_item) @@ -73,7 +79,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) an_enum_value = check_an_enum(d.pop("an_enum_value")) - an_allof_enum_with_overridden_default = check_an_all_of_enum(d.pop("an_allof_enum_with_overridden_default")) + an_allof_enum_with_overridden_default = check_an_all_of_enum( + d.pop("an_allof_enum_with_overridden_default") + ) any_value = d.pop("any_value", UNSET) @@ -90,7 +98,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: nested_list_of_enums_item = [] _nested_list_of_enums_item = nested_list_of_enums_item_data for nested_list_of_enums_item_item_data in _nested_list_of_enums_item: - nested_list_of_enums_item_item = check_different_enum(nested_list_of_enums_item_item_data) + nested_list_of_enums_item_item = check_different_enum( + nested_list_of_enums_item_item_data + ) nested_list_of_enums_item.append(nested_list_of_enums_item_item) diff --git a/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/an_all_of_enum.py b/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/an_all_of_enum.py index 3455e04d0..0f9a4d734 100644 --- a/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/an_all_of_enum.py +++ b/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/an_all_of_enum.py @@ -13,4 +13,6 @@ def check_an_all_of_enum(value: str) -> AnAllOfEnum: if value in AN_ALL_OF_ENUM_VALUES: return cast(AnAllOfEnum, value) - raise TypeError(f"Unexpected value {value!r}. Expected one of {AN_ALL_OF_ENUM_VALUES!r}") + raise TypeError( + f"Unexpected value {value!r}. Expected one of {AN_ALL_OF_ENUM_VALUES!r}" + ) diff --git a/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/an_enum_with_null.py b/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/an_enum_with_null.py index 4203876de..4e540a6b1 100644 --- a/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/an_enum_with_null.py +++ b/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/an_enum_with_null.py @@ -11,4 +11,6 @@ def check_an_enum_with_null(value: str) -> AnEnumWithNull: if value in AN_ENUM_WITH_NULL_VALUES: return cast(AnEnumWithNull, value) - raise TypeError(f"Unexpected value {value!r}. Expected one of {AN_ENUM_WITH_NULL_VALUES!r}") + raise TypeError( + f"Unexpected value {value!r}. Expected one of {AN_ENUM_WITH_NULL_VALUES!r}" + ) diff --git a/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/an_int_enum.py b/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/an_int_enum.py index 9d0abd942..91babdc5f 100644 --- a/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/an_int_enum.py +++ b/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/an_int_enum.py @@ -12,4 +12,6 @@ def check_an_int_enum(value: int) -> AnIntEnum: if value in AN_INT_ENUM_VALUES: return cast(AnIntEnum, value) - raise TypeError(f"Unexpected value {value!r}. Expected one of {AN_INT_ENUM_VALUES!r}") + raise TypeError( + f"Unexpected value {value!r}. Expected one of {AN_INT_ENUM_VALUES!r}" + ) diff --git a/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/different_enum.py b/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/different_enum.py index e672a9821..17a58b561 100644 --- a/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/different_enum.py +++ b/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/different_enum.py @@ -11,4 +11,6 @@ def check_different_enum(value: str) -> DifferentEnum: if value in DIFFERENT_ENUM_VALUES: return cast(DifferentEnum, value) - raise TypeError(f"Unexpected value {value!r}. Expected one of {DIFFERENT_ENUM_VALUES!r}") + raise TypeError( + f"Unexpected value {value!r}. Expected one of {DIFFERENT_ENUM_VALUES!r}" + ) diff --git a/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/get_user_list_int_enum_header.py b/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/get_user_list_int_enum_header.py index 845d6c2a0..d92980fce 100644 --- a/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/get_user_list_int_enum_header.py +++ b/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/get_user_list_int_enum_header.py @@ -12,4 +12,6 @@ def check_get_user_list_int_enum_header(value: int) -> GetUserListIntEnumHeader: if value in GET_USER_LIST_INT_ENUM_HEADER_VALUES: return cast(GetUserListIntEnumHeader, value) - raise TypeError(f"Unexpected value {value!r}. Expected one of {GET_USER_LIST_INT_ENUM_HEADER_VALUES!r}") + raise TypeError( + f"Unexpected value {value!r}. Expected one of {GET_USER_LIST_INT_ENUM_HEADER_VALUES!r}" + ) diff --git a/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/get_user_list_string_enum_header.py b/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/get_user_list_string_enum_header.py index 55dbbad62..a40c1da10 100644 --- a/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/get_user_list_string_enum_header.py +++ b/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/get_user_list_string_enum_header.py @@ -12,4 +12,6 @@ def check_get_user_list_string_enum_header(value: str) -> GetUserListStringEnumHeader: if value in GET_USER_LIST_STRING_ENUM_HEADER_VALUES: return cast(GetUserListStringEnumHeader, value) - raise TypeError(f"Unexpected value {value!r}. Expected one of {GET_USER_LIST_STRING_ENUM_HEADER_VALUES!r}") + raise TypeError( + f"Unexpected value {value!r}. Expected one of {GET_USER_LIST_STRING_ENUM_HEADER_VALUES!r}" + ) diff --git a/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/post_user_list_body.py b/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/post_user_list_body.py index 86212c124..19edb7ddb 100644 --- a/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/post_user_list_body.py +++ b/end_to_end_tests/literal-enums-golden-record/my_enum_api_client/models/post_user_list_body.py @@ -29,7 +29,9 @@ class PostUserListBody: an_enum_value: Union[Unset, list[AnEnum]] = UNSET an_enum_value_with_null: Union[Unset, list[Union[AnEnumWithNull, None]]] = UNSET an_enum_value_with_only_null: Union[Unset, list[None]] = UNSET - an_allof_enum_with_overridden_default: Union[Unset, AnAllOfEnum] = "overridden_default" + an_allof_enum_with_overridden_default: Union[Unset, AnAllOfEnum] = ( + "overridden_default" + ) an_optional_allof_enum: Union[Unset, AnAllOfEnum] = UNSET nested_list_of_enums: Union[Unset, list[list[DifferentEnum]]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -59,7 +61,9 @@ def to_dict(self) -> dict[str, Any]: an_allof_enum_with_overridden_default: Union[Unset, str] = UNSET if not isinstance(self.an_allof_enum_with_overridden_default, Unset): - an_allof_enum_with_overridden_default = self.an_allof_enum_with_overridden_default + an_allof_enum_with_overridden_default = ( + self.an_allof_enum_with_overridden_default + ) an_optional_allof_enum: Union[Unset, str] = UNSET if not isinstance(self.an_optional_allof_enum, Unset): @@ -70,8 +74,12 @@ def to_dict(self) -> dict[str, Any]: nested_list_of_enums = [] for nested_list_of_enums_item_data in self.nested_list_of_enums: nested_list_of_enums_item = [] - for nested_list_of_enums_item_item_data in nested_list_of_enums_item_data: - nested_list_of_enums_item_item: str = nested_list_of_enums_item_item_data + for ( + nested_list_of_enums_item_item_data + ) in nested_list_of_enums_item_data: + nested_list_of_enums_item_item: str = ( + nested_list_of_enums_item_item_data + ) nested_list_of_enums_item.append(nested_list_of_enums_item_item) nested_list_of_enums.append(nested_list_of_enums_item) @@ -86,7 +94,9 @@ def to_dict(self) -> dict[str, Any]: if an_enum_value_with_only_null is not UNSET: field_dict["an_enum_value_with_only_null"] = an_enum_value_with_only_null if an_allof_enum_with_overridden_default is not UNSET: - field_dict["an_allof_enum_with_overridden_default"] = an_allof_enum_with_overridden_default + field_dict["an_allof_enum_with_overridden_default"] = ( + an_allof_enum_with_overridden_default + ) if an_optional_allof_enum is not UNSET: field_dict["an_optional_allof_enum"] = an_optional_allof_enum if nested_list_of_enums is not UNSET: @@ -99,7 +109,12 @@ def to_multipart(self) -> types.RequestFiles: if not isinstance(self.an_enum_value, Unset): for an_enum_value_item_element in self.an_enum_value: - files.append(("an_enum_value", (None, str(an_enum_value_item_element).encode(), "text/plain"))) + files.append( + ( + "an_enum_value", + (None, str(an_enum_value_item_element).encode(), "text/plain"), + ) + ) if not isinstance(self.an_enum_value_with_null, Unset): for an_enum_value_with_null_item_element in self.an_enum_value_with_null: @@ -107,23 +122,37 @@ def to_multipart(self) -> types.RequestFiles: files.append( ( "an_enum_value_with_null", - (None, str(an_enum_value_with_null_item_element).encode(), "text/plain"), + ( + None, + str(an_enum_value_with_null_item_element).encode(), + "text/plain", + ), ) ) else: files.append( ( "an_enum_value_with_null", - (None, str(an_enum_value_with_null_item_element).encode(), "text/plain"), + ( + None, + str(an_enum_value_with_null_item_element).encode(), + "text/plain", + ), ) ) if not isinstance(self.an_enum_value_with_only_null, Unset): - for an_enum_value_with_only_null_item_element in self.an_enum_value_with_only_null: + for ( + an_enum_value_with_only_null_item_element + ) in self.an_enum_value_with_only_null: files.append( ( "an_enum_value_with_only_null", - (None, str(an_enum_value_with_only_null_item_element).encode(), "text/plain"), + ( + None, + str(an_enum_value_with_only_null_item_element).encode(), + "text/plain", + ), ) ) @@ -131,20 +160,35 @@ def to_multipart(self) -> types.RequestFiles: files.append( ( "an_allof_enum_with_overridden_default", - (None, str(self.an_allof_enum_with_overridden_default).encode(), "text/plain"), + ( + None, + str(self.an_allof_enum_with_overridden_default).encode(), + "text/plain", + ), ) ) if not isinstance(self.an_optional_allof_enum, Unset): - files.append(("an_optional_allof_enum", (None, str(self.an_optional_allof_enum).encode(), "text/plain"))) + files.append( + ( + "an_optional_allof_enum", + (None, str(self.an_optional_allof_enum).encode(), "text/plain"), + ) + ) if not isinstance(self.nested_list_of_enums, Unset): for nested_list_of_enums_item_element in self.nested_list_of_enums: - for nested_list_of_enums_item_item_element in nested_list_of_enums_item_element: + for ( + nested_list_of_enums_item_item_element + ) in nested_list_of_enums_item_element: files.append( ( "nested_list_of_enums", - (None, str(nested_list_of_enums_item_item_element).encode(), "text/plain"), + ( + None, + str(nested_list_of_enums_item_item_element).encode(), + "text/plain", + ), ) ) @@ -167,31 +211,43 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _an_enum_value_with_null = d.pop("an_enum_value_with_null", UNSET) for an_enum_value_with_null_item_data in _an_enum_value_with_null or []: - def _parse_an_enum_value_with_null_item(data: object) -> Union[AnEnumWithNull, None]: + def _parse_an_enum_value_with_null_item( + data: object, + ) -> Union[AnEnumWithNull, None]: if data is None: return data try: if not isinstance(data, str): raise TypeError() - componentsschemas_an_enum_with_null_type_1 = check_an_enum_with_null(data) + componentsschemas_an_enum_with_null_type_1 = ( + check_an_enum_with_null(data) + ) return componentsschemas_an_enum_with_null_type_1 except: # noqa: E722 pass return cast(Union[AnEnumWithNull, None], data) - an_enum_value_with_null_item = _parse_an_enum_value_with_null_item(an_enum_value_with_null_item_data) + an_enum_value_with_null_item = _parse_an_enum_value_with_null_item( + an_enum_value_with_null_item_data + ) an_enum_value_with_null.append(an_enum_value_with_null_item) - an_enum_value_with_only_null = cast(list[None], d.pop("an_enum_value_with_only_null", UNSET)) + an_enum_value_with_only_null = cast( + list[None], d.pop("an_enum_value_with_only_null", UNSET) + ) - _an_allof_enum_with_overridden_default = d.pop("an_allof_enum_with_overridden_default", UNSET) + _an_allof_enum_with_overridden_default = d.pop( + "an_allof_enum_with_overridden_default", UNSET + ) an_allof_enum_with_overridden_default: Union[Unset, AnAllOfEnum] if isinstance(_an_allof_enum_with_overridden_default, Unset): an_allof_enum_with_overridden_default = UNSET else: - an_allof_enum_with_overridden_default = check_an_all_of_enum(_an_allof_enum_with_overridden_default) + an_allof_enum_with_overridden_default = check_an_all_of_enum( + _an_allof_enum_with_overridden_default + ) _an_optional_allof_enum = d.pop("an_optional_allof_enum", UNSET) an_optional_allof_enum: Union[Unset, AnAllOfEnum] @@ -206,7 +262,9 @@ def _parse_an_enum_value_with_null_item(data: object) -> Union[AnEnumWithNull, N nested_list_of_enums_item = [] _nested_list_of_enums_item = nested_list_of_enums_item_data for nested_list_of_enums_item_item_data in _nested_list_of_enums_item: - nested_list_of_enums_item_item = check_different_enum(nested_list_of_enums_item_item_data) + nested_list_of_enums_item_item = check_different_enum( + nested_list_of_enums_item_item_data + ) nested_list_of_enums_item.append(nested_list_of_enums_item_item) diff --git a/end_to_end_tests/metadata_snapshots/setup.py b/end_to_end_tests/metadata_snapshots/setup.py index 312241bb8..507c1d71b 100644 --- a/end_to_end_tests/metadata_snapshots/setup.py +++ b/end_to_end_tests/metadata_snapshots/setup.py @@ -13,6 +13,10 @@ long_description_content_type="text/markdown", packages=find_packages(), python_requires=">=3.9, <4", - install_requires=["httpx >= 0.23.0, < 0.29.0", "attrs >= 22.2.0", "python-dateutil >= 2.8.0, < 3"], + install_requires=[ + "httpx >= 0.23.0, < 0.29.0", + "attrs >= 22.2.0", + "python-dateutil >= 2.8.0, < 3", + ], package_data={"test_3_1_features_client": ["py.typed"]}, ) diff --git a/end_to_end_tests/regen_golden_record.py b/end_to_end_tests/regen_golden_record.py index ba608dfa3..86fdab1de 100644 --- a/end_to_end_tests/regen_golden_record.py +++ b/end_to_end_tests/regen_golden_record.py @@ -1,4 +1,5 @@ -""" Regenerate golden-record """ +"""Regenerate golden-record""" + import filecmp import shutil from pathlib import Path @@ -15,7 +16,7 @@ def _regenerate( output_dir: str = "my-test-api-client", golden_record_dir: Optional[str] = None, config_file_name: str = "config.yml", - extra_args: Optional[list[str]] = None + extra_args: Optional[list[str]] = None, ) -> None: end_to_end_tests_base_path = Path(__file__).parent project_base_path = end_to_end_tests_base_path.parent @@ -31,7 +32,9 @@ def _regenerate( args.append(f"--config={config_path}") if extra_args: args.extend(extra_args) - print(f"Using {spec_file_name}{f' and {config_file_name}' if config_file_name else ''}") + print( + f"Using {spec_file_name}{f' and {config_file_name}' if config_file_name else ''}" + ) result = runner.invoke(app, args) @@ -73,7 +76,12 @@ def regen_metadata_snapshots(): output_path = Path.cwd() / "test-3-1-features-client" snapshots_dir = Path(__file__).parent / "metadata_snapshots" - for (meta, file, rename_to) in (("setup", "setup.py", "setup.py"), ("pdm", "pyproject.toml", "pdm.pyproject.toml"), ("poetry", "pyproject.toml", "poetry.pyproject.toml"), ("uv", "pyproject.toml", "uv.pyproject.toml")): + for meta, file, rename_to in ( + ("setup", "setup.py", "setup.py"), + ("pdm", "pyproject.toml", "pdm.pyproject.toml"), + ("poetry", "pyproject.toml", "poetry.pyproject.toml"), + ("uv", "pyproject.toml", "uv.pyproject.toml"), + ): _regenerate( spec_file_name="3.1_specific.openapi.yaml", output_dir="test-3-1-features-client", diff --git a/end_to_end_tests/test-3-1-golden-record/test_3_1_features_client/api/const/post_const_path.py b/end_to_end_tests/test-3-1-golden-record/test_3_1_features_client/api/const/post_const_path.py index 1bb532823..a71dd24a8 100644 --- a/end_to_end_tests/test-3-1-golden-record/test_3_1_features_client/api/const/post_const_path.py +++ b/end_to_end_tests/test-3-1-golden-record/test_3_1_features_client/api/const/post_const_path.py @@ -44,7 +44,9 @@ def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[Literal["Why have a fixed response? I dunno"]]: if response.status_code == 200: - response_200 = cast(Literal["Why have a fixed response? I dunno"], response.json()) + response_200 = cast( + Literal["Why have a fixed response? I dunno"], response.json() + ) if response_200 != "Why have a fixed response? I dunno": raise ValueError( f"response_200 must match const 'Why have a fixed response? I dunno', got '{response_200}'" diff --git a/end_to_end_tests/test-3-1-golden-record/test_3_1_features_client/api/prefix_items/post_prefix_items.py b/end_to_end_tests/test-3-1-golden-record/test_3_1_features_client/api/prefix_items/post_prefix_items.py index 48a2c1733..6e14134d8 100644 --- a/end_to_end_tests/test-3-1-golden-record/test_3_1_features_client/api/prefix_items/post_prefix_items.py +++ b/end_to_end_tests/test-3-1-golden-record/test_3_1_features_client/api/prefix_items/post_prefix_items.py @@ -28,7 +28,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[str]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[str]: if response.status_code == 200: response_200 = cast(str, response.json()) return response_200 @@ -38,7 +40,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[str]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[str]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, diff --git a/end_to_end_tests/test-3-1-golden-record/test_3_1_features_client/client.py b/end_to_end_tests/test-3-1-golden-record/test_3_1_features_client/client.py index e80446f10..eeffd00c8 100644 --- a/end_to_end_tests/test-3-1-golden-record/test_3_1_features_client/client.py +++ b/end_to_end_tests/test-3-1-golden-record/test_3_1_features_client/client.py @@ -38,9 +38,15 @@ class Client: _base_url: str = field(alias="base_url") _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") - _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout") - _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl") - _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _timeout: Optional[httpx.Timeout] = field( + default=None, kw_only=True, alias="timeout" + ) + _verify_ssl: Union[str, bool, ssl.SSLContext] = field( + default=True, kw_only=True, alias="verify_ssl" + ) + _follow_redirects: bool = field( + default=False, kw_only=True, alias="follow_redirects" + ) _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") _client: Optional[httpx.Client] = field(default=None, init=False) _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) @@ -168,9 +174,15 @@ class AuthenticatedClient: _base_url: str = field(alias="base_url") _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") - _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout") - _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl") - _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _timeout: Optional[httpx.Timeout] = field( + default=None, kw_only=True, alias="timeout" + ) + _verify_ssl: Union[str, bool, ssl.SSLContext] = field( + default=True, kw_only=True, alias="verify_ssl" + ) + _follow_redirects: bool = field( + default=False, kw_only=True, alias="follow_redirects" + ) _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") _client: Optional[httpx.Client] = field(default=None, init=False) _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) @@ -214,7 +226,9 @@ def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient": def get_httpx_client(self) -> httpx.Client: """Get the underlying httpx.Client, constructing a new one if not previously set""" if self._client is None: - self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token + self._headers[self.auth_header_name] = ( + f"{self.prefix} {self.token}" if self.prefix else self.token + ) self._client = httpx.Client( base_url=self._base_url, cookies=self._cookies, @@ -235,7 +249,9 @@ def __exit__(self, *args: Any, **kwargs: Any) -> None: """Exit a context manager for internal httpx.Client (see httpx docs)""" self.get_httpx_client().__exit__(*args, **kwargs) - def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "AuthenticatedClient": + def set_async_httpx_client( + self, async_client: httpx.AsyncClient + ) -> "AuthenticatedClient": """Manually the underlying httpx.AsyncClient **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. @@ -246,7 +262,9 @@ def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Authentica def get_async_httpx_client(self) -> httpx.AsyncClient: """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" if self._async_client is None: - self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token + self._headers[self.auth_header_name] = ( + f"{self.prefix} {self.token}" if self.prefix else self.token + ) self._async_client = httpx.AsyncClient( base_url=self._base_url, cookies=self._cookies, diff --git a/end_to_end_tests/test-3-1-golden-record/test_3_1_features_client/models/post_const_path_body.py b/end_to_end_tests/test-3-1-golden-record/test_3_1_features_client/models/post_const_path_body.py index 3f910dc89..5a29ba283 100644 --- a/end_to_end_tests/test-3-1-golden-record/test_3_1_features_client/models/post_const_path_body.py +++ b/end_to_end_tests/test-3-1-golden-record/test_3_1_features_client/models/post_const_path_body.py @@ -49,9 +49,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) required = cast(Literal["this always goes in the body"], d.pop("required")) if required != "this always goes in the body": - raise ValueError(f"required must match const 'this always goes in the body', got '{required}'") + raise ValueError( + f"required must match const 'this always goes in the body', got '{required}'" + ) - def _parse_nullable(data: object) -> Union[Literal["this or null goes in the body"], None]: + def _parse_nullable( + data: object, + ) -> Union[Literal["this or null goes in the body"], None]: if data is None: return data nullable_type_1 = cast(Literal["this or null goes in the body"], data) @@ -64,9 +68,16 @@ def _parse_nullable(data: object) -> Union[Literal["this or null goes in the bod nullable = _parse_nullable(d.pop("nullable")) - optional = cast(Union[Literal["this sometimes goes in the body"], Unset], d.pop("optional", UNSET)) - if optional != "this sometimes goes in the body" and not isinstance(optional, Unset): - raise ValueError(f"optional must match const 'this sometimes goes in the body', got '{optional}'") + optional = cast( + Union[Literal["this sometimes goes in the body"], Unset], + d.pop("optional", UNSET), + ) + if optional != "this sometimes goes in the body" and not isinstance( + optional, Unset + ): + raise ValueError( + f"optional must match const 'this sometimes goes in the body', got '{optional}'" + ) post_const_path_body = cls( required=required, diff --git a/end_to_end_tests/test-3-1-golden-record/test_3_1_features_client/models/post_prefix_items_body.py b/end_to_end_tests/test-3-1-golden-record/test_3_1_features_client/models/post_prefix_items_body.py index 655c607d8..74721f66c 100644 --- a/end_to_end_tests/test-3-1-golden-record/test_3_1_features_client/models/post_prefix_items_body.py +++ b/end_to_end_tests/test-3-1-golden-record/test_3_1_features_client/models/post_prefix_items_body.py @@ -17,12 +17,16 @@ class PostPrefixItemsBody: prefix_items_only (Union[Unset, list[Union[float, str]]]): """ - prefix_items_and_items: Union[Unset, list[Union[Literal["prefix"], float, str]]] = UNSET + prefix_items_and_items: Union[Unset, list[Union[Literal["prefix"], float, str]]] = ( + UNSET + ) prefix_items_only: Union[Unset, list[Union[float, str]]] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - prefix_items_and_items: Union[Unset, list[Union[Literal["prefix"], float, str]]] = UNSET + prefix_items_and_items: Union[ + Unset, list[Union[Literal["prefix"], float, str]] + ] = UNSET if not isinstance(self.prefix_items_and_items, Unset): prefix_items_and_items = [] for prefix_items_and_items_item_data in self.prefix_items_and_items: @@ -55,7 +59,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _prefix_items_and_items = d.pop("prefixItemsAndItems", UNSET) for prefix_items_and_items_item_data in _prefix_items_and_items or []: - def _parse_prefix_items_and_items_item(data: object) -> Union[Literal["prefix"], float, str]: + def _parse_prefix_items_and_items_item( + data: object, + ) -> Union[Literal["prefix"], float, str]: prefix_items_and_items_item_type_0 = cast(Literal["prefix"], data) if prefix_items_and_items_item_type_0 != "prefix": raise ValueError( @@ -64,7 +70,9 @@ def _parse_prefix_items_and_items_item(data: object) -> Union[Literal["prefix"], return prefix_items_and_items_item_type_0 return cast(Union[Literal["prefix"], float, str], data) - prefix_items_and_items_item = _parse_prefix_items_and_items_item(prefix_items_and_items_item_data) + prefix_items_and_items_item = _parse_prefix_items_and_items_item( + prefix_items_and_items_item_data + ) prefix_items_and_items.append(prefix_items_and_items_item) @@ -75,7 +83,9 @@ def _parse_prefix_items_and_items_item(data: object) -> Union[Literal["prefix"], def _parse_prefix_items_only_item(data: object) -> Union[float, str]: return cast(Union[float, str], data) - prefix_items_only_item = _parse_prefix_items_only_item(prefix_items_only_item_data) + prefix_items_only_item = _parse_prefix_items_only_item( + prefix_items_only_item_data + ) prefix_items_only.append(prefix_items_only_item) diff --git a/end_to_end_tests/test_end_to_end.py b/end_to_end_tests/test_end_to_end.py index 347f72f7e..60c243edc 100644 --- a/end_to_end_tests/test_end_to_end.py +++ b/end_to_end_tests/test_end_to_end.py @@ -8,7 +8,9 @@ from typer.testing import CliRunner from end_to_end_tests.generated_client import ( - _run_command, generate_client, generate_client_from_inline_spec, + _run_command, + generate_client, + generate_client_from_inline_spec, ) from openapi_python_client.cli import app @@ -32,7 +34,9 @@ def _compare_directories( """ first_printable = record.relative_to(Path.cwd()) second_printable = test_subject.relative_to(Path.cwd()) - dc = dircmp(record, test_subject, ignore=[".ruff_cache", "__pycache__"] + (ignore or [])) + dc = dircmp( + record, test_subject, ignore=[".ruff_cache", "__pycache__"] + (ignore or []) + ) missing_files = set(dc.left_only + dc.right_only) - (expected_missing or set()) if missing_files: pytest.fail( @@ -88,16 +92,25 @@ def run_e2e_test( expected_missing: Optional[set[str]] = None, specify_output_path_explicitly: bool = True, ) -> Result: - with generate_client(openapi_document, extra_args, output_path, specify_output_path_explicitly=specify_output_path_explicitly) as g: + with generate_client( + openapi_document, + extra_args, + output_path, + specify_output_path_explicitly=specify_output_path_explicitly, + ) as g: gr_path = Path(__file__).parent / golden_record_path expected_differences = expected_differences or {} # Use absolute paths for expected differences for easier comparisons expected_differences = { - g.output_path.joinpath(key): value for key, value in expected_differences.items() + g.output_path.joinpath(key): value + for key, value in expected_differences.items() } _compare_directories( - gr_path, g.output_path, expected_differences=expected_differences, expected_missing=expected_missing + gr_path, + g.output_path, + expected_differences=expected_differences, + expected_missing=expected_missing, ) import mypy.api @@ -133,7 +146,7 @@ def test_literal_enums_end_to_end(): [f"--config={config_path}"], {}, "literal-enums-golden-record", - "my-enum-api-client" + "my-enum-api-client", ) @@ -144,7 +157,7 @@ def test_literal_enums_end_to_end(): ("pdm", "pyproject.toml", "pdm.pyproject.toml"), ("poetry", "pyproject.toml", "poetry.pyproject.toml"), ("uv", "pyproject.toml", "uv.pyproject.toml"), - ) + ), ) def test_meta(meta: str, generated_file: Optional[str], expected_file: Optional[str]): with generate_client( @@ -154,10 +167,9 @@ def test_meta(meta: str, generated_file: Optional[str], expected_file: Optional[ ) as g: if generated_file and expected_file: assert (g.output_path / generated_file).exists() - assert ( - (g.output_path / generated_file).read_text() == - (Path(__file__).parent / "metadata_snapshots" / expected_file).read_text() - ) + assert (g.output_path / generated_file).read_text() == ( + Path(__file__).parent / "metadata_snapshots" / expected_file + ).read_text() def test_none_meta(): @@ -224,10 +236,16 @@ def test_bad_url(): assert "Could not get OpenAPI document from provided URL" in result.stdout -ERROR_DOCUMENTS = [path for path in Path(__file__).parent.joinpath("documents_with_errors").iterdir() if path.is_file()] +ERROR_DOCUMENTS = [ + path + for path in Path(__file__).parent.joinpath("documents_with_errors").iterdir() + if path.is_file() +] -@pytest.mark.parametrize("document", ERROR_DOCUMENTS, ids=[path.stem for path in ERROR_DOCUMENTS]) +@pytest.mark.parametrize( + "document", ERROR_DOCUMENTS, ids=[path.stem for path in ERROR_DOCUMENTS] +) def test_documents_with_errors(snapshot, document): with generate_client( document, @@ -237,7 +255,9 @@ def test_documents_with_errors(snapshot, document): ) as g: result = g.generator_result assert result.exit_code == 1 - output = result.stdout.replace(str(g.output_path), "/test-documents-with-errors") + output = result.stdout.replace( + str(g.output_path), "/test-documents-with-errors" + ) assert output == snapshot @@ -279,7 +299,7 @@ def test_update_integration_tests(): "generate", extra_args=["--overwrite", "--meta=pdm", f"--output-path={temp_dir}"], url=url, - config_path=config_path + config_path=config_path, ) _compare_directories(source_path, temp_dir, ignore=["pyproject.toml"]) import mypy.api diff --git a/integration-tests/integration_tests/api/parameters/post_parameters_header.py b/integration-tests/integration_tests/api/parameters/post_parameters_header.py index 0981585cc..a8fdf6928 100644 --- a/integration-tests/integration_tests/api/parameters/post_parameters_header.py +++ b/integration-tests/integration_tests/api/parameters/post_parameters_header.py @@ -5,7 +5,9 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.post_parameters_header_response_200 import PostParametersHeaderResponse200 +from ...models.post_parameters_header_response_200 import ( + PostParametersHeaderResponse200, +) from ...models.public_error import PublicError from ...types import Response diff --git a/integration-tests/integration_tests/client.py b/integration-tests/integration_tests/client.py index e80446f10..eeffd00c8 100644 --- a/integration-tests/integration_tests/client.py +++ b/integration-tests/integration_tests/client.py @@ -38,9 +38,15 @@ class Client: _base_url: str = field(alias="base_url") _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") - _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout") - _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl") - _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _timeout: Optional[httpx.Timeout] = field( + default=None, kw_only=True, alias="timeout" + ) + _verify_ssl: Union[str, bool, ssl.SSLContext] = field( + default=True, kw_only=True, alias="verify_ssl" + ) + _follow_redirects: bool = field( + default=False, kw_only=True, alias="follow_redirects" + ) _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") _client: Optional[httpx.Client] = field(default=None, init=False) _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) @@ -168,9 +174,15 @@ class AuthenticatedClient: _base_url: str = field(alias="base_url") _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") - _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout") - _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl") - _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _timeout: Optional[httpx.Timeout] = field( + default=None, kw_only=True, alias="timeout" + ) + _verify_ssl: Union[str, bool, ssl.SSLContext] = field( + default=True, kw_only=True, alias="verify_ssl" + ) + _follow_redirects: bool = field( + default=False, kw_only=True, alias="follow_redirects" + ) _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") _client: Optional[httpx.Client] = field(default=None, init=False) _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) @@ -214,7 +226,9 @@ def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient": def get_httpx_client(self) -> httpx.Client: """Get the underlying httpx.Client, constructing a new one if not previously set""" if self._client is None: - self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token + self._headers[self.auth_header_name] = ( + f"{self.prefix} {self.token}" if self.prefix else self.token + ) self._client = httpx.Client( base_url=self._base_url, cookies=self._cookies, @@ -235,7 +249,9 @@ def __exit__(self, *args: Any, **kwargs: Any) -> None: """Exit a context manager for internal httpx.Client (see httpx docs)""" self.get_httpx_client().__exit__(*args, **kwargs) - def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "AuthenticatedClient": + def set_async_httpx_client( + self, async_client: httpx.AsyncClient + ) -> "AuthenticatedClient": """Manually the underlying httpx.AsyncClient **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. @@ -246,7 +262,9 @@ def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Authentica def get_async_httpx_client(self) -> httpx.AsyncClient: """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" if self._async_client is None: - self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token + self._headers[self.auth_header_name] = ( + f"{self.prefix} {self.token}" if self.prefix else self.token + ) self._async_client = httpx.AsyncClient( base_url=self._base_url, cookies=self._cookies, diff --git a/integration-tests/integration_tests/models/post_body_multipart_body.py b/integration-tests/integration_tests/models/post_body_multipart_body.py index cb73d1d8b..de926263b 100644 --- a/integration-tests/integration_tests/models/post_body_multipart_body.py +++ b/integration-tests/integration_tests/models/post_body_multipart_body.py @@ -79,13 +79,26 @@ def to_multipart(self) -> types.RequestFiles: for files_item_element in self.files: files.append(("files", files_item_element.to_tuple())) - files.append(("description", (None, str(self.description).encode(), "text/plain"))) + files.append( + ("description", (None, str(self.description).encode(), "text/plain")) + ) for objects_item_element in self.objects: - files.append(("objects", (None, json.dumps(objects_item_element.to_dict()).encode(), "application/json"))) + files.append( + ( + "objects", + ( + None, + json.dumps(objects_item_element.to_dict()).encode(), + "application/json", + ), + ) + ) for times_item_element in self.times: - files.append(("times", (None, times_item_element.isoformat().encode(), "text/plain"))) + files.append( + ("times", (None, times_item_element.isoformat().encode(), "text/plain")) + ) for prop_name, prop in self.additional_properties.items(): files.append((prop_name, (None, str(prop).encode(), "text/plain"))) diff --git a/integration-tests/tests/test_api/test_body/test_post_body_multipart.py b/integration-tests/tests/test_api/test_body/test_post_body_multipart.py index 52ac5dd00..eafe93166 100644 --- a/integration-tests/tests/test_api/test_body/test_post_body_multipart.py +++ b/integration-tests/tests/test_api/test_body/test_post_body_multipart.py @@ -8,7 +8,9 @@ from integration_tests.client import Client from integration_tests.models import AnObject, PublicError from integration_tests.models.post_body_multipart_body import PostBodyMultipartBody -from integration_tests.models.post_body_multipart_response_200 import PostBodyMultipartResponse200 +from integration_tests.models.post_body_multipart_response_200 import ( + PostBodyMultipartResponse200, +) from integration_tests.types import File, Response body = PostBodyMultipartBody( @@ -40,10 +42,14 @@ ) -def check_response(response: Response[Union[PostBodyMultipartResponse200, PublicError]]) -> None: +def check_response( + response: Response[Union[PostBodyMultipartResponse200, PublicError]], +) -> None: content = response.parsed if not isinstance(content, PostBodyMultipartResponse200): - raise AssertionError(f"Received status {response.status_code} from test server with payload: {content!r}") + raise AssertionError( + f"Received status {response.status_code} from test server with payload: {content!r}" + ) assert content.a_string == body.a_string assert content.description == body.description @@ -79,7 +85,10 @@ def log_response(*_: Any, **__: Any) -> None: response_hook_called = True client = Client( - "http://localhost:3000", httpx_args={"event_hooks": {"request": [log_request], "response": [log_response]}} + "http://localhost:3000", + httpx_args={ + "event_hooks": {"request": [log_request], "response": [log_response]} + }, ) post_body_multipart.sync_detailed( diff --git a/integration-tests/tests/test_api/test_parameters/test_post_parameters_header.py b/integration-tests/tests/test_api/test_parameters/test_post_parameters_header.py index 2403ca417..93d2d4ce7 100644 --- a/integration-tests/tests/test_api/test_parameters/test_post_parameters_header.py +++ b/integration-tests/tests/test_api/test_parameters/test_post_parameters_header.py @@ -1,6 +1,8 @@ from integration_tests.api.parameters.post_parameters_header import sync_detailed from integration_tests.client import Client -from integration_tests.models.post_parameters_header_response_200 import PostParametersHeaderResponse200 +from integration_tests.models.post_parameters_header_response_200 import ( + PostParametersHeaderResponse200, +) def test(client: Client) -> None: diff --git a/openapi/README_internal.md b/openapi/README_internal.md new file mode 100644 index 000000000..8cf114abf --- /dev/null +++ b/openapi/README_internal.md @@ -0,0 +1,20 @@ +pip install openapi-python-client + +preprocess json or yaml in your + +To gen client +cd openAPI + +# still in your venv +python -m openapi_python_client generate ` + --overwrite ` + --config openapi\class_overrides.yaml ` + --custom-template-path openapi\templates ` + --path openapi\swagger_cleaned.json + +or +openapi-python-client generate --overwrite --path ./openapiv3.yaml + +Remove gitignore/pyproject +rm openapi_project\.gitignore +rm openapi_project\pyproject.toml diff --git a/openapi/class_overrides.yaml b/openapi/class_overrides.yaml new file mode 100644 index 000000000..c484f85e8 --- /dev/null +++ b/openapi/class_overrides.yaml @@ -0,0 +1,11 @@ +class_overrides: + Any: + class_name: AnyModel + module_name: any_model +project_name_override: openapi_project +package_name_override: openapi_package +field_prefix: attr_ +use_path_prefixes_for_title_model_names: false +post_hooks: + - "black ." + - "ruff check . --fix" \ No newline at end of file diff --git a/openapi/openapi_project/README.md b/openapi/openapi_project/README.md new file mode 100644 index 000000000..126ad5b7e --- /dev/null +++ b/openapi/openapi_project/README.md @@ -0,0 +1,124 @@ +# openapi_project +A client library for accessing Silexx API + +## Usage +First, create a client: + +```python +from openapi_package import Client + +client = Client(base_url="https://api.example.com") +``` + +If the endpoints you're going to hit require authentication, use `AuthenticatedClient` instead: + +```python +from openapi_package import AuthenticatedClient + +client = AuthenticatedClient(base_url="https://api.example.com", token="SuperSecretToken") +``` + +Now call your endpoint and use your models: + +```python +from openapi_package.models import MyDataModel +from openapi_package.api.my_tag import get_my_data_model +from openapi_package.types import Response + +with client as client: + my_data: MyDataModel = get_my_data_model.sync(client=client) + # or if you need more info (e.g. status_code) + response: Response[MyDataModel] = get_my_data_model.sync_detailed(client=client) +``` + +Or do the same thing with an async version: + +```python +from openapi_package.models import MyDataModel +from openapi_package.api.my_tag import get_my_data_model +from openapi_package.types import Response + +async with client as client: + my_data: MyDataModel = await get_my_data_model.asyncio(client=client) + response: Response[MyDataModel] = await get_my_data_model.asyncio_detailed(client=client) +``` + +By default, when you're calling an HTTPS API it will attempt to verify that SSL is working correctly. Using certificate verification is highly recommended most of the time, but sometimes you may need to authenticate to a server (especially an internal server) using a custom certificate bundle. + +```python +client = AuthenticatedClient( + base_url="https://internal_api.example.com", + token="SuperSecretToken", + verify_ssl="/path/to/certificate_bundle.pem", +) +``` + +You can also disable certificate validation altogether, but beware that **this is a security risk**. + +```python +client = AuthenticatedClient( + base_url="https://internal_api.example.com", + token="SuperSecretToken", + verify_ssl=False +) +``` + +Things to know: +1. Every path/method combo becomes a Python module with four functions: + 1. `sync`: Blocking request that returns parsed data (if successful) or `None` + 1. `sync_detailed`: Blocking request that always returns a `Request`, optionally with `parsed` set if the request was successful. + 1. `asyncio`: Like `sync` but async instead of blocking + 1. `asyncio_detailed`: Like `sync_detailed` but async instead of blocking + +1. All path/query params, and bodies become method arguments. +1. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above) +1. Any endpoint which did not have a tag will be in `openapi_package.api.default` + +## Advanced customizations + +There are more settings on the generated `Client` class which let you control more runtime behavior, check out the docstring on that class for more info. You can also customize the underlying `httpx.Client` or `httpx.AsyncClient` (depending on your use-case): + +```python +from openapi_package import Client + +def log_request(request): + print(f"Request event hook: {request.method} {request.url} - Waiting for response") + +def log_response(response): + request = response.request + print(f"Response event hook: {request.method} {request.url} - Status {response.status_code}") + +client = Client( + base_url="https://api.example.com", + httpx_args={"event_hooks": {"request": [log_request], "response": [log_response]}}, +) + +# Or get the underlying httpx client to modify directly with client.get_httpx_client() or client.get_async_httpx_client() +``` + +You can even set the httpx client directly, but beware that this will override any existing settings (e.g., base_url): + +```python +import httpx +from openapi_package import Client + +client = Client( + base_url="https://api.example.com", +) +# Note that base_url needs to be re-set, as would any shared cookies, headers, etc. +client.set_httpx_client(httpx.Client(base_url="https://api.example.com", proxies="http://localhost:8030")) +``` + +## Building / publishing this package +This project uses [Poetry](https://python-poetry.org/) to manage dependencies and packaging. Here are the basics: +1. Update the metadata in pyproject.toml (e.g. authors, version) +1. If you're using a private repository, configure it with Poetry + 1. `poetry config repositories. ` + 1. `poetry config http-basic. ` +1. Publish the client with `poetry publish --build -r ` or, if for public PyPI, just `poetry publish --build` + +If you want to install this client into another project without publishing it (e.g. for development) then: +1. If that project **is using Poetry**, you can simply do `poetry add ` from that project +1. If that project is not using Poetry: + 1. Build a wheel with `poetry build -f wheel` + 1. Install that wheel from the other project `pip install ` diff --git a/openapi/openapi_project/openapi_package/__init__.py b/openapi/openapi_project/openapi_package/__init__.py new file mode 100644 index 000000000..4eeee1912 --- /dev/null +++ b/openapi/openapi_project/openapi_package/__init__.py @@ -0,0 +1,8 @@ +"""A client library for accessing Silexx API""" + +from .client import AuthenticatedClient, Client + +__all__ = ( + "AuthenticatedClient", + "Client", +) diff --git a/openapi/openapi_project/openapi_package/api/__init__.py b/openapi/openapi_project/openapi_package/api/__init__.py new file mode 100644 index 000000000..e6035bd9f --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/__init__.py @@ -0,0 +1 @@ +"""Contains methods for accessing the API""" diff --git a/openapi/openapi_project/openapi_package/api/application_service/__init__.py b/openapi/openapi_project/openapi_package/api/application_service/__init__.py new file mode 100644 index 000000000..dcbab9a7a --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/application_service/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/openapi/openapi_project/openapi_package/api/application_service/post_application_login.py b/openapi/openapi_project/openapi_package/api/application_service/post_application_login.py new file mode 100644 index 000000000..840b19d1b --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/application_service/post_application_login.py @@ -0,0 +1,154 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.login_request import LoginRequest +from ...models.login_response import LoginResponse +from ...types import Response + + +def _get_kwargs( + *, + body: LoginRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/application/login", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> LoginResponse | None: + if response.status_code == 200: + response_200 = LoginResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[LoginResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: LoginRequest, +) -> Response[LoginResponse]: + """ + Args: + body (LoginRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LoginResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: LoginRequest, +) -> LoginResponse | None: + """ + Args: + body (LoginRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LoginResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: LoginRequest, +) -> Response[LoginResponse]: + """ + Args: + body (LoginRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LoginResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: LoginRequest, +) -> LoginResponse | None: + """ + Args: + body (LoginRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LoginResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/__init__.py b/openapi/openapi_project/openapi_package/api/order_service/__init__.py new file mode 100644 index 000000000..dcbab9a7a --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/order_service/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/openapi/openapi_project/openapi_package/api/order_service/get_orders.py b/openapi/openapi_project/openapi_package/api/order_service/get_orders.py new file mode 100644 index 000000000..d9c0716fb --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/order_service/get_orders.py @@ -0,0 +1,121 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.list_orders_response import ListOrdersResponse +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/orders", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ListOrdersResponse | None: + if response.status_code == 200: + response_200 = ListOrdersResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ListOrdersResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListOrdersResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListOrdersResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> ListOrdersResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListOrdersResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListOrdersResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListOrdersResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> ListOrdersResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListOrdersResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/get_orders_searchhistory.py b/openapi/openapi_project/openapi_package/api/order_service/get_orders_searchhistory.py new file mode 100644 index 000000000..ee5601a21 --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/order_service/get_orders_searchhistory.py @@ -0,0 +1,243 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.search_order_history_response import SearchOrderHistoryResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + account_ids: Unset | str = UNSET, + to_dt_year: Unset | str = UNSET, + to_dt_month: Unset | str = UNSET, + to_dt_day: Unset | str = UNSET, + from_dt_year: Unset | str = UNSET, + from_dt_month: Unset | str = UNSET, + from_dt_day: Unset | str = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["accountIds"] = account_ids + + params["toDt.year"] = to_dt_year + + params["toDt.month"] = to_dt_month + + params["toDt.day"] = to_dt_day + + params["fromDt.year"] = from_dt_year + + params["fromDt.month"] = from_dt_month + + params["fromDt.day"] = from_dt_day + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/orders/searchhistory", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> SearchOrderHistoryResponse | None: + if response.status_code == 200: + response_200 = SearchOrderHistoryResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[SearchOrderHistoryResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + account_ids: Unset | str = UNSET, + to_dt_year: Unset | str = UNSET, + to_dt_month: Unset | str = UNSET, + to_dt_day: Unset | str = UNSET, + from_dt_year: Unset | str = UNSET, + from_dt_month: Unset | str = UNSET, + from_dt_day: Unset | str = UNSET, +) -> Response[SearchOrderHistoryResponse]: + """ + Args: + account_ids (Union[Unset, str]): + to_dt_year (Union[Unset, str]): + to_dt_month (Union[Unset, str]): + to_dt_day (Union[Unset, str]): + from_dt_year (Union[Unset, str]): + from_dt_month (Union[Unset, str]): + from_dt_day (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SearchOrderHistoryResponse] + """ + + kwargs = _get_kwargs( + account_ids=account_ids, + to_dt_year=to_dt_year, + to_dt_month=to_dt_month, + to_dt_day=to_dt_day, + from_dt_year=from_dt_year, + from_dt_month=from_dt_month, + from_dt_day=from_dt_day, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + account_ids: Unset | str = UNSET, + to_dt_year: Unset | str = UNSET, + to_dt_month: Unset | str = UNSET, + to_dt_day: Unset | str = UNSET, + from_dt_year: Unset | str = UNSET, + from_dt_month: Unset | str = UNSET, + from_dt_day: Unset | str = UNSET, +) -> SearchOrderHistoryResponse | None: + """ + Args: + account_ids (Union[Unset, str]): + to_dt_year (Union[Unset, str]): + to_dt_month (Union[Unset, str]): + to_dt_day (Union[Unset, str]): + from_dt_year (Union[Unset, str]): + from_dt_month (Union[Unset, str]): + from_dt_day (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SearchOrderHistoryResponse + """ + + return sync_detailed( + client=client, + account_ids=account_ids, + to_dt_year=to_dt_year, + to_dt_month=to_dt_month, + to_dt_day=to_dt_day, + from_dt_year=from_dt_year, + from_dt_month=from_dt_month, + from_dt_day=from_dt_day, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + account_ids: Unset | str = UNSET, + to_dt_year: Unset | str = UNSET, + to_dt_month: Unset | str = UNSET, + to_dt_day: Unset | str = UNSET, + from_dt_year: Unset | str = UNSET, + from_dt_month: Unset | str = UNSET, + from_dt_day: Unset | str = UNSET, +) -> Response[SearchOrderHistoryResponse]: + """ + Args: + account_ids (Union[Unset, str]): + to_dt_year (Union[Unset, str]): + to_dt_month (Union[Unset, str]): + to_dt_day (Union[Unset, str]): + from_dt_year (Union[Unset, str]): + from_dt_month (Union[Unset, str]): + from_dt_day (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SearchOrderHistoryResponse] + """ + + kwargs = _get_kwargs( + account_ids=account_ids, + to_dt_year=to_dt_year, + to_dt_month=to_dt_month, + to_dt_day=to_dt_day, + from_dt_year=from_dt_year, + from_dt_month=from_dt_month, + from_dt_day=from_dt_day, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + account_ids: Unset | str = UNSET, + to_dt_year: Unset | str = UNSET, + to_dt_month: Unset | str = UNSET, + to_dt_day: Unset | str = UNSET, + from_dt_year: Unset | str = UNSET, + from_dt_month: Unset | str = UNSET, + from_dt_day: Unset | str = UNSET, +) -> SearchOrderHistoryResponse | None: + """ + Args: + account_ids (Union[Unset, str]): + to_dt_year (Union[Unset, str]): + to_dt_month (Union[Unset, str]): + to_dt_day (Union[Unset, str]): + from_dt_year (Union[Unset, str]): + from_dt_month (Union[Unset, str]): + from_dt_day (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SearchOrderHistoryResponse + """ + + return ( + await asyncio_detailed( + client=client, + account_ids=account_ids, + to_dt_year=to_dt_year, + to_dt_month=to_dt_month, + to_dt_day=to_dt_day, + from_dt_year=from_dt_year, + from_dt_month=from_dt_month, + from_dt_day=from_dt_day, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/get_orders_tradeconfirms.py b/openapi/openapi_project/openapi_package/api/order_service/get_orders_tradeconfirms.py new file mode 100644 index 000000000..f153b8d1c --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/order_service/get_orders_tradeconfirms.py @@ -0,0 +1,213 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.list_trade_confirms_response import ListTradeConfirmsResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + account_ids: Unset | str = UNSET, + end_time_utc: Unset | str = UNSET, + start_time_utc: Unset | str = UNSET, + trading_firm_ids: Unset | str = UNSET, + user_ids: Unset | str = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["accountIds"] = account_ids + + params["endTimeUtc"] = end_time_utc + + params["startTimeUtc"] = start_time_utc + + params["tradingFirmIds"] = trading_firm_ids + + params["userIds"] = user_ids + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/orders/tradeconfirms", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ListTradeConfirmsResponse | None: + if response.status_code == 200: + response_200 = ListTradeConfirmsResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ListTradeConfirmsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + account_ids: Unset | str = UNSET, + end_time_utc: Unset | str = UNSET, + start_time_utc: Unset | str = UNSET, + trading_firm_ids: Unset | str = UNSET, + user_ids: Unset | str = UNSET, +) -> Response[ListTradeConfirmsResponse]: + """ + Args: + account_ids (Union[Unset, str]): + end_time_utc (Union[Unset, str]): + start_time_utc (Union[Unset, str]): + trading_firm_ids (Union[Unset, str]): + user_ids (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListTradeConfirmsResponse] + """ + + kwargs = _get_kwargs( + account_ids=account_ids, + end_time_utc=end_time_utc, + start_time_utc=start_time_utc, + trading_firm_ids=trading_firm_ids, + user_ids=user_ids, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + account_ids: Unset | str = UNSET, + end_time_utc: Unset | str = UNSET, + start_time_utc: Unset | str = UNSET, + trading_firm_ids: Unset | str = UNSET, + user_ids: Unset | str = UNSET, +) -> ListTradeConfirmsResponse | None: + """ + Args: + account_ids (Union[Unset, str]): + end_time_utc (Union[Unset, str]): + start_time_utc (Union[Unset, str]): + trading_firm_ids (Union[Unset, str]): + user_ids (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListTradeConfirmsResponse + """ + + return sync_detailed( + client=client, + account_ids=account_ids, + end_time_utc=end_time_utc, + start_time_utc=start_time_utc, + trading_firm_ids=trading_firm_ids, + user_ids=user_ids, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + account_ids: Unset | str = UNSET, + end_time_utc: Unset | str = UNSET, + start_time_utc: Unset | str = UNSET, + trading_firm_ids: Unset | str = UNSET, + user_ids: Unset | str = UNSET, +) -> Response[ListTradeConfirmsResponse]: + """ + Args: + account_ids (Union[Unset, str]): + end_time_utc (Union[Unset, str]): + start_time_utc (Union[Unset, str]): + trading_firm_ids (Union[Unset, str]): + user_ids (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListTradeConfirmsResponse] + """ + + kwargs = _get_kwargs( + account_ids=account_ids, + end_time_utc=end_time_utc, + start_time_utc=start_time_utc, + trading_firm_ids=trading_firm_ids, + user_ids=user_ids, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + account_ids: Unset | str = UNSET, + end_time_utc: Unset | str = UNSET, + start_time_utc: Unset | str = UNSET, + trading_firm_ids: Unset | str = UNSET, + user_ids: Unset | str = UNSET, +) -> ListTradeConfirmsResponse | None: + """ + Args: + account_ids (Union[Unset, str]): + end_time_utc (Union[Unset, str]): + start_time_utc (Union[Unset, str]): + trading_firm_ids (Union[Unset, str]): + user_ids (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListTradeConfirmsResponse + """ + + return ( + await asyncio_detailed( + client=client, + account_ids=account_ids, + end_time_utc=end_time_utc, + start_time_utc=start_time_utc, + trading_firm_ids=trading_firm_ids, + user_ids=user_ids, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_cancelorder.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_cancelorder.py new file mode 100644 index 000000000..4f77ee5f7 --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/order_service/post_orders_cancelorder.py @@ -0,0 +1,154 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.cancel_order_request import CancelOrderRequest +from ...models.cancel_order_response import CancelOrderResponse +from ...types import Response + + +def _get_kwargs( + *, + body: CancelOrderRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/orders/cancelorder", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CancelOrderResponse | None: + if response.status_code == 200: + response_200 = CancelOrderResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CancelOrderResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CancelOrderRequest, +) -> Response[CancelOrderResponse]: + """ + Args: + body (CancelOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CancelOrderResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CancelOrderRequest, +) -> CancelOrderResponse | None: + """ + Args: + body (CancelOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CancelOrderResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CancelOrderRequest, +) -> Response[CancelOrderResponse]: + """ + Args: + body (CancelOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CancelOrderResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CancelOrderRequest, +) -> CancelOrderResponse | None: + """ + Args: + body (CancelOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CancelOrderResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_createmultilegorder.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_createmultilegorder.py new file mode 100644 index 000000000..244f618f7 --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/order_service/post_orders_createmultilegorder.py @@ -0,0 +1,154 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.create_multi_leg_order_request import CreateMultiLegOrderRequest +from ...models.create_multi_leg_order_response import CreateMultiLegOrderResponse +from ...types import Response + + +def _get_kwargs( + *, + body: CreateMultiLegOrderRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/orders/createmultilegorder", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateMultiLegOrderResponse | None: + if response.status_code == 200: + response_200 = CreateMultiLegOrderResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateMultiLegOrderResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderRequest, +) -> Response[CreateMultiLegOrderResponse]: + """ + Args: + body (CreateMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateMultiLegOrderResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderRequest, +) -> CreateMultiLegOrderResponse | None: + """ + Args: + body (CreateMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateMultiLegOrderResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderRequest, +) -> Response[CreateMultiLegOrderResponse]: + """ + Args: + body (CreateMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateMultiLegOrderResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderRequest, +) -> CreateMultiLegOrderResponse | None: + """ + Args: + body (CreateMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateMultiLegOrderResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_createmultilegordercross.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_createmultilegordercross.py new file mode 100644 index 000000000..b26c3b915 --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/order_service/post_orders_createmultilegordercross.py @@ -0,0 +1,158 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.create_multi_leg_order_cross_request import ( + CreateMultiLegOrderCrossRequest, +) +from ...models.create_multi_leg_order_cross_response import ( + CreateMultiLegOrderCrossResponse, +) +from ...types import Response + + +def _get_kwargs( + *, + body: CreateMultiLegOrderCrossRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/orders/createmultilegordercross", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateMultiLegOrderCrossResponse | None: + if response.status_code == 200: + response_200 = CreateMultiLegOrderCrossResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateMultiLegOrderCrossResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderCrossRequest, +) -> Response[CreateMultiLegOrderCrossResponse]: + """ + Args: + body (CreateMultiLegOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateMultiLegOrderCrossResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderCrossRequest, +) -> CreateMultiLegOrderCrossResponse | None: + """ + Args: + body (CreateMultiLegOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateMultiLegOrderCrossResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderCrossRequest, +) -> Response[CreateMultiLegOrderCrossResponse]: + """ + Args: + body (CreateMultiLegOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateMultiLegOrderCrossResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderCrossRequest, +) -> CreateMultiLegOrderCrossResponse | None: + """ + Args: + body (CreateMultiLegOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateMultiLegOrderCrossResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_createorder.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_createorder.py new file mode 100644 index 000000000..8e6561ac9 --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/order_service/post_orders_createorder.py @@ -0,0 +1,154 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.create_order_request import CreateOrderRequest +from ...models.create_order_response import CreateOrderResponse +from ...types import Response + + +def _get_kwargs( + *, + body: CreateOrderRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/orders/createorder", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateOrderResponse | None: + if response.status_code == 200: + response_200 = CreateOrderResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateOrderResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateOrderRequest, +) -> Response[CreateOrderResponse]: + """ + Args: + body (CreateOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateOrderResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CreateOrderRequest, +) -> CreateOrderResponse | None: + """ + Args: + body (CreateOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateOrderResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateOrderRequest, +) -> Response[CreateOrderResponse]: + """ + Args: + body (CreateOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateOrderResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CreateOrderRequest, +) -> CreateOrderResponse | None: + """ + Args: + body (CreateOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateOrderResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_createordercross.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_createordercross.py new file mode 100644 index 000000000..1ad1aeded --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/order_service/post_orders_createordercross.py @@ -0,0 +1,154 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.create_order_cross_request import CreateOrderCrossRequest +from ...models.create_order_cross_response import CreateOrderCrossResponse +from ...types import Response + + +def _get_kwargs( + *, + body: CreateOrderCrossRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/orders/createordercross", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateOrderCrossResponse | None: + if response.status_code == 200: + response_200 = CreateOrderCrossResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateOrderCrossResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateOrderCrossRequest, +) -> Response[CreateOrderCrossResponse]: + """ + Args: + body (CreateOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateOrderCrossResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CreateOrderCrossRequest, +) -> CreateOrderCrossResponse | None: + """ + Args: + body (CreateOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateOrderCrossResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateOrderCrossRequest, +) -> Response[CreateOrderCrossResponse]: + """ + Args: + body (CreateOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateOrderCrossResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CreateOrderCrossRequest, +) -> CreateOrderCrossResponse | None: + """ + Args: + body (CreateOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateOrderCrossResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_replacemultilegorder.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_replacemultilegorder.py new file mode 100644 index 000000000..99edd1177 --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/order_service/post_orders_replacemultilegorder.py @@ -0,0 +1,158 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.cancel_replace_multi_leg_order_request import ( + CancelReplaceMultiLegOrderRequest, +) +from ...models.cancel_replace_multi_leg_order_response import ( + CancelReplaceMultiLegOrderResponse, +) +from ...types import Response + + +def _get_kwargs( + *, + body: CancelReplaceMultiLegOrderRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/orders/replacemultilegorder", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CancelReplaceMultiLegOrderResponse | None: + if response.status_code == 200: + response_200 = CancelReplaceMultiLegOrderResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CancelReplaceMultiLegOrderResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceMultiLegOrderRequest, +) -> Response[CancelReplaceMultiLegOrderResponse]: + """ + Args: + body (CancelReplaceMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CancelReplaceMultiLegOrderResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceMultiLegOrderRequest, +) -> CancelReplaceMultiLegOrderResponse | None: + """ + Args: + body (CancelReplaceMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CancelReplaceMultiLegOrderResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceMultiLegOrderRequest, +) -> Response[CancelReplaceMultiLegOrderResponse]: + """ + Args: + body (CancelReplaceMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CancelReplaceMultiLegOrderResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceMultiLegOrderRequest, +) -> CancelReplaceMultiLegOrderResponse | None: + """ + Args: + body (CancelReplaceMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CancelReplaceMultiLegOrderResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_replaceorder.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_replaceorder.py new file mode 100644 index 000000000..c16d3f72c --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/order_service/post_orders_replaceorder.py @@ -0,0 +1,154 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.cancel_replace_order_request import CancelReplaceOrderRequest +from ...models.cancel_replace_order_response import CancelReplaceOrderResponse +from ...types import Response + + +def _get_kwargs( + *, + body: CancelReplaceOrderRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/orders/replaceorder", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CancelReplaceOrderResponse | None: + if response.status_code == 200: + response_200 = CancelReplaceOrderResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CancelReplaceOrderResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceOrderRequest, +) -> Response[CancelReplaceOrderResponse]: + """ + Args: + body (CancelReplaceOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CancelReplaceOrderResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceOrderRequest, +) -> CancelReplaceOrderResponse | None: + """ + Args: + body (CancelReplaceOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CancelReplaceOrderResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceOrderRequest, +) -> Response[CancelReplaceOrderResponse]: + """ + Args: + body (CancelReplaceOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CancelReplaceOrderResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceOrderRequest, +) -> CancelReplaceOrderResponse | None: + """ + Args: + body (CancelReplaceOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CancelReplaceOrderResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegorder.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegorder.py new file mode 100644 index 000000000..184bcd0d7 --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegorder.py @@ -0,0 +1,154 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.create_multi_leg_order_request import CreateMultiLegOrderRequest +from ...models.validate_risk_response import ValidateRiskResponse +from ...types import Response + + +def _get_kwargs( + *, + body: CreateMultiLegOrderRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/orders/validaterisk/createmultilegorder", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ValidateRiskResponse | None: + if response.status_code == 200: + response_200 = ValidateRiskResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ValidateRiskResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderRequest, +) -> Response[ValidateRiskResponse]: + """ + Args: + body (CreateMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ValidateRiskResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderRequest, +) -> ValidateRiskResponse | None: + """ + Args: + body (CreateMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ValidateRiskResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderRequest, +) -> Response[ValidateRiskResponse]: + """ + Args: + body (CreateMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ValidateRiskResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderRequest, +) -> ValidateRiskResponse | None: + """ + Args: + body (CreateMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ValidateRiskResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegordercross.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegordercross.py new file mode 100644 index 000000000..16ca8e2e3 --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegordercross.py @@ -0,0 +1,156 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.create_multi_leg_order_cross_request import ( + CreateMultiLegOrderCrossRequest, +) +from ...models.validate_risk_response import ValidateRiskResponse +from ...types import Response + + +def _get_kwargs( + *, + body: CreateMultiLegOrderCrossRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/orders/validaterisk/createmultilegordercross", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ValidateRiskResponse | None: + if response.status_code == 200: + response_200 = ValidateRiskResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ValidateRiskResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderCrossRequest, +) -> Response[ValidateRiskResponse]: + """ + Args: + body (CreateMultiLegOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ValidateRiskResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderCrossRequest, +) -> ValidateRiskResponse | None: + """ + Args: + body (CreateMultiLegOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ValidateRiskResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderCrossRequest, +) -> Response[ValidateRiskResponse]: + """ + Args: + body (CreateMultiLegOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ValidateRiskResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderCrossRequest, +) -> ValidateRiskResponse | None: + """ + Args: + body (CreateMultiLegOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ValidateRiskResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createorder.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createorder.py new file mode 100644 index 000000000..83931714e --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createorder.py @@ -0,0 +1,154 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.create_order_request import CreateOrderRequest +from ...models.validate_risk_response import ValidateRiskResponse +from ...types import Response + + +def _get_kwargs( + *, + body: CreateOrderRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/orders/validaterisk/createorder", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ValidateRiskResponse | None: + if response.status_code == 200: + response_200 = ValidateRiskResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ValidateRiskResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateOrderRequest, +) -> Response[ValidateRiskResponse]: + """ + Args: + body (CreateOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ValidateRiskResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CreateOrderRequest, +) -> ValidateRiskResponse | None: + """ + Args: + body (CreateOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ValidateRiskResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateOrderRequest, +) -> Response[ValidateRiskResponse]: + """ + Args: + body (CreateOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ValidateRiskResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CreateOrderRequest, +) -> ValidateRiskResponse | None: + """ + Args: + body (CreateOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ValidateRiskResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createordercross.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createordercross.py new file mode 100644 index 000000000..b2adcc914 --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createordercross.py @@ -0,0 +1,154 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.create_order_cross_request import CreateOrderCrossRequest +from ...models.validate_risk_response import ValidateRiskResponse +from ...types import Response + + +def _get_kwargs( + *, + body: CreateOrderCrossRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/orders/validaterisk/createordercross", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ValidateRiskResponse | None: + if response.status_code == 200: + response_200 = ValidateRiskResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ValidateRiskResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateOrderCrossRequest, +) -> Response[ValidateRiskResponse]: + """ + Args: + body (CreateOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ValidateRiskResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CreateOrderCrossRequest, +) -> ValidateRiskResponse | None: + """ + Args: + body (CreateOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ValidateRiskResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateOrderCrossRequest, +) -> Response[ValidateRiskResponse]: + """ + Args: + body (CreateOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ValidateRiskResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CreateOrderCrossRequest, +) -> ValidateRiskResponse | None: + """ + Args: + body (CreateOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ValidateRiskResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replacemultilegorder.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replacemultilegorder.py new file mode 100644 index 000000000..7655b76ba --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replacemultilegorder.py @@ -0,0 +1,156 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.cancel_replace_multi_leg_order_request import ( + CancelReplaceMultiLegOrderRequest, +) +from ...models.validate_risk_response import ValidateRiskResponse +from ...types import Response + + +def _get_kwargs( + *, + body: CancelReplaceMultiLegOrderRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/orders/validaterisk/replacemultilegorder", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ValidateRiskResponse | None: + if response.status_code == 200: + response_200 = ValidateRiskResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ValidateRiskResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceMultiLegOrderRequest, +) -> Response[ValidateRiskResponse]: + """ + Args: + body (CancelReplaceMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ValidateRiskResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceMultiLegOrderRequest, +) -> ValidateRiskResponse | None: + """ + Args: + body (CancelReplaceMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ValidateRiskResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceMultiLegOrderRequest, +) -> Response[ValidateRiskResponse]: + """ + Args: + body (CancelReplaceMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ValidateRiskResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceMultiLegOrderRequest, +) -> ValidateRiskResponse | None: + """ + Args: + body (CancelReplaceMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ValidateRiskResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replaceorder.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replaceorder.py new file mode 100644 index 000000000..d7319c92b --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replaceorder.py @@ -0,0 +1,154 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.cancel_replace_order_request import CancelReplaceOrderRequest +from ...models.validate_risk_response import ValidateRiskResponse +from ...types import Response + + +def _get_kwargs( + *, + body: CancelReplaceOrderRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/orders/validaterisk/replaceorder", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ValidateRiskResponse | None: + if response.status_code == 200: + response_200 = ValidateRiskResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ValidateRiskResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceOrderRequest, +) -> Response[ValidateRiskResponse]: + """ + Args: + body (CancelReplaceOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ValidateRiskResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceOrderRequest, +) -> ValidateRiskResponse | None: + """ + Args: + body (CancelReplaceOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ValidateRiskResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceOrderRequest, +) -> Response[ValidateRiskResponse]: + """ + Args: + body (CancelReplaceOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ValidateRiskResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceOrderRequest, +) -> ValidateRiskResponse | None: + """ + Args: + body (CancelReplaceOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ValidateRiskResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/portfolio_service/__init__.py b/openapi/openapi_project/openapi_package/api/portfolio_service/__init__.py new file mode 100644 index 000000000..dcbab9a7a --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/portfolio_service/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/openapi/openapi_project/openapi_package/api/portfolio_service/get_portfolio_positions.py b/openapi/openapi_project/openapi_package/api/portfolio_service/get_portfolio_positions.py new file mode 100644 index 000000000..b1b7e1d3f --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/portfolio_service/get_portfolio_positions.py @@ -0,0 +1,198 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.list_positions_response import ListPositionsResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + all_: Unset | str = UNSET, + account_id: Unset | str = UNSET, + account_id_and_symbol_account_id: Unset | str = UNSET, + account_id_and_symbol_symbol: Unset | str = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["all"] = all_ + + params["accountId"] = account_id + + params["accountIdAndSymbol.accountId"] = account_id_and_symbol_account_id + + params["accountIdAndSymbol.symbol"] = account_id_and_symbol_symbol + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/portfolio/positions", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ListPositionsResponse | None: + if response.status_code == 200: + response_200 = ListPositionsResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ListPositionsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + all_: Unset | str = UNSET, + account_id: Unset | str = UNSET, + account_id_and_symbol_account_id: Unset | str = UNSET, + account_id_and_symbol_symbol: Unset | str = UNSET, +) -> Response[ListPositionsResponse]: + """ + Args: + all_ (Union[Unset, str]): + account_id (Union[Unset, str]): + account_id_and_symbol_account_id (Union[Unset, str]): + account_id_and_symbol_symbol (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListPositionsResponse] + """ + + kwargs = _get_kwargs( + all_=all_, + account_id=account_id, + account_id_and_symbol_account_id=account_id_and_symbol_account_id, + account_id_and_symbol_symbol=account_id_and_symbol_symbol, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + all_: Unset | str = UNSET, + account_id: Unset | str = UNSET, + account_id_and_symbol_account_id: Unset | str = UNSET, + account_id_and_symbol_symbol: Unset | str = UNSET, +) -> ListPositionsResponse | None: + """ + Args: + all_ (Union[Unset, str]): + account_id (Union[Unset, str]): + account_id_and_symbol_account_id (Union[Unset, str]): + account_id_and_symbol_symbol (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListPositionsResponse + """ + + return sync_detailed( + client=client, + all_=all_, + account_id=account_id, + account_id_and_symbol_account_id=account_id_and_symbol_account_id, + account_id_and_symbol_symbol=account_id_and_symbol_symbol, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + all_: Unset | str = UNSET, + account_id: Unset | str = UNSET, + account_id_and_symbol_account_id: Unset | str = UNSET, + account_id_and_symbol_symbol: Unset | str = UNSET, +) -> Response[ListPositionsResponse]: + """ + Args: + all_ (Union[Unset, str]): + account_id (Union[Unset, str]): + account_id_and_symbol_account_id (Union[Unset, str]): + account_id_and_symbol_symbol (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListPositionsResponse] + """ + + kwargs = _get_kwargs( + all_=all_, + account_id=account_id, + account_id_and_symbol_account_id=account_id_and_symbol_account_id, + account_id_and_symbol_symbol=account_id_and_symbol_symbol, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + all_: Unset | str = UNSET, + account_id: Unset | str = UNSET, + account_id_and_symbol_account_id: Unset | str = UNSET, + account_id_and_symbol_symbol: Unset | str = UNSET, +) -> ListPositionsResponse | None: + """ + Args: + all_ (Union[Unset, str]): + account_id (Union[Unset, str]): + account_id_and_symbol_account_id (Union[Unset, str]): + account_id_and_symbol_symbol (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListPositionsResponse + """ + + return ( + await asyncio_detailed( + client=client, + all_=all_, + account_id=account_id, + account_id_and_symbol_account_id=account_id_and_symbol_account_id, + account_id_and_symbol_symbol=account_id_and_symbol_symbol, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_analyzepositions.py b/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_analyzepositions.py new file mode 100644 index 000000000..20b1be3de --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_analyzepositions.py @@ -0,0 +1,154 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.analyze_positions_request import AnalyzePositionsRequest +from ...models.analyze_positions_response import AnalyzePositionsResponse +from ...types import Response + + +def _get_kwargs( + *, + body: AnalyzePositionsRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/portfolio/analyzepositions", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AnalyzePositionsResponse | None: + if response.status_code == 200: + response_200 = AnalyzePositionsResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AnalyzePositionsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: AnalyzePositionsRequest, +) -> Response[AnalyzePositionsResponse]: + """ + Args: + body (AnalyzePositionsRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AnalyzePositionsResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: AnalyzePositionsRequest, +) -> AnalyzePositionsResponse | None: + """ + Args: + body (AnalyzePositionsRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AnalyzePositionsResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: AnalyzePositionsRequest, +) -> Response[AnalyzePositionsResponse]: + """ + Args: + body (AnalyzePositionsRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AnalyzePositionsResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: AnalyzePositionsRequest, +) -> AnalyzePositionsResponse | None: + """ + Args: + body (AnalyzePositionsRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AnalyzePositionsResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_calculatemargins.py b/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_calculatemargins.py new file mode 100644 index 000000000..93b714d29 --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_calculatemargins.py @@ -0,0 +1,154 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.calculate_margin_request import CalculateMarginRequest +from ...models.calculate_margin_response import CalculateMarginResponse +from ...types import Response + + +def _get_kwargs( + *, + body: CalculateMarginRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/portfolio/calculatemargins", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CalculateMarginResponse | None: + if response.status_code == 200: + response_200 = CalculateMarginResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CalculateMarginResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CalculateMarginRequest, +) -> Response[CalculateMarginResponse]: + """ + Args: + body (CalculateMarginRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CalculateMarginResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CalculateMarginRequest, +) -> CalculateMarginResponse | None: + """ + Args: + body (CalculateMarginRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CalculateMarginResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CalculateMarginRequest, +) -> Response[CalculateMarginResponse]: + """ + Args: + body (CalculateMarginRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CalculateMarginResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CalculateMarginRequest, +) -> CalculateMarginResponse | None: + """ + Args: + body (CalculateMarginRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CalculateMarginResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_riskradar.py b/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_riskradar.py new file mode 100644 index 000000000..2d3976dc7 --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_riskradar.py @@ -0,0 +1,154 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.risk_radar_request import RiskRadarRequest +from ...models.risk_radar_response import RiskRadarResponse +from ...types import Response + + +def _get_kwargs( + *, + body: RiskRadarRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/portfolio/riskradar", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> RiskRadarResponse | None: + if response.status_code == 200: + response_200 = RiskRadarResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[RiskRadarResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: RiskRadarRequest, +) -> Response[RiskRadarResponse]: + """ + Args: + body (RiskRadarRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[RiskRadarResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: RiskRadarRequest, +) -> RiskRadarResponse | None: + """ + Args: + body (RiskRadarRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + RiskRadarResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: RiskRadarRequest, +) -> Response[RiskRadarResponse]: + """ + Args: + body (RiskRadarRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[RiskRadarResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: RiskRadarRequest, +) -> RiskRadarResponse | None: + """ + Args: + body (RiskRadarRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + RiskRadarResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/security_service/__init__.py b/openapi/openapi_project/openapi_package/api/security_service/__init__.py new file mode 100644 index 000000000..dcbab9a7a --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/security_service/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/openapi/openapi_project/openapi_package/api/security_service/get_securities_exchanges.py b/openapi/openapi_project/openapi_package/api/security_service/get_securities_exchanges.py new file mode 100644 index 000000000..4db2b1403 --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/security_service/get_securities_exchanges.py @@ -0,0 +1,121 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.list_exchanges_response import ListExchangesResponse +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/securities/exchanges", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ListExchangesResponse | None: + if response.status_code == 200: + response_200 = ListExchangesResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ListExchangesResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListExchangesResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListExchangesResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> ListExchangesResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListExchangesResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListExchangesResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListExchangesResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> ListExchangesResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListExchangesResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/security_service/post_securities_easytoborrowsecurities.py b/openapi/openapi_project/openapi_package/api/security_service/post_securities_easytoborrowsecurities.py new file mode 100644 index 000000000..5768e69c7 --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/security_service/post_securities_easytoborrowsecurities.py @@ -0,0 +1,158 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.list_easy_to_borrow_securities_request import ( + ListEasyToBorrowSecuritiesRequest, +) +from ...models.list_easy_to_borrow_securities_response import ( + ListEasyToBorrowSecuritiesResponse, +) +from ...types import Response + + +def _get_kwargs( + *, + body: ListEasyToBorrowSecuritiesRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/securities/easytoborrowsecurities", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ListEasyToBorrowSecuritiesResponse | None: + if response.status_code == 200: + response_200 = ListEasyToBorrowSecuritiesResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ListEasyToBorrowSecuritiesResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: ListEasyToBorrowSecuritiesRequest, +) -> Response[ListEasyToBorrowSecuritiesResponse]: + """ + Args: + body (ListEasyToBorrowSecuritiesRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListEasyToBorrowSecuritiesResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: ListEasyToBorrowSecuritiesRequest, +) -> ListEasyToBorrowSecuritiesResponse | None: + """ + Args: + body (ListEasyToBorrowSecuritiesRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListEasyToBorrowSecuritiesResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: ListEasyToBorrowSecuritiesRequest, +) -> Response[ListEasyToBorrowSecuritiesResponse]: + """ + Args: + body (ListEasyToBorrowSecuritiesRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListEasyToBorrowSecuritiesResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: ListEasyToBorrowSecuritiesRequest, +) -> ListEasyToBorrowSecuritiesResponse | None: + """ + Args: + body (ListEasyToBorrowSecuritiesRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListEasyToBorrowSecuritiesResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/security_service/post_securities_flexoption.py b/openapi/openapi_project/openapi_package/api/security_service/post_securities_flexoption.py new file mode 100644 index 000000000..0f6ef5c9e --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/security_service/post_securities_flexoption.py @@ -0,0 +1,154 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.create_flex_option_request import CreateFlexOptionRequest +from ...models.create_flex_option_response import CreateFlexOptionResponse +from ...types import Response + + +def _get_kwargs( + *, + body: CreateFlexOptionRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/securities/flexoption", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateFlexOptionResponse | None: + if response.status_code == 200: + response_200 = CreateFlexOptionResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateFlexOptionResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateFlexOptionRequest, +) -> Response[CreateFlexOptionResponse]: + """ + Args: + body (CreateFlexOptionRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateFlexOptionResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CreateFlexOptionRequest, +) -> CreateFlexOptionResponse | None: + """ + Args: + body (CreateFlexOptionRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateFlexOptionResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateFlexOptionRequest, +) -> Response[CreateFlexOptionResponse]: + """ + Args: + body (CreateFlexOptionRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateFlexOptionResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CreateFlexOptionRequest, +) -> CreateFlexOptionResponse | None: + """ + Args: + body (CreateFlexOptionRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateFlexOptionResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/security_service/post_securities_optionchains.py b/openapi/openapi_project/openapi_package/api/security_service/post_securities_optionchains.py new file mode 100644 index 000000000..594be48fc --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/security_service/post_securities_optionchains.py @@ -0,0 +1,154 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.list_option_chains_repsonse import ListOptionChainsRepsonse +from ...models.list_option_chains_request import ListOptionChainsRequest +from ...types import Response + + +def _get_kwargs( + *, + body: ListOptionChainsRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/securities/optionchains", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ListOptionChainsRepsonse | None: + if response.status_code == 200: + response_200 = ListOptionChainsRepsonse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ListOptionChainsRepsonse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: ListOptionChainsRequest, +) -> Response[ListOptionChainsRepsonse]: + """ + Args: + body (ListOptionChainsRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListOptionChainsRepsonse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: ListOptionChainsRequest, +) -> ListOptionChainsRepsonse | None: + """ + Args: + body (ListOptionChainsRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListOptionChainsRepsonse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: ListOptionChainsRequest, +) -> Response[ListOptionChainsRepsonse]: + """ + Args: + body (ListOptionChainsRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListOptionChainsRepsonse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: ListOptionChainsRequest, +) -> ListOptionChainsRepsonse | None: + """ + Args: + body (ListOptionChainsRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListOptionChainsRepsonse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/security_service/post_securities_securities.py b/openapi/openapi_project/openapi_package/api/security_service/post_securities_securities.py new file mode 100644 index 000000000..0274f693c --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/security_service/post_securities_securities.py @@ -0,0 +1,154 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.list_securities_request import ListSecuritiesRequest +from ...models.list_securities_response import ListSecuritiesResponse +from ...types import Response + + +def _get_kwargs( + *, + body: ListSecuritiesRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/securities/securities", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ListSecuritiesResponse | None: + if response.status_code == 200: + response_200 = ListSecuritiesResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ListSecuritiesResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: ListSecuritiesRequest, +) -> Response[ListSecuritiesResponse]: + """ + Args: + body (ListSecuritiesRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListSecuritiesResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: ListSecuritiesRequest, +) -> ListSecuritiesResponse | None: + """ + Args: + body (ListSecuritiesRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListSecuritiesResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: ListSecuritiesRequest, +) -> Response[ListSecuritiesResponse]: + """ + Args: + body (ListSecuritiesRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListSecuritiesResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: ListSecuritiesRequest, +) -> ListSecuritiesResponse | None: + """ + Args: + body (ListSecuritiesRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListSecuritiesResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/user_data_service/__init__.py b/openapi/openapi_project/openapi_package/api/user_data_service/__init__.py new file mode 100644 index 000000000..dcbab9a7a --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/user_data_service/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_accounts.py b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_accounts.py new file mode 100644 index 000000000..d98626366 --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_accounts.py @@ -0,0 +1,121 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.list_accounts_response import ListAccountsResponse +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/userdata/accounts", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ListAccountsResponse | None: + if response.status_code == 200: + response_200 = ListAccountsResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ListAccountsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListAccountsResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListAccountsResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> ListAccountsResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListAccountsResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListAccountsResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListAccountsResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> ListAccountsResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListAccountsResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_activeuser.py b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_activeuser.py new file mode 100644 index 000000000..449bc4d65 --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_activeuser.py @@ -0,0 +1,121 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_active_user_response import GetActiveUserResponse +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/userdata/activeuser", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> GetActiveUserResponse | None: + if response.status_code == 200: + response_200 = GetActiveUserResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[GetActiveUserResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[GetActiveUserResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetActiveUserResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> GetActiveUserResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetActiveUserResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[GetActiveUserResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetActiveUserResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> GetActiveUserResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetActiveUserResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_affiliatedtradingfirms.py b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_affiliatedtradingfirms.py new file mode 100644 index 000000000..710a91d00 --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_affiliatedtradingfirms.py @@ -0,0 +1,123 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.list_affiliated_trading_firms_response import ( + ListAffiliatedTradingFirmsResponse, +) +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/userdata/affiliatedtradingfirms", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ListAffiliatedTradingFirmsResponse | None: + if response.status_code == 200: + response_200 = ListAffiliatedTradingFirmsResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ListAffiliatedTradingFirmsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListAffiliatedTradingFirmsResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListAffiliatedTradingFirmsResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> ListAffiliatedTradingFirmsResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListAffiliatedTradingFirmsResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListAffiliatedTradingFirmsResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListAffiliatedTradingFirmsResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> ListAffiliatedTradingFirmsResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListAffiliatedTradingFirmsResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_p2paccounts.py b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_p2paccounts.py new file mode 100644 index 000000000..7a4c9e428 --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_p2paccounts.py @@ -0,0 +1,121 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.list_accounts_response import ListAccountsResponse +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/userdata/p2paccounts", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ListAccountsResponse | None: + if response.status_code == 200: + response_200 = ListAccountsResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ListAccountsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListAccountsResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListAccountsResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> ListAccountsResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListAccountsResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListAccountsResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListAccountsResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> ListAccountsResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListAccountsResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_routes.py b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_routes.py new file mode 100644 index 000000000..55797199c --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_routes.py @@ -0,0 +1,121 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.list_routes_response import ListRoutesResponse +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/userdata/routes", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ListRoutesResponse | None: + if response.status_code == 200: + response_200 = ListRoutesResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ListRoutesResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListRoutesResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListRoutesResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> ListRoutesResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListRoutesResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListRoutesResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListRoutesResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> ListRoutesResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListRoutesResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_tradingfirms.py b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_tradingfirms.py new file mode 100644 index 000000000..887aa13a8 --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_tradingfirms.py @@ -0,0 +1,121 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.list_trading_firms_response import ListTradingFirmsResponse +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/userdata/tradingfirms", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ListTradingFirmsResponse | None: + if response.status_code == 200: + response_200 = ListTradingFirmsResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ListTradingFirmsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListTradingFirmsResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListTradingFirmsResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> ListTradingFirmsResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListTradingFirmsResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListTradingFirmsResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListTradingFirmsResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> ListTradingFirmsResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListTradingFirmsResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/utility_service/__init__.py b/openapi/openapi_project/openapi_package/api/utility_service/__init__.py new file mode 100644 index 000000000..dcbab9a7a --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/utility_service/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/openapi/openapi_project/openapi_package/api/utility_service/get_utility_serverinfo.py b/openapi/openapi_project/openapi_package/api/utility_service/get_utility_serverinfo.py new file mode 100644 index 000000000..83bf38609 --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/utility_service/get_utility_serverinfo.py @@ -0,0 +1,121 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_server_info_response import GetServerInfoResponse +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/utility/serverinfo", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> GetServerInfoResponse | None: + if response.status_code == 200: + response_200 = GetServerInfoResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[GetServerInfoResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[GetServerInfoResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetServerInfoResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> GetServerInfoResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetServerInfoResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[GetServerInfoResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetServerInfoResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> GetServerInfoResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetServerInfoResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/utility_service/get_utility_servertime.py b/openapi/openapi_project/openapi_package/api/utility_service/get_utility_servertime.py new file mode 100644 index 000000000..45acefb97 --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/utility_service/get_utility_servertime.py @@ -0,0 +1,121 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_server_time_response import GetServerTimeResponse +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/utility/servertime", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> GetServerTimeResponse | None: + if response.status_code == 200: + response_200 = GetServerTimeResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[GetServerTimeResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[GetServerTimeResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetServerTimeResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> GetServerTimeResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetServerTimeResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[GetServerTimeResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetServerTimeResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> GetServerTimeResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetServerTimeResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/api/utility_service/get_utility_tradingholidays.py b/openapi/openapi_project/openapi_package/api/utility_service/get_utility_tradingholidays.py new file mode 100644 index 000000000..a2ad9d3f8 --- /dev/null +++ b/openapi/openapi_project/openapi_package/api/utility_service/get_utility_tradingholidays.py @@ -0,0 +1,121 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_trading_holidays_response import GetTradingHolidaysResponse +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/utility/tradingholidays", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> GetTradingHolidaysResponse | None: + if response.status_code == 200: + response_200 = GetTradingHolidaysResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[GetTradingHolidaysResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[GetTradingHolidaysResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetTradingHolidaysResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> GetTradingHolidaysResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetTradingHolidaysResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[GetTradingHolidaysResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetTradingHolidaysResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> GetTradingHolidaysResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetTradingHolidaysResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/openapi/openapi_project/openapi_package/client.py b/openapi/openapi_project/openapi_package/client.py new file mode 100644 index 000000000..55aa3eb2c --- /dev/null +++ b/openapi/openapi_project/openapi_package/client.py @@ -0,0 +1,282 @@ +import ssl +from typing import Any + +import httpx +from attrs import define, evolve, field + + +@define +class Client: + """A class for keeping track of data related to the API + + The following are accepted as keyword arguments and will be used to construct httpx Clients internally: + + ``base_url``: The base URL for the API, all requests are made to a relative path to this URL + + ``cookies``: A dictionary of cookies to be sent with every request + + ``headers``: A dictionary of headers to be sent with every request + + ``timeout``: The maximum amount of a time a request can take. API functions will raise + httpx.TimeoutException if this is exceeded. + + ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, + but can be set to False for testing purposes. + + ``follow_redirects``: Whether or not to follow redirects. Default value is False. + + ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. + + + Attributes: + raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a + status code that was not documented in the source OpenAPI document. Can also be provided as a keyword + argument to the constructor. + """ + + raise_on_unexpected_status: bool = field(default=False, kw_only=True) + _base_url: str = field(alias="base_url") + _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") + _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") + _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: str | bool | ssl.SSLContext = field( + default=True, kw_only=True, alias="verify_ssl" + ) + _follow_redirects: bool = field( + default=False, kw_only=True, alias="follow_redirects" + ) + _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") + _client: httpx.Client | None = field(default=None, init=False) + _async_client: httpx.AsyncClient | None = field(default=None, init=False) + + def with_headers(self, headers: dict[str, str]) -> "Client": + """Get a new client matching this one with additional headers""" + if self._client is not None: + self._client.headers.update(headers) + if self._async_client is not None: + self._async_client.headers.update(headers) + return evolve(self, headers={**self._headers, **headers}) + + def with_cookies(self, cookies: dict[str, str]) -> "Client": + """Get a new client matching this one with additional cookies""" + if self._client is not None: + self._client.cookies.update(cookies) + if self._async_client is not None: + self._async_client.cookies.update(cookies) + return evolve(self, cookies={**self._cookies, **cookies}) + + def with_timeout(self, timeout: httpx.Timeout) -> "Client": + """Get a new client matching this one with a new timeout (in seconds)""" + if self._client is not None: + self._client.timeout = timeout + if self._async_client is not None: + self._async_client.timeout = timeout + return evolve(self, timeout=timeout) + + def set_httpx_client(self, client: httpx.Client) -> "Client": + """Manually set the underlying httpx.Client + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._client = client + return self + + def get_httpx_client(self) -> httpx.Client: + """Get the underlying httpx.Client, constructing a new one if not previously set""" + if self._client is None: + self._client = httpx.Client( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._client + + def __enter__(self) -> "Client": + """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" + self.get_httpx_client().__enter__() + return self + + def __exit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for internal httpx.Client (see httpx docs)""" + self.get_httpx_client().__exit__(*args, **kwargs) + + def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client": + """Manually the underlying httpx.AsyncClient + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._async_client = async_client + return self + + def get_async_httpx_client(self) -> httpx.AsyncClient: + """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" + if self._async_client is None: + self._async_client = httpx.AsyncClient( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._async_client + + async def __aenter__(self) -> "Client": + """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" + await self.get_async_httpx_client().__aenter__() + return self + + async def __aexit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" + await self.get_async_httpx_client().__aexit__(*args, **kwargs) + + +@define +class AuthenticatedClient: + """A Client which has been authenticated for use on secured endpoints + + The following are accepted as keyword arguments and will be used to construct httpx Clients internally: + + ``base_url``: The base URL for the API, all requests are made to a relative path to this URL + + ``cookies``: A dictionary of cookies to be sent with every request + + ``headers``: A dictionary of headers to be sent with every request + + ``timeout``: The maximum amount of a time a request can take. API functions will raise + httpx.TimeoutException if this is exceeded. + + ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, + but can be set to False for testing purposes. + + ``follow_redirects``: Whether or not to follow redirects. Default value is False. + + ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. + + + Attributes: + raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a + status code that was not documented in the source OpenAPI document. Can also be provided as a keyword + argument to the constructor. + token: The token to use for authentication + prefix: The prefix to use for the Authorization header + auth_header_name: The name of the Authorization header + """ + + raise_on_unexpected_status: bool = field(default=False, kw_only=True) + _base_url: str = field(alias="base_url") + _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") + _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") + _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: str | bool | ssl.SSLContext = field( + default=True, kw_only=True, alias="verify_ssl" + ) + _follow_redirects: bool = field( + default=False, kw_only=True, alias="follow_redirects" + ) + _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") + _client: httpx.Client | None = field(default=None, init=False) + _async_client: httpx.AsyncClient | None = field(default=None, init=False) + + token: str + prefix: str = "Bearer" + auth_header_name: str = "Authorization" + + def with_headers(self, headers: dict[str, str]) -> "AuthenticatedClient": + """Get a new client matching this one with additional headers""" + if self._client is not None: + self._client.headers.update(headers) + if self._async_client is not None: + self._async_client.headers.update(headers) + return evolve(self, headers={**self._headers, **headers}) + + def with_cookies(self, cookies: dict[str, str]) -> "AuthenticatedClient": + """Get a new client matching this one with additional cookies""" + if self._client is not None: + self._client.cookies.update(cookies) + if self._async_client is not None: + self._async_client.cookies.update(cookies) + return evolve(self, cookies={**self._cookies, **cookies}) + + def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient": + """Get a new client matching this one with a new timeout (in seconds)""" + if self._client is not None: + self._client.timeout = timeout + if self._async_client is not None: + self._async_client.timeout = timeout + return evolve(self, timeout=timeout) + + def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient": + """Manually set the underlying httpx.Client + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._client = client + return self + + def get_httpx_client(self) -> httpx.Client: + """Get the underlying httpx.Client, constructing a new one if not previously set""" + if self._client is None: + self._headers[self.auth_header_name] = ( + f"{self.prefix} {self.token}" if self.prefix else self.token + ) + self._client = httpx.Client( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._client + + def __enter__(self) -> "AuthenticatedClient": + """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" + self.get_httpx_client().__enter__() + return self + + def __exit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for internal httpx.Client (see httpx docs)""" + self.get_httpx_client().__exit__(*args, **kwargs) + + def set_async_httpx_client( + self, async_client: httpx.AsyncClient + ) -> "AuthenticatedClient": + """Manually the underlying httpx.AsyncClient + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._async_client = async_client + return self + + def get_async_httpx_client(self) -> httpx.AsyncClient: + """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" + if self._async_client is None: + self._headers[self.auth_header_name] = ( + f"{self.prefix} {self.token}" if self.prefix else self.token + ) + self._async_client = httpx.AsyncClient( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._async_client + + async def __aenter__(self) -> "AuthenticatedClient": + """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" + await self.get_async_httpx_client().__aenter__() + return self + + async def __aexit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" + await self.get_async_httpx_client().__aexit__(*args, **kwargs) diff --git a/openapi/openapi_project/openapi_package/errors.py b/openapi/openapi_project/openapi_package/errors.py new file mode 100644 index 000000000..9bf275435 --- /dev/null +++ b/openapi/openapi_project/openapi_package/errors.py @@ -0,0 +1,16 @@ +"""Contains shared errors types that can be raised from API functions""" + + +class UnexpectedStatus(Exception): + """Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True""" + + def __init__(self, status_code: int, content: bytes): + self.status_code = status_code + self.content = content + + super().__init__( + f"Unexpected status code: {status_code}\n\nResponse content:\n{content.decode(errors='ignore')}" + ) + + +__all__ = ["UnexpectedStatus"] diff --git a/openapi/openapi_project/openapi_package/models/__init__.py b/openapi/openapi_project/openapi_package/models/__init__.py new file mode 100644 index 000000000..fb15fd046 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/__init__.py @@ -0,0 +1,547 @@ +"""Contains all the data models used in inputs/outputs""" + +from .account import Account +from .account_script import AccountScript +from .account_status import AccountStatus +from .account_type import AccountType +from .analyze_position_item import AnalyzePositionItem +from .analyze_positions_request import AnalyzePositionsRequest +from .analyze_positions_response import AnalyzePositionsResponse +from .any_model import AnyModel +from .calculate_margin_request import CalculateMarginRequest +from .calculate_margin_request_position import CalculateMarginRequestPosition +from .calculate_margin_request_position_list import CalculateMarginRequestPositionList +from .calculate_margin_response import CalculateMarginResponse +from .cancel_order_request import CancelOrderRequest +from .cancel_order_request_optional_data import CancelOrderRequestOptionalData +from .cancel_order_response import CancelOrderResponse +from .cancel_replace_multi_leg_order_request import CancelReplaceMultiLegOrderRequest +from .cancel_replace_multi_leg_order_request_algo import ( + CancelReplaceMultiLegOrderRequestAlgo, +) +from .cancel_replace_multi_leg_order_request_market_condition import ( + CancelReplaceMultiLegOrderRequestMarketCondition, +) +from .cancel_replace_multi_leg_order_request_optional_data import ( + CancelReplaceMultiLegOrderRequestOptionalData, +) +from .cancel_replace_multi_leg_order_response import CancelReplaceMultiLegOrderResponse +from .cancel_replace_order_request import CancelReplaceOrderRequest +from .cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo +from .cancel_replace_order_request_market_condition import ( + CancelReplaceOrderRequestMarketCondition, +) +from .cancel_replace_order_request_optional_data import ( + CancelReplaceOrderRequestOptionalData, +) +from .cancel_replace_order_response import CancelReplaceOrderResponse +from .capacity_code import CapacityCode +from .claim_type import ClaimType +from .clearing_info import ClearingInfo +from .clearing_range import ClearingRange +from .country import Country +from .create_flex_option_request import CreateFlexOptionRequest +from .create_flex_option_response import CreateFlexOptionResponse +from .create_multi_leg_order_cross_allocation import CreateMultiLegOrderCrossAllocation +from .create_multi_leg_order_cross_allocation_optional_data import ( + CreateMultiLegOrderCrossAllocationOptionalData, +) +from .create_multi_leg_order_cross_request import CreateMultiLegOrderCrossRequest +from .create_multi_leg_order_cross_request_algo import ( + CreateMultiLegOrderCrossRequestAlgo, +) +from .create_multi_leg_order_cross_request_market_condition import ( + CreateMultiLegOrderCrossRequestMarketCondition, +) +from .create_multi_leg_order_cross_request_optional_data import ( + CreateMultiLegOrderCrossRequestOptionalData, +) +from .create_multi_leg_order_cross_response import CreateMultiLegOrderCrossResponse +from .create_multi_leg_order_leg import CreateMultiLegOrderLeg +from .create_multi_leg_order_leg_market_condition import ( + CreateMultiLegOrderLegMarketCondition, +) +from .create_multi_leg_order_leg_optional_data import CreateMultiLegOrderLegOptionalData +from .create_multi_leg_order_request import CreateMultiLegOrderRequest +from .create_multi_leg_order_request_algo import CreateMultiLegOrderRequestAlgo +from .create_multi_leg_order_request_market_condition import ( + CreateMultiLegOrderRequestMarketCondition, +) +from .create_multi_leg_order_request_optional_data import ( + CreateMultiLegOrderRequestOptionalData, +) +from .create_multi_leg_order_response import CreateMultiLegOrderResponse +from .create_order_cross_allocation import CreateOrderCrossAllocation +from .create_order_cross_allocation_optional_data import ( + CreateOrderCrossAllocationOptionalData, +) +from .create_order_cross_request import CreateOrderCrossRequest +from .create_order_cross_request_algo import CreateOrderCrossRequestAlgo +from .create_order_cross_request_market_condition import ( + CreateOrderCrossRequestMarketCondition, +) +from .create_order_cross_request_optional_data import ( + CreateOrderCrossRequestOptionalData, +) +from .create_order_cross_response import CreateOrderCrossResponse +from .create_order_request import CreateOrderRequest +from .create_order_request_algo import CreateOrderRequestAlgo +from .create_order_request_market_condition import CreateOrderRequestMarketCondition +from .create_order_request_optional_data import CreateOrderRequestOptionalData +from .create_order_response import CreateOrderResponse +from .cross_side_type import CrossSideType +from .cross_type import CrossType +from .crypto import Crypto +from .crypto_aliases import CryptoAliases +from .currency import Currency +from .cxl_rej_response_to import CxlRejResponseTo +from .date import Date +from .easy_to_borrow_security import EasyToBorrowSecurity +from .empty import Empty +from .exchange import Exchange +from .exchange_code import ExchangeCode +from .exec_type import ExecType +from .execution import Execution +from .execution_algo import ExecutionAlgo +from .execution_optional_data import ExecutionOptionalData +from .flex_option import FlexOption +from .flex_option_aliases import FlexOptionAliases +from .flex_settlement_type import FlexSettlementType +from .future import Future +from .future_aliases import FutureAliases +from .future_root import FutureRoot +from .future_root_aliases import FutureRootAliases +from .future_spread import FutureSpread +from .future_spread_aliases import FutureSpreadAliases +from .future_spread_leg import FutureSpreadLeg +from .fx import Fx +from .fx_aliases import FxAliases +from .generic_order import GenericOrder +from .get_active_user_response import GetActiveUserResponse +from .get_server_info_response import GetServerInfoResponse +from .get_server_info_response_system_settings import ( + GetServerInfoResponseSystemSettings, +) +from .get_server_time_response import GetServerTimeResponse +from .get_trading_holidays_response import GetTradingHolidaysResponse +from .header import Header +from .index import Index +from .index_aliases import IndexAliases +from .list_accounts_response import ListAccountsResponse +from .list_affiliated_trading_firms_response import ListAffiliatedTradingFirmsResponse +from .list_easy_to_borrow_securities_request import ListEasyToBorrowSecuritiesRequest +from .list_easy_to_borrow_securities_response import ListEasyToBorrowSecuritiesResponse +from .list_exchanges_response import ListExchangesResponse +from .list_option_chains_repsonse import ListOptionChainsRepsonse +from .list_option_chains_request import ListOptionChainsRequest +from .list_orders_response import ListOrdersResponse +from .list_positions_response import ListPositionsResponse +from .list_routes_response import ListRoutesResponse +from .list_securities_request import ListSecuritiesRequest +from .list_securities_response import ListSecuritiesResponse +from .list_trade_confirms_response import ListTradeConfirmsResponse +from .list_trading_firms_response import ListTradingFirmsResponse +from .login_request import LoginRequest +from .login_response import LoginResponse +from .login_response_system_settings import LoginResponseSystemSettings +from .login_status import LoginStatus +from .margin_data import MarginData +from .margin_data_type import MarginDataType +from .multi_leg_order import MultiLegOrder +from .multi_leg_order_algo import MultiLegOrderAlgo +from .multi_leg_order_cancel_replace_request import MultiLegOrderCancelReplaceRequest +from .multi_leg_order_cancel_replace_request_algo import ( + MultiLegOrderCancelReplaceRequestAlgo, +) +from .multi_leg_order_cancel_replace_request_market_condition import ( + MultiLegOrderCancelReplaceRequestMarketCondition, +) +from .multi_leg_order_cancel_replace_request_optional_data import ( + MultiLegOrderCancelReplaceRequestOptionalData, +) +from .multi_leg_order_cross import MultiLegOrderCross +from .multi_leg_order_cross_algo import MultiLegOrderCrossAlgo +from .multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation +from .multi_leg_order_cross_allocation_optional_data import ( + MultiLegOrderCrossAllocationOptionalData, +) +from .multi_leg_order_cross_market_condition import MultiLegOrderCrossMarketCondition +from .multi_leg_order_cross_optional_data import MultiLegOrderCrossOptionalData +from .multi_leg_order_leg import MultiLegOrderLeg +from .multi_leg_order_leg_market_condition import MultiLegOrderLegMarketCondition +from .multi_leg_order_leg_optional_data import MultiLegOrderLegOptionalData +from .multi_leg_order_market_condition import MultiLegOrderMarketCondition +from .multi_leg_order_optional_data import MultiLegOrderOptionalData +from .multi_leg_reporting_type import MultiLegReportingType +from .numeric_display_format import NumericDisplayFormat +from .option import Option +from .option_aliases import OptionAliases +from .option_chain import OptionChain +from .option_chain_option import OptionChainOption +from .option_chain_option_aliases import OptionChainOptionAliases +from .option_chain_options import OptionChainOptions +from .option_chain_roots import OptionChainRoots +from .option_exercise_style import OptionExerciseStyle +from .option_expiration_style import OptionExpirationStyle +from .option_root import OptionRoot +from .option_root_aliases import OptionRootAliases +from .option_series import OptionSeries +from .option_series_product_type import OptionSeriesProductType +from .option_series_type import OptionSeriesType +from .option_settlement_type import OptionSettlementType +from .ord_status import OrdStatus +from .ord_type import OrdType +from .order import Order +from .order_algo import OrderAlgo +from .order_cancel_reject import OrderCancelReject +from .order_cancel_reject_optional_data import OrderCancelRejectOptionalData +from .order_cancel_replace_request import OrderCancelReplaceRequest +from .order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo +from .order_cancel_replace_request_market_condition import ( + OrderCancelReplaceRequestMarketCondition, +) +from .order_cancel_replace_request_optional_data import ( + OrderCancelReplaceRequestOptionalData, +) +from .order_cancel_request import OrderCancelRequest +from .order_cancel_request_optional_data import OrderCancelRequestOptionalData +from .order_cross import OrderCross +from .order_cross_algo import OrderCrossAlgo +from .order_cross_allocation import OrderCrossAllocation +from .order_cross_allocation_optional_data import OrderCrossAllocationOptionalData +from .order_cross_market_condition import OrderCrossMarketCondition +from .order_cross_optional_data import OrderCrossOptionalData +from .order_delete import OrderDelete +from .order_delete_optional_data import OrderDeleteOptionalData +from .order_instruction import OrderInstruction +from .order_instruction_type import OrderInstructionType +from .order_market_condition import OrderMarketCondition +from .order_optional_data import OrderOptionalData +from .order_type import OrderType +from .order_update import OrderUpdate +from .order_update_algo import OrderUpdateAlgo +from .order_update_event import OrderUpdateEvent +from .order_update_optional_data import OrderUpdateOptionalData +from .origination_type import OriginationType +from .position import Position +from .position_analysis import PositionAnalysis +from .position_effect import PositionEffect +from .position_source import PositionSource +from .position_theo import PositionTheo +from .position_theo_leg import PositionTheoLeg +from .price_type import PriceType +from .product_group import ProductGroup +from .product_sub_group import ProductSubGroup +from .put_call import PutCall +from .risk_calculation_type import RiskCalculationType +from .risk_eval_mode import RiskEvalMode +from .risk_radar_account_group import RiskRadarAccountGroup +from .risk_radar_class_group import RiskRadarClassGroup +from .risk_radar_data import RiskRadarData +from .risk_radar_position import RiskRadarPosition +from .risk_radar_product_group import RiskRadarProductGroup +from .risk_radar_request import RiskRadarRequest +from .risk_radar_request_position import RiskRadarRequestPosition +from .risk_radar_request_position_list import RiskRadarRequestPositionList +from .risk_radar_response import RiskRadarResponse +from .risk_radar_scenario_order import RiskRadarScenarioOrder +from .risk_reject import RiskReject +from .risk_reject_type import RiskRejectType +from .route import Route +from .route_applicability import RouteApplicability +from .route_property import RouteProperty +from .route_property_type import RoutePropertyType +from .route_type import RouteType +from .routing_session_group import RoutingSessionGroup +from .routing_session_group_type import RoutingSessionGroupType +from .scenario import Scenario +from .scenario_leg import ScenarioLeg +from .scenario_position import ScenarioPosition +from .scenario_theo import ScenarioTheo +from .search_order_history_response import SearchOrderHistoryResponse +from .security import Security +from .security_category import SecurityCategory +from .security_type import SecurityType +from .settlement_deliverable_type import SettlementDeliverableType +from .settlement_info import SettlementInfo +from .shock_value import ShockValue +from .shock_value_flags import ShockValueFlags +from .side import Side +from .spread_leg_side import SpreadLegSide +from .spread_leg_type import SpreadLegType +from .status import Status +from .status_code import StatusCode +from .stock import Stock +from .stock_aliases import StockAliases +from .tif import Tif +from .time_of_day import TimeOfDay +from .tims_class_group import TimsClassGroup +from .tims_margin_data import TimsMarginData +from .tims_position_group import TimsPositionGroup +from .tims_product_group import TimsProductGroup +from .trade_confirm import TradeConfirm +from .trading_firm import TradingFirm +from .trading_firm_slim import TradingFirmSlim +from .trading_holiday import TradingHoliday +from .trading_session import TradingSession +from .trading_session_group import TradingSessionGroup +from .user import User +from .user_location import UserLocation +from .user_permission import UserPermission +from .user_status import UserStatus +from .user_type import UserType +from .validate_risk_response import ValidateRiskResponse +from .volatility_shock_skew import VolatilityShockSkew +from .volatility_shock_type import VolatilityShockType + +__all__ = ( + "Account", + "AccountScript", + "AccountStatus", + "AccountType", + "AnalyzePositionItem", + "AnalyzePositionsRequest", + "AnalyzePositionsResponse", + "AnyModel", + "CalculateMarginRequest", + "CalculateMarginRequestPosition", + "CalculateMarginRequestPositionList", + "CalculateMarginResponse", + "CancelOrderRequest", + "CancelOrderRequestOptionalData", + "CancelOrderResponse", + "CancelReplaceMultiLegOrderRequest", + "CancelReplaceMultiLegOrderRequestAlgo", + "CancelReplaceMultiLegOrderRequestMarketCondition", + "CancelReplaceMultiLegOrderRequestOptionalData", + "CancelReplaceMultiLegOrderResponse", + "CancelReplaceOrderRequest", + "CancelReplaceOrderRequestAlgo", + "CancelReplaceOrderRequestMarketCondition", + "CancelReplaceOrderRequestOptionalData", + "CancelReplaceOrderResponse", + "CapacityCode", + "ClaimType", + "ClearingInfo", + "ClearingRange", + "Country", + "CreateFlexOptionRequest", + "CreateFlexOptionResponse", + "CreateMultiLegOrderCrossAllocation", + "CreateMultiLegOrderCrossAllocationOptionalData", + "CreateMultiLegOrderCrossRequest", + "CreateMultiLegOrderCrossRequestAlgo", + "CreateMultiLegOrderCrossRequestMarketCondition", + "CreateMultiLegOrderCrossRequestOptionalData", + "CreateMultiLegOrderCrossResponse", + "CreateMultiLegOrderLeg", + "CreateMultiLegOrderLegMarketCondition", + "CreateMultiLegOrderLegOptionalData", + "CreateMultiLegOrderRequest", + "CreateMultiLegOrderRequestAlgo", + "CreateMultiLegOrderRequestMarketCondition", + "CreateMultiLegOrderRequestOptionalData", + "CreateMultiLegOrderResponse", + "CreateOrderCrossAllocation", + "CreateOrderCrossAllocationOptionalData", + "CreateOrderCrossRequest", + "CreateOrderCrossRequestAlgo", + "CreateOrderCrossRequestMarketCondition", + "CreateOrderCrossRequestOptionalData", + "CreateOrderCrossResponse", + "CreateOrderRequest", + "CreateOrderRequestAlgo", + "CreateOrderRequestMarketCondition", + "CreateOrderRequestOptionalData", + "CreateOrderResponse", + "CrossSideType", + "CrossType", + "Crypto", + "CryptoAliases", + "Currency", + "CxlRejResponseTo", + "Date", + "EasyToBorrowSecurity", + "Empty", + "Exchange", + "ExchangeCode", + "ExecType", + "Execution", + "ExecutionAlgo", + "ExecutionOptionalData", + "FlexOption", + "FlexOptionAliases", + "FlexSettlementType", + "Future", + "FutureAliases", + "FutureRoot", + "FutureRootAliases", + "FutureSpread", + "FutureSpreadAliases", + "FutureSpreadLeg", + "Fx", + "FxAliases", + "GenericOrder", + "GetActiveUserResponse", + "GetServerInfoResponse", + "GetServerInfoResponseSystemSettings", + "GetServerTimeResponse", + "GetTradingHolidaysResponse", + "Header", + "Index", + "IndexAliases", + "ListAccountsResponse", + "ListAffiliatedTradingFirmsResponse", + "ListEasyToBorrowSecuritiesRequest", + "ListEasyToBorrowSecuritiesResponse", + "ListExchangesResponse", + "ListOptionChainsRepsonse", + "ListOptionChainsRequest", + "ListOrdersResponse", + "ListPositionsResponse", + "ListRoutesResponse", + "ListSecuritiesRequest", + "ListSecuritiesResponse", + "ListTradeConfirmsResponse", + "ListTradingFirmsResponse", + "LoginRequest", + "LoginResponse", + "LoginResponseSystemSettings", + "LoginStatus", + "MarginData", + "MarginDataType", + "MultiLegOrder", + "MultiLegOrderAlgo", + "MultiLegOrderCancelReplaceRequest", + "MultiLegOrderCancelReplaceRequestAlgo", + "MultiLegOrderCancelReplaceRequestMarketCondition", + "MultiLegOrderCancelReplaceRequestOptionalData", + "MultiLegOrderCross", + "MultiLegOrderCrossAlgo", + "MultiLegOrderCrossAllocation", + "MultiLegOrderCrossAllocationOptionalData", + "MultiLegOrderCrossMarketCondition", + "MultiLegOrderCrossOptionalData", + "MultiLegOrderLeg", + "MultiLegOrderLegMarketCondition", + "MultiLegOrderLegOptionalData", + "MultiLegOrderMarketCondition", + "MultiLegOrderOptionalData", + "MultiLegReportingType", + "NumericDisplayFormat", + "Option", + "OptionAliases", + "OptionChain", + "OptionChainOption", + "OptionChainOptionAliases", + "OptionChainOptions", + "OptionChainRoots", + "OptionExerciseStyle", + "OptionExpirationStyle", + "OptionRoot", + "OptionRootAliases", + "OptionSeries", + "OptionSeriesProductType", + "OptionSeriesType", + "OptionSettlementType", + "Order", + "OrderAlgo", + "OrderCancelReject", + "OrderCancelRejectOptionalData", + "OrderCancelReplaceRequest", + "OrderCancelReplaceRequestAlgo", + "OrderCancelReplaceRequestMarketCondition", + "OrderCancelReplaceRequestOptionalData", + "OrderCancelRequest", + "OrderCancelRequestOptionalData", + "OrderCross", + "OrderCrossAlgo", + "OrderCrossAllocation", + "OrderCrossAllocationOptionalData", + "OrderCrossMarketCondition", + "OrderCrossOptionalData", + "OrderDelete", + "OrderDeleteOptionalData", + "OrderInstruction", + "OrderInstructionType", + "OrderMarketCondition", + "OrderOptionalData", + "OrderType", + "OrderUpdate", + "OrderUpdateAlgo", + "OrderUpdateEvent", + "OrderUpdateOptionalData", + "OrdStatus", + "OrdType", + "OriginationType", + "Position", + "PositionAnalysis", + "PositionEffect", + "PositionSource", + "PositionTheo", + "PositionTheoLeg", + "PriceType", + "ProductGroup", + "ProductSubGroup", + "PutCall", + "RiskCalculationType", + "RiskEvalMode", + "RiskRadarAccountGroup", + "RiskRadarClassGroup", + "RiskRadarData", + "RiskRadarPosition", + "RiskRadarProductGroup", + "RiskRadarRequest", + "RiskRadarRequestPosition", + "RiskRadarRequestPositionList", + "RiskRadarResponse", + "RiskRadarScenarioOrder", + "RiskReject", + "RiskRejectType", + "Route", + "RouteApplicability", + "RouteProperty", + "RoutePropertyType", + "RouteType", + "RoutingSessionGroup", + "RoutingSessionGroupType", + "Scenario", + "ScenarioLeg", + "ScenarioPosition", + "ScenarioTheo", + "SearchOrderHistoryResponse", + "Security", + "SecurityCategory", + "SecurityType", + "SettlementDeliverableType", + "SettlementInfo", + "ShockValue", + "ShockValueFlags", + "Side", + "SpreadLegSide", + "SpreadLegType", + "Status", + "StatusCode", + "Stock", + "StockAliases", + "Tif", + "TimeOfDay", + "TimsClassGroup", + "TimsMarginData", + "TimsPositionGroup", + "TimsProductGroup", + "TradeConfirm", + "TradingFirm", + "TradingFirmSlim", + "TradingHoliday", + "TradingSession", + "TradingSessionGroup", + "User", + "UserLocation", + "UserPermission", + "UserStatus", + "UserType", + "ValidateRiskResponse", + "VolatilityShockSkew", + "VolatilityShockType", +) diff --git a/openapi/openapi_project/openapi_package/models/account.py b/openapi/openapi_project/openapi_package/models/account.py new file mode 100644 index 000000000..10279ba80 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/account.py @@ -0,0 +1,371 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.account_status import AccountStatus +from ..models.account_type import AccountType +from ..models.capacity_code import CapacityCode +from ..models.clearing_range import ClearingRange +from ..models.currency import Currency +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.account_script import AccountScript + from ..models.routing_session_group import RoutingSessionGroup + + +T = TypeVar("T", bound="Account") + + +@_attrs_define +class Account: + """ + Attributes: + id (Union[Unset, int]): + billing_code (Union[Unset, str]): + cti_code (Union[Unset, str]): + currency (Union[Unset, Currency]): + equities_capacity (Union[Unset, CapacityCode]): + equities_give_up (Union[Unset, str]): + equities_mpid (Union[Unset, str]): + futures_clearing_account (Union[Unset, str]): + futures_clearing_range (Union[Unset, ClearingRange]): + futures_cmta (Union[Unset, str]): + futures_execution_broker (Union[Unset, str]): + name (Union[Unset, str]): + occ_actionable_id (Union[Unset, str]): + options_clearing_account (Union[Unset, str]): + options_clearing_range (Union[Unset, ClearingRange]): + options_cmta (Union[Unset, str]): + options_efid (Union[Unset, str]): + options_give_up (Union[Unset, str]): + routing_session_groups (Union[Unset, list['RoutingSessionGroup']]): + status (Union[Unset, AccountStatus]): + tag1 (Union[Unset, str]): + trading_firm_id (Union[Unset, int]): + type_ (Union[Unset, AccountType]): + created_ts (Union[Unset, str]): + optional_data (Union[Unset, str]): + position_script (Union[Unset, AccountScript]): + buying_power_script (Union[Unset, AccountScript]): + clearing_script (Union[Unset, AccountScript]): + """ + + id: Unset | int = UNSET + billing_code: Unset | str = UNSET + cti_code: Unset | str = UNSET + currency: Unset | Currency = UNSET + equities_capacity: Unset | CapacityCode = UNSET + equities_give_up: Unset | str = UNSET + equities_mpid: Unset | str = UNSET + futures_clearing_account: Unset | str = UNSET + futures_clearing_range: Unset | ClearingRange = UNSET + futures_cmta: Unset | str = UNSET + futures_execution_broker: Unset | str = UNSET + name: Unset | str = UNSET + occ_actionable_id: Unset | str = UNSET + options_clearing_account: Unset | str = UNSET + options_clearing_range: Unset | ClearingRange = UNSET + options_cmta: Unset | str = UNSET + options_efid: Unset | str = UNSET + options_give_up: Unset | str = UNSET + routing_session_groups: Unset | list["RoutingSessionGroup"] = UNSET + status: Unset | AccountStatus = UNSET + tag1: Unset | str = UNSET + trading_firm_id: Unset | int = UNSET + type_: Unset | AccountType = UNSET + created_ts: Unset | str = UNSET + optional_data: Unset | str = UNSET + position_script: Union[Unset, "AccountScript"] = UNSET + buying_power_script: Union[Unset, "AccountScript"] = UNSET + clearing_script: Union[Unset, "AccountScript"] = UNSET + + def to_dict(self) -> dict[str, Any]: + id = self.id + + billing_code = self.billing_code + + cti_code = self.cti_code + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + equities_capacity: Unset | str = UNSET + if not isinstance(self.equities_capacity, Unset): + equities_capacity = self.equities_capacity.value + + equities_give_up = self.equities_give_up + + equities_mpid = self.equities_mpid + + futures_clearing_account = self.futures_clearing_account + + futures_clearing_range: Unset | str = UNSET + if not isinstance(self.futures_clearing_range, Unset): + futures_clearing_range = self.futures_clearing_range.value + + futures_cmta = self.futures_cmta + + futures_execution_broker = self.futures_execution_broker + + name = self.name + + occ_actionable_id = self.occ_actionable_id + + options_clearing_account = self.options_clearing_account + + options_clearing_range: Unset | str = UNSET + if not isinstance(self.options_clearing_range, Unset): + options_clearing_range = self.options_clearing_range.value + + options_cmta = self.options_cmta + + options_efid = self.options_efid + + options_give_up = self.options_give_up + + routing_session_groups: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.routing_session_groups, Unset): + routing_session_groups = [] + for routing_session_groups_item_data in self.routing_session_groups: + routing_session_groups_item = routing_session_groups_item_data.to_dict() + routing_session_groups.append(routing_session_groups_item) + + status: Unset | str = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + tag1 = self.tag1 + + trading_firm_id = self.trading_firm_id + + type_: Unset | str = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + created_ts = self.created_ts + + optional_data = self.optional_data + + position_script: Unset | dict[str, Any] = UNSET + if not isinstance(self.position_script, Unset): + position_script = self.position_script.to_dict() + + buying_power_script: Unset | dict[str, Any] = UNSET + if not isinstance(self.buying_power_script, Unset): + buying_power_script = self.buying_power_script.to_dict() + + clearing_script: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_script, Unset): + clearing_script = self.clearing_script.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if billing_code is not UNSET: + field_dict["billingCode"] = billing_code + if cti_code is not UNSET: + field_dict["ctiCode"] = cti_code + if currency is not UNSET: + field_dict["currency"] = currency + if equities_capacity is not UNSET: + field_dict["equitiesCapacity"] = equities_capacity + if equities_give_up is not UNSET: + field_dict["equitiesGiveUp"] = equities_give_up + if equities_mpid is not UNSET: + field_dict["equitiesMpid"] = equities_mpid + if futures_clearing_account is not UNSET: + field_dict["futuresClearingAccount"] = futures_clearing_account + if futures_clearing_range is not UNSET: + field_dict["futuresClearingRange"] = futures_clearing_range + if futures_cmta is not UNSET: + field_dict["futuresCmta"] = futures_cmta + if futures_execution_broker is not UNSET: + field_dict["futuresExecutionBroker"] = futures_execution_broker + if name is not UNSET: + field_dict["name"] = name + if occ_actionable_id is not UNSET: + field_dict["occActionableId"] = occ_actionable_id + if options_clearing_account is not UNSET: + field_dict["optionsClearingAccount"] = options_clearing_account + if options_clearing_range is not UNSET: + field_dict["optionsClearingRange"] = options_clearing_range + if options_cmta is not UNSET: + field_dict["optionsCmta"] = options_cmta + if options_efid is not UNSET: + field_dict["optionsEfid"] = options_efid + if options_give_up is not UNSET: + field_dict["optionsGiveUp"] = options_give_up + if routing_session_groups is not UNSET: + field_dict["routingSessionGroups"] = routing_session_groups + if status is not UNSET: + field_dict["status"] = status + if tag1 is not UNSET: + field_dict["tag1"] = tag1 + if trading_firm_id is not UNSET: + field_dict["tradingFirmId"] = trading_firm_id + if type_ is not UNSET: + field_dict["type"] = type_ + if created_ts is not UNSET: + field_dict["createdTs"] = created_ts + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if position_script is not UNSET: + field_dict["positionScript"] = position_script + if buying_power_script is not UNSET: + field_dict["buyingPowerScript"] = buying_power_script + if clearing_script is not UNSET: + field_dict["clearingScript"] = clearing_script + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.account_script import AccountScript + from ..models.routing_session_group import RoutingSessionGroup + + d = dict(src_dict) + id = d.pop("id", UNSET) + + billing_code = d.pop("billingCode", UNSET) + + cti_code = d.pop("ctiCode", UNSET) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + _equities_capacity = d.pop("equitiesCapacity", UNSET) + equities_capacity: Unset | CapacityCode + if isinstance(_equities_capacity, Unset): + equities_capacity = UNSET + else: + equities_capacity = CapacityCode(_equities_capacity) + + equities_give_up = d.pop("equitiesGiveUp", UNSET) + + equities_mpid = d.pop("equitiesMpid", UNSET) + + futures_clearing_account = d.pop("futuresClearingAccount", UNSET) + + _futures_clearing_range = d.pop("futuresClearingRange", UNSET) + futures_clearing_range: Unset | ClearingRange + if isinstance(_futures_clearing_range, Unset): + futures_clearing_range = UNSET + else: + futures_clearing_range = ClearingRange(_futures_clearing_range) + + futures_cmta = d.pop("futuresCmta", UNSET) + + futures_execution_broker = d.pop("futuresExecutionBroker", UNSET) + + name = d.pop("name", UNSET) + + occ_actionable_id = d.pop("occActionableId", UNSET) + + options_clearing_account = d.pop("optionsClearingAccount", UNSET) + + _options_clearing_range = d.pop("optionsClearingRange", UNSET) + options_clearing_range: Unset | ClearingRange + if isinstance(_options_clearing_range, Unset): + options_clearing_range = UNSET + else: + options_clearing_range = ClearingRange(_options_clearing_range) + + options_cmta = d.pop("optionsCmta", UNSET) + + options_efid = d.pop("optionsEfid", UNSET) + + options_give_up = d.pop("optionsGiveUp", UNSET) + + routing_session_groups = [] + _routing_session_groups = d.pop("routingSessionGroups", UNSET) + for routing_session_groups_item_data in _routing_session_groups or []: + routing_session_groups_item = RoutingSessionGroup.from_dict( + routing_session_groups_item_data + ) + + routing_session_groups.append(routing_session_groups_item) + + _status = d.pop("status", UNSET) + status: Unset | AccountStatus + if isinstance(_status, Unset): + status = UNSET + else: + status = AccountStatus(_status) + + tag1 = d.pop("tag1", UNSET) + + trading_firm_id = d.pop("tradingFirmId", UNSET) + + _type_ = d.pop("type", UNSET) + type_: Unset | AccountType + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = AccountType(_type_) + + created_ts = d.pop("createdTs", UNSET) + + optional_data = d.pop("optionalData", UNSET) + + _position_script = d.pop("positionScript", UNSET) + position_script: Unset | AccountScript + if isinstance(_position_script, Unset): + position_script = UNSET + else: + position_script = AccountScript.from_dict(_position_script) + + _buying_power_script = d.pop("buyingPowerScript", UNSET) + buying_power_script: Unset | AccountScript + if isinstance(_buying_power_script, Unset): + buying_power_script = UNSET + else: + buying_power_script = AccountScript.from_dict(_buying_power_script) + + _clearing_script = d.pop("clearingScript", UNSET) + clearing_script: Unset | AccountScript + if isinstance(_clearing_script, Unset): + clearing_script = UNSET + else: + clearing_script = AccountScript.from_dict(_clearing_script) + + account = cls( + id=id, + billing_code=billing_code, + cti_code=cti_code, + currency=currency, + equities_capacity=equities_capacity, + equities_give_up=equities_give_up, + equities_mpid=equities_mpid, + futures_clearing_account=futures_clearing_account, + futures_clearing_range=futures_clearing_range, + futures_cmta=futures_cmta, + futures_execution_broker=futures_execution_broker, + name=name, + occ_actionable_id=occ_actionable_id, + options_clearing_account=options_clearing_account, + options_clearing_range=options_clearing_range, + options_cmta=options_cmta, + options_efid=options_efid, + options_give_up=options_give_up, + routing_session_groups=routing_session_groups, + status=status, + tag1=tag1, + trading_firm_id=trading_firm_id, + type_=type_, + created_ts=created_ts, + optional_data=optional_data, + position_script=position_script, + buying_power_script=buying_power_script, + clearing_script=clearing_script, + ) + + return account diff --git a/openapi/openapi_project/openapi_package/models/account_script.py b/openapi/openapi_project/openapi_package/models/account_script.py new file mode 100644 index 000000000..180e5ba44 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/account_script.py @@ -0,0 +1,49 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AccountScript") + + +@_attrs_define +class AccountScript: + """ + Attributes: + script_name (Union[Unset, str]): + account_name (Union[Unset, str]): + """ + + script_name: Unset | str = UNSET + account_name: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + script_name = self.script_name + + account_name = self.account_name + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if script_name is not UNSET: + field_dict["scriptName"] = script_name + if account_name is not UNSET: + field_dict["accountName"] = account_name + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + script_name = d.pop("scriptName", UNSET) + + account_name = d.pop("accountName", UNSET) + + account_script = cls( + script_name=script_name, + account_name=account_name, + ) + + return account_script diff --git a/openapi/openapi_project/openapi_package/models/account_status.py b/openapi/openapi_project/openapi_package/models/account_status.py new file mode 100644 index 000000000..0a19e6040 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/account_status.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class AccountStatus(str, Enum): + ACCOUNT_STATUS_ACTIVE = "ACCOUNT_STATUS_ACTIVE" + ACCOUNT_STATUS_DELETED = "ACCOUNT_STATUS_DELETED" + ACCOUNT_STATUS_LIQUIDATION = "ACCOUNT_STATUS_LIQUIDATION" + ACCOUNT_STATUS_VIEW_ONLY = "ACCOUNT_STATUS_VIEW_ONLY" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/account_type.py b/openapi/openapi_project/openapi_package/models/account_type.py new file mode 100644 index 000000000..65c58c63a --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/account_type.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class AccountType(str, Enum): + ACCOUNT_TYPE_CASH = "ACCOUNT_TYPE_CASH" + ACCOUNT_TYPE_INVENTORY = "ACCOUNT_TYPE_INVENTORY" + ACCOUNT_TYPE_MARGIN = "ACCOUNT_TYPE_MARGIN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/analyze_position_item.py b/openapi/openapi_project/openapi_package/models/analyze_position_item.py new file mode 100644 index 000000000..de889950e --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/analyze_position_item.py @@ -0,0 +1,67 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AnalyzePositionItem") + + +@_attrs_define +class AnalyzePositionItem: + """ + Attributes: + price (Union[Unset, float]): + qty (Union[Unset, int]): + symbol (Union[Unset, str]): + volatility (Union[Unset, float]): + """ + + price: Unset | float = UNSET + qty: Unset | int = UNSET + symbol: Unset | str = UNSET + volatility: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + price = self.price + + qty = self.qty + + symbol = self.symbol + + volatility = self.volatility + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if price is not UNSET: + field_dict["price"] = price + if qty is not UNSET: + field_dict["qty"] = qty + if symbol is not UNSET: + field_dict["symbol"] = symbol + if volatility is not UNSET: + field_dict["volatility"] = volatility + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + price = d.pop("price", UNSET) + + qty = d.pop("qty", UNSET) + + symbol = d.pop("symbol", UNSET) + + volatility = d.pop("volatility", UNSET) + + analyze_position_item = cls( + price=price, + qty=qty, + symbol=symbol, + volatility=volatility, + ) + + return analyze_position_item diff --git a/openapi/openapi_project/openapi_package/models/analyze_positions_request.py b/openapi/openapi_project/openapi_package/models/analyze_positions_request.py new file mode 100644 index 000000000..dfaba24d7 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/analyze_positions_request.py @@ -0,0 +1,136 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.analyze_position_item import AnalyzePositionItem + + +T = TypeVar("T", bound="AnalyzePositionsRequest") + + +@_attrs_define +class AnalyzePositionsRequest: + """ + Attributes: + as_of_ts (Union[Unset, str]): + evaluate_at_expiry (Union[Unset, bool]): + evaluate_at_strike (Union[Unset, bool]): + evaluation_as_of (Union[Unset, list[str]]): + positions (Union[Unset, list['AnalyzePositionItem']]): + price (Union[Unset, float]): + underlying_volatility (Union[Unset, list[float]]): + historical_volatility_days (Union[Unset, list[int]]): + volatility_change (Union[Unset, float]): + """ + + as_of_ts: Unset | str = UNSET + evaluate_at_expiry: Unset | bool = UNSET + evaluate_at_strike: Unset | bool = UNSET + evaluation_as_of: Unset | list[str] = UNSET + positions: Unset | list["AnalyzePositionItem"] = UNSET + price: Unset | float = UNSET + underlying_volatility: Unset | list[float] = UNSET + historical_volatility_days: Unset | list[int] = UNSET + volatility_change: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + as_of_ts = self.as_of_ts + + evaluate_at_expiry = self.evaluate_at_expiry + + evaluate_at_strike = self.evaluate_at_strike + + evaluation_as_of: Unset | list[str] = UNSET + if not isinstance(self.evaluation_as_of, Unset): + evaluation_as_of = self.evaluation_as_of + + positions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.positions, Unset): + positions = [] + for positions_item_data in self.positions: + positions_item = positions_item_data.to_dict() + positions.append(positions_item) + + price = self.price + + underlying_volatility: Unset | list[float] = UNSET + if not isinstance(self.underlying_volatility, Unset): + underlying_volatility = self.underlying_volatility + + historical_volatility_days: Unset | list[int] = UNSET + if not isinstance(self.historical_volatility_days, Unset): + historical_volatility_days = self.historical_volatility_days + + volatility_change = self.volatility_change + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if as_of_ts is not UNSET: + field_dict["asOfTs"] = as_of_ts + if evaluate_at_expiry is not UNSET: + field_dict["evaluateAtExpiry"] = evaluate_at_expiry + if evaluate_at_strike is not UNSET: + field_dict["evaluateAtStrike"] = evaluate_at_strike + if evaluation_as_of is not UNSET: + field_dict["evaluationAsOf"] = evaluation_as_of + if positions is not UNSET: + field_dict["positions"] = positions + if price is not UNSET: + field_dict["price"] = price + if underlying_volatility is not UNSET: + field_dict["underlyingVolatility"] = underlying_volatility + if historical_volatility_days is not UNSET: + field_dict["historicalVolatilityDays"] = historical_volatility_days + if volatility_change is not UNSET: + field_dict["volatilityChange"] = volatility_change + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.analyze_position_item import AnalyzePositionItem + + d = dict(src_dict) + as_of_ts = d.pop("asOfTs", UNSET) + + evaluate_at_expiry = d.pop("evaluateAtExpiry", UNSET) + + evaluate_at_strike = d.pop("evaluateAtStrike", UNSET) + + evaluation_as_of = cast(list[str], d.pop("evaluationAsOf", UNSET)) + + positions = [] + _positions = d.pop("positions", UNSET) + for positions_item_data in _positions or []: + positions_item = AnalyzePositionItem.from_dict(positions_item_data) + + positions.append(positions_item) + + price = d.pop("price", UNSET) + + underlying_volatility = cast(list[float], d.pop("underlyingVolatility", UNSET)) + + historical_volatility_days = cast( + list[int], d.pop("historicalVolatilityDays", UNSET) + ) + + volatility_change = d.pop("volatilityChange", UNSET) + + analyze_positions_request = cls( + as_of_ts=as_of_ts, + evaluate_at_expiry=evaluate_at_expiry, + evaluate_at_strike=evaluate_at_strike, + evaluation_as_of=evaluation_as_of, + positions=positions, + price=price, + underlying_volatility=underlying_volatility, + historical_volatility_days=historical_volatility_days, + volatility_change=volatility_change, + ) + + return analyze_positions_request diff --git a/openapi/openapi_project/openapi_package/models/analyze_positions_response.py b/openapi/openapi_project/openapi_package/models/analyze_positions_response.py new file mode 100644 index 000000000..0cac7e11f --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/analyze_positions_response.py @@ -0,0 +1,79 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.position_analysis import PositionAnalysis + + +T = TypeVar("T", bound="AnalyzePositionsResponse") + + +@_attrs_define +class AnalyzePositionsResponse: + """ + Attributes: + analysis (Union[Unset, PositionAnalysis]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + analysis: Union[Unset, "PositionAnalysis"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + analysis: Unset | dict[str, Any] = UNSET + if not isinstance(self.analysis, Unset): + analysis = self.analysis.to_dict() + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if analysis is not UNSET: + field_dict["analysis"] = analysis + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.position_analysis import PositionAnalysis + + d = dict(src_dict) + _analysis = d.pop("analysis", UNSET) + analysis: Unset | PositionAnalysis + if isinstance(_analysis, Unset): + analysis = UNSET + else: + analysis = PositionAnalysis.from_dict(_analysis) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + analyze_positions_response = cls( + analysis=analysis, + error_message=error_message, + status_code=status_code, + ) + + return analyze_positions_response diff --git a/openapi/openapi_project/openapi_package/models/any_model.py b/openapi/openapi_project/openapi_package/models/any_model.py new file mode 100644 index 000000000..c40b6a3fe --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/any_model.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="AnyModel") + + +@_attrs_define +class AnyModel: + """ + Attributes: + type_ (str): + """ + + type_: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + type_ = self.type_ + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "@type": type_, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + type_ = d.pop("@type") + + any_model = cls( + type_=type_, + ) + + any_model.additional_properties = d + return any_model + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/calculate_margin_request.py b/openapi/openapi_project/openapi_package/models/calculate_margin_request.py new file mode 100644 index 000000000..c8446eac2 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/calculate_margin_request.py @@ -0,0 +1,126 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..models.margin_data_type import MarginDataType +from ..models.position_source import PositionSource +from ..models.risk_eval_mode import RiskEvalMode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.calculate_margin_request_position_list import ( + CalculateMarginRequestPositionList, + ) + + +T = TypeVar("T", bound="CalculateMarginRequest") + + +@_attrs_define +class CalculateMarginRequest: + """ + Attributes: + account_ids (Union[Unset, list[int]]): + margin_data_type (Union[Unset, MarginDataType]): + positions_by_account_id (Union[Unset, list['CalculateMarginRequestPositionList']]): + eval_mode (Union[Unset, RiskEvalMode]): + source (Union[Unset, PositionSource]): + """ + + account_ids: Unset | list[int] = UNSET + margin_data_type: Unset | MarginDataType = UNSET + positions_by_account_id: Unset | list["CalculateMarginRequestPositionList"] = UNSET + eval_mode: Unset | RiskEvalMode = UNSET + source: Unset | PositionSource = UNSET + + def to_dict(self) -> dict[str, Any]: + account_ids: Unset | list[int] = UNSET + if not isinstance(self.account_ids, Unset): + account_ids = self.account_ids + + margin_data_type: Unset | str = UNSET + if not isinstance(self.margin_data_type, Unset): + margin_data_type = self.margin_data_type.value + + positions_by_account_id: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.positions_by_account_id, Unset): + positions_by_account_id = [] + for positions_by_account_id_item_data in self.positions_by_account_id: + positions_by_account_id_item = ( + positions_by_account_id_item_data.to_dict() + ) + positions_by_account_id.append(positions_by_account_id_item) + + eval_mode: Unset | str = UNSET + if not isinstance(self.eval_mode, Unset): + eval_mode = self.eval_mode.value + + source: Unset | str = UNSET + if not isinstance(self.source, Unset): + source = self.source.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_ids is not UNSET: + field_dict["accountIds"] = account_ids + if margin_data_type is not UNSET: + field_dict["marginDataType"] = margin_data_type + if positions_by_account_id is not UNSET: + field_dict["positionsByAccountId"] = positions_by_account_id + if eval_mode is not UNSET: + field_dict["evalMode"] = eval_mode + if source is not UNSET: + field_dict["source"] = source + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.calculate_margin_request_position_list import ( + CalculateMarginRequestPositionList, + ) + + d = dict(src_dict) + account_ids = cast(list[int], d.pop("accountIds", UNSET)) + + _margin_data_type = d.pop("marginDataType", UNSET) + margin_data_type: Unset | MarginDataType + if isinstance(_margin_data_type, Unset): + margin_data_type = UNSET + else: + margin_data_type = MarginDataType(_margin_data_type) + + positions_by_account_id = [] + _positions_by_account_id = d.pop("positionsByAccountId", UNSET) + for positions_by_account_id_item_data in _positions_by_account_id or []: + positions_by_account_id_item = CalculateMarginRequestPositionList.from_dict( + positions_by_account_id_item_data + ) + + positions_by_account_id.append(positions_by_account_id_item) + + _eval_mode = d.pop("evalMode", UNSET) + eval_mode: Unset | RiskEvalMode + if isinstance(_eval_mode, Unset): + eval_mode = UNSET + else: + eval_mode = RiskEvalMode(_eval_mode) + + _source = d.pop("source", UNSET) + source: Unset | PositionSource + if isinstance(_source, Unset): + source = UNSET + else: + source = PositionSource(_source) + + calculate_margin_request = cls( + account_ids=account_ids, + margin_data_type=margin_data_type, + positions_by_account_id=positions_by_account_id, + eval_mode=eval_mode, + source=source, + ) + + return calculate_margin_request diff --git a/openapi/openapi_project/openapi_package/models/calculate_margin_request_position.py b/openapi/openapi_project/openapi_package/models/calculate_margin_request_position.py new file mode 100644 index 000000000..93c54a0ff --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/calculate_margin_request_position.py @@ -0,0 +1,58 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CalculateMarginRequestPosition") + + +@_attrs_define +class CalculateMarginRequestPosition: + """ + Attributes: + is_simulated_position (Union[Unset, bool]): + qty (Union[Unset, float]): + symbol (Union[Unset, str]): + """ + + is_simulated_position: Unset | bool = UNSET + qty: Unset | float = UNSET + symbol: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + is_simulated_position = self.is_simulated_position + + qty = self.qty + + symbol = self.symbol + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if is_simulated_position is not UNSET: + field_dict["isSimulatedPosition"] = is_simulated_position + if qty is not UNSET: + field_dict["qty"] = qty + if symbol is not UNSET: + field_dict["symbol"] = symbol + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + is_simulated_position = d.pop("isSimulatedPosition", UNSET) + + qty = d.pop("qty", UNSET) + + symbol = d.pop("symbol", UNSET) + + calculate_margin_request_position = cls( + is_simulated_position=is_simulated_position, + qty=qty, + symbol=symbol, + ) + + return calculate_margin_request_position diff --git a/openapi/openapi_project/openapi_package/models/calculate_margin_request_position_list.py b/openapi/openapi_project/openapi_package/models/calculate_margin_request_position_list.py new file mode 100644 index 000000000..16cd08822 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/calculate_margin_request_position_list.py @@ -0,0 +1,71 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.calculate_margin_request_position import ( + CalculateMarginRequestPosition, + ) + + +T = TypeVar("T", bound="CalculateMarginRequestPositionList") + + +@_attrs_define +class CalculateMarginRequestPositionList: + """ + Attributes: + account_id (Union[Unset, int]): + positions (Union[Unset, list['CalculateMarginRequestPosition']]): + """ + + account_id: Unset | int = UNSET + positions: Unset | list["CalculateMarginRequestPosition"] = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + positions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.positions, Unset): + positions = [] + for positions_item_data in self.positions: + positions_item = positions_item_data.to_dict() + positions.append(positions_item) + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if positions is not UNSET: + field_dict["positions"] = positions + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.calculate_margin_request_position import ( + CalculateMarginRequestPosition, + ) + + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + positions = [] + _positions = d.pop("positions", UNSET) + for positions_item_data in _positions or []: + positions_item = CalculateMarginRequestPosition.from_dict( + positions_item_data + ) + + positions.append(positions_item) + + calculate_margin_request_position_list = cls( + account_id=account_id, + positions=positions, + ) + + return calculate_margin_request_position_list diff --git a/openapi/openapi_project/openapi_package/models/calculate_margin_response.py b/openapi/openapi_project/openapi_package/models/calculate_margin_response.py new file mode 100644 index 000000000..2693a25f7 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/calculate_margin_response.py @@ -0,0 +1,82 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.margin_data import MarginData + + +T = TypeVar("T", bound="CalculateMarginResponse") + + +@_attrs_define +class CalculateMarginResponse: + """ + Attributes: + margin_data (Union[Unset, list['MarginData']]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + margin_data: Unset | list["MarginData"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + margin_data: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.margin_data, Unset): + margin_data = [] + for margin_data_item_data in self.margin_data: + margin_data_item = margin_data_item_data.to_dict() + margin_data.append(margin_data_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if margin_data is not UNSET: + field_dict["marginData"] = margin_data + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.margin_data import MarginData + + d = dict(src_dict) + margin_data = [] + _margin_data = d.pop("marginData", UNSET) + for margin_data_item_data in _margin_data or []: + margin_data_item = MarginData.from_dict(margin_data_item_data) + + margin_data.append(margin_data_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + calculate_margin_response = cls( + margin_data=margin_data, + error_message=error_message, + status_code=status_code, + ) + + return calculate_margin_response diff --git a/openapi/openapi_project/openapi_package/models/cancel_order_request.py b/openapi/openapi_project/openapi_package/models/cancel_order_request.py new file mode 100644 index 000000000..636934aaa --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/cancel_order_request.py @@ -0,0 +1,96 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.cancel_order_request_optional_data import ( + CancelOrderRequestOptionalData, + ) + from ..models.order_instruction import OrderInstruction + + +T = TypeVar("T", bound="CancelOrderRequest") + + +@_attrs_define +class CancelOrderRequest: + """ + Attributes: + cur_ord_id (Union[Unset, str]): + instructions (Union[Unset, list['OrderInstruction']]): + perm_ord_id (Union[Unset, str]): + optional_data (Union[Unset, CancelOrderRequestOptionalData]): + """ + + cur_ord_id: Unset | str = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + perm_ord_id: Unset | str = UNSET + optional_data: Union[Unset, "CancelOrderRequestOptionalData"] = UNSET + + def to_dict(self) -> dict[str, Any]: + cur_ord_id = self.cur_ord_id + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + perm_ord_id = self.perm_ord_id + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if instructions is not UNSET: + field_dict["instructions"] = instructions + if perm_ord_id is not UNSET: + field_dict["permOrdId"] = perm_ord_id + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.cancel_order_request_optional_data import ( + CancelOrderRequestOptionalData, + ) + from ..models.order_instruction import OrderInstruction + + d = dict(src_dict) + cur_ord_id = d.pop("curOrdId", UNSET) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + perm_ord_id = d.pop("permOrdId", UNSET) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | CancelOrderRequestOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = CancelOrderRequestOptionalData.from_dict(_optional_data) + + cancel_order_request = cls( + cur_ord_id=cur_ord_id, + instructions=instructions, + perm_ord_id=perm_ord_id, + optional_data=optional_data, + ) + + return cancel_order_request diff --git a/openapi/openapi_project/openapi_package/models/cancel_order_request_optional_data.py b/openapi/openapi_project/openapi_package/models/cancel_order_request_optional_data.py new file mode 100644 index 000000000..4b34136e3 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/cancel_order_request_optional_data.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CancelOrderRequestOptionalData") + + +@_attrs_define +class CancelOrderRequestOptionalData: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + cancel_order_request_optional_data = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + cancel_order_request_optional_data.additional_properties = additional_properties + return cancel_order_request_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/cancel_order_response.py b/openapi/openapi_project/openapi_package/models/cancel_order_response.py new file mode 100644 index 000000000..489cc9cf2 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/cancel_order_response.py @@ -0,0 +1,75 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CancelOrderResponse") + + +@_attrs_define +class CancelOrderResponse: + """ + Attributes: + submit_ts (Union[Unset, str]): + req_ord_id (Union[Unset, str]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + submit_ts: Unset | str = UNSET + req_ord_id: Unset | str = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + submit_ts = self.submit_ts + + req_ord_id = self.req_ord_id + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if submit_ts is not UNSET: + field_dict["submitTs"] = submit_ts + if req_ord_id is not UNSET: + field_dict["reqOrdId"] = req_ord_id + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + submit_ts = d.pop("submitTs", UNSET) + + req_ord_id = d.pop("reqOrdId", UNSET) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + cancel_order_response = cls( + submit_ts=submit_ts, + req_ord_id=req_ord_id, + error_message=error_message, + status_code=status_code, + ) + + return cancel_order_response diff --git a/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py b/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py new file mode 100644 index 000000000..935178101 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py @@ -0,0 +1,245 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.ord_type import OrdType +from ..models.tif import Tif +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.cancel_replace_multi_leg_order_request_algo import ( + CancelReplaceMultiLegOrderRequestAlgo, + ) + from ..models.cancel_replace_multi_leg_order_request_market_condition import ( + CancelReplaceMultiLegOrderRequestMarketCondition, + ) + from ..models.cancel_replace_multi_leg_order_request_optional_data import ( + CancelReplaceMultiLegOrderRequestOptionalData, + ) + from ..models.clearing_info import ClearingInfo + from ..models.order_instruction import OrderInstruction + + +T = TypeVar("T", bound="CancelReplaceMultiLegOrderRequest") + + +@_attrs_define +class CancelReplaceMultiLegOrderRequest: + """ + Attributes: + aux_price (Union[Unset, float]): + clearing_info (Union[Unset, ClearingInfo]): + cur_ord_id (Union[Unset, str]): + instructions (Union[Unset, list['OrderInstruction']]): + ord_type (Union[Unset, OrdType]): + perm_ord_id (Union[Unset, str]): + price (Union[Unset, float]): + qty (Union[Unset, float]): + tag (Union[Unset, str]): + text (Union[Unset, str]): + tif (Union[Unset, Tif]): + algo (Union[Unset, CancelReplaceMultiLegOrderRequestAlgo]): + market_condition (Union[Unset, CancelReplaceMultiLegOrderRequestMarketCondition]): + optional_data (Union[Unset, CancelReplaceMultiLegOrderRequestOptionalData]): + """ + + aux_price: Unset | float = UNSET + clearing_info: Union[Unset, "ClearingInfo"] = UNSET + cur_ord_id: Unset | str = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + ord_type: Unset | OrdType = UNSET + perm_ord_id: Unset | str = UNSET + price: Unset | float = UNSET + qty: Unset | float = UNSET + tag: Unset | str = UNSET + text: Unset | str = UNSET + tif: Unset | Tif = UNSET + algo: Union[Unset, "CancelReplaceMultiLegOrderRequestAlgo"] = UNSET + market_condition: Union[ + Unset, "CancelReplaceMultiLegOrderRequestMarketCondition" + ] = UNSET + optional_data: Union[Unset, "CancelReplaceMultiLegOrderRequestOptionalData"] = UNSET + + def to_dict(self) -> dict[str, Any]: + aux_price = self.aux_price + + clearing_info: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_info, Unset): + clearing_info = self.clearing_info.to_dict() + + cur_ord_id = self.cur_ord_id + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + perm_ord_id = self.perm_ord_id + + price = self.price + + qty = self.qty + + tag = self.tag + + text = self.text + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + algo: Unset | dict[str, Any] = UNSET + if not isinstance(self.algo, Unset): + algo = self.algo.to_dict() + + market_condition: Unset | dict[str, Any] = UNSET + if not isinstance(self.market_condition, Unset): + market_condition = self.market_condition.to_dict() + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if aux_price is not UNSET: + field_dict["auxPrice"] = aux_price + if clearing_info is not UNSET: + field_dict["clearingInfo"] = clearing_info + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if instructions is not UNSET: + field_dict["instructions"] = instructions + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if perm_ord_id is not UNSET: + field_dict["permOrdId"] = perm_ord_id + if price is not UNSET: + field_dict["price"] = price + if qty is not UNSET: + field_dict["qty"] = qty + if tag is not UNSET: + field_dict["tag"] = tag + if text is not UNSET: + field_dict["text"] = text + if tif is not UNSET: + field_dict["tif"] = tif + if algo is not UNSET: + field_dict["algo"] = algo + if market_condition is not UNSET: + field_dict["marketCondition"] = market_condition + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.cancel_replace_multi_leg_order_request_algo import ( + CancelReplaceMultiLegOrderRequestAlgo, + ) + from ..models.cancel_replace_multi_leg_order_request_market_condition import ( + CancelReplaceMultiLegOrderRequestMarketCondition, + ) + from ..models.cancel_replace_multi_leg_order_request_optional_data import ( + CancelReplaceMultiLegOrderRequestOptionalData, + ) + from ..models.clearing_info import ClearingInfo + from ..models.order_instruction import OrderInstruction + + d = dict(src_dict) + aux_price = d.pop("auxPrice", UNSET) + + _clearing_info = d.pop("clearingInfo", UNSET) + clearing_info: Unset | ClearingInfo + if isinstance(_clearing_info, Unset): + clearing_info = UNSET + else: + clearing_info = ClearingInfo.from_dict(_clearing_info) + + cur_ord_id = d.pop("curOrdId", UNSET) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + perm_ord_id = d.pop("permOrdId", UNSET) + + price = d.pop("price", UNSET) + + qty = d.pop("qty", UNSET) + + tag = d.pop("tag", UNSET) + + text = d.pop("text", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + _algo = d.pop("algo", UNSET) + algo: Unset | CancelReplaceMultiLegOrderRequestAlgo + if isinstance(_algo, Unset): + algo = UNSET + else: + algo = CancelReplaceMultiLegOrderRequestAlgo.from_dict(_algo) + + _market_condition = d.pop("marketCondition", UNSET) + market_condition: Unset | CancelReplaceMultiLegOrderRequestMarketCondition + if isinstance(_market_condition, Unset): + market_condition = UNSET + else: + market_condition = ( + CancelReplaceMultiLegOrderRequestMarketCondition.from_dict( + _market_condition + ) + ) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | CancelReplaceMultiLegOrderRequestOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = CancelReplaceMultiLegOrderRequestOptionalData.from_dict( + _optional_data + ) + + cancel_replace_multi_leg_order_request = cls( + aux_price=aux_price, + clearing_info=clearing_info, + cur_ord_id=cur_ord_id, + instructions=instructions, + ord_type=ord_type, + perm_ord_id=perm_ord_id, + price=price, + qty=qty, + tag=tag, + text=text, + tif=tif, + algo=algo, + market_condition=market_condition, + optional_data=optional_data, + ) + + return cancel_replace_multi_leg_order_request diff --git a/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py b/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py new file mode 100644 index 000000000..717b5d06f --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CancelReplaceMultiLegOrderRequestAlgo") + + +@_attrs_define +class CancelReplaceMultiLegOrderRequestAlgo: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + cancel_replace_multi_leg_order_request_algo = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + cancel_replace_multi_leg_order_request_algo.additional_properties = ( + additional_properties + ) + return cancel_replace_multi_leg_order_request_algo + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py b/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py new file mode 100644 index 000000000..fac43107f --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CancelReplaceMultiLegOrderRequestMarketCondition") + + +@_attrs_define +class CancelReplaceMultiLegOrderRequestMarketCondition: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + cancel_replace_multi_leg_order_request_market_condition = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + cancel_replace_multi_leg_order_request_market_condition.additional_properties = ( + additional_properties + ) + return cancel_replace_multi_leg_order_request_market_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py b/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py new file mode 100644 index 000000000..6a874b1bf --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CancelReplaceMultiLegOrderRequestOptionalData") + + +@_attrs_define +class CancelReplaceMultiLegOrderRequestOptionalData: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + cancel_replace_multi_leg_order_request_optional_data = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + cancel_replace_multi_leg_order_request_optional_data.additional_properties = ( + additional_properties + ) + return cancel_replace_multi_leg_order_request_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py b/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py new file mode 100644 index 000000000..c09c8791c --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py @@ -0,0 +1,75 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CancelReplaceMultiLegOrderResponse") + + +@_attrs_define +class CancelReplaceMultiLegOrderResponse: + """ + Attributes: + submit_ts (Union[Unset, str]): + req_ord_id (Union[Unset, str]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + submit_ts: Unset | str = UNSET + req_ord_id: Unset | str = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + submit_ts = self.submit_ts + + req_ord_id = self.req_ord_id + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if submit_ts is not UNSET: + field_dict["submitTs"] = submit_ts + if req_ord_id is not UNSET: + field_dict["reqOrdId"] = req_ord_id + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + submit_ts = d.pop("submitTs", UNSET) + + req_ord_id = d.pop("reqOrdId", UNSET) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + cancel_replace_multi_leg_order_response = cls( + submit_ts=submit_ts, + req_ord_id=req_ord_id, + error_message=error_message, + status_code=status_code, + ) + + return cancel_replace_multi_leg_order_response diff --git a/openapi/openapi_project/openapi_package/models/cancel_replace_order_request.py b/openapi/openapi_project/openapi_package/models/cancel_replace_order_request.py new file mode 100644 index 000000000..796a89381 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/cancel_replace_order_request.py @@ -0,0 +1,221 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.ord_type import OrdType +from ..models.tif import Tif +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo + from ..models.cancel_replace_order_request_market_condition import ( + CancelReplaceOrderRequestMarketCondition, + ) + from ..models.cancel_replace_order_request_optional_data import ( + CancelReplaceOrderRequestOptionalData, + ) + from ..models.clearing_info import ClearingInfo + from ..models.order_instruction import OrderInstruction + + +T = TypeVar("T", bound="CancelReplaceOrderRequest") + + +@_attrs_define +class CancelReplaceOrderRequest: + """ + Attributes: + aux_price (Union[Unset, float]): + clearing_info (Union[Unset, ClearingInfo]): + cur_ord_id (Union[Unset, str]): + instructions (Union[Unset, list['OrderInstruction']]): + ord_type (Union[Unset, OrdType]): + perm_ord_id (Union[Unset, str]): + price (Union[Unset, float]): + qty (Union[Unset, float]): + tif (Union[Unset, Tif]): + algo (Union[Unset, CancelReplaceOrderRequestAlgo]): + market_condition (Union[Unset, CancelReplaceOrderRequestMarketCondition]): + optional_data (Union[Unset, CancelReplaceOrderRequestOptionalData]): + """ + + aux_price: Unset | float = UNSET + clearing_info: Union[Unset, "ClearingInfo"] = UNSET + cur_ord_id: Unset | str = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + ord_type: Unset | OrdType = UNSET + perm_ord_id: Unset | str = UNSET + price: Unset | float = UNSET + qty: Unset | float = UNSET + tif: Unset | Tif = UNSET + algo: Union[Unset, "CancelReplaceOrderRequestAlgo"] = UNSET + market_condition: Union[Unset, "CancelReplaceOrderRequestMarketCondition"] = UNSET + optional_data: Union[Unset, "CancelReplaceOrderRequestOptionalData"] = UNSET + + def to_dict(self) -> dict[str, Any]: + aux_price = self.aux_price + + clearing_info: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_info, Unset): + clearing_info = self.clearing_info.to_dict() + + cur_ord_id = self.cur_ord_id + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + perm_ord_id = self.perm_ord_id + + price = self.price + + qty = self.qty + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + algo: Unset | dict[str, Any] = UNSET + if not isinstance(self.algo, Unset): + algo = self.algo.to_dict() + + market_condition: Unset | dict[str, Any] = UNSET + if not isinstance(self.market_condition, Unset): + market_condition = self.market_condition.to_dict() + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if aux_price is not UNSET: + field_dict["auxPrice"] = aux_price + if clearing_info is not UNSET: + field_dict["clearingInfo"] = clearing_info + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if instructions is not UNSET: + field_dict["instructions"] = instructions + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if perm_ord_id is not UNSET: + field_dict["permOrdId"] = perm_ord_id + if price is not UNSET: + field_dict["price"] = price + if qty is not UNSET: + field_dict["qty"] = qty + if tif is not UNSET: + field_dict["tif"] = tif + if algo is not UNSET: + field_dict["algo"] = algo + if market_condition is not UNSET: + field_dict["marketCondition"] = market_condition + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.cancel_replace_order_request_algo import ( + CancelReplaceOrderRequestAlgo, + ) + from ..models.cancel_replace_order_request_market_condition import ( + CancelReplaceOrderRequestMarketCondition, + ) + from ..models.cancel_replace_order_request_optional_data import ( + CancelReplaceOrderRequestOptionalData, + ) + from ..models.clearing_info import ClearingInfo + from ..models.order_instruction import OrderInstruction + + d = dict(src_dict) + aux_price = d.pop("auxPrice", UNSET) + + _clearing_info = d.pop("clearingInfo", UNSET) + clearing_info: Unset | ClearingInfo + if isinstance(_clearing_info, Unset): + clearing_info = UNSET + else: + clearing_info = ClearingInfo.from_dict(_clearing_info) + + cur_ord_id = d.pop("curOrdId", UNSET) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + perm_ord_id = d.pop("permOrdId", UNSET) + + price = d.pop("price", UNSET) + + qty = d.pop("qty", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + _algo = d.pop("algo", UNSET) + algo: Unset | CancelReplaceOrderRequestAlgo + if isinstance(_algo, Unset): + algo = UNSET + else: + algo = CancelReplaceOrderRequestAlgo.from_dict(_algo) + + _market_condition = d.pop("marketCondition", UNSET) + market_condition: Unset | CancelReplaceOrderRequestMarketCondition + if isinstance(_market_condition, Unset): + market_condition = UNSET + else: + market_condition = CancelReplaceOrderRequestMarketCondition.from_dict( + _market_condition + ) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | CancelReplaceOrderRequestOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = CancelReplaceOrderRequestOptionalData.from_dict( + _optional_data + ) + + cancel_replace_order_request = cls( + aux_price=aux_price, + clearing_info=clearing_info, + cur_ord_id=cur_ord_id, + instructions=instructions, + ord_type=ord_type, + perm_ord_id=perm_ord_id, + price=price, + qty=qty, + tif=tif, + algo=algo, + market_condition=market_condition, + optional_data=optional_data, + ) + + return cancel_replace_order_request diff --git a/openapi/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py b/openapi/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py new file mode 100644 index 000000000..9e59fac7d --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CancelReplaceOrderRequestAlgo") + + +@_attrs_define +class CancelReplaceOrderRequestAlgo: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + cancel_replace_order_request_algo = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + cancel_replace_order_request_algo.additional_properties = additional_properties + return cancel_replace_order_request_algo + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py b/openapi/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py new file mode 100644 index 000000000..df8263244 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CancelReplaceOrderRequestMarketCondition") + + +@_attrs_define +class CancelReplaceOrderRequestMarketCondition: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + cancel_replace_order_request_market_condition = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + cancel_replace_order_request_market_condition.additional_properties = ( + additional_properties + ) + return cancel_replace_order_request_market_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py b/openapi/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py new file mode 100644 index 000000000..a6f8ee555 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CancelReplaceOrderRequestOptionalData") + + +@_attrs_define +class CancelReplaceOrderRequestOptionalData: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + cancel_replace_order_request_optional_data = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + cancel_replace_order_request_optional_data.additional_properties = ( + additional_properties + ) + return cancel_replace_order_request_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/cancel_replace_order_response.py b/openapi/openapi_project/openapi_package/models/cancel_replace_order_response.py new file mode 100644 index 000000000..bda3041be --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/cancel_replace_order_response.py @@ -0,0 +1,75 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CancelReplaceOrderResponse") + + +@_attrs_define +class CancelReplaceOrderResponse: + """ + Attributes: + submit_ts (Union[Unset, str]): + req_ord_id (Union[Unset, str]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + submit_ts: Unset | str = UNSET + req_ord_id: Unset | str = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + submit_ts = self.submit_ts + + req_ord_id = self.req_ord_id + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if submit_ts is not UNSET: + field_dict["submitTs"] = submit_ts + if req_ord_id is not UNSET: + field_dict["reqOrdId"] = req_ord_id + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + submit_ts = d.pop("submitTs", UNSET) + + req_ord_id = d.pop("reqOrdId", UNSET) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + cancel_replace_order_response = cls( + submit_ts=submit_ts, + req_ord_id=req_ord_id, + error_message=error_message, + status_code=status_code, + ) + + return cancel_replace_order_response diff --git a/openapi/openapi_project/openapi_package/models/capacity_code.py b/openapi/openapi_project/openapi_package/models/capacity_code.py new file mode 100644 index 000000000..db23b3407 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/capacity_code.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class CapacityCode(str, Enum): + CAPACITY_CODE_AGENT = "CAPACITY_CODE_AGENT" + CAPACITY_CODE_NOT_SET = "CAPACITY_CODE_NOT_SET" + CAPACITY_CODE_PRINCIPAL = "CAPACITY_CODE_PRINCIPAL" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/claim_type.py b/openapi/openapi_project/openapi_package/models/claim_type.py new file mode 100644 index 000000000..a4ac678ab --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/claim_type.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class ClaimType(str, Enum): + CLAIM_TYPE_FUNCTIONALITY_PERMISSION = "CLAIM_TYPE_FUNCTIONALITY_PERMISSION" + CLAIM_TYPE_SYSOP_PERMISSION = "CLAIM_TYPE_SYSOP_PERMISSION" + CLAIM_TYPE_UI_MODULE_PERMISSION = "CLAIM_TYPE_UI_MODULE_PERMISSION" + CLAIM_TYPE_UNDEFINED = "CLAIM_TYPE_UNDEFINED" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/clearing_info.py b/openapi/openapi_project/openapi_package/models/clearing_info.py new file mode 100644 index 000000000..d452bb777 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/clearing_info.py @@ -0,0 +1,216 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.capacity_code import CapacityCode +from ..models.clearing_range import ClearingRange +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ClearingInfo") + + +@_attrs_define +class ClearingInfo: + """ + Attributes: + clearing_optional_data (Union[Unset, str]): + cti_code (Union[Unset, str]): + efid (Union[Unset, str]): + eq_capacity (Union[Unset, CapacityCode]): + eq_clearing_account (Union[Unset, str]): + eq_give_up (Union[Unset, str]): + eq_mpid (Union[Unset, str]): + fut_clearing_account (Union[Unset, str]): + fut_clearing_range (Union[Unset, ClearingRange]): + fut_cmta (Union[Unset, str]): + fut_exec_broker (Union[Unset, str]): + locate_id (Union[Unset, str]): + opt_clearing_account (Union[Unset, str]): + opt_clearing_range (Union[Unset, ClearingRange]): + opt_cmta (Union[Unset, str]): + opt_give_up (Union[Unset, str]): + tag1 (Union[Unset, str]): + billing_code (Union[Unset, str]): + """ + + clearing_optional_data: Unset | str = UNSET + cti_code: Unset | str = UNSET + efid: Unset | str = UNSET + eq_capacity: Unset | CapacityCode = UNSET + eq_clearing_account: Unset | str = UNSET + eq_give_up: Unset | str = UNSET + eq_mpid: Unset | str = UNSET + fut_clearing_account: Unset | str = UNSET + fut_clearing_range: Unset | ClearingRange = UNSET + fut_cmta: Unset | str = UNSET + fut_exec_broker: Unset | str = UNSET + locate_id: Unset | str = UNSET + opt_clearing_account: Unset | str = UNSET + opt_clearing_range: Unset | ClearingRange = UNSET + opt_cmta: Unset | str = UNSET + opt_give_up: Unset | str = UNSET + tag1: Unset | str = UNSET + billing_code: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + clearing_optional_data = self.clearing_optional_data + + cti_code = self.cti_code + + efid = self.efid + + eq_capacity: Unset | str = UNSET + if not isinstance(self.eq_capacity, Unset): + eq_capacity = self.eq_capacity.value + + eq_clearing_account = self.eq_clearing_account + + eq_give_up = self.eq_give_up + + eq_mpid = self.eq_mpid + + fut_clearing_account = self.fut_clearing_account + + fut_clearing_range: Unset | str = UNSET + if not isinstance(self.fut_clearing_range, Unset): + fut_clearing_range = self.fut_clearing_range.value + + fut_cmta = self.fut_cmta + + fut_exec_broker = self.fut_exec_broker + + locate_id = self.locate_id + + opt_clearing_account = self.opt_clearing_account + + opt_clearing_range: Unset | str = UNSET + if not isinstance(self.opt_clearing_range, Unset): + opt_clearing_range = self.opt_clearing_range.value + + opt_cmta = self.opt_cmta + + opt_give_up = self.opt_give_up + + tag1 = self.tag1 + + billing_code = self.billing_code + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if clearing_optional_data is not UNSET: + field_dict["clearingOptionalData"] = clearing_optional_data + if cti_code is not UNSET: + field_dict["ctiCode"] = cti_code + if efid is not UNSET: + field_dict["efid"] = efid + if eq_capacity is not UNSET: + field_dict["eqCapacity"] = eq_capacity + if eq_clearing_account is not UNSET: + field_dict["eqClearingAccount"] = eq_clearing_account + if eq_give_up is not UNSET: + field_dict["eqGiveUp"] = eq_give_up + if eq_mpid is not UNSET: + field_dict["eqMpid"] = eq_mpid + if fut_clearing_account is not UNSET: + field_dict["futClearingAccount"] = fut_clearing_account + if fut_clearing_range is not UNSET: + field_dict["futClearingRange"] = fut_clearing_range + if fut_cmta is not UNSET: + field_dict["futCmta"] = fut_cmta + if fut_exec_broker is not UNSET: + field_dict["futExecBroker"] = fut_exec_broker + if locate_id is not UNSET: + field_dict["locateId"] = locate_id + if opt_clearing_account is not UNSET: + field_dict["optClearingAccount"] = opt_clearing_account + if opt_clearing_range is not UNSET: + field_dict["optClearingRange"] = opt_clearing_range + if opt_cmta is not UNSET: + field_dict["optCmta"] = opt_cmta + if opt_give_up is not UNSET: + field_dict["optGiveUp"] = opt_give_up + if tag1 is not UNSET: + field_dict["tag1"] = tag1 + if billing_code is not UNSET: + field_dict["billingCode"] = billing_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + clearing_optional_data = d.pop("clearingOptionalData", UNSET) + + cti_code = d.pop("ctiCode", UNSET) + + efid = d.pop("efid", UNSET) + + _eq_capacity = d.pop("eqCapacity", UNSET) + eq_capacity: Unset | CapacityCode + if isinstance(_eq_capacity, Unset): + eq_capacity = UNSET + else: + eq_capacity = CapacityCode(_eq_capacity) + + eq_clearing_account = d.pop("eqClearingAccount", UNSET) + + eq_give_up = d.pop("eqGiveUp", UNSET) + + eq_mpid = d.pop("eqMpid", UNSET) + + fut_clearing_account = d.pop("futClearingAccount", UNSET) + + _fut_clearing_range = d.pop("futClearingRange", UNSET) + fut_clearing_range: Unset | ClearingRange + if isinstance(_fut_clearing_range, Unset): + fut_clearing_range = UNSET + else: + fut_clearing_range = ClearingRange(_fut_clearing_range) + + fut_cmta = d.pop("futCmta", UNSET) + + fut_exec_broker = d.pop("futExecBroker", UNSET) + + locate_id = d.pop("locateId", UNSET) + + opt_clearing_account = d.pop("optClearingAccount", UNSET) + + _opt_clearing_range = d.pop("optClearingRange", UNSET) + opt_clearing_range: Unset | ClearingRange + if isinstance(_opt_clearing_range, Unset): + opt_clearing_range = UNSET + else: + opt_clearing_range = ClearingRange(_opt_clearing_range) + + opt_cmta = d.pop("optCmta", UNSET) + + opt_give_up = d.pop("optGiveUp", UNSET) + + tag1 = d.pop("tag1", UNSET) + + billing_code = d.pop("billingCode", UNSET) + + clearing_info = cls( + clearing_optional_data=clearing_optional_data, + cti_code=cti_code, + efid=efid, + eq_capacity=eq_capacity, + eq_clearing_account=eq_clearing_account, + eq_give_up=eq_give_up, + eq_mpid=eq_mpid, + fut_clearing_account=fut_clearing_account, + fut_clearing_range=fut_clearing_range, + fut_cmta=fut_cmta, + fut_exec_broker=fut_exec_broker, + locate_id=locate_id, + opt_clearing_account=opt_clearing_account, + opt_clearing_range=opt_clearing_range, + opt_cmta=opt_cmta, + opt_give_up=opt_give_up, + tag1=tag1, + billing_code=billing_code, + ) + + return clearing_info diff --git a/openapi/openapi_project/openapi_package/models/clearing_range.py b/openapi/openapi_project/openapi_package/models/clearing_range.py new file mode 100644 index 000000000..a4f20d190 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/clearing_range.py @@ -0,0 +1,21 @@ +from enum import Enum + + +class ClearingRange(str, Enum): + CLEARING_RANGE_AWAY_MARKET_MAKER = "CLEARING_RANGE_AWAY_MARKET_MAKER" + CLEARING_RANGE_BROKER_DEALER = "CLEARING_RANGE_BROKER_DEALER" + CLEARING_RANGE_BROKER_DEALER_CUSTOMER = "CLEARING_RANGE_BROKER_DEALER_CUSTOMER" + CLEARING_RANGE_BROKER_DEALER_FIRM = "CLEARING_RANGE_BROKER_DEALER_FIRM" + CLEARING_RANGE_CUSTOMER = "CLEARING_RANGE_CUSTOMER" + CLEARING_RANGE_FIRM = "CLEARING_RANGE_FIRM" + CLEARING_RANGE_JOINT_BACK_OFFICE = "CLEARING_RANGE_JOINT_BACK_OFFICE" + CLEARING_RANGE_MARKET_MAKER = "CLEARING_RANGE_MARKET_MAKER" + CLEARING_RANGE_NON_TPH_AFFILIATE = "CLEARING_RANGE_NON_TPH_AFFILIATE" + CLEARING_RANGE_NON_TPH_BROKER_DEALER = "CLEARING_RANGE_NON_TPH_BROKER_DEALER" + CLEARING_RANGE_NOTSET = "CLEARING_RANGE_NOTSET" + CLEARING_RANGE_PROFESSIONAL_CUSTOMER = "CLEARING_RANGE_PROFESSIONAL_CUSTOMER" + CLEARING_RANGE_PROPRIETARY_CUSTOMER = "CLEARING_RANGE_PROPRIETARY_CUSTOMER" + CLEARING_RANGE_PROPRIETARY_FIRM = "CLEARING_RANGE_PROPRIETARY_FIRM" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/country.py b/openapi/openapi_project/openapi_package/models/country.py new file mode 100644 index 000000000..a29ba6b7a --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/country.py @@ -0,0 +1,14 @@ +from enum import Enum + + +class Country(str, Enum): + COUNTRY_CHINA = "COUNTRY_CHINA" + COUNTRY_GERMANY = "COUNTRY_GERMANY" + COUNTRY_INDIA = "COUNTRY_INDIA" + COUNTRY_JAPAN = "COUNTRY_JAPAN" + COUNTRY_UNITED_KINGDOM = "COUNTRY_UNITED_KINGDOM" + COUNTRY_UNITED_STATES = "COUNTRY_UNITED_STATES" + COUNTRY_UNKNOWN = "COUNTRY_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/create_flex_option_request.py b/openapi/openapi_project/openapi_package/models/create_flex_option_request.py new file mode 100644 index 000000000..0b0c163ca --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_flex_option_request.py @@ -0,0 +1,182 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.flex_settlement_type import FlexSettlementType +from ..models.option_exercise_style import OptionExerciseStyle +from ..models.option_series_product_type import OptionSeriesProductType +from ..models.put_call import PutCall +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.date import Date + + +T = TypeVar("T", bound="CreateFlexOptionRequest") + + +@_attrs_define +class CreateFlexOptionRequest: + """ + Attributes: + root_symbol (Union[Unset, str]): + settlement_type (Union[Unset, FlexSettlementType]): + expiration_dt (Union[Unset, Date]): + strike (Union[Unset, float]): + put_call (Union[Unset, PutCall]): + product_type (Union[Unset, OptionSeriesProductType]): + exercise_style (Union[Unset, OptionExerciseStyle]): + creation_dt (Union[Unset, Date]): + observation_day (Union[Unset, int]): + is_percentage_priced (Union[Unset, bool]): + cap_percentage (Union[Unset, float]): + """ + + root_symbol: Unset | str = UNSET + settlement_type: Unset | FlexSettlementType = UNSET + expiration_dt: Union[Unset, "Date"] = UNSET + strike: Unset | float = UNSET + put_call: Unset | PutCall = UNSET + product_type: Unset | OptionSeriesProductType = UNSET + exercise_style: Unset | OptionExerciseStyle = UNSET + creation_dt: Union[Unset, "Date"] = UNSET + observation_day: Unset | int = UNSET + is_percentage_priced: Unset | bool = UNSET + cap_percentage: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + root_symbol = self.root_symbol + + settlement_type: Unset | str = UNSET + if not isinstance(self.settlement_type, Unset): + settlement_type = self.settlement_type.value + + expiration_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.expiration_dt, Unset): + expiration_dt = self.expiration_dt.to_dict() + + strike = self.strike + + put_call: Unset | str = UNSET + if not isinstance(self.put_call, Unset): + put_call = self.put_call.value + + product_type: Unset | str = UNSET + if not isinstance(self.product_type, Unset): + product_type = self.product_type.value + + exercise_style: Unset | str = UNSET + if not isinstance(self.exercise_style, Unset): + exercise_style = self.exercise_style.value + + creation_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.creation_dt, Unset): + creation_dt = self.creation_dt.to_dict() + + observation_day = self.observation_day + + is_percentage_priced = self.is_percentage_priced + + cap_percentage = self.cap_percentage + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if root_symbol is not UNSET: + field_dict["rootSymbol"] = root_symbol + if settlement_type is not UNSET: + field_dict["settlementType"] = settlement_type + if expiration_dt is not UNSET: + field_dict["expirationDt"] = expiration_dt + if strike is not UNSET: + field_dict["strike"] = strike + if put_call is not UNSET: + field_dict["putCall"] = put_call + if product_type is not UNSET: + field_dict["productType"] = product_type + if exercise_style is not UNSET: + field_dict["exerciseStyle"] = exercise_style + if creation_dt is not UNSET: + field_dict["creationDt"] = creation_dt + if observation_day is not UNSET: + field_dict["observationDay"] = observation_day + if is_percentage_priced is not UNSET: + field_dict["isPercentagePriced"] = is_percentage_priced + if cap_percentage is not UNSET: + field_dict["capPercentage"] = cap_percentage + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.date import Date + + d = dict(src_dict) + root_symbol = d.pop("rootSymbol", UNSET) + + _settlement_type = d.pop("settlementType", UNSET) + settlement_type: Unset | FlexSettlementType + if isinstance(_settlement_type, Unset): + settlement_type = UNSET + else: + settlement_type = FlexSettlementType(_settlement_type) + + _expiration_dt = d.pop("expirationDt", UNSET) + expiration_dt: Unset | Date + if isinstance(_expiration_dt, Unset): + expiration_dt = UNSET + else: + expiration_dt = Date.from_dict(_expiration_dt) + + strike = d.pop("strike", UNSET) + + _put_call = d.pop("putCall", UNSET) + put_call: Unset | PutCall + if isinstance(_put_call, Unset): + put_call = UNSET + else: + put_call = PutCall(_put_call) + + _product_type = d.pop("productType", UNSET) + product_type: Unset | OptionSeriesProductType + if isinstance(_product_type, Unset): + product_type = UNSET + else: + product_type = OptionSeriesProductType(_product_type) + + _exercise_style = d.pop("exerciseStyle", UNSET) + exercise_style: Unset | OptionExerciseStyle + if isinstance(_exercise_style, Unset): + exercise_style = UNSET + else: + exercise_style = OptionExerciseStyle(_exercise_style) + + _creation_dt = d.pop("creationDt", UNSET) + creation_dt: Unset | Date + if isinstance(_creation_dt, Unset): + creation_dt = UNSET + else: + creation_dt = Date.from_dict(_creation_dt) + + observation_day = d.pop("observationDay", UNSET) + + is_percentage_priced = d.pop("isPercentagePriced", UNSET) + + cap_percentage = d.pop("capPercentage", UNSET) + + create_flex_option_request = cls( + root_symbol=root_symbol, + settlement_type=settlement_type, + expiration_dt=expiration_dt, + strike=strike, + put_call=put_call, + product_type=product_type, + exercise_style=exercise_style, + creation_dt=creation_dt, + observation_day=observation_day, + is_percentage_priced=is_percentage_priced, + cap_percentage=cap_percentage, + ) + + return create_flex_option_request diff --git a/openapi/openapi_project/openapi_package/models/create_flex_option_response.py b/openapi/openapi_project/openapi_package/models/create_flex_option_response.py new file mode 100644 index 000000000..b2228e9e9 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_flex_option_response.py @@ -0,0 +1,79 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.flex_option import FlexOption + + +T = TypeVar("T", bound="CreateFlexOptionResponse") + + +@_attrs_define +class CreateFlexOptionResponse: + """ + Attributes: + flex_option (Union[Unset, FlexOption]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + flex_option: Union[Unset, "FlexOption"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + flex_option: Unset | dict[str, Any] = UNSET + if not isinstance(self.flex_option, Unset): + flex_option = self.flex_option.to_dict() + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if flex_option is not UNSET: + field_dict["flexOption"] = flex_option + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.flex_option import FlexOption + + d = dict(src_dict) + _flex_option = d.pop("flexOption", UNSET) + flex_option: Unset | FlexOption + if isinstance(_flex_option, Unset): + flex_option = UNSET + else: + flex_option = FlexOption.from_dict(_flex_option) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + create_flex_option_response = cls( + flex_option=flex_option, + error_message=error_message, + status_code=status_code, + ) + + return create_flex_option_response diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py new file mode 100644 index 000000000..725e88196 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py @@ -0,0 +1,156 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.cross_side_type import CrossSideType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.clearing_info import ClearingInfo + from ..models.create_multi_leg_order_cross_allocation_optional_data import ( + CreateMultiLegOrderCrossAllocationOptionalData, + ) + from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg + from ..models.order_instruction import OrderInstruction + + +T = TypeVar("T", bound="CreateMultiLegOrderCrossAllocation") + + +@_attrs_define +class CreateMultiLegOrderCrossAllocation: + """ + Attributes: + account_id (Union[Unset, int]): + clearing_info (Union[Unset, ClearingInfo]): + instructions (Union[Unset, list['OrderInstruction']]): + legs (Union[Unset, list['CreateMultiLegOrderLeg']]): + optional_data (Union[Unset, CreateMultiLegOrderCrossAllocationOptionalData]): + qty (Union[Unset, float]): + side_type (Union[Unset, CrossSideType]): + """ + + account_id: Unset | int = UNSET + clearing_info: Union[Unset, "ClearingInfo"] = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + legs: Unset | list["CreateMultiLegOrderLeg"] = UNSET + optional_data: Union[Unset, "CreateMultiLegOrderCrossAllocationOptionalData"] = ( + UNSET + ) + qty: Unset | float = UNSET + side_type: Unset | CrossSideType = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + clearing_info: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_info, Unset): + clearing_info = self.clearing_info.to_dict() + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + legs: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.legs, Unset): + legs = [] + for legs_item_data in self.legs: + legs_item = legs_item_data.to_dict() + legs.append(legs_item) + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + qty = self.qty + + side_type: Unset | str = UNSET + if not isinstance(self.side_type, Unset): + side_type = self.side_type.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if clearing_info is not UNSET: + field_dict["clearingInfo"] = clearing_info + if instructions is not UNSET: + field_dict["instructions"] = instructions + if legs is not UNSET: + field_dict["legs"] = legs + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if qty is not UNSET: + field_dict["qty"] = qty + if side_type is not UNSET: + field_dict["sideType"] = side_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.clearing_info import ClearingInfo + from ..models.create_multi_leg_order_cross_allocation_optional_data import ( + CreateMultiLegOrderCrossAllocationOptionalData, + ) + from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg + from ..models.order_instruction import OrderInstruction + + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + _clearing_info = d.pop("clearingInfo", UNSET) + clearing_info: Unset | ClearingInfo + if isinstance(_clearing_info, Unset): + clearing_info = UNSET + else: + clearing_info = ClearingInfo.from_dict(_clearing_info) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + legs = [] + _legs = d.pop("legs", UNSET) + for legs_item_data in _legs or []: + legs_item = CreateMultiLegOrderLeg.from_dict(legs_item_data) + + legs.append(legs_item) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | CreateMultiLegOrderCrossAllocationOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = CreateMultiLegOrderCrossAllocationOptionalData.from_dict( + _optional_data + ) + + qty = d.pop("qty", UNSET) + + _side_type = d.pop("sideType", UNSET) + side_type: Unset | CrossSideType + if isinstance(_side_type, Unset): + side_type = UNSET + else: + side_type = CrossSideType(_side_type) + + create_multi_leg_order_cross_allocation = cls( + account_id=account_id, + clearing_info=clearing_info, + instructions=instructions, + legs=legs, + optional_data=optional_data, + qty=qty, + side_type=side_type, + ) + + return create_multi_leg_order_cross_allocation diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py new file mode 100644 index 000000000..64af0aa54 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CreateMultiLegOrderCrossAllocationOptionalData") + + +@_attrs_define +class CreateMultiLegOrderCrossAllocationOptionalData: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_multi_leg_order_cross_allocation_optional_data = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_multi_leg_order_cross_allocation_optional_data.additional_properties = ( + additional_properties + ) + return create_multi_leg_order_cross_allocation_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py new file mode 100644 index 000000000..e5c84b370 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py @@ -0,0 +1,295 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.cross_type import CrossType +from ..models.ord_type import OrdType +from ..models.price_type import PriceType +from ..models.tif import Tif +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.create_multi_leg_order_cross_allocation import ( + CreateMultiLegOrderCrossAllocation, + ) + from ..models.create_multi_leg_order_cross_request_algo import ( + CreateMultiLegOrderCrossRequestAlgo, + ) + from ..models.create_multi_leg_order_cross_request_market_condition import ( + CreateMultiLegOrderCrossRequestMarketCondition, + ) + from ..models.create_multi_leg_order_cross_request_optional_data import ( + CreateMultiLegOrderCrossRequestOptionalData, + ) + from ..models.order_instruction import OrderInstruction + + +T = TypeVar("T", bound="CreateMultiLegOrderCrossRequest") + + +@_attrs_define +class CreateMultiLegOrderCrossRequest: + """ + Attributes: + account_id (Union[Unset, int]): + allocations (Union[Unset, list['CreateMultiLegOrderCrossAllocation']]): + cross_type (Union[Unset, CrossType]): + instructions (Union[Unset, list['OrderInstruction']]): + ord_type (Union[Unset, OrdType]): + order_flags (Union[Unset, int]): + parent_ord_id (Union[Unset, str]): + price (Union[Unset, float]): + price_type (Union[Unset, PriceType]): + qty (Union[Unset, float]): + route (Union[Unset, str]): + tag (Union[Unset, str]): + text (Union[Unset, str]): + tif (Union[Unset, Tif]): + algo (Union[Unset, CreateMultiLegOrderCrossRequestAlgo]): + market_condition (Union[Unset, CreateMultiLegOrderCrossRequestMarketCondition]): + optional_data (Union[Unset, CreateMultiLegOrderCrossRequestOptionalData]): + """ + + account_id: Unset | int = UNSET + allocations: Unset | list["CreateMultiLegOrderCrossAllocation"] = UNSET + cross_type: Unset | CrossType = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + ord_type: Unset | OrdType = UNSET + order_flags: Unset | int = UNSET + parent_ord_id: Unset | str = UNSET + price: Unset | float = UNSET + price_type: Unset | PriceType = UNSET + qty: Unset | float = UNSET + route: Unset | str = UNSET + tag: Unset | str = UNSET + text: Unset | str = UNSET + tif: Unset | Tif = UNSET + algo: Union[Unset, "CreateMultiLegOrderCrossRequestAlgo"] = UNSET + market_condition: Union[Unset, "CreateMultiLegOrderCrossRequestMarketCondition"] = ( + UNSET + ) + optional_data: Union[Unset, "CreateMultiLegOrderCrossRequestOptionalData"] = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + allocations: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.allocations, Unset): + allocations = [] + for allocations_item_data in self.allocations: + allocations_item = allocations_item_data.to_dict() + allocations.append(allocations_item) + + cross_type: Unset | str = UNSET + if not isinstance(self.cross_type, Unset): + cross_type = self.cross_type.value + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + order_flags = self.order_flags + + parent_ord_id = self.parent_ord_id + + price = self.price + + price_type: Unset | str = UNSET + if not isinstance(self.price_type, Unset): + price_type = self.price_type.value + + qty = self.qty + + route = self.route + + tag = self.tag + + text = self.text + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + algo: Unset | dict[str, Any] = UNSET + if not isinstance(self.algo, Unset): + algo = self.algo.to_dict() + + market_condition: Unset | dict[str, Any] = UNSET + if not isinstance(self.market_condition, Unset): + market_condition = self.market_condition.to_dict() + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if allocations is not UNSET: + field_dict["allocations"] = allocations + if cross_type is not UNSET: + field_dict["crossType"] = cross_type + if instructions is not UNSET: + field_dict["instructions"] = instructions + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if order_flags is not UNSET: + field_dict["orderFlags"] = order_flags + if parent_ord_id is not UNSET: + field_dict["parentOrdId"] = parent_ord_id + if price is not UNSET: + field_dict["price"] = price + if price_type is not UNSET: + field_dict["priceType"] = price_type + if qty is not UNSET: + field_dict["qty"] = qty + if route is not UNSET: + field_dict["route"] = route + if tag is not UNSET: + field_dict["tag"] = tag + if text is not UNSET: + field_dict["text"] = text + if tif is not UNSET: + field_dict["tif"] = tif + if algo is not UNSET: + field_dict["algo"] = algo + if market_condition is not UNSET: + field_dict["marketCondition"] = market_condition + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.create_multi_leg_order_cross_allocation import ( + CreateMultiLegOrderCrossAllocation, + ) + from ..models.create_multi_leg_order_cross_request_algo import ( + CreateMultiLegOrderCrossRequestAlgo, + ) + from ..models.create_multi_leg_order_cross_request_market_condition import ( + CreateMultiLegOrderCrossRequestMarketCondition, + ) + from ..models.create_multi_leg_order_cross_request_optional_data import ( + CreateMultiLegOrderCrossRequestOptionalData, + ) + from ..models.order_instruction import OrderInstruction + + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + allocations = [] + _allocations = d.pop("allocations", UNSET) + for allocations_item_data in _allocations or []: + allocations_item = CreateMultiLegOrderCrossAllocation.from_dict( + allocations_item_data + ) + + allocations.append(allocations_item) + + _cross_type = d.pop("crossType", UNSET) + cross_type: Unset | CrossType + if isinstance(_cross_type, Unset): + cross_type = UNSET + else: + cross_type = CrossType(_cross_type) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + order_flags = d.pop("orderFlags", UNSET) + + parent_ord_id = d.pop("parentOrdId", UNSET) + + price = d.pop("price", UNSET) + + _price_type = d.pop("priceType", UNSET) + price_type: Unset | PriceType + if isinstance(_price_type, Unset): + price_type = UNSET + else: + price_type = PriceType(_price_type) + + qty = d.pop("qty", UNSET) + + route = d.pop("route", UNSET) + + tag = d.pop("tag", UNSET) + + text = d.pop("text", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + _algo = d.pop("algo", UNSET) + algo: Unset | CreateMultiLegOrderCrossRequestAlgo + if isinstance(_algo, Unset): + algo = UNSET + else: + algo = CreateMultiLegOrderCrossRequestAlgo.from_dict(_algo) + + _market_condition = d.pop("marketCondition", UNSET) + market_condition: Unset | CreateMultiLegOrderCrossRequestMarketCondition + if isinstance(_market_condition, Unset): + market_condition = UNSET + else: + market_condition = CreateMultiLegOrderCrossRequestMarketCondition.from_dict( + _market_condition + ) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | CreateMultiLegOrderCrossRequestOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = CreateMultiLegOrderCrossRequestOptionalData.from_dict( + _optional_data + ) + + create_multi_leg_order_cross_request = cls( + account_id=account_id, + allocations=allocations, + cross_type=cross_type, + instructions=instructions, + ord_type=ord_type, + order_flags=order_flags, + parent_ord_id=parent_ord_id, + price=price, + price_type=price_type, + qty=qty, + route=route, + tag=tag, + text=text, + tif=tif, + algo=algo, + market_condition=market_condition, + optional_data=optional_data, + ) + + return create_multi_leg_order_cross_request diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py new file mode 100644 index 000000000..88bb3a5a9 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CreateMultiLegOrderCrossRequestAlgo") + + +@_attrs_define +class CreateMultiLegOrderCrossRequestAlgo: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_multi_leg_order_cross_request_algo = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_multi_leg_order_cross_request_algo.additional_properties = ( + additional_properties + ) + return create_multi_leg_order_cross_request_algo + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py new file mode 100644 index 000000000..4ed3fccd0 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CreateMultiLegOrderCrossRequestMarketCondition") + + +@_attrs_define +class CreateMultiLegOrderCrossRequestMarketCondition: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_multi_leg_order_cross_request_market_condition = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_multi_leg_order_cross_request_market_condition.additional_properties = ( + additional_properties + ) + return create_multi_leg_order_cross_request_market_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py new file mode 100644 index 000000000..0106a37a4 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CreateMultiLegOrderCrossRequestOptionalData") + + +@_attrs_define +class CreateMultiLegOrderCrossRequestOptionalData: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_multi_leg_order_cross_request_optional_data = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_multi_leg_order_cross_request_optional_data.additional_properties = ( + additional_properties + ) + return create_multi_leg_order_cross_request_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py new file mode 100644 index 000000000..9ad3d858a --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py @@ -0,0 +1,79 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.multi_leg_order_cross import MultiLegOrderCross + + +T = TypeVar("T", bound="CreateMultiLegOrderCrossResponse") + + +@_attrs_define +class CreateMultiLegOrderCrossResponse: + """ + Attributes: + multi_leg_order_cross (Union[Unset, MultiLegOrderCross]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + multi_leg_order_cross: Union[Unset, "MultiLegOrderCross"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + multi_leg_order_cross: Unset | dict[str, Any] = UNSET + if not isinstance(self.multi_leg_order_cross, Unset): + multi_leg_order_cross = self.multi_leg_order_cross.to_dict() + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if multi_leg_order_cross is not UNSET: + field_dict["multiLegOrderCross"] = multi_leg_order_cross + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.multi_leg_order_cross import MultiLegOrderCross + + d = dict(src_dict) + _multi_leg_order_cross = d.pop("multiLegOrderCross", UNSET) + multi_leg_order_cross: Unset | MultiLegOrderCross + if isinstance(_multi_leg_order_cross, Unset): + multi_leg_order_cross = UNSET + else: + multi_leg_order_cross = MultiLegOrderCross.from_dict(_multi_leg_order_cross) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + create_multi_leg_order_cross_response = cls( + multi_leg_order_cross=multi_leg_order_cross, + error_message=error_message, + status_code=status_code, + ) + + return create_multi_leg_order_cross_response diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_leg.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_leg.py new file mode 100644 index 000000000..aec64ad46 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_leg.py @@ -0,0 +1,160 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.position_effect import PositionEffect +from ..models.side import Side +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.create_multi_leg_order_leg_market_condition import ( + CreateMultiLegOrderLegMarketCondition, + ) + from ..models.create_multi_leg_order_leg_optional_data import ( + CreateMultiLegOrderLegOptionalData, + ) + from ..models.flex_option import FlexOption + + +T = TypeVar("T", bound="CreateMultiLegOrderLeg") + + +@_attrs_define +class CreateMultiLegOrderLeg: + """ + Attributes: + position_effect (Union[Unset, PositionEffect]): + price (Union[Unset, float]): + ratio (Union[Unset, int]): + side (Union[Unset, Side]): + symbol (Union[Unset, str]): + market_condition (Union[Unset, CreateMultiLegOrderLegMarketCondition]): + optional_data (Union[Unset, CreateMultiLegOrderLegOptionalData]): + flex_option (Union[Unset, FlexOption]): + """ + + position_effect: Unset | PositionEffect = UNSET + price: Unset | float = UNSET + ratio: Unset | int = UNSET + side: Unset | Side = UNSET + symbol: Unset | str = UNSET + market_condition: Union[Unset, "CreateMultiLegOrderLegMarketCondition"] = UNSET + optional_data: Union[Unset, "CreateMultiLegOrderLegOptionalData"] = UNSET + flex_option: Union[Unset, "FlexOption"] = UNSET + + def to_dict(self) -> dict[str, Any]: + position_effect: Unset | str = UNSET + if not isinstance(self.position_effect, Unset): + position_effect = self.position_effect.value + + price = self.price + + ratio = self.ratio + + side: Unset | str = UNSET + if not isinstance(self.side, Unset): + side = self.side.value + + symbol = self.symbol + + market_condition: Unset | dict[str, Any] = UNSET + if not isinstance(self.market_condition, Unset): + market_condition = self.market_condition.to_dict() + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + flex_option: Unset | dict[str, Any] = UNSET + if not isinstance(self.flex_option, Unset): + flex_option = self.flex_option.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if position_effect is not UNSET: + field_dict["positionEffect"] = position_effect + if price is not UNSET: + field_dict["price"] = price + if ratio is not UNSET: + field_dict["ratio"] = ratio + if side is not UNSET: + field_dict["side"] = side + if symbol is not UNSET: + field_dict["symbol"] = symbol + if market_condition is not UNSET: + field_dict["marketCondition"] = market_condition + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if flex_option is not UNSET: + field_dict["flexOption"] = flex_option + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.create_multi_leg_order_leg_market_condition import ( + CreateMultiLegOrderLegMarketCondition, + ) + from ..models.create_multi_leg_order_leg_optional_data import ( + CreateMultiLegOrderLegOptionalData, + ) + from ..models.flex_option import FlexOption + + d = dict(src_dict) + _position_effect = d.pop("positionEffect", UNSET) + position_effect: Unset | PositionEffect + if isinstance(_position_effect, Unset): + position_effect = UNSET + else: + position_effect = PositionEffect(_position_effect) + + price = d.pop("price", UNSET) + + ratio = d.pop("ratio", UNSET) + + _side = d.pop("side", UNSET) + side: Unset | Side + if isinstance(_side, Unset): + side = UNSET + else: + side = Side(_side) + + symbol = d.pop("symbol", UNSET) + + _market_condition = d.pop("marketCondition", UNSET) + market_condition: Unset | CreateMultiLegOrderLegMarketCondition + if isinstance(_market_condition, Unset): + market_condition = UNSET + else: + market_condition = CreateMultiLegOrderLegMarketCondition.from_dict( + _market_condition + ) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | CreateMultiLegOrderLegOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = CreateMultiLegOrderLegOptionalData.from_dict(_optional_data) + + _flex_option = d.pop("flexOption", UNSET) + flex_option: Unset | FlexOption + if isinstance(_flex_option, Unset): + flex_option = UNSET + else: + flex_option = FlexOption.from_dict(_flex_option) + + create_multi_leg_order_leg = cls( + position_effect=position_effect, + price=price, + ratio=ratio, + side=side, + symbol=symbol, + market_condition=market_condition, + optional_data=optional_data, + flex_option=flex_option, + ) + + return create_multi_leg_order_leg diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py new file mode 100644 index 000000000..dc7f302a5 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CreateMultiLegOrderLegMarketCondition") + + +@_attrs_define +class CreateMultiLegOrderLegMarketCondition: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_multi_leg_order_leg_market_condition = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_multi_leg_order_leg_market_condition.additional_properties = ( + additional_properties + ) + return create_multi_leg_order_leg_market_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py new file mode 100644 index 000000000..c2abc7171 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CreateMultiLegOrderLegOptionalData") + + +@_attrs_define +class CreateMultiLegOrderLegOptionalData: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_multi_leg_order_leg_optional_data = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_multi_leg_order_leg_optional_data.additional_properties = ( + additional_properties + ) + return create_multi_leg_order_leg_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_request.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_request.py new file mode 100644 index 000000000..3a04056b6 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_request.py @@ -0,0 +1,297 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.ord_type import OrdType +from ..models.price_type import PriceType +from ..models.tif import Tif +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.clearing_info import ClearingInfo + from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg + from ..models.create_multi_leg_order_request_algo import ( + CreateMultiLegOrderRequestAlgo, + ) + from ..models.create_multi_leg_order_request_market_condition import ( + CreateMultiLegOrderRequestMarketCondition, + ) + from ..models.create_multi_leg_order_request_optional_data import ( + CreateMultiLegOrderRequestOptionalData, + ) + from ..models.order_instruction import OrderInstruction + + +T = TypeVar("T", bound="CreateMultiLegOrderRequest") + + +@_attrs_define +class CreateMultiLegOrderRequest: + """ + Attributes: + account_id (Union[Unset, int]): + aux_price (Union[Unset, float]): + clearing_info (Union[Unset, ClearingInfo]): + instructions (Union[Unset, list['OrderInstruction']]): + legs (Union[Unset, list['CreateMultiLegOrderLeg']]): + ord_type (Union[Unset, OrdType]): + order_flags (Union[Unset, int]): + parent_ord_id (Union[Unset, str]): + price (Union[Unset, float]): + price_type (Union[Unset, PriceType]): + qty (Union[Unset, float]): + route (Union[Unset, str]): + tag (Union[Unset, str]): + text (Union[Unset, str]): + tif (Union[Unset, Tif]): + algo (Union[Unset, CreateMultiLegOrderRequestAlgo]): + market_condition (Union[Unset, CreateMultiLegOrderRequestMarketCondition]): + optional_data (Union[Unset, CreateMultiLegOrderRequestOptionalData]): + """ + + account_id: Unset | int = UNSET + aux_price: Unset | float = UNSET + clearing_info: Union[Unset, "ClearingInfo"] = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + legs: Unset | list["CreateMultiLegOrderLeg"] = UNSET + ord_type: Unset | OrdType = UNSET + order_flags: Unset | int = UNSET + parent_ord_id: Unset | str = UNSET + price: Unset | float = UNSET + price_type: Unset | PriceType = UNSET + qty: Unset | float = UNSET + route: Unset | str = UNSET + tag: Unset | str = UNSET + text: Unset | str = UNSET + tif: Unset | Tif = UNSET + algo: Union[Unset, "CreateMultiLegOrderRequestAlgo"] = UNSET + market_condition: Union[Unset, "CreateMultiLegOrderRequestMarketCondition"] = UNSET + optional_data: Union[Unset, "CreateMultiLegOrderRequestOptionalData"] = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + aux_price = self.aux_price + + clearing_info: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_info, Unset): + clearing_info = self.clearing_info.to_dict() + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + legs: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.legs, Unset): + legs = [] + for legs_item_data in self.legs: + legs_item = legs_item_data.to_dict() + legs.append(legs_item) + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + order_flags = self.order_flags + + parent_ord_id = self.parent_ord_id + + price = self.price + + price_type: Unset | str = UNSET + if not isinstance(self.price_type, Unset): + price_type = self.price_type.value + + qty = self.qty + + route = self.route + + tag = self.tag + + text = self.text + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + algo: Unset | dict[str, Any] = UNSET + if not isinstance(self.algo, Unset): + algo = self.algo.to_dict() + + market_condition: Unset | dict[str, Any] = UNSET + if not isinstance(self.market_condition, Unset): + market_condition = self.market_condition.to_dict() + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if aux_price is not UNSET: + field_dict["auxPrice"] = aux_price + if clearing_info is not UNSET: + field_dict["clearingInfo"] = clearing_info + if instructions is not UNSET: + field_dict["instructions"] = instructions + if legs is not UNSET: + field_dict["legs"] = legs + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if order_flags is not UNSET: + field_dict["orderFlags"] = order_flags + if parent_ord_id is not UNSET: + field_dict["parentOrdId"] = parent_ord_id + if price is not UNSET: + field_dict["price"] = price + if price_type is not UNSET: + field_dict["priceType"] = price_type + if qty is not UNSET: + field_dict["qty"] = qty + if route is not UNSET: + field_dict["route"] = route + if tag is not UNSET: + field_dict["tag"] = tag + if text is not UNSET: + field_dict["text"] = text + if tif is not UNSET: + field_dict["tif"] = tif + if algo is not UNSET: + field_dict["algo"] = algo + if market_condition is not UNSET: + field_dict["marketCondition"] = market_condition + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.clearing_info import ClearingInfo + from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg + from ..models.create_multi_leg_order_request_algo import ( + CreateMultiLegOrderRequestAlgo, + ) + from ..models.create_multi_leg_order_request_market_condition import ( + CreateMultiLegOrderRequestMarketCondition, + ) + from ..models.create_multi_leg_order_request_optional_data import ( + CreateMultiLegOrderRequestOptionalData, + ) + from ..models.order_instruction import OrderInstruction + + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + aux_price = d.pop("auxPrice", UNSET) + + _clearing_info = d.pop("clearingInfo", UNSET) + clearing_info: Unset | ClearingInfo + if isinstance(_clearing_info, Unset): + clearing_info = UNSET + else: + clearing_info = ClearingInfo.from_dict(_clearing_info) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + legs = [] + _legs = d.pop("legs", UNSET) + for legs_item_data in _legs or []: + legs_item = CreateMultiLegOrderLeg.from_dict(legs_item_data) + + legs.append(legs_item) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + order_flags = d.pop("orderFlags", UNSET) + + parent_ord_id = d.pop("parentOrdId", UNSET) + + price = d.pop("price", UNSET) + + _price_type = d.pop("priceType", UNSET) + price_type: Unset | PriceType + if isinstance(_price_type, Unset): + price_type = UNSET + else: + price_type = PriceType(_price_type) + + qty = d.pop("qty", UNSET) + + route = d.pop("route", UNSET) + + tag = d.pop("tag", UNSET) + + text = d.pop("text", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + _algo = d.pop("algo", UNSET) + algo: Unset | CreateMultiLegOrderRequestAlgo + if isinstance(_algo, Unset): + algo = UNSET + else: + algo = CreateMultiLegOrderRequestAlgo.from_dict(_algo) + + _market_condition = d.pop("marketCondition", UNSET) + market_condition: Unset | CreateMultiLegOrderRequestMarketCondition + if isinstance(_market_condition, Unset): + market_condition = UNSET + else: + market_condition = CreateMultiLegOrderRequestMarketCondition.from_dict( + _market_condition + ) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | CreateMultiLegOrderRequestOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = CreateMultiLegOrderRequestOptionalData.from_dict( + _optional_data + ) + + create_multi_leg_order_request = cls( + account_id=account_id, + aux_price=aux_price, + clearing_info=clearing_info, + instructions=instructions, + legs=legs, + ord_type=ord_type, + order_flags=order_flags, + parent_ord_id=parent_ord_id, + price=price, + price_type=price_type, + qty=qty, + route=route, + tag=tag, + text=text, + tif=tif, + algo=algo, + market_condition=market_condition, + optional_data=optional_data, + ) + + return create_multi_leg_order_request diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py new file mode 100644 index 000000000..1c3365cc6 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CreateMultiLegOrderRequestAlgo") + + +@_attrs_define +class CreateMultiLegOrderRequestAlgo: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_multi_leg_order_request_algo = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_multi_leg_order_request_algo.additional_properties = ( + additional_properties + ) + return create_multi_leg_order_request_algo + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py new file mode 100644 index 000000000..801f1b5d2 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CreateMultiLegOrderRequestMarketCondition") + + +@_attrs_define +class CreateMultiLegOrderRequestMarketCondition: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_multi_leg_order_request_market_condition = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_multi_leg_order_request_market_condition.additional_properties = ( + additional_properties + ) + return create_multi_leg_order_request_market_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py new file mode 100644 index 000000000..80c559ed0 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CreateMultiLegOrderRequestOptionalData") + + +@_attrs_define +class CreateMultiLegOrderRequestOptionalData: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_multi_leg_order_request_optional_data = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_multi_leg_order_request_optional_data.additional_properties = ( + additional_properties + ) + return create_multi_leg_order_request_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_response.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_response.py new file mode 100644 index 000000000..ad2cbc8c1 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_response.py @@ -0,0 +1,79 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.multi_leg_order import MultiLegOrder + + +T = TypeVar("T", bound="CreateMultiLegOrderResponse") + + +@_attrs_define +class CreateMultiLegOrderResponse: + """ + Attributes: + multi_leg_order (Union[Unset, MultiLegOrder]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + multi_leg_order: Union[Unset, "MultiLegOrder"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + multi_leg_order: Unset | dict[str, Any] = UNSET + if not isinstance(self.multi_leg_order, Unset): + multi_leg_order = self.multi_leg_order.to_dict() + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if multi_leg_order is not UNSET: + field_dict["multiLegOrder"] = multi_leg_order + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.multi_leg_order import MultiLegOrder + + d = dict(src_dict) + _multi_leg_order = d.pop("multiLegOrder", UNSET) + multi_leg_order: Unset | MultiLegOrder + if isinstance(_multi_leg_order, Unset): + multi_leg_order = UNSET + else: + multi_leg_order = MultiLegOrder.from_dict(_multi_leg_order) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + create_multi_leg_order_response = cls( + multi_leg_order=multi_leg_order, + error_message=error_message, + status_code=status_code, + ) + + return create_multi_leg_order_response diff --git a/openapi/openapi_project/openapi_package/models/create_order_cross_allocation.py b/openapi/openapi_project/openapi_package/models/create_order_cross_allocation.py new file mode 100644 index 000000000..010d0f3a1 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_order_cross_allocation.py @@ -0,0 +1,167 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.cross_side_type import CrossSideType +from ..models.position_effect import PositionEffect +from ..models.side import Side +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.clearing_info import ClearingInfo + from ..models.create_order_cross_allocation_optional_data import ( + CreateOrderCrossAllocationOptionalData, + ) + from ..models.order_instruction import OrderInstruction + + +T = TypeVar("T", bound="CreateOrderCrossAllocation") + + +@_attrs_define +class CreateOrderCrossAllocation: + """ + Attributes: + account_id (Union[Unset, int]): + clearing_info (Union[Unset, ClearingInfo]): + instructions (Union[Unset, list['OrderInstruction']]): + optional_data (Union[Unset, CreateOrderCrossAllocationOptionalData]): + position_effect (Union[Unset, PositionEffect]): + qty (Union[Unset, float]): + side (Union[Unset, Side]): + side_type (Union[Unset, CrossSideType]): + """ + + account_id: Unset | int = UNSET + clearing_info: Union[Unset, "ClearingInfo"] = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + optional_data: Union[Unset, "CreateOrderCrossAllocationOptionalData"] = UNSET + position_effect: Unset | PositionEffect = UNSET + qty: Unset | float = UNSET + side: Unset | Side = UNSET + side_type: Unset | CrossSideType = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + clearing_info: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_info, Unset): + clearing_info = self.clearing_info.to_dict() + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + position_effect: Unset | str = UNSET + if not isinstance(self.position_effect, Unset): + position_effect = self.position_effect.value + + qty = self.qty + + side: Unset | str = UNSET + if not isinstance(self.side, Unset): + side = self.side.value + + side_type: Unset | str = UNSET + if not isinstance(self.side_type, Unset): + side_type = self.side_type.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if clearing_info is not UNSET: + field_dict["clearingInfo"] = clearing_info + if instructions is not UNSET: + field_dict["instructions"] = instructions + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if position_effect is not UNSET: + field_dict["positionEffect"] = position_effect + if qty is not UNSET: + field_dict["qty"] = qty + if side is not UNSET: + field_dict["side"] = side + if side_type is not UNSET: + field_dict["sideType"] = side_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.clearing_info import ClearingInfo + from ..models.create_order_cross_allocation_optional_data import ( + CreateOrderCrossAllocationOptionalData, + ) + from ..models.order_instruction import OrderInstruction + + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + _clearing_info = d.pop("clearingInfo", UNSET) + clearing_info: Unset | ClearingInfo + if isinstance(_clearing_info, Unset): + clearing_info = UNSET + else: + clearing_info = ClearingInfo.from_dict(_clearing_info) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | CreateOrderCrossAllocationOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = CreateOrderCrossAllocationOptionalData.from_dict( + _optional_data + ) + + _position_effect = d.pop("positionEffect", UNSET) + position_effect: Unset | PositionEffect + if isinstance(_position_effect, Unset): + position_effect = UNSET + else: + position_effect = PositionEffect(_position_effect) + + qty = d.pop("qty", UNSET) + + _side = d.pop("side", UNSET) + side: Unset | Side + if isinstance(_side, Unset): + side = UNSET + else: + side = Side(_side) + + _side_type = d.pop("sideType", UNSET) + side_type: Unset | CrossSideType + if isinstance(_side_type, Unset): + side_type = UNSET + else: + side_type = CrossSideType(_side_type) + + create_order_cross_allocation = cls( + account_id=account_id, + clearing_info=clearing_info, + instructions=instructions, + optional_data=optional_data, + position_effect=position_effect, + qty=qty, + side=side, + side_type=side_type, + ) + + return create_order_cross_allocation diff --git a/openapi/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py b/openapi/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py new file mode 100644 index 000000000..e8bb12c13 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CreateOrderCrossAllocationOptionalData") + + +@_attrs_define +class CreateOrderCrossAllocationOptionalData: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_order_cross_allocation_optional_data = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_order_cross_allocation_optional_data.additional_properties = ( + additional_properties + ) + return create_order_cross_allocation_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_order_cross_request.py b/openapi/openapi_project/openapi_package/models/create_order_cross_request.py new file mode 100644 index 000000000..2c32f1c44 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_order_cross_request.py @@ -0,0 +1,312 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.cross_type import CrossType +from ..models.ord_type import OrdType +from ..models.price_type import PriceType +from ..models.tif import Tif +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.create_order_cross_allocation import CreateOrderCrossAllocation + from ..models.create_order_cross_request_algo import CreateOrderCrossRequestAlgo + from ..models.create_order_cross_request_market_condition import ( + CreateOrderCrossRequestMarketCondition, + ) + from ..models.create_order_cross_request_optional_data import ( + CreateOrderCrossRequestOptionalData, + ) + from ..models.flex_option import FlexOption + from ..models.order_instruction import OrderInstruction + + +T = TypeVar("T", bound="CreateOrderCrossRequest") + + +@_attrs_define +class CreateOrderCrossRequest: + """ + Attributes: + account_id (Union[Unset, int]): + allocations (Union[Unset, list['CreateOrderCrossAllocation']]): + cross_type (Union[Unset, CrossType]): + instructions (Union[Unset, list['OrderInstruction']]): + ord_type (Union[Unset, OrdType]): + order_flags (Union[Unset, int]): + parent_ord_id (Union[Unset, str]): + price (Union[Unset, float]): + price_type (Union[Unset, PriceType]): + qty (Union[Unset, float]): + route (Union[Unset, str]): + symbol (Union[Unset, str]): + tag (Union[Unset, str]): + text (Union[Unset, str]): + tif (Union[Unset, Tif]): + algo (Union[Unset, CreateOrderCrossRequestAlgo]): + market_condition (Union[Unset, CreateOrderCrossRequestMarketCondition]): + optional_data (Union[Unset, CreateOrderCrossRequestOptionalData]): + flex_option (Union[Unset, FlexOption]): + """ + + account_id: Unset | int = UNSET + allocations: Unset | list["CreateOrderCrossAllocation"] = UNSET + cross_type: Unset | CrossType = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + ord_type: Unset | OrdType = UNSET + order_flags: Unset | int = UNSET + parent_ord_id: Unset | str = UNSET + price: Unset | float = UNSET + price_type: Unset | PriceType = UNSET + qty: Unset | float = UNSET + route: Unset | str = UNSET + symbol: Unset | str = UNSET + tag: Unset | str = UNSET + text: Unset | str = UNSET + tif: Unset | Tif = UNSET + algo: Union[Unset, "CreateOrderCrossRequestAlgo"] = UNSET + market_condition: Union[Unset, "CreateOrderCrossRequestMarketCondition"] = UNSET + optional_data: Union[Unset, "CreateOrderCrossRequestOptionalData"] = UNSET + flex_option: Union[Unset, "FlexOption"] = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + allocations: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.allocations, Unset): + allocations = [] + for allocations_item_data in self.allocations: + allocations_item = allocations_item_data.to_dict() + allocations.append(allocations_item) + + cross_type: Unset | str = UNSET + if not isinstance(self.cross_type, Unset): + cross_type = self.cross_type.value + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + order_flags = self.order_flags + + parent_ord_id = self.parent_ord_id + + price = self.price + + price_type: Unset | str = UNSET + if not isinstance(self.price_type, Unset): + price_type = self.price_type.value + + qty = self.qty + + route = self.route + + symbol = self.symbol + + tag = self.tag + + text = self.text + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + algo: Unset | dict[str, Any] = UNSET + if not isinstance(self.algo, Unset): + algo = self.algo.to_dict() + + market_condition: Unset | dict[str, Any] = UNSET + if not isinstance(self.market_condition, Unset): + market_condition = self.market_condition.to_dict() + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + flex_option: Unset | dict[str, Any] = UNSET + if not isinstance(self.flex_option, Unset): + flex_option = self.flex_option.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if allocations is not UNSET: + field_dict["allocations"] = allocations + if cross_type is not UNSET: + field_dict["crossType"] = cross_type + if instructions is not UNSET: + field_dict["instructions"] = instructions + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if order_flags is not UNSET: + field_dict["orderFlags"] = order_flags + if parent_ord_id is not UNSET: + field_dict["parentOrdId"] = parent_ord_id + if price is not UNSET: + field_dict["price"] = price + if price_type is not UNSET: + field_dict["priceType"] = price_type + if qty is not UNSET: + field_dict["qty"] = qty + if route is not UNSET: + field_dict["route"] = route + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tag is not UNSET: + field_dict["tag"] = tag + if text is not UNSET: + field_dict["text"] = text + if tif is not UNSET: + field_dict["tif"] = tif + if algo is not UNSET: + field_dict["algo"] = algo + if market_condition is not UNSET: + field_dict["marketCondition"] = market_condition + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if flex_option is not UNSET: + field_dict["flexOption"] = flex_option + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.create_order_cross_allocation import CreateOrderCrossAllocation + from ..models.create_order_cross_request_algo import CreateOrderCrossRequestAlgo + from ..models.create_order_cross_request_market_condition import ( + CreateOrderCrossRequestMarketCondition, + ) + from ..models.create_order_cross_request_optional_data import ( + CreateOrderCrossRequestOptionalData, + ) + from ..models.flex_option import FlexOption + from ..models.order_instruction import OrderInstruction + + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + allocations = [] + _allocations = d.pop("allocations", UNSET) + for allocations_item_data in _allocations or []: + allocations_item = CreateOrderCrossAllocation.from_dict( + allocations_item_data + ) + + allocations.append(allocations_item) + + _cross_type = d.pop("crossType", UNSET) + cross_type: Unset | CrossType + if isinstance(_cross_type, Unset): + cross_type = UNSET + else: + cross_type = CrossType(_cross_type) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + order_flags = d.pop("orderFlags", UNSET) + + parent_ord_id = d.pop("parentOrdId", UNSET) + + price = d.pop("price", UNSET) + + _price_type = d.pop("priceType", UNSET) + price_type: Unset | PriceType + if isinstance(_price_type, Unset): + price_type = UNSET + else: + price_type = PriceType(_price_type) + + qty = d.pop("qty", UNSET) + + route = d.pop("route", UNSET) + + symbol = d.pop("symbol", UNSET) + + tag = d.pop("tag", UNSET) + + text = d.pop("text", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + _algo = d.pop("algo", UNSET) + algo: Unset | CreateOrderCrossRequestAlgo + if isinstance(_algo, Unset): + algo = UNSET + else: + algo = CreateOrderCrossRequestAlgo.from_dict(_algo) + + _market_condition = d.pop("marketCondition", UNSET) + market_condition: Unset | CreateOrderCrossRequestMarketCondition + if isinstance(_market_condition, Unset): + market_condition = UNSET + else: + market_condition = CreateOrderCrossRequestMarketCondition.from_dict( + _market_condition + ) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | CreateOrderCrossRequestOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = CreateOrderCrossRequestOptionalData.from_dict( + _optional_data + ) + + _flex_option = d.pop("flexOption", UNSET) + flex_option: Unset | FlexOption + if isinstance(_flex_option, Unset): + flex_option = UNSET + else: + flex_option = FlexOption.from_dict(_flex_option) + + create_order_cross_request = cls( + account_id=account_id, + allocations=allocations, + cross_type=cross_type, + instructions=instructions, + ord_type=ord_type, + order_flags=order_flags, + parent_ord_id=parent_ord_id, + price=price, + price_type=price_type, + qty=qty, + route=route, + symbol=symbol, + tag=tag, + text=text, + tif=tif, + algo=algo, + market_condition=market_condition, + optional_data=optional_data, + flex_option=flex_option, + ) + + return create_order_cross_request diff --git a/openapi/openapi_project/openapi_package/models/create_order_cross_request_algo.py b/openapi/openapi_project/openapi_package/models/create_order_cross_request_algo.py new file mode 100644 index 000000000..aa0a3120d --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_order_cross_request_algo.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CreateOrderCrossRequestAlgo") + + +@_attrs_define +class CreateOrderCrossRequestAlgo: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_order_cross_request_algo = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_order_cross_request_algo.additional_properties = additional_properties + return create_order_cross_request_algo + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py b/openapi/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py new file mode 100644 index 000000000..ee5a05afd --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CreateOrderCrossRequestMarketCondition") + + +@_attrs_define +class CreateOrderCrossRequestMarketCondition: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_order_cross_request_market_condition = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_order_cross_request_market_condition.additional_properties = ( + additional_properties + ) + return create_order_cross_request_market_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py b/openapi/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py new file mode 100644 index 000000000..1ab09a7be --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CreateOrderCrossRequestOptionalData") + + +@_attrs_define +class CreateOrderCrossRequestOptionalData: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_order_cross_request_optional_data = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_order_cross_request_optional_data.additional_properties = ( + additional_properties + ) + return create_order_cross_request_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_order_cross_response.py b/openapi/openapi_project/openapi_package/models/create_order_cross_response.py new file mode 100644 index 000000000..483b9cd65 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_order_cross_response.py @@ -0,0 +1,79 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.order_cross import OrderCross + + +T = TypeVar("T", bound="CreateOrderCrossResponse") + + +@_attrs_define +class CreateOrderCrossResponse: + """ + Attributes: + order_cross (Union[Unset, OrderCross]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + order_cross: Union[Unset, "OrderCross"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + order_cross: Unset | dict[str, Any] = UNSET + if not isinstance(self.order_cross, Unset): + order_cross = self.order_cross.to_dict() + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if order_cross is not UNSET: + field_dict["orderCross"] = order_cross + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.order_cross import OrderCross + + d = dict(src_dict) + _order_cross = d.pop("orderCross", UNSET) + order_cross: Unset | OrderCross + if isinstance(_order_cross, Unset): + order_cross = UNSET + else: + order_cross = OrderCross.from_dict(_order_cross) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + create_order_cross_response = cls( + order_cross=order_cross, + error_message=error_message, + status_code=status_code, + ) + + return create_order_cross_response diff --git a/openapi/openapi_project/openapi_package/models/create_order_request.py b/openapi/openapi_project/openapi_package/models/create_order_request.py new file mode 100644 index 000000000..21fdadd88 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_order_request.py @@ -0,0 +1,331 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.ord_type import OrdType +from ..models.position_effect import PositionEffect +from ..models.price_type import PriceType +from ..models.side import Side +from ..models.tif import Tif +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.clearing_info import ClearingInfo + from ..models.create_order_request_algo import CreateOrderRequestAlgo + from ..models.create_order_request_market_condition import ( + CreateOrderRequestMarketCondition, + ) + from ..models.create_order_request_optional_data import ( + CreateOrderRequestOptionalData, + ) + from ..models.flex_option import FlexOption + from ..models.order_instruction import OrderInstruction + + +T = TypeVar("T", bound="CreateOrderRequest") + + +@_attrs_define +class CreateOrderRequest: + """ + Attributes: + account_id (Union[Unset, int]): + aux_price (Union[Unset, float]): + clearing_info (Union[Unset, ClearingInfo]): + instructions (Union[Unset, list['OrderInstruction']]): + ord_type (Union[Unset, OrdType]): + order_flags (Union[Unset, int]): + parent_ord_id (Union[Unset, str]): + position_effect (Union[Unset, PositionEffect]): + price (Union[Unset, float]): + price_type (Union[Unset, PriceType]): + qty (Union[Unset, float]): + route (Union[Unset, str]): + side (Union[Unset, Side]): + symbol (Union[Unset, str]): + tag (Union[Unset, str]): + text (Union[Unset, str]): + tif (Union[Unset, Tif]): + algo (Union[Unset, CreateOrderRequestAlgo]): + market_condition (Union[Unset, CreateOrderRequestMarketCondition]): + optional_data (Union[Unset, CreateOrderRequestOptionalData]): + flex_option (Union[Unset, FlexOption]): + """ + + account_id: Unset | int = UNSET + aux_price: Unset | float = UNSET + clearing_info: Union[Unset, "ClearingInfo"] = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + ord_type: Unset | OrdType = UNSET + order_flags: Unset | int = UNSET + parent_ord_id: Unset | str = UNSET + position_effect: Unset | PositionEffect = UNSET + price: Unset | float = UNSET + price_type: Unset | PriceType = UNSET + qty: Unset | float = UNSET + route: Unset | str = UNSET + side: Unset | Side = UNSET + symbol: Unset | str = UNSET + tag: Unset | str = UNSET + text: Unset | str = UNSET + tif: Unset | Tif = UNSET + algo: Union[Unset, "CreateOrderRequestAlgo"] = UNSET + market_condition: Union[Unset, "CreateOrderRequestMarketCondition"] = UNSET + optional_data: Union[Unset, "CreateOrderRequestOptionalData"] = UNSET + flex_option: Union[Unset, "FlexOption"] = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + aux_price = self.aux_price + + clearing_info: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_info, Unset): + clearing_info = self.clearing_info.to_dict() + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + order_flags = self.order_flags + + parent_ord_id = self.parent_ord_id + + position_effect: Unset | str = UNSET + if not isinstance(self.position_effect, Unset): + position_effect = self.position_effect.value + + price = self.price + + price_type: Unset | str = UNSET + if not isinstance(self.price_type, Unset): + price_type = self.price_type.value + + qty = self.qty + + route = self.route + + side: Unset | str = UNSET + if not isinstance(self.side, Unset): + side = self.side.value + + symbol = self.symbol + + tag = self.tag + + text = self.text + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + algo: Unset | dict[str, Any] = UNSET + if not isinstance(self.algo, Unset): + algo = self.algo.to_dict() + + market_condition: Unset | dict[str, Any] = UNSET + if not isinstance(self.market_condition, Unset): + market_condition = self.market_condition.to_dict() + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + flex_option: Unset | dict[str, Any] = UNSET + if not isinstance(self.flex_option, Unset): + flex_option = self.flex_option.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if aux_price is not UNSET: + field_dict["auxPrice"] = aux_price + if clearing_info is not UNSET: + field_dict["clearingInfo"] = clearing_info + if instructions is not UNSET: + field_dict["instructions"] = instructions + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if order_flags is not UNSET: + field_dict["orderFlags"] = order_flags + if parent_ord_id is not UNSET: + field_dict["parentOrdId"] = parent_ord_id + if position_effect is not UNSET: + field_dict["positionEffect"] = position_effect + if price is not UNSET: + field_dict["price"] = price + if price_type is not UNSET: + field_dict["priceType"] = price_type + if qty is not UNSET: + field_dict["qty"] = qty + if route is not UNSET: + field_dict["route"] = route + if side is not UNSET: + field_dict["side"] = side + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tag is not UNSET: + field_dict["tag"] = tag + if text is not UNSET: + field_dict["text"] = text + if tif is not UNSET: + field_dict["tif"] = tif + if algo is not UNSET: + field_dict["algo"] = algo + if market_condition is not UNSET: + field_dict["marketCondition"] = market_condition + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if flex_option is not UNSET: + field_dict["flexOption"] = flex_option + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.clearing_info import ClearingInfo + from ..models.create_order_request_algo import CreateOrderRequestAlgo + from ..models.create_order_request_market_condition import ( + CreateOrderRequestMarketCondition, + ) + from ..models.create_order_request_optional_data import ( + CreateOrderRequestOptionalData, + ) + from ..models.flex_option import FlexOption + from ..models.order_instruction import OrderInstruction + + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + aux_price = d.pop("auxPrice", UNSET) + + _clearing_info = d.pop("clearingInfo", UNSET) + clearing_info: Unset | ClearingInfo + if isinstance(_clearing_info, Unset): + clearing_info = UNSET + else: + clearing_info = ClearingInfo.from_dict(_clearing_info) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + order_flags = d.pop("orderFlags", UNSET) + + parent_ord_id = d.pop("parentOrdId", UNSET) + + _position_effect = d.pop("positionEffect", UNSET) + position_effect: Unset | PositionEffect + if isinstance(_position_effect, Unset): + position_effect = UNSET + else: + position_effect = PositionEffect(_position_effect) + + price = d.pop("price", UNSET) + + _price_type = d.pop("priceType", UNSET) + price_type: Unset | PriceType + if isinstance(_price_type, Unset): + price_type = UNSET + else: + price_type = PriceType(_price_type) + + qty = d.pop("qty", UNSET) + + route = d.pop("route", UNSET) + + _side = d.pop("side", UNSET) + side: Unset | Side + if isinstance(_side, Unset): + side = UNSET + else: + side = Side(_side) + + symbol = d.pop("symbol", UNSET) + + tag = d.pop("tag", UNSET) + + text = d.pop("text", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + _algo = d.pop("algo", UNSET) + algo: Unset | CreateOrderRequestAlgo + if isinstance(_algo, Unset): + algo = UNSET + else: + algo = CreateOrderRequestAlgo.from_dict(_algo) + + _market_condition = d.pop("marketCondition", UNSET) + market_condition: Unset | CreateOrderRequestMarketCondition + if isinstance(_market_condition, Unset): + market_condition = UNSET + else: + market_condition = CreateOrderRequestMarketCondition.from_dict( + _market_condition + ) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | CreateOrderRequestOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = CreateOrderRequestOptionalData.from_dict(_optional_data) + + _flex_option = d.pop("flexOption", UNSET) + flex_option: Unset | FlexOption + if isinstance(_flex_option, Unset): + flex_option = UNSET + else: + flex_option = FlexOption.from_dict(_flex_option) + + create_order_request = cls( + account_id=account_id, + aux_price=aux_price, + clearing_info=clearing_info, + instructions=instructions, + ord_type=ord_type, + order_flags=order_flags, + parent_ord_id=parent_ord_id, + position_effect=position_effect, + price=price, + price_type=price_type, + qty=qty, + route=route, + side=side, + symbol=symbol, + tag=tag, + text=text, + tif=tif, + algo=algo, + market_condition=market_condition, + optional_data=optional_data, + flex_option=flex_option, + ) + + return create_order_request diff --git a/openapi/openapi_project/openapi_package/models/create_order_request_algo.py b/openapi/openapi_project/openapi_package/models/create_order_request_algo.py new file mode 100644 index 000000000..e3d00825a --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_order_request_algo.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CreateOrderRequestAlgo") + + +@_attrs_define +class CreateOrderRequestAlgo: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_order_request_algo = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_order_request_algo.additional_properties = additional_properties + return create_order_request_algo + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_order_request_market_condition.py b/openapi/openapi_project/openapi_package/models/create_order_request_market_condition.py new file mode 100644 index 000000000..00153a8a6 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_order_request_market_condition.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CreateOrderRequestMarketCondition") + + +@_attrs_define +class CreateOrderRequestMarketCondition: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_order_request_market_condition = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_order_request_market_condition.additional_properties = ( + additional_properties + ) + return create_order_request_market_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_order_request_optional_data.py b/openapi/openapi_project/openapi_package/models/create_order_request_optional_data.py new file mode 100644 index 000000000..a6246ddf4 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_order_request_optional_data.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CreateOrderRequestOptionalData") + + +@_attrs_define +class CreateOrderRequestOptionalData: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_order_request_optional_data = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_order_request_optional_data.additional_properties = additional_properties + return create_order_request_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_order_response.py b/openapi/openapi_project/openapi_package/models/create_order_response.py new file mode 100644 index 000000000..99cd84e8a --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/create_order_response.py @@ -0,0 +1,79 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.order import Order + + +T = TypeVar("T", bound="CreateOrderResponse") + + +@_attrs_define +class CreateOrderResponse: + """ + Attributes: + order (Union[Unset, Order]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + order: Union[Unset, "Order"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + order: Unset | dict[str, Any] = UNSET + if not isinstance(self.order, Unset): + order = self.order.to_dict() + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if order is not UNSET: + field_dict["order"] = order + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.order import Order + + d = dict(src_dict) + _order = d.pop("order", UNSET) + order: Unset | Order + if isinstance(_order, Unset): + order = UNSET + else: + order = Order.from_dict(_order) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + create_order_response = cls( + order=order, + error_message=error_message, + status_code=status_code, + ) + + return create_order_response diff --git a/openapi/openapi_project/openapi_package/models/cross_side_type.py b/openapi/openapi_project/openapi_package/models/cross_side_type.py new file mode 100644 index 000000000..31e60a925 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/cross_side_type.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class CrossSideType(str, Enum): + CROSS_SIDE_TYPE_AGENCY = "CROSS_SIDE_TYPE_AGENCY" + CROSS_SIDE_TYPE_CONTRA = "CROSS_SIDE_TYPE_CONTRA" + CROSS_SIDE_TYPE_UNDEFINED = "CROSS_SIDE_TYPE_UNDEFINED" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/cross_type.py b/openapi/openapi_project/openapi_package/models/cross_type.py new file mode 100644 index 000000000..41cbd00c3 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/cross_type.py @@ -0,0 +1,20 @@ +from enum import Enum + + +class CrossType(str, Enum): + CROSS_TYPE_AIM = "CROSS_TYPE_AIM" + CROSS_TYPE_BAM = "CROSS_TYPE_BAM" + CROSS_TYPE_C2C = "CROSS_TYPE_C2C" + CROSS_TYPE_FACILITATION = "CROSS_TYPE_FACILITATION" + CROSS_TYPE_MATRIX_CROSS = "CROSS_TYPE_MATRIX_CROSS" + CROSS_TYPE_PCC = "CROSS_TYPE_PCC" + CROSS_TYPE_PIM = "CROSS_TYPE_PIM" + CROSS_TYPE_QCC = "CROSS_TYPE_QCC" + CROSS_TYPE_RFC = "CROSS_TYPE_RFC" + CROSS_TYPE_SAM = "CROSS_TYPE_SAM" + CROSS_TYPE_SWEEP_AND_AIM = "CROSS_TYPE_SWEEP_AND_AIM" + CROSS_TYPE_SWEEP_AND_CROSS = "CROSS_TYPE_SWEEP_AND_CROSS" + CROSS_TYPE_UNDEFINED = "CROSS_TYPE_UNDEFINED" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/crypto.py b/openapi/openapi_project/openapi_package/models/crypto.py new file mode 100644 index 000000000..540b7a745 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/crypto.py @@ -0,0 +1,289 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.currency import Currency +from ..models.exchange_code import ExchangeCode +from ..models.numeric_display_format import NumericDisplayFormat +from ..models.security_category import SecurityCategory +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.crypto_aliases import CryptoAliases + from ..models.date import Date + + +T = TypeVar("T", bound="Crypto") + + +@_attrs_define +class Crypto: + """ + Attributes: + aliases (Union[Unset, CryptoAliases]): + currency (Union[Unset, Currency]): + listed_dt (Union[Unset, Date]): + delisted_dt (Union[Unset, Date]): + description (Union[Unset, str]): + exchange_id (Union[Unset, int]): + id (Union[Unset, int]): + multiplier (Union[Unset, float]): + price_base_factor (Union[Unset, float]): + price_display_factor (Union[Unset, float]): + price_display_format (Union[Unset, NumericDisplayFormat]): + qty_display_factor (Union[Unset, float]): + qty_display_format (Union[Unset, NumericDisplayFormat]): + security_category (Union[Unset, SecurityCategory]): + symbol (Union[Unset, str]): + tick_rule (Union[Unset, str]): + tick_size (Union[Unset, float]): + tick_value (Union[Unset, float]): + traded_exchanges (Union[Unset, list[ExchangeCode]]): + quote_currency (Union[Unset, Currency]): + """ + + aliases: Union[Unset, "CryptoAliases"] = UNSET + currency: Unset | Currency = UNSET + listed_dt: Union[Unset, "Date"] = UNSET + delisted_dt: Union[Unset, "Date"] = UNSET + description: Unset | str = UNSET + exchange_id: Unset | int = UNSET + id: Unset | int = UNSET + multiplier: Unset | float = UNSET + price_base_factor: Unset | float = UNSET + price_display_factor: Unset | float = UNSET + price_display_format: Unset | NumericDisplayFormat = UNSET + qty_display_factor: Unset | float = UNSET + qty_display_format: Unset | NumericDisplayFormat = UNSET + security_category: Unset | SecurityCategory = UNSET + symbol: Unset | str = UNSET + tick_rule: Unset | str = UNSET + tick_size: Unset | float = UNSET + tick_value: Unset | float = UNSET + traded_exchanges: Unset | list[ExchangeCode] = UNSET + quote_currency: Unset | Currency = UNSET + + def to_dict(self) -> dict[str, Any]: + aliases: Unset | dict[str, Any] = UNSET + if not isinstance(self.aliases, Unset): + aliases = self.aliases.to_dict() + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + listed_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.listed_dt, Unset): + listed_dt = self.listed_dt.to_dict() + + delisted_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.delisted_dt, Unset): + delisted_dt = self.delisted_dt.to_dict() + + description = self.description + + exchange_id = self.exchange_id + + id = self.id + + multiplier = self.multiplier + + price_base_factor = self.price_base_factor + + price_display_factor = self.price_display_factor + + price_display_format: Unset | str = UNSET + if not isinstance(self.price_display_format, Unset): + price_display_format = self.price_display_format.value + + qty_display_factor = self.qty_display_factor + + qty_display_format: Unset | str = UNSET + if not isinstance(self.qty_display_format, Unset): + qty_display_format = self.qty_display_format.value + + security_category: Unset | str = UNSET + if not isinstance(self.security_category, Unset): + security_category = self.security_category.value + + symbol = self.symbol + + tick_rule = self.tick_rule + + tick_size = self.tick_size + + tick_value = self.tick_value + + traded_exchanges: Unset | list[str] = UNSET + if not isinstance(self.traded_exchanges, Unset): + traded_exchanges = [] + for traded_exchanges_item_data in self.traded_exchanges: + traded_exchanges_item = traded_exchanges_item_data.value + traded_exchanges.append(traded_exchanges_item) + + quote_currency: Unset | str = UNSET + if not isinstance(self.quote_currency, Unset): + quote_currency = self.quote_currency.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if aliases is not UNSET: + field_dict["aliases"] = aliases + if currency is not UNSET: + field_dict["currency"] = currency + if listed_dt is not UNSET: + field_dict["listedDt"] = listed_dt + if delisted_dt is not UNSET: + field_dict["delistedDt"] = delisted_dt + if description is not UNSET: + field_dict["description"] = description + if exchange_id is not UNSET: + field_dict["exchangeId"] = exchange_id + if id is not UNSET: + field_dict["id"] = id + if multiplier is not UNSET: + field_dict["multiplier"] = multiplier + if price_base_factor is not UNSET: + field_dict["priceBaseFactor"] = price_base_factor + if price_display_factor is not UNSET: + field_dict["priceDisplayFactor"] = price_display_factor + if price_display_format is not UNSET: + field_dict["priceDisplayFormat"] = price_display_format + if qty_display_factor is not UNSET: + field_dict["qtyDisplayFactor"] = qty_display_factor + if qty_display_format is not UNSET: + field_dict["qtyDisplayFormat"] = qty_display_format + if security_category is not UNSET: + field_dict["securityCategory"] = security_category + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tick_rule is not UNSET: + field_dict["tickRule"] = tick_rule + if tick_size is not UNSET: + field_dict["tickSize"] = tick_size + if tick_value is not UNSET: + field_dict["tickValue"] = tick_value + if traded_exchanges is not UNSET: + field_dict["tradedExchanges"] = traded_exchanges + if quote_currency is not UNSET: + field_dict["quoteCurrency"] = quote_currency + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.crypto_aliases import CryptoAliases + from ..models.date import Date + + d = dict(src_dict) + _aliases = d.pop("aliases", UNSET) + aliases: Unset | CryptoAliases + if isinstance(_aliases, Unset): + aliases = UNSET + else: + aliases = CryptoAliases.from_dict(_aliases) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + _listed_dt = d.pop("listedDt", UNSET) + listed_dt: Unset | Date + if isinstance(_listed_dt, Unset): + listed_dt = UNSET + else: + listed_dt = Date.from_dict(_listed_dt) + + _delisted_dt = d.pop("delistedDt", UNSET) + delisted_dt: Unset | Date + if isinstance(_delisted_dt, Unset): + delisted_dt = UNSET + else: + delisted_dt = Date.from_dict(_delisted_dt) + + description = d.pop("description", UNSET) + + exchange_id = d.pop("exchangeId", UNSET) + + id = d.pop("id", UNSET) + + multiplier = d.pop("multiplier", UNSET) + + price_base_factor = d.pop("priceBaseFactor", UNSET) + + price_display_factor = d.pop("priceDisplayFactor", UNSET) + + _price_display_format = d.pop("priceDisplayFormat", UNSET) + price_display_format: Unset | NumericDisplayFormat + if isinstance(_price_display_format, Unset): + price_display_format = UNSET + else: + price_display_format = NumericDisplayFormat(_price_display_format) + + qty_display_factor = d.pop("qtyDisplayFactor", UNSET) + + _qty_display_format = d.pop("qtyDisplayFormat", UNSET) + qty_display_format: Unset | NumericDisplayFormat + if isinstance(_qty_display_format, Unset): + qty_display_format = UNSET + else: + qty_display_format = NumericDisplayFormat(_qty_display_format) + + _security_category = d.pop("securityCategory", UNSET) + security_category: Unset | SecurityCategory + if isinstance(_security_category, Unset): + security_category = UNSET + else: + security_category = SecurityCategory(_security_category) + + symbol = d.pop("symbol", UNSET) + + tick_rule = d.pop("tickRule", UNSET) + + tick_size = d.pop("tickSize", UNSET) + + tick_value = d.pop("tickValue", UNSET) + + traded_exchanges = [] + _traded_exchanges = d.pop("tradedExchanges", UNSET) + for traded_exchanges_item_data in _traded_exchanges or []: + traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) + + traded_exchanges.append(traded_exchanges_item) + + _quote_currency = d.pop("quoteCurrency", UNSET) + quote_currency: Unset | Currency + if isinstance(_quote_currency, Unset): + quote_currency = UNSET + else: + quote_currency = Currency(_quote_currency) + + crypto = cls( + aliases=aliases, + currency=currency, + listed_dt=listed_dt, + delisted_dt=delisted_dt, + description=description, + exchange_id=exchange_id, + id=id, + multiplier=multiplier, + price_base_factor=price_base_factor, + price_display_factor=price_display_factor, + price_display_format=price_display_format, + qty_display_factor=qty_display_factor, + qty_display_format=qty_display_format, + security_category=security_category, + symbol=symbol, + tick_rule=tick_rule, + tick_size=tick_size, + tick_value=tick_value, + traded_exchanges=traded_exchanges, + quote_currency=quote_currency, + ) + + return crypto diff --git a/openapi/openapi_project/openapi_package/models/crypto_aliases.py b/openapi/openapi_project/openapi_package/models/crypto_aliases.py new file mode 100644 index 000000000..b7275e189 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/crypto_aliases.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CryptoAliases") + + +@_attrs_define +class CryptoAliases: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + crypto_aliases = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + crypto_aliases.additional_properties = additional_properties + return crypto_aliases + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/currency.py b/openapi/openapi_project/openapi_package/models/currency.py new file mode 100644 index 000000000..bb1f74189 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/currency.py @@ -0,0 +1,180 @@ +from enum import Enum + + +class Currency(str, Enum): + CURRENCY_AED = "CURRENCY_AED" + CURRENCY_AFN = "CURRENCY_AFN" + CURRENCY_ALL = "CURRENCY_ALL" + CURRENCY_AMD = "CURRENCY_AMD" + CURRENCY_ANG = "CURRENCY_ANG" + CURRENCY_AOA = "CURRENCY_AOA" + CURRENCY_ARS = "CURRENCY_ARS" + CURRENCY_AUD = "CURRENCY_AUD" + CURRENCY_AWG = "CURRENCY_AWG" + CURRENCY_AZN = "CURRENCY_AZN" + CURRENCY_BAM = "CURRENCY_BAM" + CURRENCY_BBD = "CURRENCY_BBD" + CURRENCY_BDT = "CURRENCY_BDT" + CURRENCY_BGN = "CURRENCY_BGN" + CURRENCY_BHD = "CURRENCY_BHD" + CURRENCY_BIF = "CURRENCY_BIF" + CURRENCY_BMD = "CURRENCY_BMD" + CURRENCY_BND = "CURRENCY_BND" + CURRENCY_BOB = "CURRENCY_BOB" + CURRENCY_BRL = "CURRENCY_BRL" + CURRENCY_BSD = "CURRENCY_BSD" + CURRENCY_BTC = "CURRENCY_BTC" + CURRENCY_BTN = "CURRENCY_BTN" + CURRENCY_BWP = "CURRENCY_BWP" + CURRENCY_BYR = "CURRENCY_BYR" + CURRENCY_BZD = "CURRENCY_BZD" + CURRENCY_CAD = "CURRENCY_CAD" + CURRENCY_CDF = "CURRENCY_CDF" + CURRENCY_CHF = "CURRENCY_CHF" + CURRENCY_CLP = "CURRENCY_CLP" + CURRENCY_CNH = "CURRENCY_CNH" + CURRENCY_CNY = "CURRENCY_CNY" + CURRENCY_COP = "CURRENCY_COP" + CURRENCY_CRC = "CURRENCY_CRC" + CURRENCY_CUC = "CURRENCY_CUC" + CURRENCY_CUP = "CURRENCY_CUP" + CURRENCY_CVE = "CURRENCY_CVE" + CURRENCY_CZK = "CURRENCY_CZK" + CURRENCY_DEM = "CURRENCY_DEM" + CURRENCY_DJF = "CURRENCY_DJF" + CURRENCY_DKK = "CURRENCY_DKK" + CURRENCY_DOP = "CURRENCY_DOP" + CURRENCY_DZD = "CURRENCY_DZD" + CURRENCY_EEK = "CURRENCY_EEK" + CURRENCY_EGP = "CURRENCY_EGP" + CURRENCY_ERN = "CURRENCY_ERN" + CURRENCY_ETB = "CURRENCY_ETB" + CURRENCY_ETH = "CURRENCY_ETH" + CURRENCY_EUR = "CURRENCY_EUR" + CURRENCY_FJD = "CURRENCY_FJD" + CURRENCY_FKP = "CURRENCY_FKP" + CURRENCY_GBP = "CURRENCY_GBP" + CURRENCY_GBX = "CURRENCY_GBX" + CURRENCY_GEL = "CURRENCY_GEL" + CURRENCY_GGP = "CURRENCY_GGP" + CURRENCY_GHS = "CURRENCY_GHS" + CURRENCY_GIP = "CURRENCY_GIP" + CURRENCY_GMD = "CURRENCY_GMD" + CURRENCY_GNF = "CURRENCY_GNF" + CURRENCY_GTQ = "CURRENCY_GTQ" + CURRENCY_GYD = "CURRENCY_GYD" + CURRENCY_HKD = "CURRENCY_HKD" + CURRENCY_HNL = "CURRENCY_HNL" + CURRENCY_HRK = "CURRENCY_HRK" + CURRENCY_HTG = "CURRENCY_HTG" + CURRENCY_HUF = "CURRENCY_HUF" + CURRENCY_IDR = "CURRENCY_IDR" + CURRENCY_ILS = "CURRENCY_ILS" + CURRENCY_IMP = "CURRENCY_IMP" + CURRENCY_INR = "CURRENCY_INR" + CURRENCY_IQD = "CURRENCY_IQD" + CURRENCY_IRR = "CURRENCY_IRR" + CURRENCY_ISK = "CURRENCY_ISK" + CURRENCY_JEP = "CURRENCY_JEP" + CURRENCY_JMD = "CURRENCY_JMD" + CURRENCY_JOD = "CURRENCY_JOD" + CURRENCY_JPY = "CURRENCY_JPY" + CURRENCY_KES = "CURRENCY_KES" + CURRENCY_KGS = "CURRENCY_KGS" + CURRENCY_KHR = "CURRENCY_KHR" + CURRENCY_KMF = "CURRENCY_KMF" + CURRENCY_KPW = "CURRENCY_KPW" + CURRENCY_KRW = "CURRENCY_KRW" + CURRENCY_KWD = "CURRENCY_KWD" + CURRENCY_KYD = "CURRENCY_KYD" + CURRENCY_KZT = "CURRENCY_KZT" + CURRENCY_LAK = "CURRENCY_LAK" + CURRENCY_LBP = "CURRENCY_LBP" + CURRENCY_LKR = "CURRENCY_LKR" + CURRENCY_LRD = "CURRENCY_LRD" + CURRENCY_LSL = "CURRENCY_LSL" + CURRENCY_LTL = "CURRENCY_LTL" + CURRENCY_LVL = "CURRENCY_LVL" + CURRENCY_LYD = "CURRENCY_LYD" + CURRENCY_MAD = "CURRENCY_MAD" + CURRENCY_MDL = "CURRENCY_MDL" + CURRENCY_MGA = "CURRENCY_MGA" + CURRENCY_MKD = "CURRENCY_MKD" + CURRENCY_MMK = "CURRENCY_MMK" + CURRENCY_MNT = "CURRENCY_MNT" + CURRENCY_MOP = "CURRENCY_MOP" + CURRENCY_MRO = "CURRENCY_MRO" + CURRENCY_MUR = "CURRENCY_MUR" + CURRENCY_MVR = "CURRENCY_MVR" + CURRENCY_MWK = "CURRENCY_MWK" + CURRENCY_MXN = "CURRENCY_MXN" + CURRENCY_MYR = "CURRENCY_MYR" + CURRENCY_MZN = "CURRENCY_MZN" + CURRENCY_NAD = "CURRENCY_NAD" + CURRENCY_NGN = "CURRENCY_NGN" + CURRENCY_NIO = "CURRENCY_NIO" + CURRENCY_NLG = "CURRENCY_NLG" + CURRENCY_NOK = "CURRENCY_NOK" + CURRENCY_NPR = "CURRENCY_NPR" + CURRENCY_NZD = "CURRENCY_NZD" + CURRENCY_OMR = "CURRENCY_OMR" + CURRENCY_PAB = "CURRENCY_PAB" + CURRENCY_PEN = "CURRENCY_PEN" + CURRENCY_PGK = "CURRENCY_PGK" + CURRENCY_PHP = "CURRENCY_PHP" + CURRENCY_PKR = "CURRENCY_PKR" + CURRENCY_PLN = "CURRENCY_PLN" + CURRENCY_PYG = "CURRENCY_PYG" + CURRENCY_QAR = "CURRENCY_QAR" + CURRENCY_RON = "CURRENCY_RON" + CURRENCY_RSD = "CURRENCY_RSD" + CURRENCY_RUB = "CURRENCY_RUB" + CURRENCY_RWF = "CURRENCY_RWF" + CURRENCY_SAR = "CURRENCY_SAR" + CURRENCY_SBD = "CURRENCY_SBD" + CURRENCY_SCR = "CURRENCY_SCR" + CURRENCY_SDG = "CURRENCY_SDG" + CURRENCY_SEK = "CURRENCY_SEK" + CURRENCY_SGD = "CURRENCY_SGD" + CURRENCY_SHP = "CURRENCY_SHP" + CURRENCY_SKK = "CURRENCY_SKK" + CURRENCY_SLL = "CURRENCY_SLL" + CURRENCY_SOS = "CURRENCY_SOS" + CURRENCY_SPL = "CURRENCY_SPL" + CURRENCY_SRD = "CURRENCY_SRD" + CURRENCY_STD = "CURRENCY_STD" + CURRENCY_SVC = "CURRENCY_SVC" + CURRENCY_SYP = "CURRENCY_SYP" + CURRENCY_SZL = "CURRENCY_SZL" + CURRENCY_THB = "CURRENCY_THB" + CURRENCY_TJS = "CURRENCY_TJS" + CURRENCY_TMT = "CURRENCY_TMT" + CURRENCY_TND = "CURRENCY_TND" + CURRENCY_TOP = "CURRENCY_TOP" + CURRENCY_TRY = "CURRENCY_TRY" + CURRENCY_TTD = "CURRENCY_TTD" + CURRENCY_TVD = "CURRENCY_TVD" + CURRENCY_TWD = "CURRENCY_TWD" + CURRENCY_TZS = "CURRENCY_TZS" + CURRENCY_UAH = "CURRENCY_UAH" + CURRENCY_UGX = "CURRENCY_UGX" + CURRENCY_USD = "CURRENCY_USD" + CURRENCY_UYU = "CURRENCY_UYU" + CURRENCY_UZS = "CURRENCY_UZS" + CURRENCY_VEF = "CURRENCY_VEF" + CURRENCY_VND = "CURRENCY_VND" + CURRENCY_VUV = "CURRENCY_VUV" + CURRENCY_WST = "CURRENCY_WST" + CURRENCY_XAF = "CURRENCY_XAF" + CURRENCY_XCD = "CURRENCY_XCD" + CURRENCY_XDR = "CURRENCY_XDR" + CURRENCY_XOF = "CURRENCY_XOF" + CURRENCY_XPF = "CURRENCY_XPF" + CURRENCY_XXX = "CURRENCY_XXX" + CURRENCY_YER = "CURRENCY_YER" + CURRENCY_ZAR = "CURRENCY_ZAR" + CURRENCY_ZMW = "CURRENCY_ZMW" + CURRENCY_ZWD = "CURRENCY_ZWD" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/cxl_rej_response_to.py b/openapi/openapi_project/openapi_package/models/cxl_rej_response_to.py new file mode 100644 index 000000000..294c6354a --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/cxl_rej_response_to.py @@ -0,0 +1,14 @@ +from enum import Enum + + +class CxlRejResponseTo(str, Enum): + CXL_REJ_RESPONSE_TO_ORDER_CANCEL_REPLACE_REQUEST = ( + "CXL_REJ_RESPONSE_TO_ORDER_CANCEL_REPLACE_REQUEST" + ) + CXL_REJ_RESPONSE_TO_ORDER_CANCEL_REQUEST = ( + "CXL_REJ_RESPONSE_TO_ORDER_CANCEL_REQUEST" + ) + CXL_REJ_RESPONSE_TO_UNKNOWN = "CXL_REJ_RESPONSE_TO_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/date.py b/openapi/openapi_project/openapi_package/models/date.py new file mode 100644 index 000000000..c2b8d90e6 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/date.py @@ -0,0 +1,58 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="Date") + + +@_attrs_define +class Date: + """ + Attributes: + year (Union[Unset, int]): + month (Union[Unset, int]): + day (Union[Unset, int]): + """ + + year: Unset | int = UNSET + month: Unset | int = UNSET + day: Unset | int = UNSET + + def to_dict(self) -> dict[str, Any]: + year = self.year + + month = self.month + + day = self.day + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if year is not UNSET: + field_dict["year"] = year + if month is not UNSET: + field_dict["month"] = month + if day is not UNSET: + field_dict["day"] = day + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + year = d.pop("year", UNSET) + + month = d.pop("month", UNSET) + + day = d.pop("day", UNSET) + + date = cls( + year=year, + month=month, + day=day, + ) + + return date diff --git a/openapi/openapi_project/openapi_package/models/easy_to_borrow_security.py b/openapi/openapi_project/openapi_package/models/easy_to_borrow_security.py new file mode 100644 index 000000000..6ad84f15e --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/easy_to_borrow_security.py @@ -0,0 +1,49 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="EasyToBorrowSecurity") + + +@_attrs_define +class EasyToBorrowSecurity: + """ + Attributes: + symbol (Union[Unset, str]): + locate_id (Union[Unset, str]): + """ + + symbol: Unset | str = UNSET + locate_id: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + locate_id = self.locate_id + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if symbol is not UNSET: + field_dict["symbol"] = symbol + if locate_id is not UNSET: + field_dict["locateId"] = locate_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = d.pop("symbol", UNSET) + + locate_id = d.pop("locateId", UNSET) + + easy_to_borrow_security = cls( + symbol=symbol, + locate_id=locate_id, + ) + + return easy_to_borrow_security diff --git a/openapi/openapi_project/openapi_package/models/empty.py b/openapi/openapi_project/openapi_package/models/empty.py new file mode 100644 index 000000000..4a89f74ef --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/empty.py @@ -0,0 +1,22 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="Empty") + + +@_attrs_define +class Empty: + """ """ + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + empty = cls() + + return empty diff --git a/openapi/openapi_project/openapi_package/models/exchange.py b/openapi/openapi_project/openapi_package/models/exchange.py new file mode 100644 index 000000000..92e7d9ec6 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/exchange.py @@ -0,0 +1,157 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="Exchange") + + +@_attrs_define +class Exchange: + """ + Attributes: + country (Union[Unset, str]): + description (Union[Unset, str]): + display_name (Union[Unset, str]): + id (Union[Unset, int]): + mic (Union[Unset, str]): + microsoft_timezone (Union[Unset, str]): + name (Union[Unset, str]): + olson_timezone (Union[Unset, str]): + operating_mic (Union[Unset, str]): + region (Union[Unset, str]): + short_code (Union[Unset, str]): + suffix (Union[Unset, str]): + utc_offset (Union[Unset, int]): + website (Union[Unset, str]): + """ + + country: Unset | str = UNSET + description: Unset | str = UNSET + display_name: Unset | str = UNSET + id: Unset | int = UNSET + mic: Unset | str = UNSET + microsoft_timezone: Unset | str = UNSET + name: Unset | str = UNSET + olson_timezone: Unset | str = UNSET + operating_mic: Unset | str = UNSET + region: Unset | str = UNSET + short_code: Unset | str = UNSET + suffix: Unset | str = UNSET + utc_offset: Unset | int = UNSET + website: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + country = self.country + + description = self.description + + display_name = self.display_name + + id = self.id + + mic = self.mic + + microsoft_timezone = self.microsoft_timezone + + name = self.name + + olson_timezone = self.olson_timezone + + operating_mic = self.operating_mic + + region = self.region + + short_code = self.short_code + + suffix = self.suffix + + utc_offset = self.utc_offset + + website = self.website + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if country is not UNSET: + field_dict["Country"] = country + if description is not UNSET: + field_dict["Description"] = description + if display_name is not UNSET: + field_dict["DisplayName"] = display_name + if id is not UNSET: + field_dict["Id"] = id + if mic is not UNSET: + field_dict["MIC"] = mic + if microsoft_timezone is not UNSET: + field_dict["MicrosoftTimezone"] = microsoft_timezone + if name is not UNSET: + field_dict["Name"] = name + if olson_timezone is not UNSET: + field_dict["OlsonTimezone"] = olson_timezone + if operating_mic is not UNSET: + field_dict["OperatingMIC"] = operating_mic + if region is not UNSET: + field_dict["Region"] = region + if short_code is not UNSET: + field_dict["ShortCode"] = short_code + if suffix is not UNSET: + field_dict["Suffix"] = suffix + if utc_offset is not UNSET: + field_dict["UtcOffset"] = utc_offset + if website is not UNSET: + field_dict["Website"] = website + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + country = d.pop("Country", UNSET) + + description = d.pop("Description", UNSET) + + display_name = d.pop("DisplayName", UNSET) + + id = d.pop("Id", UNSET) + + mic = d.pop("MIC", UNSET) + + microsoft_timezone = d.pop("MicrosoftTimezone", UNSET) + + name = d.pop("Name", UNSET) + + olson_timezone = d.pop("OlsonTimezone", UNSET) + + operating_mic = d.pop("OperatingMIC", UNSET) + + region = d.pop("Region", UNSET) + + short_code = d.pop("ShortCode", UNSET) + + suffix = d.pop("Suffix", UNSET) + + utc_offset = d.pop("UtcOffset", UNSET) + + website = d.pop("Website", UNSET) + + exchange = cls( + country=country, + description=description, + display_name=display_name, + id=id, + mic=mic, + microsoft_timezone=microsoft_timezone, + name=name, + olson_timezone=olson_timezone, + operating_mic=operating_mic, + region=region, + short_code=short_code, + suffix=suffix, + utc_offset=utc_offset, + website=website, + ) + + return exchange diff --git a/openapi/openapi_project/openapi_package/models/exchange_code.py b/openapi/openapi_project/openapi_package/models/exchange_code.py new file mode 100644 index 000000000..fff12c425 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/exchange_code.py @@ -0,0 +1,72 @@ +from enum import Enum + + +class ExchangeCode(str, Enum): + EXCHANGE_CODE_AMXO = "EXCHANGE_CODE_AMXO" + EXCHANGE_CODE_ARCO = "EXCHANGE_CODE_ARCO" + EXCHANGE_CODE_ARCX = "EXCHANGE_CODE_ARCX" + EXCHANGE_CODE_BATO = "EXCHANGE_CODE_BATO" + EXCHANGE_CODE_BATS = "EXCHANGE_CODE_BATS" + EXCHANGE_CODE_BATY = "EXCHANGE_CODE_BATY" + EXCHANGE_CODE_BLCK = "EXCHANGE_CODE_BLCK" + EXCHANGE_CODE_C2OX = "EXCHANGE_CODE_C2OX" + EXCHANGE_CODE_CBSX = "EXCHANGE_CODE_CBSX" + EXCHANGE_CODE_CGIX = "EXCHANGE_CODE_CGIX" + EXCHANGE_CODE_CSMI = "EXCHANGE_CODE_CSMI" + EXCHANGE_CODE_DJXX = "EXCHANGE_CODE_DJXX" + EXCHANGE_CODE_EDGA = "EXCHANGE_CODE_EDGA" + EXCHANGE_CODE_EDGO = "EXCHANGE_CODE_EDGO" + EXCHANGE_CODE_EDGX = "EXCHANGE_CODE_EDGX" + EXCHANGE_CODE_EMLD = "EXCHANGE_CODE_EMLD" + EXCHANGE_CODE_EPRL = "EXCHANGE_CODE_EPRL" + EXCHANGE_CODE_GIDS = "EXCHANGE_CODE_GIDS" + EXCHANGE_CODE_GLBX = "EXCHANGE_CODE_GLBX" + EXCHANGE_CODE_GMNI = "EXCHANGE_CODE_GMNI" + EXCHANGE_CODE_IEXG = "EXCHANGE_CODE_IEXG" + EXCHANGE_CODE_LTSE = "EXCHANGE_CODE_LTSE" + EXCHANGE_CODE_MCRY = "EXCHANGE_CODE_MCRY" + EXCHANGE_CODE_MEMX = "EXCHANGE_CODE_MEMX" + EXCHANGE_CODE_MPRL = "EXCHANGE_CODE_MPRL" + EXCHANGE_CODE_MSCI = "EXCHANGE_CODE_MSCI" + EXCHANGE_CODE_MSTR = "EXCHANGE_CODE_MSTR" + EXCHANGE_CODE_MXOP = "EXCHANGE_CODE_MXOP" + EXCHANGE_CODE_OOTC = "EXCHANGE_CODE_OOTC" + EXCHANGE_CODE_OPRA = "EXCHANGE_CODE_OPRA" + EXCHANGE_CODE_OTCB = "EXCHANGE_CODE_OTCB" + EXCHANGE_CODE_OTCM = "EXCHANGE_CODE_OTCM" + EXCHANGE_CODE_OTCQ = "EXCHANGE_CODE_OTCQ" + EXCHANGE_CODE_PINC = "EXCHANGE_CODE_PINC" + EXCHANGE_CODE_PINX = "EXCHANGE_CODE_PINX" + EXCHANGE_CODE_RTXX = "EXCHANGE_CODE_RTXX" + EXCHANGE_CODE_SPHR = "EXCHANGE_CODE_SPHR" + EXCHANGE_CODE_SPXX = "EXCHANGE_CODE_SPXX" + EXCHANGE_CODE_USEQ = "EXCHANGE_CODE_USEQ" + EXCHANGE_CODE_XADF = "EXCHANGE_CODE_XADF" + EXCHANGE_CODE_XASE = "EXCHANGE_CODE_XASE" + EXCHANGE_CODE_XBOS = "EXCHANGE_CODE_XBOS" + EXCHANGE_CODE_XBOX = "EXCHANGE_CODE_XBOX" + EXCHANGE_CODE_XBXO = "EXCHANGE_CODE_XBXO" + EXCHANGE_CODE_XCBF = "EXCHANGE_CODE_XCBF" + EXCHANGE_CODE_XCBO = "EXCHANGE_CODE_XCBO" + EXCHANGE_CODE_XCBT = "EXCHANGE_CODE_XCBT" + EXCHANGE_CODE_XCEC = "EXCHANGE_CODE_XCEC" + EXCHANGE_CODE_XCHI = "EXCHANGE_CODE_XCHI" + EXCHANGE_CODE_XCIS = "EXCHANGE_CODE_XCIS" + EXCHANGE_CODE_XCME = "EXCHANGE_CODE_XCME" + EXCHANGE_CODE_XISE = "EXCHANGE_CODE_XISE" + EXCHANGE_CODE_XISX = "EXCHANGE_CODE_XISX" + EXCHANGE_CODE_XKBT = "EXCHANGE_CODE_XKBT" + EXCHANGE_CODE_XMIO = "EXCHANGE_CODE_XMIO" + EXCHANGE_CODE_XNAS = "EXCHANGE_CODE_XNAS" + EXCHANGE_CODE_XNDQ = "EXCHANGE_CODE_XNDQ" + EXCHANGE_CODE_XNGS = "EXCHANGE_CODE_XNGS" + EXCHANGE_CODE_XNYM = "EXCHANGE_CODE_XNYM" + EXCHANGE_CODE_XNYS = "EXCHANGE_CODE_XNYS" + EXCHANGE_CODE_XOCC = "EXCHANGE_CODE_XOCC" + EXCHANGE_CODE_XOTC = "EXCHANGE_CODE_XOTC" + EXCHANGE_CODE_XPHO = "EXCHANGE_CODE_XPHO" + EXCHANGE_CODE_XPSX = "EXCHANGE_CODE_XPSX" + EXCHANGE_CODE_XXXX = "EXCHANGE_CODE_XXXX" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/exec_type.py b/openapi/openapi_project/openapi_package/models/exec_type.py new file mode 100644 index 000000000..851f1e912 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/exec_type.py @@ -0,0 +1,30 @@ +from enum import Enum + + +class ExecType(str, Enum): + EXEC_TYPE_CANCELED = "EXEC_TYPE_CANCELED" + EXEC_TYPE_CLAIM_REQUIRED = "EXEC_TYPE_CLAIM_REQUIRED" + EXEC_TYPE_DONE_FOR_DAY = "EXEC_TYPE_DONE_FOR_DAY" + EXEC_TYPE_EXPIRED = "EXEC_TYPE_EXPIRED" + EXEC_TYPE_NEW = "EXEC_TYPE_NEW" + EXEC_TYPE_NOTE = "EXEC_TYPE_NOTE" + EXEC_TYPE_PENDING_CANCEL = "EXEC_TYPE_PENDING_CANCEL" + EXEC_TYPE_PENDING_NEW = "EXEC_TYPE_PENDING_NEW" + EXEC_TYPE_PENDING_REPLACE = "EXEC_TYPE_PENDING_REPLACE" + EXEC_TYPE_QUEUED_ORDER = "EXEC_TYPE_QUEUED_ORDER" + EXEC_TYPE_REJECTED = "EXEC_TYPE_REJECTED" + EXEC_TYPE_REPLACED = "EXEC_TYPE_REPLACED" + EXEC_TYPE_REPRESENTED = "EXEC_TYPE_REPRESENTED" + EXEC_TYPE_RESTATED = "EXEC_TYPE_RESTATED" + EXEC_TYPE_STOPPED = "EXEC_TYPE_STOPPED" + EXEC_TYPE_SUSPENDED = "EXEC_TYPE_SUSPENDED" + EXEC_TYPE_TRADE = "EXEC_TYPE_TRADE" + EXEC_TYPE_TRADE_BUST = "EXEC_TYPE_TRADE_BUST" + EXEC_TYPE_TRADE_CORRECT = "EXEC_TYPE_TRADE_CORRECT" + EXEC_TYPE_UNKNOWN = "EXEC_TYPE_UNKNOWN" + EXEC_TYPE_UPDATE = "EXEC_TYPE_UPDATE" + EXEC_TYPE_UPDATE_OPTIONAL_DATA = "EXEC_TYPE_UPDATE_OPTIONAL_DATA" + EXEC_TYPE_USER_CLAIMED = "EXEC_TYPE_USER_CLAIMED" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/execution.py b/openapi/openapi_project/openapi_package/models/execution.py new file mode 100644 index 000000000..8644ffd83 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/execution.py @@ -0,0 +1,641 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.exec_type import ExecType +from ..models.multi_leg_reporting_type import MultiLegReportingType +from ..models.ord_status import OrdStatus +from ..models.ord_type import OrdType +from ..models.origination_type import OriginationType +from ..models.position_effect import PositionEffect +from ..models.price_type import PriceType +from ..models.side import Side +from ..models.tif import Tif +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.clearing_info import ClearingInfo + from ..models.execution_algo import ExecutionAlgo + from ..models.execution_optional_data import ExecutionOptionalData + from ..models.header import Header + from ..models.order_instruction import OrderInstruction + from ..models.security import Security + + +T = TypeVar("T", bound="Execution") + + +@_attrs_define +class Execution: + """ + Attributes: + account_id (Union[Unset, int]): + algo (Union[Unset, ExecutionAlgo]): + alloc_id (Union[Unset, str]): + aux_price (Union[Unset, float]): + avg_price (Union[Unset, float]): + claimed_by (Union[Unset, str]): + clearing_info (Union[Unset, ClearingInfo]): + commission (Union[Unset, float]): + cum_qty (Union[Unset, float]): + cur_ord_id (Union[Unset, str]): + exec_broker (Union[Unset, str]): + exec_id (Union[Unset, str]): + exec_ref_id (Union[Unset, str]): + exec_type (Union[Unset, ExecType]): + fee1 (Union[Unset, float]): + fee2 (Union[Unset, float]): + header (Union[Unset, Header]): + incoming_cl_ord_id (Union[Unset, str]): + incoming_ord_id (Union[Unset, str]): + incoming_orig_cl_ord_id (Union[Unset, str]): + instructions (Union[Unset, list['OrderInstruction']]): + last_market (Union[Unset, str]): + last_price (Union[Unset, float]): + last_qty (Union[Unset, float]): + leaves_qty (Union[Unset, float]): + leg_id (Union[Unset, str]): + liquidity_flag (Union[Unset, str]): + multi_leg_reporting_type (Union[Unset, MultiLegReportingType]): + optional_data (Union[Unset, ExecutionOptionalData]): + order_flags (Union[Unset, int]): + ord_status (Union[Unset, OrdStatus]): + ord_type (Union[Unset, OrdType]): + origination_type (Union[Unset, OriginationType]): + orig_ord_id (Union[Unset, str]): + parent_ord_id (Union[Unset, str]): + perm_ord_id (Union[Unset, str]): + position_effect (Union[Unset, PositionEffect]): + price (Union[Unset, float]): + price_type (Union[Unset, PriceType]): + qty (Union[Unset, float]): + route (Union[Unset, str]): + routing_session (Union[Unset, str]): + security (Union[Unset, Security]): + side (Union[Unset, Side]): + source (Union[Unset, str]): + symbol (Union[Unset, str]): + tag (Union[Unset, str]): + text (Union[Unset, str]): + tif (Union[Unset, Tif]): + trader_id (Union[Unset, str]): + transact_ts (Union[Unset, str]): + user_id (Union[Unset, int]): + working_qty (Union[Unset, float]): + """ + + account_id: Unset | int = UNSET + algo: Union[Unset, "ExecutionAlgo"] = UNSET + alloc_id: Unset | str = UNSET + aux_price: Unset | float = UNSET + avg_price: Unset | float = UNSET + claimed_by: Unset | str = UNSET + clearing_info: Union[Unset, "ClearingInfo"] = UNSET + commission: Unset | float = UNSET + cum_qty: Unset | float = UNSET + cur_ord_id: Unset | str = UNSET + exec_broker: Unset | str = UNSET + exec_id: Unset | str = UNSET + exec_ref_id: Unset | str = UNSET + exec_type: Unset | ExecType = UNSET + fee1: Unset | float = UNSET + fee2: Unset | float = UNSET + header: Union[Unset, "Header"] = UNSET + incoming_cl_ord_id: Unset | str = UNSET + incoming_ord_id: Unset | str = UNSET + incoming_orig_cl_ord_id: Unset | str = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + last_market: Unset | str = UNSET + last_price: Unset | float = UNSET + last_qty: Unset | float = UNSET + leaves_qty: Unset | float = UNSET + leg_id: Unset | str = UNSET + liquidity_flag: Unset | str = UNSET + multi_leg_reporting_type: Unset | MultiLegReportingType = UNSET + optional_data: Union[Unset, "ExecutionOptionalData"] = UNSET + order_flags: Unset | int = UNSET + ord_status: Unset | OrdStatus = UNSET + ord_type: Unset | OrdType = UNSET + origination_type: Unset | OriginationType = UNSET + orig_ord_id: Unset | str = UNSET + parent_ord_id: Unset | str = UNSET + perm_ord_id: Unset | str = UNSET + position_effect: Unset | PositionEffect = UNSET + price: Unset | float = UNSET + price_type: Unset | PriceType = UNSET + qty: Unset | float = UNSET + route: Unset | str = UNSET + routing_session: Unset | str = UNSET + security: Union[Unset, "Security"] = UNSET + side: Unset | Side = UNSET + source: Unset | str = UNSET + symbol: Unset | str = UNSET + tag: Unset | str = UNSET + text: Unset | str = UNSET + tif: Unset | Tif = UNSET + trader_id: Unset | str = UNSET + transact_ts: Unset | str = UNSET + user_id: Unset | int = UNSET + working_qty: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + algo: Unset | dict[str, Any] = UNSET + if not isinstance(self.algo, Unset): + algo = self.algo.to_dict() + + alloc_id = self.alloc_id + + aux_price = self.aux_price + + avg_price = self.avg_price + + claimed_by = self.claimed_by + + clearing_info: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_info, Unset): + clearing_info = self.clearing_info.to_dict() + + commission = self.commission + + cum_qty = self.cum_qty + + cur_ord_id = self.cur_ord_id + + exec_broker = self.exec_broker + + exec_id = self.exec_id + + exec_ref_id = self.exec_ref_id + + exec_type: Unset | str = UNSET + if not isinstance(self.exec_type, Unset): + exec_type = self.exec_type.value + + fee1 = self.fee1 + + fee2 = self.fee2 + + header: Unset | dict[str, Any] = UNSET + if not isinstance(self.header, Unset): + header = self.header.to_dict() + + incoming_cl_ord_id = self.incoming_cl_ord_id + + incoming_ord_id = self.incoming_ord_id + + incoming_orig_cl_ord_id = self.incoming_orig_cl_ord_id + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + last_market = self.last_market + + last_price = self.last_price + + last_qty = self.last_qty + + leaves_qty = self.leaves_qty + + leg_id = self.leg_id + + liquidity_flag = self.liquidity_flag + + multi_leg_reporting_type: Unset | str = UNSET + if not isinstance(self.multi_leg_reporting_type, Unset): + multi_leg_reporting_type = self.multi_leg_reporting_type.value + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + order_flags = self.order_flags + + ord_status: Unset | str = UNSET + if not isinstance(self.ord_status, Unset): + ord_status = self.ord_status.value + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + origination_type: Unset | str = UNSET + if not isinstance(self.origination_type, Unset): + origination_type = self.origination_type.value + + orig_ord_id = self.orig_ord_id + + parent_ord_id = self.parent_ord_id + + perm_ord_id = self.perm_ord_id + + position_effect: Unset | str = UNSET + if not isinstance(self.position_effect, Unset): + position_effect = self.position_effect.value + + price = self.price + + price_type: Unset | str = UNSET + if not isinstance(self.price_type, Unset): + price_type = self.price_type.value + + qty = self.qty + + route = self.route + + routing_session = self.routing_session + + security: Unset | dict[str, Any] = UNSET + if not isinstance(self.security, Unset): + security = self.security.to_dict() + + side: Unset | str = UNSET + if not isinstance(self.side, Unset): + side = self.side.value + + source = self.source + + symbol = self.symbol + + tag = self.tag + + text = self.text + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + trader_id = self.trader_id + + transact_ts = self.transact_ts + + user_id = self.user_id + + working_qty = self.working_qty + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if algo is not UNSET: + field_dict["algo"] = algo + if alloc_id is not UNSET: + field_dict["allocId"] = alloc_id + if aux_price is not UNSET: + field_dict["auxPrice"] = aux_price + if avg_price is not UNSET: + field_dict["avgPrice"] = avg_price + if claimed_by is not UNSET: + field_dict["claimedBy"] = claimed_by + if clearing_info is not UNSET: + field_dict["clearingInfo"] = clearing_info + if commission is not UNSET: + field_dict["commission"] = commission + if cum_qty is not UNSET: + field_dict["cumQty"] = cum_qty + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if exec_broker is not UNSET: + field_dict["execBroker"] = exec_broker + if exec_id is not UNSET: + field_dict["execId"] = exec_id + if exec_ref_id is not UNSET: + field_dict["execRefId"] = exec_ref_id + if exec_type is not UNSET: + field_dict["execType"] = exec_type + if fee1 is not UNSET: + field_dict["fee1"] = fee1 + if fee2 is not UNSET: + field_dict["fee2"] = fee2 + if header is not UNSET: + field_dict["header"] = header + if incoming_cl_ord_id is not UNSET: + field_dict["incomingClOrdId"] = incoming_cl_ord_id + if incoming_ord_id is not UNSET: + field_dict["incomingOrdId"] = incoming_ord_id + if incoming_orig_cl_ord_id is not UNSET: + field_dict["incomingOrigClOrdId"] = incoming_orig_cl_ord_id + if instructions is not UNSET: + field_dict["instructions"] = instructions + if last_market is not UNSET: + field_dict["lastMarket"] = last_market + if last_price is not UNSET: + field_dict["lastPrice"] = last_price + if last_qty is not UNSET: + field_dict["lastQty"] = last_qty + if leaves_qty is not UNSET: + field_dict["leavesQty"] = leaves_qty + if leg_id is not UNSET: + field_dict["legId"] = leg_id + if liquidity_flag is not UNSET: + field_dict["liquidityFlag"] = liquidity_flag + if multi_leg_reporting_type is not UNSET: + field_dict["multiLegReportingType"] = multi_leg_reporting_type + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if order_flags is not UNSET: + field_dict["orderFlags"] = order_flags + if ord_status is not UNSET: + field_dict["ordStatus"] = ord_status + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if origination_type is not UNSET: + field_dict["originationType"] = origination_type + if orig_ord_id is not UNSET: + field_dict["origOrdId"] = orig_ord_id + if parent_ord_id is not UNSET: + field_dict["parentOrdId"] = parent_ord_id + if perm_ord_id is not UNSET: + field_dict["permOrdId"] = perm_ord_id + if position_effect is not UNSET: + field_dict["positionEffect"] = position_effect + if price is not UNSET: + field_dict["price"] = price + if price_type is not UNSET: + field_dict["priceType"] = price_type + if qty is not UNSET: + field_dict["qty"] = qty + if route is not UNSET: + field_dict["route"] = route + if routing_session is not UNSET: + field_dict["routingSession"] = routing_session + if security is not UNSET: + field_dict["security"] = security + if side is not UNSET: + field_dict["side"] = side + if source is not UNSET: + field_dict["source"] = source + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tag is not UNSET: + field_dict["tag"] = tag + if text is not UNSET: + field_dict["text"] = text + if tif is not UNSET: + field_dict["tif"] = tif + if trader_id is not UNSET: + field_dict["traderId"] = trader_id + if transact_ts is not UNSET: + field_dict["transactTs"] = transact_ts + if user_id is not UNSET: + field_dict["userId"] = user_id + if working_qty is not UNSET: + field_dict["workingQty"] = working_qty + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.clearing_info import ClearingInfo + from ..models.execution_algo import ExecutionAlgo + from ..models.execution_optional_data import ExecutionOptionalData + from ..models.header import Header + from ..models.order_instruction import OrderInstruction + from ..models.security import Security + + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + _algo = d.pop("algo", UNSET) + algo: Unset | ExecutionAlgo + if isinstance(_algo, Unset): + algo = UNSET + else: + algo = ExecutionAlgo.from_dict(_algo) + + alloc_id = d.pop("allocId", UNSET) + + aux_price = d.pop("auxPrice", UNSET) + + avg_price = d.pop("avgPrice", UNSET) + + claimed_by = d.pop("claimedBy", UNSET) + + _clearing_info = d.pop("clearingInfo", UNSET) + clearing_info: Unset | ClearingInfo + if isinstance(_clearing_info, Unset): + clearing_info = UNSET + else: + clearing_info = ClearingInfo.from_dict(_clearing_info) + + commission = d.pop("commission", UNSET) + + cum_qty = d.pop("cumQty", UNSET) + + cur_ord_id = d.pop("curOrdId", UNSET) + + exec_broker = d.pop("execBroker", UNSET) + + exec_id = d.pop("execId", UNSET) + + exec_ref_id = d.pop("execRefId", UNSET) + + _exec_type = d.pop("execType", UNSET) + exec_type: Unset | ExecType + if isinstance(_exec_type, Unset): + exec_type = UNSET + else: + exec_type = ExecType(_exec_type) + + fee1 = d.pop("fee1", UNSET) + + fee2 = d.pop("fee2", UNSET) + + _header = d.pop("header", UNSET) + header: Unset | Header + if isinstance(_header, Unset): + header = UNSET + else: + header = Header.from_dict(_header) + + incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) + + incoming_ord_id = d.pop("incomingOrdId", UNSET) + + incoming_orig_cl_ord_id = d.pop("incomingOrigClOrdId", UNSET) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + last_market = d.pop("lastMarket", UNSET) + + last_price = d.pop("lastPrice", UNSET) + + last_qty = d.pop("lastQty", UNSET) + + leaves_qty = d.pop("leavesQty", UNSET) + + leg_id = d.pop("legId", UNSET) + + liquidity_flag = d.pop("liquidityFlag", UNSET) + + _multi_leg_reporting_type = d.pop("multiLegReportingType", UNSET) + multi_leg_reporting_type: Unset | MultiLegReportingType + if isinstance(_multi_leg_reporting_type, Unset): + multi_leg_reporting_type = UNSET + else: + multi_leg_reporting_type = MultiLegReportingType(_multi_leg_reporting_type) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | ExecutionOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = ExecutionOptionalData.from_dict(_optional_data) + + order_flags = d.pop("orderFlags", UNSET) + + _ord_status = d.pop("ordStatus", UNSET) + ord_status: Unset | OrdStatus + if isinstance(_ord_status, Unset): + ord_status = UNSET + else: + ord_status = OrdStatus(_ord_status) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + _origination_type = d.pop("originationType", UNSET) + origination_type: Unset | OriginationType + if isinstance(_origination_type, Unset): + origination_type = UNSET + else: + origination_type = OriginationType(_origination_type) + + orig_ord_id = d.pop("origOrdId", UNSET) + + parent_ord_id = d.pop("parentOrdId", UNSET) + + perm_ord_id = d.pop("permOrdId", UNSET) + + _position_effect = d.pop("positionEffect", UNSET) + position_effect: Unset | PositionEffect + if isinstance(_position_effect, Unset): + position_effect = UNSET + else: + position_effect = PositionEffect(_position_effect) + + price = d.pop("price", UNSET) + + _price_type = d.pop("priceType", UNSET) + price_type: Unset | PriceType + if isinstance(_price_type, Unset): + price_type = UNSET + else: + price_type = PriceType(_price_type) + + qty = d.pop("qty", UNSET) + + route = d.pop("route", UNSET) + + routing_session = d.pop("routingSession", UNSET) + + _security = d.pop("security", UNSET) + security: Unset | Security + if isinstance(_security, Unset): + security = UNSET + else: + security = Security.from_dict(_security) + + _side = d.pop("side", UNSET) + side: Unset | Side + if isinstance(_side, Unset): + side = UNSET + else: + side = Side(_side) + + source = d.pop("source", UNSET) + + symbol = d.pop("symbol", UNSET) + + tag = d.pop("tag", UNSET) + + text = d.pop("text", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + trader_id = d.pop("traderId", UNSET) + + transact_ts = d.pop("transactTs", UNSET) + + user_id = d.pop("userId", UNSET) + + working_qty = d.pop("workingQty", UNSET) + + execution = cls( + account_id=account_id, + algo=algo, + alloc_id=alloc_id, + aux_price=aux_price, + avg_price=avg_price, + claimed_by=claimed_by, + clearing_info=clearing_info, + commission=commission, + cum_qty=cum_qty, + cur_ord_id=cur_ord_id, + exec_broker=exec_broker, + exec_id=exec_id, + exec_ref_id=exec_ref_id, + exec_type=exec_type, + fee1=fee1, + fee2=fee2, + header=header, + incoming_cl_ord_id=incoming_cl_ord_id, + incoming_ord_id=incoming_ord_id, + incoming_orig_cl_ord_id=incoming_orig_cl_ord_id, + instructions=instructions, + last_market=last_market, + last_price=last_price, + last_qty=last_qty, + leaves_qty=leaves_qty, + leg_id=leg_id, + liquidity_flag=liquidity_flag, + multi_leg_reporting_type=multi_leg_reporting_type, + optional_data=optional_data, + order_flags=order_flags, + ord_status=ord_status, + ord_type=ord_type, + origination_type=origination_type, + orig_ord_id=orig_ord_id, + parent_ord_id=parent_ord_id, + perm_ord_id=perm_ord_id, + position_effect=position_effect, + price=price, + price_type=price_type, + qty=qty, + route=route, + routing_session=routing_session, + security=security, + side=side, + source=source, + symbol=symbol, + tag=tag, + text=text, + tif=tif, + trader_id=trader_id, + transact_ts=transact_ts, + user_id=user_id, + working_qty=working_qty, + ) + + return execution diff --git a/openapi/openapi_project/openapi_package/models/execution_algo.py b/openapi/openapi_project/openapi_package/models/execution_algo.py new file mode 100644 index 000000000..0cf4e8d7d --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/execution_algo.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ExecutionAlgo") + + +@_attrs_define +class ExecutionAlgo: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + execution_algo = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + execution_algo.additional_properties = additional_properties + return execution_algo + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/execution_optional_data.py b/openapi/openapi_project/openapi_package/models/execution_optional_data.py new file mode 100644 index 000000000..863b6b07e --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/execution_optional_data.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ExecutionOptionalData") + + +@_attrs_define +class ExecutionOptionalData: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + execution_optional_data = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + execution_optional_data.additional_properties = additional_properties + return execution_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/flex_option.py b/openapi/openapi_project/openapi_package/models/flex_option.py new file mode 100644 index 000000000..e24c5cc10 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/flex_option.py @@ -0,0 +1,445 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.currency import Currency +from ..models.exchange_code import ExchangeCode +from ..models.numeric_display_format import NumericDisplayFormat +from ..models.option_exercise_style import OptionExerciseStyle +from ..models.option_series_product_type import OptionSeriesProductType +from ..models.option_settlement_type import OptionSettlementType +from ..models.put_call import PutCall +from ..models.security_category import SecurityCategory +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.date import Date + from ..models.flex_option_aliases import FlexOptionAliases + + +T = TypeVar("T", bound="FlexOption") + + +@_attrs_define +class FlexOption: + """ + Attributes: + aliases (Union[Unset, FlexOptionAliases]): + currency (Union[Unset, Currency]): + listed_dt (Union[Unset, Date]): + delisted_dt (Union[Unset, Date]): + description (Union[Unset, str]): + exchange_id (Union[Unset, int]): + id (Union[Unset, int]): + multiplier (Union[Unset, float]): + price_base_factor (Union[Unset, float]): + price_display_factor (Union[Unset, float]): + price_display_format (Union[Unset, NumericDisplayFormat]): + qty_display_factor (Union[Unset, float]): + qty_display_format (Union[Unset, NumericDisplayFormat]): + security_category (Union[Unset, SecurityCategory]): + symbol (Union[Unset, str]): + tick_rule (Union[Unset, str]): + tick_size (Union[Unset, float]): + tick_value (Union[Unset, float]): + traded_exchanges (Union[Unset, list[ExchangeCode]]): + cap_percentage (Union[Unset, float]): + creation_dt (Union[Unset, Date]): + deliverable_per_contract (Union[Unset, float]): + exercise_style (Union[Unset, OptionExerciseStyle]): + expiration_dt (Union[Unset, Date]): + observation_day (Union[Unset, int]): + percentage_pricing (Union[Unset, bool]): + product_type (Union[Unset, OptionSeriesProductType]): + put_call (Union[Unset, PutCall]): + root (Union[Unset, str]): + root_base (Union[Unset, str]): + settlement_type (Union[Unset, OptionSettlementType]): + strike (Union[Unset, float]): + underlying (Union[Unset, str]): + """ + + aliases: Union[Unset, "FlexOptionAliases"] = UNSET + currency: Unset | Currency = UNSET + listed_dt: Union[Unset, "Date"] = UNSET + delisted_dt: Union[Unset, "Date"] = UNSET + description: Unset | str = UNSET + exchange_id: Unset | int = UNSET + id: Unset | int = UNSET + multiplier: Unset | float = UNSET + price_base_factor: Unset | float = UNSET + price_display_factor: Unset | float = UNSET + price_display_format: Unset | NumericDisplayFormat = UNSET + qty_display_factor: Unset | float = UNSET + qty_display_format: Unset | NumericDisplayFormat = UNSET + security_category: Unset | SecurityCategory = UNSET + symbol: Unset | str = UNSET + tick_rule: Unset | str = UNSET + tick_size: Unset | float = UNSET + tick_value: Unset | float = UNSET + traded_exchanges: Unset | list[ExchangeCode] = UNSET + cap_percentage: Unset | float = UNSET + creation_dt: Union[Unset, "Date"] = UNSET + deliverable_per_contract: Unset | float = UNSET + exercise_style: Unset | OptionExerciseStyle = UNSET + expiration_dt: Union[Unset, "Date"] = UNSET + observation_day: Unset | int = UNSET + percentage_pricing: Unset | bool = UNSET + product_type: Unset | OptionSeriesProductType = UNSET + put_call: Unset | PutCall = UNSET + root: Unset | str = UNSET + root_base: Unset | str = UNSET + settlement_type: Unset | OptionSettlementType = UNSET + strike: Unset | float = UNSET + underlying: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + aliases: Unset | dict[str, Any] = UNSET + if not isinstance(self.aliases, Unset): + aliases = self.aliases.to_dict() + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + listed_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.listed_dt, Unset): + listed_dt = self.listed_dt.to_dict() + + delisted_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.delisted_dt, Unset): + delisted_dt = self.delisted_dt.to_dict() + + description = self.description + + exchange_id = self.exchange_id + + id = self.id + + multiplier = self.multiplier + + price_base_factor = self.price_base_factor + + price_display_factor = self.price_display_factor + + price_display_format: Unset | str = UNSET + if not isinstance(self.price_display_format, Unset): + price_display_format = self.price_display_format.value + + qty_display_factor = self.qty_display_factor + + qty_display_format: Unset | str = UNSET + if not isinstance(self.qty_display_format, Unset): + qty_display_format = self.qty_display_format.value + + security_category: Unset | str = UNSET + if not isinstance(self.security_category, Unset): + security_category = self.security_category.value + + symbol = self.symbol + + tick_rule = self.tick_rule + + tick_size = self.tick_size + + tick_value = self.tick_value + + traded_exchanges: Unset | list[str] = UNSET + if not isinstance(self.traded_exchanges, Unset): + traded_exchanges = [] + for traded_exchanges_item_data in self.traded_exchanges: + traded_exchanges_item = traded_exchanges_item_data.value + traded_exchanges.append(traded_exchanges_item) + + cap_percentage = self.cap_percentage + + creation_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.creation_dt, Unset): + creation_dt = self.creation_dt.to_dict() + + deliverable_per_contract = self.deliverable_per_contract + + exercise_style: Unset | str = UNSET + if not isinstance(self.exercise_style, Unset): + exercise_style = self.exercise_style.value + + expiration_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.expiration_dt, Unset): + expiration_dt = self.expiration_dt.to_dict() + + observation_day = self.observation_day + + percentage_pricing = self.percentage_pricing + + product_type: Unset | str = UNSET + if not isinstance(self.product_type, Unset): + product_type = self.product_type.value + + put_call: Unset | str = UNSET + if not isinstance(self.put_call, Unset): + put_call = self.put_call.value + + root = self.root + + root_base = self.root_base + + settlement_type: Unset | str = UNSET + if not isinstance(self.settlement_type, Unset): + settlement_type = self.settlement_type.value + + strike = self.strike + + underlying = self.underlying + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if aliases is not UNSET: + field_dict["aliases"] = aliases + if currency is not UNSET: + field_dict["currency"] = currency + if listed_dt is not UNSET: + field_dict["listedDt"] = listed_dt + if delisted_dt is not UNSET: + field_dict["delistedDt"] = delisted_dt + if description is not UNSET: + field_dict["description"] = description + if exchange_id is not UNSET: + field_dict["exchangeId"] = exchange_id + if id is not UNSET: + field_dict["id"] = id + if multiplier is not UNSET: + field_dict["multiplier"] = multiplier + if price_base_factor is not UNSET: + field_dict["priceBaseFactor"] = price_base_factor + if price_display_factor is not UNSET: + field_dict["priceDisplayFactor"] = price_display_factor + if price_display_format is not UNSET: + field_dict["priceDisplayFormat"] = price_display_format + if qty_display_factor is not UNSET: + field_dict["qtyDisplayFactor"] = qty_display_factor + if qty_display_format is not UNSET: + field_dict["qtyDisplayFormat"] = qty_display_format + if security_category is not UNSET: + field_dict["securityCategory"] = security_category + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tick_rule is not UNSET: + field_dict["tickRule"] = tick_rule + if tick_size is not UNSET: + field_dict["tickSize"] = tick_size + if tick_value is not UNSET: + field_dict["tickValue"] = tick_value + if traded_exchanges is not UNSET: + field_dict["tradedExchanges"] = traded_exchanges + if cap_percentage is not UNSET: + field_dict["capPercentage"] = cap_percentage + if creation_dt is not UNSET: + field_dict["creationDt"] = creation_dt + if deliverable_per_contract is not UNSET: + field_dict["deliverablePerContract"] = deliverable_per_contract + if exercise_style is not UNSET: + field_dict["exerciseStyle"] = exercise_style + if expiration_dt is not UNSET: + field_dict["expirationDt"] = expiration_dt + if observation_day is not UNSET: + field_dict["observationDay"] = observation_day + if percentage_pricing is not UNSET: + field_dict["percentagePricing"] = percentage_pricing + if product_type is not UNSET: + field_dict["productType"] = product_type + if put_call is not UNSET: + field_dict["putCall"] = put_call + if root is not UNSET: + field_dict["root"] = root + if root_base is not UNSET: + field_dict["rootBase"] = root_base + if settlement_type is not UNSET: + field_dict["settlementType"] = settlement_type + if strike is not UNSET: + field_dict["strike"] = strike + if underlying is not UNSET: + field_dict["underlying"] = underlying + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.date import Date + from ..models.flex_option_aliases import FlexOptionAliases + + d = dict(src_dict) + _aliases = d.pop("aliases", UNSET) + aliases: Unset | FlexOptionAliases + if isinstance(_aliases, Unset): + aliases = UNSET + else: + aliases = FlexOptionAliases.from_dict(_aliases) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + _listed_dt = d.pop("listedDt", UNSET) + listed_dt: Unset | Date + if isinstance(_listed_dt, Unset): + listed_dt = UNSET + else: + listed_dt = Date.from_dict(_listed_dt) + + _delisted_dt = d.pop("delistedDt", UNSET) + delisted_dt: Unset | Date + if isinstance(_delisted_dt, Unset): + delisted_dt = UNSET + else: + delisted_dt = Date.from_dict(_delisted_dt) + + description = d.pop("description", UNSET) + + exchange_id = d.pop("exchangeId", UNSET) + + id = d.pop("id", UNSET) + + multiplier = d.pop("multiplier", UNSET) + + price_base_factor = d.pop("priceBaseFactor", UNSET) + + price_display_factor = d.pop("priceDisplayFactor", UNSET) + + _price_display_format = d.pop("priceDisplayFormat", UNSET) + price_display_format: Unset | NumericDisplayFormat + if isinstance(_price_display_format, Unset): + price_display_format = UNSET + else: + price_display_format = NumericDisplayFormat(_price_display_format) + + qty_display_factor = d.pop("qtyDisplayFactor", UNSET) + + _qty_display_format = d.pop("qtyDisplayFormat", UNSET) + qty_display_format: Unset | NumericDisplayFormat + if isinstance(_qty_display_format, Unset): + qty_display_format = UNSET + else: + qty_display_format = NumericDisplayFormat(_qty_display_format) + + _security_category = d.pop("securityCategory", UNSET) + security_category: Unset | SecurityCategory + if isinstance(_security_category, Unset): + security_category = UNSET + else: + security_category = SecurityCategory(_security_category) + + symbol = d.pop("symbol", UNSET) + + tick_rule = d.pop("tickRule", UNSET) + + tick_size = d.pop("tickSize", UNSET) + + tick_value = d.pop("tickValue", UNSET) + + traded_exchanges = [] + _traded_exchanges = d.pop("tradedExchanges", UNSET) + for traded_exchanges_item_data in _traded_exchanges or []: + traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) + + traded_exchanges.append(traded_exchanges_item) + + cap_percentage = d.pop("capPercentage", UNSET) + + _creation_dt = d.pop("creationDt", UNSET) + creation_dt: Unset | Date + if isinstance(_creation_dt, Unset): + creation_dt = UNSET + else: + creation_dt = Date.from_dict(_creation_dt) + + deliverable_per_contract = d.pop("deliverablePerContract", UNSET) + + _exercise_style = d.pop("exerciseStyle", UNSET) + exercise_style: Unset | OptionExerciseStyle + if isinstance(_exercise_style, Unset): + exercise_style = UNSET + else: + exercise_style = OptionExerciseStyle(_exercise_style) + + _expiration_dt = d.pop("expirationDt", UNSET) + expiration_dt: Unset | Date + if isinstance(_expiration_dt, Unset): + expiration_dt = UNSET + else: + expiration_dt = Date.from_dict(_expiration_dt) + + observation_day = d.pop("observationDay", UNSET) + + percentage_pricing = d.pop("percentagePricing", UNSET) + + _product_type = d.pop("productType", UNSET) + product_type: Unset | OptionSeriesProductType + if isinstance(_product_type, Unset): + product_type = UNSET + else: + product_type = OptionSeriesProductType(_product_type) + + _put_call = d.pop("putCall", UNSET) + put_call: Unset | PutCall + if isinstance(_put_call, Unset): + put_call = UNSET + else: + put_call = PutCall(_put_call) + + root = d.pop("root", UNSET) + + root_base = d.pop("rootBase", UNSET) + + _settlement_type = d.pop("settlementType", UNSET) + settlement_type: Unset | OptionSettlementType + if isinstance(_settlement_type, Unset): + settlement_type = UNSET + else: + settlement_type = OptionSettlementType(_settlement_type) + + strike = d.pop("strike", UNSET) + + underlying = d.pop("underlying", UNSET) + + flex_option = cls( + aliases=aliases, + currency=currency, + listed_dt=listed_dt, + delisted_dt=delisted_dt, + description=description, + exchange_id=exchange_id, + id=id, + multiplier=multiplier, + price_base_factor=price_base_factor, + price_display_factor=price_display_factor, + price_display_format=price_display_format, + qty_display_factor=qty_display_factor, + qty_display_format=qty_display_format, + security_category=security_category, + symbol=symbol, + tick_rule=tick_rule, + tick_size=tick_size, + tick_value=tick_value, + traded_exchanges=traded_exchanges, + cap_percentage=cap_percentage, + creation_dt=creation_dt, + deliverable_per_contract=deliverable_per_contract, + exercise_style=exercise_style, + expiration_dt=expiration_dt, + observation_day=observation_day, + percentage_pricing=percentage_pricing, + product_type=product_type, + put_call=put_call, + root=root, + root_base=root_base, + settlement_type=settlement_type, + strike=strike, + underlying=underlying, + ) + + return flex_option diff --git a/openapi/openapi_project/openapi_package/models/flex_option_aliases.py b/openapi/openapi_project/openapi_package/models/flex_option_aliases.py new file mode 100644 index 000000000..b0d5a6edc --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/flex_option_aliases.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="FlexOptionAliases") + + +@_attrs_define +class FlexOptionAliases: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + flex_option_aliases = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + flex_option_aliases.additional_properties = additional_properties + return flex_option_aliases + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/flex_settlement_type.py b/openapi/openapi_project/openapi_package/models/flex_settlement_type.py new file mode 100644 index 000000000..4c2b8eb1a --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/flex_settlement_type.py @@ -0,0 +1,12 @@ +from enum import Enum + + +class FlexSettlementType(str, Enum): + FLEX_SETTLEMENT_TYPE_AM = "FLEX_SETTLEMENT_TYPE_AM" + FLEX_SETTLEMENT_TYPE_ASIAN = "FLEX_SETTLEMENT_TYPE_ASIAN" + FLEX_SETTLEMENT_TYPE_CLIQUET = "FLEX_SETTLEMENT_TYPE_CLIQUET" + FLEX_SETTLEMENT_TYPE_PM = "FLEX_SETTLEMENT_TYPE_PM" + FLEX_SETTLEMENT_TYPE_PM_CASH = "FLEX_SETTLEMENT_TYPE_PM_CASH" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/future.py b/openapi/openapi_project/openapi_package/models/future.py new file mode 100644 index 000000000..c27b81445 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/future.py @@ -0,0 +1,364 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.currency import Currency +from ..models.exchange_code import ExchangeCode +from ..models.numeric_display_format import NumericDisplayFormat +from ..models.security_category import SecurityCategory +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.date import Date + from ..models.future_aliases import FutureAliases + from ..models.future_root import FutureRoot + + +T = TypeVar("T", bound="Future") + + +@_attrs_define +class Future: + """ + Attributes: + aliases (Union[Unset, FutureAliases]): + currency (Union[Unset, Currency]): + listed_dt (Union[Unset, Date]): + delisted_dt (Union[Unset, Date]): + description (Union[Unset, str]): + exchange_id (Union[Unset, int]): + id (Union[Unset, int]): + multiplier (Union[Unset, float]): + price_base_factor (Union[Unset, float]): + price_display_factor (Union[Unset, float]): + price_display_format (Union[Unset, NumericDisplayFormat]): + qty_display_factor (Union[Unset, float]): + qty_display_format (Union[Unset, NumericDisplayFormat]): + security_category (Union[Unset, SecurityCategory]): + symbol (Union[Unset, str]): + tick_rule (Union[Unset, str]): + tick_size (Union[Unset, float]): + tick_value (Union[Unset, float]): + traded_exchanges (Union[Unset, list[ExchangeCode]]): + contract_myy (Union[Unset, str]): + first_notice_dt (Union[Unset, Date]): + first_trade_dt (Union[Unset, Date]): + last_notice_dt (Union[Unset, Date]): + last_trade_dt (Union[Unset, Date]): + root (Union[Unset, FutureRoot]): + """ + + aliases: Union[Unset, "FutureAliases"] = UNSET + currency: Unset | Currency = UNSET + listed_dt: Union[Unset, "Date"] = UNSET + delisted_dt: Union[Unset, "Date"] = UNSET + description: Unset | str = UNSET + exchange_id: Unset | int = UNSET + id: Unset | int = UNSET + multiplier: Unset | float = UNSET + price_base_factor: Unset | float = UNSET + price_display_factor: Unset | float = UNSET + price_display_format: Unset | NumericDisplayFormat = UNSET + qty_display_factor: Unset | float = UNSET + qty_display_format: Unset | NumericDisplayFormat = UNSET + security_category: Unset | SecurityCategory = UNSET + symbol: Unset | str = UNSET + tick_rule: Unset | str = UNSET + tick_size: Unset | float = UNSET + tick_value: Unset | float = UNSET + traded_exchanges: Unset | list[ExchangeCode] = UNSET + contract_myy: Unset | str = UNSET + first_notice_dt: Union[Unset, "Date"] = UNSET + first_trade_dt: Union[Unset, "Date"] = UNSET + last_notice_dt: Union[Unset, "Date"] = UNSET + last_trade_dt: Union[Unset, "Date"] = UNSET + root: Union[Unset, "FutureRoot"] = UNSET + + def to_dict(self) -> dict[str, Any]: + aliases: Unset | dict[str, Any] = UNSET + if not isinstance(self.aliases, Unset): + aliases = self.aliases.to_dict() + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + listed_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.listed_dt, Unset): + listed_dt = self.listed_dt.to_dict() + + delisted_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.delisted_dt, Unset): + delisted_dt = self.delisted_dt.to_dict() + + description = self.description + + exchange_id = self.exchange_id + + id = self.id + + multiplier = self.multiplier + + price_base_factor = self.price_base_factor + + price_display_factor = self.price_display_factor + + price_display_format: Unset | str = UNSET + if not isinstance(self.price_display_format, Unset): + price_display_format = self.price_display_format.value + + qty_display_factor = self.qty_display_factor + + qty_display_format: Unset | str = UNSET + if not isinstance(self.qty_display_format, Unset): + qty_display_format = self.qty_display_format.value + + security_category: Unset | str = UNSET + if not isinstance(self.security_category, Unset): + security_category = self.security_category.value + + symbol = self.symbol + + tick_rule = self.tick_rule + + tick_size = self.tick_size + + tick_value = self.tick_value + + traded_exchanges: Unset | list[str] = UNSET + if not isinstance(self.traded_exchanges, Unset): + traded_exchanges = [] + for traded_exchanges_item_data in self.traded_exchanges: + traded_exchanges_item = traded_exchanges_item_data.value + traded_exchanges.append(traded_exchanges_item) + + contract_myy = self.contract_myy + + first_notice_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.first_notice_dt, Unset): + first_notice_dt = self.first_notice_dt.to_dict() + + first_trade_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.first_trade_dt, Unset): + first_trade_dt = self.first_trade_dt.to_dict() + + last_notice_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.last_notice_dt, Unset): + last_notice_dt = self.last_notice_dt.to_dict() + + last_trade_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.last_trade_dt, Unset): + last_trade_dt = self.last_trade_dt.to_dict() + + root: Unset | dict[str, Any] = UNSET + if not isinstance(self.root, Unset): + root = self.root.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if aliases is not UNSET: + field_dict["aliases"] = aliases + if currency is not UNSET: + field_dict["currency"] = currency + if listed_dt is not UNSET: + field_dict["listedDt"] = listed_dt + if delisted_dt is not UNSET: + field_dict["delistedDt"] = delisted_dt + if description is not UNSET: + field_dict["description"] = description + if exchange_id is not UNSET: + field_dict["exchangeId"] = exchange_id + if id is not UNSET: + field_dict["id"] = id + if multiplier is not UNSET: + field_dict["multiplier"] = multiplier + if price_base_factor is not UNSET: + field_dict["priceBaseFactor"] = price_base_factor + if price_display_factor is not UNSET: + field_dict["priceDisplayFactor"] = price_display_factor + if price_display_format is not UNSET: + field_dict["priceDisplayFormat"] = price_display_format + if qty_display_factor is not UNSET: + field_dict["qtyDisplayFactor"] = qty_display_factor + if qty_display_format is not UNSET: + field_dict["qtyDisplayFormat"] = qty_display_format + if security_category is not UNSET: + field_dict["securityCategory"] = security_category + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tick_rule is not UNSET: + field_dict["tickRule"] = tick_rule + if tick_size is not UNSET: + field_dict["tickSize"] = tick_size + if tick_value is not UNSET: + field_dict["tickValue"] = tick_value + if traded_exchanges is not UNSET: + field_dict["tradedExchanges"] = traded_exchanges + if contract_myy is not UNSET: + field_dict["contractMYY"] = contract_myy + if first_notice_dt is not UNSET: + field_dict["firstNoticeDt"] = first_notice_dt + if first_trade_dt is not UNSET: + field_dict["firstTradeDt"] = first_trade_dt + if last_notice_dt is not UNSET: + field_dict["lastNoticeDt"] = last_notice_dt + if last_trade_dt is not UNSET: + field_dict["lastTradeDt"] = last_trade_dt + if root is not UNSET: + field_dict["root"] = root + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.date import Date + from ..models.future_aliases import FutureAliases + from ..models.future_root import FutureRoot + + d = dict(src_dict) + _aliases = d.pop("aliases", UNSET) + aliases: Unset | FutureAliases + if isinstance(_aliases, Unset): + aliases = UNSET + else: + aliases = FutureAliases.from_dict(_aliases) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + _listed_dt = d.pop("listedDt", UNSET) + listed_dt: Unset | Date + if isinstance(_listed_dt, Unset): + listed_dt = UNSET + else: + listed_dt = Date.from_dict(_listed_dt) + + _delisted_dt = d.pop("delistedDt", UNSET) + delisted_dt: Unset | Date + if isinstance(_delisted_dt, Unset): + delisted_dt = UNSET + else: + delisted_dt = Date.from_dict(_delisted_dt) + + description = d.pop("description", UNSET) + + exchange_id = d.pop("exchangeId", UNSET) + + id = d.pop("id", UNSET) + + multiplier = d.pop("multiplier", UNSET) + + price_base_factor = d.pop("priceBaseFactor", UNSET) + + price_display_factor = d.pop("priceDisplayFactor", UNSET) + + _price_display_format = d.pop("priceDisplayFormat", UNSET) + price_display_format: Unset | NumericDisplayFormat + if isinstance(_price_display_format, Unset): + price_display_format = UNSET + else: + price_display_format = NumericDisplayFormat(_price_display_format) + + qty_display_factor = d.pop("qtyDisplayFactor", UNSET) + + _qty_display_format = d.pop("qtyDisplayFormat", UNSET) + qty_display_format: Unset | NumericDisplayFormat + if isinstance(_qty_display_format, Unset): + qty_display_format = UNSET + else: + qty_display_format = NumericDisplayFormat(_qty_display_format) + + _security_category = d.pop("securityCategory", UNSET) + security_category: Unset | SecurityCategory + if isinstance(_security_category, Unset): + security_category = UNSET + else: + security_category = SecurityCategory(_security_category) + + symbol = d.pop("symbol", UNSET) + + tick_rule = d.pop("tickRule", UNSET) + + tick_size = d.pop("tickSize", UNSET) + + tick_value = d.pop("tickValue", UNSET) + + traded_exchanges = [] + _traded_exchanges = d.pop("tradedExchanges", UNSET) + for traded_exchanges_item_data in _traded_exchanges or []: + traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) + + traded_exchanges.append(traded_exchanges_item) + + contract_myy = d.pop("contractMYY", UNSET) + + _first_notice_dt = d.pop("firstNoticeDt", UNSET) + first_notice_dt: Unset | Date + if isinstance(_first_notice_dt, Unset): + first_notice_dt = UNSET + else: + first_notice_dt = Date.from_dict(_first_notice_dt) + + _first_trade_dt = d.pop("firstTradeDt", UNSET) + first_trade_dt: Unset | Date + if isinstance(_first_trade_dt, Unset): + first_trade_dt = UNSET + else: + first_trade_dt = Date.from_dict(_first_trade_dt) + + _last_notice_dt = d.pop("lastNoticeDt", UNSET) + last_notice_dt: Unset | Date + if isinstance(_last_notice_dt, Unset): + last_notice_dt = UNSET + else: + last_notice_dt = Date.from_dict(_last_notice_dt) + + _last_trade_dt = d.pop("lastTradeDt", UNSET) + last_trade_dt: Unset | Date + if isinstance(_last_trade_dt, Unset): + last_trade_dt = UNSET + else: + last_trade_dt = Date.from_dict(_last_trade_dt) + + _root = d.pop("root", UNSET) + root: Unset | FutureRoot + if isinstance(_root, Unset): + root = UNSET + else: + root = FutureRoot.from_dict(_root) + + future = cls( + aliases=aliases, + currency=currency, + listed_dt=listed_dt, + delisted_dt=delisted_dt, + description=description, + exchange_id=exchange_id, + id=id, + multiplier=multiplier, + price_base_factor=price_base_factor, + price_display_factor=price_display_factor, + price_display_format=price_display_format, + qty_display_factor=qty_display_factor, + qty_display_format=qty_display_format, + security_category=security_category, + symbol=symbol, + tick_rule=tick_rule, + tick_size=tick_size, + tick_value=tick_value, + traded_exchanges=traded_exchanges, + contract_myy=contract_myy, + first_notice_dt=first_notice_dt, + first_trade_dt=first_trade_dt, + last_notice_dt=last_notice_dt, + last_trade_dt=last_trade_dt, + root=root, + ) + + return future diff --git a/openapi/openapi_project/openapi_package/models/future_aliases.py b/openapi/openapi_project/openapi_package/models/future_aliases.py new file mode 100644 index 000000000..99b81ab33 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/future_aliases.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="FutureAliases") + + +@_attrs_define +class FutureAliases: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + future_aliases = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + future_aliases.additional_properties = additional_properties + return future_aliases + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/future_root.py b/openapi/openapi_project/openapi_package/models/future_root.py new file mode 100644 index 000000000..4523534a1 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/future_root.py @@ -0,0 +1,364 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.currency import Currency +from ..models.exchange_code import ExchangeCode +from ..models.numeric_display_format import NumericDisplayFormat +from ..models.product_group import ProductGroup +from ..models.product_sub_group import ProductSubGroup +from ..models.security_category import SecurityCategory +from ..models.settlement_deliverable_type import SettlementDeliverableType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.date import Date + from ..models.future_root_aliases import FutureRootAliases + from ..models.trading_session_group import TradingSessionGroup + + +T = TypeVar("T", bound="FutureRoot") + + +@_attrs_define +class FutureRoot: + """ + Attributes: + aliases (Union[Unset, FutureRootAliases]): + currency (Union[Unset, Currency]): + listed_dt (Union[Unset, Date]): + delisted_dt (Union[Unset, Date]): + description (Union[Unset, str]): + exchange_id (Union[Unset, int]): + id (Union[Unset, int]): + multiplier (Union[Unset, float]): + price_base_factor (Union[Unset, float]): + price_display_factor (Union[Unset, float]): + price_display_format (Union[Unset, NumericDisplayFormat]): + qty_display_factor (Union[Unset, float]): + qty_display_format (Union[Unset, NumericDisplayFormat]): + security_category (Union[Unset, SecurityCategory]): + symbol (Union[Unset, str]): + tick_rule (Union[Unset, str]): + tick_size (Union[Unset, float]): + tick_value (Union[Unset, float]): + traded_exchanges (Union[Unset, list[ExchangeCode]]): + product_group (Union[Unset, ProductGroup]): + product_sub_group (Union[Unset, ProductSubGroup]): + settlement_deliverable_type (Union[Unset, SettlementDeliverableType]): + unit_of_measure (Union[Unset, str]): + unit_of_measure_qty (Union[Unset, float]): + trading_session_group (Union[Unset, TradingSessionGroup]): + """ + + aliases: Union[Unset, "FutureRootAliases"] = UNSET + currency: Unset | Currency = UNSET + listed_dt: Union[Unset, "Date"] = UNSET + delisted_dt: Union[Unset, "Date"] = UNSET + description: Unset | str = UNSET + exchange_id: Unset | int = UNSET + id: Unset | int = UNSET + multiplier: Unset | float = UNSET + price_base_factor: Unset | float = UNSET + price_display_factor: Unset | float = UNSET + price_display_format: Unset | NumericDisplayFormat = UNSET + qty_display_factor: Unset | float = UNSET + qty_display_format: Unset | NumericDisplayFormat = UNSET + security_category: Unset | SecurityCategory = UNSET + symbol: Unset | str = UNSET + tick_rule: Unset | str = UNSET + tick_size: Unset | float = UNSET + tick_value: Unset | float = UNSET + traded_exchanges: Unset | list[ExchangeCode] = UNSET + product_group: Unset | ProductGroup = UNSET + product_sub_group: Unset | ProductSubGroup = UNSET + settlement_deliverable_type: Unset | SettlementDeliverableType = UNSET + unit_of_measure: Unset | str = UNSET + unit_of_measure_qty: Unset | float = UNSET + trading_session_group: Union[Unset, "TradingSessionGroup"] = UNSET + + def to_dict(self) -> dict[str, Any]: + aliases: Unset | dict[str, Any] = UNSET + if not isinstance(self.aliases, Unset): + aliases = self.aliases.to_dict() + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + listed_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.listed_dt, Unset): + listed_dt = self.listed_dt.to_dict() + + delisted_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.delisted_dt, Unset): + delisted_dt = self.delisted_dt.to_dict() + + description = self.description + + exchange_id = self.exchange_id + + id = self.id + + multiplier = self.multiplier + + price_base_factor = self.price_base_factor + + price_display_factor = self.price_display_factor + + price_display_format: Unset | str = UNSET + if not isinstance(self.price_display_format, Unset): + price_display_format = self.price_display_format.value + + qty_display_factor = self.qty_display_factor + + qty_display_format: Unset | str = UNSET + if not isinstance(self.qty_display_format, Unset): + qty_display_format = self.qty_display_format.value + + security_category: Unset | str = UNSET + if not isinstance(self.security_category, Unset): + security_category = self.security_category.value + + symbol = self.symbol + + tick_rule = self.tick_rule + + tick_size = self.tick_size + + tick_value = self.tick_value + + traded_exchanges: Unset | list[str] = UNSET + if not isinstance(self.traded_exchanges, Unset): + traded_exchanges = [] + for traded_exchanges_item_data in self.traded_exchanges: + traded_exchanges_item = traded_exchanges_item_data.value + traded_exchanges.append(traded_exchanges_item) + + product_group: Unset | str = UNSET + if not isinstance(self.product_group, Unset): + product_group = self.product_group.value + + product_sub_group: Unset | str = UNSET + if not isinstance(self.product_sub_group, Unset): + product_sub_group = self.product_sub_group.value + + settlement_deliverable_type: Unset | str = UNSET + if not isinstance(self.settlement_deliverable_type, Unset): + settlement_deliverable_type = self.settlement_deliverable_type.value + + unit_of_measure = self.unit_of_measure + + unit_of_measure_qty = self.unit_of_measure_qty + + trading_session_group: Unset | dict[str, Any] = UNSET + if not isinstance(self.trading_session_group, Unset): + trading_session_group = self.trading_session_group.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if aliases is not UNSET: + field_dict["aliases"] = aliases + if currency is not UNSET: + field_dict["currency"] = currency + if listed_dt is not UNSET: + field_dict["listedDt"] = listed_dt + if delisted_dt is not UNSET: + field_dict["delistedDt"] = delisted_dt + if description is not UNSET: + field_dict["description"] = description + if exchange_id is not UNSET: + field_dict["exchangeId"] = exchange_id + if id is not UNSET: + field_dict["id"] = id + if multiplier is not UNSET: + field_dict["multiplier"] = multiplier + if price_base_factor is not UNSET: + field_dict["priceBaseFactor"] = price_base_factor + if price_display_factor is not UNSET: + field_dict["priceDisplayFactor"] = price_display_factor + if price_display_format is not UNSET: + field_dict["priceDisplayFormat"] = price_display_format + if qty_display_factor is not UNSET: + field_dict["qtyDisplayFactor"] = qty_display_factor + if qty_display_format is not UNSET: + field_dict["qtyDisplayFormat"] = qty_display_format + if security_category is not UNSET: + field_dict["securityCategory"] = security_category + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tick_rule is not UNSET: + field_dict["tickRule"] = tick_rule + if tick_size is not UNSET: + field_dict["tickSize"] = tick_size + if tick_value is not UNSET: + field_dict["tickValue"] = tick_value + if traded_exchanges is not UNSET: + field_dict["tradedExchanges"] = traded_exchanges + if product_group is not UNSET: + field_dict["productGroup"] = product_group + if product_sub_group is not UNSET: + field_dict["productSubGroup"] = product_sub_group + if settlement_deliverable_type is not UNSET: + field_dict["settlementDeliverableType"] = settlement_deliverable_type + if unit_of_measure is not UNSET: + field_dict["unitOfMeasure"] = unit_of_measure + if unit_of_measure_qty is not UNSET: + field_dict["unitOfMeasureQty"] = unit_of_measure_qty + if trading_session_group is not UNSET: + field_dict["tradingSessionGroup"] = trading_session_group + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.date import Date + from ..models.future_root_aliases import FutureRootAliases + from ..models.trading_session_group import TradingSessionGroup + + d = dict(src_dict) + _aliases = d.pop("aliases", UNSET) + aliases: Unset | FutureRootAliases + if isinstance(_aliases, Unset): + aliases = UNSET + else: + aliases = FutureRootAliases.from_dict(_aliases) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + _listed_dt = d.pop("listedDt", UNSET) + listed_dt: Unset | Date + if isinstance(_listed_dt, Unset): + listed_dt = UNSET + else: + listed_dt = Date.from_dict(_listed_dt) + + _delisted_dt = d.pop("delistedDt", UNSET) + delisted_dt: Unset | Date + if isinstance(_delisted_dt, Unset): + delisted_dt = UNSET + else: + delisted_dt = Date.from_dict(_delisted_dt) + + description = d.pop("description", UNSET) + + exchange_id = d.pop("exchangeId", UNSET) + + id = d.pop("id", UNSET) + + multiplier = d.pop("multiplier", UNSET) + + price_base_factor = d.pop("priceBaseFactor", UNSET) + + price_display_factor = d.pop("priceDisplayFactor", UNSET) + + _price_display_format = d.pop("priceDisplayFormat", UNSET) + price_display_format: Unset | NumericDisplayFormat + if isinstance(_price_display_format, Unset): + price_display_format = UNSET + else: + price_display_format = NumericDisplayFormat(_price_display_format) + + qty_display_factor = d.pop("qtyDisplayFactor", UNSET) + + _qty_display_format = d.pop("qtyDisplayFormat", UNSET) + qty_display_format: Unset | NumericDisplayFormat + if isinstance(_qty_display_format, Unset): + qty_display_format = UNSET + else: + qty_display_format = NumericDisplayFormat(_qty_display_format) + + _security_category = d.pop("securityCategory", UNSET) + security_category: Unset | SecurityCategory + if isinstance(_security_category, Unset): + security_category = UNSET + else: + security_category = SecurityCategory(_security_category) + + symbol = d.pop("symbol", UNSET) + + tick_rule = d.pop("tickRule", UNSET) + + tick_size = d.pop("tickSize", UNSET) + + tick_value = d.pop("tickValue", UNSET) + + traded_exchanges = [] + _traded_exchanges = d.pop("tradedExchanges", UNSET) + for traded_exchanges_item_data in _traded_exchanges or []: + traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) + + traded_exchanges.append(traded_exchanges_item) + + _product_group = d.pop("productGroup", UNSET) + product_group: Unset | ProductGroup + if isinstance(_product_group, Unset): + product_group = UNSET + else: + product_group = ProductGroup(_product_group) + + _product_sub_group = d.pop("productSubGroup", UNSET) + product_sub_group: Unset | ProductSubGroup + if isinstance(_product_sub_group, Unset): + product_sub_group = UNSET + else: + product_sub_group = ProductSubGroup(_product_sub_group) + + _settlement_deliverable_type = d.pop("settlementDeliverableType", UNSET) + settlement_deliverable_type: Unset | SettlementDeliverableType + if isinstance(_settlement_deliverable_type, Unset): + settlement_deliverable_type = UNSET + else: + settlement_deliverable_type = SettlementDeliverableType( + _settlement_deliverable_type + ) + + unit_of_measure = d.pop("unitOfMeasure", UNSET) + + unit_of_measure_qty = d.pop("unitOfMeasureQty", UNSET) + + _trading_session_group = d.pop("tradingSessionGroup", UNSET) + trading_session_group: Unset | TradingSessionGroup + if isinstance(_trading_session_group, Unset): + trading_session_group = UNSET + else: + trading_session_group = TradingSessionGroup.from_dict( + _trading_session_group + ) + + future_root = cls( + aliases=aliases, + currency=currency, + listed_dt=listed_dt, + delisted_dt=delisted_dt, + description=description, + exchange_id=exchange_id, + id=id, + multiplier=multiplier, + price_base_factor=price_base_factor, + price_display_factor=price_display_factor, + price_display_format=price_display_format, + qty_display_factor=qty_display_factor, + qty_display_format=qty_display_format, + security_category=security_category, + symbol=symbol, + tick_rule=tick_rule, + tick_size=tick_size, + tick_value=tick_value, + traded_exchanges=traded_exchanges, + product_group=product_group, + product_sub_group=product_sub_group, + settlement_deliverable_type=settlement_deliverable_type, + unit_of_measure=unit_of_measure, + unit_of_measure_qty=unit_of_measure_qty, + trading_session_group=trading_session_group, + ) + + return future_root diff --git a/openapi/openapi_project/openapi_package/models/future_root_aliases.py b/openapi/openapi_project/openapi_package/models/future_root_aliases.py new file mode 100644 index 000000000..b6f75b0a9 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/future_root_aliases.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="FutureRootAliases") + + +@_attrs_define +class FutureRootAliases: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + future_root_aliases = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + future_root_aliases.additional_properties = additional_properties + return future_root_aliases + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/future_spread.py b/openapi/openapi_project/openapi_package/models/future_spread.py new file mode 100644 index 000000000..c804658be --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/future_spread.py @@ -0,0 +1,385 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.currency import Currency +from ..models.exchange_code import ExchangeCode +from ..models.numeric_display_format import NumericDisplayFormat +from ..models.security_category import SecurityCategory +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.date import Date + from ..models.future_spread_aliases import FutureSpreadAliases + from ..models.future_spread_leg import FutureSpreadLeg + + +T = TypeVar("T", bound="FutureSpread") + + +@_attrs_define +class FutureSpread: + """ + Attributes: + aliases (Union[Unset, FutureSpreadAliases]): + currency (Union[Unset, Currency]): + listed_dt (Union[Unset, Date]): + delisted_dt (Union[Unset, Date]): + description (Union[Unset, str]): + exchange_id (Union[Unset, int]): + id (Union[Unset, int]): + multiplier (Union[Unset, float]): + price_base_factor (Union[Unset, float]): + price_display_factor (Union[Unset, float]): + price_display_format (Union[Unset, NumericDisplayFormat]): + qty_display_factor (Union[Unset, float]): + qty_display_format (Union[Unset, NumericDisplayFormat]): + security_category (Union[Unset, SecurityCategory]): + symbol (Union[Unset, str]): + tick_rule (Union[Unset, str]): + tick_size (Union[Unset, float]): + tick_value (Union[Unset, float]): + traded_exchanges (Union[Unset, list[ExchangeCode]]): + contract_myy (Union[Unset, str]): + display_factor (Union[Unset, float]): + first_notice_dt (Union[Unset, Date]): + first_trade_dt (Union[Unset, Date]): + last_notice_dt (Union[Unset, Date]): + last_trade_dt (Union[Unset, Date]): + legs (Union[Unset, list['FutureSpreadLeg']]): + spread_code (Union[Unset, str]): + """ + + aliases: Union[Unset, "FutureSpreadAliases"] = UNSET + currency: Unset | Currency = UNSET + listed_dt: Union[Unset, "Date"] = UNSET + delisted_dt: Union[Unset, "Date"] = UNSET + description: Unset | str = UNSET + exchange_id: Unset | int = UNSET + id: Unset | int = UNSET + multiplier: Unset | float = UNSET + price_base_factor: Unset | float = UNSET + price_display_factor: Unset | float = UNSET + price_display_format: Unset | NumericDisplayFormat = UNSET + qty_display_factor: Unset | float = UNSET + qty_display_format: Unset | NumericDisplayFormat = UNSET + security_category: Unset | SecurityCategory = UNSET + symbol: Unset | str = UNSET + tick_rule: Unset | str = UNSET + tick_size: Unset | float = UNSET + tick_value: Unset | float = UNSET + traded_exchanges: Unset | list[ExchangeCode] = UNSET + contract_myy: Unset | str = UNSET + display_factor: Unset | float = UNSET + first_notice_dt: Union[Unset, "Date"] = UNSET + first_trade_dt: Union[Unset, "Date"] = UNSET + last_notice_dt: Union[Unset, "Date"] = UNSET + last_trade_dt: Union[Unset, "Date"] = UNSET + legs: Unset | list["FutureSpreadLeg"] = UNSET + spread_code: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + aliases: Unset | dict[str, Any] = UNSET + if not isinstance(self.aliases, Unset): + aliases = self.aliases.to_dict() + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + listed_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.listed_dt, Unset): + listed_dt = self.listed_dt.to_dict() + + delisted_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.delisted_dt, Unset): + delisted_dt = self.delisted_dt.to_dict() + + description = self.description + + exchange_id = self.exchange_id + + id = self.id + + multiplier = self.multiplier + + price_base_factor = self.price_base_factor + + price_display_factor = self.price_display_factor + + price_display_format: Unset | str = UNSET + if not isinstance(self.price_display_format, Unset): + price_display_format = self.price_display_format.value + + qty_display_factor = self.qty_display_factor + + qty_display_format: Unset | str = UNSET + if not isinstance(self.qty_display_format, Unset): + qty_display_format = self.qty_display_format.value + + security_category: Unset | str = UNSET + if not isinstance(self.security_category, Unset): + security_category = self.security_category.value + + symbol = self.symbol + + tick_rule = self.tick_rule + + tick_size = self.tick_size + + tick_value = self.tick_value + + traded_exchanges: Unset | list[str] = UNSET + if not isinstance(self.traded_exchanges, Unset): + traded_exchanges = [] + for traded_exchanges_item_data in self.traded_exchanges: + traded_exchanges_item = traded_exchanges_item_data.value + traded_exchanges.append(traded_exchanges_item) + + contract_myy = self.contract_myy + + display_factor = self.display_factor + + first_notice_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.first_notice_dt, Unset): + first_notice_dt = self.first_notice_dt.to_dict() + + first_trade_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.first_trade_dt, Unset): + first_trade_dt = self.first_trade_dt.to_dict() + + last_notice_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.last_notice_dt, Unset): + last_notice_dt = self.last_notice_dt.to_dict() + + last_trade_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.last_trade_dt, Unset): + last_trade_dt = self.last_trade_dt.to_dict() + + legs: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.legs, Unset): + legs = [] + for legs_item_data in self.legs: + legs_item = legs_item_data.to_dict() + legs.append(legs_item) + + spread_code = self.spread_code + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if aliases is not UNSET: + field_dict["aliases"] = aliases + if currency is not UNSET: + field_dict["currency"] = currency + if listed_dt is not UNSET: + field_dict["listedDt"] = listed_dt + if delisted_dt is not UNSET: + field_dict["delistedDt"] = delisted_dt + if description is not UNSET: + field_dict["description"] = description + if exchange_id is not UNSET: + field_dict["exchangeId"] = exchange_id + if id is not UNSET: + field_dict["id"] = id + if multiplier is not UNSET: + field_dict["multiplier"] = multiplier + if price_base_factor is not UNSET: + field_dict["priceBaseFactor"] = price_base_factor + if price_display_factor is not UNSET: + field_dict["priceDisplayFactor"] = price_display_factor + if price_display_format is not UNSET: + field_dict["priceDisplayFormat"] = price_display_format + if qty_display_factor is not UNSET: + field_dict["qtyDisplayFactor"] = qty_display_factor + if qty_display_format is not UNSET: + field_dict["qtyDisplayFormat"] = qty_display_format + if security_category is not UNSET: + field_dict["securityCategory"] = security_category + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tick_rule is not UNSET: + field_dict["tickRule"] = tick_rule + if tick_size is not UNSET: + field_dict["tickSize"] = tick_size + if tick_value is not UNSET: + field_dict["tickValue"] = tick_value + if traded_exchanges is not UNSET: + field_dict["tradedExchanges"] = traded_exchanges + if contract_myy is not UNSET: + field_dict["contractMYY"] = contract_myy + if display_factor is not UNSET: + field_dict["displayFactor"] = display_factor + if first_notice_dt is not UNSET: + field_dict["firstNoticeDt"] = first_notice_dt + if first_trade_dt is not UNSET: + field_dict["firstTradeDt"] = first_trade_dt + if last_notice_dt is not UNSET: + field_dict["lastNoticeDt"] = last_notice_dt + if last_trade_dt is not UNSET: + field_dict["lastTradeDt"] = last_trade_dt + if legs is not UNSET: + field_dict["legs"] = legs + if spread_code is not UNSET: + field_dict["spreadCode"] = spread_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.date import Date + from ..models.future_spread_aliases import FutureSpreadAliases + from ..models.future_spread_leg import FutureSpreadLeg + + d = dict(src_dict) + _aliases = d.pop("aliases", UNSET) + aliases: Unset | FutureSpreadAliases + if isinstance(_aliases, Unset): + aliases = UNSET + else: + aliases = FutureSpreadAliases.from_dict(_aliases) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + _listed_dt = d.pop("listedDt", UNSET) + listed_dt: Unset | Date + if isinstance(_listed_dt, Unset): + listed_dt = UNSET + else: + listed_dt = Date.from_dict(_listed_dt) + + _delisted_dt = d.pop("delistedDt", UNSET) + delisted_dt: Unset | Date + if isinstance(_delisted_dt, Unset): + delisted_dt = UNSET + else: + delisted_dt = Date.from_dict(_delisted_dt) + + description = d.pop("description", UNSET) + + exchange_id = d.pop("exchangeId", UNSET) + + id = d.pop("id", UNSET) + + multiplier = d.pop("multiplier", UNSET) + + price_base_factor = d.pop("priceBaseFactor", UNSET) + + price_display_factor = d.pop("priceDisplayFactor", UNSET) + + _price_display_format = d.pop("priceDisplayFormat", UNSET) + price_display_format: Unset | NumericDisplayFormat + if isinstance(_price_display_format, Unset): + price_display_format = UNSET + else: + price_display_format = NumericDisplayFormat(_price_display_format) + + qty_display_factor = d.pop("qtyDisplayFactor", UNSET) + + _qty_display_format = d.pop("qtyDisplayFormat", UNSET) + qty_display_format: Unset | NumericDisplayFormat + if isinstance(_qty_display_format, Unset): + qty_display_format = UNSET + else: + qty_display_format = NumericDisplayFormat(_qty_display_format) + + _security_category = d.pop("securityCategory", UNSET) + security_category: Unset | SecurityCategory + if isinstance(_security_category, Unset): + security_category = UNSET + else: + security_category = SecurityCategory(_security_category) + + symbol = d.pop("symbol", UNSET) + + tick_rule = d.pop("tickRule", UNSET) + + tick_size = d.pop("tickSize", UNSET) + + tick_value = d.pop("tickValue", UNSET) + + traded_exchanges = [] + _traded_exchanges = d.pop("tradedExchanges", UNSET) + for traded_exchanges_item_data in _traded_exchanges or []: + traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) + + traded_exchanges.append(traded_exchanges_item) + + contract_myy = d.pop("contractMYY", UNSET) + + display_factor = d.pop("displayFactor", UNSET) + + _first_notice_dt = d.pop("firstNoticeDt", UNSET) + first_notice_dt: Unset | Date + if isinstance(_first_notice_dt, Unset): + first_notice_dt = UNSET + else: + first_notice_dt = Date.from_dict(_first_notice_dt) + + _first_trade_dt = d.pop("firstTradeDt", UNSET) + first_trade_dt: Unset | Date + if isinstance(_first_trade_dt, Unset): + first_trade_dt = UNSET + else: + first_trade_dt = Date.from_dict(_first_trade_dt) + + _last_notice_dt = d.pop("lastNoticeDt", UNSET) + last_notice_dt: Unset | Date + if isinstance(_last_notice_dt, Unset): + last_notice_dt = UNSET + else: + last_notice_dt = Date.from_dict(_last_notice_dt) + + _last_trade_dt = d.pop("lastTradeDt", UNSET) + last_trade_dt: Unset | Date + if isinstance(_last_trade_dt, Unset): + last_trade_dt = UNSET + else: + last_trade_dt = Date.from_dict(_last_trade_dt) + + legs = [] + _legs = d.pop("legs", UNSET) + for legs_item_data in _legs or []: + legs_item = FutureSpreadLeg.from_dict(legs_item_data) + + legs.append(legs_item) + + spread_code = d.pop("spreadCode", UNSET) + + future_spread = cls( + aliases=aliases, + currency=currency, + listed_dt=listed_dt, + delisted_dt=delisted_dt, + description=description, + exchange_id=exchange_id, + id=id, + multiplier=multiplier, + price_base_factor=price_base_factor, + price_display_factor=price_display_factor, + price_display_format=price_display_format, + qty_display_factor=qty_display_factor, + qty_display_format=qty_display_format, + security_category=security_category, + symbol=symbol, + tick_rule=tick_rule, + tick_size=tick_size, + tick_value=tick_value, + traded_exchanges=traded_exchanges, + contract_myy=contract_myy, + display_factor=display_factor, + first_notice_dt=first_notice_dt, + first_trade_dt=first_trade_dt, + last_notice_dt=last_notice_dt, + last_trade_dt=last_trade_dt, + legs=legs, + spread_code=spread_code, + ) + + return future_spread diff --git a/openapi/openapi_project/openapi_package/models/future_spread_aliases.py b/openapi/openapi_project/openapi_package/models/future_spread_aliases.py new file mode 100644 index 000000000..27ac025a6 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/future_spread_aliases.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="FutureSpreadAliases") + + +@_attrs_define +class FutureSpreadAliases: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + future_spread_aliases = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + future_spread_aliases.additional_properties = additional_properties + return future_spread_aliases + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/future_spread_leg.py b/openapi/openapi_project/openapi_package/models/future_spread_leg.py new file mode 100644 index 000000000..3beec7287 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/future_spread_leg.py @@ -0,0 +1,114 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.spread_leg_side import SpreadLegSide +from ..models.spread_leg_type import SpreadLegType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.future import Future + + +T = TypeVar("T", bound="FutureSpreadLeg") + + +@_attrs_define +class FutureSpreadLeg: + """ + Attributes: + delta (Union[Unset, float]): + price (Union[Unset, float]): + ratio (Union[Unset, int]): + future (Union[Unset, Future]): + side (Union[Unset, SpreadLegSide]): + spread_leg_type (Union[Unset, SpreadLegType]): + """ + + delta: Unset | float = UNSET + price: Unset | float = UNSET + ratio: Unset | int = UNSET + future: Union[Unset, "Future"] = UNSET + side: Unset | SpreadLegSide = UNSET + spread_leg_type: Unset | SpreadLegType = UNSET + + def to_dict(self) -> dict[str, Any]: + delta = self.delta + + price = self.price + + ratio = self.ratio + + future: Unset | dict[str, Any] = UNSET + if not isinstance(self.future, Unset): + future = self.future.to_dict() + + side: Unset | str = UNSET + if not isinstance(self.side, Unset): + side = self.side.value + + spread_leg_type: Unset | str = UNSET + if not isinstance(self.spread_leg_type, Unset): + spread_leg_type = self.spread_leg_type.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if delta is not UNSET: + field_dict["delta"] = delta + if price is not UNSET: + field_dict["price"] = price + if ratio is not UNSET: + field_dict["ratio"] = ratio + if future is not UNSET: + field_dict["future"] = future + if side is not UNSET: + field_dict["side"] = side + if spread_leg_type is not UNSET: + field_dict["spreadLegType"] = spread_leg_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.future import Future + + d = dict(src_dict) + delta = d.pop("delta", UNSET) + + price = d.pop("price", UNSET) + + ratio = d.pop("ratio", UNSET) + + _future = d.pop("future", UNSET) + future: Unset | Future + if isinstance(_future, Unset): + future = UNSET + else: + future = Future.from_dict(_future) + + _side = d.pop("side", UNSET) + side: Unset | SpreadLegSide + if isinstance(_side, Unset): + side = UNSET + else: + side = SpreadLegSide(_side) + + _spread_leg_type = d.pop("spreadLegType", UNSET) + spread_leg_type: Unset | SpreadLegType + if isinstance(_spread_leg_type, Unset): + spread_leg_type = UNSET + else: + spread_leg_type = SpreadLegType(_spread_leg_type) + + future_spread_leg = cls( + delta=delta, + price=price, + ratio=ratio, + future=future, + side=side, + spread_leg_type=spread_leg_type, + ) + + return future_spread_leg diff --git a/openapi/openapi_project/openapi_package/models/fx.py b/openapi/openapi_project/openapi_package/models/fx.py new file mode 100644 index 000000000..c4c61ffa1 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/fx.py @@ -0,0 +1,289 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.currency import Currency +from ..models.exchange_code import ExchangeCode +from ..models.numeric_display_format import NumericDisplayFormat +from ..models.security_category import SecurityCategory +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.date import Date + from ..models.fx_aliases import FxAliases + + +T = TypeVar("T", bound="Fx") + + +@_attrs_define +class Fx: + """ + Attributes: + aliases (Union[Unset, FxAliases]): + currency (Union[Unset, Currency]): + listed_dt (Union[Unset, Date]): + delisted_dt (Union[Unset, Date]): + description (Union[Unset, str]): + exchange_id (Union[Unset, int]): + id (Union[Unset, int]): + multiplier (Union[Unset, float]): + price_base_factor (Union[Unset, float]): + price_display_factor (Union[Unset, float]): + price_display_format (Union[Unset, NumericDisplayFormat]): + qty_display_factor (Union[Unset, float]): + qty_display_format (Union[Unset, NumericDisplayFormat]): + security_category (Union[Unset, SecurityCategory]): + symbol (Union[Unset, str]): + tick_rule (Union[Unset, str]): + tick_size (Union[Unset, float]): + tick_value (Union[Unset, float]): + traded_exchanges (Union[Unset, list[ExchangeCode]]): + quote_currency (Union[Unset, Currency]): + """ + + aliases: Union[Unset, "FxAliases"] = UNSET + currency: Unset | Currency = UNSET + listed_dt: Union[Unset, "Date"] = UNSET + delisted_dt: Union[Unset, "Date"] = UNSET + description: Unset | str = UNSET + exchange_id: Unset | int = UNSET + id: Unset | int = UNSET + multiplier: Unset | float = UNSET + price_base_factor: Unset | float = UNSET + price_display_factor: Unset | float = UNSET + price_display_format: Unset | NumericDisplayFormat = UNSET + qty_display_factor: Unset | float = UNSET + qty_display_format: Unset | NumericDisplayFormat = UNSET + security_category: Unset | SecurityCategory = UNSET + symbol: Unset | str = UNSET + tick_rule: Unset | str = UNSET + tick_size: Unset | float = UNSET + tick_value: Unset | float = UNSET + traded_exchanges: Unset | list[ExchangeCode] = UNSET + quote_currency: Unset | Currency = UNSET + + def to_dict(self) -> dict[str, Any]: + aliases: Unset | dict[str, Any] = UNSET + if not isinstance(self.aliases, Unset): + aliases = self.aliases.to_dict() + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + listed_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.listed_dt, Unset): + listed_dt = self.listed_dt.to_dict() + + delisted_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.delisted_dt, Unset): + delisted_dt = self.delisted_dt.to_dict() + + description = self.description + + exchange_id = self.exchange_id + + id = self.id + + multiplier = self.multiplier + + price_base_factor = self.price_base_factor + + price_display_factor = self.price_display_factor + + price_display_format: Unset | str = UNSET + if not isinstance(self.price_display_format, Unset): + price_display_format = self.price_display_format.value + + qty_display_factor = self.qty_display_factor + + qty_display_format: Unset | str = UNSET + if not isinstance(self.qty_display_format, Unset): + qty_display_format = self.qty_display_format.value + + security_category: Unset | str = UNSET + if not isinstance(self.security_category, Unset): + security_category = self.security_category.value + + symbol = self.symbol + + tick_rule = self.tick_rule + + tick_size = self.tick_size + + tick_value = self.tick_value + + traded_exchanges: Unset | list[str] = UNSET + if not isinstance(self.traded_exchanges, Unset): + traded_exchanges = [] + for traded_exchanges_item_data in self.traded_exchanges: + traded_exchanges_item = traded_exchanges_item_data.value + traded_exchanges.append(traded_exchanges_item) + + quote_currency: Unset | str = UNSET + if not isinstance(self.quote_currency, Unset): + quote_currency = self.quote_currency.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if aliases is not UNSET: + field_dict["aliases"] = aliases + if currency is not UNSET: + field_dict["currency"] = currency + if listed_dt is not UNSET: + field_dict["listedDt"] = listed_dt + if delisted_dt is not UNSET: + field_dict["delistedDt"] = delisted_dt + if description is not UNSET: + field_dict["description"] = description + if exchange_id is not UNSET: + field_dict["exchangeId"] = exchange_id + if id is not UNSET: + field_dict["id"] = id + if multiplier is not UNSET: + field_dict["multiplier"] = multiplier + if price_base_factor is not UNSET: + field_dict["priceBaseFactor"] = price_base_factor + if price_display_factor is not UNSET: + field_dict["priceDisplayFactor"] = price_display_factor + if price_display_format is not UNSET: + field_dict["priceDisplayFormat"] = price_display_format + if qty_display_factor is not UNSET: + field_dict["qtyDisplayFactor"] = qty_display_factor + if qty_display_format is not UNSET: + field_dict["qtyDisplayFormat"] = qty_display_format + if security_category is not UNSET: + field_dict["securityCategory"] = security_category + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tick_rule is not UNSET: + field_dict["tickRule"] = tick_rule + if tick_size is not UNSET: + field_dict["tickSize"] = tick_size + if tick_value is not UNSET: + field_dict["tickValue"] = tick_value + if traded_exchanges is not UNSET: + field_dict["tradedExchanges"] = traded_exchanges + if quote_currency is not UNSET: + field_dict["quoteCurrency"] = quote_currency + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.date import Date + from ..models.fx_aliases import FxAliases + + d = dict(src_dict) + _aliases = d.pop("aliases", UNSET) + aliases: Unset | FxAliases + if isinstance(_aliases, Unset): + aliases = UNSET + else: + aliases = FxAliases.from_dict(_aliases) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + _listed_dt = d.pop("listedDt", UNSET) + listed_dt: Unset | Date + if isinstance(_listed_dt, Unset): + listed_dt = UNSET + else: + listed_dt = Date.from_dict(_listed_dt) + + _delisted_dt = d.pop("delistedDt", UNSET) + delisted_dt: Unset | Date + if isinstance(_delisted_dt, Unset): + delisted_dt = UNSET + else: + delisted_dt = Date.from_dict(_delisted_dt) + + description = d.pop("description", UNSET) + + exchange_id = d.pop("exchangeId", UNSET) + + id = d.pop("id", UNSET) + + multiplier = d.pop("multiplier", UNSET) + + price_base_factor = d.pop("priceBaseFactor", UNSET) + + price_display_factor = d.pop("priceDisplayFactor", UNSET) + + _price_display_format = d.pop("priceDisplayFormat", UNSET) + price_display_format: Unset | NumericDisplayFormat + if isinstance(_price_display_format, Unset): + price_display_format = UNSET + else: + price_display_format = NumericDisplayFormat(_price_display_format) + + qty_display_factor = d.pop("qtyDisplayFactor", UNSET) + + _qty_display_format = d.pop("qtyDisplayFormat", UNSET) + qty_display_format: Unset | NumericDisplayFormat + if isinstance(_qty_display_format, Unset): + qty_display_format = UNSET + else: + qty_display_format = NumericDisplayFormat(_qty_display_format) + + _security_category = d.pop("securityCategory", UNSET) + security_category: Unset | SecurityCategory + if isinstance(_security_category, Unset): + security_category = UNSET + else: + security_category = SecurityCategory(_security_category) + + symbol = d.pop("symbol", UNSET) + + tick_rule = d.pop("tickRule", UNSET) + + tick_size = d.pop("tickSize", UNSET) + + tick_value = d.pop("tickValue", UNSET) + + traded_exchanges = [] + _traded_exchanges = d.pop("tradedExchanges", UNSET) + for traded_exchanges_item_data in _traded_exchanges or []: + traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) + + traded_exchanges.append(traded_exchanges_item) + + _quote_currency = d.pop("quoteCurrency", UNSET) + quote_currency: Unset | Currency + if isinstance(_quote_currency, Unset): + quote_currency = UNSET + else: + quote_currency = Currency(_quote_currency) + + fx = cls( + aliases=aliases, + currency=currency, + listed_dt=listed_dt, + delisted_dt=delisted_dt, + description=description, + exchange_id=exchange_id, + id=id, + multiplier=multiplier, + price_base_factor=price_base_factor, + price_display_factor=price_display_factor, + price_display_format=price_display_format, + qty_display_factor=qty_display_factor, + qty_display_format=qty_display_format, + security_category=security_category, + symbol=symbol, + tick_rule=tick_rule, + tick_size=tick_size, + tick_value=tick_value, + traded_exchanges=traded_exchanges, + quote_currency=quote_currency, + ) + + return fx diff --git a/openapi/openapi_project/openapi_package/models/fx_aliases.py b/openapi/openapi_project/openapi_package/models/fx_aliases.py new file mode 100644 index 000000000..af0dc0adc --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/fx_aliases.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="FxAliases") + + +@_attrs_define +class FxAliases: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + fx_aliases = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + fx_aliases.additional_properties = additional_properties + return fx_aliases + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/generic_order.py b/openapi/openapi_project/openapi_package/models/generic_order.py new file mode 100644 index 000000000..e943d1343 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/generic_order.py @@ -0,0 +1,107 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.multi_leg_order import MultiLegOrder + from ..models.multi_leg_order_cross import MultiLegOrderCross + from ..models.order import Order + from ..models.order_cross import OrderCross + + +T = TypeVar("T", bound="GenericOrder") + + +@_attrs_define +class GenericOrder: + """ + Attributes: + order (Union[Unset, Order]): + order_cross (Union[Unset, OrderCross]): + multi_leg_order (Union[Unset, MultiLegOrder]): + multi_leg_order_cross (Union[Unset, MultiLegOrderCross]): + """ + + order: Union[Unset, "Order"] = UNSET + order_cross: Union[Unset, "OrderCross"] = UNSET + multi_leg_order: Union[Unset, "MultiLegOrder"] = UNSET + multi_leg_order_cross: Union[Unset, "MultiLegOrderCross"] = UNSET + + def to_dict(self) -> dict[str, Any]: + order: Unset | dict[str, Any] = UNSET + if not isinstance(self.order, Unset): + order = self.order.to_dict() + + order_cross: Unset | dict[str, Any] = UNSET + if not isinstance(self.order_cross, Unset): + order_cross = self.order_cross.to_dict() + + multi_leg_order: Unset | dict[str, Any] = UNSET + if not isinstance(self.multi_leg_order, Unset): + multi_leg_order = self.multi_leg_order.to_dict() + + multi_leg_order_cross: Unset | dict[str, Any] = UNSET + if not isinstance(self.multi_leg_order_cross, Unset): + multi_leg_order_cross = self.multi_leg_order_cross.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if order is not UNSET: + field_dict["order"] = order + if order_cross is not UNSET: + field_dict["orderCross"] = order_cross + if multi_leg_order is not UNSET: + field_dict["multiLegOrder"] = multi_leg_order + if multi_leg_order_cross is not UNSET: + field_dict["multiLegOrderCross"] = multi_leg_order_cross + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.multi_leg_order import MultiLegOrder + from ..models.multi_leg_order_cross import MultiLegOrderCross + from ..models.order import Order + from ..models.order_cross import OrderCross + + d = dict(src_dict) + _order = d.pop("order", UNSET) + order: Unset | Order + if isinstance(_order, Unset): + order = UNSET + else: + order = Order.from_dict(_order) + + _order_cross = d.pop("orderCross", UNSET) + order_cross: Unset | OrderCross + if isinstance(_order_cross, Unset): + order_cross = UNSET + else: + order_cross = OrderCross.from_dict(_order_cross) + + _multi_leg_order = d.pop("multiLegOrder", UNSET) + multi_leg_order: Unset | MultiLegOrder + if isinstance(_multi_leg_order, Unset): + multi_leg_order = UNSET + else: + multi_leg_order = MultiLegOrder.from_dict(_multi_leg_order) + + _multi_leg_order_cross = d.pop("multiLegOrderCross", UNSET) + multi_leg_order_cross: Unset | MultiLegOrderCross + if isinstance(_multi_leg_order_cross, Unset): + multi_leg_order_cross = UNSET + else: + multi_leg_order_cross = MultiLegOrderCross.from_dict(_multi_leg_order_cross) + + generic_order = cls( + order=order, + order_cross=order_cross, + multi_leg_order=multi_leg_order, + multi_leg_order_cross=multi_leg_order_cross, + ) + + return generic_order diff --git a/openapi/openapi_project/openapi_package/models/get_active_user_response.py b/openapi/openapi_project/openapi_package/models/get_active_user_response.py new file mode 100644 index 000000000..08b20d969 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/get_active_user_response.py @@ -0,0 +1,79 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.user import User + + +T = TypeVar("T", bound="GetActiveUserResponse") + + +@_attrs_define +class GetActiveUserResponse: + """ + Attributes: + user (Union[Unset, User]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + user: Union[Unset, "User"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + user: Unset | dict[str, Any] = UNSET + if not isinstance(self.user, Unset): + user = self.user.to_dict() + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if user is not UNSET: + field_dict["user"] = user + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.user import User + + d = dict(src_dict) + _user = d.pop("user", UNSET) + user: Unset | User + if isinstance(_user, Unset): + user = UNSET + else: + user = User.from_dict(_user) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + get_active_user_response = cls( + user=user, + error_message=error_message, + status_code=status_code, + ) + + return get_active_user_response diff --git a/openapi/openapi_project/openapi_package/models/get_server_info_response.py b/openapi/openapi_project/openapi_package/models/get_server_info_response.py new file mode 100644 index 000000000..0bbbe7a2a --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/get_server_info_response.py @@ -0,0 +1,139 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.get_server_info_response_system_settings import ( + GetServerInfoResponseSystemSettings, + ) + + +T = TypeVar("T", bound="GetServerInfoResponse") + + +@_attrs_define +class GetServerInfoResponse: + """ + Attributes: + environment (Union[Unset, str]): + server_build_ts (Union[Unset, str]): + server_hash (Union[Unset, str]): + server_name (Union[Unset, str]): + server_version (Union[Unset, str]): + site (Union[Unset, str]): + system_settings (Union[Unset, GetServerInfoResponseSystemSettings]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + environment: Unset | str = UNSET + server_build_ts: Unset | str = UNSET + server_hash: Unset | str = UNSET + server_name: Unset | str = UNSET + server_version: Unset | str = UNSET + site: Unset | str = UNSET + system_settings: Union[Unset, "GetServerInfoResponseSystemSettings"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + environment = self.environment + + server_build_ts = self.server_build_ts + + server_hash = self.server_hash + + server_name = self.server_name + + server_version = self.server_version + + site = self.site + + system_settings: Unset | dict[str, Any] = UNSET + if not isinstance(self.system_settings, Unset): + system_settings = self.system_settings.to_dict() + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if environment is not UNSET: + field_dict["environment"] = environment + if server_build_ts is not UNSET: + field_dict["serverBuildTs"] = server_build_ts + if server_hash is not UNSET: + field_dict["serverHash"] = server_hash + if server_name is not UNSET: + field_dict["serverName"] = server_name + if server_version is not UNSET: + field_dict["serverVersion"] = server_version + if site is not UNSET: + field_dict["site"] = site + if system_settings is not UNSET: + field_dict["systemSettings"] = system_settings + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.get_server_info_response_system_settings import ( + GetServerInfoResponseSystemSettings, + ) + + d = dict(src_dict) + environment = d.pop("environment", UNSET) + + server_build_ts = d.pop("serverBuildTs", UNSET) + + server_hash = d.pop("serverHash", UNSET) + + server_name = d.pop("serverName", UNSET) + + server_version = d.pop("serverVersion", UNSET) + + site = d.pop("site", UNSET) + + _system_settings = d.pop("systemSettings", UNSET) + system_settings: Unset | GetServerInfoResponseSystemSettings + if isinstance(_system_settings, Unset): + system_settings = UNSET + else: + system_settings = GetServerInfoResponseSystemSettings.from_dict( + _system_settings + ) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + get_server_info_response = cls( + environment=environment, + server_build_ts=server_build_ts, + server_hash=server_hash, + server_name=server_name, + server_version=server_version, + site=site, + system_settings=system_settings, + error_message=error_message, + status_code=status_code, + ) + + return get_server_info_response diff --git a/openapi/openapi_project/openapi_package/models/get_server_info_response_system_settings.py b/openapi/openapi_project/openapi_package/models/get_server_info_response_system_settings.py new file mode 100644 index 000000000..4503270cf --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/get_server_info_response_system_settings.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="GetServerInfoResponseSystemSettings") + + +@_attrs_define +class GetServerInfoResponseSystemSettings: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + get_server_info_response_system_settings = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + get_server_info_response_system_settings.additional_properties = ( + additional_properties + ) + return get_server_info_response_system_settings + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/get_server_time_response.py b/openapi/openapi_project/openapi_package/models/get_server_time_response.py new file mode 100644 index 000000000..c19f78f0e --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/get_server_time_response.py @@ -0,0 +1,66 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +T = TypeVar("T", bound="GetServerTimeResponse") + + +@_attrs_define +class GetServerTimeResponse: + """ + Attributes: + server_time_utc (Union[Unset, str]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + server_time_utc: Unset | str = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + server_time_utc = self.server_time_utc + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if server_time_utc is not UNSET: + field_dict["serverTimeUtc"] = server_time_utc + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + server_time_utc = d.pop("serverTimeUtc", UNSET) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + get_server_time_response = cls( + server_time_utc=server_time_utc, + error_message=error_message, + status_code=status_code, + ) + + return get_server_time_response diff --git a/openapi/openapi_project/openapi_package/models/get_trading_holidays_response.py b/openapi/openapi_project/openapi_package/models/get_trading_holidays_response.py new file mode 100644 index 000000000..81f204a68 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/get_trading_holidays_response.py @@ -0,0 +1,82 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.trading_holiday import TradingHoliday + + +T = TypeVar("T", bound="GetTradingHolidaysResponse") + + +@_attrs_define +class GetTradingHolidaysResponse: + """ + Attributes: + trading_holidays (Union[Unset, list['TradingHoliday']]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + trading_holidays: Unset | list["TradingHoliday"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + trading_holidays: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.trading_holidays, Unset): + trading_holidays = [] + for trading_holidays_item_data in self.trading_holidays: + trading_holidays_item = trading_holidays_item_data.to_dict() + trading_holidays.append(trading_holidays_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if trading_holidays is not UNSET: + field_dict["tradingHolidays"] = trading_holidays + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.trading_holiday import TradingHoliday + + d = dict(src_dict) + trading_holidays = [] + _trading_holidays = d.pop("tradingHolidays", UNSET) + for trading_holidays_item_data in _trading_holidays or []: + trading_holidays_item = TradingHoliday.from_dict(trading_holidays_item_data) + + trading_holidays.append(trading_holidays_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + get_trading_holidays_response = cls( + trading_holidays=trading_holidays, + error_message=error_message, + status_code=status_code, + ) + + return get_trading_holidays_response diff --git a/openapi/openapi_project/openapi_package/models/header.py b/openapi/openapi_project/openapi_package/models/header.py new file mode 100644 index 000000000..dd5dd0fb9 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/header.py @@ -0,0 +1,103 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="Header") + + +@_attrs_define +class Header: + """ + Attributes: + deliver_to_comp_id (Union[Unset, str]): + deliver_to_sub_id (Union[Unset, str]): + on_behalf_of_comp_id (Union[Unset, str]): + on_behalf_of_sub_id (Union[Unset, str]): + sender_comp_id (Union[Unset, str]): + sender_sub_id (Union[Unset, str]): + target_comp_id (Union[Unset, str]): + target_sub_id (Union[Unset, str]): + """ + + deliver_to_comp_id: Unset | str = UNSET + deliver_to_sub_id: Unset | str = UNSET + on_behalf_of_comp_id: Unset | str = UNSET + on_behalf_of_sub_id: Unset | str = UNSET + sender_comp_id: Unset | str = UNSET + sender_sub_id: Unset | str = UNSET + target_comp_id: Unset | str = UNSET + target_sub_id: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + deliver_to_comp_id = self.deliver_to_comp_id + + deliver_to_sub_id = self.deliver_to_sub_id + + on_behalf_of_comp_id = self.on_behalf_of_comp_id + + on_behalf_of_sub_id = self.on_behalf_of_sub_id + + sender_comp_id = self.sender_comp_id + + sender_sub_id = self.sender_sub_id + + target_comp_id = self.target_comp_id + + target_sub_id = self.target_sub_id + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if deliver_to_comp_id is not UNSET: + field_dict["deliverToCompId"] = deliver_to_comp_id + if deliver_to_sub_id is not UNSET: + field_dict["deliverToSubId"] = deliver_to_sub_id + if on_behalf_of_comp_id is not UNSET: + field_dict["onBehalfOfCompId"] = on_behalf_of_comp_id + if on_behalf_of_sub_id is not UNSET: + field_dict["onBehalfOfSubId"] = on_behalf_of_sub_id + if sender_comp_id is not UNSET: + field_dict["senderCompId"] = sender_comp_id + if sender_sub_id is not UNSET: + field_dict["senderSubId"] = sender_sub_id + if target_comp_id is not UNSET: + field_dict["targetCompId"] = target_comp_id + if target_sub_id is not UNSET: + field_dict["targetSubId"] = target_sub_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + deliver_to_comp_id = d.pop("deliverToCompId", UNSET) + + deliver_to_sub_id = d.pop("deliverToSubId", UNSET) + + on_behalf_of_comp_id = d.pop("onBehalfOfCompId", UNSET) + + on_behalf_of_sub_id = d.pop("onBehalfOfSubId", UNSET) + + sender_comp_id = d.pop("senderCompId", UNSET) + + sender_sub_id = d.pop("senderSubId", UNSET) + + target_comp_id = d.pop("targetCompId", UNSET) + + target_sub_id = d.pop("targetSubId", UNSET) + + header = cls( + deliver_to_comp_id=deliver_to_comp_id, + deliver_to_sub_id=deliver_to_sub_id, + on_behalf_of_comp_id=on_behalf_of_comp_id, + on_behalf_of_sub_id=on_behalf_of_sub_id, + sender_comp_id=sender_comp_id, + sender_sub_id=sender_sub_id, + target_comp_id=target_comp_id, + target_sub_id=target_sub_id, + ) + + return header diff --git a/openapi/openapi_project/openapi_package/models/index.py b/openapi/openapi_project/openapi_package/models/index.py new file mode 100644 index 000000000..350f9871a --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/index.py @@ -0,0 +1,273 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.currency import Currency +from ..models.exchange_code import ExchangeCode +from ..models.numeric_display_format import NumericDisplayFormat +from ..models.security_category import SecurityCategory +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.date import Date + from ..models.index_aliases import IndexAliases + + +T = TypeVar("T", bound="Index") + + +@_attrs_define +class Index: + """ + Attributes: + aliases (Union[Unset, IndexAliases]): + currency (Union[Unset, Currency]): + listed_dt (Union[Unset, Date]): + delisted_dt (Union[Unset, Date]): + description (Union[Unset, str]): + exchange_id (Union[Unset, int]): + id (Union[Unset, int]): + multiplier (Union[Unset, float]): + price_base_factor (Union[Unset, float]): + price_display_factor (Union[Unset, float]): + price_display_format (Union[Unset, NumericDisplayFormat]): + qty_display_factor (Union[Unset, float]): + qty_display_format (Union[Unset, NumericDisplayFormat]): + security_category (Union[Unset, SecurityCategory]): + symbol (Union[Unset, str]): + tick_rule (Union[Unset, str]): + tick_size (Union[Unset, float]): + tick_value (Union[Unset, float]): + traded_exchanges (Union[Unset, list[ExchangeCode]]): + """ + + aliases: Union[Unset, "IndexAliases"] = UNSET + currency: Unset | Currency = UNSET + listed_dt: Union[Unset, "Date"] = UNSET + delisted_dt: Union[Unset, "Date"] = UNSET + description: Unset | str = UNSET + exchange_id: Unset | int = UNSET + id: Unset | int = UNSET + multiplier: Unset | float = UNSET + price_base_factor: Unset | float = UNSET + price_display_factor: Unset | float = UNSET + price_display_format: Unset | NumericDisplayFormat = UNSET + qty_display_factor: Unset | float = UNSET + qty_display_format: Unset | NumericDisplayFormat = UNSET + security_category: Unset | SecurityCategory = UNSET + symbol: Unset | str = UNSET + tick_rule: Unset | str = UNSET + tick_size: Unset | float = UNSET + tick_value: Unset | float = UNSET + traded_exchanges: Unset | list[ExchangeCode] = UNSET + + def to_dict(self) -> dict[str, Any]: + aliases: Unset | dict[str, Any] = UNSET + if not isinstance(self.aliases, Unset): + aliases = self.aliases.to_dict() + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + listed_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.listed_dt, Unset): + listed_dt = self.listed_dt.to_dict() + + delisted_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.delisted_dt, Unset): + delisted_dt = self.delisted_dt.to_dict() + + description = self.description + + exchange_id = self.exchange_id + + id = self.id + + multiplier = self.multiplier + + price_base_factor = self.price_base_factor + + price_display_factor = self.price_display_factor + + price_display_format: Unset | str = UNSET + if not isinstance(self.price_display_format, Unset): + price_display_format = self.price_display_format.value + + qty_display_factor = self.qty_display_factor + + qty_display_format: Unset | str = UNSET + if not isinstance(self.qty_display_format, Unset): + qty_display_format = self.qty_display_format.value + + security_category: Unset | str = UNSET + if not isinstance(self.security_category, Unset): + security_category = self.security_category.value + + symbol = self.symbol + + tick_rule = self.tick_rule + + tick_size = self.tick_size + + tick_value = self.tick_value + + traded_exchanges: Unset | list[str] = UNSET + if not isinstance(self.traded_exchanges, Unset): + traded_exchanges = [] + for traded_exchanges_item_data in self.traded_exchanges: + traded_exchanges_item = traded_exchanges_item_data.value + traded_exchanges.append(traded_exchanges_item) + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if aliases is not UNSET: + field_dict["aliases"] = aliases + if currency is not UNSET: + field_dict["currency"] = currency + if listed_dt is not UNSET: + field_dict["listedDt"] = listed_dt + if delisted_dt is not UNSET: + field_dict["delistedDt"] = delisted_dt + if description is not UNSET: + field_dict["description"] = description + if exchange_id is not UNSET: + field_dict["exchangeId"] = exchange_id + if id is not UNSET: + field_dict["id"] = id + if multiplier is not UNSET: + field_dict["multiplier"] = multiplier + if price_base_factor is not UNSET: + field_dict["priceBaseFactor"] = price_base_factor + if price_display_factor is not UNSET: + field_dict["priceDisplayFactor"] = price_display_factor + if price_display_format is not UNSET: + field_dict["priceDisplayFormat"] = price_display_format + if qty_display_factor is not UNSET: + field_dict["qtyDisplayFactor"] = qty_display_factor + if qty_display_format is not UNSET: + field_dict["qtyDisplayFormat"] = qty_display_format + if security_category is not UNSET: + field_dict["securityCategory"] = security_category + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tick_rule is not UNSET: + field_dict["tickRule"] = tick_rule + if tick_size is not UNSET: + field_dict["tickSize"] = tick_size + if tick_value is not UNSET: + field_dict["tickValue"] = tick_value + if traded_exchanges is not UNSET: + field_dict["tradedExchanges"] = traded_exchanges + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.date import Date + from ..models.index_aliases import IndexAliases + + d = dict(src_dict) + _aliases = d.pop("aliases", UNSET) + aliases: Unset | IndexAliases + if isinstance(_aliases, Unset): + aliases = UNSET + else: + aliases = IndexAliases.from_dict(_aliases) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + _listed_dt = d.pop("listedDt", UNSET) + listed_dt: Unset | Date + if isinstance(_listed_dt, Unset): + listed_dt = UNSET + else: + listed_dt = Date.from_dict(_listed_dt) + + _delisted_dt = d.pop("delistedDt", UNSET) + delisted_dt: Unset | Date + if isinstance(_delisted_dt, Unset): + delisted_dt = UNSET + else: + delisted_dt = Date.from_dict(_delisted_dt) + + description = d.pop("description", UNSET) + + exchange_id = d.pop("exchangeId", UNSET) + + id = d.pop("id", UNSET) + + multiplier = d.pop("multiplier", UNSET) + + price_base_factor = d.pop("priceBaseFactor", UNSET) + + price_display_factor = d.pop("priceDisplayFactor", UNSET) + + _price_display_format = d.pop("priceDisplayFormat", UNSET) + price_display_format: Unset | NumericDisplayFormat + if isinstance(_price_display_format, Unset): + price_display_format = UNSET + else: + price_display_format = NumericDisplayFormat(_price_display_format) + + qty_display_factor = d.pop("qtyDisplayFactor", UNSET) + + _qty_display_format = d.pop("qtyDisplayFormat", UNSET) + qty_display_format: Unset | NumericDisplayFormat + if isinstance(_qty_display_format, Unset): + qty_display_format = UNSET + else: + qty_display_format = NumericDisplayFormat(_qty_display_format) + + _security_category = d.pop("securityCategory", UNSET) + security_category: Unset | SecurityCategory + if isinstance(_security_category, Unset): + security_category = UNSET + else: + security_category = SecurityCategory(_security_category) + + symbol = d.pop("symbol", UNSET) + + tick_rule = d.pop("tickRule", UNSET) + + tick_size = d.pop("tickSize", UNSET) + + tick_value = d.pop("tickValue", UNSET) + + traded_exchanges = [] + _traded_exchanges = d.pop("tradedExchanges", UNSET) + for traded_exchanges_item_data in _traded_exchanges or []: + traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) + + traded_exchanges.append(traded_exchanges_item) + + index = cls( + aliases=aliases, + currency=currency, + listed_dt=listed_dt, + delisted_dt=delisted_dt, + description=description, + exchange_id=exchange_id, + id=id, + multiplier=multiplier, + price_base_factor=price_base_factor, + price_display_factor=price_display_factor, + price_display_format=price_display_format, + qty_display_factor=qty_display_factor, + qty_display_format=qty_display_format, + security_category=security_category, + symbol=symbol, + tick_rule=tick_rule, + tick_size=tick_size, + tick_value=tick_value, + traded_exchanges=traded_exchanges, + ) + + return index diff --git a/openapi/openapi_project/openapi_package/models/index_aliases.py b/openapi/openapi_project/openapi_package/models/index_aliases.py new file mode 100644 index 000000000..297c59786 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/index_aliases.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="IndexAliases") + + +@_attrs_define +class IndexAliases: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + index_aliases = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + index_aliases.additional_properties = additional_properties + return index_aliases + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/list_accounts_response.py b/openapi/openapi_project/openapi_package/models/list_accounts_response.py new file mode 100644 index 000000000..b12ec1951 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/list_accounts_response.py @@ -0,0 +1,82 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.account import Account + + +T = TypeVar("T", bound="ListAccountsResponse") + + +@_attrs_define +class ListAccountsResponse: + """ + Attributes: + accounts (Union[Unset, list['Account']]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + accounts: Unset | list["Account"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + accounts: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.accounts, Unset): + accounts = [] + for accounts_item_data in self.accounts: + accounts_item = accounts_item_data.to_dict() + accounts.append(accounts_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if accounts is not UNSET: + field_dict["accounts"] = accounts + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.account import Account + + d = dict(src_dict) + accounts = [] + _accounts = d.pop("accounts", UNSET) + for accounts_item_data in _accounts or []: + accounts_item = Account.from_dict(accounts_item_data) + + accounts.append(accounts_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + list_accounts_response = cls( + accounts=accounts, + error_message=error_message, + status_code=status_code, + ) + + return list_accounts_response diff --git a/openapi/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py b/openapi/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py new file mode 100644 index 000000000..4717d9bd4 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py @@ -0,0 +1,84 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.trading_firm_slim import TradingFirmSlim + + +T = TypeVar("T", bound="ListAffiliatedTradingFirmsResponse") + + +@_attrs_define +class ListAffiliatedTradingFirmsResponse: + """ + Attributes: + affiliated_firms (Union[Unset, list['TradingFirmSlim']]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + affiliated_firms: Unset | list["TradingFirmSlim"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + affiliated_firms: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.affiliated_firms, Unset): + affiliated_firms = [] + for affiliated_firms_item_data in self.affiliated_firms: + affiliated_firms_item = affiliated_firms_item_data.to_dict() + affiliated_firms.append(affiliated_firms_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if affiliated_firms is not UNSET: + field_dict["affiliatedFirms"] = affiliated_firms + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.trading_firm_slim import TradingFirmSlim + + d = dict(src_dict) + affiliated_firms = [] + _affiliated_firms = d.pop("affiliatedFirms", UNSET) + for affiliated_firms_item_data in _affiliated_firms or []: + affiliated_firms_item = TradingFirmSlim.from_dict( + affiliated_firms_item_data + ) + + affiliated_firms.append(affiliated_firms_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + list_affiliated_trading_firms_response = cls( + affiliated_firms=affiliated_firms, + error_message=error_message, + status_code=status_code, + ) + + return list_affiliated_trading_firms_response diff --git a/openapi/openapi_project/openapi_package/models/list_easy_to_borrow_securities_request.py b/openapi/openapi_project/openapi_package/models/list_easy_to_borrow_securities_request.py new file mode 100644 index 000000000..20674d12f --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/list_easy_to_borrow_securities_request.py @@ -0,0 +1,49 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ListEasyToBorrowSecuritiesRequest") + + +@_attrs_define +class ListEasyToBorrowSecuritiesRequest: + """ + Attributes: + trading_firm_id (Union[Unset, int]): + account_id (Union[Unset, int]): + """ + + trading_firm_id: Unset | int = UNSET + account_id: Unset | int = UNSET + + def to_dict(self) -> dict[str, Any]: + trading_firm_id = self.trading_firm_id + + account_id = self.account_id + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if trading_firm_id is not UNSET: + field_dict["tradingFirmId"] = trading_firm_id + if account_id is not UNSET: + field_dict["accountId"] = account_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + trading_firm_id = d.pop("tradingFirmId", UNSET) + + account_id = d.pop("accountId", UNSET) + + list_easy_to_borrow_securities_request = cls( + trading_firm_id=trading_firm_id, + account_id=account_id, + ) + + return list_easy_to_borrow_securities_request diff --git a/openapi/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py b/openapi/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py new file mode 100644 index 000000000..7046c3360 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py @@ -0,0 +1,82 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.easy_to_borrow_security import EasyToBorrowSecurity + + +T = TypeVar("T", bound="ListEasyToBorrowSecuritiesResponse") + + +@_attrs_define +class ListEasyToBorrowSecuritiesResponse: + """ + Attributes: + securities (Union[Unset, list['EasyToBorrowSecurity']]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + securities: Unset | list["EasyToBorrowSecurity"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + securities: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.securities, Unset): + securities = [] + for securities_item_data in self.securities: + securities_item = securities_item_data.to_dict() + securities.append(securities_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if securities is not UNSET: + field_dict["securities"] = securities + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.easy_to_borrow_security import EasyToBorrowSecurity + + d = dict(src_dict) + securities = [] + _securities = d.pop("securities", UNSET) + for securities_item_data in _securities or []: + securities_item = EasyToBorrowSecurity.from_dict(securities_item_data) + + securities.append(securities_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + list_easy_to_borrow_securities_response = cls( + securities=securities, + error_message=error_message, + status_code=status_code, + ) + + return list_easy_to_borrow_securities_response diff --git a/openapi/openapi_project/openapi_package/models/list_exchanges_response.py b/openapi/openapi_project/openapi_package/models/list_exchanges_response.py new file mode 100644 index 000000000..32dc42c16 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/list_exchanges_response.py @@ -0,0 +1,82 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.exchange import Exchange + + +T = TypeVar("T", bound="ListExchangesResponse") + + +@_attrs_define +class ListExchangesResponse: + """ + Attributes: + exchanges (Union[Unset, list['Exchange']]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + exchanges: Unset | list["Exchange"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + exchanges: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.exchanges, Unset): + exchanges = [] + for exchanges_item_data in self.exchanges: + exchanges_item = exchanges_item_data.to_dict() + exchanges.append(exchanges_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if exchanges is not UNSET: + field_dict["exchanges"] = exchanges + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.exchange import Exchange + + d = dict(src_dict) + exchanges = [] + _exchanges = d.pop("exchanges", UNSET) + for exchanges_item_data in _exchanges or []: + exchanges_item = Exchange.from_dict(exchanges_item_data) + + exchanges.append(exchanges_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + list_exchanges_response = cls( + exchanges=exchanges, + error_message=error_message, + status_code=status_code, + ) + + return list_exchanges_response diff --git a/openapi/openapi_project/openapi_package/models/list_option_chains_repsonse.py b/openapi/openapi_project/openapi_package/models/list_option_chains_repsonse.py new file mode 100644 index 000000000..b4ebc9b39 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/list_option_chains_repsonse.py @@ -0,0 +1,82 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.option_chain import OptionChain + + +T = TypeVar("T", bound="ListOptionChainsRepsonse") + + +@_attrs_define +class ListOptionChainsRepsonse: + """ + Attributes: + option_chains (Union[Unset, list['OptionChain']]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + option_chains: Unset | list["OptionChain"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + option_chains: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.option_chains, Unset): + option_chains = [] + for option_chains_item_data in self.option_chains: + option_chains_item = option_chains_item_data.to_dict() + option_chains.append(option_chains_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if option_chains is not UNSET: + field_dict["optionChains"] = option_chains + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.option_chain import OptionChain + + d = dict(src_dict) + option_chains = [] + _option_chains = d.pop("optionChains", UNSET) + for option_chains_item_data in _option_chains or []: + option_chains_item = OptionChain.from_dict(option_chains_item_data) + + option_chains.append(option_chains_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + list_option_chains_repsonse = cls( + option_chains=option_chains, + error_message=error_message, + status_code=status_code, + ) + + return list_option_chains_repsonse diff --git a/openapi/openapi_project/openapi_package/models/list_option_chains_request.py b/openapi/openapi_project/openapi_package/models/list_option_chains_request.py new file mode 100644 index 000000000..efcb9c431 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/list_option_chains_request.py @@ -0,0 +1,42 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ListOptionChainsRequest") + + +@_attrs_define +class ListOptionChainsRequest: + """ + Attributes: + underlying_symbols (Union[Unset, list[str]]): + """ + + underlying_symbols: Unset | list[str] = UNSET + + def to_dict(self) -> dict[str, Any]: + underlying_symbols: Unset | list[str] = UNSET + if not isinstance(self.underlying_symbols, Unset): + underlying_symbols = self.underlying_symbols + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if underlying_symbols is not UNSET: + field_dict["underlyingSymbols"] = underlying_symbols + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + underlying_symbols = cast(list[str], d.pop("underlyingSymbols", UNSET)) + + list_option_chains_request = cls( + underlying_symbols=underlying_symbols, + ) + + return list_option_chains_request diff --git a/openapi/openapi_project/openapi_package/models/list_orders_response.py b/openapi/openapi_project/openapi_package/models/list_orders_response.py new file mode 100644 index 000000000..789644369 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/list_orders_response.py @@ -0,0 +1,82 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.generic_order import GenericOrder + + +T = TypeVar("T", bound="ListOrdersResponse") + + +@_attrs_define +class ListOrdersResponse: + """ + Attributes: + orders (Union[Unset, list['GenericOrder']]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + orders: Unset | list["GenericOrder"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + orders: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.orders, Unset): + orders = [] + for orders_item_data in self.orders: + orders_item = orders_item_data.to_dict() + orders.append(orders_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if orders is not UNSET: + field_dict["orders"] = orders + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.generic_order import GenericOrder + + d = dict(src_dict) + orders = [] + _orders = d.pop("orders", UNSET) + for orders_item_data in _orders or []: + orders_item = GenericOrder.from_dict(orders_item_data) + + orders.append(orders_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + list_orders_response = cls( + orders=orders, + error_message=error_message, + status_code=status_code, + ) + + return list_orders_response diff --git a/openapi/openapi_project/openapi_package/models/list_positions_response.py b/openapi/openapi_project/openapi_package/models/list_positions_response.py new file mode 100644 index 000000000..fbc77d357 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/list_positions_response.py @@ -0,0 +1,82 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.position import Position + + +T = TypeVar("T", bound="ListPositionsResponse") + + +@_attrs_define +class ListPositionsResponse: + """ + Attributes: + positions (Union[Unset, list['Position']]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + positions: Unset | list["Position"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + positions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.positions, Unset): + positions = [] + for positions_item_data in self.positions: + positions_item = positions_item_data.to_dict() + positions.append(positions_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if positions is not UNSET: + field_dict["positions"] = positions + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.position import Position + + d = dict(src_dict) + positions = [] + _positions = d.pop("positions", UNSET) + for positions_item_data in _positions or []: + positions_item = Position.from_dict(positions_item_data) + + positions.append(positions_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + list_positions_response = cls( + positions=positions, + error_message=error_message, + status_code=status_code, + ) + + return list_positions_response diff --git a/openapi/openapi_project/openapi_package/models/list_routes_response.py b/openapi/openapi_project/openapi_package/models/list_routes_response.py new file mode 100644 index 000000000..2455f717b --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/list_routes_response.py @@ -0,0 +1,105 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.route import Route + from ..models.route_applicability import RouteApplicability + + +T = TypeVar("T", bound="ListRoutesResponse") + + +@_attrs_define +class ListRoutesResponse: + """ + Attributes: + routes (Union[Unset, list['Route']]): + route_applicabilities (Union[Unset, list['RouteApplicability']]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + routes: Unset | list["Route"] = UNSET + route_applicabilities: Unset | list["RouteApplicability"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + routes: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.routes, Unset): + routes = [] + for routes_item_data in self.routes: + routes_item = routes_item_data.to_dict() + routes.append(routes_item) + + route_applicabilities: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.route_applicabilities, Unset): + route_applicabilities = [] + for route_applicabilities_item_data in self.route_applicabilities: + route_applicabilities_item = route_applicabilities_item_data.to_dict() + route_applicabilities.append(route_applicabilities_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if routes is not UNSET: + field_dict["routes"] = routes + if route_applicabilities is not UNSET: + field_dict["routeApplicabilities"] = route_applicabilities + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.route import Route + from ..models.route_applicability import RouteApplicability + + d = dict(src_dict) + routes = [] + _routes = d.pop("routes", UNSET) + for routes_item_data in _routes or []: + routes_item = Route.from_dict(routes_item_data) + + routes.append(routes_item) + + route_applicabilities = [] + _route_applicabilities = d.pop("routeApplicabilities", UNSET) + for route_applicabilities_item_data in _route_applicabilities or []: + route_applicabilities_item = RouteApplicability.from_dict( + route_applicabilities_item_data + ) + + route_applicabilities.append(route_applicabilities_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + list_routes_response = cls( + routes=routes, + route_applicabilities=route_applicabilities, + error_message=error_message, + status_code=status_code, + ) + + return list_routes_response diff --git a/openapi/openapi_project/openapi_package/models/list_securities_request.py b/openapi/openapi_project/openapi_package/models/list_securities_request.py new file mode 100644 index 000000000..1390029ae --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/list_securities_request.py @@ -0,0 +1,42 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ListSecuritiesRequest") + + +@_attrs_define +class ListSecuritiesRequest: + """ + Attributes: + symbols (Union[Unset, list[str]]): + """ + + symbols: Unset | list[str] = UNSET + + def to_dict(self) -> dict[str, Any]: + symbols: Unset | list[str] = UNSET + if not isinstance(self.symbols, Unset): + symbols = self.symbols + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if symbols is not UNSET: + field_dict["symbols"] = symbols + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbols = cast(list[str], d.pop("symbols", UNSET)) + + list_securities_request = cls( + symbols=symbols, + ) + + return list_securities_request diff --git a/openapi/openapi_project/openapi_package/models/list_securities_response.py b/openapi/openapi_project/openapi_package/models/list_securities_response.py new file mode 100644 index 000000000..9e4934459 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/list_securities_response.py @@ -0,0 +1,82 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.security import Security + + +T = TypeVar("T", bound="ListSecuritiesResponse") + + +@_attrs_define +class ListSecuritiesResponse: + """ + Attributes: + securities (Union[Unset, list['Security']]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + securities: Unset | list["Security"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + securities: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.securities, Unset): + securities = [] + for securities_item_data in self.securities: + securities_item = securities_item_data.to_dict() + securities.append(securities_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if securities is not UNSET: + field_dict["securities"] = securities + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.security import Security + + d = dict(src_dict) + securities = [] + _securities = d.pop("securities", UNSET) + for securities_item_data in _securities or []: + securities_item = Security.from_dict(securities_item_data) + + securities.append(securities_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + list_securities_response = cls( + securities=securities, + error_message=error_message, + status_code=status_code, + ) + + return list_securities_response diff --git a/openapi/openapi_project/openapi_package/models/list_trade_confirms_response.py b/openapi/openapi_project/openapi_package/models/list_trade_confirms_response.py new file mode 100644 index 000000000..c882c7c47 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/list_trade_confirms_response.py @@ -0,0 +1,82 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.trade_confirm import TradeConfirm + + +T = TypeVar("T", bound="ListTradeConfirmsResponse") + + +@_attrs_define +class ListTradeConfirmsResponse: + """ + Attributes: + trade_confirms (Union[Unset, list['TradeConfirm']]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + trade_confirms: Unset | list["TradeConfirm"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + trade_confirms: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.trade_confirms, Unset): + trade_confirms = [] + for trade_confirms_item_data in self.trade_confirms: + trade_confirms_item = trade_confirms_item_data.to_dict() + trade_confirms.append(trade_confirms_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if trade_confirms is not UNSET: + field_dict["tradeConfirms"] = trade_confirms + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.trade_confirm import TradeConfirm + + d = dict(src_dict) + trade_confirms = [] + _trade_confirms = d.pop("tradeConfirms", UNSET) + for trade_confirms_item_data in _trade_confirms or []: + trade_confirms_item = TradeConfirm.from_dict(trade_confirms_item_data) + + trade_confirms.append(trade_confirms_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + list_trade_confirms_response = cls( + trade_confirms=trade_confirms, + error_message=error_message, + status_code=status_code, + ) + + return list_trade_confirms_response diff --git a/openapi/openapi_project/openapi_package/models/list_trading_firms_response.py b/openapi/openapi_project/openapi_package/models/list_trading_firms_response.py new file mode 100644 index 000000000..9759c68e5 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/list_trading_firms_response.py @@ -0,0 +1,82 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.trading_firm import TradingFirm + + +T = TypeVar("T", bound="ListTradingFirmsResponse") + + +@_attrs_define +class ListTradingFirmsResponse: + """ + Attributes: + trading_firms (Union[Unset, list['TradingFirm']]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + trading_firms: Unset | list["TradingFirm"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + trading_firms: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.trading_firms, Unset): + trading_firms = [] + for trading_firms_item_data in self.trading_firms: + trading_firms_item = trading_firms_item_data.to_dict() + trading_firms.append(trading_firms_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if trading_firms is not UNSET: + field_dict["tradingFirms"] = trading_firms + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.trading_firm import TradingFirm + + d = dict(src_dict) + trading_firms = [] + _trading_firms = d.pop("tradingFirms", UNSET) + for trading_firms_item_data in _trading_firms or []: + trading_firms_item = TradingFirm.from_dict(trading_firms_item_data) + + trading_firms.append(trading_firms_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + list_trading_firms_response = cls( + trading_firms=trading_firms, + error_message=error_message, + status_code=status_code, + ) + + return list_trading_firms_response diff --git a/openapi/openapi_project/openapi_package/models/login_request.py b/openapi/openapi_project/openapi_package/models/login_request.py new file mode 100644 index 000000000..fc9347b21 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/login_request.py @@ -0,0 +1,76 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="LoginRequest") + + +@_attrs_define +class LoginRequest: + """ + Attributes: + domain (Union[Unset, str]): + username (Union[Unset, str]): + password (Union[Unset, str]): + application_name (Union[Unset, str]): + application_version (Union[Unset, str]): + """ + + domain: Unset | str = UNSET + username: Unset | str = UNSET + password: Unset | str = UNSET + application_name: Unset | str = UNSET + application_version: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + domain = self.domain + + username = self.username + + password = self.password + + application_name = self.application_name + + application_version = self.application_version + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if domain is not UNSET: + field_dict["domain"] = domain + if username is not UNSET: + field_dict["username"] = username + if password is not UNSET: + field_dict["password"] = password + if application_name is not UNSET: + field_dict["applicationName"] = application_name + if application_version is not UNSET: + field_dict["applicationVersion"] = application_version + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + domain = d.pop("domain", UNSET) + + username = d.pop("username", UNSET) + + password = d.pop("password", UNSET) + + application_name = d.pop("applicationName", UNSET) + + application_version = d.pop("applicationVersion", UNSET) + + login_request = cls( + domain=domain, + username=username, + password=password, + application_name=application_name, + application_version=application_version, + ) + + return login_request diff --git a/openapi/openapi_project/openapi_package/models/login_response.py b/openapi/openapi_project/openapi_package/models/login_response.py new file mode 100644 index 000000000..757b0879c --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/login_response.py @@ -0,0 +1,204 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.login_status import LoginStatus +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.login_response_system_settings import LoginResponseSystemSettings + from ..models.user import User + + +T = TypeVar("T", bound="LoginResponse") + + +@_attrs_define +class LoginResponse: + """ + Attributes: + token (Union[Unset, str]): + environment (Union[Unset, str]): + login_attempts_remaining (Union[Unset, int]): + login_status (Union[Unset, LoginStatus]): + server_build_ts (Union[Unset, str]): + server_hash (Union[Unset, str]): + server_name (Union[Unset, str]): + server_time_utc (Union[Unset, str]): + server_version (Union[Unset, str]): + site (Union[Unset, str]): + text (Union[Unset, str]): + user (Union[Unset, User]): + system_settings (Union[Unset, LoginResponseSystemSettings]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + token: Unset | str = UNSET + environment: Unset | str = UNSET + login_attempts_remaining: Unset | int = UNSET + login_status: Unset | LoginStatus = UNSET + server_build_ts: Unset | str = UNSET + server_hash: Unset | str = UNSET + server_name: Unset | str = UNSET + server_time_utc: Unset | str = UNSET + server_version: Unset | str = UNSET + site: Unset | str = UNSET + text: Unset | str = UNSET + user: Union[Unset, "User"] = UNSET + system_settings: Union[Unset, "LoginResponseSystemSettings"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + token = self.token + + environment = self.environment + + login_attempts_remaining = self.login_attempts_remaining + + login_status: Unset | str = UNSET + if not isinstance(self.login_status, Unset): + login_status = self.login_status.value + + server_build_ts = self.server_build_ts + + server_hash = self.server_hash + + server_name = self.server_name + + server_time_utc = self.server_time_utc + + server_version = self.server_version + + site = self.site + + text = self.text + + user: Unset | dict[str, Any] = UNSET + if not isinstance(self.user, Unset): + user = self.user.to_dict() + + system_settings: Unset | dict[str, Any] = UNSET + if not isinstance(self.system_settings, Unset): + system_settings = self.system_settings.to_dict() + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if token is not UNSET: + field_dict["token"] = token + if environment is not UNSET: + field_dict["environment"] = environment + if login_attempts_remaining is not UNSET: + field_dict["loginAttemptsRemaining"] = login_attempts_remaining + if login_status is not UNSET: + field_dict["loginStatus"] = login_status + if server_build_ts is not UNSET: + field_dict["serverBuildTs"] = server_build_ts + if server_hash is not UNSET: + field_dict["serverHash"] = server_hash + if server_name is not UNSET: + field_dict["serverName"] = server_name + if server_time_utc is not UNSET: + field_dict["serverTimeUtc"] = server_time_utc + if server_version is not UNSET: + field_dict["serverVersion"] = server_version + if site is not UNSET: + field_dict["site"] = site + if text is not UNSET: + field_dict["text"] = text + if user is not UNSET: + field_dict["user"] = user + if system_settings is not UNSET: + field_dict["systemSettings"] = system_settings + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.login_response_system_settings import LoginResponseSystemSettings + from ..models.user import User + + d = dict(src_dict) + token = d.pop("token", UNSET) + + environment = d.pop("environment", UNSET) + + login_attempts_remaining = d.pop("loginAttemptsRemaining", UNSET) + + _login_status = d.pop("loginStatus", UNSET) + login_status: Unset | LoginStatus + if isinstance(_login_status, Unset): + login_status = UNSET + else: + login_status = LoginStatus(_login_status) + + server_build_ts = d.pop("serverBuildTs", UNSET) + + server_hash = d.pop("serverHash", UNSET) + + server_name = d.pop("serverName", UNSET) + + server_time_utc = d.pop("serverTimeUtc", UNSET) + + server_version = d.pop("serverVersion", UNSET) + + site = d.pop("site", UNSET) + + text = d.pop("text", UNSET) + + _user = d.pop("user", UNSET) + user: Unset | User + if isinstance(_user, Unset): + user = UNSET + else: + user = User.from_dict(_user) + + _system_settings = d.pop("systemSettings", UNSET) + system_settings: Unset | LoginResponseSystemSettings + if isinstance(_system_settings, Unset): + system_settings = UNSET + else: + system_settings = LoginResponseSystemSettings.from_dict(_system_settings) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + login_response = cls( + token=token, + environment=environment, + login_attempts_remaining=login_attempts_remaining, + login_status=login_status, + server_build_ts=server_build_ts, + server_hash=server_hash, + server_name=server_name, + server_time_utc=server_time_utc, + server_version=server_version, + site=site, + text=text, + user=user, + system_settings=system_settings, + error_message=error_message, + status_code=status_code, + ) + + return login_response diff --git a/openapi/openapi_project/openapi_package/models/login_response_system_settings.py b/openapi/openapi_project/openapi_package/models/login_response_system_settings.py new file mode 100644 index 000000000..cd0f44a86 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/login_response_system_settings.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="LoginResponseSystemSettings") + + +@_attrs_define +class LoginResponseSystemSettings: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + login_response_system_settings = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + login_response_system_settings.additional_properties = additional_properties + return login_response_system_settings + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/login_status.py b/openapi/openapi_project/openapi_package/models/login_status.py new file mode 100644 index 000000000..30ad89211 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/login_status.py @@ -0,0 +1,19 @@ +from enum import Enum + + +class LoginStatus(str, Enum): + CONNECTION_FAILED = "CONNECTION_FAILED" + LOGIN_DISALLOWED = "LOGIN_DISALLOWED" + LOGIN_SUCCESS = "LOGIN_SUCCESS" + MFA_FAILED = "MFA_FAILED" + MFA_REQUIRED = "MFA_REQUIRED" + NOT_AUTHORIZED = "NOT_AUTHORIZED" + PASSWORD_CHANGE_FAILED = "PASSWORD_CHANGE_FAILED" + PASSWORD_CHANGE_SUCCESSFUL = "PASSWORD_CHANGE_SUCCESSFUL" + PASSWORD_EXPIRED = "PASSWORD_EXPIRED" + SERVER_HASH_CHANGED = "SERVER_HASH_CHANGED" + UNDEFINED = "UNDEFINED" + VERSION_TOO_OLD = "VERSION_TOO_OLD" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/margin_data.py b/openapi/openapi_project/openapi_package/models/margin_data.py new file mode 100644 index 000000000..a5a72ebcf --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/margin_data.py @@ -0,0 +1,80 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.empty import Empty + from ..models.tims_margin_data import TimsMarginData + + +T = TypeVar("T", bound="MarginData") + + +@_attrs_define +class MarginData: + """ + Attributes: + account_id (Union[Unset, int]): + tims (Union[Unset, TimsMarginData]): + span (Union[Unset, Empty]): + """ + + account_id: Unset | int = UNSET + tims: Union[Unset, "TimsMarginData"] = UNSET + span: Union[Unset, "Empty"] = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + tims: Unset | dict[str, Any] = UNSET + if not isinstance(self.tims, Unset): + tims = self.tims.to_dict() + + span: Unset | dict[str, Any] = UNSET + if not isinstance(self.span, Unset): + span = self.span.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if tims is not UNSET: + field_dict["tims"] = tims + if span is not UNSET: + field_dict["span"] = span + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.empty import Empty + from ..models.tims_margin_data import TimsMarginData + + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + _tims = d.pop("tims", UNSET) + tims: Unset | TimsMarginData + if isinstance(_tims, Unset): + tims = UNSET + else: + tims = TimsMarginData.from_dict(_tims) + + _span = d.pop("span", UNSET) + span: Unset | Empty + if isinstance(_span, Unset): + span = UNSET + else: + span = Empty.from_dict(_span) + + margin_data = cls( + account_id=account_id, + tims=tims, + span=span, + ) + + return margin_data diff --git a/openapi/openapi_project/openapi_package/models/margin_data_type.py b/openapi/openapi_project/openapi_package/models/margin_data_type.py new file mode 100644 index 000000000..aecc4034d --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/margin_data_type.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class MarginDataType(str, Enum): + MARGIN_DATA_TYPE_SPAN = "MARGIN_DATA_TYPE_SPAN" + MARGIN_DATA_TYPE_TIMS = "MARGIN_DATA_TYPE_TIMS" + MARGIN_DATA_TYPE_UNKNOWN = "MARGIN_DATA_TYPE_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order.py b/openapi/openapi_project/openapi_package/models/multi_leg_order.py new file mode 100644 index 000000000..c925ee6b2 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/multi_leg_order.py @@ -0,0 +1,545 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.ord_status import OrdStatus +from ..models.ord_type import OrdType +from ..models.origination_type import OriginationType +from ..models.price_type import PriceType +from ..models.tif import Tif +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.clearing_info import ClearingInfo + from ..models.header import Header + from ..models.multi_leg_order_algo import MultiLegOrderAlgo + from ..models.multi_leg_order_leg import MultiLegOrderLeg + from ..models.multi_leg_order_market_condition import MultiLegOrderMarketCondition + from ..models.multi_leg_order_optional_data import MultiLegOrderOptionalData + from ..models.order_instruction import OrderInstruction + from ..models.order_update_event import OrderUpdateEvent + + +T = TypeVar("T", bound="MultiLegOrder") + + +@_attrs_define +class MultiLegOrder: + """ + Attributes: + account_id (Union[Unset, int]): + algo (Union[Unset, MultiLegOrderAlgo]): + aux_price (Union[Unset, float]): + clearing_info (Union[Unset, ClearingInfo]): + cur_ord_id (Union[Unset, str]): + header (Union[Unset, Header]): + id (Union[Unset, str]): + incoming_cl_ord_id (Union[Unset, str]): + incoming_ord_id (Union[Unset, str]): + instructions (Union[Unset, list['OrderInstruction']]): + legs (Union[Unset, list['MultiLegOrderLeg']]): + market_condition (Union[Unset, MultiLegOrderMarketCondition]): + optional_data (Union[Unset, MultiLegOrderOptionalData]): + order_flags (Union[Unset, int]): + order_updates (Union[Unset, list['OrderUpdateEvent']]): + ord_type (Union[Unset, OrdType]): + origination_type (Union[Unset, OriginationType]): + parent_ord_id (Union[Unset, str]): + price (Union[Unset, float]): + price_type (Union[Unset, PriceType]): + qty (Union[Unset, float]): + route (Union[Unset, str]): + source (Union[Unset, str]): + source_address (Union[Unset, str]): + submit_ts (Union[Unset, str]): + tag (Union[Unset, str]): + text (Union[Unset, str]): + tif (Union[Unset, Tif]): + user_id (Union[Unset, int]): + trader_id (Union[Unset, str]): + ord_status (Union[Unset, OrdStatus]): + avg_price (Union[Unset, float]): + claimed_by (Union[Unset, str]): + last_price (Union[Unset, float]): + last_qty (Union[Unset, float]): + last_market (Union[Unset, str]): + leaves_qty (Union[Unset, float]): + cum_qty (Union[Unset, float]): + transact_ts (Union[Unset, str]): + working_qty (Union[Unset, float]): + has_busts (Union[Unset, bool]): + has_corrects (Union[Unset, bool]): + has_notes (Union[Unset, bool]): + """ + + account_id: Unset | int = UNSET + algo: Union[Unset, "MultiLegOrderAlgo"] = UNSET + aux_price: Unset | float = UNSET + clearing_info: Union[Unset, "ClearingInfo"] = UNSET + cur_ord_id: Unset | str = UNSET + header: Union[Unset, "Header"] = UNSET + id: Unset | str = UNSET + incoming_cl_ord_id: Unset | str = UNSET + incoming_ord_id: Unset | str = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + legs: Unset | list["MultiLegOrderLeg"] = UNSET + market_condition: Union[Unset, "MultiLegOrderMarketCondition"] = UNSET + optional_data: Union[Unset, "MultiLegOrderOptionalData"] = UNSET + order_flags: Unset | int = UNSET + order_updates: Unset | list["OrderUpdateEvent"] = UNSET + ord_type: Unset | OrdType = UNSET + origination_type: Unset | OriginationType = UNSET + parent_ord_id: Unset | str = UNSET + price: Unset | float = UNSET + price_type: Unset | PriceType = UNSET + qty: Unset | float = UNSET + route: Unset | str = UNSET + source: Unset | str = UNSET + source_address: Unset | str = UNSET + submit_ts: Unset | str = UNSET + tag: Unset | str = UNSET + text: Unset | str = UNSET + tif: Unset | Tif = UNSET + user_id: Unset | int = UNSET + trader_id: Unset | str = UNSET + ord_status: Unset | OrdStatus = UNSET + avg_price: Unset | float = UNSET + claimed_by: Unset | str = UNSET + last_price: Unset | float = UNSET + last_qty: Unset | float = UNSET + last_market: Unset | str = UNSET + leaves_qty: Unset | float = UNSET + cum_qty: Unset | float = UNSET + transact_ts: Unset | str = UNSET + working_qty: Unset | float = UNSET + has_busts: Unset | bool = UNSET + has_corrects: Unset | bool = UNSET + has_notes: Unset | bool = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + algo: Unset | dict[str, Any] = UNSET + if not isinstance(self.algo, Unset): + algo = self.algo.to_dict() + + aux_price = self.aux_price + + clearing_info: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_info, Unset): + clearing_info = self.clearing_info.to_dict() + + cur_ord_id = self.cur_ord_id + + header: Unset | dict[str, Any] = UNSET + if not isinstance(self.header, Unset): + header = self.header.to_dict() + + id = self.id + + incoming_cl_ord_id = self.incoming_cl_ord_id + + incoming_ord_id = self.incoming_ord_id + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + legs: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.legs, Unset): + legs = [] + for legs_item_data in self.legs: + legs_item = legs_item_data.to_dict() + legs.append(legs_item) + + market_condition: Unset | dict[str, Any] = UNSET + if not isinstance(self.market_condition, Unset): + market_condition = self.market_condition.to_dict() + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + order_flags = self.order_flags + + order_updates: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.order_updates, Unset): + order_updates = [] + for order_updates_item_data in self.order_updates: + order_updates_item = order_updates_item_data.to_dict() + order_updates.append(order_updates_item) + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + origination_type: Unset | str = UNSET + if not isinstance(self.origination_type, Unset): + origination_type = self.origination_type.value + + parent_ord_id = self.parent_ord_id + + price = self.price + + price_type: Unset | str = UNSET + if not isinstance(self.price_type, Unset): + price_type = self.price_type.value + + qty = self.qty + + route = self.route + + source = self.source + + source_address = self.source_address + + submit_ts = self.submit_ts + + tag = self.tag + + text = self.text + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + user_id = self.user_id + + trader_id = self.trader_id + + ord_status: Unset | str = UNSET + if not isinstance(self.ord_status, Unset): + ord_status = self.ord_status.value + + avg_price = self.avg_price + + claimed_by = self.claimed_by + + last_price = self.last_price + + last_qty = self.last_qty + + last_market = self.last_market + + leaves_qty = self.leaves_qty + + cum_qty = self.cum_qty + + transact_ts = self.transact_ts + + working_qty = self.working_qty + + has_busts = self.has_busts + + has_corrects = self.has_corrects + + has_notes = self.has_notes + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if algo is not UNSET: + field_dict["algo"] = algo + if aux_price is not UNSET: + field_dict["auxPrice"] = aux_price + if clearing_info is not UNSET: + field_dict["clearingInfo"] = clearing_info + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if header is not UNSET: + field_dict["header"] = header + if id is not UNSET: + field_dict["id"] = id + if incoming_cl_ord_id is not UNSET: + field_dict["incomingClOrdId"] = incoming_cl_ord_id + if incoming_ord_id is not UNSET: + field_dict["incomingOrdId"] = incoming_ord_id + if instructions is not UNSET: + field_dict["instructions"] = instructions + if legs is not UNSET: + field_dict["legs"] = legs + if market_condition is not UNSET: + field_dict["marketCondition"] = market_condition + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if order_flags is not UNSET: + field_dict["orderFlags"] = order_flags + if order_updates is not UNSET: + field_dict["orderUpdates"] = order_updates + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if origination_type is not UNSET: + field_dict["originationType"] = origination_type + if parent_ord_id is not UNSET: + field_dict["parentOrdId"] = parent_ord_id + if price is not UNSET: + field_dict["price"] = price + if price_type is not UNSET: + field_dict["priceType"] = price_type + if qty is not UNSET: + field_dict["qty"] = qty + if route is not UNSET: + field_dict["route"] = route + if source is not UNSET: + field_dict["source"] = source + if source_address is not UNSET: + field_dict["sourceAddress"] = source_address + if submit_ts is not UNSET: + field_dict["submitTs"] = submit_ts + if tag is not UNSET: + field_dict["tag"] = tag + if text is not UNSET: + field_dict["text"] = text + if tif is not UNSET: + field_dict["tif"] = tif + if user_id is not UNSET: + field_dict["userId"] = user_id + if trader_id is not UNSET: + field_dict["traderId"] = trader_id + if ord_status is not UNSET: + field_dict["ordStatus"] = ord_status + if avg_price is not UNSET: + field_dict["avgPrice"] = avg_price + if claimed_by is not UNSET: + field_dict["claimedBy"] = claimed_by + if last_price is not UNSET: + field_dict["lastPrice"] = last_price + if last_qty is not UNSET: + field_dict["lastQty"] = last_qty + if last_market is not UNSET: + field_dict["lastMarket"] = last_market + if leaves_qty is not UNSET: + field_dict["leavesQty"] = leaves_qty + if cum_qty is not UNSET: + field_dict["cumQty"] = cum_qty + if transact_ts is not UNSET: + field_dict["transactTs"] = transact_ts + if working_qty is not UNSET: + field_dict["workingQty"] = working_qty + if has_busts is not UNSET: + field_dict["hasBusts"] = has_busts + if has_corrects is not UNSET: + field_dict["hasCorrects"] = has_corrects + if has_notes is not UNSET: + field_dict["hasNotes"] = has_notes + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.clearing_info import ClearingInfo + from ..models.header import Header + from ..models.multi_leg_order_algo import MultiLegOrderAlgo + from ..models.multi_leg_order_leg import MultiLegOrderLeg + from ..models.multi_leg_order_market_condition import ( + MultiLegOrderMarketCondition, + ) + from ..models.multi_leg_order_optional_data import MultiLegOrderOptionalData + from ..models.order_instruction import OrderInstruction + from ..models.order_update_event import OrderUpdateEvent + + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + _algo = d.pop("algo", UNSET) + algo: Unset | MultiLegOrderAlgo + if isinstance(_algo, Unset): + algo = UNSET + else: + algo = MultiLegOrderAlgo.from_dict(_algo) + + aux_price = d.pop("auxPrice", UNSET) + + _clearing_info = d.pop("clearingInfo", UNSET) + clearing_info: Unset | ClearingInfo + if isinstance(_clearing_info, Unset): + clearing_info = UNSET + else: + clearing_info = ClearingInfo.from_dict(_clearing_info) + + cur_ord_id = d.pop("curOrdId", UNSET) + + _header = d.pop("header", UNSET) + header: Unset | Header + if isinstance(_header, Unset): + header = UNSET + else: + header = Header.from_dict(_header) + + id = d.pop("id", UNSET) + + incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) + + incoming_ord_id = d.pop("incomingOrdId", UNSET) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + legs = [] + _legs = d.pop("legs", UNSET) + for legs_item_data in _legs or []: + legs_item = MultiLegOrderLeg.from_dict(legs_item_data) + + legs.append(legs_item) + + _market_condition = d.pop("marketCondition", UNSET) + market_condition: Unset | MultiLegOrderMarketCondition + if isinstance(_market_condition, Unset): + market_condition = UNSET + else: + market_condition = MultiLegOrderMarketCondition.from_dict(_market_condition) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | MultiLegOrderOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = MultiLegOrderOptionalData.from_dict(_optional_data) + + order_flags = d.pop("orderFlags", UNSET) + + order_updates = [] + _order_updates = d.pop("orderUpdates", UNSET) + for order_updates_item_data in _order_updates or []: + order_updates_item = OrderUpdateEvent.from_dict(order_updates_item_data) + + order_updates.append(order_updates_item) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + _origination_type = d.pop("originationType", UNSET) + origination_type: Unset | OriginationType + if isinstance(_origination_type, Unset): + origination_type = UNSET + else: + origination_type = OriginationType(_origination_type) + + parent_ord_id = d.pop("parentOrdId", UNSET) + + price = d.pop("price", UNSET) + + _price_type = d.pop("priceType", UNSET) + price_type: Unset | PriceType + if isinstance(_price_type, Unset): + price_type = UNSET + else: + price_type = PriceType(_price_type) + + qty = d.pop("qty", UNSET) + + route = d.pop("route", UNSET) + + source = d.pop("source", UNSET) + + source_address = d.pop("sourceAddress", UNSET) + + submit_ts = d.pop("submitTs", UNSET) + + tag = d.pop("tag", UNSET) + + text = d.pop("text", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + user_id = d.pop("userId", UNSET) + + trader_id = d.pop("traderId", UNSET) + + _ord_status = d.pop("ordStatus", UNSET) + ord_status: Unset | OrdStatus + if isinstance(_ord_status, Unset): + ord_status = UNSET + else: + ord_status = OrdStatus(_ord_status) + + avg_price = d.pop("avgPrice", UNSET) + + claimed_by = d.pop("claimedBy", UNSET) + + last_price = d.pop("lastPrice", UNSET) + + last_qty = d.pop("lastQty", UNSET) + + last_market = d.pop("lastMarket", UNSET) + + leaves_qty = d.pop("leavesQty", UNSET) + + cum_qty = d.pop("cumQty", UNSET) + + transact_ts = d.pop("transactTs", UNSET) + + working_qty = d.pop("workingQty", UNSET) + + has_busts = d.pop("hasBusts", UNSET) + + has_corrects = d.pop("hasCorrects", UNSET) + + has_notes = d.pop("hasNotes", UNSET) + + multi_leg_order = cls( + account_id=account_id, + algo=algo, + aux_price=aux_price, + clearing_info=clearing_info, + cur_ord_id=cur_ord_id, + header=header, + id=id, + incoming_cl_ord_id=incoming_cl_ord_id, + incoming_ord_id=incoming_ord_id, + instructions=instructions, + legs=legs, + market_condition=market_condition, + optional_data=optional_data, + order_flags=order_flags, + order_updates=order_updates, + ord_type=ord_type, + origination_type=origination_type, + parent_ord_id=parent_ord_id, + price=price, + price_type=price_type, + qty=qty, + route=route, + source=source, + source_address=source_address, + submit_ts=submit_ts, + tag=tag, + text=text, + tif=tif, + user_id=user_id, + trader_id=trader_id, + ord_status=ord_status, + avg_price=avg_price, + claimed_by=claimed_by, + last_price=last_price, + last_qty=last_qty, + last_market=last_market, + leaves_qty=leaves_qty, + cum_qty=cum_qty, + transact_ts=transact_ts, + working_qty=working_qty, + has_busts=has_busts, + has_corrects=has_corrects, + has_notes=has_notes, + ) + + return multi_leg_order diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_algo.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_algo.py new file mode 100644 index 000000000..f151dd1d7 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/multi_leg_order_algo.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="MultiLegOrderAlgo") + + +@_attrs_define +class MultiLegOrderAlgo: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + multi_leg_order_algo = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + multi_leg_order_algo.additional_properties = additional_properties + return multi_leg_order_algo + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py new file mode 100644 index 000000000..f1c4373c6 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py @@ -0,0 +1,377 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.ord_type import OrdType +from ..models.origination_type import OriginationType +from ..models.price_type import PriceType +from ..models.side import Side +from ..models.tif import Tif +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.clearing_info import ClearingInfo + from ..models.header import Header + from ..models.multi_leg_order_cancel_replace_request_algo import ( + MultiLegOrderCancelReplaceRequestAlgo, + ) + from ..models.multi_leg_order_cancel_replace_request_market_condition import ( + MultiLegOrderCancelReplaceRequestMarketCondition, + ) + from ..models.multi_leg_order_cancel_replace_request_optional_data import ( + MultiLegOrderCancelReplaceRequestOptionalData, + ) + from ..models.order_instruction import OrderInstruction + + +T = TypeVar("T", bound="MultiLegOrderCancelReplaceRequest") + + +@_attrs_define +class MultiLegOrderCancelReplaceRequest: + """ + Attributes: + algo (Union[Unset, MultiLegOrderCancelReplaceRequestAlgo]): + aux_price (Union[Unset, float]): + clearing_info (Union[Unset, ClearingInfo]): + cur_ord_id (Union[Unset, str]): + header (Union[Unset, Header]): + incoming_cl_ord_id (Union[Unset, str]): + incoming_orig_cl_ord_id (Union[Unset, str]): + instructions (Union[Unset, list['OrderInstruction']]): + optional_data (Union[Unset, MultiLegOrderCancelReplaceRequestOptionalData]): + market_condition (Union[Unset, MultiLegOrderCancelReplaceRequestMarketCondition]): + ord_type (Union[Unset, OrdType]): + origination_type (Union[Unset, OriginationType]): + perm_ord_id (Union[Unset, str]): + price (Union[Unset, float]): + price_type (Union[Unset, PriceType]): + qty (Union[Unset, float]): + req_ord_id (Union[Unset, str]): + side (Union[Unset, Side]): + source (Union[Unset, str]): + submit_ts (Union[Unset, str]): + tag (Union[Unset, str]): + text (Union[Unset, str]): + tif (Union[Unset, Tif]): + trader_id (Union[Unset, str]): + user_id (Union[Unset, int]): + """ + + algo: Union[Unset, "MultiLegOrderCancelReplaceRequestAlgo"] = UNSET + aux_price: Unset | float = UNSET + clearing_info: Union[Unset, "ClearingInfo"] = UNSET + cur_ord_id: Unset | str = UNSET + header: Union[Unset, "Header"] = UNSET + incoming_cl_ord_id: Unset | str = UNSET + incoming_orig_cl_ord_id: Unset | str = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + optional_data: Union[Unset, "MultiLegOrderCancelReplaceRequestOptionalData"] = UNSET + market_condition: Union[ + Unset, "MultiLegOrderCancelReplaceRequestMarketCondition" + ] = UNSET + ord_type: Unset | OrdType = UNSET + origination_type: Unset | OriginationType = UNSET + perm_ord_id: Unset | str = UNSET + price: Unset | float = UNSET + price_type: Unset | PriceType = UNSET + qty: Unset | float = UNSET + req_ord_id: Unset | str = UNSET + side: Unset | Side = UNSET + source: Unset | str = UNSET + submit_ts: Unset | str = UNSET + tag: Unset | str = UNSET + text: Unset | str = UNSET + tif: Unset | Tif = UNSET + trader_id: Unset | str = UNSET + user_id: Unset | int = UNSET + + def to_dict(self) -> dict[str, Any]: + algo: Unset | dict[str, Any] = UNSET + if not isinstance(self.algo, Unset): + algo = self.algo.to_dict() + + aux_price = self.aux_price + + clearing_info: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_info, Unset): + clearing_info = self.clearing_info.to_dict() + + cur_ord_id = self.cur_ord_id + + header: Unset | dict[str, Any] = UNSET + if not isinstance(self.header, Unset): + header = self.header.to_dict() + + incoming_cl_ord_id = self.incoming_cl_ord_id + + incoming_orig_cl_ord_id = self.incoming_orig_cl_ord_id + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + market_condition: Unset | dict[str, Any] = UNSET + if not isinstance(self.market_condition, Unset): + market_condition = self.market_condition.to_dict() + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + origination_type: Unset | str = UNSET + if not isinstance(self.origination_type, Unset): + origination_type = self.origination_type.value + + perm_ord_id = self.perm_ord_id + + price = self.price + + price_type: Unset | str = UNSET + if not isinstance(self.price_type, Unset): + price_type = self.price_type.value + + qty = self.qty + + req_ord_id = self.req_ord_id + + side: Unset | str = UNSET + if not isinstance(self.side, Unset): + side = self.side.value + + source = self.source + + submit_ts = self.submit_ts + + tag = self.tag + + text = self.text + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + trader_id = self.trader_id + + user_id = self.user_id + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if algo is not UNSET: + field_dict["algo"] = algo + if aux_price is not UNSET: + field_dict["auxPrice"] = aux_price + if clearing_info is not UNSET: + field_dict["clearingInfo"] = clearing_info + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if header is not UNSET: + field_dict["header"] = header + if incoming_cl_ord_id is not UNSET: + field_dict["incomingClOrdId"] = incoming_cl_ord_id + if incoming_orig_cl_ord_id is not UNSET: + field_dict["incomingOrigClOrdId"] = incoming_orig_cl_ord_id + if instructions is not UNSET: + field_dict["instructions"] = instructions + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if market_condition is not UNSET: + field_dict["marketCondition"] = market_condition + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if origination_type is not UNSET: + field_dict["originationType"] = origination_type + if perm_ord_id is not UNSET: + field_dict["permOrdId"] = perm_ord_id + if price is not UNSET: + field_dict["price"] = price + if price_type is not UNSET: + field_dict["priceType"] = price_type + if qty is not UNSET: + field_dict["qty"] = qty + if req_ord_id is not UNSET: + field_dict["reqOrdId"] = req_ord_id + if side is not UNSET: + field_dict["side"] = side + if source is not UNSET: + field_dict["source"] = source + if submit_ts is not UNSET: + field_dict["submitTs"] = submit_ts + if tag is not UNSET: + field_dict["tag"] = tag + if text is not UNSET: + field_dict["text"] = text + if tif is not UNSET: + field_dict["tif"] = tif + if trader_id is not UNSET: + field_dict["traderId"] = trader_id + if user_id is not UNSET: + field_dict["userId"] = user_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.clearing_info import ClearingInfo + from ..models.header import Header + from ..models.multi_leg_order_cancel_replace_request_algo import ( + MultiLegOrderCancelReplaceRequestAlgo, + ) + from ..models.multi_leg_order_cancel_replace_request_market_condition import ( + MultiLegOrderCancelReplaceRequestMarketCondition, + ) + from ..models.multi_leg_order_cancel_replace_request_optional_data import ( + MultiLegOrderCancelReplaceRequestOptionalData, + ) + from ..models.order_instruction import OrderInstruction + + d = dict(src_dict) + _algo = d.pop("algo", UNSET) + algo: Unset | MultiLegOrderCancelReplaceRequestAlgo + if isinstance(_algo, Unset): + algo = UNSET + else: + algo = MultiLegOrderCancelReplaceRequestAlgo.from_dict(_algo) + + aux_price = d.pop("auxPrice", UNSET) + + _clearing_info = d.pop("clearingInfo", UNSET) + clearing_info: Unset | ClearingInfo + if isinstance(_clearing_info, Unset): + clearing_info = UNSET + else: + clearing_info = ClearingInfo.from_dict(_clearing_info) + + cur_ord_id = d.pop("curOrdId", UNSET) + + _header = d.pop("header", UNSET) + header: Unset | Header + if isinstance(_header, Unset): + header = UNSET + else: + header = Header.from_dict(_header) + + incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) + + incoming_orig_cl_ord_id = d.pop("incomingOrigClOrdId", UNSET) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | MultiLegOrderCancelReplaceRequestOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = MultiLegOrderCancelReplaceRequestOptionalData.from_dict( + _optional_data + ) + + _market_condition = d.pop("marketCondition", UNSET) + market_condition: Unset | MultiLegOrderCancelReplaceRequestMarketCondition + if isinstance(_market_condition, Unset): + market_condition = UNSET + else: + market_condition = ( + MultiLegOrderCancelReplaceRequestMarketCondition.from_dict( + _market_condition + ) + ) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + _origination_type = d.pop("originationType", UNSET) + origination_type: Unset | OriginationType + if isinstance(_origination_type, Unset): + origination_type = UNSET + else: + origination_type = OriginationType(_origination_type) + + perm_ord_id = d.pop("permOrdId", UNSET) + + price = d.pop("price", UNSET) + + _price_type = d.pop("priceType", UNSET) + price_type: Unset | PriceType + if isinstance(_price_type, Unset): + price_type = UNSET + else: + price_type = PriceType(_price_type) + + qty = d.pop("qty", UNSET) + + req_ord_id = d.pop("reqOrdId", UNSET) + + _side = d.pop("side", UNSET) + side: Unset | Side + if isinstance(_side, Unset): + side = UNSET + else: + side = Side(_side) + + source = d.pop("source", UNSET) + + submit_ts = d.pop("submitTs", UNSET) + + tag = d.pop("tag", UNSET) + + text = d.pop("text", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + trader_id = d.pop("traderId", UNSET) + + user_id = d.pop("userId", UNSET) + + multi_leg_order_cancel_replace_request = cls( + algo=algo, + aux_price=aux_price, + clearing_info=clearing_info, + cur_ord_id=cur_ord_id, + header=header, + incoming_cl_ord_id=incoming_cl_ord_id, + incoming_orig_cl_ord_id=incoming_orig_cl_ord_id, + instructions=instructions, + optional_data=optional_data, + market_condition=market_condition, + ord_type=ord_type, + origination_type=origination_type, + perm_ord_id=perm_ord_id, + price=price, + price_type=price_type, + qty=qty, + req_ord_id=req_ord_id, + side=side, + source=source, + submit_ts=submit_ts, + tag=tag, + text=text, + tif=tif, + trader_id=trader_id, + user_id=user_id, + ) + + return multi_leg_order_cancel_replace_request diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py new file mode 100644 index 000000000..e417952f1 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="MultiLegOrderCancelReplaceRequestAlgo") + + +@_attrs_define +class MultiLegOrderCancelReplaceRequestAlgo: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + multi_leg_order_cancel_replace_request_algo = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + multi_leg_order_cancel_replace_request_algo.additional_properties = ( + additional_properties + ) + return multi_leg_order_cancel_replace_request_algo + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py new file mode 100644 index 000000000..4aed01b62 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="MultiLegOrderCancelReplaceRequestMarketCondition") + + +@_attrs_define +class MultiLegOrderCancelReplaceRequestMarketCondition: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + multi_leg_order_cancel_replace_request_market_condition = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + multi_leg_order_cancel_replace_request_market_condition.additional_properties = ( + additional_properties + ) + return multi_leg_order_cancel_replace_request_market_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py new file mode 100644 index 000000000..e0a2e0afc --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="MultiLegOrderCancelReplaceRequestOptionalData") + + +@_attrs_define +class MultiLegOrderCancelReplaceRequestOptionalData: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + multi_leg_order_cancel_replace_request_optional_data = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + multi_leg_order_cancel_replace_request_optional_data.additional_properties = ( + additional_properties + ) + return multi_leg_order_cancel_replace_request_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_cross.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_cross.py new file mode 100644 index 000000000..f62bf4e99 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/multi_leg_order_cross.py @@ -0,0 +1,484 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.cross_type import CrossType +from ..models.ord_status import OrdStatus +from ..models.ord_type import OrdType +from ..models.origination_type import OriginationType +from ..models.price_type import PriceType +from ..models.tif import Tif +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.header import Header + from ..models.multi_leg_order_cross_algo import MultiLegOrderCrossAlgo + from ..models.multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation + from ..models.multi_leg_order_cross_market_condition import ( + MultiLegOrderCrossMarketCondition, + ) + from ..models.multi_leg_order_cross_optional_data import ( + MultiLegOrderCrossOptionalData, + ) + from ..models.order_instruction import OrderInstruction + from ..models.order_update_event import OrderUpdateEvent + + +T = TypeVar("T", bound="MultiLegOrderCross") + + +@_attrs_define +class MultiLegOrderCross: + """ + Attributes: + account_id (Union[Unset, int]): + algo (Union[Unset, MultiLegOrderCrossAlgo]): + allocations (Union[Unset, list['MultiLegOrderCrossAllocation']]): + cross_type (Union[Unset, CrossType]): + cur_ord_id (Union[Unset, str]): + header (Union[Unset, Header]): + id (Union[Unset, str]): + incoming_cl_ord_id (Union[Unset, str]): + incoming_ord_id (Union[Unset, str]): + instructions (Union[Unset, list['OrderInstruction']]): + market_condition (Union[Unset, MultiLegOrderCrossMarketCondition]): + optional_data (Union[Unset, MultiLegOrderCrossOptionalData]): + order_flags (Union[Unset, int]): + order_updates (Union[Unset, list['OrderUpdateEvent']]): + ord_type (Union[Unset, OrdType]): + origination_type (Union[Unset, OriginationType]): + parent_ord_id (Union[Unset, str]): + price (Union[Unset, float]): + price_type (Union[Unset, PriceType]): + qty (Union[Unset, float]): + route (Union[Unset, str]): + source (Union[Unset, str]): + source_address (Union[Unset, str]): + submit_ts (Union[Unset, str]): + tag (Union[Unset, str]): + text (Union[Unset, str]): + tif (Union[Unset, Tif]): + user_id (Union[Unset, int]): + trader_id (Union[Unset, str]): + claimed_by (Union[Unset, str]): + ord_status (Union[Unset, OrdStatus]): + transact_ts (Union[Unset, str]): + has_busts (Union[Unset, bool]): + has_corrects (Union[Unset, bool]): + has_notes (Union[Unset, bool]): + """ + + account_id: Unset | int = UNSET + algo: Union[Unset, "MultiLegOrderCrossAlgo"] = UNSET + allocations: Unset | list["MultiLegOrderCrossAllocation"] = UNSET + cross_type: Unset | CrossType = UNSET + cur_ord_id: Unset | str = UNSET + header: Union[Unset, "Header"] = UNSET + id: Unset | str = UNSET + incoming_cl_ord_id: Unset | str = UNSET + incoming_ord_id: Unset | str = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + market_condition: Union[Unset, "MultiLegOrderCrossMarketCondition"] = UNSET + optional_data: Union[Unset, "MultiLegOrderCrossOptionalData"] = UNSET + order_flags: Unset | int = UNSET + order_updates: Unset | list["OrderUpdateEvent"] = UNSET + ord_type: Unset | OrdType = UNSET + origination_type: Unset | OriginationType = UNSET + parent_ord_id: Unset | str = UNSET + price: Unset | float = UNSET + price_type: Unset | PriceType = UNSET + qty: Unset | float = UNSET + route: Unset | str = UNSET + source: Unset | str = UNSET + source_address: Unset | str = UNSET + submit_ts: Unset | str = UNSET + tag: Unset | str = UNSET + text: Unset | str = UNSET + tif: Unset | Tif = UNSET + user_id: Unset | int = UNSET + trader_id: Unset | str = UNSET + claimed_by: Unset | str = UNSET + ord_status: Unset | OrdStatus = UNSET + transact_ts: Unset | str = UNSET + has_busts: Unset | bool = UNSET + has_corrects: Unset | bool = UNSET + has_notes: Unset | bool = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + algo: Unset | dict[str, Any] = UNSET + if not isinstance(self.algo, Unset): + algo = self.algo.to_dict() + + allocations: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.allocations, Unset): + allocations = [] + for allocations_item_data in self.allocations: + allocations_item = allocations_item_data.to_dict() + allocations.append(allocations_item) + + cross_type: Unset | str = UNSET + if not isinstance(self.cross_type, Unset): + cross_type = self.cross_type.value + + cur_ord_id = self.cur_ord_id + + header: Unset | dict[str, Any] = UNSET + if not isinstance(self.header, Unset): + header = self.header.to_dict() + + id = self.id + + incoming_cl_ord_id = self.incoming_cl_ord_id + + incoming_ord_id = self.incoming_ord_id + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + market_condition: Unset | dict[str, Any] = UNSET + if not isinstance(self.market_condition, Unset): + market_condition = self.market_condition.to_dict() + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + order_flags = self.order_flags + + order_updates: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.order_updates, Unset): + order_updates = [] + for order_updates_item_data in self.order_updates: + order_updates_item = order_updates_item_data.to_dict() + order_updates.append(order_updates_item) + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + origination_type: Unset | str = UNSET + if not isinstance(self.origination_type, Unset): + origination_type = self.origination_type.value + + parent_ord_id = self.parent_ord_id + + price = self.price + + price_type: Unset | str = UNSET + if not isinstance(self.price_type, Unset): + price_type = self.price_type.value + + qty = self.qty + + route = self.route + + source = self.source + + source_address = self.source_address + + submit_ts = self.submit_ts + + tag = self.tag + + text = self.text + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + user_id = self.user_id + + trader_id = self.trader_id + + claimed_by = self.claimed_by + + ord_status: Unset | str = UNSET + if not isinstance(self.ord_status, Unset): + ord_status = self.ord_status.value + + transact_ts = self.transact_ts + + has_busts = self.has_busts + + has_corrects = self.has_corrects + + has_notes = self.has_notes + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if algo is not UNSET: + field_dict["algo"] = algo + if allocations is not UNSET: + field_dict["allocations"] = allocations + if cross_type is not UNSET: + field_dict["crossType"] = cross_type + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if header is not UNSET: + field_dict["header"] = header + if id is not UNSET: + field_dict["id"] = id + if incoming_cl_ord_id is not UNSET: + field_dict["incomingClOrdId"] = incoming_cl_ord_id + if incoming_ord_id is not UNSET: + field_dict["incomingOrdId"] = incoming_ord_id + if instructions is not UNSET: + field_dict["instructions"] = instructions + if market_condition is not UNSET: + field_dict["marketCondition"] = market_condition + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if order_flags is not UNSET: + field_dict["orderFlags"] = order_flags + if order_updates is not UNSET: + field_dict["orderUpdates"] = order_updates + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if origination_type is not UNSET: + field_dict["originationType"] = origination_type + if parent_ord_id is not UNSET: + field_dict["parentOrdId"] = parent_ord_id + if price is not UNSET: + field_dict["price"] = price + if price_type is not UNSET: + field_dict["priceType"] = price_type + if qty is not UNSET: + field_dict["qty"] = qty + if route is not UNSET: + field_dict["route"] = route + if source is not UNSET: + field_dict["source"] = source + if source_address is not UNSET: + field_dict["sourceAddress"] = source_address + if submit_ts is not UNSET: + field_dict["submitTs"] = submit_ts + if tag is not UNSET: + field_dict["tag"] = tag + if text is not UNSET: + field_dict["text"] = text + if tif is not UNSET: + field_dict["tif"] = tif + if user_id is not UNSET: + field_dict["userId"] = user_id + if trader_id is not UNSET: + field_dict["traderId"] = trader_id + if claimed_by is not UNSET: + field_dict["claimedBy"] = claimed_by + if ord_status is not UNSET: + field_dict["ordStatus"] = ord_status + if transact_ts is not UNSET: + field_dict["transactTs"] = transact_ts + if has_busts is not UNSET: + field_dict["hasBusts"] = has_busts + if has_corrects is not UNSET: + field_dict["hasCorrects"] = has_corrects + if has_notes is not UNSET: + field_dict["hasNotes"] = has_notes + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.header import Header + from ..models.multi_leg_order_cross_algo import MultiLegOrderCrossAlgo + from ..models.multi_leg_order_cross_allocation import ( + MultiLegOrderCrossAllocation, + ) + from ..models.multi_leg_order_cross_market_condition import ( + MultiLegOrderCrossMarketCondition, + ) + from ..models.multi_leg_order_cross_optional_data import ( + MultiLegOrderCrossOptionalData, + ) + from ..models.order_instruction import OrderInstruction + from ..models.order_update_event import OrderUpdateEvent + + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + _algo = d.pop("algo", UNSET) + algo: Unset | MultiLegOrderCrossAlgo + if isinstance(_algo, Unset): + algo = UNSET + else: + algo = MultiLegOrderCrossAlgo.from_dict(_algo) + + allocations = [] + _allocations = d.pop("allocations", UNSET) + for allocations_item_data in _allocations or []: + allocations_item = MultiLegOrderCrossAllocation.from_dict( + allocations_item_data + ) + + allocations.append(allocations_item) + + _cross_type = d.pop("crossType", UNSET) + cross_type: Unset | CrossType + if isinstance(_cross_type, Unset): + cross_type = UNSET + else: + cross_type = CrossType(_cross_type) + + cur_ord_id = d.pop("curOrdId", UNSET) + + _header = d.pop("header", UNSET) + header: Unset | Header + if isinstance(_header, Unset): + header = UNSET + else: + header = Header.from_dict(_header) + + id = d.pop("id", UNSET) + + incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) + + incoming_ord_id = d.pop("incomingOrdId", UNSET) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + _market_condition = d.pop("marketCondition", UNSET) + market_condition: Unset | MultiLegOrderCrossMarketCondition + if isinstance(_market_condition, Unset): + market_condition = UNSET + else: + market_condition = MultiLegOrderCrossMarketCondition.from_dict( + _market_condition + ) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | MultiLegOrderCrossOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = MultiLegOrderCrossOptionalData.from_dict(_optional_data) + + order_flags = d.pop("orderFlags", UNSET) + + order_updates = [] + _order_updates = d.pop("orderUpdates", UNSET) + for order_updates_item_data in _order_updates or []: + order_updates_item = OrderUpdateEvent.from_dict(order_updates_item_data) + + order_updates.append(order_updates_item) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + _origination_type = d.pop("originationType", UNSET) + origination_type: Unset | OriginationType + if isinstance(_origination_type, Unset): + origination_type = UNSET + else: + origination_type = OriginationType(_origination_type) + + parent_ord_id = d.pop("parentOrdId", UNSET) + + price = d.pop("price", UNSET) + + _price_type = d.pop("priceType", UNSET) + price_type: Unset | PriceType + if isinstance(_price_type, Unset): + price_type = UNSET + else: + price_type = PriceType(_price_type) + + qty = d.pop("qty", UNSET) + + route = d.pop("route", UNSET) + + source = d.pop("source", UNSET) + + source_address = d.pop("sourceAddress", UNSET) + + submit_ts = d.pop("submitTs", UNSET) + + tag = d.pop("tag", UNSET) + + text = d.pop("text", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + user_id = d.pop("userId", UNSET) + + trader_id = d.pop("traderId", UNSET) + + claimed_by = d.pop("claimedBy", UNSET) + + _ord_status = d.pop("ordStatus", UNSET) + ord_status: Unset | OrdStatus + if isinstance(_ord_status, Unset): + ord_status = UNSET + else: + ord_status = OrdStatus(_ord_status) + + transact_ts = d.pop("transactTs", UNSET) + + has_busts = d.pop("hasBusts", UNSET) + + has_corrects = d.pop("hasCorrects", UNSET) + + has_notes = d.pop("hasNotes", UNSET) + + multi_leg_order_cross = cls( + account_id=account_id, + algo=algo, + allocations=allocations, + cross_type=cross_type, + cur_ord_id=cur_ord_id, + header=header, + id=id, + incoming_cl_ord_id=incoming_cl_ord_id, + incoming_ord_id=incoming_ord_id, + instructions=instructions, + market_condition=market_condition, + optional_data=optional_data, + order_flags=order_flags, + order_updates=order_updates, + ord_type=ord_type, + origination_type=origination_type, + parent_ord_id=parent_ord_id, + price=price, + price_type=price_type, + qty=qty, + route=route, + source=source, + source_address=source_address, + submit_ts=submit_ts, + tag=tag, + text=text, + tif=tif, + user_id=user_id, + trader_id=trader_id, + claimed_by=claimed_by, + ord_status=ord_status, + transact_ts=transact_ts, + has_busts=has_busts, + has_corrects=has_corrects, + has_notes=has_notes, + ) + + return multi_leg_order_cross diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py new file mode 100644 index 000000000..f28e1cbb7 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="MultiLegOrderCrossAlgo") + + +@_attrs_define +class MultiLegOrderCrossAlgo: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + multi_leg_order_cross_algo = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + multi_leg_order_cross_algo.additional_properties = additional_properties + return multi_leg_order_cross_algo + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py new file mode 100644 index 000000000..c4cc4e4d7 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py @@ -0,0 +1,261 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.cross_side_type import CrossSideType +from ..models.ord_status import OrdStatus +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.clearing_info import ClearingInfo + from ..models.multi_leg_order_cross_allocation_optional_data import ( + MultiLegOrderCrossAllocationOptionalData, + ) + from ..models.multi_leg_order_leg import MultiLegOrderLeg + from ..models.order_instruction import OrderInstruction + + +T = TypeVar("T", bound="MultiLegOrderCrossAllocation") + + +@_attrs_define +class MultiLegOrderCrossAllocation: + """ + Attributes: + account_id (Union[Unset, int]): + clearing_info (Union[Unset, ClearingInfo]): + id (Union[Unset, str]): + instructions (Union[Unset, list['OrderInstruction']]): + legs (Union[Unset, list['MultiLegOrderLeg']]): + optional_data (Union[Unset, MultiLegOrderCrossAllocationOptionalData]): + qty (Union[Unset, float]): + side_type (Union[Unset, CrossSideType]): + avg_price (Union[Unset, float]): + last_price (Union[Unset, float]): + last_qty (Union[Unset, float]): + last_market (Union[Unset, str]): + leaves_qty (Union[Unset, float]): + cum_qty (Union[Unset, float]): + transact_ts (Union[Unset, str]): + ord_status (Union[Unset, OrdStatus]): + incoming_cl_ord_id (Union[Unset, str]): + incoming_ord_id (Union[Unset, str]): + """ + + account_id: Unset | int = UNSET + clearing_info: Union[Unset, "ClearingInfo"] = UNSET + id: Unset | str = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + legs: Unset | list["MultiLegOrderLeg"] = UNSET + optional_data: Union[Unset, "MultiLegOrderCrossAllocationOptionalData"] = UNSET + qty: Unset | float = UNSET + side_type: Unset | CrossSideType = UNSET + avg_price: Unset | float = UNSET + last_price: Unset | float = UNSET + last_qty: Unset | float = UNSET + last_market: Unset | str = UNSET + leaves_qty: Unset | float = UNSET + cum_qty: Unset | float = UNSET + transact_ts: Unset | str = UNSET + ord_status: Unset | OrdStatus = UNSET + incoming_cl_ord_id: Unset | str = UNSET + incoming_ord_id: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + clearing_info: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_info, Unset): + clearing_info = self.clearing_info.to_dict() + + id = self.id + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + legs: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.legs, Unset): + legs = [] + for legs_item_data in self.legs: + legs_item = legs_item_data.to_dict() + legs.append(legs_item) + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + qty = self.qty + + side_type: Unset | str = UNSET + if not isinstance(self.side_type, Unset): + side_type = self.side_type.value + + avg_price = self.avg_price + + last_price = self.last_price + + last_qty = self.last_qty + + last_market = self.last_market + + leaves_qty = self.leaves_qty + + cum_qty = self.cum_qty + + transact_ts = self.transact_ts + + ord_status: Unset | str = UNSET + if not isinstance(self.ord_status, Unset): + ord_status = self.ord_status.value + + incoming_cl_ord_id = self.incoming_cl_ord_id + + incoming_ord_id = self.incoming_ord_id + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if clearing_info is not UNSET: + field_dict["clearingInfo"] = clearing_info + if id is not UNSET: + field_dict["id"] = id + if instructions is not UNSET: + field_dict["instructions"] = instructions + if legs is not UNSET: + field_dict["legs"] = legs + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if qty is not UNSET: + field_dict["qty"] = qty + if side_type is not UNSET: + field_dict["sideType"] = side_type + if avg_price is not UNSET: + field_dict["avgPrice"] = avg_price + if last_price is not UNSET: + field_dict["lastPrice"] = last_price + if last_qty is not UNSET: + field_dict["lastQty"] = last_qty + if last_market is not UNSET: + field_dict["lastMarket"] = last_market + if leaves_qty is not UNSET: + field_dict["leavesQty"] = leaves_qty + if cum_qty is not UNSET: + field_dict["cumQty"] = cum_qty + if transact_ts is not UNSET: + field_dict["transactTs"] = transact_ts + if ord_status is not UNSET: + field_dict["ordStatus"] = ord_status + if incoming_cl_ord_id is not UNSET: + field_dict["incomingClOrdId"] = incoming_cl_ord_id + if incoming_ord_id is not UNSET: + field_dict["incomingOrdId"] = incoming_ord_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.clearing_info import ClearingInfo + from ..models.multi_leg_order_cross_allocation_optional_data import ( + MultiLegOrderCrossAllocationOptionalData, + ) + from ..models.multi_leg_order_leg import MultiLegOrderLeg + from ..models.order_instruction import OrderInstruction + + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + _clearing_info = d.pop("clearingInfo", UNSET) + clearing_info: Unset | ClearingInfo + if isinstance(_clearing_info, Unset): + clearing_info = UNSET + else: + clearing_info = ClearingInfo.from_dict(_clearing_info) + + id = d.pop("id", UNSET) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + legs = [] + _legs = d.pop("legs", UNSET) + for legs_item_data in _legs or []: + legs_item = MultiLegOrderLeg.from_dict(legs_item_data) + + legs.append(legs_item) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | MultiLegOrderCrossAllocationOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = MultiLegOrderCrossAllocationOptionalData.from_dict( + _optional_data + ) + + qty = d.pop("qty", UNSET) + + _side_type = d.pop("sideType", UNSET) + side_type: Unset | CrossSideType + if isinstance(_side_type, Unset): + side_type = UNSET + else: + side_type = CrossSideType(_side_type) + + avg_price = d.pop("avgPrice", UNSET) + + last_price = d.pop("lastPrice", UNSET) + + last_qty = d.pop("lastQty", UNSET) + + last_market = d.pop("lastMarket", UNSET) + + leaves_qty = d.pop("leavesQty", UNSET) + + cum_qty = d.pop("cumQty", UNSET) + + transact_ts = d.pop("transactTs", UNSET) + + _ord_status = d.pop("ordStatus", UNSET) + ord_status: Unset | OrdStatus + if isinstance(_ord_status, Unset): + ord_status = UNSET + else: + ord_status = OrdStatus(_ord_status) + + incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) + + incoming_ord_id = d.pop("incomingOrdId", UNSET) + + multi_leg_order_cross_allocation = cls( + account_id=account_id, + clearing_info=clearing_info, + id=id, + instructions=instructions, + legs=legs, + optional_data=optional_data, + qty=qty, + side_type=side_type, + avg_price=avg_price, + last_price=last_price, + last_qty=last_qty, + last_market=last_market, + leaves_qty=leaves_qty, + cum_qty=cum_qty, + transact_ts=transact_ts, + ord_status=ord_status, + incoming_cl_ord_id=incoming_cl_ord_id, + incoming_ord_id=incoming_ord_id, + ) + + return multi_leg_order_cross_allocation diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py new file mode 100644 index 000000000..3adc30656 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="MultiLegOrderCrossAllocationOptionalData") + + +@_attrs_define +class MultiLegOrderCrossAllocationOptionalData: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + multi_leg_order_cross_allocation_optional_data = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + multi_leg_order_cross_allocation_optional_data.additional_properties = ( + additional_properties + ) + return multi_leg_order_cross_allocation_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py new file mode 100644 index 000000000..4267a5ea4 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="MultiLegOrderCrossMarketCondition") + + +@_attrs_define +class MultiLegOrderCrossMarketCondition: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + multi_leg_order_cross_market_condition = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + multi_leg_order_cross_market_condition.additional_properties = ( + additional_properties + ) + return multi_leg_order_cross_market_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py new file mode 100644 index 000000000..27c8cc231 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="MultiLegOrderCrossOptionalData") + + +@_attrs_define +class MultiLegOrderCrossOptionalData: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + multi_leg_order_cross_optional_data = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + multi_leg_order_cross_optional_data.additional_properties = ( + additional_properties + ) + return multi_leg_order_cross_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_leg.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_leg.py new file mode 100644 index 000000000..d3374e9cf --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/multi_leg_order_leg.py @@ -0,0 +1,260 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.position_effect import PositionEffect +from ..models.side import Side +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.multi_leg_order_leg_market_condition import ( + MultiLegOrderLegMarketCondition, + ) + from ..models.multi_leg_order_leg_optional_data import MultiLegOrderLegOptionalData + from ..models.order_update_event import OrderUpdateEvent + from ..models.security import Security + + +T = TypeVar("T", bound="MultiLegOrderLeg") + + +@_attrs_define +class MultiLegOrderLeg: + """ + Attributes: + id (Union[Unset, str]): + market_condition (Union[Unset, MultiLegOrderLegMarketCondition]): + optional_data (Union[Unset, MultiLegOrderLegOptionalData]): + order_updates (Union[Unset, list['OrderUpdateEvent']]): + position_effect (Union[Unset, PositionEffect]): + price (Union[Unset, float]): + qty (Union[Unset, float]): + ratio (Union[Unset, int]): + security (Union[Unset, Security]): + side (Union[Unset, Side]): + symbol (Union[Unset, str]): + avg_price (Union[Unset, float]): + last_price (Union[Unset, float]): + last_qty (Union[Unset, float]): + last_market (Union[Unset, str]): + leaves_qty (Union[Unset, float]): + cum_qty (Union[Unset, float]): + transact_ts (Union[Unset, str]): + """ + + id: Unset | str = UNSET + market_condition: Union[Unset, "MultiLegOrderLegMarketCondition"] = UNSET + optional_data: Union[Unset, "MultiLegOrderLegOptionalData"] = UNSET + order_updates: Unset | list["OrderUpdateEvent"] = UNSET + position_effect: Unset | PositionEffect = UNSET + price: Unset | float = UNSET + qty: Unset | float = UNSET + ratio: Unset | int = UNSET + security: Union[Unset, "Security"] = UNSET + side: Unset | Side = UNSET + symbol: Unset | str = UNSET + avg_price: Unset | float = UNSET + last_price: Unset | float = UNSET + last_qty: Unset | float = UNSET + last_market: Unset | str = UNSET + leaves_qty: Unset | float = UNSET + cum_qty: Unset | float = UNSET + transact_ts: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + id = self.id + + market_condition: Unset | dict[str, Any] = UNSET + if not isinstance(self.market_condition, Unset): + market_condition = self.market_condition.to_dict() + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + order_updates: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.order_updates, Unset): + order_updates = [] + for order_updates_item_data in self.order_updates: + order_updates_item = order_updates_item_data.to_dict() + order_updates.append(order_updates_item) + + position_effect: Unset | str = UNSET + if not isinstance(self.position_effect, Unset): + position_effect = self.position_effect.value + + price = self.price + + qty = self.qty + + ratio = self.ratio + + security: Unset | dict[str, Any] = UNSET + if not isinstance(self.security, Unset): + security = self.security.to_dict() + + side: Unset | str = UNSET + if not isinstance(self.side, Unset): + side = self.side.value + + symbol = self.symbol + + avg_price = self.avg_price + + last_price = self.last_price + + last_qty = self.last_qty + + last_market = self.last_market + + leaves_qty = self.leaves_qty + + cum_qty = self.cum_qty + + transact_ts = self.transact_ts + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if market_condition is not UNSET: + field_dict["marketCondition"] = market_condition + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if order_updates is not UNSET: + field_dict["orderUpdates"] = order_updates + if position_effect is not UNSET: + field_dict["positionEffect"] = position_effect + if price is not UNSET: + field_dict["price"] = price + if qty is not UNSET: + field_dict["qty"] = qty + if ratio is not UNSET: + field_dict["ratio"] = ratio + if security is not UNSET: + field_dict["security"] = security + if side is not UNSET: + field_dict["side"] = side + if symbol is not UNSET: + field_dict["symbol"] = symbol + if avg_price is not UNSET: + field_dict["avgPrice"] = avg_price + if last_price is not UNSET: + field_dict["lastPrice"] = last_price + if last_qty is not UNSET: + field_dict["lastQty"] = last_qty + if last_market is not UNSET: + field_dict["lastMarket"] = last_market + if leaves_qty is not UNSET: + field_dict["leavesQty"] = leaves_qty + if cum_qty is not UNSET: + field_dict["cumQty"] = cum_qty + if transact_ts is not UNSET: + field_dict["transactTs"] = transact_ts + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.multi_leg_order_leg_market_condition import ( + MultiLegOrderLegMarketCondition, + ) + from ..models.multi_leg_order_leg_optional_data import ( + MultiLegOrderLegOptionalData, + ) + from ..models.order_update_event import OrderUpdateEvent + from ..models.security import Security + + d = dict(src_dict) + id = d.pop("id", UNSET) + + _market_condition = d.pop("marketCondition", UNSET) + market_condition: Unset | MultiLegOrderLegMarketCondition + if isinstance(_market_condition, Unset): + market_condition = UNSET + else: + market_condition = MultiLegOrderLegMarketCondition.from_dict( + _market_condition + ) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | MultiLegOrderLegOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = MultiLegOrderLegOptionalData.from_dict(_optional_data) + + order_updates = [] + _order_updates = d.pop("orderUpdates", UNSET) + for order_updates_item_data in _order_updates or []: + order_updates_item = OrderUpdateEvent.from_dict(order_updates_item_data) + + order_updates.append(order_updates_item) + + _position_effect = d.pop("positionEffect", UNSET) + position_effect: Unset | PositionEffect + if isinstance(_position_effect, Unset): + position_effect = UNSET + else: + position_effect = PositionEffect(_position_effect) + + price = d.pop("price", UNSET) + + qty = d.pop("qty", UNSET) + + ratio = d.pop("ratio", UNSET) + + _security = d.pop("security", UNSET) + security: Unset | Security + if isinstance(_security, Unset): + security = UNSET + else: + security = Security.from_dict(_security) + + _side = d.pop("side", UNSET) + side: Unset | Side + if isinstance(_side, Unset): + side = UNSET + else: + side = Side(_side) + + symbol = d.pop("symbol", UNSET) + + avg_price = d.pop("avgPrice", UNSET) + + last_price = d.pop("lastPrice", UNSET) + + last_qty = d.pop("lastQty", UNSET) + + last_market = d.pop("lastMarket", UNSET) + + leaves_qty = d.pop("leavesQty", UNSET) + + cum_qty = d.pop("cumQty", UNSET) + + transact_ts = d.pop("transactTs", UNSET) + + multi_leg_order_leg = cls( + id=id, + market_condition=market_condition, + optional_data=optional_data, + order_updates=order_updates, + position_effect=position_effect, + price=price, + qty=qty, + ratio=ratio, + security=security, + side=side, + symbol=symbol, + avg_price=avg_price, + last_price=last_price, + last_qty=last_qty, + last_market=last_market, + leaves_qty=leaves_qty, + cum_qty=cum_qty, + transact_ts=transact_ts, + ) + + return multi_leg_order_leg diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py new file mode 100644 index 000000000..1a02af13d --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="MultiLegOrderLegMarketCondition") + + +@_attrs_define +class MultiLegOrderLegMarketCondition: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + multi_leg_order_leg_market_condition = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + multi_leg_order_leg_market_condition.additional_properties = ( + additional_properties + ) + return multi_leg_order_leg_market_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py new file mode 100644 index 000000000..5f5651b13 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="MultiLegOrderLegOptionalData") + + +@_attrs_define +class MultiLegOrderLegOptionalData: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + multi_leg_order_leg_optional_data = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + multi_leg_order_leg_optional_data.additional_properties = additional_properties + return multi_leg_order_leg_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_market_condition.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_market_condition.py new file mode 100644 index 000000000..df877977c --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/multi_leg_order_market_condition.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="MultiLegOrderMarketCondition") + + +@_attrs_define +class MultiLegOrderMarketCondition: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + multi_leg_order_market_condition = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + multi_leg_order_market_condition.additional_properties = additional_properties + return multi_leg_order_market_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_optional_data.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_optional_data.py new file mode 100644 index 000000000..1fd555d04 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/multi_leg_order_optional_data.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="MultiLegOrderOptionalData") + + +@_attrs_define +class MultiLegOrderOptionalData: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + multi_leg_order_optional_data = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + multi_leg_order_optional_data.additional_properties = additional_properties + return multi_leg_order_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_reporting_type.py b/openapi/openapi_project/openapi_package/models/multi_leg_reporting_type.py new file mode 100644 index 000000000..3bfe5e229 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/multi_leg_reporting_type.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class MultiLegReportingType(str, Enum): + MULTI_LEG_REPORTING_TYPE_LEG = "MULTI_LEG_REPORTING_TYPE_LEG" + MULTI_LEG_REPORTING_TYPE_PARENT = "MULTI_LEG_REPORTING_TYPE_PARENT" + MULTI_LEG_REPORTING_TYPE_SINGLE = "MULTI_LEG_REPORTING_TYPE_SINGLE" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/numeric_display_format.py b/openapi/openapi_project/openapi_package/models/numeric_display_format.py new file mode 100644 index 000000000..f28c58032 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/numeric_display_format.py @@ -0,0 +1,32 @@ +from enum import Enum + + +class NumericDisplayFormat(str, Enum): + NUMERIC_DISPLAY_FORMAT_AUTO = "NUMERIC_DISPLAY_FORMAT_AUTO" + NUMERIC_DISPLAY_FORMAT_DECIMAL_00 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_00" + NUMERIC_DISPLAY_FORMAT_DECIMAL_01 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_01" + NUMERIC_DISPLAY_FORMAT_DECIMAL_02 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_02" + NUMERIC_DISPLAY_FORMAT_DECIMAL_03 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_03" + NUMERIC_DISPLAY_FORMAT_DECIMAL_04 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_04" + NUMERIC_DISPLAY_FORMAT_DECIMAL_05 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_05" + NUMERIC_DISPLAY_FORMAT_DECIMAL_06 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_06" + NUMERIC_DISPLAY_FORMAT_DECIMAL_07 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_07" + NUMERIC_DISPLAY_FORMAT_DECIMAL_08 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_08" + NUMERIC_DISPLAY_FORMAT_DECIMAL_09 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_09" + NUMERIC_DISPLAY_FORMAT_DECIMAL_10 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_10" + NUMERIC_DISPLAY_FORMAT_DECIMAL_11 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_11" + NUMERIC_DISPLAY_FORMAT_FRACTIONAL_128TH = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_128TH" + NUMERIC_DISPLAY_FORMAT_FRACTIONAL_16TH = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_16TH" + NUMERIC_DISPLAY_FORMAT_FRACTIONAL_256TH = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_256TH" + NUMERIC_DISPLAY_FORMAT_FRACTIONAL_32ND = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_32ND" + NUMERIC_DISPLAY_FORMAT_FRACTIONAL_512ND = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_512ND" + NUMERIC_DISPLAY_FORMAT_FRACTIONAL_64TH = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_64TH" + NUMERIC_DISPLAY_FORMAT_FRACTIONAL_8TH = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_8TH" + NUMERIC_DISPLAY_FORMAT_FRACTIONAL_HALF = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_HALF" + NUMERIC_DISPLAY_FORMAT_FRACTIONAL_QUARTER = ( + "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_QUARTER" + ) + NUMERIC_DISPLAY_FORMAT_FRACTIONAL_WHOLE = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_WHOLE" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/option.py b/openapi/openapi_project/openapi_package/models/option.py new file mode 100644 index 000000000..be4c11837 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/option.py @@ -0,0 +1,391 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.currency import Currency +from ..models.exchange_code import ExchangeCode +from ..models.numeric_display_format import NumericDisplayFormat +from ..models.option_expiration_style import OptionExpirationStyle +from ..models.put_call import PutCall +from ..models.security_category import SecurityCategory +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.date import Date + from ..models.option_aliases import OptionAliases + from ..models.option_root import OptionRoot + + +T = TypeVar("T", bound="Option") + + +@_attrs_define +class Option: + """ + Attributes: + aliases (Union[Unset, OptionAliases]): + currency (Union[Unset, Currency]): + listed_dt (Union[Unset, Date]): + delisted_dt (Union[Unset, Date]): + description (Union[Unset, str]): + exchange_id (Union[Unset, int]): + id (Union[Unset, int]): + multiplier (Union[Unset, float]): + price_base_factor (Union[Unset, float]): + price_display_factor (Union[Unset, float]): + price_display_format (Union[Unset, NumericDisplayFormat]): + qty_display_factor (Union[Unset, float]): + qty_display_format (Union[Unset, NumericDisplayFormat]): + security_category (Union[Unset, SecurityCategory]): + symbol (Union[Unset, str]): + tick_rule (Union[Unset, str]): + tick_size (Union[Unset, float]): + tick_value (Union[Unset, float]): + traded_exchanges (Union[Unset, list[ExchangeCode]]): + expiration_dt (Union[Unset, Date]): + expiration_style (Union[Unset, OptionExpirationStyle]): + first_trade_dt (Union[Unset, Date]): + last_trade_dt (Union[Unset, Date]): + put_call (Union[Unset, PutCall]): + root (Union[Unset, OptionRoot]): + strike (Union[Unset, float]): + underlying (Union[Unset, str]): + """ + + aliases: Union[Unset, "OptionAliases"] = UNSET + currency: Unset | Currency = UNSET + listed_dt: Union[Unset, "Date"] = UNSET + delisted_dt: Union[Unset, "Date"] = UNSET + description: Unset | str = UNSET + exchange_id: Unset | int = UNSET + id: Unset | int = UNSET + multiplier: Unset | float = UNSET + price_base_factor: Unset | float = UNSET + price_display_factor: Unset | float = UNSET + price_display_format: Unset | NumericDisplayFormat = UNSET + qty_display_factor: Unset | float = UNSET + qty_display_format: Unset | NumericDisplayFormat = UNSET + security_category: Unset | SecurityCategory = UNSET + symbol: Unset | str = UNSET + tick_rule: Unset | str = UNSET + tick_size: Unset | float = UNSET + tick_value: Unset | float = UNSET + traded_exchanges: Unset | list[ExchangeCode] = UNSET + expiration_dt: Union[Unset, "Date"] = UNSET + expiration_style: Unset | OptionExpirationStyle = UNSET + first_trade_dt: Union[Unset, "Date"] = UNSET + last_trade_dt: Union[Unset, "Date"] = UNSET + put_call: Unset | PutCall = UNSET + root: Union[Unset, "OptionRoot"] = UNSET + strike: Unset | float = UNSET + underlying: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + aliases: Unset | dict[str, Any] = UNSET + if not isinstance(self.aliases, Unset): + aliases = self.aliases.to_dict() + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + listed_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.listed_dt, Unset): + listed_dt = self.listed_dt.to_dict() + + delisted_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.delisted_dt, Unset): + delisted_dt = self.delisted_dt.to_dict() + + description = self.description + + exchange_id = self.exchange_id + + id = self.id + + multiplier = self.multiplier + + price_base_factor = self.price_base_factor + + price_display_factor = self.price_display_factor + + price_display_format: Unset | str = UNSET + if not isinstance(self.price_display_format, Unset): + price_display_format = self.price_display_format.value + + qty_display_factor = self.qty_display_factor + + qty_display_format: Unset | str = UNSET + if not isinstance(self.qty_display_format, Unset): + qty_display_format = self.qty_display_format.value + + security_category: Unset | str = UNSET + if not isinstance(self.security_category, Unset): + security_category = self.security_category.value + + symbol = self.symbol + + tick_rule = self.tick_rule + + tick_size = self.tick_size + + tick_value = self.tick_value + + traded_exchanges: Unset | list[str] = UNSET + if not isinstance(self.traded_exchanges, Unset): + traded_exchanges = [] + for traded_exchanges_item_data in self.traded_exchanges: + traded_exchanges_item = traded_exchanges_item_data.value + traded_exchanges.append(traded_exchanges_item) + + expiration_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.expiration_dt, Unset): + expiration_dt = self.expiration_dt.to_dict() + + expiration_style: Unset | str = UNSET + if not isinstance(self.expiration_style, Unset): + expiration_style = self.expiration_style.value + + first_trade_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.first_trade_dt, Unset): + first_trade_dt = self.first_trade_dt.to_dict() + + last_trade_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.last_trade_dt, Unset): + last_trade_dt = self.last_trade_dt.to_dict() + + put_call: Unset | str = UNSET + if not isinstance(self.put_call, Unset): + put_call = self.put_call.value + + root: Unset | dict[str, Any] = UNSET + if not isinstance(self.root, Unset): + root = self.root.to_dict() + + strike = self.strike + + underlying = self.underlying + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if aliases is not UNSET: + field_dict["aliases"] = aliases + if currency is not UNSET: + field_dict["currency"] = currency + if listed_dt is not UNSET: + field_dict["listedDt"] = listed_dt + if delisted_dt is not UNSET: + field_dict["delistedDt"] = delisted_dt + if description is not UNSET: + field_dict["description"] = description + if exchange_id is not UNSET: + field_dict["exchangeId"] = exchange_id + if id is not UNSET: + field_dict["id"] = id + if multiplier is not UNSET: + field_dict["multiplier"] = multiplier + if price_base_factor is not UNSET: + field_dict["priceBaseFactor"] = price_base_factor + if price_display_factor is not UNSET: + field_dict["priceDisplayFactor"] = price_display_factor + if price_display_format is not UNSET: + field_dict["priceDisplayFormat"] = price_display_format + if qty_display_factor is not UNSET: + field_dict["qtyDisplayFactor"] = qty_display_factor + if qty_display_format is not UNSET: + field_dict["qtyDisplayFormat"] = qty_display_format + if security_category is not UNSET: + field_dict["securityCategory"] = security_category + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tick_rule is not UNSET: + field_dict["tickRule"] = tick_rule + if tick_size is not UNSET: + field_dict["tickSize"] = tick_size + if tick_value is not UNSET: + field_dict["tickValue"] = tick_value + if traded_exchanges is not UNSET: + field_dict["tradedExchanges"] = traded_exchanges + if expiration_dt is not UNSET: + field_dict["expirationDt"] = expiration_dt + if expiration_style is not UNSET: + field_dict["expirationStyle"] = expiration_style + if first_trade_dt is not UNSET: + field_dict["firstTradeDt"] = first_trade_dt + if last_trade_dt is not UNSET: + field_dict["lastTradeDt"] = last_trade_dt + if put_call is not UNSET: + field_dict["putCall"] = put_call + if root is not UNSET: + field_dict["root"] = root + if strike is not UNSET: + field_dict["strike"] = strike + if underlying is not UNSET: + field_dict["underlying"] = underlying + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.date import Date + from ..models.option_aliases import OptionAliases + from ..models.option_root import OptionRoot + + d = dict(src_dict) + _aliases = d.pop("aliases", UNSET) + aliases: Unset | OptionAliases + if isinstance(_aliases, Unset): + aliases = UNSET + else: + aliases = OptionAliases.from_dict(_aliases) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + _listed_dt = d.pop("listedDt", UNSET) + listed_dt: Unset | Date + if isinstance(_listed_dt, Unset): + listed_dt = UNSET + else: + listed_dt = Date.from_dict(_listed_dt) + + _delisted_dt = d.pop("delistedDt", UNSET) + delisted_dt: Unset | Date + if isinstance(_delisted_dt, Unset): + delisted_dt = UNSET + else: + delisted_dt = Date.from_dict(_delisted_dt) + + description = d.pop("description", UNSET) + + exchange_id = d.pop("exchangeId", UNSET) + + id = d.pop("id", UNSET) + + multiplier = d.pop("multiplier", UNSET) + + price_base_factor = d.pop("priceBaseFactor", UNSET) + + price_display_factor = d.pop("priceDisplayFactor", UNSET) + + _price_display_format = d.pop("priceDisplayFormat", UNSET) + price_display_format: Unset | NumericDisplayFormat + if isinstance(_price_display_format, Unset): + price_display_format = UNSET + else: + price_display_format = NumericDisplayFormat(_price_display_format) + + qty_display_factor = d.pop("qtyDisplayFactor", UNSET) + + _qty_display_format = d.pop("qtyDisplayFormat", UNSET) + qty_display_format: Unset | NumericDisplayFormat + if isinstance(_qty_display_format, Unset): + qty_display_format = UNSET + else: + qty_display_format = NumericDisplayFormat(_qty_display_format) + + _security_category = d.pop("securityCategory", UNSET) + security_category: Unset | SecurityCategory + if isinstance(_security_category, Unset): + security_category = UNSET + else: + security_category = SecurityCategory(_security_category) + + symbol = d.pop("symbol", UNSET) + + tick_rule = d.pop("tickRule", UNSET) + + tick_size = d.pop("tickSize", UNSET) + + tick_value = d.pop("tickValue", UNSET) + + traded_exchanges = [] + _traded_exchanges = d.pop("tradedExchanges", UNSET) + for traded_exchanges_item_data in _traded_exchanges or []: + traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) + + traded_exchanges.append(traded_exchanges_item) + + _expiration_dt = d.pop("expirationDt", UNSET) + expiration_dt: Unset | Date + if isinstance(_expiration_dt, Unset): + expiration_dt = UNSET + else: + expiration_dt = Date.from_dict(_expiration_dt) + + _expiration_style = d.pop("expirationStyle", UNSET) + expiration_style: Unset | OptionExpirationStyle + if isinstance(_expiration_style, Unset): + expiration_style = UNSET + else: + expiration_style = OptionExpirationStyle(_expiration_style) + + _first_trade_dt = d.pop("firstTradeDt", UNSET) + first_trade_dt: Unset | Date + if isinstance(_first_trade_dt, Unset): + first_trade_dt = UNSET + else: + first_trade_dt = Date.from_dict(_first_trade_dt) + + _last_trade_dt = d.pop("lastTradeDt", UNSET) + last_trade_dt: Unset | Date + if isinstance(_last_trade_dt, Unset): + last_trade_dt = UNSET + else: + last_trade_dt = Date.from_dict(_last_trade_dt) + + _put_call = d.pop("putCall", UNSET) + put_call: Unset | PutCall + if isinstance(_put_call, Unset): + put_call = UNSET + else: + put_call = PutCall(_put_call) + + _root = d.pop("root", UNSET) + root: Unset | OptionRoot + if isinstance(_root, Unset): + root = UNSET + else: + root = OptionRoot.from_dict(_root) + + strike = d.pop("strike", UNSET) + + underlying = d.pop("underlying", UNSET) + + option = cls( + aliases=aliases, + currency=currency, + listed_dt=listed_dt, + delisted_dt=delisted_dt, + description=description, + exchange_id=exchange_id, + id=id, + multiplier=multiplier, + price_base_factor=price_base_factor, + price_display_factor=price_display_factor, + price_display_format=price_display_format, + qty_display_factor=qty_display_factor, + qty_display_format=qty_display_format, + security_category=security_category, + symbol=symbol, + tick_rule=tick_rule, + tick_size=tick_size, + tick_value=tick_value, + traded_exchanges=traded_exchanges, + expiration_dt=expiration_dt, + expiration_style=expiration_style, + first_trade_dt=first_trade_dt, + last_trade_dt=last_trade_dt, + put_call=put_call, + root=root, + strike=strike, + underlying=underlying, + ) + + return option diff --git a/openapi/openapi_project/openapi_package/models/option_aliases.py b/openapi/openapi_project/openapi_package/models/option_aliases.py new file mode 100644 index 000000000..47517bdc7 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/option_aliases.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="OptionAliases") + + +@_attrs_define +class OptionAliases: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + option_aliases = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + option_aliases.additional_properties = additional_properties + return option_aliases + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/option_chain.py b/openapi/openapi_project/openapi_package/models/option_chain.py new file mode 100644 index 000000000..90be1bac4 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/option_chain.py @@ -0,0 +1,128 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.option_chain_options import OptionChainOptions + from ..models.option_chain_roots import OptionChainRoots + from ..models.option_series import OptionSeries + from ..models.security import Security + + +T = TypeVar("T", bound="OptionChain") + + +@_attrs_define +class OptionChain: + """ + Attributes: + underlying (Union[Unset, Security]): + roots (Union[Unset, OptionChainRoots]): + options (Union[Unset, OptionChainOptions]): + option_series (Union[Unset, list['OptionSeries']]): + post (Union[Unset, str]): + station (Union[Unset, str]): + """ + + underlying: Union[Unset, "Security"] = UNSET + roots: Union[Unset, "OptionChainRoots"] = UNSET + options: Union[Unset, "OptionChainOptions"] = UNSET + option_series: Unset | list["OptionSeries"] = UNSET + post: Unset | str = UNSET + station: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + underlying: Unset | dict[str, Any] = UNSET + if not isinstance(self.underlying, Unset): + underlying = self.underlying.to_dict() + + roots: Unset | dict[str, Any] = UNSET + if not isinstance(self.roots, Unset): + roots = self.roots.to_dict() + + options: Unset | dict[str, Any] = UNSET + if not isinstance(self.options, Unset): + options = self.options.to_dict() + + option_series: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.option_series, Unset): + option_series = [] + for option_series_item_data in self.option_series: + option_series_item = option_series_item_data.to_dict() + option_series.append(option_series_item) + + post = self.post + + station = self.station + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if underlying is not UNSET: + field_dict["underlying"] = underlying + if roots is not UNSET: + field_dict["roots"] = roots + if options is not UNSET: + field_dict["options"] = options + if option_series is not UNSET: + field_dict["optionSeries"] = option_series + if post is not UNSET: + field_dict["post"] = post + if station is not UNSET: + field_dict["station"] = station + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.option_chain_options import OptionChainOptions + from ..models.option_chain_roots import OptionChainRoots + from ..models.option_series import OptionSeries + from ..models.security import Security + + d = dict(src_dict) + _underlying = d.pop("underlying", UNSET) + underlying: Unset | Security + if isinstance(_underlying, Unset): + underlying = UNSET + else: + underlying = Security.from_dict(_underlying) + + _roots = d.pop("roots", UNSET) + roots: Unset | OptionChainRoots + if isinstance(_roots, Unset): + roots = UNSET + else: + roots = OptionChainRoots.from_dict(_roots) + + _options = d.pop("options", UNSET) + options: Unset | OptionChainOptions + if isinstance(_options, Unset): + options = UNSET + else: + options = OptionChainOptions.from_dict(_options) + + option_series = [] + _option_series = d.pop("optionSeries", UNSET) + for option_series_item_data in _option_series or []: + option_series_item = OptionSeries.from_dict(option_series_item_data) + + option_series.append(option_series_item) + + post = d.pop("post", UNSET) + + station = d.pop("station", UNSET) + + option_chain = cls( + underlying=underlying, + roots=roots, + options=options, + option_series=option_series, + post=post, + station=station, + ) + + return option_chain diff --git a/openapi/openapi_project/openapi_package/models/option_chain_option.py b/openapi/openapi_project/openapi_package/models/option_chain_option.py new file mode 100644 index 000000000..abd7d82b4 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/option_chain_option.py @@ -0,0 +1,219 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.exchange_code import ExchangeCode +from ..models.put_call import PutCall +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.date import Date + from ..models.option_chain_option_aliases import OptionChainOptionAliases + + +T = TypeVar("T", bound="OptionChainOption") + + +@_attrs_define +class OptionChainOption: + """ + Attributes: + aliases (Union[Unset, OptionChainOptionAliases]): + listed_dt (Union[Unset, Date]): + delisted_dt (Union[Unset, Date]): + description (Union[Unset, str]): + exchange_id (Union[Unset, int]): + id (Union[Unset, int]): + tick_rule (Union[Unset, str]): + tick_size (Union[Unset, float]): + tick_value (Union[Unset, float]): + traded_exchanges (Union[Unset, list[ExchangeCode]]): + first_trade_dt (Union[Unset, Date]): + last_trade_dt (Union[Unset, Date]): + put_call (Union[Unset, PutCall]): + strike (Union[Unset, float]): + """ + + aliases: Union[Unset, "OptionChainOptionAliases"] = UNSET + listed_dt: Union[Unset, "Date"] = UNSET + delisted_dt: Union[Unset, "Date"] = UNSET + description: Unset | str = UNSET + exchange_id: Unset | int = UNSET + id: Unset | int = UNSET + tick_rule: Unset | str = UNSET + tick_size: Unset | float = UNSET + tick_value: Unset | float = UNSET + traded_exchanges: Unset | list[ExchangeCode] = UNSET + first_trade_dt: Union[Unset, "Date"] = UNSET + last_trade_dt: Union[Unset, "Date"] = UNSET + put_call: Unset | PutCall = UNSET + strike: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + aliases: Unset | dict[str, Any] = UNSET + if not isinstance(self.aliases, Unset): + aliases = self.aliases.to_dict() + + listed_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.listed_dt, Unset): + listed_dt = self.listed_dt.to_dict() + + delisted_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.delisted_dt, Unset): + delisted_dt = self.delisted_dt.to_dict() + + description = self.description + + exchange_id = self.exchange_id + + id = self.id + + tick_rule = self.tick_rule + + tick_size = self.tick_size + + tick_value = self.tick_value + + traded_exchanges: Unset | list[str] = UNSET + if not isinstance(self.traded_exchanges, Unset): + traded_exchanges = [] + for traded_exchanges_item_data in self.traded_exchanges: + traded_exchanges_item = traded_exchanges_item_data.value + traded_exchanges.append(traded_exchanges_item) + + first_trade_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.first_trade_dt, Unset): + first_trade_dt = self.first_trade_dt.to_dict() + + last_trade_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.last_trade_dt, Unset): + last_trade_dt = self.last_trade_dt.to_dict() + + put_call: Unset | str = UNSET + if not isinstance(self.put_call, Unset): + put_call = self.put_call.value + + strike = self.strike + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if aliases is not UNSET: + field_dict["aliases"] = aliases + if listed_dt is not UNSET: + field_dict["listedDt"] = listed_dt + if delisted_dt is not UNSET: + field_dict["delistedDt"] = delisted_dt + if description is not UNSET: + field_dict["description"] = description + if exchange_id is not UNSET: + field_dict["exchangeId"] = exchange_id + if id is not UNSET: + field_dict["id"] = id + if tick_rule is not UNSET: + field_dict["tickRule"] = tick_rule + if tick_size is not UNSET: + field_dict["tickSize"] = tick_size + if tick_value is not UNSET: + field_dict["tickValue"] = tick_value + if traded_exchanges is not UNSET: + field_dict["tradedExchanges"] = traded_exchanges + if first_trade_dt is not UNSET: + field_dict["firstTradeDt"] = first_trade_dt + if last_trade_dt is not UNSET: + field_dict["lastTradeDt"] = last_trade_dt + if put_call is not UNSET: + field_dict["putCall"] = put_call + if strike is not UNSET: + field_dict["strike"] = strike + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.date import Date + from ..models.option_chain_option_aliases import OptionChainOptionAliases + + d = dict(src_dict) + _aliases = d.pop("aliases", UNSET) + aliases: Unset | OptionChainOptionAliases + if isinstance(_aliases, Unset): + aliases = UNSET + else: + aliases = OptionChainOptionAliases.from_dict(_aliases) + + _listed_dt = d.pop("listedDt", UNSET) + listed_dt: Unset | Date + if isinstance(_listed_dt, Unset): + listed_dt = UNSET + else: + listed_dt = Date.from_dict(_listed_dt) + + _delisted_dt = d.pop("delistedDt", UNSET) + delisted_dt: Unset | Date + if isinstance(_delisted_dt, Unset): + delisted_dt = UNSET + else: + delisted_dt = Date.from_dict(_delisted_dt) + + description = d.pop("description", UNSET) + + exchange_id = d.pop("exchangeId", UNSET) + + id = d.pop("id", UNSET) + + tick_rule = d.pop("tickRule", UNSET) + + tick_size = d.pop("tickSize", UNSET) + + tick_value = d.pop("tickValue", UNSET) + + traded_exchanges = [] + _traded_exchanges = d.pop("tradedExchanges", UNSET) + for traded_exchanges_item_data in _traded_exchanges or []: + traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) + + traded_exchanges.append(traded_exchanges_item) + + _first_trade_dt = d.pop("firstTradeDt", UNSET) + first_trade_dt: Unset | Date + if isinstance(_first_trade_dt, Unset): + first_trade_dt = UNSET + else: + first_trade_dt = Date.from_dict(_first_trade_dt) + + _last_trade_dt = d.pop("lastTradeDt", UNSET) + last_trade_dt: Unset | Date + if isinstance(_last_trade_dt, Unset): + last_trade_dt = UNSET + else: + last_trade_dt = Date.from_dict(_last_trade_dt) + + _put_call = d.pop("putCall", UNSET) + put_call: Unset | PutCall + if isinstance(_put_call, Unset): + put_call = UNSET + else: + put_call = PutCall(_put_call) + + strike = d.pop("strike", UNSET) + + option_chain_option = cls( + aliases=aliases, + listed_dt=listed_dt, + delisted_dt=delisted_dt, + description=description, + exchange_id=exchange_id, + id=id, + tick_rule=tick_rule, + tick_size=tick_size, + tick_value=tick_value, + traded_exchanges=traded_exchanges, + first_trade_dt=first_trade_dt, + last_trade_dt=last_trade_dt, + put_call=put_call, + strike=strike, + ) + + return option_chain_option diff --git a/openapi/openapi_project/openapi_package/models/option_chain_option_aliases.py b/openapi/openapi_project/openapi_package/models/option_chain_option_aliases.py new file mode 100644 index 000000000..1200fde1c --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/option_chain_option_aliases.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="OptionChainOptionAliases") + + +@_attrs_define +class OptionChainOptionAliases: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + option_chain_option_aliases = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + option_chain_option_aliases.additional_properties = additional_properties + return option_chain_option_aliases + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/option_chain_options.py b/openapi/openapi_project/openapi_package/models/option_chain_options.py new file mode 100644 index 000000000..601a13e40 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/option_chain_options.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.option_chain_option import OptionChainOption + + +T = TypeVar("T", bound="OptionChainOptions") + + +@_attrs_define +class OptionChainOptions: + """ """ + + additional_properties: dict[str, "OptionChainOption"] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop.to_dict() + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.option_chain_option import OptionChainOption + + d = dict(src_dict) + option_chain_options = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = OptionChainOption.from_dict(prop_dict) + + additional_properties[prop_name] = additional_property + + option_chain_options.additional_properties = additional_properties + return option_chain_options + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> "OptionChainOption": + return self.additional_properties[key] + + def __setitem__(self, key: str, value: "OptionChainOption") -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/option_chain_roots.py b/openapi/openapi_project/openapi_package/models/option_chain_roots.py new file mode 100644 index 000000000..1f6694c13 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/option_chain_roots.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.option_root import OptionRoot + + +T = TypeVar("T", bound="OptionChainRoots") + + +@_attrs_define +class OptionChainRoots: + """ """ + + additional_properties: dict[str, "OptionRoot"] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop.to_dict() + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.option_root import OptionRoot + + d = dict(src_dict) + option_chain_roots = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = OptionRoot.from_dict(prop_dict) + + additional_properties[prop_name] = additional_property + + option_chain_roots.additional_properties = additional_properties + return option_chain_roots + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> "OptionRoot": + return self.additional_properties[key] + + def __setitem__(self, key: str, value: "OptionRoot") -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/option_exercise_style.py b/openapi/openapi_project/openapi_package/models/option_exercise_style.py new file mode 100644 index 000000000..147be4d65 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/option_exercise_style.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class OptionExerciseStyle(str, Enum): + OPTION_EXERCISE_STYLE_AMERICAN = "OPTION_EXERCISE_STYLE_AMERICAN" + OPTION_EXERCISE_STYLE_BERMUDAN = "OPTION_EXERCISE_STYLE_BERMUDAN" + OPTION_EXERCISE_STYLE_EUROPEAN = "OPTION_EXERCISE_STYLE_EUROPEAN" + OPTION_EXERCISE_STYLE_UNDEFINED = "OPTION_EXERCISE_STYLE_UNDEFINED" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/option_expiration_style.py b/openapi/openapi_project/openapi_package/models/option_expiration_style.py new file mode 100644 index 000000000..bf0ad8c56 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/option_expiration_style.py @@ -0,0 +1,19 @@ +from enum import Enum + + +class OptionExpirationStyle(str, Enum): + OPTION_EXPIRATION_STYLE_DAILY = "OPTION_EXPIRATION_STYLE_DAILY" + OPTION_EXPIRATION_STYLE_E_O_M = "OPTION_EXPIRATION_STYLE_E_O_M" + OPTION_EXPIRATION_STYLE_LEAP = "OPTION_EXPIRATION_STYLE_LEAP" + OPTION_EXPIRATION_STYLE_MONTHLY = "OPTION_EXPIRATION_STYLE_MONTHLY" + OPTION_EXPIRATION_STYLE_QUARTERLY = "OPTION_EXPIRATION_STYLE_QUARTERLY" + OPTION_EXPIRATION_STYLE_UNKNOWN = "OPTION_EXPIRATION_STYLE_UNKNOWN" + OPTION_EXPIRATION_STYLE_WEEKLY = "OPTION_EXPIRATION_STYLE_WEEKLY" + OPTION_EXPIRATION_STYLE_WK1 = "OPTION_EXPIRATION_STYLE_WK1" + OPTION_EXPIRATION_STYLE_WK2 = "OPTION_EXPIRATION_STYLE_WK2" + OPTION_EXPIRATION_STYLE_WK3 = "OPTION_EXPIRATION_STYLE_WK3" + OPTION_EXPIRATION_STYLE_WK4 = "OPTION_EXPIRATION_STYLE_WK4" + OPTION_EXPIRATION_STYLE_WK5 = "OPTION_EXPIRATION_STYLE_WK5" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/option_root.py b/openapi/openapi_project/openapi_package/models/option_root.py new file mode 100644 index 000000000..6ef3ff488 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/option_root.py @@ -0,0 +1,418 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.currency import Currency +from ..models.exchange_code import ExchangeCode +from ..models.numeric_display_format import NumericDisplayFormat +from ..models.option_exercise_style import OptionExerciseStyle +from ..models.option_series_product_type import OptionSeriesProductType +from ..models.option_series_type import OptionSeriesType +from ..models.option_settlement_type import OptionSettlementType +from ..models.security_category import SecurityCategory +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.date import Date + from ..models.option_root_aliases import OptionRootAliases + from ..models.settlement_info import SettlementInfo + from ..models.trading_session_group import TradingSessionGroup + + +T = TypeVar("T", bound="OptionRoot") + + +@_attrs_define +class OptionRoot: + """ + Attributes: + aliases (Union[Unset, OptionRootAliases]): + currency (Union[Unset, Currency]): + listed_dt (Union[Unset, Date]): + delisted_dt (Union[Unset, Date]): + description (Union[Unset, str]): + exchange_id (Union[Unset, int]): + id (Union[Unset, int]): + multiplier (Union[Unset, float]): + price_base_factor (Union[Unset, float]): + price_display_factor (Union[Unset, float]): + price_display_format (Union[Unset, NumericDisplayFormat]): + qty_display_factor (Union[Unset, float]): + qty_display_format (Union[Unset, NumericDisplayFormat]): + security_category (Union[Unset, SecurityCategory]): + symbol (Union[Unset, str]): + tick_rule (Union[Unset, str]): + tick_size (Union[Unset, float]): + tick_value (Union[Unset, float]): + traded_exchanges (Union[Unset, list[ExchangeCode]]): + deliverable_per_contract (Union[Unset, float]): + exercise_style (Union[Unset, OptionExerciseStyle]): + product_type (Union[Unset, OptionSeriesProductType]): + series_type (Union[Unset, OptionSeriesType]): + settlement_infos (Union[Unset, list['SettlementInfo']]): + settlement_type (Union[Unset, OptionSettlementType]): + strike_multiplier (Union[Unset, float]): + strike_value (Union[Unset, float]): + trading_session_group (Union[Unset, TradingSessionGroup]): + underlying (Union[Unset, str]): + """ + + aliases: Union[Unset, "OptionRootAliases"] = UNSET + currency: Unset | Currency = UNSET + listed_dt: Union[Unset, "Date"] = UNSET + delisted_dt: Union[Unset, "Date"] = UNSET + description: Unset | str = UNSET + exchange_id: Unset | int = UNSET + id: Unset | int = UNSET + multiplier: Unset | float = UNSET + price_base_factor: Unset | float = UNSET + price_display_factor: Unset | float = UNSET + price_display_format: Unset | NumericDisplayFormat = UNSET + qty_display_factor: Unset | float = UNSET + qty_display_format: Unset | NumericDisplayFormat = UNSET + security_category: Unset | SecurityCategory = UNSET + symbol: Unset | str = UNSET + tick_rule: Unset | str = UNSET + tick_size: Unset | float = UNSET + tick_value: Unset | float = UNSET + traded_exchanges: Unset | list[ExchangeCode] = UNSET + deliverable_per_contract: Unset | float = UNSET + exercise_style: Unset | OptionExerciseStyle = UNSET + product_type: Unset | OptionSeriesProductType = UNSET + series_type: Unset | OptionSeriesType = UNSET + settlement_infos: Unset | list["SettlementInfo"] = UNSET + settlement_type: Unset | OptionSettlementType = UNSET + strike_multiplier: Unset | float = UNSET + strike_value: Unset | float = UNSET + trading_session_group: Union[Unset, "TradingSessionGroup"] = UNSET + underlying: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + aliases: Unset | dict[str, Any] = UNSET + if not isinstance(self.aliases, Unset): + aliases = self.aliases.to_dict() + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + listed_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.listed_dt, Unset): + listed_dt = self.listed_dt.to_dict() + + delisted_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.delisted_dt, Unset): + delisted_dt = self.delisted_dt.to_dict() + + description = self.description + + exchange_id = self.exchange_id + + id = self.id + + multiplier = self.multiplier + + price_base_factor = self.price_base_factor + + price_display_factor = self.price_display_factor + + price_display_format: Unset | str = UNSET + if not isinstance(self.price_display_format, Unset): + price_display_format = self.price_display_format.value + + qty_display_factor = self.qty_display_factor + + qty_display_format: Unset | str = UNSET + if not isinstance(self.qty_display_format, Unset): + qty_display_format = self.qty_display_format.value + + security_category: Unset | str = UNSET + if not isinstance(self.security_category, Unset): + security_category = self.security_category.value + + symbol = self.symbol + + tick_rule = self.tick_rule + + tick_size = self.tick_size + + tick_value = self.tick_value + + traded_exchanges: Unset | list[str] = UNSET + if not isinstance(self.traded_exchanges, Unset): + traded_exchanges = [] + for traded_exchanges_item_data in self.traded_exchanges: + traded_exchanges_item = traded_exchanges_item_data.value + traded_exchanges.append(traded_exchanges_item) + + deliverable_per_contract = self.deliverable_per_contract + + exercise_style: Unset | str = UNSET + if not isinstance(self.exercise_style, Unset): + exercise_style = self.exercise_style.value + + product_type: Unset | str = UNSET + if not isinstance(self.product_type, Unset): + product_type = self.product_type.value + + series_type: Unset | str = UNSET + if not isinstance(self.series_type, Unset): + series_type = self.series_type.value + + settlement_infos: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.settlement_infos, Unset): + settlement_infos = [] + for settlement_infos_item_data in self.settlement_infos: + settlement_infos_item = settlement_infos_item_data.to_dict() + settlement_infos.append(settlement_infos_item) + + settlement_type: Unset | str = UNSET + if not isinstance(self.settlement_type, Unset): + settlement_type = self.settlement_type.value + + strike_multiplier = self.strike_multiplier + + strike_value = self.strike_value + + trading_session_group: Unset | dict[str, Any] = UNSET + if not isinstance(self.trading_session_group, Unset): + trading_session_group = self.trading_session_group.to_dict() + + underlying = self.underlying + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if aliases is not UNSET: + field_dict["aliases"] = aliases + if currency is not UNSET: + field_dict["currency"] = currency + if listed_dt is not UNSET: + field_dict["listedDt"] = listed_dt + if delisted_dt is not UNSET: + field_dict["delistedDt"] = delisted_dt + if description is not UNSET: + field_dict["description"] = description + if exchange_id is not UNSET: + field_dict["exchangeId"] = exchange_id + if id is not UNSET: + field_dict["id"] = id + if multiplier is not UNSET: + field_dict["multiplier"] = multiplier + if price_base_factor is not UNSET: + field_dict["priceBaseFactor"] = price_base_factor + if price_display_factor is not UNSET: + field_dict["priceDisplayFactor"] = price_display_factor + if price_display_format is not UNSET: + field_dict["priceDisplayFormat"] = price_display_format + if qty_display_factor is not UNSET: + field_dict["qtyDisplayFactor"] = qty_display_factor + if qty_display_format is not UNSET: + field_dict["qtyDisplayFormat"] = qty_display_format + if security_category is not UNSET: + field_dict["securityCategory"] = security_category + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tick_rule is not UNSET: + field_dict["tickRule"] = tick_rule + if tick_size is not UNSET: + field_dict["tickSize"] = tick_size + if tick_value is not UNSET: + field_dict["tickValue"] = tick_value + if traded_exchanges is not UNSET: + field_dict["tradedExchanges"] = traded_exchanges + if deliverable_per_contract is not UNSET: + field_dict["deliverablePerContract"] = deliverable_per_contract + if exercise_style is not UNSET: + field_dict["exerciseStyle"] = exercise_style + if product_type is not UNSET: + field_dict["productType"] = product_type + if series_type is not UNSET: + field_dict["seriesType"] = series_type + if settlement_infos is not UNSET: + field_dict["settlementInfos"] = settlement_infos + if settlement_type is not UNSET: + field_dict["settlementType"] = settlement_type + if strike_multiplier is not UNSET: + field_dict["strikeMultiplier"] = strike_multiplier + if strike_value is not UNSET: + field_dict["strikeValue"] = strike_value + if trading_session_group is not UNSET: + field_dict["tradingSessionGroup"] = trading_session_group + if underlying is not UNSET: + field_dict["underlying"] = underlying + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.date import Date + from ..models.option_root_aliases import OptionRootAliases + from ..models.settlement_info import SettlementInfo + from ..models.trading_session_group import TradingSessionGroup + + d = dict(src_dict) + _aliases = d.pop("aliases", UNSET) + aliases: Unset | OptionRootAliases + if isinstance(_aliases, Unset): + aliases = UNSET + else: + aliases = OptionRootAliases.from_dict(_aliases) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + _listed_dt = d.pop("listedDt", UNSET) + listed_dt: Unset | Date + if isinstance(_listed_dt, Unset): + listed_dt = UNSET + else: + listed_dt = Date.from_dict(_listed_dt) + + _delisted_dt = d.pop("delistedDt", UNSET) + delisted_dt: Unset | Date + if isinstance(_delisted_dt, Unset): + delisted_dt = UNSET + else: + delisted_dt = Date.from_dict(_delisted_dt) + + description = d.pop("description", UNSET) + + exchange_id = d.pop("exchangeId", UNSET) + + id = d.pop("id", UNSET) + + multiplier = d.pop("multiplier", UNSET) + + price_base_factor = d.pop("priceBaseFactor", UNSET) + + price_display_factor = d.pop("priceDisplayFactor", UNSET) + + _price_display_format = d.pop("priceDisplayFormat", UNSET) + price_display_format: Unset | NumericDisplayFormat + if isinstance(_price_display_format, Unset): + price_display_format = UNSET + else: + price_display_format = NumericDisplayFormat(_price_display_format) + + qty_display_factor = d.pop("qtyDisplayFactor", UNSET) + + _qty_display_format = d.pop("qtyDisplayFormat", UNSET) + qty_display_format: Unset | NumericDisplayFormat + if isinstance(_qty_display_format, Unset): + qty_display_format = UNSET + else: + qty_display_format = NumericDisplayFormat(_qty_display_format) + + _security_category = d.pop("securityCategory", UNSET) + security_category: Unset | SecurityCategory + if isinstance(_security_category, Unset): + security_category = UNSET + else: + security_category = SecurityCategory(_security_category) + + symbol = d.pop("symbol", UNSET) + + tick_rule = d.pop("tickRule", UNSET) + + tick_size = d.pop("tickSize", UNSET) + + tick_value = d.pop("tickValue", UNSET) + + traded_exchanges = [] + _traded_exchanges = d.pop("tradedExchanges", UNSET) + for traded_exchanges_item_data in _traded_exchanges or []: + traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) + + traded_exchanges.append(traded_exchanges_item) + + deliverable_per_contract = d.pop("deliverablePerContract", UNSET) + + _exercise_style = d.pop("exerciseStyle", UNSET) + exercise_style: Unset | OptionExerciseStyle + if isinstance(_exercise_style, Unset): + exercise_style = UNSET + else: + exercise_style = OptionExerciseStyle(_exercise_style) + + _product_type = d.pop("productType", UNSET) + product_type: Unset | OptionSeriesProductType + if isinstance(_product_type, Unset): + product_type = UNSET + else: + product_type = OptionSeriesProductType(_product_type) + + _series_type = d.pop("seriesType", UNSET) + series_type: Unset | OptionSeriesType + if isinstance(_series_type, Unset): + series_type = UNSET + else: + series_type = OptionSeriesType(_series_type) + + settlement_infos = [] + _settlement_infos = d.pop("settlementInfos", UNSET) + for settlement_infos_item_data in _settlement_infos or []: + settlement_infos_item = SettlementInfo.from_dict(settlement_infos_item_data) + + settlement_infos.append(settlement_infos_item) + + _settlement_type = d.pop("settlementType", UNSET) + settlement_type: Unset | OptionSettlementType + if isinstance(_settlement_type, Unset): + settlement_type = UNSET + else: + settlement_type = OptionSettlementType(_settlement_type) + + strike_multiplier = d.pop("strikeMultiplier", UNSET) + + strike_value = d.pop("strikeValue", UNSET) + + _trading_session_group = d.pop("tradingSessionGroup", UNSET) + trading_session_group: Unset | TradingSessionGroup + if isinstance(_trading_session_group, Unset): + trading_session_group = UNSET + else: + trading_session_group = TradingSessionGroup.from_dict( + _trading_session_group + ) + + underlying = d.pop("underlying", UNSET) + + option_root = cls( + aliases=aliases, + currency=currency, + listed_dt=listed_dt, + delisted_dt=delisted_dt, + description=description, + exchange_id=exchange_id, + id=id, + multiplier=multiplier, + price_base_factor=price_base_factor, + price_display_factor=price_display_factor, + price_display_format=price_display_format, + qty_display_factor=qty_display_factor, + qty_display_format=qty_display_format, + security_category=security_category, + symbol=symbol, + tick_rule=tick_rule, + tick_size=tick_size, + tick_value=tick_value, + traded_exchanges=traded_exchanges, + deliverable_per_contract=deliverable_per_contract, + exercise_style=exercise_style, + product_type=product_type, + series_type=series_type, + settlement_infos=settlement_infos, + settlement_type=settlement_type, + strike_multiplier=strike_multiplier, + strike_value=strike_value, + trading_session_group=trading_session_group, + underlying=underlying, + ) + + return option_root diff --git a/openapi/openapi_project/openapi_package/models/option_root_aliases.py b/openapi/openapi_project/openapi_package/models/option_root_aliases.py new file mode 100644 index 000000000..98d380e17 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/option_root_aliases.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="OptionRootAliases") + + +@_attrs_define +class OptionRootAliases: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + option_root_aliases = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + option_root_aliases.additional_properties = additional_properties + return option_root_aliases + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/option_series.py b/openapi/openapi_project/openapi_package/models/option_series.py new file mode 100644 index 000000000..fbd7897ac --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/option_series.py @@ -0,0 +1,227 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define + +from ..models.currency import Currency +from ..models.numeric_display_format import NumericDisplayFormat +from ..models.option_expiration_style import OptionExpirationStyle +from ..models.option_series_type import OptionSeriesType +from ..models.option_settlement_type import OptionSettlementType +from ..models.security_category import SecurityCategory +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.date import Date + + +T = TypeVar("T", bound="OptionSeries") + + +@_attrs_define +class OptionSeries: + """ + Attributes: + expiration_dt (Union[Unset, Date]): + expiration_style (Union[Unset, OptionExpirationStyle]): + root_symbol (Union[Unset, str]): + series_type (Union[Unset, OptionSeriesType]): + settlement_type (Union[Unset, OptionSettlementType]): + option_symbols (Union[Unset, list[str]]): + currency (Union[Unset, Currency]): + multiplier (Union[Unset, float]): + price_base_factor (Union[Unset, float]): + price_display_factor (Union[Unset, float]): + price_display_format (Union[Unset, NumericDisplayFormat]): + qty_display_factor (Union[Unset, float]): + qty_display_format (Union[Unset, NumericDisplayFormat]): + security_category (Union[Unset, SecurityCategory]): + """ + + expiration_dt: Union[Unset, "Date"] = UNSET + expiration_style: Unset | OptionExpirationStyle = UNSET + root_symbol: Unset | str = UNSET + series_type: Unset | OptionSeriesType = UNSET + settlement_type: Unset | OptionSettlementType = UNSET + option_symbols: Unset | list[str] = UNSET + currency: Unset | Currency = UNSET + multiplier: Unset | float = UNSET + price_base_factor: Unset | float = UNSET + price_display_factor: Unset | float = UNSET + price_display_format: Unset | NumericDisplayFormat = UNSET + qty_display_factor: Unset | float = UNSET + qty_display_format: Unset | NumericDisplayFormat = UNSET + security_category: Unset | SecurityCategory = UNSET + + def to_dict(self) -> dict[str, Any]: + expiration_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.expiration_dt, Unset): + expiration_dt = self.expiration_dt.to_dict() + + expiration_style: Unset | str = UNSET + if not isinstance(self.expiration_style, Unset): + expiration_style = self.expiration_style.value + + root_symbol = self.root_symbol + + series_type: Unset | str = UNSET + if not isinstance(self.series_type, Unset): + series_type = self.series_type.value + + settlement_type: Unset | str = UNSET + if not isinstance(self.settlement_type, Unset): + settlement_type = self.settlement_type.value + + option_symbols: Unset | list[str] = UNSET + if not isinstance(self.option_symbols, Unset): + option_symbols = self.option_symbols + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + multiplier = self.multiplier + + price_base_factor = self.price_base_factor + + price_display_factor = self.price_display_factor + + price_display_format: Unset | str = UNSET + if not isinstance(self.price_display_format, Unset): + price_display_format = self.price_display_format.value + + qty_display_factor = self.qty_display_factor + + qty_display_format: Unset | str = UNSET + if not isinstance(self.qty_display_format, Unset): + qty_display_format = self.qty_display_format.value + + security_category: Unset | str = UNSET + if not isinstance(self.security_category, Unset): + security_category = self.security_category.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if expiration_dt is not UNSET: + field_dict["expirationDt"] = expiration_dt + if expiration_style is not UNSET: + field_dict["expirationStyle"] = expiration_style + if root_symbol is not UNSET: + field_dict["rootSymbol"] = root_symbol + if series_type is not UNSET: + field_dict["seriesType"] = series_type + if settlement_type is not UNSET: + field_dict["settlementType"] = settlement_type + if option_symbols is not UNSET: + field_dict["optionSymbols"] = option_symbols + if currency is not UNSET: + field_dict["currency"] = currency + if multiplier is not UNSET: + field_dict["multiplier"] = multiplier + if price_base_factor is not UNSET: + field_dict["priceBaseFactor"] = price_base_factor + if price_display_factor is not UNSET: + field_dict["priceDisplayFactor"] = price_display_factor + if price_display_format is not UNSET: + field_dict["priceDisplayFormat"] = price_display_format + if qty_display_factor is not UNSET: + field_dict["qtyDisplayFactor"] = qty_display_factor + if qty_display_format is not UNSET: + field_dict["qtyDisplayFormat"] = qty_display_format + if security_category is not UNSET: + field_dict["securityCategory"] = security_category + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.date import Date + + d = dict(src_dict) + _expiration_dt = d.pop("expirationDt", UNSET) + expiration_dt: Unset | Date + if isinstance(_expiration_dt, Unset): + expiration_dt = UNSET + else: + expiration_dt = Date.from_dict(_expiration_dt) + + _expiration_style = d.pop("expirationStyle", UNSET) + expiration_style: Unset | OptionExpirationStyle + if isinstance(_expiration_style, Unset): + expiration_style = UNSET + else: + expiration_style = OptionExpirationStyle(_expiration_style) + + root_symbol = d.pop("rootSymbol", UNSET) + + _series_type = d.pop("seriesType", UNSET) + series_type: Unset | OptionSeriesType + if isinstance(_series_type, Unset): + series_type = UNSET + else: + series_type = OptionSeriesType(_series_type) + + _settlement_type = d.pop("settlementType", UNSET) + settlement_type: Unset | OptionSettlementType + if isinstance(_settlement_type, Unset): + settlement_type = UNSET + else: + settlement_type = OptionSettlementType(_settlement_type) + + option_symbols = cast(list[str], d.pop("optionSymbols", UNSET)) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + multiplier = d.pop("multiplier", UNSET) + + price_base_factor = d.pop("priceBaseFactor", UNSET) + + price_display_factor = d.pop("priceDisplayFactor", UNSET) + + _price_display_format = d.pop("priceDisplayFormat", UNSET) + price_display_format: Unset | NumericDisplayFormat + if isinstance(_price_display_format, Unset): + price_display_format = UNSET + else: + price_display_format = NumericDisplayFormat(_price_display_format) + + qty_display_factor = d.pop("qtyDisplayFactor", UNSET) + + _qty_display_format = d.pop("qtyDisplayFormat", UNSET) + qty_display_format: Unset | NumericDisplayFormat + if isinstance(_qty_display_format, Unset): + qty_display_format = UNSET + else: + qty_display_format = NumericDisplayFormat(_qty_display_format) + + _security_category = d.pop("securityCategory", UNSET) + security_category: Unset | SecurityCategory + if isinstance(_security_category, Unset): + security_category = UNSET + else: + security_category = SecurityCategory(_security_category) + + option_series = cls( + expiration_dt=expiration_dt, + expiration_style=expiration_style, + root_symbol=root_symbol, + series_type=series_type, + settlement_type=settlement_type, + option_symbols=option_symbols, + currency=currency, + multiplier=multiplier, + price_base_factor=price_base_factor, + price_display_factor=price_display_factor, + price_display_format=price_display_format, + qty_display_factor=qty_display_factor, + qty_display_format=qty_display_format, + security_category=security_category, + ) + + return option_series diff --git a/openapi/openapi_project/openapi_package/models/option_series_product_type.py b/openapi/openapi_project/openapi_package/models/option_series_product_type.py new file mode 100644 index 000000000..5fed3ad30 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/option_series_product_type.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class OptionSeriesProductType(str, Enum): + OPTION_SERIES_PRODUCT_TYPE_MICRO = "OPTION_SERIES_PRODUCT_TYPE_MICRO" + OPTION_SERIES_PRODUCT_TYPE_STANDARD = "OPTION_SERIES_PRODUCT_TYPE_STANDARD" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/option_series_type.py b/openapi/openapi_project/openapi_package/models/option_series_type.py new file mode 100644 index 000000000..44b47e8ea --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/option_series_type.py @@ -0,0 +1,13 @@ +from enum import Enum + + +class OptionSeriesType(str, Enum): + OPTION_SERIES_TYPE_BINARY = "OPTION_SERIES_TYPE_BINARY" + OPTION_SERIES_TYPE_FLEX = "OPTION_SERIES_TYPE_FLEX" + OPTION_SERIES_TYPE_LEAP = "OPTION_SERIES_TYPE_LEAP" + OPTION_SERIES_TYPE_RANGE = "OPTION_SERIES_TYPE_RANGE" + OPTION_SERIES_TYPE_STANDARD = "OPTION_SERIES_TYPE_STANDARD" + OPTION_SERIES_TYPE_UNKNOWN = "OPTION_SERIES_TYPE_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/option_settlement_type.py b/openapi/openapi_project/openapi_package/models/option_settlement_type.py new file mode 100644 index 000000000..8ff8df614 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/option_settlement_type.py @@ -0,0 +1,12 @@ +from enum import Enum + + +class OptionSettlementType(str, Enum): + OPTION_SETTLEMENT_TYPE_AM = "OPTION_SETTLEMENT_TYPE_AM" + OPTION_SETTLEMENT_TYPE_ASIAN = "OPTION_SETTLEMENT_TYPE_ASIAN" + OPTION_SETTLEMENT_TYPE_CLIQUET = "OPTION_SETTLEMENT_TYPE_CLIQUET" + OPTION_SETTLEMENT_TYPE_PM = "OPTION_SETTLEMENT_TYPE_PM" + OPTION_SETTLEMENT_TYPE_UNDEFINED = "OPTION_SETTLEMENT_TYPE_UNDEFINED" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/ord_status.py b/openapi/openapi_project/openapi_package/models/ord_status.py new file mode 100644 index 000000000..920d81f37 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/ord_status.py @@ -0,0 +1,30 @@ +from enum import Enum + + +class OrdStatus(str, Enum): + ORD_STATUS_ACCEPTED = "ORD_STATUS_ACCEPTED" + ORD_STATUS_ACCEPTED_FOR_BIDDING = "ORD_STATUS_ACCEPTED_FOR_BIDDING" + ORD_STATUS_CANCELED = "ORD_STATUS_CANCELED" + ORD_STATUS_DECLINED = "ORD_STATUS_DECLINED" + ORD_STATUS_DONE_FOR_DAY = "ORD_STATUS_DONE_FOR_DAY" + ORD_STATUS_EXPIRED = "ORD_STATUS_EXPIRED" + ORD_STATUS_FILLED = "ORD_STATUS_FILLED" + ORD_STATUS_NEW = "ORD_STATUS_NEW" + ORD_STATUS_PARTIALLY_FILLED = "ORD_STATUS_PARTIALLY_FILLED" + ORD_STATUS_PENDING_CANCEL = "ORD_STATUS_PENDING_CANCEL" + ORD_STATUS_PENDING_NEW = "ORD_STATUS_PENDING_NEW" + ORD_STATUS_PENDING_REPLACE = "ORD_STATUS_PENDING_REPLACE" + ORD_STATUS_PUSHED = "ORD_STATUS_PUSHED" + ORD_STATUS_QUEUED = "ORD_STATUS_QUEUED" + ORD_STATUS_REJECTED = "ORD_STATUS_REJECTED" + ORD_STATUS_REPLACED = "ORD_STATUS_REPLACED" + ORD_STATUS_REPRESENTED = "ORD_STATUS_REPRESENTED" + ORD_STATUS_STAGED = "ORD_STATUS_STAGED" + ORD_STATUS_STOPPED = "ORD_STATUS_STOPPED" + ORD_STATUS_SUSPENDED = "ORD_STATUS_SUSPENDED" + ORD_STATUS_TIMED_OUT = "ORD_STATUS_TIMED_OUT" + ORD_STATUS_UNKNOWN = "ORD_STATUS_UNKNOWN" + ORD_STATUS_WORKING = "ORD_STATUS_WORKING" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/ord_type.py b/openapi/openapi_project/openapi_package/models/ord_type.py new file mode 100644 index 000000000..4ef641095 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/ord_type.py @@ -0,0 +1,14 @@ +from enum import Enum + + +class OrdType(str, Enum): + ORD_TYPE_LIMIT = "ORD_TYPE_LIMIT" + ORD_TYPE_MARKET = "ORD_TYPE_MARKET" + ORD_TYPE_MARKET_IF_TOUCHED = "ORD_TYPE_MARKET_IF_TOUCHED" + ORD_TYPE_PEGGED = "ORD_TYPE_PEGGED" + ORD_TYPE_STOP = "ORD_TYPE_STOP" + ORD_TYPE_STOP_LIMIT = "ORD_TYPE_STOP_LIMIT" + ORD_TYPE_UNKNOWN = "ORD_TYPE_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/order.py b/openapi/openapi_project/openapi_package/models/order.py new file mode 100644 index 000000000..5510d3917 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/order.py @@ -0,0 +1,583 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.ord_status import OrdStatus +from ..models.ord_type import OrdType +from ..models.origination_type import OriginationType +from ..models.position_effect import PositionEffect +from ..models.price_type import PriceType +from ..models.side import Side +from ..models.tif import Tif +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.clearing_info import ClearingInfo + from ..models.header import Header + from ..models.order_algo import OrderAlgo + from ..models.order_instruction import OrderInstruction + from ..models.order_market_condition import OrderMarketCondition + from ..models.order_optional_data import OrderOptionalData + from ..models.order_update_event import OrderUpdateEvent + from ..models.security import Security + + +T = TypeVar("T", bound="Order") + + +@_attrs_define +class Order: + """ + Attributes: + account_id (Union[Unset, int]): + algo (Union[Unset, OrderAlgo]): + aux_price (Union[Unset, float]): + clearing_info (Union[Unset, ClearingInfo]): + cur_ord_id (Union[Unset, str]): + header (Union[Unset, Header]): + id (Union[Unset, str]): + incoming_cl_ord_id (Union[Unset, str]): + incoming_ord_id (Union[Unset, str]): + instructions (Union[Unset, list['OrderInstruction']]): + market_condition (Union[Unset, OrderMarketCondition]): + optional_data (Union[Unset, OrderOptionalData]): + order_flags (Union[Unset, int]): + order_updates (Union[Unset, list['OrderUpdateEvent']]): + ord_type (Union[Unset, OrdType]): + origination_type (Union[Unset, OriginationType]): + parent_ord_id (Union[Unset, str]): + position_effect (Union[Unset, PositionEffect]): + price (Union[Unset, float]): + price_type (Union[Unset, PriceType]): + qty (Union[Unset, float]): + route (Union[Unset, str]): + security (Union[Unset, Security]): + side (Union[Unset, Side]): + source (Union[Unset, str]): + source_address (Union[Unset, str]): + submit_ts (Union[Unset, str]): + symbol (Union[Unset, str]): + tag (Union[Unset, str]): + text (Union[Unset, str]): + tif (Union[Unset, Tif]): + trader_id (Union[Unset, str]): + user_id (Union[Unset, int]): + ord_status (Union[Unset, OrdStatus]): + avg_price (Union[Unset, float]): + claimed_by (Union[Unset, str]): + last_price (Union[Unset, float]): + last_qty (Union[Unset, float]): + last_market (Union[Unset, str]): + leaves_qty (Union[Unset, float]): + cum_qty (Union[Unset, float]): + transact_ts (Union[Unset, str]): + working_qty (Union[Unset, float]): + has_busts (Union[Unset, bool]): + has_corrects (Union[Unset, bool]): + has_notes (Union[Unset, bool]): + """ + + account_id: Unset | int = UNSET + algo: Union[Unset, "OrderAlgo"] = UNSET + aux_price: Unset | float = UNSET + clearing_info: Union[Unset, "ClearingInfo"] = UNSET + cur_ord_id: Unset | str = UNSET + header: Union[Unset, "Header"] = UNSET + id: Unset | str = UNSET + incoming_cl_ord_id: Unset | str = UNSET + incoming_ord_id: Unset | str = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + market_condition: Union[Unset, "OrderMarketCondition"] = UNSET + optional_data: Union[Unset, "OrderOptionalData"] = UNSET + order_flags: Unset | int = UNSET + order_updates: Unset | list["OrderUpdateEvent"] = UNSET + ord_type: Unset | OrdType = UNSET + origination_type: Unset | OriginationType = UNSET + parent_ord_id: Unset | str = UNSET + position_effect: Unset | PositionEffect = UNSET + price: Unset | float = UNSET + price_type: Unset | PriceType = UNSET + qty: Unset | float = UNSET + route: Unset | str = UNSET + security: Union[Unset, "Security"] = UNSET + side: Unset | Side = UNSET + source: Unset | str = UNSET + source_address: Unset | str = UNSET + submit_ts: Unset | str = UNSET + symbol: Unset | str = UNSET + tag: Unset | str = UNSET + text: Unset | str = UNSET + tif: Unset | Tif = UNSET + trader_id: Unset | str = UNSET + user_id: Unset | int = UNSET + ord_status: Unset | OrdStatus = UNSET + avg_price: Unset | float = UNSET + claimed_by: Unset | str = UNSET + last_price: Unset | float = UNSET + last_qty: Unset | float = UNSET + last_market: Unset | str = UNSET + leaves_qty: Unset | float = UNSET + cum_qty: Unset | float = UNSET + transact_ts: Unset | str = UNSET + working_qty: Unset | float = UNSET + has_busts: Unset | bool = UNSET + has_corrects: Unset | bool = UNSET + has_notes: Unset | bool = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + algo: Unset | dict[str, Any] = UNSET + if not isinstance(self.algo, Unset): + algo = self.algo.to_dict() + + aux_price = self.aux_price + + clearing_info: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_info, Unset): + clearing_info = self.clearing_info.to_dict() + + cur_ord_id = self.cur_ord_id + + header: Unset | dict[str, Any] = UNSET + if not isinstance(self.header, Unset): + header = self.header.to_dict() + + id = self.id + + incoming_cl_ord_id = self.incoming_cl_ord_id + + incoming_ord_id = self.incoming_ord_id + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + market_condition: Unset | dict[str, Any] = UNSET + if not isinstance(self.market_condition, Unset): + market_condition = self.market_condition.to_dict() + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + order_flags = self.order_flags + + order_updates: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.order_updates, Unset): + order_updates = [] + for order_updates_item_data in self.order_updates: + order_updates_item = order_updates_item_data.to_dict() + order_updates.append(order_updates_item) + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + origination_type: Unset | str = UNSET + if not isinstance(self.origination_type, Unset): + origination_type = self.origination_type.value + + parent_ord_id = self.parent_ord_id + + position_effect: Unset | str = UNSET + if not isinstance(self.position_effect, Unset): + position_effect = self.position_effect.value + + price = self.price + + price_type: Unset | str = UNSET + if not isinstance(self.price_type, Unset): + price_type = self.price_type.value + + qty = self.qty + + route = self.route + + security: Unset | dict[str, Any] = UNSET + if not isinstance(self.security, Unset): + security = self.security.to_dict() + + side: Unset | str = UNSET + if not isinstance(self.side, Unset): + side = self.side.value + + source = self.source + + source_address = self.source_address + + submit_ts = self.submit_ts + + symbol = self.symbol + + tag = self.tag + + text = self.text + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + trader_id = self.trader_id + + user_id = self.user_id + + ord_status: Unset | str = UNSET + if not isinstance(self.ord_status, Unset): + ord_status = self.ord_status.value + + avg_price = self.avg_price + + claimed_by = self.claimed_by + + last_price = self.last_price + + last_qty = self.last_qty + + last_market = self.last_market + + leaves_qty = self.leaves_qty + + cum_qty = self.cum_qty + + transact_ts = self.transact_ts + + working_qty = self.working_qty + + has_busts = self.has_busts + + has_corrects = self.has_corrects + + has_notes = self.has_notes + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if algo is not UNSET: + field_dict["algo"] = algo + if aux_price is not UNSET: + field_dict["auxPrice"] = aux_price + if clearing_info is not UNSET: + field_dict["clearingInfo"] = clearing_info + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if header is not UNSET: + field_dict["header"] = header + if id is not UNSET: + field_dict["id"] = id + if incoming_cl_ord_id is not UNSET: + field_dict["incomingClOrdId"] = incoming_cl_ord_id + if incoming_ord_id is not UNSET: + field_dict["incomingOrdId"] = incoming_ord_id + if instructions is not UNSET: + field_dict["instructions"] = instructions + if market_condition is not UNSET: + field_dict["marketCondition"] = market_condition + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if order_flags is not UNSET: + field_dict["orderFlags"] = order_flags + if order_updates is not UNSET: + field_dict["orderUpdates"] = order_updates + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if origination_type is not UNSET: + field_dict["originationType"] = origination_type + if parent_ord_id is not UNSET: + field_dict["parentOrdId"] = parent_ord_id + if position_effect is not UNSET: + field_dict["positionEffect"] = position_effect + if price is not UNSET: + field_dict["price"] = price + if price_type is not UNSET: + field_dict["priceType"] = price_type + if qty is not UNSET: + field_dict["qty"] = qty + if route is not UNSET: + field_dict["route"] = route + if security is not UNSET: + field_dict["security"] = security + if side is not UNSET: + field_dict["side"] = side + if source is not UNSET: + field_dict["source"] = source + if source_address is not UNSET: + field_dict["sourceAddress"] = source_address + if submit_ts is not UNSET: + field_dict["submitTs"] = submit_ts + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tag is not UNSET: + field_dict["tag"] = tag + if text is not UNSET: + field_dict["text"] = text + if tif is not UNSET: + field_dict["tif"] = tif + if trader_id is not UNSET: + field_dict["traderId"] = trader_id + if user_id is not UNSET: + field_dict["userId"] = user_id + if ord_status is not UNSET: + field_dict["ordStatus"] = ord_status + if avg_price is not UNSET: + field_dict["avgPrice"] = avg_price + if claimed_by is not UNSET: + field_dict["claimedBy"] = claimed_by + if last_price is not UNSET: + field_dict["lastPrice"] = last_price + if last_qty is not UNSET: + field_dict["lastQty"] = last_qty + if last_market is not UNSET: + field_dict["lastMarket"] = last_market + if leaves_qty is not UNSET: + field_dict["leavesQty"] = leaves_qty + if cum_qty is not UNSET: + field_dict["cumQty"] = cum_qty + if transact_ts is not UNSET: + field_dict["transactTs"] = transact_ts + if working_qty is not UNSET: + field_dict["workingQty"] = working_qty + if has_busts is not UNSET: + field_dict["hasBusts"] = has_busts + if has_corrects is not UNSET: + field_dict["hasCorrects"] = has_corrects + if has_notes is not UNSET: + field_dict["hasNotes"] = has_notes + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.clearing_info import ClearingInfo + from ..models.header import Header + from ..models.order_algo import OrderAlgo + from ..models.order_instruction import OrderInstruction + from ..models.order_market_condition import OrderMarketCondition + from ..models.order_optional_data import OrderOptionalData + from ..models.order_update_event import OrderUpdateEvent + from ..models.security import Security + + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + _algo = d.pop("algo", UNSET) + algo: Unset | OrderAlgo + if isinstance(_algo, Unset): + algo = UNSET + else: + algo = OrderAlgo.from_dict(_algo) + + aux_price = d.pop("auxPrice", UNSET) + + _clearing_info = d.pop("clearingInfo", UNSET) + clearing_info: Unset | ClearingInfo + if isinstance(_clearing_info, Unset): + clearing_info = UNSET + else: + clearing_info = ClearingInfo.from_dict(_clearing_info) + + cur_ord_id = d.pop("curOrdId", UNSET) + + _header = d.pop("header", UNSET) + header: Unset | Header + if isinstance(_header, Unset): + header = UNSET + else: + header = Header.from_dict(_header) + + id = d.pop("id", UNSET) + + incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) + + incoming_ord_id = d.pop("incomingOrdId", UNSET) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + _market_condition = d.pop("marketCondition", UNSET) + market_condition: Unset | OrderMarketCondition + if isinstance(_market_condition, Unset): + market_condition = UNSET + else: + market_condition = OrderMarketCondition.from_dict(_market_condition) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | OrderOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = OrderOptionalData.from_dict(_optional_data) + + order_flags = d.pop("orderFlags", UNSET) + + order_updates = [] + _order_updates = d.pop("orderUpdates", UNSET) + for order_updates_item_data in _order_updates or []: + order_updates_item = OrderUpdateEvent.from_dict(order_updates_item_data) + + order_updates.append(order_updates_item) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + _origination_type = d.pop("originationType", UNSET) + origination_type: Unset | OriginationType + if isinstance(_origination_type, Unset): + origination_type = UNSET + else: + origination_type = OriginationType(_origination_type) + + parent_ord_id = d.pop("parentOrdId", UNSET) + + _position_effect = d.pop("positionEffect", UNSET) + position_effect: Unset | PositionEffect + if isinstance(_position_effect, Unset): + position_effect = UNSET + else: + position_effect = PositionEffect(_position_effect) + + price = d.pop("price", UNSET) + + _price_type = d.pop("priceType", UNSET) + price_type: Unset | PriceType + if isinstance(_price_type, Unset): + price_type = UNSET + else: + price_type = PriceType(_price_type) + + qty = d.pop("qty", UNSET) + + route = d.pop("route", UNSET) + + _security = d.pop("security", UNSET) + security: Unset | Security + if isinstance(_security, Unset): + security = UNSET + else: + security = Security.from_dict(_security) + + _side = d.pop("side", UNSET) + side: Unset | Side + if isinstance(_side, Unset): + side = UNSET + else: + side = Side(_side) + + source = d.pop("source", UNSET) + + source_address = d.pop("sourceAddress", UNSET) + + submit_ts = d.pop("submitTs", UNSET) + + symbol = d.pop("symbol", UNSET) + + tag = d.pop("tag", UNSET) + + text = d.pop("text", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + trader_id = d.pop("traderId", UNSET) + + user_id = d.pop("userId", UNSET) + + _ord_status = d.pop("ordStatus", UNSET) + ord_status: Unset | OrdStatus + if isinstance(_ord_status, Unset): + ord_status = UNSET + else: + ord_status = OrdStatus(_ord_status) + + avg_price = d.pop("avgPrice", UNSET) + + claimed_by = d.pop("claimedBy", UNSET) + + last_price = d.pop("lastPrice", UNSET) + + last_qty = d.pop("lastQty", UNSET) + + last_market = d.pop("lastMarket", UNSET) + + leaves_qty = d.pop("leavesQty", UNSET) + + cum_qty = d.pop("cumQty", UNSET) + + transact_ts = d.pop("transactTs", UNSET) + + working_qty = d.pop("workingQty", UNSET) + + has_busts = d.pop("hasBusts", UNSET) + + has_corrects = d.pop("hasCorrects", UNSET) + + has_notes = d.pop("hasNotes", UNSET) + + order = cls( + account_id=account_id, + algo=algo, + aux_price=aux_price, + clearing_info=clearing_info, + cur_ord_id=cur_ord_id, + header=header, + id=id, + incoming_cl_ord_id=incoming_cl_ord_id, + incoming_ord_id=incoming_ord_id, + instructions=instructions, + market_condition=market_condition, + optional_data=optional_data, + order_flags=order_flags, + order_updates=order_updates, + ord_type=ord_type, + origination_type=origination_type, + parent_ord_id=parent_ord_id, + position_effect=position_effect, + price=price, + price_type=price_type, + qty=qty, + route=route, + security=security, + side=side, + source=source, + source_address=source_address, + submit_ts=submit_ts, + symbol=symbol, + tag=tag, + text=text, + tif=tif, + trader_id=trader_id, + user_id=user_id, + ord_status=ord_status, + avg_price=avg_price, + claimed_by=claimed_by, + last_price=last_price, + last_qty=last_qty, + last_market=last_market, + leaves_qty=leaves_qty, + cum_qty=cum_qty, + transact_ts=transact_ts, + working_qty=working_qty, + has_busts=has_busts, + has_corrects=has_corrects, + has_notes=has_notes, + ) + + return order diff --git a/openapi/openapi_project/openapi_package/models/order_algo.py b/openapi/openapi_project/openapi_package/models/order_algo.py new file mode 100644 index 000000000..8ac958125 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/order_algo.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="OrderAlgo") + + +@_attrs_define +class OrderAlgo: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_algo = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_algo.additional_properties = additional_properties + return order_algo + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/order_cancel_reject.py b/openapi/openapi_project/openapi_package/models/order_cancel_reject.py new file mode 100644 index 000000000..e188474f0 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/order_cancel_reject.py @@ -0,0 +1,187 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.cxl_rej_response_to import CxlRejResponseTo +from ..models.ord_status import OrdStatus +from ..models.origination_type import OriginationType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.order_cancel_reject_optional_data import OrderCancelRejectOptionalData + + +T = TypeVar("T", bound="OrderCancelReject") + + +@_attrs_define +class OrderCancelReject: + """ + Attributes: + cur_ord_id (Union[Unset, str]): + incoming_cl_ord_id (Union[Unset, str]): + incoming_orig_cl_ord_id (Union[Unset, str]): + ord_status (Union[Unset, OrdStatus]): + optional_data (Union[Unset, OrderCancelRejectOptionalData]): + origination_type (Union[Unset, OriginationType]): + perm_ord_id (Union[Unset, str]): + req_ord_id (Union[Unset, str]): + source (Union[Unset, str]): + text (Union[Unset, str]): + trader_id (Union[Unset, str]): + transact_ts (Union[Unset, str]): + cxl_rej_response_to (Union[Unset, CxlRejResponseTo]): + """ + + cur_ord_id: Unset | str = UNSET + incoming_cl_ord_id: Unset | str = UNSET + incoming_orig_cl_ord_id: Unset | str = UNSET + ord_status: Unset | OrdStatus = UNSET + optional_data: Union[Unset, "OrderCancelRejectOptionalData"] = UNSET + origination_type: Unset | OriginationType = UNSET + perm_ord_id: Unset | str = UNSET + req_ord_id: Unset | str = UNSET + source: Unset | str = UNSET + text: Unset | str = UNSET + trader_id: Unset | str = UNSET + transact_ts: Unset | str = UNSET + cxl_rej_response_to: Unset | CxlRejResponseTo = UNSET + + def to_dict(self) -> dict[str, Any]: + cur_ord_id = self.cur_ord_id + + incoming_cl_ord_id = self.incoming_cl_ord_id + + incoming_orig_cl_ord_id = self.incoming_orig_cl_ord_id + + ord_status: Unset | str = UNSET + if not isinstance(self.ord_status, Unset): + ord_status = self.ord_status.value + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + origination_type: Unset | str = UNSET + if not isinstance(self.origination_type, Unset): + origination_type = self.origination_type.value + + perm_ord_id = self.perm_ord_id + + req_ord_id = self.req_ord_id + + source = self.source + + text = self.text + + trader_id = self.trader_id + + transact_ts = self.transact_ts + + cxl_rej_response_to: Unset | str = UNSET + if not isinstance(self.cxl_rej_response_to, Unset): + cxl_rej_response_to = self.cxl_rej_response_to.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if incoming_cl_ord_id is not UNSET: + field_dict["incomingClOrdId"] = incoming_cl_ord_id + if incoming_orig_cl_ord_id is not UNSET: + field_dict["incomingOrigClOrdId"] = incoming_orig_cl_ord_id + if ord_status is not UNSET: + field_dict["ordStatus"] = ord_status + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if origination_type is not UNSET: + field_dict["originationType"] = origination_type + if perm_ord_id is not UNSET: + field_dict["permOrdId"] = perm_ord_id + if req_ord_id is not UNSET: + field_dict["reqOrdId"] = req_ord_id + if source is not UNSET: + field_dict["source"] = source + if text is not UNSET: + field_dict["text"] = text + if trader_id is not UNSET: + field_dict["traderId"] = trader_id + if transact_ts is not UNSET: + field_dict["transactTs"] = transact_ts + if cxl_rej_response_to is not UNSET: + field_dict["cxlRejResponseTo"] = cxl_rej_response_to + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.order_cancel_reject_optional_data import ( + OrderCancelRejectOptionalData, + ) + + d = dict(src_dict) + cur_ord_id = d.pop("curOrdId", UNSET) + + incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) + + incoming_orig_cl_ord_id = d.pop("incomingOrigClOrdId", UNSET) + + _ord_status = d.pop("ordStatus", UNSET) + ord_status: Unset | OrdStatus + if isinstance(_ord_status, Unset): + ord_status = UNSET + else: + ord_status = OrdStatus(_ord_status) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | OrderCancelRejectOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = OrderCancelRejectOptionalData.from_dict(_optional_data) + + _origination_type = d.pop("originationType", UNSET) + origination_type: Unset | OriginationType + if isinstance(_origination_type, Unset): + origination_type = UNSET + else: + origination_type = OriginationType(_origination_type) + + perm_ord_id = d.pop("permOrdId", UNSET) + + req_ord_id = d.pop("reqOrdId", UNSET) + + source = d.pop("source", UNSET) + + text = d.pop("text", UNSET) + + trader_id = d.pop("traderId", UNSET) + + transact_ts = d.pop("transactTs", UNSET) + + _cxl_rej_response_to = d.pop("cxlRejResponseTo", UNSET) + cxl_rej_response_to: Unset | CxlRejResponseTo + if isinstance(_cxl_rej_response_to, Unset): + cxl_rej_response_to = UNSET + else: + cxl_rej_response_to = CxlRejResponseTo(_cxl_rej_response_to) + + order_cancel_reject = cls( + cur_ord_id=cur_ord_id, + incoming_cl_ord_id=incoming_cl_ord_id, + incoming_orig_cl_ord_id=incoming_orig_cl_ord_id, + ord_status=ord_status, + optional_data=optional_data, + origination_type=origination_type, + perm_ord_id=perm_ord_id, + req_ord_id=req_ord_id, + source=source, + text=text, + trader_id=trader_id, + transact_ts=transact_ts, + cxl_rej_response_to=cxl_rej_response_to, + ) + + return order_cancel_reject diff --git a/openapi/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py b/openapi/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py new file mode 100644 index 000000000..5f78e4407 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="OrderCancelRejectOptionalData") + + +@_attrs_define +class OrderCancelRejectOptionalData: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_cancel_reject_optional_data = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_cancel_reject_optional_data.additional_properties = additional_properties + return order_cancel_reject_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/order_cancel_replace_request.py b/openapi/openapi_project/openapi_package/models/order_cancel_replace_request.py new file mode 100644 index 000000000..82046e0ff --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/order_cancel_replace_request.py @@ -0,0 +1,353 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.ord_type import OrdType +from ..models.origination_type import OriginationType +from ..models.price_type import PriceType +from ..models.side import Side +from ..models.tif import Tif +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.clearing_info import ClearingInfo + from ..models.header import Header + from ..models.order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo + from ..models.order_cancel_replace_request_market_condition import ( + OrderCancelReplaceRequestMarketCondition, + ) + from ..models.order_cancel_replace_request_optional_data import ( + OrderCancelReplaceRequestOptionalData, + ) + from ..models.order_instruction import OrderInstruction + + +T = TypeVar("T", bound="OrderCancelReplaceRequest") + + +@_attrs_define +class OrderCancelReplaceRequest: + """ + Attributes: + algo (Union[Unset, OrderCancelReplaceRequestAlgo]): + aux_price (Union[Unset, float]): + clearing_info (Union[Unset, ClearingInfo]): + cur_ord_id (Union[Unset, str]): + header (Union[Unset, Header]): + incoming_cl_ord_id (Union[Unset, str]): + incoming_orig_cl_ord_id (Union[Unset, str]): + instructions (Union[Unset, list['OrderInstruction']]): + optional_data (Union[Unset, OrderCancelReplaceRequestOptionalData]): + market_condition (Union[Unset, OrderCancelReplaceRequestMarketCondition]): + ord_type (Union[Unset, OrdType]): + origination_type (Union[Unset, OriginationType]): + perm_ord_id (Union[Unset, str]): + price (Union[Unset, float]): + price_type (Union[Unset, PriceType]): + qty (Union[Unset, float]): + req_ord_id (Union[Unset, str]): + side (Union[Unset, Side]): + source (Union[Unset, str]): + submit_ts (Union[Unset, str]): + tif (Union[Unset, Tif]): + trader_id (Union[Unset, str]): + user_id (Union[Unset, int]): + """ + + algo: Union[Unset, "OrderCancelReplaceRequestAlgo"] = UNSET + aux_price: Unset | float = UNSET + clearing_info: Union[Unset, "ClearingInfo"] = UNSET + cur_ord_id: Unset | str = UNSET + header: Union[Unset, "Header"] = UNSET + incoming_cl_ord_id: Unset | str = UNSET + incoming_orig_cl_ord_id: Unset | str = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + optional_data: Union[Unset, "OrderCancelReplaceRequestOptionalData"] = UNSET + market_condition: Union[Unset, "OrderCancelReplaceRequestMarketCondition"] = UNSET + ord_type: Unset | OrdType = UNSET + origination_type: Unset | OriginationType = UNSET + perm_ord_id: Unset | str = UNSET + price: Unset | float = UNSET + price_type: Unset | PriceType = UNSET + qty: Unset | float = UNSET + req_ord_id: Unset | str = UNSET + side: Unset | Side = UNSET + source: Unset | str = UNSET + submit_ts: Unset | str = UNSET + tif: Unset | Tif = UNSET + trader_id: Unset | str = UNSET + user_id: Unset | int = UNSET + + def to_dict(self) -> dict[str, Any]: + algo: Unset | dict[str, Any] = UNSET + if not isinstance(self.algo, Unset): + algo = self.algo.to_dict() + + aux_price = self.aux_price + + clearing_info: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_info, Unset): + clearing_info = self.clearing_info.to_dict() + + cur_ord_id = self.cur_ord_id + + header: Unset | dict[str, Any] = UNSET + if not isinstance(self.header, Unset): + header = self.header.to_dict() + + incoming_cl_ord_id = self.incoming_cl_ord_id + + incoming_orig_cl_ord_id = self.incoming_orig_cl_ord_id + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + market_condition: Unset | dict[str, Any] = UNSET + if not isinstance(self.market_condition, Unset): + market_condition = self.market_condition.to_dict() + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + origination_type: Unset | str = UNSET + if not isinstance(self.origination_type, Unset): + origination_type = self.origination_type.value + + perm_ord_id = self.perm_ord_id + + price = self.price + + price_type: Unset | str = UNSET + if not isinstance(self.price_type, Unset): + price_type = self.price_type.value + + qty = self.qty + + req_ord_id = self.req_ord_id + + side: Unset | str = UNSET + if not isinstance(self.side, Unset): + side = self.side.value + + source = self.source + + submit_ts = self.submit_ts + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + trader_id = self.trader_id + + user_id = self.user_id + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if algo is not UNSET: + field_dict["algo"] = algo + if aux_price is not UNSET: + field_dict["auxPrice"] = aux_price + if clearing_info is not UNSET: + field_dict["clearingInfo"] = clearing_info + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if header is not UNSET: + field_dict["header"] = header + if incoming_cl_ord_id is not UNSET: + field_dict["incomingClOrdId"] = incoming_cl_ord_id + if incoming_orig_cl_ord_id is not UNSET: + field_dict["incomingOrigClOrdId"] = incoming_orig_cl_ord_id + if instructions is not UNSET: + field_dict["instructions"] = instructions + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if market_condition is not UNSET: + field_dict["marketCondition"] = market_condition + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if origination_type is not UNSET: + field_dict["originationType"] = origination_type + if perm_ord_id is not UNSET: + field_dict["permOrdId"] = perm_ord_id + if price is not UNSET: + field_dict["price"] = price + if price_type is not UNSET: + field_dict["priceType"] = price_type + if qty is not UNSET: + field_dict["qty"] = qty + if req_ord_id is not UNSET: + field_dict["reqOrdId"] = req_ord_id + if side is not UNSET: + field_dict["side"] = side + if source is not UNSET: + field_dict["source"] = source + if submit_ts is not UNSET: + field_dict["submitTs"] = submit_ts + if tif is not UNSET: + field_dict["tif"] = tif + if trader_id is not UNSET: + field_dict["traderId"] = trader_id + if user_id is not UNSET: + field_dict["userId"] = user_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.clearing_info import ClearingInfo + from ..models.header import Header + from ..models.order_cancel_replace_request_algo import ( + OrderCancelReplaceRequestAlgo, + ) + from ..models.order_cancel_replace_request_market_condition import ( + OrderCancelReplaceRequestMarketCondition, + ) + from ..models.order_cancel_replace_request_optional_data import ( + OrderCancelReplaceRequestOptionalData, + ) + from ..models.order_instruction import OrderInstruction + + d = dict(src_dict) + _algo = d.pop("algo", UNSET) + algo: Unset | OrderCancelReplaceRequestAlgo + if isinstance(_algo, Unset): + algo = UNSET + else: + algo = OrderCancelReplaceRequestAlgo.from_dict(_algo) + + aux_price = d.pop("auxPrice", UNSET) + + _clearing_info = d.pop("clearingInfo", UNSET) + clearing_info: Unset | ClearingInfo + if isinstance(_clearing_info, Unset): + clearing_info = UNSET + else: + clearing_info = ClearingInfo.from_dict(_clearing_info) + + cur_ord_id = d.pop("curOrdId", UNSET) + + _header = d.pop("header", UNSET) + header: Unset | Header + if isinstance(_header, Unset): + header = UNSET + else: + header = Header.from_dict(_header) + + incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) + + incoming_orig_cl_ord_id = d.pop("incomingOrigClOrdId", UNSET) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | OrderCancelReplaceRequestOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = OrderCancelReplaceRequestOptionalData.from_dict( + _optional_data + ) + + _market_condition = d.pop("marketCondition", UNSET) + market_condition: Unset | OrderCancelReplaceRequestMarketCondition + if isinstance(_market_condition, Unset): + market_condition = UNSET + else: + market_condition = OrderCancelReplaceRequestMarketCondition.from_dict( + _market_condition + ) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + _origination_type = d.pop("originationType", UNSET) + origination_type: Unset | OriginationType + if isinstance(_origination_type, Unset): + origination_type = UNSET + else: + origination_type = OriginationType(_origination_type) + + perm_ord_id = d.pop("permOrdId", UNSET) + + price = d.pop("price", UNSET) + + _price_type = d.pop("priceType", UNSET) + price_type: Unset | PriceType + if isinstance(_price_type, Unset): + price_type = UNSET + else: + price_type = PriceType(_price_type) + + qty = d.pop("qty", UNSET) + + req_ord_id = d.pop("reqOrdId", UNSET) + + _side = d.pop("side", UNSET) + side: Unset | Side + if isinstance(_side, Unset): + side = UNSET + else: + side = Side(_side) + + source = d.pop("source", UNSET) + + submit_ts = d.pop("submitTs", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + trader_id = d.pop("traderId", UNSET) + + user_id = d.pop("userId", UNSET) + + order_cancel_replace_request = cls( + algo=algo, + aux_price=aux_price, + clearing_info=clearing_info, + cur_ord_id=cur_ord_id, + header=header, + incoming_cl_ord_id=incoming_cl_ord_id, + incoming_orig_cl_ord_id=incoming_orig_cl_ord_id, + instructions=instructions, + optional_data=optional_data, + market_condition=market_condition, + ord_type=ord_type, + origination_type=origination_type, + perm_ord_id=perm_ord_id, + price=price, + price_type=price_type, + qty=qty, + req_ord_id=req_ord_id, + side=side, + source=source, + submit_ts=submit_ts, + tif=tif, + trader_id=trader_id, + user_id=user_id, + ) + + return order_cancel_replace_request diff --git a/openapi/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py b/openapi/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py new file mode 100644 index 000000000..329b25687 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="OrderCancelReplaceRequestAlgo") + + +@_attrs_define +class OrderCancelReplaceRequestAlgo: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_cancel_replace_request_algo = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_cancel_replace_request_algo.additional_properties = additional_properties + return order_cancel_replace_request_algo + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py b/openapi/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py new file mode 100644 index 000000000..cb67173fb --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="OrderCancelReplaceRequestMarketCondition") + + +@_attrs_define +class OrderCancelReplaceRequestMarketCondition: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_cancel_replace_request_market_condition = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_cancel_replace_request_market_condition.additional_properties = ( + additional_properties + ) + return order_cancel_replace_request_market_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py b/openapi/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py new file mode 100644 index 000000000..4de205dad --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="OrderCancelReplaceRequestOptionalData") + + +@_attrs_define +class OrderCancelReplaceRequestOptionalData: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_cancel_replace_request_optional_data = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_cancel_replace_request_optional_data.additional_properties = ( + additional_properties + ) + return order_cancel_replace_request_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/order_cancel_request.py b/openapi/openapi_project/openapi_package/models/order_cancel_request.py new file mode 100644 index 000000000..0b51c72c0 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/order_cancel_request.py @@ -0,0 +1,176 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.origination_type import OriginationType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.order_cancel_request_optional_data import ( + OrderCancelRequestOptionalData, + ) + from ..models.order_instruction import OrderInstruction + + +T = TypeVar("T", bound="OrderCancelRequest") + + +@_attrs_define +class OrderCancelRequest: + """ + Attributes: + cur_ord_id (Union[Unset, str]): + incoming_cl_ord_id (Union[Unset, str]): + incoming_orig_cl_ord_id (Union[Unset, str]): + instructions (Union[Unset, list['OrderInstruction']]): + optional_data (Union[Unset, OrderCancelRequestOptionalData]): + origination_type (Union[Unset, OriginationType]): + perm_ord_id (Union[Unset, str]): + req_ord_id (Union[Unset, str]): + source (Union[Unset, str]): + submit_ts (Union[Unset, str]): + trader_id (Union[Unset, str]): + user_id (Union[Unset, int]): + """ + + cur_ord_id: Unset | str = UNSET + incoming_cl_ord_id: Unset | str = UNSET + incoming_orig_cl_ord_id: Unset | str = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + optional_data: Union[Unset, "OrderCancelRequestOptionalData"] = UNSET + origination_type: Unset | OriginationType = UNSET + perm_ord_id: Unset | str = UNSET + req_ord_id: Unset | str = UNSET + source: Unset | str = UNSET + submit_ts: Unset | str = UNSET + trader_id: Unset | str = UNSET + user_id: Unset | int = UNSET + + def to_dict(self) -> dict[str, Any]: + cur_ord_id = self.cur_ord_id + + incoming_cl_ord_id = self.incoming_cl_ord_id + + incoming_orig_cl_ord_id = self.incoming_orig_cl_ord_id + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + origination_type: Unset | str = UNSET + if not isinstance(self.origination_type, Unset): + origination_type = self.origination_type.value + + perm_ord_id = self.perm_ord_id + + req_ord_id = self.req_ord_id + + source = self.source + + submit_ts = self.submit_ts + + trader_id = self.trader_id + + user_id = self.user_id + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if incoming_cl_ord_id is not UNSET: + field_dict["incomingClOrdId"] = incoming_cl_ord_id + if incoming_orig_cl_ord_id is not UNSET: + field_dict["incomingOrigClOrdId"] = incoming_orig_cl_ord_id + if instructions is not UNSET: + field_dict["instructions"] = instructions + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if origination_type is not UNSET: + field_dict["originationType"] = origination_type + if perm_ord_id is not UNSET: + field_dict["permOrdId"] = perm_ord_id + if req_ord_id is not UNSET: + field_dict["reqOrdId"] = req_ord_id + if source is not UNSET: + field_dict["source"] = source + if submit_ts is not UNSET: + field_dict["submitTs"] = submit_ts + if trader_id is not UNSET: + field_dict["traderId"] = trader_id + if user_id is not UNSET: + field_dict["userId"] = user_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.order_cancel_request_optional_data import ( + OrderCancelRequestOptionalData, + ) + from ..models.order_instruction import OrderInstruction + + d = dict(src_dict) + cur_ord_id = d.pop("curOrdId", UNSET) + + incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) + + incoming_orig_cl_ord_id = d.pop("incomingOrigClOrdId", UNSET) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | OrderCancelRequestOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = OrderCancelRequestOptionalData.from_dict(_optional_data) + + _origination_type = d.pop("originationType", UNSET) + origination_type: Unset | OriginationType + if isinstance(_origination_type, Unset): + origination_type = UNSET + else: + origination_type = OriginationType(_origination_type) + + perm_ord_id = d.pop("permOrdId", UNSET) + + req_ord_id = d.pop("reqOrdId", UNSET) + + source = d.pop("source", UNSET) + + submit_ts = d.pop("submitTs", UNSET) + + trader_id = d.pop("traderId", UNSET) + + user_id = d.pop("userId", UNSET) + + order_cancel_request = cls( + cur_ord_id=cur_ord_id, + incoming_cl_ord_id=incoming_cl_ord_id, + incoming_orig_cl_ord_id=incoming_orig_cl_ord_id, + instructions=instructions, + optional_data=optional_data, + origination_type=origination_type, + perm_ord_id=perm_ord_id, + req_ord_id=req_ord_id, + source=source, + submit_ts=submit_ts, + trader_id=trader_id, + user_id=user_id, + ) + + return order_cancel_request diff --git a/openapi/openapi_project/openapi_package/models/order_cancel_request_optional_data.py b/openapi/openapi_project/openapi_package/models/order_cancel_request_optional_data.py new file mode 100644 index 000000000..5e5f76c73 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/order_cancel_request_optional_data.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="OrderCancelRequestOptionalData") + + +@_attrs_define +class OrderCancelRequestOptionalData: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_cancel_request_optional_data = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_cancel_request_optional_data.additional_properties = additional_properties + return order_cancel_request_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/order_cross.py b/openapi/openapi_project/openapi_package/models/order_cross.py new file mode 100644 index 000000000..cc19c8ab3 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/order_cross.py @@ -0,0 +1,497 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.cross_type import CrossType +from ..models.ord_status import OrdStatus +from ..models.ord_type import OrdType +from ..models.origination_type import OriginationType +from ..models.price_type import PriceType +from ..models.tif import Tif +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.header import Header + from ..models.order_cross_algo import OrderCrossAlgo + from ..models.order_cross_allocation import OrderCrossAllocation + from ..models.order_cross_market_condition import OrderCrossMarketCondition + from ..models.order_cross_optional_data import OrderCrossOptionalData + from ..models.order_instruction import OrderInstruction + from ..models.order_update_event import OrderUpdateEvent + from ..models.security import Security + + +T = TypeVar("T", bound="OrderCross") + + +@_attrs_define +class OrderCross: + """ + Attributes: + account_id (Union[Unset, int]): + algo (Union[Unset, OrderCrossAlgo]): + allocations (Union[Unset, list['OrderCrossAllocation']]): + cross_type (Union[Unset, CrossType]): + cur_ord_id (Union[Unset, str]): + header (Union[Unset, Header]): + id (Union[Unset, str]): + incoming_cl_ord_id (Union[Unset, str]): + incoming_ord_id (Union[Unset, str]): + instructions (Union[Unset, list['OrderInstruction']]): + market_condition (Union[Unset, OrderCrossMarketCondition]): + optional_data (Union[Unset, OrderCrossOptionalData]): + order_flags (Union[Unset, int]): + order_updates (Union[Unset, list['OrderUpdateEvent']]): + ord_type (Union[Unset, OrdType]): + origination_type (Union[Unset, OriginationType]): + parent_ord_id (Union[Unset, str]): + price (Union[Unset, float]): + price_type (Union[Unset, PriceType]): + qty (Union[Unset, float]): + route (Union[Unset, str]): + security (Union[Unset, Security]): + source (Union[Unset, str]): + source_address (Union[Unset, str]): + submit_ts (Union[Unset, str]): + symbol (Union[Unset, str]): + tag (Union[Unset, str]): + text (Union[Unset, str]): + tif (Union[Unset, Tif]): + user_id (Union[Unset, int]): + trader_id (Union[Unset, str]): + ord_status (Union[Unset, OrdStatus]): + claimed_by (Union[Unset, str]): + transact_ts (Union[Unset, str]): + has_busts (Union[Unset, bool]): + has_corrects (Union[Unset, bool]): + has_notes (Union[Unset, bool]): + """ + + account_id: Unset | int = UNSET + algo: Union[Unset, "OrderCrossAlgo"] = UNSET + allocations: Unset | list["OrderCrossAllocation"] = UNSET + cross_type: Unset | CrossType = UNSET + cur_ord_id: Unset | str = UNSET + header: Union[Unset, "Header"] = UNSET + id: Unset | str = UNSET + incoming_cl_ord_id: Unset | str = UNSET + incoming_ord_id: Unset | str = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + market_condition: Union[Unset, "OrderCrossMarketCondition"] = UNSET + optional_data: Union[Unset, "OrderCrossOptionalData"] = UNSET + order_flags: Unset | int = UNSET + order_updates: Unset | list["OrderUpdateEvent"] = UNSET + ord_type: Unset | OrdType = UNSET + origination_type: Unset | OriginationType = UNSET + parent_ord_id: Unset | str = UNSET + price: Unset | float = UNSET + price_type: Unset | PriceType = UNSET + qty: Unset | float = UNSET + route: Unset | str = UNSET + security: Union[Unset, "Security"] = UNSET + source: Unset | str = UNSET + source_address: Unset | str = UNSET + submit_ts: Unset | str = UNSET + symbol: Unset | str = UNSET + tag: Unset | str = UNSET + text: Unset | str = UNSET + tif: Unset | Tif = UNSET + user_id: Unset | int = UNSET + trader_id: Unset | str = UNSET + ord_status: Unset | OrdStatus = UNSET + claimed_by: Unset | str = UNSET + transact_ts: Unset | str = UNSET + has_busts: Unset | bool = UNSET + has_corrects: Unset | bool = UNSET + has_notes: Unset | bool = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + algo: Unset | dict[str, Any] = UNSET + if not isinstance(self.algo, Unset): + algo = self.algo.to_dict() + + allocations: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.allocations, Unset): + allocations = [] + for allocations_item_data in self.allocations: + allocations_item = allocations_item_data.to_dict() + allocations.append(allocations_item) + + cross_type: Unset | str = UNSET + if not isinstance(self.cross_type, Unset): + cross_type = self.cross_type.value + + cur_ord_id = self.cur_ord_id + + header: Unset | dict[str, Any] = UNSET + if not isinstance(self.header, Unset): + header = self.header.to_dict() + + id = self.id + + incoming_cl_ord_id = self.incoming_cl_ord_id + + incoming_ord_id = self.incoming_ord_id + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + market_condition: Unset | dict[str, Any] = UNSET + if not isinstance(self.market_condition, Unset): + market_condition = self.market_condition.to_dict() + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + order_flags = self.order_flags + + order_updates: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.order_updates, Unset): + order_updates = [] + for order_updates_item_data in self.order_updates: + order_updates_item = order_updates_item_data.to_dict() + order_updates.append(order_updates_item) + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + origination_type: Unset | str = UNSET + if not isinstance(self.origination_type, Unset): + origination_type = self.origination_type.value + + parent_ord_id = self.parent_ord_id + + price = self.price + + price_type: Unset | str = UNSET + if not isinstance(self.price_type, Unset): + price_type = self.price_type.value + + qty = self.qty + + route = self.route + + security: Unset | dict[str, Any] = UNSET + if not isinstance(self.security, Unset): + security = self.security.to_dict() + + source = self.source + + source_address = self.source_address + + submit_ts = self.submit_ts + + symbol = self.symbol + + tag = self.tag + + text = self.text + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + user_id = self.user_id + + trader_id = self.trader_id + + ord_status: Unset | str = UNSET + if not isinstance(self.ord_status, Unset): + ord_status = self.ord_status.value + + claimed_by = self.claimed_by + + transact_ts = self.transact_ts + + has_busts = self.has_busts + + has_corrects = self.has_corrects + + has_notes = self.has_notes + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if algo is not UNSET: + field_dict["algo"] = algo + if allocations is not UNSET: + field_dict["allocations"] = allocations + if cross_type is not UNSET: + field_dict["crossType"] = cross_type + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if header is not UNSET: + field_dict["header"] = header + if id is not UNSET: + field_dict["id"] = id + if incoming_cl_ord_id is not UNSET: + field_dict["incomingClOrdId"] = incoming_cl_ord_id + if incoming_ord_id is not UNSET: + field_dict["incomingOrdId"] = incoming_ord_id + if instructions is not UNSET: + field_dict["instructions"] = instructions + if market_condition is not UNSET: + field_dict["marketCondition"] = market_condition + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if order_flags is not UNSET: + field_dict["orderFlags"] = order_flags + if order_updates is not UNSET: + field_dict["orderUpdates"] = order_updates + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if origination_type is not UNSET: + field_dict["originationType"] = origination_type + if parent_ord_id is not UNSET: + field_dict["parentOrdId"] = parent_ord_id + if price is not UNSET: + field_dict["price"] = price + if price_type is not UNSET: + field_dict["priceType"] = price_type + if qty is not UNSET: + field_dict["qty"] = qty + if route is not UNSET: + field_dict["route"] = route + if security is not UNSET: + field_dict["security"] = security + if source is not UNSET: + field_dict["source"] = source + if source_address is not UNSET: + field_dict["sourceAddress"] = source_address + if submit_ts is not UNSET: + field_dict["submitTs"] = submit_ts + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tag is not UNSET: + field_dict["tag"] = tag + if text is not UNSET: + field_dict["text"] = text + if tif is not UNSET: + field_dict["tif"] = tif + if user_id is not UNSET: + field_dict["userId"] = user_id + if trader_id is not UNSET: + field_dict["traderId"] = trader_id + if ord_status is not UNSET: + field_dict["ordStatus"] = ord_status + if claimed_by is not UNSET: + field_dict["claimedBy"] = claimed_by + if transact_ts is not UNSET: + field_dict["transactTs"] = transact_ts + if has_busts is not UNSET: + field_dict["hasBusts"] = has_busts + if has_corrects is not UNSET: + field_dict["hasCorrects"] = has_corrects + if has_notes is not UNSET: + field_dict["hasNotes"] = has_notes + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.header import Header + from ..models.order_cross_algo import OrderCrossAlgo + from ..models.order_cross_allocation import OrderCrossAllocation + from ..models.order_cross_market_condition import OrderCrossMarketCondition + from ..models.order_cross_optional_data import OrderCrossOptionalData + from ..models.order_instruction import OrderInstruction + from ..models.order_update_event import OrderUpdateEvent + from ..models.security import Security + + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + _algo = d.pop("algo", UNSET) + algo: Unset | OrderCrossAlgo + if isinstance(_algo, Unset): + algo = UNSET + else: + algo = OrderCrossAlgo.from_dict(_algo) + + allocations = [] + _allocations = d.pop("allocations", UNSET) + for allocations_item_data in _allocations or []: + allocations_item = OrderCrossAllocation.from_dict(allocations_item_data) + + allocations.append(allocations_item) + + _cross_type = d.pop("crossType", UNSET) + cross_type: Unset | CrossType + if isinstance(_cross_type, Unset): + cross_type = UNSET + else: + cross_type = CrossType(_cross_type) + + cur_ord_id = d.pop("curOrdId", UNSET) + + _header = d.pop("header", UNSET) + header: Unset | Header + if isinstance(_header, Unset): + header = UNSET + else: + header = Header.from_dict(_header) + + id = d.pop("id", UNSET) + + incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) + + incoming_ord_id = d.pop("incomingOrdId", UNSET) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + _market_condition = d.pop("marketCondition", UNSET) + market_condition: Unset | OrderCrossMarketCondition + if isinstance(_market_condition, Unset): + market_condition = UNSET + else: + market_condition = OrderCrossMarketCondition.from_dict(_market_condition) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | OrderCrossOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = OrderCrossOptionalData.from_dict(_optional_data) + + order_flags = d.pop("orderFlags", UNSET) + + order_updates = [] + _order_updates = d.pop("orderUpdates", UNSET) + for order_updates_item_data in _order_updates or []: + order_updates_item = OrderUpdateEvent.from_dict(order_updates_item_data) + + order_updates.append(order_updates_item) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + _origination_type = d.pop("originationType", UNSET) + origination_type: Unset | OriginationType + if isinstance(_origination_type, Unset): + origination_type = UNSET + else: + origination_type = OriginationType(_origination_type) + + parent_ord_id = d.pop("parentOrdId", UNSET) + + price = d.pop("price", UNSET) + + _price_type = d.pop("priceType", UNSET) + price_type: Unset | PriceType + if isinstance(_price_type, Unset): + price_type = UNSET + else: + price_type = PriceType(_price_type) + + qty = d.pop("qty", UNSET) + + route = d.pop("route", UNSET) + + _security = d.pop("security", UNSET) + security: Unset | Security + if isinstance(_security, Unset): + security = UNSET + else: + security = Security.from_dict(_security) + + source = d.pop("source", UNSET) + + source_address = d.pop("sourceAddress", UNSET) + + submit_ts = d.pop("submitTs", UNSET) + + symbol = d.pop("symbol", UNSET) + + tag = d.pop("tag", UNSET) + + text = d.pop("text", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + user_id = d.pop("userId", UNSET) + + trader_id = d.pop("traderId", UNSET) + + _ord_status = d.pop("ordStatus", UNSET) + ord_status: Unset | OrdStatus + if isinstance(_ord_status, Unset): + ord_status = UNSET + else: + ord_status = OrdStatus(_ord_status) + + claimed_by = d.pop("claimedBy", UNSET) + + transact_ts = d.pop("transactTs", UNSET) + + has_busts = d.pop("hasBusts", UNSET) + + has_corrects = d.pop("hasCorrects", UNSET) + + has_notes = d.pop("hasNotes", UNSET) + + order_cross = cls( + account_id=account_id, + algo=algo, + allocations=allocations, + cross_type=cross_type, + cur_ord_id=cur_ord_id, + header=header, + id=id, + incoming_cl_ord_id=incoming_cl_ord_id, + incoming_ord_id=incoming_ord_id, + instructions=instructions, + market_condition=market_condition, + optional_data=optional_data, + order_flags=order_flags, + order_updates=order_updates, + ord_type=ord_type, + origination_type=origination_type, + parent_ord_id=parent_ord_id, + price=price, + price_type=price_type, + qty=qty, + route=route, + security=security, + source=source, + source_address=source_address, + submit_ts=submit_ts, + symbol=symbol, + tag=tag, + text=text, + tif=tif, + user_id=user_id, + trader_id=trader_id, + ord_status=ord_status, + claimed_by=claimed_by, + transact_ts=transact_ts, + has_busts=has_busts, + has_corrects=has_corrects, + has_notes=has_notes, + ) + + return order_cross diff --git a/openapi/openapi_project/openapi_package/models/order_cross_algo.py b/openapi/openapi_project/openapi_package/models/order_cross_algo.py new file mode 100644 index 000000000..f96dab4f9 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/order_cross_algo.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="OrderCrossAlgo") + + +@_attrs_define +class OrderCrossAlgo: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_cross_algo = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_cross_algo.additional_properties = additional_properties + return order_cross_algo + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/order_cross_allocation.py b/openapi/openapi_project/openapi_package/models/order_cross_allocation.py new file mode 100644 index 000000000..b79a16449 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/order_cross_allocation.py @@ -0,0 +1,263 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.cross_side_type import CrossSideType +from ..models.ord_status import OrdStatus +from ..models.position_effect import PositionEffect +from ..models.side import Side +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.clearing_info import ClearingInfo + from ..models.order_cross_allocation_optional_data import ( + OrderCrossAllocationOptionalData, + ) + from ..models.order_instruction import OrderInstruction + + +T = TypeVar("T", bound="OrderCrossAllocation") + + +@_attrs_define +class OrderCrossAllocation: + """ + Attributes: + account_id (Union[Unset, int]): + clearing_info (Union[Unset, ClearingInfo]): + id (Union[Unset, str]): + incoming_ord_id (Union[Unset, str]): + instructions (Union[Unset, list['OrderInstruction']]): + optional_data (Union[Unset, OrderCrossAllocationOptionalData]): + position_effect (Union[Unset, PositionEffect]): + qty (Union[Unset, float]): + side (Union[Unset, Side]): + side_type (Union[Unset, CrossSideType]): + avg_price (Union[Unset, float]): + last_price (Union[Unset, float]): + last_qty (Union[Unset, float]): + last_market (Union[Unset, str]): + leaves_qty (Union[Unset, float]): + cum_qty (Union[Unset, float]): + transact_ts (Union[Unset, str]): + ord_status (Union[Unset, OrdStatus]): + """ + + account_id: Unset | int = UNSET + clearing_info: Union[Unset, "ClearingInfo"] = UNSET + id: Unset | str = UNSET + incoming_ord_id: Unset | str = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + optional_data: Union[Unset, "OrderCrossAllocationOptionalData"] = UNSET + position_effect: Unset | PositionEffect = UNSET + qty: Unset | float = UNSET + side: Unset | Side = UNSET + side_type: Unset | CrossSideType = UNSET + avg_price: Unset | float = UNSET + last_price: Unset | float = UNSET + last_qty: Unset | float = UNSET + last_market: Unset | str = UNSET + leaves_qty: Unset | float = UNSET + cum_qty: Unset | float = UNSET + transact_ts: Unset | str = UNSET + ord_status: Unset | OrdStatus = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + clearing_info: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_info, Unset): + clearing_info = self.clearing_info.to_dict() + + id = self.id + + incoming_ord_id = self.incoming_ord_id + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + position_effect: Unset | str = UNSET + if not isinstance(self.position_effect, Unset): + position_effect = self.position_effect.value + + qty = self.qty + + side: Unset | str = UNSET + if not isinstance(self.side, Unset): + side = self.side.value + + side_type: Unset | str = UNSET + if not isinstance(self.side_type, Unset): + side_type = self.side_type.value + + avg_price = self.avg_price + + last_price = self.last_price + + last_qty = self.last_qty + + last_market = self.last_market + + leaves_qty = self.leaves_qty + + cum_qty = self.cum_qty + + transact_ts = self.transact_ts + + ord_status: Unset | str = UNSET + if not isinstance(self.ord_status, Unset): + ord_status = self.ord_status.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if clearing_info is not UNSET: + field_dict["clearingInfo"] = clearing_info + if id is not UNSET: + field_dict["id"] = id + if incoming_ord_id is not UNSET: + field_dict["incomingOrdId"] = incoming_ord_id + if instructions is not UNSET: + field_dict["instructions"] = instructions + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if position_effect is not UNSET: + field_dict["positionEffect"] = position_effect + if qty is not UNSET: + field_dict["qty"] = qty + if side is not UNSET: + field_dict["side"] = side + if side_type is not UNSET: + field_dict["sideType"] = side_type + if avg_price is not UNSET: + field_dict["avgPrice"] = avg_price + if last_price is not UNSET: + field_dict["lastPrice"] = last_price + if last_qty is not UNSET: + field_dict["lastQty"] = last_qty + if last_market is not UNSET: + field_dict["lastMarket"] = last_market + if leaves_qty is not UNSET: + field_dict["leavesQty"] = leaves_qty + if cum_qty is not UNSET: + field_dict["cumQty"] = cum_qty + if transact_ts is not UNSET: + field_dict["transactTs"] = transact_ts + if ord_status is not UNSET: + field_dict["ordStatus"] = ord_status + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.clearing_info import ClearingInfo + from ..models.order_cross_allocation_optional_data import ( + OrderCrossAllocationOptionalData, + ) + from ..models.order_instruction import OrderInstruction + + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + _clearing_info = d.pop("clearingInfo", UNSET) + clearing_info: Unset | ClearingInfo + if isinstance(_clearing_info, Unset): + clearing_info = UNSET + else: + clearing_info = ClearingInfo.from_dict(_clearing_info) + + id = d.pop("id", UNSET) + + incoming_ord_id = d.pop("incomingOrdId", UNSET) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | OrderCrossAllocationOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = OrderCrossAllocationOptionalData.from_dict(_optional_data) + + _position_effect = d.pop("positionEffect", UNSET) + position_effect: Unset | PositionEffect + if isinstance(_position_effect, Unset): + position_effect = UNSET + else: + position_effect = PositionEffect(_position_effect) + + qty = d.pop("qty", UNSET) + + _side = d.pop("side", UNSET) + side: Unset | Side + if isinstance(_side, Unset): + side = UNSET + else: + side = Side(_side) + + _side_type = d.pop("sideType", UNSET) + side_type: Unset | CrossSideType + if isinstance(_side_type, Unset): + side_type = UNSET + else: + side_type = CrossSideType(_side_type) + + avg_price = d.pop("avgPrice", UNSET) + + last_price = d.pop("lastPrice", UNSET) + + last_qty = d.pop("lastQty", UNSET) + + last_market = d.pop("lastMarket", UNSET) + + leaves_qty = d.pop("leavesQty", UNSET) + + cum_qty = d.pop("cumQty", UNSET) + + transact_ts = d.pop("transactTs", UNSET) + + _ord_status = d.pop("ordStatus", UNSET) + ord_status: Unset | OrdStatus + if isinstance(_ord_status, Unset): + ord_status = UNSET + else: + ord_status = OrdStatus(_ord_status) + + order_cross_allocation = cls( + account_id=account_id, + clearing_info=clearing_info, + id=id, + incoming_ord_id=incoming_ord_id, + instructions=instructions, + optional_data=optional_data, + position_effect=position_effect, + qty=qty, + side=side, + side_type=side_type, + avg_price=avg_price, + last_price=last_price, + last_qty=last_qty, + last_market=last_market, + leaves_qty=leaves_qty, + cum_qty=cum_qty, + transact_ts=transact_ts, + ord_status=ord_status, + ) + + return order_cross_allocation diff --git a/openapi/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py b/openapi/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py new file mode 100644 index 000000000..e05a389f3 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="OrderCrossAllocationOptionalData") + + +@_attrs_define +class OrderCrossAllocationOptionalData: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_cross_allocation_optional_data = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_cross_allocation_optional_data.additional_properties = ( + additional_properties + ) + return order_cross_allocation_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/order_cross_market_condition.py b/openapi/openapi_project/openapi_package/models/order_cross_market_condition.py new file mode 100644 index 000000000..09b5ab28a --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/order_cross_market_condition.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="OrderCrossMarketCondition") + + +@_attrs_define +class OrderCrossMarketCondition: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_cross_market_condition = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_cross_market_condition.additional_properties = additional_properties + return order_cross_market_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/order_cross_optional_data.py b/openapi/openapi_project/openapi_package/models/order_cross_optional_data.py new file mode 100644 index 000000000..c5a321b08 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/order_cross_optional_data.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="OrderCrossOptionalData") + + +@_attrs_define +class OrderCrossOptionalData: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_cross_optional_data = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_cross_optional_data.additional_properties = additional_properties + return order_cross_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/order_delete.py b/openapi/openapi_project/openapi_package/models/order_delete.py new file mode 100644 index 000000000..06bbdd0dd --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/order_delete.py @@ -0,0 +1,106 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.origination_type import OriginationType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.order_delete_optional_data import OrderDeleteOptionalData + + +T = TypeVar("T", bound="OrderDelete") + + +@_attrs_define +class OrderDelete: + """ + Attributes: + cur_ord_id (Union[Unset, str]): + optional_data (Union[Unset, OrderDeleteOptionalData]): + origination_type (Union[Unset, OriginationType]): + perm_ord_id (Union[Unset, str]): + trader_id (Union[Unset, str]): + submit_ts (Union[Unset, str]): + """ + + cur_ord_id: Unset | str = UNSET + optional_data: Union[Unset, "OrderDeleteOptionalData"] = UNSET + origination_type: Unset | OriginationType = UNSET + perm_ord_id: Unset | str = UNSET + trader_id: Unset | str = UNSET + submit_ts: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + cur_ord_id = self.cur_ord_id + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + origination_type: Unset | str = UNSET + if not isinstance(self.origination_type, Unset): + origination_type = self.origination_type.value + + perm_ord_id = self.perm_ord_id + + trader_id = self.trader_id + + submit_ts = self.submit_ts + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if origination_type is not UNSET: + field_dict["originationType"] = origination_type + if perm_ord_id is not UNSET: + field_dict["permOrdId"] = perm_ord_id + if trader_id is not UNSET: + field_dict["traderId"] = trader_id + if submit_ts is not UNSET: + field_dict["submitTs"] = submit_ts + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.order_delete_optional_data import OrderDeleteOptionalData + + d = dict(src_dict) + cur_ord_id = d.pop("curOrdId", UNSET) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | OrderDeleteOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = OrderDeleteOptionalData.from_dict(_optional_data) + + _origination_type = d.pop("originationType", UNSET) + origination_type: Unset | OriginationType + if isinstance(_origination_type, Unset): + origination_type = UNSET + else: + origination_type = OriginationType(_origination_type) + + perm_ord_id = d.pop("permOrdId", UNSET) + + trader_id = d.pop("traderId", UNSET) + + submit_ts = d.pop("submitTs", UNSET) + + order_delete = cls( + cur_ord_id=cur_ord_id, + optional_data=optional_data, + origination_type=origination_type, + perm_ord_id=perm_ord_id, + trader_id=trader_id, + submit_ts=submit_ts, + ) + + return order_delete diff --git a/openapi/openapi_project/openapi_package/models/order_delete_optional_data.py b/openapi/openapi_project/openapi_package/models/order_delete_optional_data.py new file mode 100644 index 000000000..3448ed95a --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/order_delete_optional_data.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="OrderDeleteOptionalData") + + +@_attrs_define +class OrderDeleteOptionalData: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_delete_optional_data = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_delete_optional_data.additional_properties = additional_properties + return order_delete_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/order_instruction.py b/openapi/openapi_project/openapi_package/models/order_instruction.py new file mode 100644 index 000000000..29068f573 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/order_instruction.py @@ -0,0 +1,57 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.order_instruction_type import OrderInstructionType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="OrderInstruction") + + +@_attrs_define +class OrderInstruction: + """ + Attributes: + type_ (Union[Unset, OrderInstructionType]): + value (Union[Unset, str]): + """ + + type_: Unset | OrderInstructionType = UNSET + value: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + type_: Unset | str = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + value = self.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if type_ is not UNSET: + field_dict["type"] = type_ + if value is not UNSET: + field_dict["value"] = value + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _type_ = d.pop("type", UNSET) + type_: Unset | OrderInstructionType + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = OrderInstructionType(_type_) + + value = d.pop("value", UNSET) + + order_instruction = cls( + type_=type_, + value=value, + ) + + return order_instruction diff --git a/openapi/openapi_project/openapi_package/models/order_instruction_type.py b/openapi/openapi_project/openapi_package/models/order_instruction_type.py new file mode 100644 index 000000000..2dc45378a --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/order_instruction_type.py @@ -0,0 +1,91 @@ +from enum import Enum + + +class OrderInstructionType(str, Enum): + ORDER_INSTRUCTION_TYPE_ALL_OR_NONE = "ORDER_INSTRUCTION_TYPE_ALL_OR_NONE" + ORDER_INSTRUCTION_TYPE_AUCTION_ID = "ORDER_INSTRUCTION_TYPE_AUCTION_ID" + ORDER_INSTRUCTION_TYPE_AUTO_MATCH = "ORDER_INSTRUCTION_TYPE_AUTO_MATCH" + ORDER_INSTRUCTION_TYPE_AUTO_MATCH_PRICE = "ORDER_INSTRUCTION_TYPE_AUTO_MATCH_PRICE" + ORDER_INSTRUCTION_TYPE_BROKER_PERCENTAGE = ( + "ORDER_INSTRUCTION_TYPE_BROKER_PERCENTAGE" + ) + ORDER_INSTRUCTION_TYPE_CLIENT_ID = "ORDER_INSTRUCTION_TYPE_CLIENT_ID" + ORDER_INSTRUCTION_TYPE_COMMISSION = "ORDER_INSTRUCTION_TYPE_COMMISSION" + ORDER_INSTRUCTION_TYPE_COMPRESSION = "ORDER_INSTRUCTION_TYPE_COMPRESSION" + ORDER_INSTRUCTION_TYPE_CROSS_PRIORITIZATION = ( + "ORDER_INSTRUCTION_TYPE_CROSS_PRIORITIZATION" + ) + ORDER_INSTRUCTION_TYPE_DO_NOT_REDUCE = "ORDER_INSTRUCTION_TYPE_DO_NOT_REDUCE" + ORDER_INSTRUCTION_TYPE_DO_NOT_ROUTE = "ORDER_INSTRUCTION_TYPE_DO_NOT_ROUTE" + ORDER_INSTRUCTION_TYPE_DROP = "ORDER_INSTRUCTION_TYPE_DROP" + ORDER_INSTRUCTION_TYPE_EQUITY_BUY_CLEARING_FIRM = ( + "ORDER_INSTRUCTION_TYPE_EQUITY_BUY_CLEARING_FIRM" + ) + ORDER_INSTRUCTION_TYPE_EQUITY_EX_DESTINATION = ( + "ORDER_INSTRUCTION_TYPE_EQUITY_EX_DESTINATION" + ) + ORDER_INSTRUCTION_TYPE_EQUITY_PARTY_ID = "ORDER_INSTRUCTION_TYPE_EQUITY_PARTY_ID" + ORDER_INSTRUCTION_TYPE_EQUITY_SELL_CLEARING_FIRM = ( + "ORDER_INSTRUCTION_TYPE_EQUITY_SELL_CLEARING_FIRM" + ) + ORDER_INSTRUCTION_TYPE_EQUITY_TRADE_PRICE = ( + "ORDER_INSTRUCTION_TYPE_EQUITY_TRADE_PRICE" + ) + ORDER_INSTRUCTION_TYPE_EQUITY_TRADE_SIZE = ( + "ORDER_INSTRUCTION_TYPE_EQUITY_TRADE_SIZE" + ) + ORDER_INSTRUCTION_TYPE_EQUITY_TRADE_VENUE = ( + "ORDER_INSTRUCTION_TYPE_EQUITY_TRADE_VENUE" + ) + ORDER_INSTRUCTION_TYPE_EQUITY_TRANSACT_TS = ( + "ORDER_INSTRUCTION_TYPE_EQUITY_TRANSACT_TS" + ) + ORDER_INSTRUCTION_TYPE_FLEX_AUCTION_DURATION = ( + "ORDER_INSTRUCTION_TYPE_FLEX_AUCTION_DURATION" + ) + ORDER_INSTRUCTION_TYPE_FLEX_HEDGE_EXEC_INST = ( + "ORDER_INSTRUCTION_TYPE_FLEX_HEDGE_EXEC_INST" + ) + ORDER_INSTRUCTION_TYPE_FLEX_PRE_FACIL_PRICE = ( + "ORDER_INSTRUCTION_TYPE_FLEX_PRE_FACIL_PRICE" + ) + ORDER_INSTRUCTION_TYPE_FREQUENT_TRADER = "ORDER_INSTRUCTION_TYPE_FREQUENT_TRADER" + ORDER_INSTRUCTION_TYPE_FREQUENT_TRADER_ID = ( + "ORDER_INSTRUCTION_TYPE_FREQUENT_TRADER_ID" + ) + ORDER_INSTRUCTION_TYPE_GOOD_TILL_DATE = "ORDER_INSTRUCTION_TYPE_GOOD_TILL_DATE" + ORDER_INSTRUCTION_TYPE_HELD = "ORDER_INSTRUCTION_TYPE_HELD" + ORDER_INSTRUCTION_TYPE_INTERMARKET_SWEEP = ( + "ORDER_INSTRUCTION_TYPE_INTERMARKET_SWEEP" + ) + ORDER_INSTRUCTION_TYPE_LAST_PRIORITY = "ORDER_INSTRUCTION_TYPE_LAST_PRIORITY" + ORDER_INSTRUCTION_TYPE_MAX_FLOOR = "ORDER_INSTRUCTION_TYPE_MAX_FLOOR" + ORDER_INSTRUCTION_TYPE_MIN_QTY = "ORDER_INSTRUCTION_TYPE_MIN_QTY" + ORDER_INSTRUCTION_TYPE_NONE = "ORDER_INSTRUCTION_TYPE_NONE" + ORDER_INSTRUCTION_TYPE_NOT_HELD = "ORDER_INSTRUCTION_TYPE_NOT_HELD" + ORDER_INSTRUCTION_TYPE_NO_COA = "ORDER_INSTRUCTION_TYPE_NO_COA" + ORDER_INSTRUCTION_TYPE_ORDER_ORIGIN = "ORDER_INSTRUCTION_TYPE_ORDER_ORIGIN" + ORDER_INSTRUCTION_TYPE_O_R_S = "ORDER_INSTRUCTION_TYPE_O_R_S" + ORDER_INSTRUCTION_TYPE_PEG_DIFFERENCE = "ORDER_INSTRUCTION_TYPE_PEG_DIFFERENCE" + ORDER_INSTRUCTION_TYPE_PEG_TYPE = "ORDER_INSTRUCTION_TYPE_PEG_TYPE" + ORDER_INSTRUCTION_TYPE_PHLX_QCC = "ORDER_INSTRUCTION_TYPE_PHLX_QCC" + ORDER_INSTRUCTION_TYPE_PREFERRED_M_M = "ORDER_INSTRUCTION_TYPE_PREFERRED_M_M" + ORDER_INSTRUCTION_TYPE_REPRESENT = "ORDER_INSTRUCTION_TYPE_REPRESENT" + ORDER_INSTRUCTION_TYPE_ROUTE_STRATEGY = "ORDER_INSTRUCTION_TYPE_ROUTE_STRATEGY" + ORDER_INSTRUCTION_TYPE_ROUTING_FIRM_ID = "ORDER_INSTRUCTION_TYPE_ROUTING_FIRM_ID" + ORDER_INSTRUCTION_TYPE_ROUTING_INST = "ORDER_INSTRUCTION_TYPE_ROUTING_INST" + ORDER_INSTRUCTION_TYPE_SESSION_ELIGIBILITY = ( + "ORDER_INSTRUCTION_TYPE_SESSION_ELIGIBILITY" + ) + ORDER_INSTRUCTION_TYPE_SETTLEMENT_LIQUIDITY = ( + "ORDER_INSTRUCTION_TYPE_SETTLEMENT_LIQUIDITY" + ) + ORDER_INSTRUCTION_TYPE_SOLICITED = "ORDER_INSTRUCTION_TYPE_SOLICITED" + ORDER_INSTRUCTION_TYPE_SPX_COMBO = "ORDER_INSTRUCTION_TYPE_SPX_COMBO" + ORDER_INSTRUCTION_TYPE_STEP_UP_PX = "ORDER_INSTRUCTION_TYPE_STEP_UP_PX" + ORDER_INSTRUCTION_TYPE_STRATEGY_ID = "ORDER_INSTRUCTION_TYPE_STRATEGY_ID" + ORDER_INSTRUCTION_TYPE_SWEEP = "ORDER_INSTRUCTION_TYPE_SWEEP" + ORDER_INSTRUCTION_TYPE_TIED_HEDGE = "ORDER_INSTRUCTION_TYPE_TIED_HEDGE" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/order_market_condition.py b/openapi/openapi_project/openapi_package/models/order_market_condition.py new file mode 100644 index 000000000..70aaf1ff9 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/order_market_condition.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="OrderMarketCondition") + + +@_attrs_define +class OrderMarketCondition: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_market_condition = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_market_condition.additional_properties = additional_properties + return order_market_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/order_optional_data.py b/openapi/openapi_project/openapi_package/models/order_optional_data.py new file mode 100644 index 000000000..089a5f2b5 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/order_optional_data.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="OrderOptionalData") + + +@_attrs_define +class OrderOptionalData: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_optional_data = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_optional_data.additional_properties = additional_properties + return order_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/order_type.py b/openapi/openapi_project/openapi_package/models/order_type.py new file mode 100644 index 000000000..f59ced1fa --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/order_type.py @@ -0,0 +1,12 @@ +from enum import Enum + + +class OrderType(str, Enum): + ORDER_TYPE_MULTI_LEG_ORDER = "ORDER_TYPE_MULTI_LEG_ORDER" + ORDER_TYPE_MULTI_LEG_ORDER_CROSS = "ORDER_TYPE_MULTI_LEG_ORDER_CROSS" + ORDER_TYPE_ORDER = "ORDER_TYPE_ORDER" + ORDER_TYPE_ORDER_CROSS = "ORDER_TYPE_ORDER_CROSS" + ORDER_TYPE_UNKNOWN = "ORDER_TYPE_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/order_update.py b/openapi/openapi_project/openapi_package/models/order_update.py new file mode 100644 index 000000000..6bd5e9c9c --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/order_update.py @@ -0,0 +1,623 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.exec_type import ExecType +from ..models.multi_leg_reporting_type import MultiLegReportingType +from ..models.ord_status import OrdStatus +from ..models.ord_type import OrdType +from ..models.origination_type import OriginationType +from ..models.position_effect import PositionEffect +from ..models.price_type import PriceType +from ..models.side import Side +from ..models.tif import Tif +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.clearing_info import ClearingInfo + from ..models.header import Header + from ..models.order_instruction import OrderInstruction + from ..models.order_update_algo import OrderUpdateAlgo + from ..models.order_update_optional_data import OrderUpdateOptionalData + from ..models.security import Security + + +T = TypeVar("T", bound="OrderUpdate") + + +@_attrs_define +class OrderUpdate: + """ + Attributes: + account_id (Union[Unset, int]): + algo (Union[Unset, OrderUpdateAlgo]): + alloc_id (Union[Unset, str]): + aux_price (Union[Unset, float]): + avg_price (Union[Unset, float]): + clearing_info (Union[Unset, ClearingInfo]): + commission (Union[Unset, float]): + cum_qty (Union[Unset, float]): + cur_ord_id (Union[Unset, str]): + exec_broker (Union[Unset, str]): + exec_id (Union[Unset, str]): + exec_ref_id (Union[Unset, str]): + exec_type (Union[Unset, ExecType]): + fee1 (Union[Unset, float]): + fee2 (Union[Unset, float]): + header (Union[Unset, Header]): + incoming_cl_ord_id (Union[Unset, str]): + incoming_ord_id (Union[Unset, str]): + incoming_orig_cl_ord_id (Union[Unset, str]): + instructions (Union[Unset, list['OrderInstruction']]): + last_market (Union[Unset, str]): + last_price (Union[Unset, float]): + last_qty (Union[Unset, float]): + leaves_qty (Union[Unset, float]): + leg_id (Union[Unset, str]): + liquidity_flag (Union[Unset, str]): + multi_leg_reporting_type (Union[Unset, MultiLegReportingType]): + notes (Union[Unset, str]): + optional_data (Union[Unset, OrderUpdateOptionalData]): + order_flags (Union[Unset, int]): + ord_status (Union[Unset, OrdStatus]): + ord_type (Union[Unset, OrdType]): + origination_type (Union[Unset, OriginationType]): + orig_ord_id (Union[Unset, str]): + parent_ord_id (Union[Unset, str]): + perm_ord_id (Union[Unset, str]): + position_effect (Union[Unset, PositionEffect]): + price (Union[Unset, float]): + price_type (Union[Unset, PriceType]): + qty (Union[Unset, float]): + route (Union[Unset, str]): + security (Union[Unset, Security]): + side (Union[Unset, Side]): + source (Union[Unset, str]): + symbol (Union[Unset, str]): + tag (Union[Unset, str]): + text (Union[Unset, str]): + tif (Union[Unset, Tif]): + trader_id (Union[Unset, str]): + transact_ts (Union[Unset, str]): + working_qty (Union[Unset, float]): + """ + + account_id: Unset | int = UNSET + algo: Union[Unset, "OrderUpdateAlgo"] = UNSET + alloc_id: Unset | str = UNSET + aux_price: Unset | float = UNSET + avg_price: Unset | float = UNSET + clearing_info: Union[Unset, "ClearingInfo"] = UNSET + commission: Unset | float = UNSET + cum_qty: Unset | float = UNSET + cur_ord_id: Unset | str = UNSET + exec_broker: Unset | str = UNSET + exec_id: Unset | str = UNSET + exec_ref_id: Unset | str = UNSET + exec_type: Unset | ExecType = UNSET + fee1: Unset | float = UNSET + fee2: Unset | float = UNSET + header: Union[Unset, "Header"] = UNSET + incoming_cl_ord_id: Unset | str = UNSET + incoming_ord_id: Unset | str = UNSET + incoming_orig_cl_ord_id: Unset | str = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + last_market: Unset | str = UNSET + last_price: Unset | float = UNSET + last_qty: Unset | float = UNSET + leaves_qty: Unset | float = UNSET + leg_id: Unset | str = UNSET + liquidity_flag: Unset | str = UNSET + multi_leg_reporting_type: Unset | MultiLegReportingType = UNSET + notes: Unset | str = UNSET + optional_data: Union[Unset, "OrderUpdateOptionalData"] = UNSET + order_flags: Unset | int = UNSET + ord_status: Unset | OrdStatus = UNSET + ord_type: Unset | OrdType = UNSET + origination_type: Unset | OriginationType = UNSET + orig_ord_id: Unset | str = UNSET + parent_ord_id: Unset | str = UNSET + perm_ord_id: Unset | str = UNSET + position_effect: Unset | PositionEffect = UNSET + price: Unset | float = UNSET + price_type: Unset | PriceType = UNSET + qty: Unset | float = UNSET + route: Unset | str = UNSET + security: Union[Unset, "Security"] = UNSET + side: Unset | Side = UNSET + source: Unset | str = UNSET + symbol: Unset | str = UNSET + tag: Unset | str = UNSET + text: Unset | str = UNSET + tif: Unset | Tif = UNSET + trader_id: Unset | str = UNSET + transact_ts: Unset | str = UNSET + working_qty: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + algo: Unset | dict[str, Any] = UNSET + if not isinstance(self.algo, Unset): + algo = self.algo.to_dict() + + alloc_id = self.alloc_id + + aux_price = self.aux_price + + avg_price = self.avg_price + + clearing_info: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_info, Unset): + clearing_info = self.clearing_info.to_dict() + + commission = self.commission + + cum_qty = self.cum_qty + + cur_ord_id = self.cur_ord_id + + exec_broker = self.exec_broker + + exec_id = self.exec_id + + exec_ref_id = self.exec_ref_id + + exec_type: Unset | str = UNSET + if not isinstance(self.exec_type, Unset): + exec_type = self.exec_type.value + + fee1 = self.fee1 + + fee2 = self.fee2 + + header: Unset | dict[str, Any] = UNSET + if not isinstance(self.header, Unset): + header = self.header.to_dict() + + incoming_cl_ord_id = self.incoming_cl_ord_id + + incoming_ord_id = self.incoming_ord_id + + incoming_orig_cl_ord_id = self.incoming_orig_cl_ord_id + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + last_market = self.last_market + + last_price = self.last_price + + last_qty = self.last_qty + + leaves_qty = self.leaves_qty + + leg_id = self.leg_id + + liquidity_flag = self.liquidity_flag + + multi_leg_reporting_type: Unset | str = UNSET + if not isinstance(self.multi_leg_reporting_type, Unset): + multi_leg_reporting_type = self.multi_leg_reporting_type.value + + notes = self.notes + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + order_flags = self.order_flags + + ord_status: Unset | str = UNSET + if not isinstance(self.ord_status, Unset): + ord_status = self.ord_status.value + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + origination_type: Unset | str = UNSET + if not isinstance(self.origination_type, Unset): + origination_type = self.origination_type.value + + orig_ord_id = self.orig_ord_id + + parent_ord_id = self.parent_ord_id + + perm_ord_id = self.perm_ord_id + + position_effect: Unset | str = UNSET + if not isinstance(self.position_effect, Unset): + position_effect = self.position_effect.value + + price = self.price + + price_type: Unset | str = UNSET + if not isinstance(self.price_type, Unset): + price_type = self.price_type.value + + qty = self.qty + + route = self.route + + security: Unset | dict[str, Any] = UNSET + if not isinstance(self.security, Unset): + security = self.security.to_dict() + + side: Unset | str = UNSET + if not isinstance(self.side, Unset): + side = self.side.value + + source = self.source + + symbol = self.symbol + + tag = self.tag + + text = self.text + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + trader_id = self.trader_id + + transact_ts = self.transact_ts + + working_qty = self.working_qty + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if algo is not UNSET: + field_dict["Algo"] = algo + if alloc_id is not UNSET: + field_dict["allocId"] = alloc_id + if aux_price is not UNSET: + field_dict["auxPrice"] = aux_price + if avg_price is not UNSET: + field_dict["avgPrice"] = avg_price + if clearing_info is not UNSET: + field_dict["clearingInfo"] = clearing_info + if commission is not UNSET: + field_dict["commission"] = commission + if cum_qty is not UNSET: + field_dict["cumQty"] = cum_qty + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if exec_broker is not UNSET: + field_dict["execBroker"] = exec_broker + if exec_id is not UNSET: + field_dict["execId"] = exec_id + if exec_ref_id is not UNSET: + field_dict["execRefId"] = exec_ref_id + if exec_type is not UNSET: + field_dict["execType"] = exec_type + if fee1 is not UNSET: + field_dict["fee1"] = fee1 + if fee2 is not UNSET: + field_dict["fee2"] = fee2 + if header is not UNSET: + field_dict["header"] = header + if incoming_cl_ord_id is not UNSET: + field_dict["incomingClOrdId"] = incoming_cl_ord_id + if incoming_ord_id is not UNSET: + field_dict["incomingOrdId"] = incoming_ord_id + if incoming_orig_cl_ord_id is not UNSET: + field_dict["incomingOrigClOrdId"] = incoming_orig_cl_ord_id + if instructions is not UNSET: + field_dict["instructions"] = instructions + if last_market is not UNSET: + field_dict["lastMarket"] = last_market + if last_price is not UNSET: + field_dict["lastPrice"] = last_price + if last_qty is not UNSET: + field_dict["lastQty"] = last_qty + if leaves_qty is not UNSET: + field_dict["leavesQty"] = leaves_qty + if leg_id is not UNSET: + field_dict["legId"] = leg_id + if liquidity_flag is not UNSET: + field_dict["liquidityFlag"] = liquidity_flag + if multi_leg_reporting_type is not UNSET: + field_dict["multiLegReportingType"] = multi_leg_reporting_type + if notes is not UNSET: + field_dict["Notes"] = notes + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if order_flags is not UNSET: + field_dict["orderFlags"] = order_flags + if ord_status is not UNSET: + field_dict["ordStatus"] = ord_status + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if origination_type is not UNSET: + field_dict["originationType"] = origination_type + if orig_ord_id is not UNSET: + field_dict["origOrdId"] = orig_ord_id + if parent_ord_id is not UNSET: + field_dict["parentOrdId"] = parent_ord_id + if perm_ord_id is not UNSET: + field_dict["permOrdId"] = perm_ord_id + if position_effect is not UNSET: + field_dict["positionEffect"] = position_effect + if price is not UNSET: + field_dict["price"] = price + if price_type is not UNSET: + field_dict["priceType"] = price_type + if qty is not UNSET: + field_dict["qty"] = qty + if route is not UNSET: + field_dict["route"] = route + if security is not UNSET: + field_dict["security"] = security + if side is not UNSET: + field_dict["side"] = side + if source is not UNSET: + field_dict["source"] = source + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tag is not UNSET: + field_dict["tag"] = tag + if text is not UNSET: + field_dict["text"] = text + if tif is not UNSET: + field_dict["tif"] = tif + if trader_id is not UNSET: + field_dict["traderId"] = trader_id + if transact_ts is not UNSET: + field_dict["transactTs"] = transact_ts + if working_qty is not UNSET: + field_dict["workingQty"] = working_qty + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.clearing_info import ClearingInfo + from ..models.header import Header + from ..models.order_instruction import OrderInstruction + from ..models.order_update_algo import OrderUpdateAlgo + from ..models.order_update_optional_data import OrderUpdateOptionalData + from ..models.security import Security + + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + _algo = d.pop("Algo", UNSET) + algo: Unset | OrderUpdateAlgo + if isinstance(_algo, Unset): + algo = UNSET + else: + algo = OrderUpdateAlgo.from_dict(_algo) + + alloc_id = d.pop("allocId", UNSET) + + aux_price = d.pop("auxPrice", UNSET) + + avg_price = d.pop("avgPrice", UNSET) + + _clearing_info = d.pop("clearingInfo", UNSET) + clearing_info: Unset | ClearingInfo + if isinstance(_clearing_info, Unset): + clearing_info = UNSET + else: + clearing_info = ClearingInfo.from_dict(_clearing_info) + + commission = d.pop("commission", UNSET) + + cum_qty = d.pop("cumQty", UNSET) + + cur_ord_id = d.pop("curOrdId", UNSET) + + exec_broker = d.pop("execBroker", UNSET) + + exec_id = d.pop("execId", UNSET) + + exec_ref_id = d.pop("execRefId", UNSET) + + _exec_type = d.pop("execType", UNSET) + exec_type: Unset | ExecType + if isinstance(_exec_type, Unset): + exec_type = UNSET + else: + exec_type = ExecType(_exec_type) + + fee1 = d.pop("fee1", UNSET) + + fee2 = d.pop("fee2", UNSET) + + _header = d.pop("header", UNSET) + header: Unset | Header + if isinstance(_header, Unset): + header = UNSET + else: + header = Header.from_dict(_header) + + incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) + + incoming_ord_id = d.pop("incomingOrdId", UNSET) + + incoming_orig_cl_ord_id = d.pop("incomingOrigClOrdId", UNSET) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + last_market = d.pop("lastMarket", UNSET) + + last_price = d.pop("lastPrice", UNSET) + + last_qty = d.pop("lastQty", UNSET) + + leaves_qty = d.pop("leavesQty", UNSET) + + leg_id = d.pop("legId", UNSET) + + liquidity_flag = d.pop("liquidityFlag", UNSET) + + _multi_leg_reporting_type = d.pop("multiLegReportingType", UNSET) + multi_leg_reporting_type: Unset | MultiLegReportingType + if isinstance(_multi_leg_reporting_type, Unset): + multi_leg_reporting_type = UNSET + else: + multi_leg_reporting_type = MultiLegReportingType(_multi_leg_reporting_type) + + notes = d.pop("Notes", UNSET) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | OrderUpdateOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = OrderUpdateOptionalData.from_dict(_optional_data) + + order_flags = d.pop("orderFlags", UNSET) + + _ord_status = d.pop("ordStatus", UNSET) + ord_status: Unset | OrdStatus + if isinstance(_ord_status, Unset): + ord_status = UNSET + else: + ord_status = OrdStatus(_ord_status) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + _origination_type = d.pop("originationType", UNSET) + origination_type: Unset | OriginationType + if isinstance(_origination_type, Unset): + origination_type = UNSET + else: + origination_type = OriginationType(_origination_type) + + orig_ord_id = d.pop("origOrdId", UNSET) + + parent_ord_id = d.pop("parentOrdId", UNSET) + + perm_ord_id = d.pop("permOrdId", UNSET) + + _position_effect = d.pop("positionEffect", UNSET) + position_effect: Unset | PositionEffect + if isinstance(_position_effect, Unset): + position_effect = UNSET + else: + position_effect = PositionEffect(_position_effect) + + price = d.pop("price", UNSET) + + _price_type = d.pop("priceType", UNSET) + price_type: Unset | PriceType + if isinstance(_price_type, Unset): + price_type = UNSET + else: + price_type = PriceType(_price_type) + + qty = d.pop("qty", UNSET) + + route = d.pop("route", UNSET) + + _security = d.pop("security", UNSET) + security: Unset | Security + if isinstance(_security, Unset): + security = UNSET + else: + security = Security.from_dict(_security) + + _side = d.pop("side", UNSET) + side: Unset | Side + if isinstance(_side, Unset): + side = UNSET + else: + side = Side(_side) + + source = d.pop("source", UNSET) + + symbol = d.pop("symbol", UNSET) + + tag = d.pop("tag", UNSET) + + text = d.pop("text", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + trader_id = d.pop("traderId", UNSET) + + transact_ts = d.pop("transactTs", UNSET) + + working_qty = d.pop("workingQty", UNSET) + + order_update = cls( + account_id=account_id, + algo=algo, + alloc_id=alloc_id, + aux_price=aux_price, + avg_price=avg_price, + clearing_info=clearing_info, + commission=commission, + cum_qty=cum_qty, + cur_ord_id=cur_ord_id, + exec_broker=exec_broker, + exec_id=exec_id, + exec_ref_id=exec_ref_id, + exec_type=exec_type, + fee1=fee1, + fee2=fee2, + header=header, + incoming_cl_ord_id=incoming_cl_ord_id, + incoming_ord_id=incoming_ord_id, + incoming_orig_cl_ord_id=incoming_orig_cl_ord_id, + instructions=instructions, + last_market=last_market, + last_price=last_price, + last_qty=last_qty, + leaves_qty=leaves_qty, + leg_id=leg_id, + liquidity_flag=liquidity_flag, + multi_leg_reporting_type=multi_leg_reporting_type, + notes=notes, + optional_data=optional_data, + order_flags=order_flags, + ord_status=ord_status, + ord_type=ord_type, + origination_type=origination_type, + orig_ord_id=orig_ord_id, + parent_ord_id=parent_ord_id, + perm_ord_id=perm_ord_id, + position_effect=position_effect, + price=price, + price_type=price_type, + qty=qty, + route=route, + security=security, + side=side, + source=source, + symbol=symbol, + tag=tag, + text=text, + tif=tif, + trader_id=trader_id, + transact_ts=transact_ts, + working_qty=working_qty, + ) + + return order_update diff --git a/openapi/openapi_project/openapi_package/models/order_update_algo.py b/openapi/openapi_project/openapi_package/models/order_update_algo.py new file mode 100644 index 000000000..e8f7ee213 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/order_update_algo.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="OrderUpdateAlgo") + + +@_attrs_define +class OrderUpdateAlgo: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_update_algo = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_update_algo.additional_properties = additional_properties + return order_update_algo + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/order_update_event.py b/openapi/openapi_project/openapi_package/models/order_update_event.py new file mode 100644 index 000000000..cc4da2419 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/order_update_event.py @@ -0,0 +1,181 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.execution import Execution + from ..models.multi_leg_order_cancel_replace_request import ( + MultiLegOrderCancelReplaceRequest, + ) + from ..models.order_cancel_reject import OrderCancelReject + from ..models.order_cancel_replace_request import OrderCancelReplaceRequest + from ..models.order_cancel_request import OrderCancelRequest + from ..models.order_delete import OrderDelete + from ..models.order_update import OrderUpdate + + +T = TypeVar("T", bound="OrderUpdateEvent") + + +@_attrs_define +class OrderUpdateEvent: + """ + Attributes: + order_cancel_request (Union[Unset, OrderCancelRequest]): + order_cancel_replace_request (Union[Unset, OrderCancelReplaceRequest]): + multi_leg_order_cancel_replace_request (Union[Unset, MultiLegOrderCancelReplaceRequest]): + execution (Union[Unset, Execution]): + order_update (Union[Unset, OrderUpdate]): + order_delete (Union[Unset, OrderDelete]): + order_cancel_reject (Union[Unset, OrderCancelReject]): + """ + + order_cancel_request: Union[Unset, "OrderCancelRequest"] = UNSET + order_cancel_replace_request: Union[Unset, "OrderCancelReplaceRequest"] = UNSET + multi_leg_order_cancel_replace_request: Union[ + Unset, "MultiLegOrderCancelReplaceRequest" + ] = UNSET + execution: Union[Unset, "Execution"] = UNSET + order_update: Union[Unset, "OrderUpdate"] = UNSET + order_delete: Union[Unset, "OrderDelete"] = UNSET + order_cancel_reject: Union[Unset, "OrderCancelReject"] = UNSET + + def to_dict(self) -> dict[str, Any]: + order_cancel_request: Unset | dict[str, Any] = UNSET + if not isinstance(self.order_cancel_request, Unset): + order_cancel_request = self.order_cancel_request.to_dict() + + order_cancel_replace_request: Unset | dict[str, Any] = UNSET + if not isinstance(self.order_cancel_replace_request, Unset): + order_cancel_replace_request = self.order_cancel_replace_request.to_dict() + + multi_leg_order_cancel_replace_request: Unset | dict[str, Any] = UNSET + if not isinstance(self.multi_leg_order_cancel_replace_request, Unset): + multi_leg_order_cancel_replace_request = ( + self.multi_leg_order_cancel_replace_request.to_dict() + ) + + execution: Unset | dict[str, Any] = UNSET + if not isinstance(self.execution, Unset): + execution = self.execution.to_dict() + + order_update: Unset | dict[str, Any] = UNSET + if not isinstance(self.order_update, Unset): + order_update = self.order_update.to_dict() + + order_delete: Unset | dict[str, Any] = UNSET + if not isinstance(self.order_delete, Unset): + order_delete = self.order_delete.to_dict() + + order_cancel_reject: Unset | dict[str, Any] = UNSET + if not isinstance(self.order_cancel_reject, Unset): + order_cancel_reject = self.order_cancel_reject.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if order_cancel_request is not UNSET: + field_dict["orderCancelRequest"] = order_cancel_request + if order_cancel_replace_request is not UNSET: + field_dict["orderCancelReplaceRequest"] = order_cancel_replace_request + if multi_leg_order_cancel_replace_request is not UNSET: + field_dict["multiLegOrderCancelReplaceRequest"] = ( + multi_leg_order_cancel_replace_request + ) + if execution is not UNSET: + field_dict["execution"] = execution + if order_update is not UNSET: + field_dict["orderUpdate"] = order_update + if order_delete is not UNSET: + field_dict["orderDelete"] = order_delete + if order_cancel_reject is not UNSET: + field_dict["orderCancelReject"] = order_cancel_reject + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.execution import Execution + from ..models.multi_leg_order_cancel_replace_request import ( + MultiLegOrderCancelReplaceRequest, + ) + from ..models.order_cancel_reject import OrderCancelReject + from ..models.order_cancel_replace_request import OrderCancelReplaceRequest + from ..models.order_cancel_request import OrderCancelRequest + from ..models.order_delete import OrderDelete + from ..models.order_update import OrderUpdate + + d = dict(src_dict) + _order_cancel_request = d.pop("orderCancelRequest", UNSET) + order_cancel_request: Unset | OrderCancelRequest + if isinstance(_order_cancel_request, Unset): + order_cancel_request = UNSET + else: + order_cancel_request = OrderCancelRequest.from_dict(_order_cancel_request) + + _order_cancel_replace_request = d.pop("orderCancelReplaceRequest", UNSET) + order_cancel_replace_request: Unset | OrderCancelReplaceRequest + if isinstance(_order_cancel_replace_request, Unset): + order_cancel_replace_request = UNSET + else: + order_cancel_replace_request = OrderCancelReplaceRequest.from_dict( + _order_cancel_replace_request + ) + + _multi_leg_order_cancel_replace_request = d.pop( + "multiLegOrderCancelReplaceRequest", UNSET + ) + multi_leg_order_cancel_replace_request: ( + Unset | MultiLegOrderCancelReplaceRequest + ) + if isinstance(_multi_leg_order_cancel_replace_request, Unset): + multi_leg_order_cancel_replace_request = UNSET + else: + multi_leg_order_cancel_replace_request = ( + MultiLegOrderCancelReplaceRequest.from_dict( + _multi_leg_order_cancel_replace_request + ) + ) + + _execution = d.pop("execution", UNSET) + execution: Unset | Execution + if isinstance(_execution, Unset): + execution = UNSET + else: + execution = Execution.from_dict(_execution) + + _order_update = d.pop("orderUpdate", UNSET) + order_update: Unset | OrderUpdate + if isinstance(_order_update, Unset): + order_update = UNSET + else: + order_update = OrderUpdate.from_dict(_order_update) + + _order_delete = d.pop("orderDelete", UNSET) + order_delete: Unset | OrderDelete + if isinstance(_order_delete, Unset): + order_delete = UNSET + else: + order_delete = OrderDelete.from_dict(_order_delete) + + _order_cancel_reject = d.pop("orderCancelReject", UNSET) + order_cancel_reject: Unset | OrderCancelReject + if isinstance(_order_cancel_reject, Unset): + order_cancel_reject = UNSET + else: + order_cancel_reject = OrderCancelReject.from_dict(_order_cancel_reject) + + order_update_event = cls( + order_cancel_request=order_cancel_request, + order_cancel_replace_request=order_cancel_replace_request, + multi_leg_order_cancel_replace_request=multi_leg_order_cancel_replace_request, + execution=execution, + order_update=order_update, + order_delete=order_delete, + order_cancel_reject=order_cancel_reject, + ) + + return order_update_event diff --git a/openapi/openapi_project/openapi_package/models/order_update_optional_data.py b/openapi/openapi_project/openapi_package/models/order_update_optional_data.py new file mode 100644 index 000000000..9236dcba2 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/order_update_optional_data.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="OrderUpdateOptionalData") + + +@_attrs_define +class OrderUpdateOptionalData: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_update_optional_data = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_update_optional_data.additional_properties = additional_properties + return order_update_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/origination_type.py b/openapi/openapi_project/openapi_package/models/origination_type.py new file mode 100644 index 000000000..e8e7a27f4 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/origination_type.py @@ -0,0 +1,39 @@ +from enum import Enum + + +class OriginationType(str, Enum): + ORIGINATION_TYPE_ADMINISTRATIVE = "ORIGINATION_TYPE_ADMINISTRATIVE" + ORIGINATION_TYPE_API_CHILD_ORDER = "ORIGINATION_TYPE_API_CHILD_ORDER" + ORIGINATION_TYPE_API_ORDER = "ORIGINATION_TYPE_API_ORDER" + ORIGINATION_TYPE_API_ORDER_CANCEL_REPLACE_REQUEST = ( + "ORIGINATION_TYPE_API_ORDER_CANCEL_REPLACE_REQUEST" + ) + ORIGINATION_TYPE_API_ORDER_CANCEL_REQUEST = ( + "ORIGINATION_TYPE_API_ORDER_CANCEL_REQUEST" + ) + ORIGINATION_TYPE_API_PARENT_ORDER = "ORIGINATION_TYPE_API_PARENT_ORDER" + ORIGINATION_TYPE_FIX_FROM_STREET_CHILD_ORDER = ( + "ORIGINATION_TYPE_FIX_FROM_STREET_CHILD_ORDER" + ) + ORIGINATION_TYPE_FIX_FROM_STREET_DROP = "ORIGINATION_TYPE_FIX_FROM_STREET_DROP" + ORIGINATION_TYPE_FIX_FROM_STREET_DROP_ORDER_UPDATE = ( + "ORIGINATION_TYPE_FIX_FROM_STREET_DROP_ORDER_UPDATE" + ) + ORIGINATION_TYPE_FIX_FROM_STREET_ORDER = "ORIGINATION_TYPE_FIX_FROM_STREET_ORDER" + ORIGINATION_TYPE_FIX_FROM_STREET_ORDER_CANCEL_REPLACE_REQUEST = ( + "ORIGINATION_TYPE_FIX_FROM_STREET_ORDER_CANCEL_REPLACE_REQUEST" + ) + ORIGINATION_TYPE_FIX_FROM_STREET_ORDER_CANCEL_REQUEST = ( + "ORIGINATION_TYPE_FIX_FROM_STREET_ORDER_CANCEL_REQUEST" + ) + ORIGINATION_TYPE_FIX_FROM_STREET_ORDER_UPDATE = ( + "ORIGINATION_TYPE_FIX_FROM_STREET_ORDER_UPDATE" + ) + ORIGINATION_TYPE_FIX_FROM_STREET_PARENT_ORDER = ( + "ORIGINATION_TYPE_FIX_FROM_STREET_PARENT_ORDER" + ) + ORIGINATION_TYPE_ORDER_MANAGER = "ORIGINATION_TYPE_ORDER_MANAGER" + ORIGINATION_TYPE_UNKNOWN = "ORIGINATION_TYPE_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/position.py b/openapi/openapi_project/openapi_package/models/position.py new file mode 100644 index 000000000..f415c0b56 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/position.py @@ -0,0 +1,193 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="Position") + + +@_attrs_define +class Position: + """ + Attributes: + account_id (Union[Unset, int]): + symbol (Union[Unset, str]): + avg_cost (Union[Unset, float]): + marked_cost (Union[Unset, float]): + net_qty (Union[Unset, float]): + notional_value (Union[Unset, float]): + opening_cost (Union[Unset, float]): + opening_qty (Union[Unset, float]): + realized_pn_l (Union[Unset, float]): + trading_avg_cost (Union[Unset, float]): + trading_buy_avg_price (Union[Unset, float]): + trading_buy_qty (Union[Unset, float]): + trading_net_qty (Union[Unset, float]): + trading_sell_avg_price (Union[Unset, float]): + trading_sell_qty (Union[Unset, float]): + trading_sell_qty_long (Union[Unset, float]): + trading_sell_qty_short (Union[Unset, float]): + transact_ts (Union[Unset, str]): + """ + + account_id: Unset | int = UNSET + symbol: Unset | str = UNSET + avg_cost: Unset | float = UNSET + marked_cost: Unset | float = UNSET + net_qty: Unset | float = UNSET + notional_value: Unset | float = UNSET + opening_cost: Unset | float = UNSET + opening_qty: Unset | float = UNSET + realized_pn_l: Unset | float = UNSET + trading_avg_cost: Unset | float = UNSET + trading_buy_avg_price: Unset | float = UNSET + trading_buy_qty: Unset | float = UNSET + trading_net_qty: Unset | float = UNSET + trading_sell_avg_price: Unset | float = UNSET + trading_sell_qty: Unset | float = UNSET + trading_sell_qty_long: Unset | float = UNSET + trading_sell_qty_short: Unset | float = UNSET + transact_ts: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + symbol = self.symbol + + avg_cost = self.avg_cost + + marked_cost = self.marked_cost + + net_qty = self.net_qty + + notional_value = self.notional_value + + opening_cost = self.opening_cost + + opening_qty = self.opening_qty + + realized_pn_l = self.realized_pn_l + + trading_avg_cost = self.trading_avg_cost + + trading_buy_avg_price = self.trading_buy_avg_price + + trading_buy_qty = self.trading_buy_qty + + trading_net_qty = self.trading_net_qty + + trading_sell_avg_price = self.trading_sell_avg_price + + trading_sell_qty = self.trading_sell_qty + + trading_sell_qty_long = self.trading_sell_qty_long + + trading_sell_qty_short = self.trading_sell_qty_short + + transact_ts = self.transact_ts + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if symbol is not UNSET: + field_dict["symbol"] = symbol + if avg_cost is not UNSET: + field_dict["avgCost"] = avg_cost + if marked_cost is not UNSET: + field_dict["markedCost"] = marked_cost + if net_qty is not UNSET: + field_dict["netQty"] = net_qty + if notional_value is not UNSET: + field_dict["notionalValue"] = notional_value + if opening_cost is not UNSET: + field_dict["openingCost"] = opening_cost + if opening_qty is not UNSET: + field_dict["openingQty"] = opening_qty + if realized_pn_l is not UNSET: + field_dict["realizedPnL"] = realized_pn_l + if trading_avg_cost is not UNSET: + field_dict["tradingAvgCost"] = trading_avg_cost + if trading_buy_avg_price is not UNSET: + field_dict["tradingBuyAvgPrice"] = trading_buy_avg_price + if trading_buy_qty is not UNSET: + field_dict["tradingBuyQty"] = trading_buy_qty + if trading_net_qty is not UNSET: + field_dict["tradingNetQty"] = trading_net_qty + if trading_sell_avg_price is not UNSET: + field_dict["tradingSellAvgPrice"] = trading_sell_avg_price + if trading_sell_qty is not UNSET: + field_dict["tradingSellQty"] = trading_sell_qty + if trading_sell_qty_long is not UNSET: + field_dict["tradingSellQtyLong"] = trading_sell_qty_long + if trading_sell_qty_short is not UNSET: + field_dict["tradingSellQtyShort"] = trading_sell_qty_short + if transact_ts is not UNSET: + field_dict["transactTs"] = transact_ts + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + symbol = d.pop("symbol", UNSET) + + avg_cost = d.pop("avgCost", UNSET) + + marked_cost = d.pop("markedCost", UNSET) + + net_qty = d.pop("netQty", UNSET) + + notional_value = d.pop("notionalValue", UNSET) + + opening_cost = d.pop("openingCost", UNSET) + + opening_qty = d.pop("openingQty", UNSET) + + realized_pn_l = d.pop("realizedPnL", UNSET) + + trading_avg_cost = d.pop("tradingAvgCost", UNSET) + + trading_buy_avg_price = d.pop("tradingBuyAvgPrice", UNSET) + + trading_buy_qty = d.pop("tradingBuyQty", UNSET) + + trading_net_qty = d.pop("tradingNetQty", UNSET) + + trading_sell_avg_price = d.pop("tradingSellAvgPrice", UNSET) + + trading_sell_qty = d.pop("tradingSellQty", UNSET) + + trading_sell_qty_long = d.pop("tradingSellQtyLong", UNSET) + + trading_sell_qty_short = d.pop("tradingSellQtyShort", UNSET) + + transact_ts = d.pop("transactTs", UNSET) + + position = cls( + account_id=account_id, + symbol=symbol, + avg_cost=avg_cost, + marked_cost=marked_cost, + net_qty=net_qty, + notional_value=notional_value, + opening_cost=opening_cost, + opening_qty=opening_qty, + realized_pn_l=realized_pn_l, + trading_avg_cost=trading_avg_cost, + trading_buy_avg_price=trading_buy_avg_price, + trading_buy_qty=trading_buy_qty, + trading_net_qty=trading_net_qty, + trading_sell_avg_price=trading_sell_avg_price, + trading_sell_qty=trading_sell_qty, + trading_sell_qty_long=trading_sell_qty_long, + trading_sell_qty_short=trading_sell_qty_short, + transact_ts=transact_ts, + ) + + return position diff --git a/openapi/openapi_project/openapi_package/models/position_analysis.py b/openapi/openapi_project/openapi_package/models/position_analysis.py new file mode 100644 index 000000000..27a6fe63a --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/position_analysis.py @@ -0,0 +1,74 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.position_theo import PositionTheo + from ..models.scenario_theo import ScenarioTheo + + +T = TypeVar("T", bound="PositionAnalysis") + + +@_attrs_define +class PositionAnalysis: + """ + Attributes: + position_theo (Union[Unset, PositionTheo]): + scenario_theos (Union[Unset, list['ScenarioTheo']]): + """ + + position_theo: Union[Unset, "PositionTheo"] = UNSET + scenario_theos: Unset | list["ScenarioTheo"] = UNSET + + def to_dict(self) -> dict[str, Any]: + position_theo: Unset | dict[str, Any] = UNSET + if not isinstance(self.position_theo, Unset): + position_theo = self.position_theo.to_dict() + + scenario_theos: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.scenario_theos, Unset): + scenario_theos = [] + for scenario_theos_item_data in self.scenario_theos: + scenario_theos_item = scenario_theos_item_data.to_dict() + scenario_theos.append(scenario_theos_item) + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if position_theo is not UNSET: + field_dict["positionTheo"] = position_theo + if scenario_theos is not UNSET: + field_dict["scenarioTheos"] = scenario_theos + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.position_theo import PositionTheo + from ..models.scenario_theo import ScenarioTheo + + d = dict(src_dict) + _position_theo = d.pop("positionTheo", UNSET) + position_theo: Unset | PositionTheo + if isinstance(_position_theo, Unset): + position_theo = UNSET + else: + position_theo = PositionTheo.from_dict(_position_theo) + + scenario_theos = [] + _scenario_theos = d.pop("scenarioTheos", UNSET) + for scenario_theos_item_data in _scenario_theos or []: + scenario_theos_item = ScenarioTheo.from_dict(scenario_theos_item_data) + + scenario_theos.append(scenario_theos_item) + + position_analysis = cls( + position_theo=position_theo, + scenario_theos=scenario_theos, + ) + + return position_analysis diff --git a/openapi/openapi_project/openapi_package/models/position_effect.py b/openapi/openapi_project/openapi_package/models/position_effect.py new file mode 100644 index 000000000..0441467a8 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/position_effect.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class PositionEffect(str, Enum): + POSITION_EFFECT_AUTO = "POSITION_EFFECT_AUTO" + POSITION_EFFECT_CLOSE = "POSITION_EFFECT_CLOSE" + POSITION_EFFECT_NONE = "POSITION_EFFECT_NONE" + POSITION_EFFECT_OPEN = "POSITION_EFFECT_OPEN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/position_source.py b/openapi/openapi_project/openapi_package/models/position_source.py new file mode 100644 index 000000000..881fcceaa --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/position_source.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class PositionSource(str, Enum): + POSITION_SOURCE_FROM_PORTFOLIO = "POSITION_SOURCE_FROM_PORTFOLIO" + POSITION_SOURCE_FROM_REQUEST = "POSITION_SOURCE_FROM_REQUEST" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/position_theo.py b/openapi/openapi_project/openapi_package/models/position_theo.py new file mode 100644 index 000000000..dd434eb3f --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/position_theo.py @@ -0,0 +1,206 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.position_theo_leg import PositionTheoLeg + + +T = TypeVar("T", bound="PositionTheo") + + +@_attrs_define +class PositionTheo: + """ + Attributes: + as_of_ts (Union[Unset, str]): + delta (Union[Unset, float]): + gamma (Union[Unset, float]): + legs (Union[Unset, list['PositionTheoLeg']]): + max_loss (Union[Unset, float]): + max_loss_lsd (Union[Unset, list[float]]): + max_profit (Union[Unset, float]): + max_profit_lsd (Union[Unset, list[float]]): + prem (Union[Unset, float]): + price (Union[Unset, float]): + profit (Union[Unset, float]): + profit_probability (Union[Unset, list[float]]): + rho (Union[Unset, float]): + theta (Union[Unset, float]): + total_value (Union[Unset, float]): + vega (Union[Unset, float]): + volatility (Union[Unset, float]): + """ + + as_of_ts: Unset | str = UNSET + delta: Unset | float = UNSET + gamma: Unset | float = UNSET + legs: Unset | list["PositionTheoLeg"] = UNSET + max_loss: Unset | float = UNSET + max_loss_lsd: Unset | list[float] = UNSET + max_profit: Unset | float = UNSET + max_profit_lsd: Unset | list[float] = UNSET + prem: Unset | float = UNSET + price: Unset | float = UNSET + profit: Unset | float = UNSET + profit_probability: Unset | list[float] = UNSET + rho: Unset | float = UNSET + theta: Unset | float = UNSET + total_value: Unset | float = UNSET + vega: Unset | float = UNSET + volatility: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + as_of_ts = self.as_of_ts + + delta = self.delta + + gamma = self.gamma + + legs: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.legs, Unset): + legs = [] + for legs_item_data in self.legs: + legs_item = legs_item_data.to_dict() + legs.append(legs_item) + + max_loss = self.max_loss + + max_loss_lsd: Unset | list[float] = UNSET + if not isinstance(self.max_loss_lsd, Unset): + max_loss_lsd = self.max_loss_lsd + + max_profit = self.max_profit + + max_profit_lsd: Unset | list[float] = UNSET + if not isinstance(self.max_profit_lsd, Unset): + max_profit_lsd = self.max_profit_lsd + + prem = self.prem + + price = self.price + + profit = self.profit + + profit_probability: Unset | list[float] = UNSET + if not isinstance(self.profit_probability, Unset): + profit_probability = self.profit_probability + + rho = self.rho + + theta = self.theta + + total_value = self.total_value + + vega = self.vega + + volatility = self.volatility + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if as_of_ts is not UNSET: + field_dict["asOfTs"] = as_of_ts + if delta is not UNSET: + field_dict["delta"] = delta + if gamma is not UNSET: + field_dict["gamma"] = gamma + if legs is not UNSET: + field_dict["legs"] = legs + if max_loss is not UNSET: + field_dict["maxLoss"] = max_loss + if max_loss_lsd is not UNSET: + field_dict["maxLossLsd"] = max_loss_lsd + if max_profit is not UNSET: + field_dict["maxProfit"] = max_profit + if max_profit_lsd is not UNSET: + field_dict["maxProfitLsd"] = max_profit_lsd + if prem is not UNSET: + field_dict["prem"] = prem + if price is not UNSET: + field_dict["price"] = price + if profit is not UNSET: + field_dict["profit"] = profit + if profit_probability is not UNSET: + field_dict["profitProbability"] = profit_probability + if rho is not UNSET: + field_dict["rho"] = rho + if theta is not UNSET: + field_dict["theta"] = theta + if total_value is not UNSET: + field_dict["totalValue"] = total_value + if vega is not UNSET: + field_dict["vega"] = vega + if volatility is not UNSET: + field_dict["volatility"] = volatility + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.position_theo_leg import PositionTheoLeg + + d = dict(src_dict) + as_of_ts = d.pop("asOfTs", UNSET) + + delta = d.pop("delta", UNSET) + + gamma = d.pop("gamma", UNSET) + + legs = [] + _legs = d.pop("legs", UNSET) + for legs_item_data in _legs or []: + legs_item = PositionTheoLeg.from_dict(legs_item_data) + + legs.append(legs_item) + + max_loss = d.pop("maxLoss", UNSET) + + max_loss_lsd = cast(list[float], d.pop("maxLossLsd", UNSET)) + + max_profit = d.pop("maxProfit", UNSET) + + max_profit_lsd = cast(list[float], d.pop("maxProfitLsd", UNSET)) + + prem = d.pop("prem", UNSET) + + price = d.pop("price", UNSET) + + profit = d.pop("profit", UNSET) + + profit_probability = cast(list[float], d.pop("profitProbability", UNSET)) + + rho = d.pop("rho", UNSET) + + theta = d.pop("theta", UNSET) + + total_value = d.pop("totalValue", UNSET) + + vega = d.pop("vega", UNSET) + + volatility = d.pop("volatility", UNSET) + + position_theo = cls( + as_of_ts=as_of_ts, + delta=delta, + gamma=gamma, + legs=legs, + max_loss=max_loss, + max_loss_lsd=max_loss_lsd, + max_profit=max_profit, + max_profit_lsd=max_profit_lsd, + prem=prem, + price=price, + profit=profit, + profit_probability=profit_probability, + rho=rho, + theta=theta, + total_value=total_value, + vega=vega, + volatility=volatility, + ) + + return position_theo diff --git a/openapi/openapi_project/openapi_package/models/position_theo_leg.py b/openapi/openapi_project/openapi_package/models/position_theo_leg.py new file mode 100644 index 000000000..0ffe36634 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/position_theo_leg.py @@ -0,0 +1,154 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PositionTheoLeg") + + +@_attrs_define +class PositionTheoLeg: + """ + Attributes: + delta (Union[Unset, float]): + gamma (Union[Unset, float]): + max_loss (Union[Unset, float]): + max_loss_lsd (Union[Unset, list[float]]): + max_profit (Union[Unset, float]): + max_profit_lsd (Union[Unset, list[float]]): + prem (Union[Unset, float]): + profit (Union[Unset, float]): + profit_probability (Union[Unset, list[float]]): + rho (Union[Unset, float]): + theta (Union[Unset, float]): + vega (Union[Unset, float]): + volatility (Union[Unset, float]): + """ + + delta: Unset | float = UNSET + gamma: Unset | float = UNSET + max_loss: Unset | float = UNSET + max_loss_lsd: Unset | list[float] = UNSET + max_profit: Unset | float = UNSET + max_profit_lsd: Unset | list[float] = UNSET + prem: Unset | float = UNSET + profit: Unset | float = UNSET + profit_probability: Unset | list[float] = UNSET + rho: Unset | float = UNSET + theta: Unset | float = UNSET + vega: Unset | float = UNSET + volatility: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + delta = self.delta + + gamma = self.gamma + + max_loss = self.max_loss + + max_loss_lsd: Unset | list[float] = UNSET + if not isinstance(self.max_loss_lsd, Unset): + max_loss_lsd = self.max_loss_lsd + + max_profit = self.max_profit + + max_profit_lsd: Unset | list[float] = UNSET + if not isinstance(self.max_profit_lsd, Unset): + max_profit_lsd = self.max_profit_lsd + + prem = self.prem + + profit = self.profit + + profit_probability: Unset | list[float] = UNSET + if not isinstance(self.profit_probability, Unset): + profit_probability = self.profit_probability + + rho = self.rho + + theta = self.theta + + vega = self.vega + + volatility = self.volatility + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if delta is not UNSET: + field_dict["delta"] = delta + if gamma is not UNSET: + field_dict["gamma"] = gamma + if max_loss is not UNSET: + field_dict["maxLoss"] = max_loss + if max_loss_lsd is not UNSET: + field_dict["maxLossLsd"] = max_loss_lsd + if max_profit is not UNSET: + field_dict["maxProfit"] = max_profit + if max_profit_lsd is not UNSET: + field_dict["maxProfitLsd"] = max_profit_lsd + if prem is not UNSET: + field_dict["prem"] = prem + if profit is not UNSET: + field_dict["profit"] = profit + if profit_probability is not UNSET: + field_dict["profitProbability"] = profit_probability + if rho is not UNSET: + field_dict["rho"] = rho + if theta is not UNSET: + field_dict["theta"] = theta + if vega is not UNSET: + field_dict["vega"] = vega + if volatility is not UNSET: + field_dict["volatility"] = volatility + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + delta = d.pop("delta", UNSET) + + gamma = d.pop("gamma", UNSET) + + max_loss = d.pop("maxLoss", UNSET) + + max_loss_lsd = cast(list[float], d.pop("maxLossLsd", UNSET)) + + max_profit = d.pop("maxProfit", UNSET) + + max_profit_lsd = cast(list[float], d.pop("maxProfitLsd", UNSET)) + + prem = d.pop("prem", UNSET) + + profit = d.pop("profit", UNSET) + + profit_probability = cast(list[float], d.pop("profitProbability", UNSET)) + + rho = d.pop("rho", UNSET) + + theta = d.pop("theta", UNSET) + + vega = d.pop("vega", UNSET) + + volatility = d.pop("volatility", UNSET) + + position_theo_leg = cls( + delta=delta, + gamma=gamma, + max_loss=max_loss, + max_loss_lsd=max_loss_lsd, + max_profit=max_profit, + max_profit_lsd=max_profit_lsd, + prem=prem, + profit=profit, + profit_probability=profit_probability, + rho=rho, + theta=theta, + vega=vega, + volatility=volatility, + ) + + return position_theo_leg diff --git a/openapi/openapi_project/openapi_package/models/price_type.py b/openapi/openapi_project/openapi_package/models/price_type.py new file mode 100644 index 000000000..c277980ed --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/price_type.py @@ -0,0 +1,14 @@ +from enum import Enum + + +class PriceType(str, Enum): + PRICE_TYPE_CABINET = "PRICE_TYPE_CABINET" + PRICE_TYPE_D_A_C = "PRICE_TYPE_D_A_C" + PRICE_TYPE_FIXED_AMT = "PRICE_TYPE_FIXED_AMT" + PRICE_TYPE_PERCENTAGE = "PRICE_TYPE_PERCENTAGE" + PRICE_TYPE_PER_UNIT = "PRICE_TYPE_PER_UNIT" + PRICE_TYPE_UNKNOWN = "PRICE_TYPE_UNKNOWN" + PRICE_TYPE_YIELD = "PRICE_TYPE_YIELD" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/product_group.py b/openapi/openapi_project/openapi_package/models/product_group.py new file mode 100644 index 000000000..aa90857b8 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/product_group.py @@ -0,0 +1,19 @@ +from enum import Enum + + +class ProductGroup(str, Enum): + PRODUCT_GROUP_AGRICULTURAL = "PRODUCT_GROUP_AGRICULTURAL" + PRODUCT_GROUP_ALTERNATIVE_MARKETS = "PRODUCT_GROUP_ALTERNATIVE_MARKETS" + PRODUCT_GROUP_CURRENCY = "PRODUCT_GROUP_CURRENCY" + PRODUCT_GROUP_ENERGY = "PRODUCT_GROUP_ENERGY" + PRODUCT_GROUP_EQUITIES = "PRODUCT_GROUP_EQUITIES" + PRODUCT_GROUP_FINANCIAL = "PRODUCT_GROUP_FINANCIAL" + PRODUCT_GROUP_INDEX = "PRODUCT_GROUP_INDEX" + PRODUCT_GROUP_INTEREST_RATE = "PRODUCT_GROUP_INTEREST_RATE" + PRODUCT_GROUP_METAL = "PRODUCT_GROUP_METAL" + PRODUCT_GROUP_REAL_ESTATE = "PRODUCT_GROUP_REAL_ESTATE" + PRODUCT_GROUP_UNKNOWN = "PRODUCT_GROUP_UNKNOWN" + PRODUCT_GROUP_WEATHER = "PRODUCT_GROUP_WEATHER" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/product_sub_group.py b/openapi/openapi_project/openapi_package/models/product_sub_group.py new file mode 100644 index 000000000..5acb9ee95 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/product_sub_group.py @@ -0,0 +1,8 @@ +from enum import Enum + + +class ProductSubGroup(str, Enum): + PRODUCT_SUB_GROUP_UNKNOWN = "PRODUCT_SUB_GROUP_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/put_call.py b/openapi/openapi_project/openapi_package/models/put_call.py new file mode 100644 index 000000000..680cfcf36 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/put_call.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class PutCall(str, Enum): + PUT_CALL_CALL = "PUT_CALL_CALL" + PUT_CALL_PUT = "PUT_CALL_PUT" + PUT_CALL_UNDEFINED = "PUT_CALL_UNDEFINED" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/risk_calculation_type.py b/openapi/openapi_project/openapi_package/models/risk_calculation_type.py new file mode 100644 index 000000000..1b51d3094 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/risk_calculation_type.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class RiskCalculationType(str, Enum): + RISK_CALCULATION_TYPE_ACCOUNT = "RISK_CALCULATION_TYPE_ACCOUNT" + RISK_CALCULATION_TYPE_TRADING_FIRM = "RISK_CALCULATION_TYPE_TRADING_FIRM" + RISK_CALCULATION_TYPE_UNKNOWN = "RISK_CALCULATION_TYPE_UNKNOWN" + RISK_CALCULATION_TYPE_USER = "RISK_CALCULATION_TYPE_USER" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/risk_eval_mode.py b/openapi/openapi_project/openapi_package/models/risk_eval_mode.py new file mode 100644 index 000000000..c44b177fd --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/risk_eval_mode.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class RiskEvalMode(str, Enum): + RISK_EVAL_MODE_END_OF_DAY = "RISK_EVAL_MODE_END_OF_DAY" + RISK_EVAL_MODE_REAL_TIME = "RISK_EVAL_MODE_REAL_TIME" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_account_group.py b/openapi/openapi_project/openapi_package/models/risk_radar_account_group.py new file mode 100644 index 000000000..272b18685 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/risk_radar_account_group.py @@ -0,0 +1,114 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.currency import Currency +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.risk_radar_product_group import RiskRadarProductGroup + from ..models.shock_value import ShockValue + + +T = TypeVar("T", bound="RiskRadarAccountGroup") + + +@_attrs_define +class RiskRadarAccountGroup: + """ + Attributes: + account_id (Union[Unset, int]): + currency (Union[Unset, Currency]): + nav (Union[Unset, float]): + product_groups (Union[Unset, list['RiskRadarProductGroup']]): + shock_values (Union[Unset, list['ShockValue']]): + """ + + account_id: Unset | int = UNSET + currency: Unset | Currency = UNSET + nav: Unset | float = UNSET + product_groups: Unset | list["RiskRadarProductGroup"] = UNSET + shock_values: Unset | list["ShockValue"] = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + nav = self.nav + + product_groups: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.product_groups, Unset): + product_groups = [] + for product_groups_item_data in self.product_groups: + product_groups_item = product_groups_item_data.to_dict() + product_groups.append(product_groups_item) + + shock_values: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.shock_values, Unset): + shock_values = [] + for shock_values_item_data in self.shock_values: + shock_values_item = shock_values_item_data.to_dict() + shock_values.append(shock_values_item) + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if currency is not UNSET: + field_dict["currency"] = currency + if nav is not UNSET: + field_dict["nav"] = nav + if product_groups is not UNSET: + field_dict["productGroups"] = product_groups + if shock_values is not UNSET: + field_dict["shockValues"] = shock_values + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.risk_radar_product_group import RiskRadarProductGroup + from ..models.shock_value import ShockValue + + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + nav = d.pop("nav", UNSET) + + product_groups = [] + _product_groups = d.pop("productGroups", UNSET) + for product_groups_item_data in _product_groups or []: + product_groups_item = RiskRadarProductGroup.from_dict( + product_groups_item_data + ) + + product_groups.append(product_groups_item) + + shock_values = [] + _shock_values = d.pop("shockValues", UNSET) + for shock_values_item_data in _shock_values or []: + shock_values_item = ShockValue.from_dict(shock_values_item_data) + + shock_values.append(shock_values_item) + + risk_radar_account_group = cls( + account_id=account_id, + currency=currency, + nav=nav, + product_groups=product_groups, + shock_values=shock_values, + ) + + return risk_radar_account_group diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_class_group.py b/openapi/openapi_project/openapi_package/models/risk_radar_class_group.py new file mode 100644 index 000000000..8b97bd70c --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/risk_radar_class_group.py @@ -0,0 +1,178 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.risk_radar_position import RiskRadarPosition + from ..models.shock_value import ShockValue + + +T = TypeVar("T", bound="RiskRadarClassGroup") + + +@_attrs_define +class RiskRadarClassGroup: + """ + Attributes: + delta (Union[Unset, float]): + dollar_delta (Union[Unset, float]): + dollar_gamma (Union[Unset, float]): + gamma (Union[Unset, float]): + nav (Union[Unset, float]): + price (Union[Unset, float]): + rho (Union[Unset, float]): + shock_keys (Union[Unset, list[float]]): + shock_values (Union[Unset, list['ShockValue']]): + symbol (Union[Unset, str]): + theta (Union[Unset, float]): + vega (Union[Unset, float]): + positions (Union[Unset, list['RiskRadarPosition']]): + """ + + delta: Unset | float = UNSET + dollar_delta: Unset | float = UNSET + dollar_gamma: Unset | float = UNSET + gamma: Unset | float = UNSET + nav: Unset | float = UNSET + price: Unset | float = UNSET + rho: Unset | float = UNSET + shock_keys: Unset | list[float] = UNSET + shock_values: Unset | list["ShockValue"] = UNSET + symbol: Unset | str = UNSET + theta: Unset | float = UNSET + vega: Unset | float = UNSET + positions: Unset | list["RiskRadarPosition"] = UNSET + + def to_dict(self) -> dict[str, Any]: + delta = self.delta + + dollar_delta = self.dollar_delta + + dollar_gamma = self.dollar_gamma + + gamma = self.gamma + + nav = self.nav + + price = self.price + + rho = self.rho + + shock_keys: Unset | list[float] = UNSET + if not isinstance(self.shock_keys, Unset): + shock_keys = self.shock_keys + + shock_values: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.shock_values, Unset): + shock_values = [] + for shock_values_item_data in self.shock_values: + shock_values_item = shock_values_item_data.to_dict() + shock_values.append(shock_values_item) + + symbol = self.symbol + + theta = self.theta + + vega = self.vega + + positions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.positions, Unset): + positions = [] + for positions_item_data in self.positions: + positions_item = positions_item_data.to_dict() + positions.append(positions_item) + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if delta is not UNSET: + field_dict["delta"] = delta + if dollar_delta is not UNSET: + field_dict["dollarDelta"] = dollar_delta + if dollar_gamma is not UNSET: + field_dict["dollarGamma"] = dollar_gamma + if gamma is not UNSET: + field_dict["gamma"] = gamma + if nav is not UNSET: + field_dict["nav"] = nav + if price is not UNSET: + field_dict["price"] = price + if rho is not UNSET: + field_dict["rho"] = rho + if shock_keys is not UNSET: + field_dict["shockKeys"] = shock_keys + if shock_values is not UNSET: + field_dict["shockValues"] = shock_values + if symbol is not UNSET: + field_dict["symbol"] = symbol + if theta is not UNSET: + field_dict["theta"] = theta + if vega is not UNSET: + field_dict["vega"] = vega + if positions is not UNSET: + field_dict["positions"] = positions + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.risk_radar_position import RiskRadarPosition + from ..models.shock_value import ShockValue + + d = dict(src_dict) + delta = d.pop("delta", UNSET) + + dollar_delta = d.pop("dollarDelta", UNSET) + + dollar_gamma = d.pop("dollarGamma", UNSET) + + gamma = d.pop("gamma", UNSET) + + nav = d.pop("nav", UNSET) + + price = d.pop("price", UNSET) + + rho = d.pop("rho", UNSET) + + shock_keys = cast(list[float], d.pop("shockKeys", UNSET)) + + shock_values = [] + _shock_values = d.pop("shockValues", UNSET) + for shock_values_item_data in _shock_values or []: + shock_values_item = ShockValue.from_dict(shock_values_item_data) + + shock_values.append(shock_values_item) + + symbol = d.pop("symbol", UNSET) + + theta = d.pop("theta", UNSET) + + vega = d.pop("vega", UNSET) + + positions = [] + _positions = d.pop("positions", UNSET) + for positions_item_data in _positions or []: + positions_item = RiskRadarPosition.from_dict(positions_item_data) + + positions.append(positions_item) + + risk_radar_class_group = cls( + delta=delta, + dollar_delta=dollar_delta, + dollar_gamma=dollar_gamma, + gamma=gamma, + nav=nav, + price=price, + rho=rho, + shock_keys=shock_keys, + shock_values=shock_values, + symbol=symbol, + theta=theta, + vega=vega, + positions=positions, + ) + + return risk_radar_class_group diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_data.py b/openapi/openapi_project/openapi_package/models/risk_radar_data.py new file mode 100644 index 000000000..817b995f1 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/risk_radar_data.py @@ -0,0 +1,67 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.risk_radar_account_group import RiskRadarAccountGroup + + +T = TypeVar("T", bound="RiskRadarData") + + +@_attrs_define +class RiskRadarData: + """ + Attributes: + risks_result (Union[Unset, list['RiskRadarAccountGroup']]): + shock_keys (Union[Unset, list[str]]): + """ + + risks_result: Unset | list["RiskRadarAccountGroup"] = UNSET + shock_keys: Unset | list[str] = UNSET + + def to_dict(self) -> dict[str, Any]: + risks_result: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.risks_result, Unset): + risks_result = [] + for risks_result_item_data in self.risks_result: + risks_result_item = risks_result_item_data.to_dict() + risks_result.append(risks_result_item) + + shock_keys: Unset | list[str] = UNSET + if not isinstance(self.shock_keys, Unset): + shock_keys = self.shock_keys + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if risks_result is not UNSET: + field_dict["risksResult"] = risks_result + if shock_keys is not UNSET: + field_dict["shockKeys"] = shock_keys + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.risk_radar_account_group import RiskRadarAccountGroup + + d = dict(src_dict) + risks_result = [] + _risks_result = d.pop("risksResult", UNSET) + for risks_result_item_data in _risks_result or []: + risks_result_item = RiskRadarAccountGroup.from_dict(risks_result_item_data) + + risks_result.append(risks_result_item) + + shock_keys = cast(list[str], d.pop("shockKeys", UNSET)) + + risk_radar_data = cls( + risks_result=risks_result, + shock_keys=shock_keys, + ) + + return risk_radar_data diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_position.py b/openapi/openapi_project/openapi_package/models/risk_radar_position.py new file mode 100644 index 000000000..f78032469 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/risk_radar_position.py @@ -0,0 +1,182 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.shock_value import ShockValue + + +T = TypeVar("T", bound="RiskRadarPosition") + + +@_attrs_define +class RiskRadarPosition: + """ + Attributes: + delta (Union[Unset, float]): + dollar_delta (Union[Unset, float]): + dollar_gamma (Union[Unset, float]): + gamma (Union[Unset, float]): + nav (Union[Unset, float]): + price (Union[Unset, float]): + p_zero (Union[Unset, float]): + rho (Union[Unset, float]): + shock_values (Union[Unset, list['ShockValue']]): + symbol (Union[Unset, str]): + theta (Union[Unset, float]): + vega (Union[Unset, float]): + rpg_root (Union[Unset, str]): + qty (Union[Unset, float]): + implied_volatility (Union[Unset, float]): + """ + + delta: Unset | float = UNSET + dollar_delta: Unset | float = UNSET + dollar_gamma: Unset | float = UNSET + gamma: Unset | float = UNSET + nav: Unset | float = UNSET + price: Unset | float = UNSET + p_zero: Unset | float = UNSET + rho: Unset | float = UNSET + shock_values: Unset | list["ShockValue"] = UNSET + symbol: Unset | str = UNSET + theta: Unset | float = UNSET + vega: Unset | float = UNSET + rpg_root: Unset | str = UNSET + qty: Unset | float = UNSET + implied_volatility: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + delta = self.delta + + dollar_delta = self.dollar_delta + + dollar_gamma = self.dollar_gamma + + gamma = self.gamma + + nav = self.nav + + price = self.price + + p_zero = self.p_zero + + rho = self.rho + + shock_values: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.shock_values, Unset): + shock_values = [] + for shock_values_item_data in self.shock_values: + shock_values_item = shock_values_item_data.to_dict() + shock_values.append(shock_values_item) + + symbol = self.symbol + + theta = self.theta + + vega = self.vega + + rpg_root = self.rpg_root + + qty = self.qty + + implied_volatility = self.implied_volatility + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if delta is not UNSET: + field_dict["delta"] = delta + if dollar_delta is not UNSET: + field_dict["dollarDelta"] = dollar_delta + if dollar_gamma is not UNSET: + field_dict["dollarGamma"] = dollar_gamma + if gamma is not UNSET: + field_dict["gamma"] = gamma + if nav is not UNSET: + field_dict["nav"] = nav + if price is not UNSET: + field_dict["price"] = price + if p_zero is not UNSET: + field_dict["pZero"] = p_zero + if rho is not UNSET: + field_dict["rho"] = rho + if shock_values is not UNSET: + field_dict["shockValues"] = shock_values + if symbol is not UNSET: + field_dict["symbol"] = symbol + if theta is not UNSET: + field_dict["theta"] = theta + if vega is not UNSET: + field_dict["vega"] = vega + if rpg_root is not UNSET: + field_dict["rpgRoot"] = rpg_root + if qty is not UNSET: + field_dict["qty"] = qty + if implied_volatility is not UNSET: + field_dict["impliedVolatility"] = implied_volatility + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.shock_value import ShockValue + + d = dict(src_dict) + delta = d.pop("delta", UNSET) + + dollar_delta = d.pop("dollarDelta", UNSET) + + dollar_gamma = d.pop("dollarGamma", UNSET) + + gamma = d.pop("gamma", UNSET) + + nav = d.pop("nav", UNSET) + + price = d.pop("price", UNSET) + + p_zero = d.pop("pZero", UNSET) + + rho = d.pop("rho", UNSET) + + shock_values = [] + _shock_values = d.pop("shockValues", UNSET) + for shock_values_item_data in _shock_values or []: + shock_values_item = ShockValue.from_dict(shock_values_item_data) + + shock_values.append(shock_values_item) + + symbol = d.pop("symbol", UNSET) + + theta = d.pop("theta", UNSET) + + vega = d.pop("vega", UNSET) + + rpg_root = d.pop("rpgRoot", UNSET) + + qty = d.pop("qty", UNSET) + + implied_volatility = d.pop("impliedVolatility", UNSET) + + risk_radar_position = cls( + delta=delta, + dollar_delta=dollar_delta, + dollar_gamma=dollar_gamma, + gamma=gamma, + nav=nav, + price=price, + p_zero=p_zero, + rho=rho, + shock_values=shock_values, + symbol=symbol, + theta=theta, + vega=vega, + rpg_root=rpg_root, + qty=qty, + implied_volatility=implied_volatility, + ) + + return risk_radar_position diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_product_group.py b/openapi/openapi_project/openapi_package/models/risk_radar_product_group.py new file mode 100644 index 000000000..64b00bdc3 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/risk_radar_product_group.py @@ -0,0 +1,104 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.risk_radar_class_group import RiskRadarClassGroup + from ..models.shock_value import ShockValue + + +T = TypeVar("T", bound="RiskRadarProductGroup") + + +@_attrs_define +class RiskRadarProductGroup: + """ + Attributes: + group (Union[Unset, str]): + nav (Union[Unset, float]): + class_groups (Union[Unset, list['RiskRadarClassGroup']]): + product_id (Union[Unset, str]): + shock_values (Union[Unset, list['ShockValue']]): + """ + + group: Unset | str = UNSET + nav: Unset | float = UNSET + class_groups: Unset | list["RiskRadarClassGroup"] = UNSET + product_id: Unset | str = UNSET + shock_values: Unset | list["ShockValue"] = UNSET + + def to_dict(self) -> dict[str, Any]: + group = self.group + + nav = self.nav + + class_groups: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.class_groups, Unset): + class_groups = [] + for class_groups_item_data in self.class_groups: + class_groups_item = class_groups_item_data.to_dict() + class_groups.append(class_groups_item) + + product_id = self.product_id + + shock_values: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.shock_values, Unset): + shock_values = [] + for shock_values_item_data in self.shock_values: + shock_values_item = shock_values_item_data.to_dict() + shock_values.append(shock_values_item) + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if group is not UNSET: + field_dict["group"] = group + if nav is not UNSET: + field_dict["nav"] = nav + if class_groups is not UNSET: + field_dict["classGroups"] = class_groups + if product_id is not UNSET: + field_dict["productId"] = product_id + if shock_values is not UNSET: + field_dict["shockValues"] = shock_values + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.risk_radar_class_group import RiskRadarClassGroup + from ..models.shock_value import ShockValue + + d = dict(src_dict) + group = d.pop("group", UNSET) + + nav = d.pop("nav", UNSET) + + class_groups = [] + _class_groups = d.pop("classGroups", UNSET) + for class_groups_item_data in _class_groups or []: + class_groups_item = RiskRadarClassGroup.from_dict(class_groups_item_data) + + class_groups.append(class_groups_item) + + product_id = d.pop("productId", UNSET) + + shock_values = [] + _shock_values = d.pop("shockValues", UNSET) + for shock_values_item_data in _shock_values or []: + shock_values_item = ShockValue.from_dict(shock_values_item_data) + + shock_values.append(shock_values_item) + + risk_radar_product_group = cls( + group=group, + nav=nav, + class_groups=class_groups, + product_id=product_id, + shock_values=shock_values, + ) + + return risk_radar_product_group diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_request.py b/openapi/openapi_project/openapi_package/models/risk_radar_request.py new file mode 100644 index 000000000..c9692ed41 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/risk_radar_request.py @@ -0,0 +1,194 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..models.position_source import PositionSource +from ..models.risk_eval_mode import RiskEvalMode +from ..models.risk_radar_scenario_order import RiskRadarScenarioOrder +from ..models.volatility_shock_skew import VolatilityShockSkew +from ..models.volatility_shock_type import VolatilityShockType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.risk_radar_request_position_list import RiskRadarRequestPositionList + + +T = TypeVar("T", bound="RiskRadarRequest") + + +@_attrs_define +class RiskRadarRequest: + """ + Attributes: + account_ids (Union[Unset, list[int]]): + positions_by_account_id (Union[Unset, list['RiskRadarRequestPositionList']]): + source (Union[Unset, PositionSource]): + range_ (Union[Unset, float]): + timestep (Union[Unset, str]): + scenario_order (Union[Unset, RiskRadarScenarioOrder]): + eval_mode (Union[Unset, RiskEvalMode]): + implied_volatility (Union[Unset, float]): + volatility_shock_skew (Union[Unset, VolatilityShockSkew]): + volatility_shock_type (Union[Unset, VolatilityShockType]): + exclude_expired_contracts (Union[Unset, bool]): + """ + + account_ids: Unset | list[int] = UNSET + positions_by_account_id: Unset | list["RiskRadarRequestPositionList"] = UNSET + source: Unset | PositionSource = UNSET + range_: Unset | float = UNSET + timestep: Unset | str = UNSET + scenario_order: Unset | RiskRadarScenarioOrder = UNSET + eval_mode: Unset | RiskEvalMode = UNSET + implied_volatility: Unset | float = UNSET + volatility_shock_skew: Unset | VolatilityShockSkew = UNSET + volatility_shock_type: Unset | VolatilityShockType = UNSET + exclude_expired_contracts: Unset | bool = UNSET + + def to_dict(self) -> dict[str, Any]: + account_ids: Unset | list[int] = UNSET + if not isinstance(self.account_ids, Unset): + account_ids = self.account_ids + + positions_by_account_id: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.positions_by_account_id, Unset): + positions_by_account_id = [] + for positions_by_account_id_item_data in self.positions_by_account_id: + positions_by_account_id_item = ( + positions_by_account_id_item_data.to_dict() + ) + positions_by_account_id.append(positions_by_account_id_item) + + source: Unset | str = UNSET + if not isinstance(self.source, Unset): + source = self.source.value + + range_ = self.range_ + + timestep = self.timestep + + scenario_order: Unset | str = UNSET + if not isinstance(self.scenario_order, Unset): + scenario_order = self.scenario_order.value + + eval_mode: Unset | str = UNSET + if not isinstance(self.eval_mode, Unset): + eval_mode = self.eval_mode.value + + implied_volatility = self.implied_volatility + + volatility_shock_skew: Unset | str = UNSET + if not isinstance(self.volatility_shock_skew, Unset): + volatility_shock_skew = self.volatility_shock_skew.value + + volatility_shock_type: Unset | str = UNSET + if not isinstance(self.volatility_shock_type, Unset): + volatility_shock_type = self.volatility_shock_type.value + + exclude_expired_contracts = self.exclude_expired_contracts + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_ids is not UNSET: + field_dict["accountIds"] = account_ids + if positions_by_account_id is not UNSET: + field_dict["positionsByAccountId"] = positions_by_account_id + if source is not UNSET: + field_dict["source"] = source + if range_ is not UNSET: + field_dict["range"] = range_ + if timestep is not UNSET: + field_dict["timestep"] = timestep + if scenario_order is not UNSET: + field_dict["scenarioOrder"] = scenario_order + if eval_mode is not UNSET: + field_dict["evalMode"] = eval_mode + if implied_volatility is not UNSET: + field_dict["impliedVolatility"] = implied_volatility + if volatility_shock_skew is not UNSET: + field_dict["volatilityShockSkew"] = volatility_shock_skew + if volatility_shock_type is not UNSET: + field_dict["volatilityShockType"] = volatility_shock_type + if exclude_expired_contracts is not UNSET: + field_dict["excludeExpiredContracts"] = exclude_expired_contracts + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.risk_radar_request_position_list import ( + RiskRadarRequestPositionList, + ) + + d = dict(src_dict) + account_ids = cast(list[int], d.pop("accountIds", UNSET)) + + positions_by_account_id = [] + _positions_by_account_id = d.pop("positionsByAccountId", UNSET) + for positions_by_account_id_item_data in _positions_by_account_id or []: + positions_by_account_id_item = RiskRadarRequestPositionList.from_dict( + positions_by_account_id_item_data + ) + + positions_by_account_id.append(positions_by_account_id_item) + + _source = d.pop("source", UNSET) + source: Unset | PositionSource + if isinstance(_source, Unset): + source = UNSET + else: + source = PositionSource(_source) + + range_ = d.pop("range", UNSET) + + timestep = d.pop("timestep", UNSET) + + _scenario_order = d.pop("scenarioOrder", UNSET) + scenario_order: Unset | RiskRadarScenarioOrder + if isinstance(_scenario_order, Unset): + scenario_order = UNSET + else: + scenario_order = RiskRadarScenarioOrder(_scenario_order) + + _eval_mode = d.pop("evalMode", UNSET) + eval_mode: Unset | RiskEvalMode + if isinstance(_eval_mode, Unset): + eval_mode = UNSET + else: + eval_mode = RiskEvalMode(_eval_mode) + + implied_volatility = d.pop("impliedVolatility", UNSET) + + _volatility_shock_skew = d.pop("volatilityShockSkew", UNSET) + volatility_shock_skew: Unset | VolatilityShockSkew + if isinstance(_volatility_shock_skew, Unset): + volatility_shock_skew = UNSET + else: + volatility_shock_skew = VolatilityShockSkew(_volatility_shock_skew) + + _volatility_shock_type = d.pop("volatilityShockType", UNSET) + volatility_shock_type: Unset | VolatilityShockType + if isinstance(_volatility_shock_type, Unset): + volatility_shock_type = UNSET + else: + volatility_shock_type = VolatilityShockType(_volatility_shock_type) + + exclude_expired_contracts = d.pop("excludeExpiredContracts", UNSET) + + risk_radar_request = cls( + account_ids=account_ids, + positions_by_account_id=positions_by_account_id, + source=source, + range_=range_, + timestep=timestep, + scenario_order=scenario_order, + eval_mode=eval_mode, + implied_volatility=implied_volatility, + volatility_shock_skew=volatility_shock_skew, + volatility_shock_type=volatility_shock_type, + exclude_expired_contracts=exclude_expired_contracts, + ) + + return risk_radar_request diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_request_position.py b/openapi/openapi_project/openapi_package/models/risk_radar_request_position.py new file mode 100644 index 000000000..42f339f4a --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/risk_radar_request_position.py @@ -0,0 +1,58 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="RiskRadarRequestPosition") + + +@_attrs_define +class RiskRadarRequestPosition: + """ + Attributes: + is_simulated_position (Union[Unset, bool]): + qty (Union[Unset, float]): + symbol (Union[Unset, str]): + """ + + is_simulated_position: Unset | bool = UNSET + qty: Unset | float = UNSET + symbol: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + is_simulated_position = self.is_simulated_position + + qty = self.qty + + symbol = self.symbol + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if is_simulated_position is not UNSET: + field_dict["isSimulatedPosition"] = is_simulated_position + if qty is not UNSET: + field_dict["qty"] = qty + if symbol is not UNSET: + field_dict["symbol"] = symbol + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + is_simulated_position = d.pop("isSimulatedPosition", UNSET) + + qty = d.pop("qty", UNSET) + + symbol = d.pop("symbol", UNSET) + + risk_radar_request_position = cls( + is_simulated_position=is_simulated_position, + qty=qty, + symbol=symbol, + ) + + return risk_radar_request_position diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_request_position_list.py b/openapi/openapi_project/openapi_package/models/risk_radar_request_position_list.py new file mode 100644 index 000000000..4510fb76d --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/risk_radar_request_position_list.py @@ -0,0 +1,65 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.risk_radar_request_position import RiskRadarRequestPosition + + +T = TypeVar("T", bound="RiskRadarRequestPositionList") + + +@_attrs_define +class RiskRadarRequestPositionList: + """ + Attributes: + account_id (Union[Unset, int]): + positions (Union[Unset, list['RiskRadarRequestPosition']]): + """ + + account_id: Unset | int = UNSET + positions: Unset | list["RiskRadarRequestPosition"] = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + positions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.positions, Unset): + positions = [] + for positions_item_data in self.positions: + positions_item = positions_item_data.to_dict() + positions.append(positions_item) + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if positions is not UNSET: + field_dict["positions"] = positions + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.risk_radar_request_position import RiskRadarRequestPosition + + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + positions = [] + _positions = d.pop("positions", UNSET) + for positions_item_data in _positions or []: + positions_item = RiskRadarRequestPosition.from_dict(positions_item_data) + + positions.append(positions_item) + + risk_radar_request_position_list = cls( + account_id=account_id, + positions=positions, + ) + + return risk_radar_request_position_list diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_response.py b/openapi/openapi_project/openapi_package/models/risk_radar_response.py new file mode 100644 index 000000000..833c7cf00 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/risk_radar_response.py @@ -0,0 +1,79 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.risk_radar_data import RiskRadarData + + +T = TypeVar("T", bound="RiskRadarResponse") + + +@_attrs_define +class RiskRadarResponse: + """ + Attributes: + result (Union[Unset, RiskRadarData]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + result: Union[Unset, "RiskRadarData"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + result: Unset | dict[str, Any] = UNSET + if not isinstance(self.result, Unset): + result = self.result.to_dict() + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if result is not UNSET: + field_dict["result"] = result + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.risk_radar_data import RiskRadarData + + d = dict(src_dict) + _result = d.pop("result", UNSET) + result: Unset | RiskRadarData + if isinstance(_result, Unset): + result = UNSET + else: + result = RiskRadarData.from_dict(_result) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + risk_radar_response = cls( + result=result, + error_message=error_message, + status_code=status_code, + ) + + return risk_radar_response diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_scenario_order.py b/openapi/openapi_project/openapi_package/models/risk_radar_scenario_order.py new file mode 100644 index 000000000..99a247430 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/risk_radar_scenario_order.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class RiskRadarScenarioOrder(str, Enum): + RISK_RADAR_SCENARIO_ORDER_SHOCK_FIRST = "RISK_RADAR_SCENARIO_ORDER_SHOCK_FIRST" + RISK_RADAR_SCENARIO_ORDER_STEP_FIRST = "RISK_RADAR_SCENARIO_ORDER_STEP_FIRST" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/risk_reject.py b/openapi/openapi_project/openapi_package/models/risk_reject.py new file mode 100644 index 000000000..72e28bb23 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/risk_reject.py @@ -0,0 +1,137 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.risk_calculation_type import RiskCalculationType +from ..models.risk_reject_type import RiskRejectType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="RiskReject") + + +@_attrs_define +class RiskReject: + """ + Attributes: + account_id (Union[Unset, int]): + guid (Union[Unset, str]): + id (Union[Unset, int]): + is_overridden (Union[Unset, bool]): + message (Union[Unset, str]): + order_id (Union[Unset, str]): + transact_ts (Union[Unset, str]): + calculation_type (Union[Unset, RiskCalculationType]): + reject_type (Union[Unset, RiskRejectType]): + user_id (Union[Unset, int]): + """ + + account_id: Unset | int = UNSET + guid: Unset | str = UNSET + id: Unset | int = UNSET + is_overridden: Unset | bool = UNSET + message: Unset | str = UNSET + order_id: Unset | str = UNSET + transact_ts: Unset | str = UNSET + calculation_type: Unset | RiskCalculationType = UNSET + reject_type: Unset | RiskRejectType = UNSET + user_id: Unset | int = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + guid = self.guid + + id = self.id + + is_overridden = self.is_overridden + + message = self.message + + order_id = self.order_id + + transact_ts = self.transact_ts + + calculation_type: Unset | str = UNSET + if not isinstance(self.calculation_type, Unset): + calculation_type = self.calculation_type.value + + reject_type: Unset | str = UNSET + if not isinstance(self.reject_type, Unset): + reject_type = self.reject_type.value + + user_id = self.user_id + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if guid is not UNSET: + field_dict["guid"] = guid + if id is not UNSET: + field_dict["id"] = id + if is_overridden is not UNSET: + field_dict["isOverridden"] = is_overridden + if message is not UNSET: + field_dict["message"] = message + if order_id is not UNSET: + field_dict["orderId"] = order_id + if transact_ts is not UNSET: + field_dict["transactTs"] = transact_ts + if calculation_type is not UNSET: + field_dict["calculationType"] = calculation_type + if reject_type is not UNSET: + field_dict["rejectType"] = reject_type + if user_id is not UNSET: + field_dict["userId"] = user_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + guid = d.pop("guid", UNSET) + + id = d.pop("id", UNSET) + + is_overridden = d.pop("isOverridden", UNSET) + + message = d.pop("message", UNSET) + + order_id = d.pop("orderId", UNSET) + + transact_ts = d.pop("transactTs", UNSET) + + _calculation_type = d.pop("calculationType", UNSET) + calculation_type: Unset | RiskCalculationType + if isinstance(_calculation_type, Unset): + calculation_type = UNSET + else: + calculation_type = RiskCalculationType(_calculation_type) + + _reject_type = d.pop("rejectType", UNSET) + reject_type: Unset | RiskRejectType + if isinstance(_reject_type, Unset): + reject_type = UNSET + else: + reject_type = RiskRejectType(_reject_type) + + user_id = d.pop("userId", UNSET) + + risk_reject = cls( + account_id=account_id, + guid=guid, + id=id, + is_overridden=is_overridden, + message=message, + order_id=order_id, + transact_ts=transact_ts, + calculation_type=calculation_type, + reject_type=reject_type, + user_id=user_id, + ) + + return risk_reject diff --git a/openapi/openapi_project/openapi_package/models/risk_reject_type.py b/openapi/openapi_project/openapi_package/models/risk_reject_type.py new file mode 100644 index 000000000..eed836c58 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/risk_reject_type.py @@ -0,0 +1,120 @@ +from enum import Enum + + +class RiskRejectType(str, Enum): + RISK_REJECT_TYPE_ACCOUNT_INACTIVE = "RISK_REJECT_TYPE_ACCOUNT_INACTIVE" + RISK_REJECT_TYPE_ACCOUNT_IN_LIQUIDATION = "RISK_REJECT_TYPE_ACCOUNT_IN_LIQUIDATION" + RISK_REJECT_TYPE_ACCOUNT_MAX_LOSS = "RISK_REJECT_TYPE_ACCOUNT_MAX_LOSS" + RISK_REJECT_TYPE_ALLOW_CRYPTO_ORDER_MARKET = ( + "RISK_REJECT_TYPE_ALLOW_CRYPTO_ORDER_MARKET" + ) + RISK_REJECT_TYPE_ALLOW_EQ_ORDER_LONG_SALE = ( + "RISK_REJECT_TYPE_ALLOW_EQ_ORDER_LONG_SALE" + ) + RISK_REJECT_TYPE_ALLOW_EQ_ORDER_MARKET = "RISK_REJECT_TYPE_ALLOW_EQ_ORDER_MARKET" + RISK_REJECT_TYPE_ALLOW_FUT_ORDER_MARKET = "RISK_REJECT_TYPE_ALLOW_FUT_ORDER_MARKET" + RISK_REJECT_TYPE_ALLOW_LOCATE_ID_FOR_EASY_TO_BORROW = ( + "RISK_REJECT_TYPE_ALLOW_LOCATE_ID_FOR_EASY_TO_BORROW" + ) + RISK_REJECT_TYPE_ALLOW_OPT_ORDER_MARKET = "RISK_REJECT_TYPE_ALLOW_OPT_ORDER_MARKET" + RISK_REJECT_TYPE_ALLOW_OPT_ORDER_SELL_TO_OPEN = ( + "RISK_REJECT_TYPE_ALLOW_OPT_ORDER_SELL_TO_OPEN" + ) + RISK_REJECT_TYPE_ALLOW_ORDER_WASH_TRADES = ( + "RISK_REJECT_TYPE_ALLOW_ORDER_WASH_TRADES" + ) + RISK_REJECT_TYPE_BUYING_POWER = "RISK_REJECT_TYPE_BUYING_POWER" + RISK_REJECT_TYPE_CRYPTO_MAX_GROSS_NOTIONAL_DAY = ( + "RISK_REJECT_TYPE_CRYPTO_MAX_GROSS_NOTIONAL_DAY" + ) + RISK_REJECT_TYPE_CRYPTO_MAX_GROSS_QTY_DAY = ( + "RISK_REJECT_TYPE_CRYPTO_MAX_GROSS_QTY_DAY" + ) + RISK_REJECT_TYPE_CRYPTO_MAX_NET_POSITION = ( + "RISK_REJECT_TYPE_CRYPTO_MAX_NET_POSITION" + ) + RISK_REJECT_TYPE_CRYPTO_MAX_NET_QTY_DAY = "RISK_REJECT_TYPE_CRYPTO_MAX_NET_QTY_DAY" + RISK_REJECT_TYPE_CRYPTO_ORDER_MAX_NOTIONAL = ( + "RISK_REJECT_TYPE_CRYPTO_ORDER_MAX_NOTIONAL" + ) + RISK_REJECT_TYPE_CRYPTO_ORDER_MAX_QTY = "RISK_REJECT_TYPE_CRYPTO_ORDER_MAX_QTY" + RISK_REJECT_TYPE_CRYPTO_ORDER_WARN_NOTIONAL = ( + "RISK_REJECT_TYPE_CRYPTO_ORDER_WARN_NOTIONAL" + ) + RISK_REJECT_TYPE_CRYPTO_ORDER_WARN_QTY = "RISK_REJECT_TYPE_CRYPTO_ORDER_WARN_QTY" + RISK_REJECT_TYPE_CRYPTO_WARN_GROSS_NOTIONAL_DAY = ( + "RISK_REJECT_TYPE_CRYPTO_WARN_GROSS_NOTIONAL_DAY" + ) + RISK_REJECT_TYPE_CRYPTO_WARN_GROSS_QTY_DAY = ( + "RISK_REJECT_TYPE_CRYPTO_WARN_GROSS_QTY_DAY" + ) + RISK_REJECT_TYPE_CRYPTO_WARN_NET_POSITION = ( + "RISK_REJECT_TYPE_CRYPTO_WARN_NET_POSITION" + ) + RISK_REJECT_TYPE_CRYPTO_WARN_NET_QTY_DAY = ( + "RISK_REJECT_TYPE_CRYPTO_WARN_NET_QTY_DAY" + ) + RISK_REJECT_TYPE_EQ_MAX_GROSS_NOTIONAL_DAY = ( + "RISK_REJECT_TYPE_EQ_MAX_GROSS_NOTIONAL_DAY" + ) + RISK_REJECT_TYPE_EQ_MAX_GROSS_QTY_DAY = "RISK_REJECT_TYPE_EQ_MAX_GROSS_QTY_DAY" + RISK_REJECT_TYPE_EQ_MAX_NET_POSITION = "RISK_REJECT_TYPE_EQ_MAX_NET_POSITION" + RISK_REJECT_TYPE_EQ_MAX_NET_QTY_DAY = "RISK_REJECT_TYPE_EQ_MAX_NET_QTY_DAY" + RISK_REJECT_TYPE_EQ_ORDER_MAX_NOTIONAL = "RISK_REJECT_TYPE_EQ_ORDER_MAX_NOTIONAL" + RISK_REJECT_TYPE_EQ_ORDER_MAX_QTY = "RISK_REJECT_TYPE_EQ_ORDER_MAX_QTY" + RISK_REJECT_TYPE_EQ_ORDER_WARN_NOTIONAL = "RISK_REJECT_TYPE_EQ_ORDER_WARN_NOTIONAL" + RISK_REJECT_TYPE_EQ_ORDER_WARN_QTY = "RISK_REJECT_TYPE_EQ_ORDER_WARN_QTY" + RISK_REJECT_TYPE_EQ_WARN_GROSS_NOTIONAL_DAY = ( + "RISK_REJECT_TYPE_EQ_WARN_GROSS_NOTIONAL_DAY" + ) + RISK_REJECT_TYPE_EQ_WARN_GROSS_QTY_DAY = "RISK_REJECT_TYPE_EQ_WARN_GROSS_QTY_DAY" + RISK_REJECT_TYPE_EQ_WARN_NET_POSITION = "RISK_REJECT_TYPE_EQ_WARN_NET_POSITION" + RISK_REJECT_TYPE_EQ_WARN_NET_QTY_DAY = "RISK_REJECT_TYPE_EQ_WARN_NET_QTY_DAY" + RISK_REJECT_TYPE_FUT_MAX_GROSS_NOTIONAL_DAY = ( + "RISK_REJECT_TYPE_FUT_MAX_GROSS_NOTIONAL_DAY" + ) + RISK_REJECT_TYPE_FUT_MAX_GROSS_QTY_DAY = "RISK_REJECT_TYPE_FUT_MAX_GROSS_QTY_DAY" + RISK_REJECT_TYPE_FUT_MAX_NET_POSITION = "RISK_REJECT_TYPE_FUT_MAX_NET_POSITION" + RISK_REJECT_TYPE_FUT_MAX_NET_QTY_DAY = "RISK_REJECT_TYPE_FUT_MAX_NET_QTY_DAY" + RISK_REJECT_TYPE_FUT_ORDER_MAX_NOTIONAL = "RISK_REJECT_TYPE_FUT_ORDER_MAX_NOTIONAL" + RISK_REJECT_TYPE_FUT_ORDER_MAX_QTY = "RISK_REJECT_TYPE_FUT_ORDER_MAX_QTY" + RISK_REJECT_TYPE_FUT_ORDER_WARN_NOTIONAL = ( + "RISK_REJECT_TYPE_FUT_ORDER_WARN_NOTIONAL" + ) + RISK_REJECT_TYPE_FUT_ORDER_WARN_QTY = "RISK_REJECT_TYPE_FUT_ORDER_WARN_QTY" + RISK_REJECT_TYPE_FUT_WARN_GROSS_NOTIONAL_DAY = ( + "RISK_REJECT_TYPE_FUT_WARN_GROSS_NOTIONAL_DAY" + ) + RISK_REJECT_TYPE_FUT_WARN_GROSS_QTY_DAY = "RISK_REJECT_TYPE_FUT_WARN_GROSS_QTY_DAY" + RISK_REJECT_TYPE_FUT_WARN_NET_POSITION = "RISK_REJECT_TYPE_FUT_WARN_NET_POSITION" + RISK_REJECT_TYPE_FUT_WARN_NET_QTY_DAY = "RISK_REJECT_TYPE_FUT_WARN_NET_QTY_DAY" + RISK_REJECT_TYPE_GTC_ORDER_NOT_ALLOWED = "RISK_REJECT_TYPE_GTC_ORDER_NOT_ALLOWED" + RISK_REJECT_TYPE_HARD_TO_BORROW = "RISK_REJECT_TYPE_HARD_TO_BORROW" + RISK_REJECT_TYPE_INVALID_ORD_TYPE = "RISK_REJECT_TYPE_INVALID_ORD_TYPE" + RISK_REJECT_TYPE_INVALID_SIDE = "RISK_REJECT_TYPE_INVALID_SIDE" + RISK_REJECT_TYPE_OPT_MAX_GROSS_NOTIONAL_DAY = ( + "RISK_REJECT_TYPE_OPT_MAX_GROSS_NOTIONAL_DAY" + ) + RISK_REJECT_TYPE_OPT_MAX_GROSS_QTY_DAY = "RISK_REJECT_TYPE_OPT_MAX_GROSS_QTY_DAY" + RISK_REJECT_TYPE_OPT_MAX_NET_POSITION = "RISK_REJECT_TYPE_OPT_MAX_NET_POSITION" + RISK_REJECT_TYPE_OPT_MAX_NET_QTY_DAY = "RISK_REJECT_TYPE_OPT_MAX_NET_QTY_DAY" + RISK_REJECT_TYPE_OPT_ORDER_MAX_NOTIONAL = "RISK_REJECT_TYPE_OPT_ORDER_MAX_NOTIONAL" + RISK_REJECT_TYPE_OPT_ORDER_MAX_QTY = "RISK_REJECT_TYPE_OPT_ORDER_MAX_QTY" + RISK_REJECT_TYPE_OPT_ORDER_WARN_NOTIONAL = ( + "RISK_REJECT_TYPE_OPT_ORDER_WARN_NOTIONAL" + ) + RISK_REJECT_TYPE_OPT_ORDER_WARN_QTY = "RISK_REJECT_TYPE_OPT_ORDER_WARN_QTY" + RISK_REJECT_TYPE_OPT_WARN_GROSS_NOTIONAL_DAY = ( + "RISK_REJECT_TYPE_OPT_WARN_GROSS_NOTIONAL_DAY" + ) + RISK_REJECT_TYPE_OPT_WARN_GROSS_QTY_DAY = "RISK_REJECT_TYPE_OPT_WARN_GROSS_QTY_DAY" + RISK_REJECT_TYPE_OPT_WARN_NET_POSITION = "RISK_REJECT_TYPE_OPT_WARN_NET_POSITION" + RISK_REJECT_TYPE_OPT_WARN_NET_QTY_DAY = "RISK_REJECT_TYPE_OPT_WARN_NET_QTY_DAY" + RISK_REJECT_TYPE_ORDER_MAX_THRESHOLD_BREACHED = ( + "RISK_REJECT_TYPE_ORDER_MAX_THRESHOLD_BREACHED" + ) + RISK_REJECT_TYPE_RESTRICTED_SECURITY = "RISK_REJECT_TYPE_RESTRICTED_SECURITY" + RISK_REJECT_TYPE_SECURITY_NOT_SUPPORTED = "RISK_REJECT_TYPE_SECURITY_NOT_SUPPORTED" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/route.py b/openapi/openapi_project/openapi_package/models/route.py new file mode 100644 index 000000000..c05328a3b --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/route.py @@ -0,0 +1,178 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.currency import Currency +from ..models.order_type import OrderType +from ..models.route_type import RouteType +from ..models.security_type import SecurityType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.route_property import RouteProperty + + +T = TypeVar("T", bound="Route") + + +@_attrs_define +class Route: + """ + Attributes: + id (Union[Unset, int]): + algo_schema (Union[Unset, str]): + currency (Union[Unset, Currency]): + is_enabled (Union[Unset, bool]): + name (Union[Unset, str]): + order_type (Union[Unset, OrderType]): + route_properties (Union[Unset, list['RouteProperty']]): + security_type (Union[Unset, SecurityType]): + type_ (Union[Unset, RouteType]): + ui_schema (Union[Unset, str]): + venue (Union[Unset, str]): + """ + + id: Unset | int = UNSET + algo_schema: Unset | str = UNSET + currency: Unset | Currency = UNSET + is_enabled: Unset | bool = UNSET + name: Unset | str = UNSET + order_type: Unset | OrderType = UNSET + route_properties: Unset | list["RouteProperty"] = UNSET + security_type: Unset | SecurityType = UNSET + type_: Unset | RouteType = UNSET + ui_schema: Unset | str = UNSET + venue: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + id = self.id + + algo_schema = self.algo_schema + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + is_enabled = self.is_enabled + + name = self.name + + order_type: Unset | str = UNSET + if not isinstance(self.order_type, Unset): + order_type = self.order_type.value + + route_properties: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.route_properties, Unset): + route_properties = [] + for route_properties_item_data in self.route_properties: + route_properties_item = route_properties_item_data.to_dict() + route_properties.append(route_properties_item) + + security_type: Unset | str = UNSET + if not isinstance(self.security_type, Unset): + security_type = self.security_type.value + + type_: Unset | str = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + ui_schema = self.ui_schema + + venue = self.venue + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if algo_schema is not UNSET: + field_dict["algoSchema"] = algo_schema + if currency is not UNSET: + field_dict["currency"] = currency + if is_enabled is not UNSET: + field_dict["isEnabled"] = is_enabled + if name is not UNSET: + field_dict["name"] = name + if order_type is not UNSET: + field_dict["orderType"] = order_type + if route_properties is not UNSET: + field_dict["routeProperties"] = route_properties + if security_type is not UNSET: + field_dict["securityType"] = security_type + if type_ is not UNSET: + field_dict["type"] = type_ + if ui_schema is not UNSET: + field_dict["uiSchema"] = ui_schema + if venue is not UNSET: + field_dict["venue"] = venue + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.route_property import RouteProperty + + d = dict(src_dict) + id = d.pop("id", UNSET) + + algo_schema = d.pop("algoSchema", UNSET) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + is_enabled = d.pop("isEnabled", UNSET) + + name = d.pop("name", UNSET) + + _order_type = d.pop("orderType", UNSET) + order_type: Unset | OrderType + if isinstance(_order_type, Unset): + order_type = UNSET + else: + order_type = OrderType(_order_type) + + route_properties = [] + _route_properties = d.pop("routeProperties", UNSET) + for route_properties_item_data in _route_properties or []: + route_properties_item = RouteProperty.from_dict(route_properties_item_data) + + route_properties.append(route_properties_item) + + _security_type = d.pop("securityType", UNSET) + security_type: Unset | SecurityType + if isinstance(_security_type, Unset): + security_type = UNSET + else: + security_type = SecurityType(_security_type) + + _type_ = d.pop("type", UNSET) + type_: Unset | RouteType + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = RouteType(_type_) + + ui_schema = d.pop("uiSchema", UNSET) + + venue = d.pop("venue", UNSET) + + route = cls( + id=id, + algo_schema=algo_schema, + currency=currency, + is_enabled=is_enabled, + name=name, + order_type=order_type, + route_properties=route_properties, + security_type=security_type, + type_=type_, + ui_schema=ui_schema, + venue=venue, + ) + + return route diff --git a/openapi/openapi_project/openapi_package/models/route_applicability.py b/openapi/openapi_project/openapi_package/models/route_applicability.py new file mode 100644 index 000000000..9ec1fe42f --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/route_applicability.py @@ -0,0 +1,120 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..models.currency import Currency +from ..models.order_type import OrderType +from ..models.security_type import SecurityType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="RouteApplicability") + + +@_attrs_define +class RouteApplicability: + """ + Attributes: + user_id (Union[Unset, int]): + account_id (Union[Unset, int]): + security_type (Union[Unset, SecurityType]): + currency (Union[Unset, Currency]): + exchange_id (Union[Unset, int]): + order_type (Union[Unset, OrderType]): + route_ids (Union[Unset, list[int]]): + """ + + user_id: Unset | int = UNSET + account_id: Unset | int = UNSET + security_type: Unset | SecurityType = UNSET + currency: Unset | Currency = UNSET + exchange_id: Unset | int = UNSET + order_type: Unset | OrderType = UNSET + route_ids: Unset | list[int] = UNSET + + def to_dict(self) -> dict[str, Any]: + user_id = self.user_id + + account_id = self.account_id + + security_type: Unset | str = UNSET + if not isinstance(self.security_type, Unset): + security_type = self.security_type.value + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + exchange_id = self.exchange_id + + order_type: Unset | str = UNSET + if not isinstance(self.order_type, Unset): + order_type = self.order_type.value + + route_ids: Unset | list[int] = UNSET + if not isinstance(self.route_ids, Unset): + route_ids = self.route_ids + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if user_id is not UNSET: + field_dict["userId"] = user_id + if account_id is not UNSET: + field_dict["accountId"] = account_id + if security_type is not UNSET: + field_dict["securityType"] = security_type + if currency is not UNSET: + field_dict["currency"] = currency + if exchange_id is not UNSET: + field_dict["exchangeId"] = exchange_id + if order_type is not UNSET: + field_dict["orderType"] = order_type + if route_ids is not UNSET: + field_dict["routeIds"] = route_ids + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + user_id = d.pop("userId", UNSET) + + account_id = d.pop("accountId", UNSET) + + _security_type = d.pop("securityType", UNSET) + security_type: Unset | SecurityType + if isinstance(_security_type, Unset): + security_type = UNSET + else: + security_type = SecurityType(_security_type) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + exchange_id = d.pop("exchangeId", UNSET) + + _order_type = d.pop("orderType", UNSET) + order_type: Unset | OrderType + if isinstance(_order_type, Unset): + order_type = UNSET + else: + order_type = OrderType(_order_type) + + route_ids = cast(list[int], d.pop("routeIds", UNSET)) + + route_applicability = cls( + user_id=user_id, + account_id=account_id, + security_type=security_type, + currency=currency, + exchange_id=exchange_id, + order_type=order_type, + route_ids=route_ids, + ) + + return route_applicability diff --git a/openapi/openapi_project/openapi_package/models/route_property.py b/openapi/openapi_project/openapi_package/models/route_property.py new file mode 100644 index 000000000..d3662d8a0 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/route_property.py @@ -0,0 +1,66 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.route_property_type import RoutePropertyType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="RouteProperty") + + +@_attrs_define +class RouteProperty: + """ + Attributes: + id (Union[Unset, int]): + type_ (Union[Unset, RoutePropertyType]): + value (Union[Unset, str]): + """ + + id: Unset | int = UNSET + type_: Unset | RoutePropertyType = UNSET + value: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + id = self.id + + type_: Unset | str = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + value = self.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if type_ is not UNSET: + field_dict["type"] = type_ + if value is not UNSET: + field_dict["value"] = value + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + _type_ = d.pop("type", UNSET) + type_: Unset | RoutePropertyType + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = RoutePropertyType(_type_) + + value = d.pop("value", UNSET) + + route_property = cls( + id=id, + type_=type_, + value=value, + ) + + return route_property diff --git a/openapi/openapi_project/openapi_package/models/route_property_type.py b/openapi/openapi_project/openapi_package/models/route_property_type.py new file mode 100644 index 000000000..df376dcfa --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/route_property_type.py @@ -0,0 +1,19 @@ +from enum import Enum + + +class RoutePropertyType(str, Enum): + ROUTE_PROPERTY_TYPE_CONTINGENCY = "ROUTE_PROPERTY_TYPE_CONTINGENCY" + ROUTE_PROPERTY_TYPE_CROSS_TYPE = "ROUTE_PROPERTY_TYPE_CROSS_TYPE" + ROUTE_PROPERTY_TYPE_EQUITY_EX_DESTINATION = ( + "ROUTE_PROPERTY_TYPE_EQUITY_EX_DESTINATION" + ) + ROUTE_PROPERTY_TYPE_INSTRUCTION = "ROUTE_PROPERTY_TYPE_INSTRUCTION" + ROUTE_PROPERTY_TYPE_ORDER_TYPE = "ROUTE_PROPERTY_TYPE_ORDER_TYPE" + ROUTE_PROPERTY_TYPE_PERMISSION = "ROUTE_PROPERTY_TYPE_PERMISSION" + ROUTE_PROPERTY_TYPE_SESSION_ELIGIBILITY = "ROUTE_PROPERTY_TYPE_SESSION_ELIGIBILITY" + ROUTE_PROPERTY_TYPE_STRATEGY_ID = "ROUTE_PROPERTY_TYPE_STRATEGY_ID" + ROUTE_PROPERTY_TYPE_TIF = "ROUTE_PROPERTY_TYPE_TIF" + ROUTE_PROPERTY_TYPE_UNKNOWN = "ROUTE_PROPERTY_TYPE_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/route_type.py b/openapi/openapi_project/openapi_package/models/route_type.py new file mode 100644 index 000000000..d8faa457c --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/route_type.py @@ -0,0 +1,16 @@ +from enum import Enum + + +class RouteType(str, Enum): + ROUTE_TYPE_ALGO = "ROUTE_TYPE_ALGO" + ROUTE_TYPE_AWAY = "ROUTE_TYPE_AWAY" + ROUTE_TYPE_BROKER = "ROUTE_TYPE_BROKER" + ROUTE_TYPE_CBOE = "ROUTE_TYPE_CBOE" + ROUTE_TYPE_DMA = "ROUTE_TYPE_DMA" + ROUTE_TYPE_MANUAL = "ROUTE_TYPE_MANUAL" + ROUTE_TYPE_P2P = "ROUTE_TYPE_P2P" + ROUTE_TYPE_PAR = "ROUTE_TYPE_PAR" + ROUTE_TYPE_STAGE = "ROUTE_TYPE_STAGE" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/routing_session_group.py b/openapi/openapi_project/openapi_package/models/routing_session_group.py new file mode 100644 index 000000000..521ffcffa --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/routing_session_group.py @@ -0,0 +1,66 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.routing_session_group_type import RoutingSessionGroupType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="RoutingSessionGroup") + + +@_attrs_define +class RoutingSessionGroup: + """ + Attributes: + id (Union[Unset, int]): + name (Union[Unset, str]): + type_ (Union[Unset, RoutingSessionGroupType]): + """ + + id: Unset | int = UNSET + name: Unset | str = UNSET + type_: Unset | RoutingSessionGroupType = UNSET + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + type_: Unset | str = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if name is not UNSET: + field_dict["name"] = name + if type_ is not UNSET: + field_dict["type"] = type_ + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + name = d.pop("name", UNSET) + + _type_ = d.pop("type", UNSET) + type_: Unset | RoutingSessionGroupType + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = RoutingSessionGroupType(_type_) + + routing_session_group = cls( + id=id, + name=name, + type_=type_, + ) + + return routing_session_group diff --git a/openapi/openapi_project/openapi_package/models/routing_session_group_type.py b/openapi/openapi_project/openapi_package/models/routing_session_group_type.py new file mode 100644 index 000000000..1eba5b629 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/routing_session_group_type.py @@ -0,0 +1,15 @@ +from enum import Enum + + +class RoutingSessionGroupType(str, Enum): + ROUTING_SESSION_GROUP_TYPE_AWAY = "ROUTING_SESSION_GROUP_TYPE_AWAY" + ROUTING_SESSION_GROUP_TYPE_BROKER = "ROUTING_SESSION_GROUP_TYPE_BROKER" + ROUTING_SESSION_GROUP_TYPE_EXCHANGE = "ROUTING_SESSION_GROUP_TYPE_EXCHANGE" + ROUTING_SESSION_GROUP_TYPE_MANUAL = "ROUTING_SESSION_GROUP_TYPE_MANUAL" + ROUTING_SESSION_GROUP_TYPE_P2P = "ROUTING_SESSION_GROUP_TYPE_P2P" + ROUTING_SESSION_GROUP_TYPE_PAR = "ROUTING_SESSION_GROUP_TYPE_PAR" + ROUTING_SESSION_GROUP_TYPE_STAGE = "ROUTING_SESSION_GROUP_TYPE_STAGE" + ROUTING_SESSION_GROUP_TYPE_UNKNOWN = "ROUTING_SESSION_GROUP_TYPE_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/scenario.py b/openapi/openapi_project/openapi_package/models/scenario.py new file mode 100644 index 000000000..d8013ea75 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/scenario.py @@ -0,0 +1,83 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.scenario_leg import ScenarioLeg + from ..models.scenario_position import ScenarioPosition + + +T = TypeVar("T", bound="Scenario") + + +@_attrs_define +class Scenario: + """ + Attributes: + price (Union[Unset, float]): + legs (Union[Unset, list['ScenarioLeg']]): + position (Union[Unset, ScenarioPosition]): + """ + + price: Unset | float = UNSET + legs: Unset | list["ScenarioLeg"] = UNSET + position: Union[Unset, "ScenarioPosition"] = UNSET + + def to_dict(self) -> dict[str, Any]: + price = self.price + + legs: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.legs, Unset): + legs = [] + for legs_item_data in self.legs: + legs_item = legs_item_data.to_dict() + legs.append(legs_item) + + position: Unset | dict[str, Any] = UNSET + if not isinstance(self.position, Unset): + position = self.position.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if price is not UNSET: + field_dict["price"] = price + if legs is not UNSET: + field_dict["legs"] = legs + if position is not UNSET: + field_dict["position"] = position + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.scenario_leg import ScenarioLeg + from ..models.scenario_position import ScenarioPosition + + d = dict(src_dict) + price = d.pop("price", UNSET) + + legs = [] + _legs = d.pop("legs", UNSET) + for legs_item_data in _legs or []: + legs_item = ScenarioLeg.from_dict(legs_item_data) + + legs.append(legs_item) + + _position = d.pop("position", UNSET) + position: Unset | ScenarioPosition + if isinstance(_position, Unset): + position = UNSET + else: + position = ScenarioPosition.from_dict(_position) + + scenario = cls( + price=price, + legs=legs, + position=position, + ) + + return scenario diff --git a/openapi/openapi_project/openapi_package/models/scenario_leg.py b/openapi/openapi_project/openapi_package/models/scenario_leg.py new file mode 100644 index 000000000..50659f4dd --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/scenario_leg.py @@ -0,0 +1,112 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ScenarioLeg") + + +@_attrs_define +class ScenarioLeg: + """ + Attributes: + delta (Union[Unset, float]): + gamma (Union[Unset, float]): + prem (Union[Unset, float]): + profit (Union[Unset, float]): + rho (Union[Unset, float]): + theta (Union[Unset, float]): + total_value (Union[Unset, float]): + vega (Union[Unset, float]): + volatility (Union[Unset, float]): + """ + + delta: Unset | float = UNSET + gamma: Unset | float = UNSET + prem: Unset | float = UNSET + profit: Unset | float = UNSET + rho: Unset | float = UNSET + theta: Unset | float = UNSET + total_value: Unset | float = UNSET + vega: Unset | float = UNSET + volatility: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + delta = self.delta + + gamma = self.gamma + + prem = self.prem + + profit = self.profit + + rho = self.rho + + theta = self.theta + + total_value = self.total_value + + vega = self.vega + + volatility = self.volatility + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if delta is not UNSET: + field_dict["delta"] = delta + if gamma is not UNSET: + field_dict["gamma"] = gamma + if prem is not UNSET: + field_dict["prem"] = prem + if profit is not UNSET: + field_dict["profit"] = profit + if rho is not UNSET: + field_dict["rho"] = rho + if theta is not UNSET: + field_dict["theta"] = theta + if total_value is not UNSET: + field_dict["totalValue"] = total_value + if vega is not UNSET: + field_dict["vega"] = vega + if volatility is not UNSET: + field_dict["volatility"] = volatility + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + delta = d.pop("delta", UNSET) + + gamma = d.pop("gamma", UNSET) + + prem = d.pop("prem", UNSET) + + profit = d.pop("profit", UNSET) + + rho = d.pop("rho", UNSET) + + theta = d.pop("theta", UNSET) + + total_value = d.pop("totalValue", UNSET) + + vega = d.pop("vega", UNSET) + + volatility = d.pop("volatility", UNSET) + + scenario_leg = cls( + delta=delta, + gamma=gamma, + prem=prem, + profit=profit, + rho=rho, + theta=theta, + total_value=total_value, + vega=vega, + volatility=volatility, + ) + + return scenario_leg diff --git a/openapi/openapi_project/openapi_package/models/scenario_position.py b/openapi/openapi_project/openapi_package/models/scenario_position.py new file mode 100644 index 000000000..37853e7ea --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/scenario_position.py @@ -0,0 +1,112 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ScenarioPosition") + + +@_attrs_define +class ScenarioPosition: + """ + Attributes: + delta (Union[Unset, float]): + gamma (Union[Unset, float]): + prem (Union[Unset, float]): + profit (Union[Unset, float]): + rho (Union[Unset, float]): + theta (Union[Unset, float]): + total_value (Union[Unset, float]): + vega (Union[Unset, float]): + volatility (Union[Unset, float]): + """ + + delta: Unset | float = UNSET + gamma: Unset | float = UNSET + prem: Unset | float = UNSET + profit: Unset | float = UNSET + rho: Unset | float = UNSET + theta: Unset | float = UNSET + total_value: Unset | float = UNSET + vega: Unset | float = UNSET + volatility: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + delta = self.delta + + gamma = self.gamma + + prem = self.prem + + profit = self.profit + + rho = self.rho + + theta = self.theta + + total_value = self.total_value + + vega = self.vega + + volatility = self.volatility + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if delta is not UNSET: + field_dict["delta"] = delta + if gamma is not UNSET: + field_dict["gamma"] = gamma + if prem is not UNSET: + field_dict["prem"] = prem + if profit is not UNSET: + field_dict["profit"] = profit + if rho is not UNSET: + field_dict["rho"] = rho + if theta is not UNSET: + field_dict["theta"] = theta + if total_value is not UNSET: + field_dict["totalValue"] = total_value + if vega is not UNSET: + field_dict["vega"] = vega + if volatility is not UNSET: + field_dict["volatility"] = volatility + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + delta = d.pop("delta", UNSET) + + gamma = d.pop("gamma", UNSET) + + prem = d.pop("prem", UNSET) + + profit = d.pop("profit", UNSET) + + rho = d.pop("rho", UNSET) + + theta = d.pop("theta", UNSET) + + total_value = d.pop("totalValue", UNSET) + + vega = d.pop("vega", UNSET) + + volatility = d.pop("volatility", UNSET) + + scenario_position = cls( + delta=delta, + gamma=gamma, + prem=prem, + profit=profit, + rho=rho, + theta=theta, + total_value=total_value, + vega=vega, + volatility=volatility, + ) + + return scenario_position diff --git a/openapi/openapi_project/openapi_package/models/scenario_theo.py b/openapi/openapi_project/openapi_package/models/scenario_theo.py new file mode 100644 index 000000000..c5edd6d33 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/scenario_theo.py @@ -0,0 +1,74 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.scenario import Scenario + + +T = TypeVar("T", bound="ScenarioTheo") + + +@_attrs_define +class ScenarioTheo: + """ + Attributes: + as_of_ts (Union[Unset, str]): + as_of_eval_expiry (Union[Unset, bool]): + scenarios (Union[Unset, list['Scenario']]): + """ + + as_of_ts: Unset | str = UNSET + as_of_eval_expiry: Unset | bool = UNSET + scenarios: Unset | list["Scenario"] = UNSET + + def to_dict(self) -> dict[str, Any]: + as_of_ts = self.as_of_ts + + as_of_eval_expiry = self.as_of_eval_expiry + + scenarios: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.scenarios, Unset): + scenarios = [] + for scenarios_item_data in self.scenarios: + scenarios_item = scenarios_item_data.to_dict() + scenarios.append(scenarios_item) + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if as_of_ts is not UNSET: + field_dict["asOfTs"] = as_of_ts + if as_of_eval_expiry is not UNSET: + field_dict["asOfEvalExpiry"] = as_of_eval_expiry + if scenarios is not UNSET: + field_dict["scenarios"] = scenarios + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.scenario import Scenario + + d = dict(src_dict) + as_of_ts = d.pop("asOfTs", UNSET) + + as_of_eval_expiry = d.pop("asOfEvalExpiry", UNSET) + + scenarios = [] + _scenarios = d.pop("scenarios", UNSET) + for scenarios_item_data in _scenarios or []: + scenarios_item = Scenario.from_dict(scenarios_item_data) + + scenarios.append(scenarios_item) + + scenario_theo = cls( + as_of_ts=as_of_ts, + as_of_eval_expiry=as_of_eval_expiry, + scenarios=scenarios, + ) + + return scenario_theo diff --git a/openapi/openapi_project/openapi_package/models/search_order_history_response.py b/openapi/openapi_project/openapi_package/models/search_order_history_response.py new file mode 100644 index 000000000..91f36e485 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/search_order_history_response.py @@ -0,0 +1,82 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.generic_order import GenericOrder + + +T = TypeVar("T", bound="SearchOrderHistoryResponse") + + +@_attrs_define +class SearchOrderHistoryResponse: + """ + Attributes: + orders (Union[Unset, list['GenericOrder']]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + orders: Unset | list["GenericOrder"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + orders: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.orders, Unset): + orders = [] + for orders_item_data in self.orders: + orders_item = orders_item_data.to_dict() + orders.append(orders_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if orders is not UNSET: + field_dict["orders"] = orders + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.generic_order import GenericOrder + + d = dict(src_dict) + orders = [] + _orders = d.pop("orders", UNSET) + for orders_item_data in _orders or []: + orders_item = GenericOrder.from_dict(orders_item_data) + + orders.append(orders_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + search_order_history_response = cls( + orders=orders, + error_message=error_message, + status_code=status_code, + ) + + return search_order_history_response diff --git a/openapi/openapi_project/openapi_package/models/security.py b/openapi/openapi_project/openapi_package/models/security.py new file mode 100644 index 000000000..bf721a1fe --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/security.py @@ -0,0 +1,215 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.crypto import Crypto + from ..models.flex_option import FlexOption + from ..models.future import Future + from ..models.future_root import FutureRoot + from ..models.future_spread import FutureSpread + from ..models.fx import Fx + from ..models.index import Index + from ..models.option import Option + from ..models.option_root import OptionRoot + from ..models.stock import Stock + + +T = TypeVar("T", bound="Security") + + +@_attrs_define +class Security: + """ + Attributes: + stock (Union[Unset, Stock]): + option (Union[Unset, Option]): + option_root (Union[Unset, OptionRoot]): + future (Union[Unset, Future]): + future_root (Union[Unset, FutureRoot]): + index (Union[Unset, Index]): + future_spread (Union[Unset, FutureSpread]): + fx (Union[Unset, Fx]): + crypto (Union[Unset, Crypto]): + flex_option (Union[Unset, FlexOption]): + """ + + stock: Union[Unset, "Stock"] = UNSET + option: Union[Unset, "Option"] = UNSET + option_root: Union[Unset, "OptionRoot"] = UNSET + future: Union[Unset, "Future"] = UNSET + future_root: Union[Unset, "FutureRoot"] = UNSET + index: Union[Unset, "Index"] = UNSET + future_spread: Union[Unset, "FutureSpread"] = UNSET + fx: Union[Unset, "Fx"] = UNSET + crypto: Union[Unset, "Crypto"] = UNSET + flex_option: Union[Unset, "FlexOption"] = UNSET + + def to_dict(self) -> dict[str, Any]: + stock: Unset | dict[str, Any] = UNSET + if not isinstance(self.stock, Unset): + stock = self.stock.to_dict() + + option: Unset | dict[str, Any] = UNSET + if not isinstance(self.option, Unset): + option = self.option.to_dict() + + option_root: Unset | dict[str, Any] = UNSET + if not isinstance(self.option_root, Unset): + option_root = self.option_root.to_dict() + + future: Unset | dict[str, Any] = UNSET + if not isinstance(self.future, Unset): + future = self.future.to_dict() + + future_root: Unset | dict[str, Any] = UNSET + if not isinstance(self.future_root, Unset): + future_root = self.future_root.to_dict() + + index: Unset | dict[str, Any] = UNSET + if not isinstance(self.index, Unset): + index = self.index.to_dict() + + future_spread: Unset | dict[str, Any] = UNSET + if not isinstance(self.future_spread, Unset): + future_spread = self.future_spread.to_dict() + + fx: Unset | dict[str, Any] = UNSET + if not isinstance(self.fx, Unset): + fx = self.fx.to_dict() + + crypto: Unset | dict[str, Any] = UNSET + if not isinstance(self.crypto, Unset): + crypto = self.crypto.to_dict() + + flex_option: Unset | dict[str, Any] = UNSET + if not isinstance(self.flex_option, Unset): + flex_option = self.flex_option.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if stock is not UNSET: + field_dict["stock"] = stock + if option is not UNSET: + field_dict["option"] = option + if option_root is not UNSET: + field_dict["optionRoot"] = option_root + if future is not UNSET: + field_dict["future"] = future + if future_root is not UNSET: + field_dict["futureRoot"] = future_root + if index is not UNSET: + field_dict["index"] = index + if future_spread is not UNSET: + field_dict["futureSpread"] = future_spread + if fx is not UNSET: + field_dict["fx"] = fx + if crypto is not UNSET: + field_dict["crypto"] = crypto + if flex_option is not UNSET: + field_dict["flexOption"] = flex_option + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.crypto import Crypto + from ..models.flex_option import FlexOption + from ..models.future import Future + from ..models.future_root import FutureRoot + from ..models.future_spread import FutureSpread + from ..models.fx import Fx + from ..models.index import Index + from ..models.option import Option + from ..models.option_root import OptionRoot + from ..models.stock import Stock + + d = dict(src_dict) + _stock = d.pop("stock", UNSET) + stock: Unset | Stock + if isinstance(_stock, Unset): + stock = UNSET + else: + stock = Stock.from_dict(_stock) + + _option = d.pop("option", UNSET) + option: Unset | Option + if isinstance(_option, Unset): + option = UNSET + else: + option = Option.from_dict(_option) + + _option_root = d.pop("optionRoot", UNSET) + option_root: Unset | OptionRoot + if isinstance(_option_root, Unset): + option_root = UNSET + else: + option_root = OptionRoot.from_dict(_option_root) + + _future = d.pop("future", UNSET) + future: Unset | Future + if isinstance(_future, Unset): + future = UNSET + else: + future = Future.from_dict(_future) + + _future_root = d.pop("futureRoot", UNSET) + future_root: Unset | FutureRoot + if isinstance(_future_root, Unset): + future_root = UNSET + else: + future_root = FutureRoot.from_dict(_future_root) + + _index = d.pop("index", UNSET) + index: Unset | Index + if isinstance(_index, Unset): + index = UNSET + else: + index = Index.from_dict(_index) + + _future_spread = d.pop("futureSpread", UNSET) + future_spread: Unset | FutureSpread + if isinstance(_future_spread, Unset): + future_spread = UNSET + else: + future_spread = FutureSpread.from_dict(_future_spread) + + _fx = d.pop("fx", UNSET) + fx: Unset | Fx + if isinstance(_fx, Unset): + fx = UNSET + else: + fx = Fx.from_dict(_fx) + + _crypto = d.pop("crypto", UNSET) + crypto: Unset | Crypto + if isinstance(_crypto, Unset): + crypto = UNSET + else: + crypto = Crypto.from_dict(_crypto) + + _flex_option = d.pop("flexOption", UNSET) + flex_option: Unset | FlexOption + if isinstance(_flex_option, Unset): + flex_option = UNSET + else: + flex_option = FlexOption.from_dict(_flex_option) + + security = cls( + stock=stock, + option=option, + option_root=option_root, + future=future, + future_root=future_root, + index=index, + future_spread=future_spread, + fx=fx, + crypto=crypto, + flex_option=flex_option, + ) + + return security diff --git a/openapi/openapi_project/openapi_package/models/security_category.py b/openapi/openapi_project/openapi_package/models/security_category.py new file mode 100644 index 000000000..2d7108ca9 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/security_category.py @@ -0,0 +1,39 @@ +from enum import Enum + + +class SecurityCategory(str, Enum): + SECURITY_CATEGORY_ADR = "SECURITY_CATEGORY_ADR" + SECURITY_CATEGORY_COMMON_STOCK = "SECURITY_CATEGORY_COMMON_STOCK" + SECURITY_CATEGORY_CONVERTIBLE = "SECURITY_CATEGORY_CONVERTIBLE" + SECURITY_CATEGORY_CORPORATE_BOND = "SECURITY_CATEGORY_CORPORATE_BOND" + SECURITY_CATEGORY_CRYPTO = "SECURITY_CATEGORY_CRYPTO" + SECURITY_CATEGORY_DEBENTURE = "SECURITY_CATEGORY_DEBENTURE" + SECURITY_CATEGORY_EQUITY_OPTION = "SECURITY_CATEGORY_EQUITY_OPTION" + SECURITY_CATEGORY_ETF = "SECURITY_CATEGORY_ETF" + SECURITY_CATEGORY_ETN = "SECURITY_CATEGORY_ETN" + SECURITY_CATEGORY_FLEX_OPTION = "SECURITY_CATEGORY_FLEX_OPTION" + SECURITY_CATEGORY_FUTURE = "SECURITY_CATEGORY_FUTURE" + SECURITY_CATEGORY_FUTURE_OPTION = "SECURITY_CATEGORY_FUTURE_OPTION" + SECURITY_CATEGORY_FUTURE_ROOT = "SECURITY_CATEGORY_FUTURE_ROOT" + SECURITY_CATEGORY_FUTURE_SPREAD = "SECURITY_CATEGORY_FUTURE_SPREAD" + SECURITY_CATEGORY_FX = "SECURITY_CATEGORY_FX" + SECURITY_CATEGORY_INDEX = "SECURITY_CATEGORY_INDEX" + SECURITY_CATEGORY_INDEX_OPTION = "SECURITY_CATEGORY_INDEX_OPTION" + SECURITY_CATEGORY_INSTALLMENT_RECEIPT = "SECURITY_CATEGORY_INSTALLMENT_RECEIPT" + SECURITY_CATEGORY_MUNICIPAL_BOND = "SECURITY_CATEGORY_MUNICIPAL_BOND" + SECURITY_CATEGORY_MUTUAL_FUND = "SECURITY_CATEGORY_MUTUAL_FUND" + SECURITY_CATEGORY_NOTE = "SECURITY_CATEGORY_NOTE" + SECURITY_CATEGORY_OPTION_ROOT = "SECURITY_CATEGORY_OPTION_ROOT" + SECURITY_CATEGORY_PREFERRED_STOCK = "SECURITY_CATEGORY_PREFERRED_STOCK" + SECURITY_CATEGORY_RIGHT = "SECURITY_CATEGORY_RIGHT" + SECURITY_CATEGORY_TEST = "SECURITY_CATEGORY_TEST" + SECURITY_CATEGORY_TREASURY_BILL = "SECURITY_CATEGORY_TREASURY_BILL" + SECURITY_CATEGORY_TRUST_UNIT = "SECURITY_CATEGORY_TRUST_UNIT" + SECURITY_CATEGORY_UNIT = "SECURITY_CATEGORY_UNIT" + SECURITY_CATEGORY_UNKNOWN = "SECURITY_CATEGORY_UNKNOWN" + SECURITY_CATEGORY_WARRANT = "SECURITY_CATEGORY_WARRANT" + SECURITY_CATEGORY_WHEN_DISTRIBUTED = "SECURITY_CATEGORY_WHEN_DISTRIBUTED" + SECURITY_CATEGORY_WHEN_ISSUED = "SECURITY_CATEGORY_WHEN_ISSUED" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/security_type.py b/openapi/openapi_project/openapi_package/models/security_type.py new file mode 100644 index 000000000..891a6dcbc --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/security_type.py @@ -0,0 +1,19 @@ +from enum import Enum + + +class SecurityType(str, Enum): + SECURITY_TYPE_BOND = "SECURITY_TYPE_BOND" + SECURITY_TYPE_CRYPTO = "SECURITY_TYPE_CRYPTO" + SECURITY_TYPE_FLEX_OPTION = "SECURITY_TYPE_FLEX_OPTION" + SECURITY_TYPE_FUTURE = "SECURITY_TYPE_FUTURE" + SECURITY_TYPE_FUTURE_ROOT = "SECURITY_TYPE_FUTURE_ROOT" + SECURITY_TYPE_FUTURE_SPREAD = "SECURITY_TYPE_FUTURE_SPREAD" + SECURITY_TYPE_FX = "SECURITY_TYPE_FX" + SECURITY_TYPE_INDEX = "SECURITY_TYPE_INDEX" + SECURITY_TYPE_OPTION = "SECURITY_TYPE_OPTION" + SECURITY_TYPE_OPTION_ROOT = "SECURITY_TYPE_OPTION_ROOT" + SECURITY_TYPE_STOCK = "SECURITY_TYPE_STOCK" + SECURITY_TYPE_UNKNOWN = "SECURITY_TYPE_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/settlement_deliverable_type.py b/openapi/openapi_project/openapi_package/models/settlement_deliverable_type.py new file mode 100644 index 000000000..0163027b4 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/settlement_deliverable_type.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class SettlementDeliverableType(str, Enum): + SETTLEMENT_DELIVERABLE_TYPE_CASH = "SETTLEMENT_DELIVERABLE_TYPE_CASH" + SETTLEMENT_DELIVERABLE_TYPE_PHYSICAL = "SETTLEMENT_DELIVERABLE_TYPE_PHYSICAL" + SETTLEMENT_DELIVERABLE_TYPE_UNDEFINED = "SETTLEMENT_DELIVERABLE_TYPE_UNDEFINED" + SETTLEMENT_DELIVERABLE_TYPE_UNDERLYING = "SETTLEMENT_DELIVERABLE_TYPE_UNDERLYING" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/settlement_info.py b/openapi/openapi_project/openapi_package/models/settlement_info.py new file mode 100644 index 000000000..d36fd9a55 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/settlement_info.py @@ -0,0 +1,66 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.settlement_deliverable_type import SettlementDeliverableType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="SettlementInfo") + + +@_attrs_define +class SettlementInfo: + """ + Attributes: + amount (Union[Unset, float]): + symbol (Union[Unset, str]): + deliverable_type (Union[Unset, SettlementDeliverableType]): + """ + + amount: Unset | float = UNSET + symbol: Unset | str = UNSET + deliverable_type: Unset | SettlementDeliverableType = UNSET + + def to_dict(self) -> dict[str, Any]: + amount = self.amount + + symbol = self.symbol + + deliverable_type: Unset | str = UNSET + if not isinstance(self.deliverable_type, Unset): + deliverable_type = self.deliverable_type.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if amount is not UNSET: + field_dict["amount"] = amount + if symbol is not UNSET: + field_dict["symbol"] = symbol + if deliverable_type is not UNSET: + field_dict["deliverableType"] = deliverable_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + amount = d.pop("amount", UNSET) + + symbol = d.pop("symbol", UNSET) + + _deliverable_type = d.pop("deliverableType", UNSET) + deliverable_type: Unset | SettlementDeliverableType + if isinstance(_deliverable_type, Unset): + deliverable_type = UNSET + else: + deliverable_type = SettlementDeliverableType(_deliverable_type) + + settlement_info = cls( + amount=amount, + symbol=symbol, + deliverable_type=deliverable_type, + ) + + return settlement_info diff --git a/openapi/openapi_project/openapi_package/models/shock_value.py b/openapi/openapi_project/openapi_package/models/shock_value.py new file mode 100644 index 000000000..0f34d4b86 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/shock_value.py @@ -0,0 +1,98 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.shock_value_flags import ShockValueFlags + + +T = TypeVar("T", bound="ShockValue") + + +@_attrs_define +class ShockValue: + """ + Attributes: + delta (Union[Unset, float]): + dollar_delta (Union[Unset, float]): + pn_l (Union[Unset, float]): + nav (Union[Unset, float]): + volatility (Union[Unset, float]): + flags (Union[Unset, ShockValueFlags]): + """ + + delta: Unset | float = UNSET + dollar_delta: Unset | float = UNSET + pn_l: Unset | float = UNSET + nav: Unset | float = UNSET + volatility: Unset | float = UNSET + flags: Union[Unset, "ShockValueFlags"] = UNSET + + def to_dict(self) -> dict[str, Any]: + delta = self.delta + + dollar_delta = self.dollar_delta + + pn_l = self.pn_l + + nav = self.nav + + volatility = self.volatility + + flags: Unset | dict[str, Any] = UNSET + if not isinstance(self.flags, Unset): + flags = self.flags.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if delta is not UNSET: + field_dict["delta"] = delta + if dollar_delta is not UNSET: + field_dict["dollarDelta"] = dollar_delta + if pn_l is not UNSET: + field_dict["pnL"] = pn_l + if nav is not UNSET: + field_dict["nav"] = nav + if volatility is not UNSET: + field_dict["volatility"] = volatility + if flags is not UNSET: + field_dict["flags"] = flags + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.shock_value_flags import ShockValueFlags + + d = dict(src_dict) + delta = d.pop("delta", UNSET) + + dollar_delta = d.pop("dollarDelta", UNSET) + + pn_l = d.pop("pnL", UNSET) + + nav = d.pop("nav", UNSET) + + volatility = d.pop("volatility", UNSET) + + _flags = d.pop("flags", UNSET) + flags: Unset | ShockValueFlags + if isinstance(_flags, Unset): + flags = UNSET + else: + flags = ShockValueFlags.from_dict(_flags) + + shock_value = cls( + delta=delta, + dollar_delta=dollar_delta, + pn_l=pn_l, + nav=nav, + volatility=volatility, + flags=flags, + ) + + return shock_value diff --git a/openapi/openapi_project/openapi_package/models/shock_value_flags.py b/openapi/openapi_project/openapi_package/models/shock_value_flags.py new file mode 100644 index 000000000..e6f5df57c --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/shock_value_flags.py @@ -0,0 +1,58 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ShockValueFlags") + + +@_attrs_define +class ShockValueFlags: + """ + Attributes: + expired (Union[Unset, bool]): + exercised (Union[Unset, bool]): + delivered (Union[Unset, bool]): + """ + + expired: Unset | bool = UNSET + exercised: Unset | bool = UNSET + delivered: Unset | bool = UNSET + + def to_dict(self) -> dict[str, Any]: + expired = self.expired + + exercised = self.exercised + + delivered = self.delivered + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if expired is not UNSET: + field_dict["expired"] = expired + if exercised is not UNSET: + field_dict["exercised"] = exercised + if delivered is not UNSET: + field_dict["delivered"] = delivered + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + expired = d.pop("expired", UNSET) + + exercised = d.pop("exercised", UNSET) + + delivered = d.pop("delivered", UNSET) + + shock_value_flags = cls( + expired=expired, + exercised=exercised, + delivered=delivered, + ) + + return shock_value_flags diff --git a/openapi/openapi_project/openapi_package/models/side.py b/openapi/openapi_project/openapi_package/models/side.py new file mode 100644 index 000000000..c85e0bf27 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/side.py @@ -0,0 +1,13 @@ +from enum import Enum + + +class Side(str, Enum): + SIDE_BUY = "SIDE_BUY" + SIDE_CROSS = "SIDE_CROSS" + SIDE_NOT_SPECIFIED = "SIDE_NOT_SPECIFIED" + SIDE_SELL = "SIDE_SELL" + SIDE_SELL_SHORT = "SIDE_SELL_SHORT" + SIDE_SELL_SHORT_EXEMPT = "SIDE_SELL_SHORT_EXEMPT" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/spread_leg_side.py b/openapi/openapi_project/openapi_package/models/spread_leg_side.py new file mode 100644 index 000000000..af9adc8ff --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/spread_leg_side.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class SpreadLegSide(str, Enum): + SPREAD_LEG_SIDE_BUY = "SPREAD_LEG_SIDE_BUY" + SPREAD_LEG_SIDE_SELL = "SPREAD_LEG_SIDE_SELL" + SPREAD_LEG_SIDE_UNKNOWN = "SPREAD_LEG_SIDE_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/spread_leg_type.py b/openapi/openapi_project/openapi_package/models/spread_leg_type.py new file mode 100644 index 000000000..a6813e623 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/spread_leg_type.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class SpreadLegType(str, Enum): + SPREAD_LEG_TYPE_OUTRIGHT = "SPREAD_LEG_TYPE_OUTRIGHT" + SPREAD_LEG_TYPE_UNKNOWN = "SPREAD_LEG_TYPE_UNKNOWN" + SPREAD_LEG_TYPE_VOLATILITY = "SPREAD_LEG_TYPE_VOLATILITY" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/status.py b/openapi/openapi_project/openapi_package/models/status.py new file mode 100644 index 000000000..93c607c82 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/status.py @@ -0,0 +1,74 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.any_model import AnyModel + + +T = TypeVar("T", bound="Status") + + +@_attrs_define +class Status: + """ + Attributes: + code (Union[Unset, int]): + message (Union[Unset, str]): + details (Union[Unset, list['AnyModel']]): + """ + + code: Unset | int = UNSET + message: Unset | str = UNSET + details: Unset | list["AnyModel"] = UNSET + + def to_dict(self) -> dict[str, Any]: + code = self.code + + message = self.message + + details: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.details, Unset): + details = [] + for details_item_data in self.details: + details_item = details_item_data.to_dict() + details.append(details_item) + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if code is not UNSET: + field_dict["code"] = code + if message is not UNSET: + field_dict["message"] = message + if details is not UNSET: + field_dict["details"] = details + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.any_model import AnyModel + + d = dict(src_dict) + code = d.pop("code", UNSET) + + message = d.pop("message", UNSET) + + details = [] + _details = d.pop("details", UNSET) + for details_item_data in _details or []: + details_item = AnyModel.from_dict(details_item_data) + + details.append(details_item) + + status = cls( + code=code, + message=message, + details=details, + ) + + return status diff --git a/openapi/openapi_project/openapi_package/models/status_code.py b/openapi/openapi_project/openapi_package/models/status_code.py new file mode 100644 index 000000000..3f7c54600 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/status_code.py @@ -0,0 +1,19 @@ +from enum import Enum + + +class StatusCode(str, Enum): + STATUS_CODE_DISCONNECTED = "STATUS_CODE_DISCONNECTED" + STATUS_CODE_ERROR = "STATUS_CODE_ERROR" + STATUS_CODE_NOT_AUTHORIZED = "STATUS_CODE_NOT_AUTHORIZED" + STATUS_CODE_NOT_CONNECTED = "STATUS_CODE_NOT_CONNECTED" + STATUS_CODE_NOT_FOUND = "STATUS_CODE_NOT_FOUND" + STATUS_CODE_NOT_UPDATED = "STATUS_CODE_NOT_UPDATED" + STATUS_CODE_OK = "STATUS_CODE_OK" + STATUS_CODE_PEER_ALREADY_EXISTS = "STATUS_CODE_PEER_ALREADY_EXISTS" + STATUS_CODE_SERVER_BUSY = "STATUS_CODE_SERVER_BUSY" + STATUS_CODE_SERVER_ERROR = "STATUS_CODE_SERVER_ERROR" + STATUS_CODE_TIMEOUT = "STATUS_CODE_TIMEOUT" + STATUS_CODE_VALIDATION_ERROR = "STATUS_CODE_VALIDATION_ERROR" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/stock.py b/openapi/openapi_project/openapi_package/models/stock.py new file mode 100644 index 000000000..c2dfc0a3a --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/stock.py @@ -0,0 +1,309 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.currency import Currency +from ..models.exchange_code import ExchangeCode +from ..models.numeric_display_format import NumericDisplayFormat +from ..models.security_category import SecurityCategory +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.date import Date + from ..models.stock_aliases import StockAliases + + +T = TypeVar("T", bound="Stock") + + +@_attrs_define +class Stock: + """ + Attributes: + aliases (Union[Unset, StockAliases]): + currency (Union[Unset, Currency]): + listed_dt (Union[Unset, Date]): + delisted_dt (Union[Unset, Date]): + description (Union[Unset, str]): + exchange_id (Union[Unset, int]): + id (Union[Unset, int]): + multiplier (Union[Unset, float]): + price_base_factor (Union[Unset, float]): + price_display_factor (Union[Unset, float]): + price_display_format (Union[Unset, NumericDisplayFormat]): + qty_display_factor (Union[Unset, float]): + qty_display_format (Union[Unset, NumericDisplayFormat]): + security_category (Union[Unset, SecurityCategory]): + symbol (Union[Unset, str]): + tick_rule (Union[Unset, str]): + tick_size (Union[Unset, float]): + tick_value (Union[Unset, float]): + traded_exchanges (Union[Unset, list[ExchangeCode]]): + category (Union[Unset, str]): + industry (Union[Unset, str]): + lot_size (Union[Unset, int]): + sector (Union[Unset, str]): + """ + + aliases: Union[Unset, "StockAliases"] = UNSET + currency: Unset | Currency = UNSET + listed_dt: Union[Unset, "Date"] = UNSET + delisted_dt: Union[Unset, "Date"] = UNSET + description: Unset | str = UNSET + exchange_id: Unset | int = UNSET + id: Unset | int = UNSET + multiplier: Unset | float = UNSET + price_base_factor: Unset | float = UNSET + price_display_factor: Unset | float = UNSET + price_display_format: Unset | NumericDisplayFormat = UNSET + qty_display_factor: Unset | float = UNSET + qty_display_format: Unset | NumericDisplayFormat = UNSET + security_category: Unset | SecurityCategory = UNSET + symbol: Unset | str = UNSET + tick_rule: Unset | str = UNSET + tick_size: Unset | float = UNSET + tick_value: Unset | float = UNSET + traded_exchanges: Unset | list[ExchangeCode] = UNSET + category: Unset | str = UNSET + industry: Unset | str = UNSET + lot_size: Unset | int = UNSET + sector: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + aliases: Unset | dict[str, Any] = UNSET + if not isinstance(self.aliases, Unset): + aliases = self.aliases.to_dict() + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + listed_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.listed_dt, Unset): + listed_dt = self.listed_dt.to_dict() + + delisted_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.delisted_dt, Unset): + delisted_dt = self.delisted_dt.to_dict() + + description = self.description + + exchange_id = self.exchange_id + + id = self.id + + multiplier = self.multiplier + + price_base_factor = self.price_base_factor + + price_display_factor = self.price_display_factor + + price_display_format: Unset | str = UNSET + if not isinstance(self.price_display_format, Unset): + price_display_format = self.price_display_format.value + + qty_display_factor = self.qty_display_factor + + qty_display_format: Unset | str = UNSET + if not isinstance(self.qty_display_format, Unset): + qty_display_format = self.qty_display_format.value + + security_category: Unset | str = UNSET + if not isinstance(self.security_category, Unset): + security_category = self.security_category.value + + symbol = self.symbol + + tick_rule = self.tick_rule + + tick_size = self.tick_size + + tick_value = self.tick_value + + traded_exchanges: Unset | list[str] = UNSET + if not isinstance(self.traded_exchanges, Unset): + traded_exchanges = [] + for traded_exchanges_item_data in self.traded_exchanges: + traded_exchanges_item = traded_exchanges_item_data.value + traded_exchanges.append(traded_exchanges_item) + + category = self.category + + industry = self.industry + + lot_size = self.lot_size + + sector = self.sector + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if aliases is not UNSET: + field_dict["aliases"] = aliases + if currency is not UNSET: + field_dict["currency"] = currency + if listed_dt is not UNSET: + field_dict["listedDt"] = listed_dt + if delisted_dt is not UNSET: + field_dict["delistedDt"] = delisted_dt + if description is not UNSET: + field_dict["description"] = description + if exchange_id is not UNSET: + field_dict["exchangeId"] = exchange_id + if id is not UNSET: + field_dict["id"] = id + if multiplier is not UNSET: + field_dict["multiplier"] = multiplier + if price_base_factor is not UNSET: + field_dict["priceBaseFactor"] = price_base_factor + if price_display_factor is not UNSET: + field_dict["priceDisplayFactor"] = price_display_factor + if price_display_format is not UNSET: + field_dict["priceDisplayFormat"] = price_display_format + if qty_display_factor is not UNSET: + field_dict["qtyDisplayFactor"] = qty_display_factor + if qty_display_format is not UNSET: + field_dict["qtyDisplayFormat"] = qty_display_format + if security_category is not UNSET: + field_dict["securityCategory"] = security_category + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tick_rule is not UNSET: + field_dict["tickRule"] = tick_rule + if tick_size is not UNSET: + field_dict["tickSize"] = tick_size + if tick_value is not UNSET: + field_dict["tickValue"] = tick_value + if traded_exchanges is not UNSET: + field_dict["tradedExchanges"] = traded_exchanges + if category is not UNSET: + field_dict["category"] = category + if industry is not UNSET: + field_dict["industry"] = industry + if lot_size is not UNSET: + field_dict["lotSize"] = lot_size + if sector is not UNSET: + field_dict["sector"] = sector + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.date import Date + from ..models.stock_aliases import StockAliases + + d = dict(src_dict) + _aliases = d.pop("aliases", UNSET) + aliases: Unset | StockAliases + if isinstance(_aliases, Unset): + aliases = UNSET + else: + aliases = StockAliases.from_dict(_aliases) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + _listed_dt = d.pop("listedDt", UNSET) + listed_dt: Unset | Date + if isinstance(_listed_dt, Unset): + listed_dt = UNSET + else: + listed_dt = Date.from_dict(_listed_dt) + + _delisted_dt = d.pop("delistedDt", UNSET) + delisted_dt: Unset | Date + if isinstance(_delisted_dt, Unset): + delisted_dt = UNSET + else: + delisted_dt = Date.from_dict(_delisted_dt) + + description = d.pop("description", UNSET) + + exchange_id = d.pop("exchangeId", UNSET) + + id = d.pop("id", UNSET) + + multiplier = d.pop("multiplier", UNSET) + + price_base_factor = d.pop("priceBaseFactor", UNSET) + + price_display_factor = d.pop("priceDisplayFactor", UNSET) + + _price_display_format = d.pop("priceDisplayFormat", UNSET) + price_display_format: Unset | NumericDisplayFormat + if isinstance(_price_display_format, Unset): + price_display_format = UNSET + else: + price_display_format = NumericDisplayFormat(_price_display_format) + + qty_display_factor = d.pop("qtyDisplayFactor", UNSET) + + _qty_display_format = d.pop("qtyDisplayFormat", UNSET) + qty_display_format: Unset | NumericDisplayFormat + if isinstance(_qty_display_format, Unset): + qty_display_format = UNSET + else: + qty_display_format = NumericDisplayFormat(_qty_display_format) + + _security_category = d.pop("securityCategory", UNSET) + security_category: Unset | SecurityCategory + if isinstance(_security_category, Unset): + security_category = UNSET + else: + security_category = SecurityCategory(_security_category) + + symbol = d.pop("symbol", UNSET) + + tick_rule = d.pop("tickRule", UNSET) + + tick_size = d.pop("tickSize", UNSET) + + tick_value = d.pop("tickValue", UNSET) + + traded_exchanges = [] + _traded_exchanges = d.pop("tradedExchanges", UNSET) + for traded_exchanges_item_data in _traded_exchanges or []: + traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) + + traded_exchanges.append(traded_exchanges_item) + + category = d.pop("category", UNSET) + + industry = d.pop("industry", UNSET) + + lot_size = d.pop("lotSize", UNSET) + + sector = d.pop("sector", UNSET) + + stock = cls( + aliases=aliases, + currency=currency, + listed_dt=listed_dt, + delisted_dt=delisted_dt, + description=description, + exchange_id=exchange_id, + id=id, + multiplier=multiplier, + price_base_factor=price_base_factor, + price_display_factor=price_display_factor, + price_display_format=price_display_format, + qty_display_factor=qty_display_factor, + qty_display_format=qty_display_format, + security_category=security_category, + symbol=symbol, + tick_rule=tick_rule, + tick_size=tick_size, + tick_value=tick_value, + traded_exchanges=traded_exchanges, + category=category, + industry=industry, + lot_size=lot_size, + sector=sector, + ) + + return stock diff --git a/openapi/openapi_project/openapi_package/models/stock_aliases.py b/openapi/openapi_project/openapi_package/models/stock_aliases.py new file mode 100644 index 000000000..063df1ec8 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/stock_aliases.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="StockAliases") + + +@_attrs_define +class StockAliases: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field( + init=False, factory=dict + ) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + stock_aliases = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + stock_aliases.additional_properties = additional_properties + return stock_aliases + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/tif.py b/openapi/openapi_project/openapi_package/models/tif.py new file mode 100644 index 000000000..ef5cc26ce --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/tif.py @@ -0,0 +1,17 @@ +from enum import Enum + + +class Tif(str, Enum): + TIF_CLO = "TIF_CLO" + TIF_DAY = "TIF_DAY" + TIF_ETH = "TIF_ETH" + TIF_FOK = "TIF_FOK" + TIF_GTC = "TIF_GTC" + TIF_GTD = "TIF_GTD" + TIF_GTX = "TIF_GTX" + TIF_IOC = "TIF_IOC" + TIF_OPG = "TIF_OPG" + TIF_UNKNOWN = "TIF_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/time_of_day.py b/openapi/openapi_project/openapi_package/models/time_of_day.py new file mode 100644 index 000000000..bd21b0257 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/time_of_day.py @@ -0,0 +1,67 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="TimeOfDay") + + +@_attrs_define +class TimeOfDay: + """ + Attributes: + hours (Union[Unset, int]): + minutes (Union[Unset, int]): + seconds (Union[Unset, int]): + nanos (Union[Unset, int]): + """ + + hours: Unset | int = UNSET + minutes: Unset | int = UNSET + seconds: Unset | int = UNSET + nanos: Unset | int = UNSET + + def to_dict(self) -> dict[str, Any]: + hours = self.hours + + minutes = self.minutes + + seconds = self.seconds + + nanos = self.nanos + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if hours is not UNSET: + field_dict["hours"] = hours + if minutes is not UNSET: + field_dict["minutes"] = minutes + if seconds is not UNSET: + field_dict["seconds"] = seconds + if nanos is not UNSET: + field_dict["nanos"] = nanos + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + hours = d.pop("hours", UNSET) + + minutes = d.pop("minutes", UNSET) + + seconds = d.pop("seconds", UNSET) + + nanos = d.pop("nanos", UNSET) + + time_of_day = cls( + hours=hours, + minutes=minutes, + seconds=seconds, + nanos=nanos, + ) + + return time_of_day diff --git a/openapi/openapi_project/openapi_package/models/tims_class_group.py b/openapi/openapi_project/openapi_package/models/tims_class_group.py new file mode 100644 index 000000000..48f36d699 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/tims_class_group.py @@ -0,0 +1,202 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.tims_position_group import TimsPositionGroup + + +T = TypeVar("T", bound="TimsClassGroup") + + +@_attrs_define +class TimsClassGroup: + """ + Attributes: + delta (Union[Unset, float]): + dollar_delta (Union[Unset, float]): + dollar_gamma (Union[Unset, float]): + gamma (Union[Unset, float]): + hc (Union[Unset, float]): + hc_min (Union[Unset, float]): + long_nav (Union[Unset, float]): + margin_req (Union[Unset, float]): + nav (Union[Unset, float]): + pn_l (Union[Unset, list[float]]): + positions (Union[Unset, list['TimsPositionGroup']]): + product_group (Union[Unset, str]): + rho (Union[Unset, float]): + short_nav (Union[Unset, float]): + symbol (Union[Unset, str]): + theta (Union[Unset, float]): + vega (Union[Unset, float]): + """ + + delta: Unset | float = UNSET + dollar_delta: Unset | float = UNSET + dollar_gamma: Unset | float = UNSET + gamma: Unset | float = UNSET + hc: Unset | float = UNSET + hc_min: Unset | float = UNSET + long_nav: Unset | float = UNSET + margin_req: Unset | float = UNSET + nav: Unset | float = UNSET + pn_l: Unset | list[float] = UNSET + positions: Unset | list["TimsPositionGroup"] = UNSET + product_group: Unset | str = UNSET + rho: Unset | float = UNSET + short_nav: Unset | float = UNSET + symbol: Unset | str = UNSET + theta: Unset | float = UNSET + vega: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + delta = self.delta + + dollar_delta = self.dollar_delta + + dollar_gamma = self.dollar_gamma + + gamma = self.gamma + + hc = self.hc + + hc_min = self.hc_min + + long_nav = self.long_nav + + margin_req = self.margin_req + + nav = self.nav + + pn_l: Unset | list[float] = UNSET + if not isinstance(self.pn_l, Unset): + pn_l = self.pn_l + + positions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.positions, Unset): + positions = [] + for positions_item_data in self.positions: + positions_item = positions_item_data.to_dict() + positions.append(positions_item) + + product_group = self.product_group + + rho = self.rho + + short_nav = self.short_nav + + symbol = self.symbol + + theta = self.theta + + vega = self.vega + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if delta is not UNSET: + field_dict["delta"] = delta + if dollar_delta is not UNSET: + field_dict["dollarDelta"] = dollar_delta + if dollar_gamma is not UNSET: + field_dict["dollarGamma"] = dollar_gamma + if gamma is not UNSET: + field_dict["gamma"] = gamma + if hc is not UNSET: + field_dict["hc"] = hc + if hc_min is not UNSET: + field_dict["hcMin"] = hc_min + if long_nav is not UNSET: + field_dict["longNav"] = long_nav + if margin_req is not UNSET: + field_dict["marginReq"] = margin_req + if nav is not UNSET: + field_dict["nav"] = nav + if pn_l is not UNSET: + field_dict["pnL"] = pn_l + if positions is not UNSET: + field_dict["positions"] = positions + if product_group is not UNSET: + field_dict["productGroup"] = product_group + if rho is not UNSET: + field_dict["rho"] = rho + if short_nav is not UNSET: + field_dict["shortNav"] = short_nav + if symbol is not UNSET: + field_dict["symbol"] = symbol + if theta is not UNSET: + field_dict["theta"] = theta + if vega is not UNSET: + field_dict["vega"] = vega + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.tims_position_group import TimsPositionGroup + + d = dict(src_dict) + delta = d.pop("delta", UNSET) + + dollar_delta = d.pop("dollarDelta", UNSET) + + dollar_gamma = d.pop("dollarGamma", UNSET) + + gamma = d.pop("gamma", UNSET) + + hc = d.pop("hc", UNSET) + + hc_min = d.pop("hcMin", UNSET) + + long_nav = d.pop("longNav", UNSET) + + margin_req = d.pop("marginReq", UNSET) + + nav = d.pop("nav", UNSET) + + pn_l = cast(list[float], d.pop("pnL", UNSET)) + + positions = [] + _positions = d.pop("positions", UNSET) + for positions_item_data in _positions or []: + positions_item = TimsPositionGroup.from_dict(positions_item_data) + + positions.append(positions_item) + + product_group = d.pop("productGroup", UNSET) + + rho = d.pop("rho", UNSET) + + short_nav = d.pop("shortNav", UNSET) + + symbol = d.pop("symbol", UNSET) + + theta = d.pop("theta", UNSET) + + vega = d.pop("vega", UNSET) + + tims_class_group = cls( + delta=delta, + dollar_delta=dollar_delta, + dollar_gamma=dollar_gamma, + gamma=gamma, + hc=hc, + hc_min=hc_min, + long_nav=long_nav, + margin_req=margin_req, + nav=nav, + pn_l=pn_l, + positions=positions, + product_group=product_group, + rho=rho, + short_nav=short_nav, + symbol=symbol, + theta=theta, + vega=vega, + ) + + return tims_class_group diff --git a/openapi/openapi_project/openapi_package/models/tims_margin_data.py b/openapi/openapi_project/openapi_package/models/tims_margin_data.py new file mode 100644 index 000000000..897d4e247 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/tims_margin_data.py @@ -0,0 +1,220 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.currency import Currency +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.tims_class_group import TimsClassGroup + from ..models.tims_product_group import TimsProductGroup + + +T = TypeVar("T", bound="TimsMarginData") + + +@_attrs_define +class TimsMarginData: + """ + Attributes: + account_type (Union[Unset, str]): + class_group_count (Union[Unset, int]): + class_groups (Union[Unset, list['TimsClassGroup']]): + currency (Union[Unset, Currency]): + dollar_delta (Union[Unset, float]): + dollar_gamma (Union[Unset, float]): + long_nav (Union[Unset, float]): + margin_req (Union[Unset, float]): + nav (Union[Unset, float]): + porfolio_group_count (Union[Unset, int]): + position_group_count (Union[Unset, int]): + product_group_count (Union[Unset, int]): + product_groups (Union[Unset, list['TimsProductGroup']]): + rho (Union[Unset, float]): + short_nav (Union[Unset, float]): + theta (Union[Unset, float]): + vega (Union[Unset, float]): + """ + + account_type: Unset | str = UNSET + class_group_count: Unset | int = UNSET + class_groups: Unset | list["TimsClassGroup"] = UNSET + currency: Unset | Currency = UNSET + dollar_delta: Unset | float = UNSET + dollar_gamma: Unset | float = UNSET + long_nav: Unset | float = UNSET + margin_req: Unset | float = UNSET + nav: Unset | float = UNSET + porfolio_group_count: Unset | int = UNSET + position_group_count: Unset | int = UNSET + product_group_count: Unset | int = UNSET + product_groups: Unset | list["TimsProductGroup"] = UNSET + rho: Unset | float = UNSET + short_nav: Unset | float = UNSET + theta: Unset | float = UNSET + vega: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + account_type = self.account_type + + class_group_count = self.class_group_count + + class_groups: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.class_groups, Unset): + class_groups = [] + for class_groups_item_data in self.class_groups: + class_groups_item = class_groups_item_data.to_dict() + class_groups.append(class_groups_item) + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + dollar_delta = self.dollar_delta + + dollar_gamma = self.dollar_gamma + + long_nav = self.long_nav + + margin_req = self.margin_req + + nav = self.nav + + porfolio_group_count = self.porfolio_group_count + + position_group_count = self.position_group_count + + product_group_count = self.product_group_count + + product_groups: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.product_groups, Unset): + product_groups = [] + for product_groups_item_data in self.product_groups: + product_groups_item = product_groups_item_data.to_dict() + product_groups.append(product_groups_item) + + rho = self.rho + + short_nav = self.short_nav + + theta = self.theta + + vega = self.vega + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_type is not UNSET: + field_dict["accountType"] = account_type + if class_group_count is not UNSET: + field_dict["classGroupCount"] = class_group_count + if class_groups is not UNSET: + field_dict["classGroups"] = class_groups + if currency is not UNSET: + field_dict["currency"] = currency + if dollar_delta is not UNSET: + field_dict["dollarDelta"] = dollar_delta + if dollar_gamma is not UNSET: + field_dict["dollarGamma"] = dollar_gamma + if long_nav is not UNSET: + field_dict["longNav"] = long_nav + if margin_req is not UNSET: + field_dict["marginReq"] = margin_req + if nav is not UNSET: + field_dict["nav"] = nav + if porfolio_group_count is not UNSET: + field_dict["porfolioGroupCount"] = porfolio_group_count + if position_group_count is not UNSET: + field_dict["positionGroupCount"] = position_group_count + if product_group_count is not UNSET: + field_dict["productGroupCount"] = product_group_count + if product_groups is not UNSET: + field_dict["productGroups"] = product_groups + if rho is not UNSET: + field_dict["rho"] = rho + if short_nav is not UNSET: + field_dict["shortNav"] = short_nav + if theta is not UNSET: + field_dict["theta"] = theta + if vega is not UNSET: + field_dict["vega"] = vega + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.tims_class_group import TimsClassGroup + from ..models.tims_product_group import TimsProductGroup + + d = dict(src_dict) + account_type = d.pop("accountType", UNSET) + + class_group_count = d.pop("classGroupCount", UNSET) + + class_groups = [] + _class_groups = d.pop("classGroups", UNSET) + for class_groups_item_data in _class_groups or []: + class_groups_item = TimsClassGroup.from_dict(class_groups_item_data) + + class_groups.append(class_groups_item) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + dollar_delta = d.pop("dollarDelta", UNSET) + + dollar_gamma = d.pop("dollarGamma", UNSET) + + long_nav = d.pop("longNav", UNSET) + + margin_req = d.pop("marginReq", UNSET) + + nav = d.pop("nav", UNSET) + + porfolio_group_count = d.pop("porfolioGroupCount", UNSET) + + position_group_count = d.pop("positionGroupCount", UNSET) + + product_group_count = d.pop("productGroupCount", UNSET) + + product_groups = [] + _product_groups = d.pop("productGroups", UNSET) + for product_groups_item_data in _product_groups or []: + product_groups_item = TimsProductGroup.from_dict(product_groups_item_data) + + product_groups.append(product_groups_item) + + rho = d.pop("rho", UNSET) + + short_nav = d.pop("shortNav", UNSET) + + theta = d.pop("theta", UNSET) + + vega = d.pop("vega", UNSET) + + tims_margin_data = cls( + account_type=account_type, + class_group_count=class_group_count, + class_groups=class_groups, + currency=currency, + dollar_delta=dollar_delta, + dollar_gamma=dollar_gamma, + long_nav=long_nav, + margin_req=margin_req, + nav=nav, + porfolio_group_count=porfolio_group_count, + position_group_count=position_group_count, + product_group_count=product_group_count, + product_groups=product_groups, + rho=rho, + short_nav=short_nav, + theta=theta, + vega=vega, + ) + + return tims_margin_data diff --git a/openapi/openapi_project/openapi_package/models/tims_position_group.py b/openapi/openapi_project/openapi_package/models/tims_position_group.py new file mode 100644 index 000000000..f11038384 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/tims_position_group.py @@ -0,0 +1,159 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="TimsPositionGroup") + + +@_attrs_define +class TimsPositionGroup: + """ + Attributes: + delta (Union[Unset, float]): + gamma (Union[Unset, float]): + hc_min (Union[Unset, float]): + hc_minval (Union[Unset, float]): + margin_req (Union[Unset, float]): + nav (Union[Unset, float]): + pn_l (Union[Unset, list[float]]): + price (Union[Unset, float]): + qty (Union[Unset, float]): + rho (Union[Unset, float]): + rpg_root (Union[Unset, str]): + symbol (Union[Unset, str]): + theta (Union[Unset, float]): + vega (Union[Unset, float]): + """ + + delta: Unset | float = UNSET + gamma: Unset | float = UNSET + hc_min: Unset | float = UNSET + hc_minval: Unset | float = UNSET + margin_req: Unset | float = UNSET + nav: Unset | float = UNSET + pn_l: Unset | list[float] = UNSET + price: Unset | float = UNSET + qty: Unset | float = UNSET + rho: Unset | float = UNSET + rpg_root: Unset | str = UNSET + symbol: Unset | str = UNSET + theta: Unset | float = UNSET + vega: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + delta = self.delta + + gamma = self.gamma + + hc_min = self.hc_min + + hc_minval = self.hc_minval + + margin_req = self.margin_req + + nav = self.nav + + pn_l: Unset | list[float] = UNSET + if not isinstance(self.pn_l, Unset): + pn_l = self.pn_l + + price = self.price + + qty = self.qty + + rho = self.rho + + rpg_root = self.rpg_root + + symbol = self.symbol + + theta = self.theta + + vega = self.vega + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if delta is not UNSET: + field_dict["delta"] = delta + if gamma is not UNSET: + field_dict["gamma"] = gamma + if hc_min is not UNSET: + field_dict["hcMin"] = hc_min + if hc_minval is not UNSET: + field_dict["hcMinval"] = hc_minval + if margin_req is not UNSET: + field_dict["marginReq"] = margin_req + if nav is not UNSET: + field_dict["nav"] = nav + if pn_l is not UNSET: + field_dict["pnL"] = pn_l + if price is not UNSET: + field_dict["price"] = price + if qty is not UNSET: + field_dict["qty"] = qty + if rho is not UNSET: + field_dict["rho"] = rho + if rpg_root is not UNSET: + field_dict["rpgRoot"] = rpg_root + if symbol is not UNSET: + field_dict["symbol"] = symbol + if theta is not UNSET: + field_dict["theta"] = theta + if vega is not UNSET: + field_dict["vega"] = vega + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + delta = d.pop("delta", UNSET) + + gamma = d.pop("gamma", UNSET) + + hc_min = d.pop("hcMin", UNSET) + + hc_minval = d.pop("hcMinval", UNSET) + + margin_req = d.pop("marginReq", UNSET) + + nav = d.pop("nav", UNSET) + + pn_l = cast(list[float], d.pop("pnL", UNSET)) + + price = d.pop("price", UNSET) + + qty = d.pop("qty", UNSET) + + rho = d.pop("rho", UNSET) + + rpg_root = d.pop("rpgRoot", UNSET) + + symbol = d.pop("symbol", UNSET) + + theta = d.pop("theta", UNSET) + + vega = d.pop("vega", UNSET) + + tims_position_group = cls( + delta=delta, + gamma=gamma, + hc_min=hc_min, + hc_minval=hc_minval, + margin_req=margin_req, + nav=nav, + pn_l=pn_l, + price=price, + qty=qty, + rho=rho, + rpg_root=rpg_root, + symbol=symbol, + theta=theta, + vega=vega, + ) + + return tims_position_group diff --git a/openapi/openapi_project/openapi_package/models/tims_product_group.py b/openapi/openapi_project/openapi_package/models/tims_product_group.py new file mode 100644 index 000000000..74d943e14 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/tims_product_group.py @@ -0,0 +1,177 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="TimsProductGroup") + + +@_attrs_define +class TimsProductGroup: + """ + Attributes: + delta (Union[Unset, float]): + dollar_delta (Union[Unset, float]): + dollar_gamma (Union[Unset, float]): + gamma (Union[Unset, float]): + group (Union[Unset, str]): + hc (Union[Unset, float]): + hc_min (Union[Unset, float]): + long_nav (Union[Unset, float]): + margin_req (Union[Unset, float]): + nav (Union[Unset, float]): + pn_l_range (Union[Unset, list[float]]): + portfolio_group (Union[Unset, str]): + rho (Union[Unset, float]): + short_nav (Union[Unset, float]): + theta (Union[Unset, float]): + vega (Union[Unset, float]): + """ + + delta: Unset | float = UNSET + dollar_delta: Unset | float = UNSET + dollar_gamma: Unset | float = UNSET + gamma: Unset | float = UNSET + group: Unset | str = UNSET + hc: Unset | float = UNSET + hc_min: Unset | float = UNSET + long_nav: Unset | float = UNSET + margin_req: Unset | float = UNSET + nav: Unset | float = UNSET + pn_l_range: Unset | list[float] = UNSET + portfolio_group: Unset | str = UNSET + rho: Unset | float = UNSET + short_nav: Unset | float = UNSET + theta: Unset | float = UNSET + vega: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + delta = self.delta + + dollar_delta = self.dollar_delta + + dollar_gamma = self.dollar_gamma + + gamma = self.gamma + + group = self.group + + hc = self.hc + + hc_min = self.hc_min + + long_nav = self.long_nav + + margin_req = self.margin_req + + nav = self.nav + + pn_l_range: Unset | list[float] = UNSET + if not isinstance(self.pn_l_range, Unset): + pn_l_range = self.pn_l_range + + portfolio_group = self.portfolio_group + + rho = self.rho + + short_nav = self.short_nav + + theta = self.theta + + vega = self.vega + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if delta is not UNSET: + field_dict["delta"] = delta + if dollar_delta is not UNSET: + field_dict["dollarDelta"] = dollar_delta + if dollar_gamma is not UNSET: + field_dict["dollarGamma"] = dollar_gamma + if gamma is not UNSET: + field_dict["gamma"] = gamma + if group is not UNSET: + field_dict["group"] = group + if hc is not UNSET: + field_dict["hc"] = hc + if hc_min is not UNSET: + field_dict["hcMin"] = hc_min + if long_nav is not UNSET: + field_dict["longNav"] = long_nav + if margin_req is not UNSET: + field_dict["marginReq"] = margin_req + if nav is not UNSET: + field_dict["nav"] = nav + if pn_l_range is not UNSET: + field_dict["pnLRange"] = pn_l_range + if portfolio_group is not UNSET: + field_dict["portfolioGroup"] = portfolio_group + if rho is not UNSET: + field_dict["rho"] = rho + if short_nav is not UNSET: + field_dict["shortNav"] = short_nav + if theta is not UNSET: + field_dict["theta"] = theta + if vega is not UNSET: + field_dict["vega"] = vega + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + delta = d.pop("delta", UNSET) + + dollar_delta = d.pop("dollarDelta", UNSET) + + dollar_gamma = d.pop("dollarGamma", UNSET) + + gamma = d.pop("gamma", UNSET) + + group = d.pop("group", UNSET) + + hc = d.pop("hc", UNSET) + + hc_min = d.pop("hcMin", UNSET) + + long_nav = d.pop("longNav", UNSET) + + margin_req = d.pop("marginReq", UNSET) + + nav = d.pop("nav", UNSET) + + pn_l_range = cast(list[float], d.pop("pnLRange", UNSET)) + + portfolio_group = d.pop("portfolioGroup", UNSET) + + rho = d.pop("rho", UNSET) + + short_nav = d.pop("shortNav", UNSET) + + theta = d.pop("theta", UNSET) + + vega = d.pop("vega", UNSET) + + tims_product_group = cls( + delta=delta, + dollar_delta=dollar_delta, + dollar_gamma=dollar_gamma, + gamma=gamma, + group=group, + hc=hc, + hc_min=hc_min, + long_nav=long_nav, + margin_req=margin_req, + nav=nav, + pn_l_range=pn_l_range, + portfolio_group=portfolio_group, + rho=rho, + short_nav=short_nav, + theta=theta, + vega=vega, + ) + + return tims_product_group diff --git a/openapi/openapi_project/openapi_package/models/trade_confirm.py b/openapi/openapi_project/openapi_package/models/trade_confirm.py new file mode 100644 index 000000000..a7697c36e --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/trade_confirm.py @@ -0,0 +1,935 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.capacity_code import CapacityCode +from ..models.clearing_range import ClearingRange +from ..models.cross_side_type import CrossSideType +from ..models.cross_type import CrossType +from ..models.exec_type import ExecType +from ..models.multi_leg_reporting_type import MultiLegReportingType +from ..models.option_exercise_style import OptionExerciseStyle +from ..models.option_settlement_type import OptionSettlementType +from ..models.ord_type import OrdType +from ..models.origination_type import OriginationType +from ..models.position_effect import PositionEffect +from ..models.price_type import PriceType +from ..models.put_call import PutCall +from ..models.security_type import SecurityType +from ..models.side import Side +from ..models.tif import Tif +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.date import Date + + +T = TypeVar("T", bound="TradeConfirm") + + +@_attrs_define +class TradeConfirm: + """ + Attributes: + account_id (Union[Unset, int]): + account_name (Union[Unset, str]): + alloc_id (Union[Unset, str]): + alloc_qty (Union[Unset, float]): + aux_price (Union[Unset, float]): + avg_price (Union[Unset, float]): + billing_code (Union[Unset, str]): + capacity (Union[Unset, CapacityCode]): + clearing_account (Union[Unset, str]): + clearing_range (Union[Unset, ClearingRange]): + client_id (Union[Unset, str]): + cmta (Union[Unset, str]): + commission (Union[Unset, float]): + cross_side_type (Union[Unset, CrossSideType]): + cross_type (Union[Unset, CrossType]): + cum_qty (Union[Unset, float]): + cur_ord_id (Union[Unset, str]): + deliver_to_compid (Union[Unset, str]): + deliver_to_subid (Union[Unset, str]): + description (Union[Unset, str]): + drop (Union[Unset, bool]): + efid (Union[Unset, str]): + exec_broker (Union[Unset, str]): + exec_id (Union[Unset, str]): + exec_ref_id (Union[Unset, str]): + exec_type (Union[Unset, ExecType]): + exercise_style (Union[Unset, OptionExerciseStyle]): + expiration_dt (Union[Unset, Date]): + fee1 (Union[Unset, float]): + fee2 (Union[Unset, float]): + frequent_trader_id (Union[Unset, str]): + give_up (Union[Unset, str]): + id (Union[Unset, int]): + incoming_cl_ord_id (Union[Unset, str]): + incoming_ord_id (Union[Unset, str]): + incoming_orig_clord_id (Union[Unset, str]): + last_market (Union[Unset, str]): + last_price (Union[Unset, float]): + last_qty (Union[Unset, float]): + leaves_qty (Union[Unset, float]): + leg_id (Union[Unset, str]): + liquidity_flag (Union[Unset, str]): + locate_id (Union[Unset, str]): + mpid (Union[Unset, str]): + multi_leg_reportingtype (Union[Unset, MultiLegReportingType]): + ord_type (Union[Unset, OrdType]): + origination_type (Union[Unset, OriginationType]): + orig_ord_id (Union[Unset, str]): + parent_ord_id (Union[Unset, str]): + perm_ord_id (Union[Unset, str]): + position_effect (Union[Unset, PositionEffect]): + price (Union[Unset, float]): + price_type (Union[Unset, PriceType]): + put_call (Union[Unset, PutCall]): + qty (Union[Unset, float]): + req_ord_id (Union[Unset, str]): + root (Union[Unset, str]): + route (Union[Unset, str]): + routing_session (Union[Unset, str]): + security_type (Union[Unset, SecurityType]): + settlement_type (Union[Unset, OptionSettlementType]): + side (Union[Unset, Side]): + source (Union[Unset, str]): + source_address (Union[Unset, str]): + strategy_id (Union[Unset, str]): + strike (Union[Unset, float]): + symbol (Union[Unset, str]): + tag (Union[Unset, str]): + tag1 (Union[Unset, str]): + target_comp_id (Union[Unset, str]): + target_sub_id (Union[Unset, str]): + text (Union[Unset, str]): + tif (Union[Unset, Tif]): + traded_dt (Union[Unset, Date]): + trader_id (Union[Unset, str]): + trading_firm_id (Union[Unset, int]): + transact_ts (Union[Unset, str]): + underlying (Union[Unset, str]): + user_id (Union[Unset, int]): + working_qty (Union[Unset, float]): + multiplier (Union[Unset, float]): + dac_delta (Union[Unset, float]): + dac_reference_price (Union[Unset, float]): + manual_fill_time (Union[Unset, str]): + """ + + account_id: Unset | int = UNSET + account_name: Unset | str = UNSET + alloc_id: Unset | str = UNSET + alloc_qty: Unset | float = UNSET + aux_price: Unset | float = UNSET + avg_price: Unset | float = UNSET + billing_code: Unset | str = UNSET + capacity: Unset | CapacityCode = UNSET + clearing_account: Unset | str = UNSET + clearing_range: Unset | ClearingRange = UNSET + client_id: Unset | str = UNSET + cmta: Unset | str = UNSET + commission: Unset | float = UNSET + cross_side_type: Unset | CrossSideType = UNSET + cross_type: Unset | CrossType = UNSET + cum_qty: Unset | float = UNSET + cur_ord_id: Unset | str = UNSET + deliver_to_compid: Unset | str = UNSET + deliver_to_subid: Unset | str = UNSET + description: Unset | str = UNSET + drop: Unset | bool = UNSET + efid: Unset | str = UNSET + exec_broker: Unset | str = UNSET + exec_id: Unset | str = UNSET + exec_ref_id: Unset | str = UNSET + exec_type: Unset | ExecType = UNSET + exercise_style: Unset | OptionExerciseStyle = UNSET + expiration_dt: Union[Unset, "Date"] = UNSET + fee1: Unset | float = UNSET + fee2: Unset | float = UNSET + frequent_trader_id: Unset | str = UNSET + give_up: Unset | str = UNSET + id: Unset | int = UNSET + incoming_cl_ord_id: Unset | str = UNSET + incoming_ord_id: Unset | str = UNSET + incoming_orig_clord_id: Unset | str = UNSET + last_market: Unset | str = UNSET + last_price: Unset | float = UNSET + last_qty: Unset | float = UNSET + leaves_qty: Unset | float = UNSET + leg_id: Unset | str = UNSET + liquidity_flag: Unset | str = UNSET + locate_id: Unset | str = UNSET + mpid: Unset | str = UNSET + multi_leg_reportingtype: Unset | MultiLegReportingType = UNSET + ord_type: Unset | OrdType = UNSET + origination_type: Unset | OriginationType = UNSET + orig_ord_id: Unset | str = UNSET + parent_ord_id: Unset | str = UNSET + perm_ord_id: Unset | str = UNSET + position_effect: Unset | PositionEffect = UNSET + price: Unset | float = UNSET + price_type: Unset | PriceType = UNSET + put_call: Unset | PutCall = UNSET + qty: Unset | float = UNSET + req_ord_id: Unset | str = UNSET + root: Unset | str = UNSET + route: Unset | str = UNSET + routing_session: Unset | str = UNSET + security_type: Unset | SecurityType = UNSET + settlement_type: Unset | OptionSettlementType = UNSET + side: Unset | Side = UNSET + source: Unset | str = UNSET + source_address: Unset | str = UNSET + strategy_id: Unset | str = UNSET + strike: Unset | float = UNSET + symbol: Unset | str = UNSET + tag: Unset | str = UNSET + tag1: Unset | str = UNSET + target_comp_id: Unset | str = UNSET + target_sub_id: Unset | str = UNSET + text: Unset | str = UNSET + tif: Unset | Tif = UNSET + traded_dt: Union[Unset, "Date"] = UNSET + trader_id: Unset | str = UNSET + trading_firm_id: Unset | int = UNSET + transact_ts: Unset | str = UNSET + underlying: Unset | str = UNSET + user_id: Unset | int = UNSET + working_qty: Unset | float = UNSET + multiplier: Unset | float = UNSET + dac_delta: Unset | float = UNSET + dac_reference_price: Unset | float = UNSET + manual_fill_time: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + account_name = self.account_name + + alloc_id = self.alloc_id + + alloc_qty = self.alloc_qty + + aux_price = self.aux_price + + avg_price = self.avg_price + + billing_code = self.billing_code + + capacity: Unset | str = UNSET + if not isinstance(self.capacity, Unset): + capacity = self.capacity.value + + clearing_account = self.clearing_account + + clearing_range: Unset | str = UNSET + if not isinstance(self.clearing_range, Unset): + clearing_range = self.clearing_range.value + + client_id = self.client_id + + cmta = self.cmta + + commission = self.commission + + cross_side_type: Unset | str = UNSET + if not isinstance(self.cross_side_type, Unset): + cross_side_type = self.cross_side_type.value + + cross_type: Unset | str = UNSET + if not isinstance(self.cross_type, Unset): + cross_type = self.cross_type.value + + cum_qty = self.cum_qty + + cur_ord_id = self.cur_ord_id + + deliver_to_compid = self.deliver_to_compid + + deliver_to_subid = self.deliver_to_subid + + description = self.description + + drop = self.drop + + efid = self.efid + + exec_broker = self.exec_broker + + exec_id = self.exec_id + + exec_ref_id = self.exec_ref_id + + exec_type: Unset | str = UNSET + if not isinstance(self.exec_type, Unset): + exec_type = self.exec_type.value + + exercise_style: Unset | str = UNSET + if not isinstance(self.exercise_style, Unset): + exercise_style = self.exercise_style.value + + expiration_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.expiration_dt, Unset): + expiration_dt = self.expiration_dt.to_dict() + + fee1 = self.fee1 + + fee2 = self.fee2 + + frequent_trader_id = self.frequent_trader_id + + give_up = self.give_up + + id = self.id + + incoming_cl_ord_id = self.incoming_cl_ord_id + + incoming_ord_id = self.incoming_ord_id + + incoming_orig_clord_id = self.incoming_orig_clord_id + + last_market = self.last_market + + last_price = self.last_price + + last_qty = self.last_qty + + leaves_qty = self.leaves_qty + + leg_id = self.leg_id + + liquidity_flag = self.liquidity_flag + + locate_id = self.locate_id + + mpid = self.mpid + + multi_leg_reportingtype: Unset | str = UNSET + if not isinstance(self.multi_leg_reportingtype, Unset): + multi_leg_reportingtype = self.multi_leg_reportingtype.value + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + origination_type: Unset | str = UNSET + if not isinstance(self.origination_type, Unset): + origination_type = self.origination_type.value + + orig_ord_id = self.orig_ord_id + + parent_ord_id = self.parent_ord_id + + perm_ord_id = self.perm_ord_id + + position_effect: Unset | str = UNSET + if not isinstance(self.position_effect, Unset): + position_effect = self.position_effect.value + + price = self.price + + price_type: Unset | str = UNSET + if not isinstance(self.price_type, Unset): + price_type = self.price_type.value + + put_call: Unset | str = UNSET + if not isinstance(self.put_call, Unset): + put_call = self.put_call.value + + qty = self.qty + + req_ord_id = self.req_ord_id + + root = self.root + + route = self.route + + routing_session = self.routing_session + + security_type: Unset | str = UNSET + if not isinstance(self.security_type, Unset): + security_type = self.security_type.value + + settlement_type: Unset | str = UNSET + if not isinstance(self.settlement_type, Unset): + settlement_type = self.settlement_type.value + + side: Unset | str = UNSET + if not isinstance(self.side, Unset): + side = self.side.value + + source = self.source + + source_address = self.source_address + + strategy_id = self.strategy_id + + strike = self.strike + + symbol = self.symbol + + tag = self.tag + + tag1 = self.tag1 + + target_comp_id = self.target_comp_id + + target_sub_id = self.target_sub_id + + text = self.text + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + traded_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.traded_dt, Unset): + traded_dt = self.traded_dt.to_dict() + + trader_id = self.trader_id + + trading_firm_id = self.trading_firm_id + + transact_ts = self.transact_ts + + underlying = self.underlying + + user_id = self.user_id + + working_qty = self.working_qty + + multiplier = self.multiplier + + dac_delta = self.dac_delta + + dac_reference_price = self.dac_reference_price + + manual_fill_time = self.manual_fill_time + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if account_name is not UNSET: + field_dict["accountName"] = account_name + if alloc_id is not UNSET: + field_dict["allocId"] = alloc_id + if alloc_qty is not UNSET: + field_dict["allocQty"] = alloc_qty + if aux_price is not UNSET: + field_dict["auxPrice"] = aux_price + if avg_price is not UNSET: + field_dict["avgPrice"] = avg_price + if billing_code is not UNSET: + field_dict["billingCode"] = billing_code + if capacity is not UNSET: + field_dict["capacity"] = capacity + if clearing_account is not UNSET: + field_dict["clearingAccount"] = clearing_account + if clearing_range is not UNSET: + field_dict["clearingRange"] = clearing_range + if client_id is not UNSET: + field_dict["clientId"] = client_id + if cmta is not UNSET: + field_dict["cmta"] = cmta + if commission is not UNSET: + field_dict["commission"] = commission + if cross_side_type is not UNSET: + field_dict["crossSideType"] = cross_side_type + if cross_type is not UNSET: + field_dict["crossType"] = cross_type + if cum_qty is not UNSET: + field_dict["cumQty"] = cum_qty + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if deliver_to_compid is not UNSET: + field_dict["deliverToCompid"] = deliver_to_compid + if deliver_to_subid is not UNSET: + field_dict["deliverToSubid"] = deliver_to_subid + if description is not UNSET: + field_dict["description"] = description + if drop is not UNSET: + field_dict["drop"] = drop + if efid is not UNSET: + field_dict["efid"] = efid + if exec_broker is not UNSET: + field_dict["execBroker"] = exec_broker + if exec_id is not UNSET: + field_dict["execId"] = exec_id + if exec_ref_id is not UNSET: + field_dict["execRefId"] = exec_ref_id + if exec_type is not UNSET: + field_dict["execType"] = exec_type + if exercise_style is not UNSET: + field_dict["exerciseStyle"] = exercise_style + if expiration_dt is not UNSET: + field_dict["expirationDt"] = expiration_dt + if fee1 is not UNSET: + field_dict["fee1"] = fee1 + if fee2 is not UNSET: + field_dict["fee2"] = fee2 + if frequent_trader_id is not UNSET: + field_dict["frequentTraderId"] = frequent_trader_id + if give_up is not UNSET: + field_dict["giveUp"] = give_up + if id is not UNSET: + field_dict["id"] = id + if incoming_cl_ord_id is not UNSET: + field_dict["incomingClOrdId"] = incoming_cl_ord_id + if incoming_ord_id is not UNSET: + field_dict["incomingOrdId"] = incoming_ord_id + if incoming_orig_clord_id is not UNSET: + field_dict["incomingOrigClordId"] = incoming_orig_clord_id + if last_market is not UNSET: + field_dict["lastMarket"] = last_market + if last_price is not UNSET: + field_dict["lastPrice"] = last_price + if last_qty is not UNSET: + field_dict["lastQty"] = last_qty + if leaves_qty is not UNSET: + field_dict["leavesQty"] = leaves_qty + if leg_id is not UNSET: + field_dict["legId"] = leg_id + if liquidity_flag is not UNSET: + field_dict["liquidityFlag"] = liquidity_flag + if locate_id is not UNSET: + field_dict["locateId"] = locate_id + if mpid is not UNSET: + field_dict["mpid"] = mpid + if multi_leg_reportingtype is not UNSET: + field_dict["multiLegReportingtype"] = multi_leg_reportingtype + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if origination_type is not UNSET: + field_dict["originationType"] = origination_type + if orig_ord_id is not UNSET: + field_dict["origOrdId"] = orig_ord_id + if parent_ord_id is not UNSET: + field_dict["parentOrdId"] = parent_ord_id + if perm_ord_id is not UNSET: + field_dict["permOrdId"] = perm_ord_id + if position_effect is not UNSET: + field_dict["positionEffect"] = position_effect + if price is not UNSET: + field_dict["price"] = price + if price_type is not UNSET: + field_dict["priceType"] = price_type + if put_call is not UNSET: + field_dict["putCall"] = put_call + if qty is not UNSET: + field_dict["qty"] = qty + if req_ord_id is not UNSET: + field_dict["reqOrdId"] = req_ord_id + if root is not UNSET: + field_dict["root"] = root + if route is not UNSET: + field_dict["route"] = route + if routing_session is not UNSET: + field_dict["routingSession"] = routing_session + if security_type is not UNSET: + field_dict["securityType"] = security_type + if settlement_type is not UNSET: + field_dict["settlementType"] = settlement_type + if side is not UNSET: + field_dict["side"] = side + if source is not UNSET: + field_dict["source"] = source + if source_address is not UNSET: + field_dict["sourceAddress"] = source_address + if strategy_id is not UNSET: + field_dict["strategyId"] = strategy_id + if strike is not UNSET: + field_dict["strike"] = strike + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tag is not UNSET: + field_dict["tag"] = tag + if tag1 is not UNSET: + field_dict["tag1"] = tag1 + if target_comp_id is not UNSET: + field_dict["targetCompId"] = target_comp_id + if target_sub_id is not UNSET: + field_dict["targetSubId"] = target_sub_id + if text is not UNSET: + field_dict["text"] = text + if tif is not UNSET: + field_dict["tif"] = tif + if traded_dt is not UNSET: + field_dict["tradedDt"] = traded_dt + if trader_id is not UNSET: + field_dict["traderId"] = trader_id + if trading_firm_id is not UNSET: + field_dict["tradingFirmId"] = trading_firm_id + if transact_ts is not UNSET: + field_dict["transactTs"] = transact_ts + if underlying is not UNSET: + field_dict["underlying"] = underlying + if user_id is not UNSET: + field_dict["userId"] = user_id + if working_qty is not UNSET: + field_dict["workingQty"] = working_qty + if multiplier is not UNSET: + field_dict["multiplier"] = multiplier + if dac_delta is not UNSET: + field_dict["dacDelta"] = dac_delta + if dac_reference_price is not UNSET: + field_dict["dacReferencePrice"] = dac_reference_price + if manual_fill_time is not UNSET: + field_dict["manualFillTime"] = manual_fill_time + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.date import Date + + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + account_name = d.pop("accountName", UNSET) + + alloc_id = d.pop("allocId", UNSET) + + alloc_qty = d.pop("allocQty", UNSET) + + aux_price = d.pop("auxPrice", UNSET) + + avg_price = d.pop("avgPrice", UNSET) + + billing_code = d.pop("billingCode", UNSET) + + _capacity = d.pop("capacity", UNSET) + capacity: Unset | CapacityCode + if isinstance(_capacity, Unset): + capacity = UNSET + else: + capacity = CapacityCode(_capacity) + + clearing_account = d.pop("clearingAccount", UNSET) + + _clearing_range = d.pop("clearingRange", UNSET) + clearing_range: Unset | ClearingRange + if isinstance(_clearing_range, Unset): + clearing_range = UNSET + else: + clearing_range = ClearingRange(_clearing_range) + + client_id = d.pop("clientId", UNSET) + + cmta = d.pop("cmta", UNSET) + + commission = d.pop("commission", UNSET) + + _cross_side_type = d.pop("crossSideType", UNSET) + cross_side_type: Unset | CrossSideType + if isinstance(_cross_side_type, Unset): + cross_side_type = UNSET + else: + cross_side_type = CrossSideType(_cross_side_type) + + _cross_type = d.pop("crossType", UNSET) + cross_type: Unset | CrossType + if isinstance(_cross_type, Unset): + cross_type = UNSET + else: + cross_type = CrossType(_cross_type) + + cum_qty = d.pop("cumQty", UNSET) + + cur_ord_id = d.pop("curOrdId", UNSET) + + deliver_to_compid = d.pop("deliverToCompid", UNSET) + + deliver_to_subid = d.pop("deliverToSubid", UNSET) + + description = d.pop("description", UNSET) + + drop = d.pop("drop", UNSET) + + efid = d.pop("efid", UNSET) + + exec_broker = d.pop("execBroker", UNSET) + + exec_id = d.pop("execId", UNSET) + + exec_ref_id = d.pop("execRefId", UNSET) + + _exec_type = d.pop("execType", UNSET) + exec_type: Unset | ExecType + if isinstance(_exec_type, Unset): + exec_type = UNSET + else: + exec_type = ExecType(_exec_type) + + _exercise_style = d.pop("exerciseStyle", UNSET) + exercise_style: Unset | OptionExerciseStyle + if isinstance(_exercise_style, Unset): + exercise_style = UNSET + else: + exercise_style = OptionExerciseStyle(_exercise_style) + + _expiration_dt = d.pop("expirationDt", UNSET) + expiration_dt: Unset | Date + if isinstance(_expiration_dt, Unset): + expiration_dt = UNSET + else: + expiration_dt = Date.from_dict(_expiration_dt) + + fee1 = d.pop("fee1", UNSET) + + fee2 = d.pop("fee2", UNSET) + + frequent_trader_id = d.pop("frequentTraderId", UNSET) + + give_up = d.pop("giveUp", UNSET) + + id = d.pop("id", UNSET) + + incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) + + incoming_ord_id = d.pop("incomingOrdId", UNSET) + + incoming_orig_clord_id = d.pop("incomingOrigClordId", UNSET) + + last_market = d.pop("lastMarket", UNSET) + + last_price = d.pop("lastPrice", UNSET) + + last_qty = d.pop("lastQty", UNSET) + + leaves_qty = d.pop("leavesQty", UNSET) + + leg_id = d.pop("legId", UNSET) + + liquidity_flag = d.pop("liquidityFlag", UNSET) + + locate_id = d.pop("locateId", UNSET) + + mpid = d.pop("mpid", UNSET) + + _multi_leg_reportingtype = d.pop("multiLegReportingtype", UNSET) + multi_leg_reportingtype: Unset | MultiLegReportingType + if isinstance(_multi_leg_reportingtype, Unset): + multi_leg_reportingtype = UNSET + else: + multi_leg_reportingtype = MultiLegReportingType(_multi_leg_reportingtype) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + _origination_type = d.pop("originationType", UNSET) + origination_type: Unset | OriginationType + if isinstance(_origination_type, Unset): + origination_type = UNSET + else: + origination_type = OriginationType(_origination_type) + + orig_ord_id = d.pop("origOrdId", UNSET) + + parent_ord_id = d.pop("parentOrdId", UNSET) + + perm_ord_id = d.pop("permOrdId", UNSET) + + _position_effect = d.pop("positionEffect", UNSET) + position_effect: Unset | PositionEffect + if isinstance(_position_effect, Unset): + position_effect = UNSET + else: + position_effect = PositionEffect(_position_effect) + + price = d.pop("price", UNSET) + + _price_type = d.pop("priceType", UNSET) + price_type: Unset | PriceType + if isinstance(_price_type, Unset): + price_type = UNSET + else: + price_type = PriceType(_price_type) + + _put_call = d.pop("putCall", UNSET) + put_call: Unset | PutCall + if isinstance(_put_call, Unset): + put_call = UNSET + else: + put_call = PutCall(_put_call) + + qty = d.pop("qty", UNSET) + + req_ord_id = d.pop("reqOrdId", UNSET) + + root = d.pop("root", UNSET) + + route = d.pop("route", UNSET) + + routing_session = d.pop("routingSession", UNSET) + + _security_type = d.pop("securityType", UNSET) + security_type: Unset | SecurityType + if isinstance(_security_type, Unset): + security_type = UNSET + else: + security_type = SecurityType(_security_type) + + _settlement_type = d.pop("settlementType", UNSET) + settlement_type: Unset | OptionSettlementType + if isinstance(_settlement_type, Unset): + settlement_type = UNSET + else: + settlement_type = OptionSettlementType(_settlement_type) + + _side = d.pop("side", UNSET) + side: Unset | Side + if isinstance(_side, Unset): + side = UNSET + else: + side = Side(_side) + + source = d.pop("source", UNSET) + + source_address = d.pop("sourceAddress", UNSET) + + strategy_id = d.pop("strategyId", UNSET) + + strike = d.pop("strike", UNSET) + + symbol = d.pop("symbol", UNSET) + + tag = d.pop("tag", UNSET) + + tag1 = d.pop("tag1", UNSET) + + target_comp_id = d.pop("targetCompId", UNSET) + + target_sub_id = d.pop("targetSubId", UNSET) + + text = d.pop("text", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + _traded_dt = d.pop("tradedDt", UNSET) + traded_dt: Unset | Date + if isinstance(_traded_dt, Unset): + traded_dt = UNSET + else: + traded_dt = Date.from_dict(_traded_dt) + + trader_id = d.pop("traderId", UNSET) + + trading_firm_id = d.pop("tradingFirmId", UNSET) + + transact_ts = d.pop("transactTs", UNSET) + + underlying = d.pop("underlying", UNSET) + + user_id = d.pop("userId", UNSET) + + working_qty = d.pop("workingQty", UNSET) + + multiplier = d.pop("multiplier", UNSET) + + dac_delta = d.pop("dacDelta", UNSET) + + dac_reference_price = d.pop("dacReferencePrice", UNSET) + + manual_fill_time = d.pop("manualFillTime", UNSET) + + trade_confirm = cls( + account_id=account_id, + account_name=account_name, + alloc_id=alloc_id, + alloc_qty=alloc_qty, + aux_price=aux_price, + avg_price=avg_price, + billing_code=billing_code, + capacity=capacity, + clearing_account=clearing_account, + clearing_range=clearing_range, + client_id=client_id, + cmta=cmta, + commission=commission, + cross_side_type=cross_side_type, + cross_type=cross_type, + cum_qty=cum_qty, + cur_ord_id=cur_ord_id, + deliver_to_compid=deliver_to_compid, + deliver_to_subid=deliver_to_subid, + description=description, + drop=drop, + efid=efid, + exec_broker=exec_broker, + exec_id=exec_id, + exec_ref_id=exec_ref_id, + exec_type=exec_type, + exercise_style=exercise_style, + expiration_dt=expiration_dt, + fee1=fee1, + fee2=fee2, + frequent_trader_id=frequent_trader_id, + give_up=give_up, + id=id, + incoming_cl_ord_id=incoming_cl_ord_id, + incoming_ord_id=incoming_ord_id, + incoming_orig_clord_id=incoming_orig_clord_id, + last_market=last_market, + last_price=last_price, + last_qty=last_qty, + leaves_qty=leaves_qty, + leg_id=leg_id, + liquidity_flag=liquidity_flag, + locate_id=locate_id, + mpid=mpid, + multi_leg_reportingtype=multi_leg_reportingtype, + ord_type=ord_type, + origination_type=origination_type, + orig_ord_id=orig_ord_id, + parent_ord_id=parent_ord_id, + perm_ord_id=perm_ord_id, + position_effect=position_effect, + price=price, + price_type=price_type, + put_call=put_call, + qty=qty, + req_ord_id=req_ord_id, + root=root, + route=route, + routing_session=routing_session, + security_type=security_type, + settlement_type=settlement_type, + side=side, + source=source, + source_address=source_address, + strategy_id=strategy_id, + strike=strike, + symbol=symbol, + tag=tag, + tag1=tag1, + target_comp_id=target_comp_id, + target_sub_id=target_sub_id, + text=text, + tif=tif, + traded_dt=traded_dt, + trader_id=trader_id, + trading_firm_id=trading_firm_id, + transact_ts=transact_ts, + underlying=underlying, + user_id=user_id, + working_qty=working_qty, + multiplier=multiplier, + dac_delta=dac_delta, + dac_reference_price=dac_reference_price, + manual_fill_time=manual_fill_time, + ) + + return trade_confirm diff --git a/openapi/openapi_project/openapi_package/models/trading_firm.py b/openapi/openapi_project/openapi_package/models/trading_firm.py new file mode 100644 index 000000000..af3229cbc --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/trading_firm.py @@ -0,0 +1,67 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="TradingFirm") + + +@_attrs_define +class TradingFirm: + """ + Attributes: + id (Union[Unset, int]): + eq_mpid (Union[Unset, str]): + name (Union[Unset, str]): + occ_clearing_number (Union[Unset, str]): + """ + + id: Unset | int = UNSET + eq_mpid: Unset | str = UNSET + name: Unset | str = UNSET + occ_clearing_number: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + id = self.id + + eq_mpid = self.eq_mpid + + name = self.name + + occ_clearing_number = self.occ_clearing_number + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if eq_mpid is not UNSET: + field_dict["eqMpid"] = eq_mpid + if name is not UNSET: + field_dict["name"] = name + if occ_clearing_number is not UNSET: + field_dict["occClearingNumber"] = occ_clearing_number + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + eq_mpid = d.pop("eqMpid", UNSET) + + name = d.pop("name", UNSET) + + occ_clearing_number = d.pop("occClearingNumber", UNSET) + + trading_firm = cls( + id=id, + eq_mpid=eq_mpid, + name=name, + occ_clearing_number=occ_clearing_number, + ) + + return trading_firm diff --git a/openapi/openapi_project/openapi_package/models/trading_firm_slim.py b/openapi/openapi_project/openapi_package/models/trading_firm_slim.py new file mode 100644 index 000000000..0a174c44c --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/trading_firm_slim.py @@ -0,0 +1,49 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="TradingFirmSlim") + + +@_attrs_define +class TradingFirmSlim: + """ + Attributes: + id (Union[Unset, int]): + name (Union[Unset, str]): + """ + + id: Unset | int = UNSET + name: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if name is not UNSET: + field_dict["name"] = name + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + name = d.pop("name", UNSET) + + trading_firm_slim = cls( + id=id, + name=name, + ) + + return trading_firm_slim diff --git a/openapi/openapi_project/openapi_package/models/trading_holiday.py b/openapi/openapi_project/openapi_package/models/trading_holiday.py new file mode 100644 index 000000000..d13428460 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/trading_holiday.py @@ -0,0 +1,97 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.country import Country +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.date import Date + + +T = TypeVar("T", bound="TradingHoliday") + + +@_attrs_define +class TradingHoliday: + """ + Attributes: + id (Union[Unset, int]): + country (Union[Unset, Country]): + date (Union[Unset, Date]): + description (Union[Unset, str]): + is_early_close (Union[Unset, bool]): + """ + + id: Unset | int = UNSET + country: Unset | Country = UNSET + date: Union[Unset, "Date"] = UNSET + description: Unset | str = UNSET + is_early_close: Unset | bool = UNSET + + def to_dict(self) -> dict[str, Any]: + id = self.id + + country: Unset | str = UNSET + if not isinstance(self.country, Unset): + country = self.country.value + + date: Unset | dict[str, Any] = UNSET + if not isinstance(self.date, Unset): + date = self.date.to_dict() + + description = self.description + + is_early_close = self.is_early_close + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if country is not UNSET: + field_dict["country"] = country + if date is not UNSET: + field_dict["date"] = date + if description is not UNSET: + field_dict["description"] = description + if is_early_close is not UNSET: + field_dict["isEarlyClose"] = is_early_close + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.date import Date + + d = dict(src_dict) + id = d.pop("id", UNSET) + + _country = d.pop("country", UNSET) + country: Unset | Country + if isinstance(_country, Unset): + country = UNSET + else: + country = Country(_country) + + _date = d.pop("date", UNSET) + date: Unset | Date + if isinstance(_date, Unset): + date = UNSET + else: + date = Date.from_dict(_date) + + description = d.pop("description", UNSET) + + is_early_close = d.pop("isEarlyClose", UNSET) + + trading_holiday = cls( + id=id, + country=country, + date=date, + description=description, + is_early_close=is_early_close, + ) + + return trading_holiday diff --git a/openapi/openapi_project/openapi_package/models/trading_session.py b/openapi/openapi_project/openapi_package/models/trading_session.py new file mode 100644 index 000000000..8824858a5 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/trading_session.py @@ -0,0 +1,105 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.time_of_day import TimeOfDay + + +T = TypeVar("T", bound="TradingSession") + + +@_attrs_define +class TradingSession: + """ + Attributes: + days_of_the_week (Union[Unset, str]): + end_time (Union[Unset, TimeOfDay]): + id (Union[Unset, int]): + name (Union[Unset, str]): + start_time (Union[Unset, TimeOfDay]): + trading_session_group_id (Union[Unset, int]): + """ + + days_of_the_week: Unset | str = UNSET + end_time: Union[Unset, "TimeOfDay"] = UNSET + id: Unset | int = UNSET + name: Unset | str = UNSET + start_time: Union[Unset, "TimeOfDay"] = UNSET + trading_session_group_id: Unset | int = UNSET + + def to_dict(self) -> dict[str, Any]: + days_of_the_week = self.days_of_the_week + + end_time: Unset | dict[str, Any] = UNSET + if not isinstance(self.end_time, Unset): + end_time = self.end_time.to_dict() + + id = self.id + + name = self.name + + start_time: Unset | dict[str, Any] = UNSET + if not isinstance(self.start_time, Unset): + start_time = self.start_time.to_dict() + + trading_session_group_id = self.trading_session_group_id + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if days_of_the_week is not UNSET: + field_dict["daysOfTheWeek"] = days_of_the_week + if end_time is not UNSET: + field_dict["endTime"] = end_time + if id is not UNSET: + field_dict["id"] = id + if name is not UNSET: + field_dict["name"] = name + if start_time is not UNSET: + field_dict["startTime"] = start_time + if trading_session_group_id is not UNSET: + field_dict["tradingSessionGroupId"] = trading_session_group_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.time_of_day import TimeOfDay + + d = dict(src_dict) + days_of_the_week = d.pop("daysOfTheWeek", UNSET) + + _end_time = d.pop("endTime", UNSET) + end_time: Unset | TimeOfDay + if isinstance(_end_time, Unset): + end_time = UNSET + else: + end_time = TimeOfDay.from_dict(_end_time) + + id = d.pop("id", UNSET) + + name = d.pop("name", UNSET) + + _start_time = d.pop("startTime", UNSET) + start_time: Unset | TimeOfDay + if isinstance(_start_time, Unset): + start_time = UNSET + else: + start_time = TimeOfDay.from_dict(_start_time) + + trading_session_group_id = d.pop("tradingSessionGroupId", UNSET) + + trading_session = cls( + days_of_the_week=days_of_the_week, + end_time=end_time, + id=id, + name=name, + start_time=start_time, + trading_session_group_id=trading_session_group_id, + ) + + return trading_session diff --git a/openapi/openapi_project/openapi_package/models/trading_session_group.py b/openapi/openapi_project/openapi_package/models/trading_session_group.py new file mode 100644 index 000000000..f7659b992 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/trading_session_group.py @@ -0,0 +1,74 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.trading_session import TradingSession + + +T = TypeVar("T", bound="TradingSessionGroup") + + +@_attrs_define +class TradingSessionGroup: + """ + Attributes: + id (Union[Unset, int]): + name (Union[Unset, str]): + sessions (Union[Unset, list['TradingSession']]): + """ + + id: Unset | int = UNSET + name: Unset | str = UNSET + sessions: Unset | list["TradingSession"] = UNSET + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + sessions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.sessions, Unset): + sessions = [] + for sessions_item_data in self.sessions: + sessions_item = sessions_item_data.to_dict() + sessions.append(sessions_item) + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if name is not UNSET: + field_dict["name"] = name + if sessions is not UNSET: + field_dict["sessions"] = sessions + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.trading_session import TradingSession + + d = dict(src_dict) + id = d.pop("id", UNSET) + + name = d.pop("name", UNSET) + + sessions = [] + _sessions = d.pop("sessions", UNSET) + for sessions_item_data in _sessions or []: + sessions_item = TradingSession.from_dict(sessions_item_data) + + sessions.append(sessions_item) + + trading_session_group = cls( + id=id, + name=name, + sessions=sessions, + ) + + return trading_session_group diff --git a/openapi/openapi_project/openapi_package/models/user.py b/openapi/openapi_project/openapi_package/models/user.py new file mode 100644 index 000000000..b3de854ed --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/user.py @@ -0,0 +1,242 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.user_location import UserLocation +from ..models.user_status import UserStatus +from ..models.user_type import UserType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.user_permission import UserPermission + + +T = TypeVar("T", bound="User") + + +@_attrs_define +class User: + """ + Attributes: + domain (Union[Unset, str]): + email (Union[Unset, str]): + first_name (Union[Unset, str]): + id (Union[Unset, int]): + is_locked_out (Union[Unset, bool]): + last_name (Union[Unset, str]): + location (Union[Unset, UserLocation]): + phone_primary (Union[Unset, str]): + phone_secondary (Union[Unset, str]): + region (Union[Unset, str]): + region_code (Union[Unset, str]): + status (Union[Unset, UserStatus]): + trading_firm_id (Union[Unset, int]): + type_ (Union[Unset, UserType]): + user_name (Union[Unset, str]): + city (Union[Unset, str]): + permissions (Union[Unset, list['UserPermission']]): + setup_ticket (Union[Unset, str]): + large_trader_id (Union[Unset, str]): + """ + + domain: Unset | str = UNSET + email: Unset | str = UNSET + first_name: Unset | str = UNSET + id: Unset | int = UNSET + is_locked_out: Unset | bool = UNSET + last_name: Unset | str = UNSET + location: Unset | UserLocation = UNSET + phone_primary: Unset | str = UNSET + phone_secondary: Unset | str = UNSET + region: Unset | str = UNSET + region_code: Unset | str = UNSET + status: Unset | UserStatus = UNSET + trading_firm_id: Unset | int = UNSET + type_: Unset | UserType = UNSET + user_name: Unset | str = UNSET + city: Unset | str = UNSET + permissions: Unset | list["UserPermission"] = UNSET + setup_ticket: Unset | str = UNSET + large_trader_id: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + domain = self.domain + + email = self.email + + first_name = self.first_name + + id = self.id + + is_locked_out = self.is_locked_out + + last_name = self.last_name + + location: Unset | str = UNSET + if not isinstance(self.location, Unset): + location = self.location.value + + phone_primary = self.phone_primary + + phone_secondary = self.phone_secondary + + region = self.region + + region_code = self.region_code + + status: Unset | str = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + trading_firm_id = self.trading_firm_id + + type_: Unset | str = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + user_name = self.user_name + + city = self.city + + permissions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.permissions, Unset): + permissions = [] + for permissions_item_data in self.permissions: + permissions_item = permissions_item_data.to_dict() + permissions.append(permissions_item) + + setup_ticket = self.setup_ticket + + large_trader_id = self.large_trader_id + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if domain is not UNSET: + field_dict["domain"] = domain + if email is not UNSET: + field_dict["email"] = email + if first_name is not UNSET: + field_dict["firstName"] = first_name + if id is not UNSET: + field_dict["id"] = id + if is_locked_out is not UNSET: + field_dict["isLockedOut"] = is_locked_out + if last_name is not UNSET: + field_dict["lastName"] = last_name + if location is not UNSET: + field_dict["location"] = location + if phone_primary is not UNSET: + field_dict["phonePrimary"] = phone_primary + if phone_secondary is not UNSET: + field_dict["phoneSecondary"] = phone_secondary + if region is not UNSET: + field_dict["region"] = region + if region_code is not UNSET: + field_dict["regionCode"] = region_code + if status is not UNSET: + field_dict["status"] = status + if trading_firm_id is not UNSET: + field_dict["tradingFirmId"] = trading_firm_id + if type_ is not UNSET: + field_dict["type"] = type_ + if user_name is not UNSET: + field_dict["userName"] = user_name + if city is not UNSET: + field_dict["city"] = city + if permissions is not UNSET: + field_dict["permissions"] = permissions + if setup_ticket is not UNSET: + field_dict["setupTicket"] = setup_ticket + if large_trader_id is not UNSET: + field_dict["largeTraderId"] = large_trader_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.user_permission import UserPermission + + d = dict(src_dict) + domain = d.pop("domain", UNSET) + + email = d.pop("email", UNSET) + + first_name = d.pop("firstName", UNSET) + + id = d.pop("id", UNSET) + + is_locked_out = d.pop("isLockedOut", UNSET) + + last_name = d.pop("lastName", UNSET) + + _location = d.pop("location", UNSET) + location: Unset | UserLocation + if isinstance(_location, Unset): + location = UNSET + else: + location = UserLocation(_location) + + phone_primary = d.pop("phonePrimary", UNSET) + + phone_secondary = d.pop("phoneSecondary", UNSET) + + region = d.pop("region", UNSET) + + region_code = d.pop("regionCode", UNSET) + + _status = d.pop("status", UNSET) + status: Unset | UserStatus + if isinstance(_status, Unset): + status = UNSET + else: + status = UserStatus(_status) + + trading_firm_id = d.pop("tradingFirmId", UNSET) + + _type_ = d.pop("type", UNSET) + type_: Unset | UserType + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = UserType(_type_) + + user_name = d.pop("userName", UNSET) + + city = d.pop("city", UNSET) + + permissions = [] + _permissions = d.pop("permissions", UNSET) + for permissions_item_data in _permissions or []: + permissions_item = UserPermission.from_dict(permissions_item_data) + + permissions.append(permissions_item) + + setup_ticket = d.pop("setupTicket", UNSET) + + large_trader_id = d.pop("largeTraderId", UNSET) + + user = cls( + domain=domain, + email=email, + first_name=first_name, + id=id, + is_locked_out=is_locked_out, + last_name=last_name, + location=location, + phone_primary=phone_primary, + phone_secondary=phone_secondary, + region=region, + region_code=region_code, + status=status, + trading_firm_id=trading_firm_id, + type_=type_, + user_name=user_name, + city=city, + permissions=permissions, + setup_ticket=setup_ticket, + large_trader_id=large_trader_id, + ) + + return user diff --git a/openapi/openapi_project/openapi_package/models/user_location.py b/openapi/openapi_project/openapi_package/models/user_location.py new file mode 100644 index 000000000..73fba2ea4 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/user_location.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class UserLocation(str, Enum): + USER_LOCATION_OFF_FLOOR = "USER_LOCATION_OFF_FLOOR" + USER_LOCATION_ON_FLOOR = "USER_LOCATION_ON_FLOOR" + USER_LOCATION_UNKNOWN = "USER_LOCATION_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/user_permission.py b/openapi/openapi_project/openapi_package/models/user_permission.py new file mode 100644 index 000000000..533c074a8 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/user_permission.py @@ -0,0 +1,66 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.claim_type import ClaimType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UserPermission") + + +@_attrs_define +class UserPermission: + """ + Attributes: + claim (Union[Unset, str]): + claim_type (Union[Unset, ClaimType]): + description (Union[Unset, str]): + """ + + claim: Unset | str = UNSET + claim_type: Unset | ClaimType = UNSET + description: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + claim = self.claim + + claim_type: Unset | str = UNSET + if not isinstance(self.claim_type, Unset): + claim_type = self.claim_type.value + + description = self.description + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if claim is not UNSET: + field_dict["claim"] = claim + if claim_type is not UNSET: + field_dict["claimType"] = claim_type + if description is not UNSET: + field_dict["description"] = description + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + claim = d.pop("claim", UNSET) + + _claim_type = d.pop("claimType", UNSET) + claim_type: Unset | ClaimType + if isinstance(_claim_type, Unset): + claim_type = UNSET + else: + claim_type = ClaimType(_claim_type) + + description = d.pop("description", UNSET) + + user_permission = cls( + claim=claim, + claim_type=claim_type, + description=description, + ) + + return user_permission diff --git a/openapi/openapi_project/openapi_package/models/user_status.py b/openapi/openapi_project/openapi_package/models/user_status.py new file mode 100644 index 000000000..88da2b504 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/user_status.py @@ -0,0 +1,12 @@ +from enum import Enum + + +class UserStatus(str, Enum): + USER_STATUS_ACTIVE = "USER_STATUS_ACTIVE" + USER_STATUS_DELETED = "USER_STATUS_DELETED" + USER_STATUS_DISABLED = "USER_STATUS_DISABLED" + USER_STATUS_UNKNOWN = "USER_STATUS_UNKNOWN" + USER_STATUS_VIEW_ONLY = "USER_STATUS_VIEW_ONLY" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/user_type.py b/openapi/openapi_project/openapi_package/models/user_type.py new file mode 100644 index 000000000..95a3da9d0 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/user_type.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class UserType(str, Enum): + USER_TYPE_API = "USER_TYPE_API" + USER_TYPE_GUI = "USER_TYPE_GUI" + USER_TYPE_UNKNOWN = "USER_TYPE_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/validate_risk_response.py b/openapi/openapi_project/openapi_package/models/validate_risk_response.py new file mode 100644 index 000000000..d00eef7d7 --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/validate_risk_response.py @@ -0,0 +1,91 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.risk_reject import RiskReject + + +T = TypeVar("T", bound="ValidateRiskResponse") + + +@_attrs_define +class ValidateRiskResponse: + """ + Attributes: + is_valid (Union[Unset, bool]): + risk_rejects (Union[Unset, list['RiskReject']]): + error_message (Union[Unset, str]): + status_code (Union[Unset, StatusCode]): + """ + + is_valid: Unset | bool = UNSET + risk_rejects: Unset | list["RiskReject"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + is_valid = self.is_valid + + risk_rejects: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.risk_rejects, Unset): + risk_rejects = [] + for risk_rejects_item_data in self.risk_rejects: + risk_rejects_item = risk_rejects_item_data.to_dict() + risk_rejects.append(risk_rejects_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if is_valid is not UNSET: + field_dict["isValid"] = is_valid + if risk_rejects is not UNSET: + field_dict["riskRejects"] = risk_rejects + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.risk_reject import RiskReject + + d = dict(src_dict) + is_valid = d.pop("isValid", UNSET) + + risk_rejects = [] + _risk_rejects = d.pop("riskRejects", UNSET) + for risk_rejects_item_data in _risk_rejects or []: + risk_rejects_item = RiskReject.from_dict(risk_rejects_item_data) + + risk_rejects.append(risk_rejects_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + validate_risk_response = cls( + is_valid=is_valid, + risk_rejects=risk_rejects, + error_message=error_message, + status_code=status_code, + ) + + return validate_risk_response diff --git a/openapi/openapi_project/openapi_package/models/volatility_shock_skew.py b/openapi/openapi_project/openapi_package/models/volatility_shock_skew.py new file mode 100644 index 000000000..ba182d91a --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/volatility_shock_skew.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class VolatilityShockSkew(str, Enum): + VOLATILITY_SHOCK_SKEW_STICKY_DELTA = "VOLATILITY_SHOCK_SKEW_STICKY_DELTA" + VOLATILITY_SHOCK_SKEW_STICKY_STRIKE = "VOLATILITY_SHOCK_SKEW_STICKY_STRIKE" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/volatility_shock_type.py b/openapi/openapi_project/openapi_package/models/volatility_shock_type.py new file mode 100644 index 000000000..4757c0b0c --- /dev/null +++ b/openapi/openapi_project/openapi_package/models/volatility_shock_type.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class VolatilityShockType(str, Enum): + VOLATILITY_SHOCK_TYPE_ABSOLUTE = "VOLATILITY_SHOCK_TYPE_ABSOLUTE" + VOLATILITY_SHOCK_TYPE_RELATIVE = "VOLATILITY_SHOCK_TYPE_RELATIVE" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi/openapi_project/openapi_package/py.typed b/openapi/openapi_project/openapi_package/py.typed new file mode 100644 index 000000000..1aad32711 --- /dev/null +++ b/openapi/openapi_project/openapi_package/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561 \ No newline at end of file diff --git a/openapi/openapi_project/openapi_package/types.py b/openapi/openapi_project/openapi_package/types.py new file mode 100644 index 000000000..571a13e74 --- /dev/null +++ b/openapi/openapi_project/openapi_package/types.py @@ -0,0 +1,55 @@ +"""Contains some shared types for properties""" + +from collections.abc import Mapping, MutableMapping +from http import HTTPStatus +from typing import IO, BinaryIO, Generic, Literal, TypeVar + +from attrs import define + + +class Unset: + def __bool__(self) -> Literal[False]: + return False + + +UNSET: Unset = Unset() + +# The types that `httpx.Client(files=)` can accept, copied from that library. +FileContent = IO[bytes] | bytes | str +FileTypes = ( + # (filename, file (or bytes), content_type) + tuple[str | None, FileContent, str | None] + | + # (filename, file (or bytes), content_type, headers) + tuple[str | None, FileContent, str | None, Mapping[str, str]] +) +RequestFiles = list[tuple[str, FileTypes]] + + +@define +class File: + """Contains information for file uploads""" + + payload: BinaryIO + file_name: str | None = None + mime_type: str | None = None + + def to_tuple(self) -> FileTypes: + """Return a tuple representation that httpx will accept for multipart/form-data""" + return self.file_name, self.payload, self.mime_type + + +T = TypeVar("T") + + +@define +class Response(Generic[T]): + """A response from an endpoint""" + + status_code: HTTPStatus + content: bytes + headers: MutableMapping[str, str] + parsed: T | None + + +__all__ = ["UNSET", "File", "FileTypes", "RequestFiles", "Response", "Unset"] diff --git a/openapi/swagger_cleaned.json b/openapi/swagger_cleaned.json new file mode 100644 index 000000000..2ad62fd2c --- /dev/null +++ b/openapi/swagger_cleaned.json @@ -0,0 +1,8122 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Silexx API", + "version": "v1" + }, + "paths": { + "/application/login": { + "post": { + "tags": [ + "ApplicationService" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoginRequest" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoginResponse" + } + } + } + } + } + } + }, + "/orders/createorder": { + "post": { + "tags": [ + "OrderService" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateOrderRequest" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateOrderResponse" + } + } + } + } + } + } + }, + "/orders/createordercross": { + "post": { + "tags": [ + "OrderService" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateOrderCrossRequest" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateOrderCrossResponse" + } + } + } + } + } + } + }, + "/orders/createmultilegorder": { + "post": { + "tags": [ + "OrderService" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateMultiLegOrderRequest" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateMultiLegOrderResponse" + } + } + } + } + } + } + }, + "/orders/createmultilegordercross": { + "post": { + "tags": [ + "OrderService" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateMultiLegOrderCrossRequest" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateMultiLegOrderCrossResponse" + } + } + } + } + } + } + }, + "/orders/cancelorder": { + "post": { + "tags": [ + "OrderService" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelOrderRequest" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelOrderResponse" + } + } + } + } + } + } + }, + "/orders/replaceorder": { + "post": { + "tags": [ + "OrderService" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelReplaceOrderRequest" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelReplaceOrderResponse" + } + } + } + } + } + } + }, + "/orders/replacemultilegorder": { + "post": { + "tags": [ + "OrderService" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelReplaceMultiLegOrderRequest" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelReplaceMultiLegOrderResponse" + } + } + } + } + } + } + }, + "/orders/validaterisk/createorder": { + "post": { + "tags": [ + "OrderService" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateOrderRequest" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidateRiskResponse" + } + } + } + } + } + } + }, + "/orders/validaterisk/createordercross": { + "post": { + "tags": [ + "OrderService" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateOrderCrossRequest" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidateRiskResponse" + } + } + } + } + } + } + }, + "/orders/validaterisk/createmultilegorder": { + "post": { + "tags": [ + "OrderService" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateMultiLegOrderRequest" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidateRiskResponse" + } + } + } + } + } + } + }, + "/orders/validaterisk/createmultilegordercross": { + "post": { + "tags": [ + "OrderService" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateMultiLegOrderCrossRequest" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidateRiskResponse" + } + } + } + } + } + } + }, + "/orders/validaterisk/replaceorder": { + "post": { + "tags": [ + "OrderService" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelReplaceOrderRequest" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidateRiskResponse" + } + } + } + } + } + } + }, + "/orders/validaterisk/replacemultilegorder": { + "post": { + "tags": [ + "OrderService" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelReplaceMultiLegOrderRequest" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidateRiskResponse" + } + } + } + } + } + } + }, + "/orders": { + "get": { + "tags": [ + "OrderService" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOrdersResponse" + } + } + } + } + } + } + }, + "/orders/tradeconfirms": { + "get": { + "tags": [ + "OrderService" + ], + "parameters": [ + { + "name": "accountIds", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "endTimeUtc", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "startTimeUtc", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "tradingFirmIds", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "userIds", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListTradeConfirmsResponse" + } + } + } + } + } + } + }, + "/orders/searchhistory": { + "get": { + "tags": [ + "OrderService" + ], + "parameters": [ + { + "name": "accountIds", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "toDt.year", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "toDt.month", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "toDt.day", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "fromDt.year", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "fromDt.month", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "fromDt.day", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchOrderHistoryResponse" + } + } + } + } + } + } + }, + "/portfolio/analyzepositions": { + "post": { + "tags": [ + "PortfolioService" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AnalyzePositionsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AnalyzePositionsResponse" + } + } + } + } + } + } + }, + "/portfolio/positions": { + "get": { + "tags": [ + "PortfolioService" + ], + "parameters": [ + { + "name": "all", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "accountId", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "accountIdAndSymbol.accountId", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "accountIdAndSymbol.symbol", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPositionsResponse" + } + } + } + } + } + } + }, + "/portfolio/calculatemargins": { + "post": { + "tags": [ + "PortfolioService" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CalculateMarginRequest" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CalculateMarginResponse" + } + } + } + } + } + } + }, + "/portfolio/riskradar": { + "post": { + "tags": [ + "PortfolioService" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RiskRadarRequest" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RiskRadarResponse" + } + } + } + } + } + } + }, + "/securities/securities": { + "post": { + "tags": [ + "SecurityService" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListSecuritiesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListSecuritiesResponse" + } + } + } + } + } + } + }, + "/securities/exchanges": { + "get": { + "tags": [ + "SecurityService" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListExchangesResponse" + } + } + } + } + } + } + }, + "/securities/optionchains": { + "post": { + "tags": [ + "SecurityService" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOptionChainsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOptionChainsRepsonse" + } + } + } + } + } + } + }, + "/securities/flexoption": { + "post": { + "tags": [ + "SecurityService" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateFlexOptionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateFlexOptionResponse" + } + } + } + } + } + } + }, + "/securities/easytoborrowsecurities": { + "post": { + "tags": [ + "SecurityService" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListEasyToBorrowSecuritiesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListEasyToBorrowSecuritiesResponse" + } + } + } + } + } + } + }, + "/userdata/activeuser": { + "get": { + "tags": [ + "UserDataService" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetActiveUserResponse" + } + } + } + } + } + } + }, + "/userdata/accounts": { + "get": { + "tags": [ + "UserDataService" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListAccountsResponse" + } + } + } + } + } + } + }, + "/userdata/tradingfirms": { + "get": { + "tags": [ + "UserDataService" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListTradingFirmsResponse" + } + } + } + } + } + } + }, + "/userdata/affiliatedtradingfirms": { + "get": { + "tags": [ + "UserDataService" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListAffiliatedTradingFirmsResponse" + } + } + } + } + } + } + }, + "/userdata/p2paccounts": { + "get": { + "tags": [ + "UserDataService" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListAccountsResponse" + } + } + } + } + } + } + }, + "/userdata/routes": { + "get": { + "tags": [ + "UserDataService" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListRoutesResponse" + } + } + } + } + } + } + }, + "/utility/tradingholidays": { + "get": { + "tags": [ + "UtilityService" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetTradingHolidaysResponse" + } + } + } + } + } + } + }, + "/utility/servertime": { + "get": { + "tags": [ + "UtilityService" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetServerTimeResponse" + } + } + } + } + } + } + }, + "/utility/serverinfo": { + "get": { + "tags": [ + "UtilityService" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetServerInfoResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Account": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "billingCode": { + "type": "string" + }, + "ctiCode": { + "type": "string" + }, + "currency": { + "$ref": "#/components/schemas/Currency" + }, + "equitiesCapacity": { + "$ref": "#/components/schemas/CapacityCode" + }, + "equitiesGiveUp": { + "type": "string" + }, + "equitiesMpid": { + "type": "string" + }, + "futuresClearingAccount": { + "type": "string" + }, + "futuresClearingRange": { + "$ref": "#/components/schemas/ClearingRange" + }, + "futuresCmta": { + "type": "string" + }, + "futuresExecutionBroker": { + "type": "string" + }, + "name": { + "type": "string" + }, + "occActionableId": { + "type": "string" + }, + "optionsClearingAccount": { + "type": "string" + }, + "optionsClearingRange": { + "$ref": "#/components/schemas/ClearingRange" + }, + "optionsCmta": { + "type": "string" + }, + "optionsEfid": { + "type": "string" + }, + "optionsGiveUp": { + "type": "string" + }, + "routingSessionGroups": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RoutingSessionGroup" + } + }, + "status": { + "$ref": "#/components/schemas/AccountStatus" + }, + "tag1": { + "type": "string" + }, + "tradingFirmId": { + "type": "integer", + "format": "int32" + }, + "type": { + "$ref": "#/components/schemas/AccountType" + }, + "createdTs": { + "type": "string" + }, + "optionalData": { + "type": "string" + }, + "positionScript": { + "$ref": "#/components/schemas/AccountScript" + }, + "buyingPowerScript": { + "$ref": "#/components/schemas/AccountScript" + }, + "clearingScript": { + "$ref": "#/components/schemas/AccountScript" + } + }, + "additionalProperties": false + }, + "AccountScript": { + "type": "object", + "properties": { + "scriptName": { + "type": "string" + }, + "accountName": { + "type": "string" + } + }, + "additionalProperties": false + }, + "AccountStatus": { + "enum": [ + "ACCOUNT_STATUS_VIEW_ONLY", + "ACCOUNT_STATUS_ACTIVE", + "ACCOUNT_STATUS_LIQUIDATION", + "ACCOUNT_STATUS_DELETED" + ], + "type": "string" + }, + "AccountType": { + "enum": [ + "ACCOUNT_TYPE_CASH", + "ACCOUNT_TYPE_MARGIN", + "ACCOUNT_TYPE_INVENTORY" + ], + "type": "string" + }, + "AnalyzePositionItem": { + "type": "object", + "properties": { + "price": { + "type": "number", + "format": "double" + }, + "qty": { + "type": "integer", + "format": "int32" + }, + "symbol": { + "type": "string" + }, + "volatility": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "AnalyzePositionsRequest": { + "type": "object", + "properties": { + "asOfTs": { + "type": "string" + }, + "evaluateAtExpiry": { + "type": "boolean" + }, + "evaluateAtStrike": { + "type": "boolean" + }, + "evaluationAsOf": { + "type": "array", + "items": { + "type": "string" + } + }, + "positions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AnalyzePositionItem" + } + }, + "price": { + "type": "number", + "format": "double" + }, + "underlyingVolatility": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + "historicalVolatilityDays": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + }, + "volatilityChange": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "AnalyzePositionsResponse": { + "type": "object", + "properties": { + "analysis": { + "$ref": "#/components/schemas/PositionAnalysis" + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "Any": { + "required": [ + "@type" + ], + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "CalculateMarginRequest": { + "type": "object", + "properties": { + "accountIds": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + }, + "marginDataType": { + "$ref": "#/components/schemas/MarginDataType" + }, + "positionsByAccountId": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CalculateMarginRequestPositionList" + } + }, + "evalMode": { + "$ref": "#/components/schemas/RiskEvalMode" + }, + "source": { + "$ref": "#/components/schemas/PositionSource" + } + }, + "additionalProperties": false + }, + "CalculateMarginRequestPosition": { + "type": "object", + "properties": { + "isSimulatedPosition": { + "type": "boolean" + }, + "qty": { + "type": "number", + "format": "double" + }, + "symbol": { + "type": "string" + } + }, + "additionalProperties": false + }, + "CalculateMarginRequestPositionList": { + "type": "object", + "properties": { + "accountId": { + "type": "integer", + "format": "int32" + }, + "positions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CalculateMarginRequestPosition" + } + } + }, + "additionalProperties": false + }, + "CalculateMarginResponse": { + "type": "object", + "properties": { + "marginData": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MarginData" + } + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "CancelOrderRequest": { + "type": "object", + "properties": { + "curOrdId": { + "type": "string" + }, + "instructions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderInstruction" + } + }, + "permOrdId": { + "type": "string" + }, + "optionalData": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + "additionalProperties": false + }, + "CancelOrderResponse": { + "type": "object", + "properties": { + "submitTs": { + "type": "string" + }, + "reqOrdId": { + "type": "string" + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "CancelReplaceMultiLegOrderRequest": { + "type": "object", + "properties": { + "auxPrice": { + "type": "number", + "format": "double" + }, + "clearingInfo": { + "$ref": "#/components/schemas/ClearingInfo" + }, + "curOrdId": { + "type": "string" + }, + "instructions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderInstruction" + } + }, + "ordType": { + "$ref": "#/components/schemas/OrdType" + }, + "permOrdId": { + "type": "string" + }, + "price": { + "type": "number", + "format": "double" + }, + "qty": { + "type": "number", + "format": "double" + }, + "tag": { + "type": "string" + }, + "text": { + "type": "string" + }, + "tif": { + "$ref": "#/components/schemas/Tif" + }, + "algo": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "marketCondition": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "optionalData": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + "additionalProperties": false + }, + "CancelReplaceMultiLegOrderResponse": { + "type": "object", + "properties": { + "submitTs": { + "type": "string" + }, + "reqOrdId": { + "type": "string" + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "CancelReplaceOrderRequest": { + "type": "object", + "properties": { + "auxPrice": { + "type": "number", + "format": "double" + }, + "clearingInfo": { + "$ref": "#/components/schemas/ClearingInfo" + }, + "curOrdId": { + "type": "string" + }, + "instructions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderInstruction" + } + }, + "ordType": { + "$ref": "#/components/schemas/OrdType" + }, + "permOrdId": { + "type": "string" + }, + "price": { + "type": "number", + "format": "double" + }, + "qty": { + "type": "number", + "format": "double" + }, + "tif": { + "$ref": "#/components/schemas/Tif" + }, + "algo": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "marketCondition": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "optionalData": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + "additionalProperties": false + }, + "CancelReplaceOrderResponse": { + "type": "object", + "properties": { + "submitTs": { + "type": "string" + }, + "reqOrdId": { + "type": "string" + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "CapacityCode": { + "enum": [ + "CAPACITY_CODE_NOT_SET", + "CAPACITY_CODE_AGENT", + "CAPACITY_CODE_PRINCIPAL" + ], + "type": "string" + }, + "ClaimType": { + "enum": [ + "CLAIM_TYPE_UNDEFINED", + "CLAIM_TYPE_UI_MODULE_PERMISSION", + "CLAIM_TYPE_FUNCTIONALITY_PERMISSION", + "CLAIM_TYPE_SYSOP_PERMISSION" + ], + "type": "string" + }, + "ClearingInfo": { + "type": "object", + "properties": { + "clearingOptionalData": { + "type": "string" + }, + "ctiCode": { + "type": "string" + }, + "efid": { + "type": "string" + }, + "eqCapacity": { + "$ref": "#/components/schemas/CapacityCode" + }, + "eqClearingAccount": { + "type": "string" + }, + "eqGiveUp": { + "type": "string" + }, + "eqMpid": { + "type": "string" + }, + "futClearingAccount": { + "type": "string" + }, + "futClearingRange": { + "$ref": "#/components/schemas/ClearingRange" + }, + "futCmta": { + "type": "string" + }, + "futExecBroker": { + "type": "string" + }, + "locateId": { + "type": "string" + }, + "optClearingAccount": { + "type": "string" + }, + "optClearingRange": { + "$ref": "#/components/schemas/ClearingRange" + }, + "optCmta": { + "type": "string" + }, + "optGiveUp": { + "type": "string" + }, + "tag1": { + "type": "string" + }, + "billingCode": { + "type": "string" + } + }, + "additionalProperties": false + }, + "ClearingRange": { + "enum": [ + "CLEARING_RANGE_NOTSET", + "CLEARING_RANGE_CUSTOMER", + "CLEARING_RANGE_PROPRIETARY_FIRM", + "CLEARING_RANGE_BROKER_DEALER_FIRM", + "CLEARING_RANGE_BROKER_DEALER_CUSTOMER", + "CLEARING_RANGE_MARKET_MAKER", + "CLEARING_RANGE_AWAY_MARKET_MAKER", + "CLEARING_RANGE_PROPRIETARY_CUSTOMER", + "CLEARING_RANGE_PROFESSIONAL_CUSTOMER", + "CLEARING_RANGE_BROKER_DEALER", + "CLEARING_RANGE_NON_TPH_BROKER_DEALER", + "CLEARING_RANGE_FIRM", + "CLEARING_RANGE_JOINT_BACK_OFFICE", + "CLEARING_RANGE_NON_TPH_AFFILIATE" + ], + "type": "string" + }, + "Country": { + "enum": [ + "COUNTRY_UNKNOWN", + "COUNTRY_UNITED_STATES", + "COUNTRY_GERMANY", + "COUNTRY_UNITED_KINGDOM", + "COUNTRY_JAPAN", + "COUNTRY_CHINA", + "COUNTRY_INDIA" + ], + "type": "string" + }, + "CreateFlexOptionRequest": { + "type": "object", + "properties": { + "rootSymbol": { + "type": "string" + }, + "settlementType": { + "$ref": "#/components/schemas/FlexSettlementType" + }, + "expirationDt": { + "$ref": "#/components/schemas/Date" + }, + "strike": { + "type": "number", + "format": "double" + }, + "putCall": { + "$ref": "#/components/schemas/PutCall" + }, + "productType": { + "$ref": "#/components/schemas/OptionSeriesProductType" + }, + "exerciseStyle": { + "$ref": "#/components/schemas/OptionExerciseStyle" + }, + "creationDt": { + "$ref": "#/components/schemas/Date" + }, + "observationDay": { + "type": "integer", + "format": "int32" + }, + "isPercentagePriced": { + "type": "boolean" + }, + "capPercentage": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "CreateFlexOptionResponse": { + "type": "object", + "properties": { + "flexOption": { + "$ref": "#/components/schemas/FlexOption" + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "CreateMultiLegOrderCrossAllocation": { + "type": "object", + "properties": { + "accountId": { + "type": "integer", + "format": "int32" + }, + "clearingInfo": { + "$ref": "#/components/schemas/ClearingInfo" + }, + "instructions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderInstruction" + } + }, + "legs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CreateMultiLegOrderLeg" + } + }, + "optionalData": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "qty": { + "type": "number", + "format": "double" + }, + "sideType": { + "$ref": "#/components/schemas/CrossSideType" + } + }, + "additionalProperties": false + }, + "CreateMultiLegOrderCrossRequest": { + "type": "object", + "properties": { + "accountId": { + "type": "integer", + "format": "int32" + }, + "allocations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CreateMultiLegOrderCrossAllocation" + } + }, + "crossType": { + "$ref": "#/components/schemas/CrossType" + }, + "instructions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderInstruction" + } + }, + "ordType": { + "$ref": "#/components/schemas/OrdType" + }, + "orderFlags": { + "type": "integer", + "format": "int32" + }, + "parentOrdId": { + "type": "string" + }, + "price": { + "type": "number", + "format": "double" + }, + "priceType": { + "$ref": "#/components/schemas/PriceType" + }, + "qty": { + "type": "number", + "format": "double" + }, + "route": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "text": { + "type": "string" + }, + "tif": { + "$ref": "#/components/schemas/Tif" + }, + "algo": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "marketCondition": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "optionalData": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + "additionalProperties": false + }, + "CreateMultiLegOrderCrossResponse": { + "type": "object", + "properties": { + "multiLegOrderCross": { + "$ref": "#/components/schemas/MultiLegOrderCross" + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "CreateMultiLegOrderLeg": { + "type": "object", + "properties": { + "positionEffect": { + "$ref": "#/components/schemas/PositionEffect" + }, + "price": { + "type": "number", + "format": "double" + }, + "ratio": { + "type": "integer", + "format": "int32" + }, + "side": { + "$ref": "#/components/schemas/Side" + }, + "symbol": { + "type": "string" + }, + "marketCondition": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "optionalData": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "flexOption": { + "$ref": "#/components/schemas/FlexOption" + } + }, + "additionalProperties": false + }, + "CreateMultiLegOrderRequest": { + "type": "object", + "properties": { + "accountId": { + "type": "integer", + "format": "int32" + }, + "auxPrice": { + "type": "number", + "format": "double" + }, + "clearingInfo": { + "$ref": "#/components/schemas/ClearingInfo" + }, + "instructions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderInstruction" + } + }, + "legs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CreateMultiLegOrderLeg" + } + }, + "ordType": { + "$ref": "#/components/schemas/OrdType" + }, + "orderFlags": { + "type": "integer", + "format": "int32" + }, + "parentOrdId": { + "type": "string" + }, + "price": { + "type": "number", + "format": "double" + }, + "priceType": { + "$ref": "#/components/schemas/PriceType" + }, + "qty": { + "type": "number", + "format": "double" + }, + "route": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "text": { + "type": "string" + }, + "tif": { + "$ref": "#/components/schemas/Tif" + }, + "algo": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "marketCondition": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "optionalData": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + "additionalProperties": false + }, + "CreateMultiLegOrderResponse": { + "type": "object", + "properties": { + "multiLegOrder": { + "$ref": "#/components/schemas/MultiLegOrder" + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "CreateOrderCrossAllocation": { + "type": "object", + "properties": { + "accountId": { + "type": "integer", + "format": "int32" + }, + "clearingInfo": { + "$ref": "#/components/schemas/ClearingInfo" + }, + "instructions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderInstruction" + } + }, + "optionalData": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "positionEffect": { + "$ref": "#/components/schemas/PositionEffect" + }, + "qty": { + "type": "number", + "format": "double" + }, + "side": { + "$ref": "#/components/schemas/Side" + }, + "sideType": { + "$ref": "#/components/schemas/CrossSideType" + } + }, + "additionalProperties": false + }, + "CreateOrderCrossRequest": { + "type": "object", + "properties": { + "accountId": { + "type": "integer", + "format": "int32" + }, + "allocations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CreateOrderCrossAllocation" + } + }, + "crossType": { + "$ref": "#/components/schemas/CrossType" + }, + "instructions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderInstruction" + } + }, + "ordType": { + "$ref": "#/components/schemas/OrdType" + }, + "orderFlags": { + "type": "integer", + "format": "int32" + }, + "parentOrdId": { + "type": "string" + }, + "price": { + "type": "number", + "format": "double" + }, + "priceType": { + "$ref": "#/components/schemas/PriceType" + }, + "qty": { + "type": "number", + "format": "double" + }, + "route": { + "type": "string" + }, + "symbol": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "text": { + "type": "string" + }, + "tif": { + "$ref": "#/components/schemas/Tif" + }, + "algo": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "marketCondition": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "optionalData": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "flexOption": { + "$ref": "#/components/schemas/FlexOption" + } + }, + "additionalProperties": false + }, + "CreateOrderCrossResponse": { + "type": "object", + "properties": { + "orderCross": { + "$ref": "#/components/schemas/OrderCross" + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "CreateOrderRequest": { + "type": "object", + "properties": { + "accountId": { + "type": "integer", + "format": "int32" + }, + "auxPrice": { + "type": "number", + "format": "double" + }, + "clearingInfo": { + "$ref": "#/components/schemas/ClearingInfo" + }, + "instructions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderInstruction" + } + }, + "ordType": { + "$ref": "#/components/schemas/OrdType" + }, + "orderFlags": { + "type": "integer", + "format": "int32" + }, + "parentOrdId": { + "type": "string" + }, + "positionEffect": { + "$ref": "#/components/schemas/PositionEffect" + }, + "price": { + "type": "number", + "format": "double" + }, + "priceType": { + "$ref": "#/components/schemas/PriceType" + }, + "qty": { + "type": "number", + "format": "double" + }, + "route": { + "type": "string" + }, + "side": { + "$ref": "#/components/schemas/Side" + }, + "symbol": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "text": { + "type": "string" + }, + "tif": { + "$ref": "#/components/schemas/Tif" + }, + "algo": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "marketCondition": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "optionalData": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "flexOption": { + "$ref": "#/components/schemas/FlexOption" + } + }, + "additionalProperties": false + }, + "CreateOrderResponse": { + "type": "object", + "properties": { + "order": { + "$ref": "#/components/schemas/Order" + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "CrossSideType": { + "enum": [ + "CROSS_SIDE_TYPE_UNDEFINED", + "CROSS_SIDE_TYPE_AGENCY", + "CROSS_SIDE_TYPE_CONTRA" + ], + "type": "string" + }, + "CrossType": { + "enum": [ + "CROSS_TYPE_UNDEFINED", + "CROSS_TYPE_SWEEP_AND_CROSS", + "CROSS_TYPE_PCC", + "CROSS_TYPE_AIM", + "CROSS_TYPE_BAM", + "CROSS_TYPE_C2C", + "CROSS_TYPE_FACILITATION", + "CROSS_TYPE_MATRIX_CROSS", + "CROSS_TYPE_PIM", + "CROSS_TYPE_QCC", + "CROSS_TYPE_RFC", + "CROSS_TYPE_SAM", + "CROSS_TYPE_SWEEP_AND_AIM" + ], + "type": "string" + }, + "Crypto": { + "type": "object", + "properties": { + "aliases": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "currency": { + "$ref": "#/components/schemas/Currency" + }, + "listedDt": { + "$ref": "#/components/schemas/Date" + }, + "delistedDt": { + "$ref": "#/components/schemas/Date" + }, + "description": { + "type": "string" + }, + "exchangeId": { + "type": "integer", + "format": "int32" + }, + "id": { + "type": "integer", + "format": "int32" + }, + "multiplier": { + "type": "number", + "format": "double" + }, + "priceBaseFactor": { + "type": "number", + "format": "double" + }, + "priceDisplayFactor": { + "type": "number", + "format": "double" + }, + "priceDisplayFormat": { + "$ref": "#/components/schemas/NumericDisplayFormat" + }, + "qtyDisplayFactor": { + "type": "number", + "format": "double" + }, + "qtyDisplayFormat": { + "$ref": "#/components/schemas/NumericDisplayFormat" + }, + "securityCategory": { + "$ref": "#/components/schemas/SecurityCategory" + }, + "symbol": { + "type": "string" + }, + "tickRule": { + "type": "string" + }, + "tickSize": { + "type": "number", + "format": "double" + }, + "tickValue": { + "type": "number", + "format": "double" + }, + "tradedExchanges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExchangeCode" + } + }, + "quoteCurrency": { + "$ref": "#/components/schemas/Currency" + } + }, + "additionalProperties": false + }, + "Currency": { + "enum": [ + "CURRENCY_USD", + "CURRENCY_AED", + "CURRENCY_AFN", + "CURRENCY_ALL", + "CURRENCY_AMD", + "CURRENCY_ANG", + "CURRENCY_AOA", + "CURRENCY_ARS", + "CURRENCY_AUD", + "CURRENCY_AWG", + "CURRENCY_AZN", + "CURRENCY_BAM", + "CURRENCY_BBD", + "CURRENCY_BDT", + "CURRENCY_BGN", + "CURRENCY_BHD", + "CURRENCY_BIF", + "CURRENCY_BMD", + "CURRENCY_BND", + "CURRENCY_BOB", + "CURRENCY_BRL", + "CURRENCY_BSD", + "CURRENCY_BTN", + "CURRENCY_BWP", + "CURRENCY_BYR", + "CURRENCY_BZD", + "CURRENCY_CAD", + "CURRENCY_CDF", + "CURRENCY_CHF", + "CURRENCY_CLP", + "CURRENCY_CNY", + "CURRENCY_COP", + "CURRENCY_CRC", + "CURRENCY_CUC", + "CURRENCY_CUP", + "CURRENCY_CVE", + "CURRENCY_CZK", + "CURRENCY_DJF", + "CURRENCY_DKK", + "CURRENCY_DOP", + "CURRENCY_DZD", + "CURRENCY_EGP", + "CURRENCY_ERN", + "CURRENCY_ETB", + "CURRENCY_EUR", + "CURRENCY_FJD", + "CURRENCY_FKP", + "CURRENCY_GBP", + "CURRENCY_GEL", + "CURRENCY_GGP", + "CURRENCY_GHS", + "CURRENCY_GIP", + "CURRENCY_GMD", + "CURRENCY_GNF", + "CURRENCY_GTQ", + "CURRENCY_GYD", + "CURRENCY_HKD", + "CURRENCY_HNL", + "CURRENCY_HRK", + "CURRENCY_HTG", + "CURRENCY_HUF", + "CURRENCY_IDR", + "CURRENCY_ILS", + "CURRENCY_IMP", + "CURRENCY_INR", + "CURRENCY_IQD", + "CURRENCY_IRR", + "CURRENCY_ISK", + "CURRENCY_JEP", + "CURRENCY_JMD", + "CURRENCY_JOD", + "CURRENCY_JPY", + "CURRENCY_KES", + "CURRENCY_KGS", + "CURRENCY_KHR", + "CURRENCY_KMF", + "CURRENCY_KPW", + "CURRENCY_KRW", + "CURRENCY_KWD", + "CURRENCY_KYD", + "CURRENCY_KZT", + "CURRENCY_LAK", + "CURRENCY_LBP", + "CURRENCY_LKR", + "CURRENCY_LRD", + "CURRENCY_LSL", + "CURRENCY_LTL", + "CURRENCY_LYD", + "CURRENCY_MAD", + "CURRENCY_MDL", + "CURRENCY_MGA", + "CURRENCY_MKD", + "CURRENCY_MMK", + "CURRENCY_MNT", + "CURRENCY_MOP", + "CURRENCY_MRO", + "CURRENCY_MUR", + "CURRENCY_MVR", + "CURRENCY_MWK", + "CURRENCY_MXN", + "CURRENCY_MYR", + "CURRENCY_MZN", + "CURRENCY_NAD", + "CURRENCY_NGN", + "CURRENCY_NIO", + "CURRENCY_NOK", + "CURRENCY_NPR", + "CURRENCY_NZD", + "CURRENCY_OMR", + "CURRENCY_PAB", + "CURRENCY_PEN", + "CURRENCY_PGK", + "CURRENCY_PHP", + "CURRENCY_PKR", + "CURRENCY_PLN", + "CURRENCY_PYG", + "CURRENCY_QAR", + "CURRENCY_RON", + "CURRENCY_RSD", + "CURRENCY_RUB", + "CURRENCY_RWF", + "CURRENCY_SAR", + "CURRENCY_SBD", + "CURRENCY_SCR", + "CURRENCY_SDG", + "CURRENCY_SEK", + "CURRENCY_SGD", + "CURRENCY_SHP", + "CURRENCY_SLL", + "CURRENCY_SOS", + "CURRENCY_SPL", + "CURRENCY_SRD", + "CURRENCY_STD", + "CURRENCY_SVC", + "CURRENCY_SYP", + "CURRENCY_SZL", + "CURRENCY_THB", + "CURRENCY_TJS", + "CURRENCY_TMT", + "CURRENCY_TND", + "CURRENCY_TOP", + "CURRENCY_TRY", + "CURRENCY_TTD", + "CURRENCY_TVD", + "CURRENCY_TWD", + "CURRENCY_TZS", + "CURRENCY_UAH", + "CURRENCY_UGX", + "CURRENCY_UYU", + "CURRENCY_UZS", + "CURRENCY_VEF", + "CURRENCY_VND", + "CURRENCY_VUV", + "CURRENCY_WST", + "CURRENCY_XAF", + "CURRENCY_XCD", + "CURRENCY_XDR", + "CURRENCY_XOF", + "CURRENCY_XPF", + "CURRENCY_YER", + "CURRENCY_ZAR", + "CURRENCY_ZMW", + "CURRENCY_ZWD", + "CURRENCY_CNH", + "CURRENCY_NLG", + "CURRENCY_DEM", + "CURRENCY_SKK", + "CURRENCY_EEK", + "CURRENCY_LVL", + "CURRENCY_XXX", + "CURRENCY_GBX", + "CURRENCY_BTC", + "CURRENCY_ETH" + ], + "type": "string" + }, + "CxlRejResponseTo": { + "enum": [ + "CXL_REJ_RESPONSE_TO_UNKNOWN", + "CXL_REJ_RESPONSE_TO_ORDER_CANCEL_REQUEST", + "CXL_REJ_RESPONSE_TO_ORDER_CANCEL_REPLACE_REQUEST" + ], + "type": "string" + }, + "Date": { + "type": "object", + "properties": { + "year": { + "type": "integer", + "format": "int32" + }, + "month": { + "type": "integer", + "format": "int32" + }, + "day": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "EasyToBorrowSecurity": { + "type": "object", + "properties": { + "symbol": { + "type": "string" + }, + "locateId": { + "type": "string" + } + }, + "additionalProperties": false + }, + "Empty": { + "type": "object", + "additionalProperties": false + }, + "Exchange": { + "type": "object", + "properties": { + "Country": { + "type": "string" + }, + "Description": { + "type": "string" + }, + "DisplayName": { + "type": "string" + }, + "Id": { + "type": "integer", + "format": "int32" + }, + "MIC": { + "type": "string" + }, + "MicrosoftTimezone": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "OlsonTimezone": { + "type": "string" + }, + "OperatingMIC": { + "type": "string" + }, + "Region": { + "type": "string" + }, + "ShortCode": { + "type": "string" + }, + "Suffix": { + "type": "string" + }, + "UtcOffset": { + "type": "integer", + "format": "int32" + }, + "Website": { + "type": "string" + } + }, + "additionalProperties": false + }, + "ExchangeCode": { + "enum": [ + "EXCHANGE_CODE_XXXX", + "EXCHANGE_CODE_USEQ", + "EXCHANGE_CODE_BATS", + "EXCHANGE_CODE_BATY", + "EXCHANGE_CODE_EDGA", + "EXCHANGE_CODE_EDGX", + "EXCHANGE_CODE_XASE", + "EXCHANGE_CODE_XBOS", + "EXCHANGE_CODE_XNYS", + "EXCHANGE_CODE_ARCX", + "EXCHANGE_CODE_XNAS", + "EXCHANGE_CODE_XCHI", + "EXCHANGE_CODE_XPSX", + "EXCHANGE_CODE_XISE", + "EXCHANGE_CODE_XADF", + "EXCHANGE_CODE_IEXG", + "EXCHANGE_CODE_XNGS", + "EXCHANGE_CODE_LTSE", + "EXCHANGE_CODE_MEMX", + "EXCHANGE_CODE_EPRL", + "EXCHANGE_CODE_XCIS", + "EXCHANGE_CODE_CBSX", + "EXCHANGE_CODE_OOTC", + "EXCHANGE_CODE_OTCM", + "EXCHANGE_CODE_OTCB", + "EXCHANGE_CODE_OTCQ", + "EXCHANGE_CODE_PINC", + "EXCHANGE_CODE_PINX", + "EXCHANGE_CODE_XOTC", + "EXCHANGE_CODE_DJXX", + "EXCHANGE_CODE_SPXX", + "EXCHANGE_CODE_RTXX", + "EXCHANGE_CODE_GIDS", + "EXCHANGE_CODE_CSMI", + "EXCHANGE_CODE_OPRA", + "EXCHANGE_CODE_CGIX", + "EXCHANGE_CODE_MSCI", + "EXCHANGE_CODE_MSTR", + "EXCHANGE_CODE_XOCC", + "EXCHANGE_CODE_BATO", + "EXCHANGE_CODE_EDGO", + "EXCHANGE_CODE_XMIO", + "EXCHANGE_CODE_MPRL", + "EXCHANGE_CODE_XBOX", + "EXCHANGE_CODE_XCBO", + "EXCHANGE_CODE_C2OX", + "EXCHANGE_CODE_XBXO", + "EXCHANGE_CODE_XPHO", + "EXCHANGE_CODE_AMXO", + "EXCHANGE_CODE_ARCO", + "EXCHANGE_CODE_XISX", + "EXCHANGE_CODE_MCRY", + "EXCHANGE_CODE_GMNI", + "EXCHANGE_CODE_XNDQ", + "EXCHANGE_CODE_EMLD", + "EXCHANGE_CODE_MXOP", + "EXCHANGE_CODE_SPHR", + "EXCHANGE_CODE_XCBT", + "EXCHANGE_CODE_XKBT", + "EXCHANGE_CODE_XCME", + "EXCHANGE_CODE_GLBX", + "EXCHANGE_CODE_XNYM", + "EXCHANGE_CODE_XCBF", + "EXCHANGE_CODE_XCEC", + "EXCHANGE_CODE_BLCK" + ], + "type": "string" + }, + "ExecType": { + "enum": [ + "EXEC_TYPE_UNKNOWN", + "EXEC_TYPE_NEW", + "EXEC_TYPE_DONE_FOR_DAY", + "EXEC_TYPE_CANCELED", + "EXEC_TYPE_REPLACED", + "EXEC_TYPE_PENDING_CANCEL", + "EXEC_TYPE_STOPPED", + "EXEC_TYPE_REJECTED", + "EXEC_TYPE_SUSPENDED", + "EXEC_TYPE_PENDING_NEW", + "EXEC_TYPE_EXPIRED", + "EXEC_TYPE_RESTATED", + "EXEC_TYPE_PENDING_REPLACE", + "EXEC_TYPE_TRADE", + "EXEC_TYPE_TRADE_CORRECT", + "EXEC_TYPE_TRADE_BUST", + "EXEC_TYPE_UPDATE", + "EXEC_TYPE_NOTE", + "EXEC_TYPE_QUEUED_ORDER", + "EXEC_TYPE_REPRESENTED", + "EXEC_TYPE_USER_CLAIMED", + "EXEC_TYPE_CLAIM_REQUIRED", + "EXEC_TYPE_UPDATE_OPTIONAL_DATA" + ], + "type": "string" + }, + "Execution": { + "type": "object", + "properties": { + "accountId": { + "type": "integer", + "format": "int32" + }, + "algo": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "allocId": { + "type": "string" + }, + "auxPrice": { + "type": "number", + "format": "double" + }, + "avgPrice": { + "type": "number", + "format": "double" + }, + "claimedBy": { + "type": "string" + }, + "clearingInfo": { + "$ref": "#/components/schemas/ClearingInfo" + }, + "commission": { + "type": "number", + "format": "double" + }, + "cumQty": { + "type": "number", + "format": "double" + }, + "curOrdId": { + "type": "string" + }, + "execBroker": { + "type": "string" + }, + "execId": { + "type": "string" + }, + "execRefId": { + "type": "string" + }, + "execType": { + "$ref": "#/components/schemas/ExecType" + }, + "fee1": { + "type": "number", + "format": "double" + }, + "fee2": { + "type": "number", + "format": "double" + }, + "header": { + "$ref": "#/components/schemas/Header" + }, + "incomingClOrdId": { + "type": "string" + }, + "incomingOrdId": { + "type": "string" + }, + "incomingOrigClOrdId": { + "type": "string" + }, + "instructions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderInstruction" + } + }, + "lastMarket": { + "type": "string" + }, + "lastPrice": { + "type": "number", + "format": "double" + }, + "lastQty": { + "type": "number", + "format": "double" + }, + "leavesQty": { + "type": "number", + "format": "double" + }, + "legId": { + "type": "string" + }, + "liquidityFlag": { + "type": "string" + }, + "multiLegReportingType": { + "$ref": "#/components/schemas/MultiLegReportingType" + }, + "optionalData": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "orderFlags": { + "type": "integer", + "format": "int32" + }, + "ordStatus": { + "$ref": "#/components/schemas/OrdStatus" + }, + "ordType": { + "$ref": "#/components/schemas/OrdType" + }, + "originationType": { + "$ref": "#/components/schemas/OriginationType" + }, + "origOrdId": { + "type": "string" + }, + "parentOrdId": { + "type": "string" + }, + "permOrdId": { + "type": "string" + }, + "positionEffect": { + "$ref": "#/components/schemas/PositionEffect" + }, + "price": { + "type": "number", + "format": "double" + }, + "priceType": { + "$ref": "#/components/schemas/PriceType" + }, + "qty": { + "type": "number", + "format": "double" + }, + "route": { + "type": "string" + }, + "routingSession": { + "type": "string" + }, + "security": { + "$ref": "#/components/schemas/Security" + }, + "side": { + "$ref": "#/components/schemas/Side" + }, + "source": { + "type": "string" + }, + "symbol": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "text": { + "type": "string" + }, + "tif": { + "$ref": "#/components/schemas/Tif" + }, + "traderId": { + "type": "string" + }, + "transactTs": { + "type": "string" + }, + "userId": { + "type": "integer", + "format": "int32" + }, + "workingQty": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "FlexOption": { + "type": "object", + "properties": { + "aliases": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "currency": { + "$ref": "#/components/schemas/Currency" + }, + "listedDt": { + "$ref": "#/components/schemas/Date" + }, + "delistedDt": { + "$ref": "#/components/schemas/Date" + }, + "description": { + "type": "string" + }, + "exchangeId": { + "type": "integer", + "format": "int32" + }, + "id": { + "type": "integer", + "format": "int32" + }, + "multiplier": { + "type": "number", + "format": "double" + }, + "priceBaseFactor": { + "type": "number", + "format": "double" + }, + "priceDisplayFactor": { + "type": "number", + "format": "double" + }, + "priceDisplayFormat": { + "$ref": "#/components/schemas/NumericDisplayFormat" + }, + "qtyDisplayFactor": { + "type": "number", + "format": "double" + }, + "qtyDisplayFormat": { + "$ref": "#/components/schemas/NumericDisplayFormat" + }, + "securityCategory": { + "$ref": "#/components/schemas/SecurityCategory" + }, + "symbol": { + "type": "string" + }, + "tickRule": { + "type": "string" + }, + "tickSize": { + "type": "number", + "format": "double" + }, + "tickValue": { + "type": "number", + "format": "double" + }, + "tradedExchanges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExchangeCode" + } + }, + "capPercentage": { + "type": "number", + "format": "double" + }, + "creationDt": { + "$ref": "#/components/schemas/Date" + }, + "deliverablePerContract": { + "type": "number", + "format": "double" + }, + "exerciseStyle": { + "$ref": "#/components/schemas/OptionExerciseStyle" + }, + "expirationDt": { + "$ref": "#/components/schemas/Date" + }, + "observationDay": { + "type": "integer", + "format": "int32" + }, + "percentagePricing": { + "type": "boolean" + }, + "productType": { + "$ref": "#/components/schemas/OptionSeriesProductType" + }, + "putCall": { + "$ref": "#/components/schemas/PutCall" + }, + "root": { + "type": "string" + }, + "rootBase": { + "type": "string" + }, + "settlementType": { + "$ref": "#/components/schemas/OptionSettlementType" + }, + "strike": { + "type": "number", + "format": "double" + }, + "underlying": { + "type": "string" + } + }, + "additionalProperties": false + }, + "FlexSettlementType": { + "enum": [ + "FLEX_SETTLEMENT_TYPE_AM", + "FLEX_SETTLEMENT_TYPE_PM", + "FLEX_SETTLEMENT_TYPE_PM_CASH", + "FLEX_SETTLEMENT_TYPE_ASIAN", + "FLEX_SETTLEMENT_TYPE_CLIQUET" + ], + "type": "string" + }, + "Future": { + "type": "object", + "properties": { + "aliases": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "currency": { + "$ref": "#/components/schemas/Currency" + }, + "listedDt": { + "$ref": "#/components/schemas/Date" + }, + "delistedDt": { + "$ref": "#/components/schemas/Date" + }, + "description": { + "type": "string" + }, + "exchangeId": { + "type": "integer", + "format": "int32" + }, + "id": { + "type": "integer", + "format": "int32" + }, + "multiplier": { + "type": "number", + "format": "double" + }, + "priceBaseFactor": { + "type": "number", + "format": "double" + }, + "priceDisplayFactor": { + "type": "number", + "format": "double" + }, + "priceDisplayFormat": { + "$ref": "#/components/schemas/NumericDisplayFormat" + }, + "qtyDisplayFactor": { + "type": "number", + "format": "double" + }, + "qtyDisplayFormat": { + "$ref": "#/components/schemas/NumericDisplayFormat" + }, + "securityCategory": { + "$ref": "#/components/schemas/SecurityCategory" + }, + "symbol": { + "type": "string" + }, + "tickRule": { + "type": "string" + }, + "tickSize": { + "type": "number", + "format": "double" + }, + "tickValue": { + "type": "number", + "format": "double" + }, + "tradedExchanges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExchangeCode" + } + }, + "contractMYY": { + "type": "string" + }, + "firstNoticeDt": { + "$ref": "#/components/schemas/Date" + }, + "firstTradeDt": { + "$ref": "#/components/schemas/Date" + }, + "lastNoticeDt": { + "$ref": "#/components/schemas/Date" + }, + "lastTradeDt": { + "$ref": "#/components/schemas/Date" + }, + "root": { + "$ref": "#/components/schemas/FutureRoot" + } + }, + "additionalProperties": false + }, + "FutureRoot": { + "type": "object", + "properties": { + "aliases": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "currency": { + "$ref": "#/components/schemas/Currency" + }, + "listedDt": { + "$ref": "#/components/schemas/Date" + }, + "delistedDt": { + "$ref": "#/components/schemas/Date" + }, + "description": { + "type": "string" + }, + "exchangeId": { + "type": "integer", + "format": "int32" + }, + "id": { + "type": "integer", + "format": "int32" + }, + "multiplier": { + "type": "number", + "format": "double" + }, + "priceBaseFactor": { + "type": "number", + "format": "double" + }, + "priceDisplayFactor": { + "type": "number", + "format": "double" + }, + "priceDisplayFormat": { + "$ref": "#/components/schemas/NumericDisplayFormat" + }, + "qtyDisplayFactor": { + "type": "number", + "format": "double" + }, + "qtyDisplayFormat": { + "$ref": "#/components/schemas/NumericDisplayFormat" + }, + "securityCategory": { + "$ref": "#/components/schemas/SecurityCategory" + }, + "symbol": { + "type": "string" + }, + "tickRule": { + "type": "string" + }, + "tickSize": { + "type": "number", + "format": "double" + }, + "tickValue": { + "type": "number", + "format": "double" + }, + "tradedExchanges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExchangeCode" + } + }, + "productGroup": { + "$ref": "#/components/schemas/ProductGroup" + }, + "productSubGroup": { + "$ref": "#/components/schemas/ProductSubGroup" + }, + "settlementDeliverableType": { + "$ref": "#/components/schemas/SettlementDeliverableType" + }, + "unitOfMeasure": { + "type": "string" + }, + "unitOfMeasureQty": { + "type": "number", + "format": "double" + }, + "tradingSessionGroup": { + "$ref": "#/components/schemas/TradingSessionGroup" + } + }, + "additionalProperties": false + }, + "FutureSpread": { + "type": "object", + "properties": { + "aliases": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "currency": { + "$ref": "#/components/schemas/Currency" + }, + "listedDt": { + "$ref": "#/components/schemas/Date" + }, + "delistedDt": { + "$ref": "#/components/schemas/Date" + }, + "description": { + "type": "string" + }, + "exchangeId": { + "type": "integer", + "format": "int32" + }, + "id": { + "type": "integer", + "format": "int32" + }, + "multiplier": { + "type": "number", + "format": "double" + }, + "priceBaseFactor": { + "type": "number", + "format": "double" + }, + "priceDisplayFactor": { + "type": "number", + "format": "double" + }, + "priceDisplayFormat": { + "$ref": "#/components/schemas/NumericDisplayFormat" + }, + "qtyDisplayFactor": { + "type": "number", + "format": "double" + }, + "qtyDisplayFormat": { + "$ref": "#/components/schemas/NumericDisplayFormat" + }, + "securityCategory": { + "$ref": "#/components/schemas/SecurityCategory" + }, + "symbol": { + "type": "string" + }, + "tickRule": { + "type": "string" + }, + "tickSize": { + "type": "number", + "format": "double" + }, + "tickValue": { + "type": "number", + "format": "double" + }, + "tradedExchanges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExchangeCode" + } + }, + "contractMYY": { + "type": "string" + }, + "displayFactor": { + "type": "number", + "format": "double" + }, + "firstNoticeDt": { + "$ref": "#/components/schemas/Date" + }, + "firstTradeDt": { + "$ref": "#/components/schemas/Date" + }, + "lastNoticeDt": { + "$ref": "#/components/schemas/Date" + }, + "lastTradeDt": { + "$ref": "#/components/schemas/Date" + }, + "legs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FutureSpreadLeg" + } + }, + "spreadCode": { + "type": "string" + } + }, + "additionalProperties": false + }, + "FutureSpreadLeg": { + "type": "object", + "properties": { + "delta": { + "type": "number", + "format": "double" + }, + "price": { + "type": "number", + "format": "double" + }, + "ratio": { + "type": "integer", + "format": "int32" + }, + "future": { + "$ref": "#/components/schemas/Future" + }, + "side": { + "$ref": "#/components/schemas/SpreadLegSide" + }, + "spreadLegType": { + "$ref": "#/components/schemas/SpreadLegType" + } + }, + "additionalProperties": false + }, + "Fx": { + "type": "object", + "properties": { + "aliases": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "currency": { + "$ref": "#/components/schemas/Currency" + }, + "listedDt": { + "$ref": "#/components/schemas/Date" + }, + "delistedDt": { + "$ref": "#/components/schemas/Date" + }, + "description": { + "type": "string" + }, + "exchangeId": { + "type": "integer", + "format": "int32" + }, + "id": { + "type": "integer", + "format": "int32" + }, + "multiplier": { + "type": "number", + "format": "double" + }, + "priceBaseFactor": { + "type": "number", + "format": "double" + }, + "priceDisplayFactor": { + "type": "number", + "format": "double" + }, + "priceDisplayFormat": { + "$ref": "#/components/schemas/NumericDisplayFormat" + }, + "qtyDisplayFactor": { + "type": "number", + "format": "double" + }, + "qtyDisplayFormat": { + "$ref": "#/components/schemas/NumericDisplayFormat" + }, + "securityCategory": { + "$ref": "#/components/schemas/SecurityCategory" + }, + "symbol": { + "type": "string" + }, + "tickRule": { + "type": "string" + }, + "tickSize": { + "type": "number", + "format": "double" + }, + "tickValue": { + "type": "number", + "format": "double" + }, + "tradedExchanges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExchangeCode" + } + }, + "quoteCurrency": { + "$ref": "#/components/schemas/Currency" + } + }, + "additionalProperties": false + }, + "GenericOrder": { + "type": "object", + "properties": { + "order": { + "$ref": "#/components/schemas/Order" + }, + "orderCross": { + "$ref": "#/components/schemas/OrderCross" + }, + "multiLegOrder": { + "$ref": "#/components/schemas/MultiLegOrder" + }, + "multiLegOrderCross": { + "$ref": "#/components/schemas/MultiLegOrderCross" + } + }, + "additionalProperties": false + }, + "GetActiveUserResponse": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/User" + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "GetServerInfoResponse": { + "type": "object", + "properties": { + "environment": { + "type": "string" + }, + "serverBuildTs": { + "type": "string" + }, + "serverHash": { + "type": "string" + }, + "serverName": { + "type": "string" + }, + "serverVersion": { + "type": "string" + }, + "site": { + "type": "string" + }, + "systemSettings": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "GetServerTimeResponse": { + "type": "object", + "properties": { + "serverTimeUtc": { + "type": "string" + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "GetTradingHolidaysResponse": { + "type": "object", + "properties": { + "tradingHolidays": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TradingHoliday" + } + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "Header": { + "type": "object", + "properties": { + "deliverToCompId": { + "type": "string" + }, + "deliverToSubId": { + "type": "string" + }, + "onBehalfOfCompId": { + "type": "string" + }, + "onBehalfOfSubId": { + "type": "string" + }, + "senderCompId": { + "type": "string" + }, + "senderSubId": { + "type": "string" + }, + "targetCompId": { + "type": "string" + }, + "targetSubId": { + "type": "string" + } + }, + "additionalProperties": false + }, + "Index": { + "type": "object", + "properties": { + "aliases": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "currency": { + "$ref": "#/components/schemas/Currency" + }, + "listedDt": { + "$ref": "#/components/schemas/Date" + }, + "delistedDt": { + "$ref": "#/components/schemas/Date" + }, + "description": { + "type": "string" + }, + "exchangeId": { + "type": "integer", + "format": "int32" + }, + "id": { + "type": "integer", + "format": "int32" + }, + "multiplier": { + "type": "number", + "format": "double" + }, + "priceBaseFactor": { + "type": "number", + "format": "double" + }, + "priceDisplayFactor": { + "type": "number", + "format": "double" + }, + "priceDisplayFormat": { + "$ref": "#/components/schemas/NumericDisplayFormat" + }, + "qtyDisplayFactor": { + "type": "number", + "format": "double" + }, + "qtyDisplayFormat": { + "$ref": "#/components/schemas/NumericDisplayFormat" + }, + "securityCategory": { + "$ref": "#/components/schemas/SecurityCategory" + }, + "symbol": { + "type": "string" + }, + "tickRule": { + "type": "string" + }, + "tickSize": { + "type": "number", + "format": "double" + }, + "tickValue": { + "type": "number", + "format": "double" + }, + "tradedExchanges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExchangeCode" + } + } + }, + "additionalProperties": false + }, + "ListAccountsResponse": { + "type": "object", + "properties": { + "accounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Account" + } + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "ListAffiliatedTradingFirmsResponse": { + "type": "object", + "properties": { + "affiliatedFirms": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TradingFirmSlim" + } + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "ListEasyToBorrowSecuritiesRequest": { + "type": "object", + "properties": { + "tradingFirmId": { + "type": "integer", + "format": "int32" + }, + "accountId": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "ListEasyToBorrowSecuritiesResponse": { + "type": "object", + "properties": { + "securities": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EasyToBorrowSecurity" + } + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "ListExchangesResponse": { + "type": "object", + "properties": { + "exchanges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Exchange" + } + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "ListOptionChainsRepsonse": { + "type": "object", + "properties": { + "optionChains": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OptionChain" + } + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "ListOptionChainsRequest": { + "type": "object", + "properties": { + "underlyingSymbols": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "ListOrdersResponse": { + "type": "object", + "properties": { + "orders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GenericOrder" + } + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "ListPositionsResponse": { + "type": "object", + "properties": { + "positions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Position" + } + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "ListRoutesResponse": { + "type": "object", + "properties": { + "routes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Route" + } + }, + "routeApplicabilities": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RouteApplicability" + } + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "ListSecuritiesRequest": { + "type": "object", + "properties": { + "symbols": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "ListSecuritiesResponse": { + "type": "object", + "properties": { + "securities": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Security" + } + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "ListTradeConfirmsResponse": { + "type": "object", + "properties": { + "tradeConfirms": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TradeConfirm" + } + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "ListTradingFirmsResponse": { + "type": "object", + "properties": { + "tradingFirms": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TradingFirm" + } + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "LoginRequest": { + "type": "object", + "properties": { + "domain": { + "type": "string" + }, + "username": { + "type": "string" + }, + "password": { + "type": "string" + }, + "applicationName": { + "type": "string" + }, + "applicationVersion": { + "type": "string" + } + }, + "additionalProperties": false + }, + "LoginResponse": { + "type": "object", + "properties": { + "token": { + "type": "string" + }, + "environment": { + "type": "string" + }, + "loginAttemptsRemaining": { + "type": "integer", + "format": "int32" + }, + "loginStatus": { + "$ref": "#/components/schemas/LoginStatus" + }, + "serverBuildTs": { + "type": "string" + }, + "serverHash": { + "type": "string" + }, + "serverName": { + "type": "string" + }, + "serverTimeUtc": { + "type": "string" + }, + "serverVersion": { + "type": "string" + }, + "site": { + "type": "string" + }, + "text": { + "type": "string" + }, + "user": { + "$ref": "#/components/schemas/User" + }, + "systemSettings": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "LoginStatus": { + "enum": [ + "UNDEFINED", + "NOT_AUTHORIZED", + "LOGIN_SUCCESS", + "VERSION_TOO_OLD", + "SERVER_HASH_CHANGED", + "PASSWORD_EXPIRED", + "PASSWORD_CHANGE_SUCCESSFUL", + "PASSWORD_CHANGE_FAILED", + "LOGIN_DISALLOWED", + "CONNECTION_FAILED", + "MFA_REQUIRED", + "MFA_FAILED" + ], + "type": "string" + }, + "MarginData": { + "type": "object", + "properties": { + "accountId": { + "type": "integer", + "format": "int32" + }, + "tims": { + "$ref": "#/components/schemas/TimsMarginData" + }, + "span": { + "$ref": "#/components/schemas/Empty" + } + }, + "additionalProperties": false + }, + "MarginDataType": { + "enum": [ + "MARGIN_DATA_TYPE_UNKNOWN", + "MARGIN_DATA_TYPE_TIMS", + "MARGIN_DATA_TYPE_SPAN" + ], + "type": "string" + }, + "MultiLegOrder": { + "type": "object", + "properties": { + "accountId": { + "type": "integer", + "format": "int32" + }, + "algo": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "auxPrice": { + "type": "number", + "format": "double" + }, + "clearingInfo": { + "$ref": "#/components/schemas/ClearingInfo" + }, + "curOrdId": { + "type": "string" + }, + "header": { + "$ref": "#/components/schemas/Header" + }, + "id": { + "type": "string" + }, + "incomingClOrdId": { + "type": "string" + }, + "incomingOrdId": { + "type": "string" + }, + "instructions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderInstruction" + } + }, + "legs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MultiLegOrderLeg" + } + }, + "marketCondition": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "optionalData": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "orderFlags": { + "type": "integer", + "format": "int32" + }, + "orderUpdates": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderUpdateEvent" + } + }, + "ordType": { + "$ref": "#/components/schemas/OrdType" + }, + "originationType": { + "$ref": "#/components/schemas/OriginationType" + }, + "parentOrdId": { + "type": "string" + }, + "price": { + "type": "number", + "format": "double" + }, + "priceType": { + "$ref": "#/components/schemas/PriceType" + }, + "qty": { + "type": "number", + "format": "double" + }, + "route": { + "type": "string" + }, + "source": { + "type": "string" + }, + "sourceAddress": { + "type": "string" + }, + "submitTs": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "text": { + "type": "string" + }, + "tif": { + "$ref": "#/components/schemas/Tif" + }, + "userId": { + "type": "integer", + "format": "int32" + }, + "traderId": { + "type": "string" + }, + "ordStatus": { + "$ref": "#/components/schemas/OrdStatus" + }, + "avgPrice": { + "type": "number", + "format": "double" + }, + "claimedBy": { + "type": "string" + }, + "lastPrice": { + "type": "number", + "format": "double" + }, + "lastQty": { + "type": "number", + "format": "double" + }, + "lastMarket": { + "type": "string" + }, + "leavesQty": { + "type": "number", + "format": "double" + }, + "cumQty": { + "type": "number", + "format": "double" + }, + "transactTs": { + "type": "string" + }, + "workingQty": { + "type": "number", + "format": "double" + }, + "hasBusts": { + "type": "boolean" + }, + "hasCorrects": { + "type": "boolean" + }, + "hasNotes": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "MultiLegOrderCancelReplaceRequest": { + "type": "object", + "properties": { + "algo": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "auxPrice": { + "type": "number", + "format": "double" + }, + "clearingInfo": { + "$ref": "#/components/schemas/ClearingInfo" + }, + "curOrdId": { + "type": "string" + }, + "header": { + "$ref": "#/components/schemas/Header" + }, + "incomingClOrdId": { + "type": "string" + }, + "incomingOrigClOrdId": { + "type": "string" + }, + "instructions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderInstruction" + } + }, + "optionalData": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "marketCondition": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "ordType": { + "$ref": "#/components/schemas/OrdType" + }, + "originationType": { + "$ref": "#/components/schemas/OriginationType" + }, + "permOrdId": { + "type": "string" + }, + "price": { + "type": "number", + "format": "double" + }, + "priceType": { + "$ref": "#/components/schemas/PriceType" + }, + "qty": { + "type": "number", + "format": "double" + }, + "reqOrdId": { + "type": "string" + }, + "side": { + "$ref": "#/components/schemas/Side" + }, + "source": { + "type": "string" + }, + "submitTs": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "text": { + "type": "string" + }, + "tif": { + "$ref": "#/components/schemas/Tif" + }, + "traderId": { + "type": "string" + }, + "userId": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "MultiLegOrderCross": { + "type": "object", + "properties": { + "accountId": { + "type": "integer", + "format": "int32" + }, + "algo": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "allocations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MultiLegOrderCrossAllocation" + } + }, + "crossType": { + "$ref": "#/components/schemas/CrossType" + }, + "curOrdId": { + "type": "string" + }, + "header": { + "$ref": "#/components/schemas/Header" + }, + "id": { + "type": "string" + }, + "incomingClOrdId": { + "type": "string" + }, + "incomingOrdId": { + "type": "string" + }, + "instructions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderInstruction" + } + }, + "marketCondition": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "optionalData": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "orderFlags": { + "type": "integer", + "format": "int32" + }, + "orderUpdates": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderUpdateEvent" + } + }, + "ordType": { + "$ref": "#/components/schemas/OrdType" + }, + "originationType": { + "$ref": "#/components/schemas/OriginationType" + }, + "parentOrdId": { + "type": "string" + }, + "price": { + "type": "number", + "format": "double" + }, + "priceType": { + "$ref": "#/components/schemas/PriceType" + }, + "qty": { + "type": "number", + "format": "double" + }, + "route": { + "type": "string" + }, + "source": { + "type": "string" + }, + "sourceAddress": { + "type": "string" + }, + "submitTs": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "text": { + "type": "string" + }, + "tif": { + "$ref": "#/components/schemas/Tif" + }, + "userId": { + "type": "integer", + "format": "int32" + }, + "traderId": { + "type": "string" + }, + "claimedBy": { + "type": "string" + }, + "ordStatus": { + "$ref": "#/components/schemas/OrdStatus" + }, + "transactTs": { + "type": "string" + }, + "hasBusts": { + "type": "boolean" + }, + "hasCorrects": { + "type": "boolean" + }, + "hasNotes": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "MultiLegOrderCrossAllocation": { + "type": "object", + "properties": { + "accountId": { + "type": "integer", + "format": "int32" + }, + "clearingInfo": { + "$ref": "#/components/schemas/ClearingInfo" + }, + "id": { + "type": "string" + }, + "instructions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderInstruction" + } + }, + "legs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MultiLegOrderLeg" + } + }, + "optionalData": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "qty": { + "type": "number", + "format": "double" + }, + "sideType": { + "$ref": "#/components/schemas/CrossSideType" + }, + "avgPrice": { + "type": "number", + "format": "double" + }, + "lastPrice": { + "type": "number", + "format": "double" + }, + "lastQty": { + "type": "number", + "format": "double" + }, + "lastMarket": { + "type": "string" + }, + "leavesQty": { + "type": "number", + "format": "double" + }, + "cumQty": { + "type": "number", + "format": "double" + }, + "transactTs": { + "type": "string" + }, + "ordStatus": { + "$ref": "#/components/schemas/OrdStatus" + }, + "incomingClOrdId": { + "type": "string" + }, + "incomingOrdId": { + "type": "string" + } + }, + "additionalProperties": false + }, + "MultiLegOrderLeg": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "marketCondition": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "optionalData": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "orderUpdates": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderUpdateEvent" + } + }, + "positionEffect": { + "$ref": "#/components/schemas/PositionEffect" + }, + "price": { + "type": "number", + "format": "double" + }, + "qty": { + "type": "number", + "format": "double" + }, + "ratio": { + "type": "integer", + "format": "int32" + }, + "security": { + "$ref": "#/components/schemas/Security" + }, + "side": { + "$ref": "#/components/schemas/Side" + }, + "symbol": { + "type": "string" + }, + "avgPrice": { + "type": "number", + "format": "double" + }, + "lastPrice": { + "type": "number", + "format": "double" + }, + "lastQty": { + "type": "number", + "format": "double" + }, + "lastMarket": { + "type": "string" + }, + "leavesQty": { + "type": "number", + "format": "double" + }, + "cumQty": { + "type": "number", + "format": "double" + }, + "transactTs": { + "type": "string" + } + }, + "additionalProperties": false + }, + "MultiLegReportingType": { + "enum": [ + "MULTI_LEG_REPORTING_TYPE_SINGLE", + "MULTI_LEG_REPORTING_TYPE_LEG", + "MULTI_LEG_REPORTING_TYPE_PARENT" + ], + "type": "string" + }, + "NumericDisplayFormat": { + "enum": [ + "NUMERIC_DISPLAY_FORMAT_AUTO", + "NUMERIC_DISPLAY_FORMAT_DECIMAL_01", + "NUMERIC_DISPLAY_FORMAT_DECIMAL_02", + "NUMERIC_DISPLAY_FORMAT_DECIMAL_03", + "NUMERIC_DISPLAY_FORMAT_DECIMAL_04", + "NUMERIC_DISPLAY_FORMAT_DECIMAL_05", + "NUMERIC_DISPLAY_FORMAT_DECIMAL_06", + "NUMERIC_DISPLAY_FORMAT_DECIMAL_07", + "NUMERIC_DISPLAY_FORMAT_DECIMAL_08", + "NUMERIC_DISPLAY_FORMAT_DECIMAL_09", + "NUMERIC_DISPLAY_FORMAT_DECIMAL_10", + "NUMERIC_DISPLAY_FORMAT_DECIMAL_11", + "NUMERIC_DISPLAY_FORMAT_DECIMAL_00", + "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_WHOLE", + "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_HALF", + "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_QUARTER", + "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_8TH", + "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_16TH", + "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_32ND", + "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_64TH", + "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_128TH", + "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_256TH", + "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_512ND" + ], + "type": "string" + }, + "Option": { + "type": "object", + "properties": { + "aliases": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "currency": { + "$ref": "#/components/schemas/Currency" + }, + "listedDt": { + "$ref": "#/components/schemas/Date" + }, + "delistedDt": { + "$ref": "#/components/schemas/Date" + }, + "description": { + "type": "string" + }, + "exchangeId": { + "type": "integer", + "format": "int32" + }, + "id": { + "type": "integer", + "format": "int32" + }, + "multiplier": { + "type": "number", + "format": "double" + }, + "priceBaseFactor": { + "type": "number", + "format": "double" + }, + "priceDisplayFactor": { + "type": "number", + "format": "double" + }, + "priceDisplayFormat": { + "$ref": "#/components/schemas/NumericDisplayFormat" + }, + "qtyDisplayFactor": { + "type": "number", + "format": "double" + }, + "qtyDisplayFormat": { + "$ref": "#/components/schemas/NumericDisplayFormat" + }, + "securityCategory": { + "$ref": "#/components/schemas/SecurityCategory" + }, + "symbol": { + "type": "string" + }, + "tickRule": { + "type": "string" + }, + "tickSize": { + "type": "number", + "format": "double" + }, + "tickValue": { + "type": "number", + "format": "double" + }, + "tradedExchanges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExchangeCode" + } + }, + "expirationDt": { + "$ref": "#/components/schemas/Date" + }, + "expirationStyle": { + "$ref": "#/components/schemas/OptionExpirationStyle" + }, + "firstTradeDt": { + "$ref": "#/components/schemas/Date" + }, + "lastTradeDt": { + "$ref": "#/components/schemas/Date" + }, + "putCall": { + "$ref": "#/components/schemas/PutCall" + }, + "root": { + "$ref": "#/components/schemas/OptionRoot" + }, + "strike": { + "type": "number", + "format": "double" + }, + "underlying": { + "type": "string" + } + }, + "additionalProperties": false + }, + "OptionChain": { + "type": "object", + "properties": { + "underlying": { + "$ref": "#/components/schemas/Security" + }, + "roots": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/OptionRoot" + } + }, + "options": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/OptionChainOption" + } + }, + "optionSeries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OptionSeries" + } + }, + "post": { + "type": "string" + }, + "station": { + "type": "string" + } + }, + "additionalProperties": false + }, + "OptionChainOption": { + "type": "object", + "properties": { + "aliases": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "listedDt": { + "$ref": "#/components/schemas/Date" + }, + "delistedDt": { + "$ref": "#/components/schemas/Date" + }, + "description": { + "type": "string" + }, + "exchangeId": { + "type": "integer", + "format": "int32" + }, + "id": { + "type": "integer", + "format": "int32" + }, + "tickRule": { + "type": "string" + }, + "tickSize": { + "type": "number", + "format": "double" + }, + "tickValue": { + "type": "number", + "format": "double" + }, + "tradedExchanges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExchangeCode" + } + }, + "firstTradeDt": { + "$ref": "#/components/schemas/Date" + }, + "lastTradeDt": { + "$ref": "#/components/schemas/Date" + }, + "putCall": { + "$ref": "#/components/schemas/PutCall" + }, + "strike": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "OptionExerciseStyle": { + "enum": [ + "OPTION_EXERCISE_STYLE_UNDEFINED", + "OPTION_EXERCISE_STYLE_AMERICAN", + "OPTION_EXERCISE_STYLE_BERMUDAN", + "OPTION_EXERCISE_STYLE_EUROPEAN" + ], + "type": "string" + }, + "OptionExpirationStyle": { + "enum": [ + "OPTION_EXPIRATION_STYLE_UNKNOWN", + "OPTION_EXPIRATION_STYLE_WK1", + "OPTION_EXPIRATION_STYLE_WK2", + "OPTION_EXPIRATION_STYLE_WK3", + "OPTION_EXPIRATION_STYLE_WK4", + "OPTION_EXPIRATION_STYLE_WK5", + "OPTION_EXPIRATION_STYLE_DAILY", + "OPTION_EXPIRATION_STYLE_E_O_M", + "OPTION_EXPIRATION_STYLE_LEAP", + "OPTION_EXPIRATION_STYLE_MONTHLY", + "OPTION_EXPIRATION_STYLE_QUARTERLY", + "OPTION_EXPIRATION_STYLE_WEEKLY" + ], + "type": "string" + }, + "OptionRoot": { + "type": "object", + "properties": { + "aliases": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "currency": { + "$ref": "#/components/schemas/Currency" + }, + "listedDt": { + "$ref": "#/components/schemas/Date" + }, + "delistedDt": { + "$ref": "#/components/schemas/Date" + }, + "description": { + "type": "string" + }, + "exchangeId": { + "type": "integer", + "format": "int32" + }, + "id": { + "type": "integer", + "format": "int32" + }, + "multiplier": { + "type": "number", + "format": "double" + }, + "priceBaseFactor": { + "type": "number", + "format": "double" + }, + "priceDisplayFactor": { + "type": "number", + "format": "double" + }, + "priceDisplayFormat": { + "$ref": "#/components/schemas/NumericDisplayFormat" + }, + "qtyDisplayFactor": { + "type": "number", + "format": "double" + }, + "qtyDisplayFormat": { + "$ref": "#/components/schemas/NumericDisplayFormat" + }, + "securityCategory": { + "$ref": "#/components/schemas/SecurityCategory" + }, + "symbol": { + "type": "string" + }, + "tickRule": { + "type": "string" + }, + "tickSize": { + "type": "number", + "format": "double" + }, + "tickValue": { + "type": "number", + "format": "double" + }, + "tradedExchanges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExchangeCode" + } + }, + "deliverablePerContract": { + "type": "number", + "format": "double" + }, + "exerciseStyle": { + "$ref": "#/components/schemas/OptionExerciseStyle" + }, + "productType": { + "$ref": "#/components/schemas/OptionSeriesProductType" + }, + "seriesType": { + "$ref": "#/components/schemas/OptionSeriesType" + }, + "settlementInfos": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SettlementInfo" + } + }, + "settlementType": { + "$ref": "#/components/schemas/OptionSettlementType" + }, + "strikeMultiplier": { + "type": "number", + "format": "double" + }, + "strikeValue": { + "type": "number", + "format": "double" + }, + "tradingSessionGroup": { + "$ref": "#/components/schemas/TradingSessionGroup" + }, + "underlying": { + "type": "string" + } + }, + "additionalProperties": false + }, + "OptionSeries": { + "type": "object", + "properties": { + "expirationDt": { + "$ref": "#/components/schemas/Date" + }, + "expirationStyle": { + "$ref": "#/components/schemas/OptionExpirationStyle" + }, + "rootSymbol": { + "type": "string" + }, + "seriesType": { + "$ref": "#/components/schemas/OptionSeriesType" + }, + "settlementType": { + "$ref": "#/components/schemas/OptionSettlementType" + }, + "optionSymbols": { + "type": "array", + "items": { + "type": "string" + } + }, + "currency": { + "$ref": "#/components/schemas/Currency" + }, + "multiplier": { + "type": "number", + "format": "double" + }, + "priceBaseFactor": { + "type": "number", + "format": "double" + }, + "priceDisplayFactor": { + "type": "number", + "format": "double" + }, + "priceDisplayFormat": { + "$ref": "#/components/schemas/NumericDisplayFormat" + }, + "qtyDisplayFactor": { + "type": "number", + "format": "double" + }, + "qtyDisplayFormat": { + "$ref": "#/components/schemas/NumericDisplayFormat" + }, + "securityCategory": { + "$ref": "#/components/schemas/SecurityCategory" + } + }, + "additionalProperties": false + }, + "OptionSeriesProductType": { + "enum": [ + "OPTION_SERIES_PRODUCT_TYPE_STANDARD", + "OPTION_SERIES_PRODUCT_TYPE_MICRO" + ], + "type": "string" + }, + "OptionSeriesType": { + "enum": [ + "OPTION_SERIES_TYPE_UNKNOWN", + "OPTION_SERIES_TYPE_BINARY", + "OPTION_SERIES_TYPE_FLEX", + "OPTION_SERIES_TYPE_LEAP", + "OPTION_SERIES_TYPE_RANGE", + "OPTION_SERIES_TYPE_STANDARD" + ], + "type": "string" + }, + "OptionSettlementType": { + "enum": [ + "OPTION_SETTLEMENT_TYPE_UNDEFINED", + "OPTION_SETTLEMENT_TYPE_AM", + "OPTION_SETTLEMENT_TYPE_CLIQUET", + "OPTION_SETTLEMENT_TYPE_PM", + "OPTION_SETTLEMENT_TYPE_ASIAN" + ], + "type": "string" + }, + "OrdStatus": { + "enum": [ + "ORD_STATUS_UNKNOWN", + "ORD_STATUS_NEW", + "ORD_STATUS_PARTIALLY_FILLED", + "ORD_STATUS_FILLED", + "ORD_STATUS_DONE_FOR_DAY", + "ORD_STATUS_CANCELED", + "ORD_STATUS_REPLACED", + "ORD_STATUS_PENDING_CANCEL", + "ORD_STATUS_STOPPED", + "ORD_STATUS_REJECTED", + "ORD_STATUS_SUSPENDED", + "ORD_STATUS_PENDING_NEW", + "ORD_STATUS_EXPIRED", + "ORD_STATUS_ACCEPTED_FOR_BIDDING", + "ORD_STATUS_PENDING_REPLACE", + "ORD_STATUS_QUEUED", + "ORD_STATUS_REPRESENTED", + "ORD_STATUS_STAGED", + "ORD_STATUS_WORKING", + "ORD_STATUS_ACCEPTED", + "ORD_STATUS_DECLINED", + "ORD_STATUS_PUSHED", + "ORD_STATUS_TIMED_OUT" + ], + "type": "string" + }, + "OrdType": { + "enum": [ + "ORD_TYPE_UNKNOWN", + "ORD_TYPE_MARKET_IF_TOUCHED", + "ORD_TYPE_LIMIT", + "ORD_TYPE_MARKET", + "ORD_TYPE_PEGGED", + "ORD_TYPE_STOP", + "ORD_TYPE_STOP_LIMIT" + ], + "type": "string" + }, + "Order": { + "type": "object", + "properties": { + "accountId": { + "type": "integer", + "format": "int32" + }, + "algo": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "auxPrice": { + "type": "number", + "format": "double" + }, + "clearingInfo": { + "$ref": "#/components/schemas/ClearingInfo" + }, + "curOrdId": { + "type": "string" + }, + "header": { + "$ref": "#/components/schemas/Header" + }, + "id": { + "type": "string" + }, + "incomingClOrdId": { + "type": "string" + }, + "incomingOrdId": { + "type": "string" + }, + "instructions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderInstruction" + } + }, + "marketCondition": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "optionalData": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "orderFlags": { + "type": "integer", + "format": "int32" + }, + "orderUpdates": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderUpdateEvent" + } + }, + "ordType": { + "$ref": "#/components/schemas/OrdType" + }, + "originationType": { + "$ref": "#/components/schemas/OriginationType" + }, + "parentOrdId": { + "type": "string" + }, + "positionEffect": { + "$ref": "#/components/schemas/PositionEffect" + }, + "price": { + "type": "number", + "format": "double" + }, + "priceType": { + "$ref": "#/components/schemas/PriceType" + }, + "qty": { + "type": "number", + "format": "double" + }, + "route": { + "type": "string" + }, + "security": { + "$ref": "#/components/schemas/Security" + }, + "side": { + "$ref": "#/components/schemas/Side" + }, + "source": { + "type": "string" + }, + "sourceAddress": { + "type": "string" + }, + "submitTs": { + "type": "string" + }, + "symbol": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "text": { + "type": "string" + }, + "tif": { + "$ref": "#/components/schemas/Tif" + }, + "traderId": { + "type": "string" + }, + "userId": { + "type": "integer", + "format": "int32" + }, + "ordStatus": { + "$ref": "#/components/schemas/OrdStatus" + }, + "avgPrice": { + "type": "number", + "format": "double" + }, + "claimedBy": { + "type": "string" + }, + "lastPrice": { + "type": "number", + "format": "double" + }, + "lastQty": { + "type": "number", + "format": "double" + }, + "lastMarket": { + "type": "string" + }, + "leavesQty": { + "type": "number", + "format": "double" + }, + "cumQty": { + "type": "number", + "format": "double" + }, + "transactTs": { + "type": "string" + }, + "workingQty": { + "type": "number", + "format": "double" + }, + "hasBusts": { + "type": "boolean" + }, + "hasCorrects": { + "type": "boolean" + }, + "hasNotes": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "OrderCancelReject": { + "type": "object", + "properties": { + "curOrdId": { + "type": "string" + }, + "incomingClOrdId": { + "type": "string" + }, + "incomingOrigClOrdId": { + "type": "string" + }, + "ordStatus": { + "$ref": "#/components/schemas/OrdStatus" + }, + "optionalData": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "originationType": { + "$ref": "#/components/schemas/OriginationType" + }, + "permOrdId": { + "type": "string" + }, + "reqOrdId": { + "type": "string" + }, + "source": { + "type": "string" + }, + "text": { + "type": "string" + }, + "traderId": { + "type": "string" + }, + "transactTs": { + "type": "string" + }, + "cxlRejResponseTo": { + "$ref": "#/components/schemas/CxlRejResponseTo" + } + }, + "additionalProperties": false + }, + "OrderCancelReplaceRequest": { + "type": "object", + "properties": { + "algo": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "auxPrice": { + "type": "number", + "format": "double" + }, + "clearingInfo": { + "$ref": "#/components/schemas/ClearingInfo" + }, + "curOrdId": { + "type": "string" + }, + "header": { + "$ref": "#/components/schemas/Header" + }, + "incomingClOrdId": { + "type": "string" + }, + "incomingOrigClOrdId": { + "type": "string" + }, + "instructions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderInstruction" + } + }, + "optionalData": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "marketCondition": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "ordType": { + "$ref": "#/components/schemas/OrdType" + }, + "originationType": { + "$ref": "#/components/schemas/OriginationType" + }, + "permOrdId": { + "type": "string" + }, + "price": { + "type": "number", + "format": "double" + }, + "priceType": { + "$ref": "#/components/schemas/PriceType" + }, + "qty": { + "type": "number", + "format": "double" + }, + "reqOrdId": { + "type": "string" + }, + "side": { + "$ref": "#/components/schemas/Side" + }, + "source": { + "type": "string" + }, + "submitTs": { + "type": "string" + }, + "tif": { + "$ref": "#/components/schemas/Tif" + }, + "traderId": { + "type": "string" + }, + "userId": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "OrderCancelRequest": { + "type": "object", + "properties": { + "curOrdId": { + "type": "string" + }, + "incomingClOrdId": { + "type": "string" + }, + "incomingOrigClOrdId": { + "type": "string" + }, + "instructions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderInstruction" + } + }, + "optionalData": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "originationType": { + "$ref": "#/components/schemas/OriginationType" + }, + "permOrdId": { + "type": "string" + }, + "reqOrdId": { + "type": "string" + }, + "source": { + "type": "string" + }, + "submitTs": { + "type": "string" + }, + "traderId": { + "type": "string" + }, + "userId": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "OrderCross": { + "type": "object", + "properties": { + "accountId": { + "type": "integer", + "format": "int32" + }, + "algo": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "allocations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderCrossAllocation" + } + }, + "crossType": { + "$ref": "#/components/schemas/CrossType" + }, + "curOrdId": { + "type": "string" + }, + "header": { + "$ref": "#/components/schemas/Header" + }, + "id": { + "type": "string" + }, + "incomingClOrdId": { + "type": "string" + }, + "incomingOrdId": { + "type": "string" + }, + "instructions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderInstruction" + } + }, + "marketCondition": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "optionalData": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "orderFlags": { + "type": "integer", + "format": "int32" + }, + "orderUpdates": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderUpdateEvent" + } + }, + "ordType": { + "$ref": "#/components/schemas/OrdType" + }, + "originationType": { + "$ref": "#/components/schemas/OriginationType" + }, + "parentOrdId": { + "type": "string" + }, + "price": { + "type": "number", + "format": "double" + }, + "priceType": { + "$ref": "#/components/schemas/PriceType" + }, + "qty": { + "type": "number", + "format": "double" + }, + "route": { + "type": "string" + }, + "security": { + "$ref": "#/components/schemas/Security" + }, + "source": { + "type": "string" + }, + "sourceAddress": { + "type": "string" + }, + "submitTs": { + "type": "string" + }, + "symbol": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "text": { + "type": "string" + }, + "tif": { + "$ref": "#/components/schemas/Tif" + }, + "userId": { + "type": "integer", + "format": "int32" + }, + "traderId": { + "type": "string" + }, + "ordStatus": { + "$ref": "#/components/schemas/OrdStatus" + }, + "claimedBy": { + "type": "string" + }, + "transactTs": { + "type": "string" + }, + "hasBusts": { + "type": "boolean" + }, + "hasCorrects": { + "type": "boolean" + }, + "hasNotes": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "OrderCrossAllocation": { + "type": "object", + "properties": { + "accountId": { + "type": "integer", + "format": "int32" + }, + "clearingInfo": { + "$ref": "#/components/schemas/ClearingInfo" + }, + "id": { + "type": "string" + }, + "incomingOrdId": { + "type": "string" + }, + "instructions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderInstruction" + } + }, + "optionalData": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "positionEffect": { + "$ref": "#/components/schemas/PositionEffect" + }, + "qty": { + "type": "number", + "format": "double" + }, + "side": { + "$ref": "#/components/schemas/Side" + }, + "sideType": { + "$ref": "#/components/schemas/CrossSideType" + }, + "avgPrice": { + "type": "number", + "format": "double" + }, + "lastPrice": { + "type": "number", + "format": "double" + }, + "lastQty": { + "type": "number", + "format": "double" + }, + "lastMarket": { + "type": "string" + }, + "leavesQty": { + "type": "number", + "format": "double" + }, + "cumQty": { + "type": "number", + "format": "double" + }, + "transactTs": { + "type": "string" + }, + "ordStatus": { + "$ref": "#/components/schemas/OrdStatus" + } + }, + "additionalProperties": false + }, + "OrderDelete": { + "type": "object", + "properties": { + "curOrdId": { + "type": "string" + }, + "optionalData": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "originationType": { + "$ref": "#/components/schemas/OriginationType" + }, + "permOrdId": { + "type": "string" + }, + "traderId": { + "type": "string" + }, + "submitTs": { + "type": "string" + } + }, + "additionalProperties": false + }, + "OrderInstruction": { + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/OrderInstructionType" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false + }, + "OrderInstructionType": { + "enum": [ + "ORDER_INSTRUCTION_TYPE_NONE", + "ORDER_INSTRUCTION_TYPE_ALL_OR_NONE", + "ORDER_INSTRUCTION_TYPE_AUCTION_ID", + "ORDER_INSTRUCTION_TYPE_AUTO_MATCH", + "ORDER_INSTRUCTION_TYPE_AUTO_MATCH_PRICE", + "ORDER_INSTRUCTION_TYPE_CLIENT_ID", + "ORDER_INSTRUCTION_TYPE_COMMISSION", + "ORDER_INSTRUCTION_TYPE_COMPRESSION", + "ORDER_INSTRUCTION_TYPE_CROSS_PRIORITIZATION", + "ORDER_INSTRUCTION_TYPE_DO_NOT_REDUCE", + "ORDER_INSTRUCTION_TYPE_DO_NOT_ROUTE", + "ORDER_INSTRUCTION_TYPE_DROP", + "ORDER_INSTRUCTION_TYPE_EQUITY_BUY_CLEARING_FIRM", + "ORDER_INSTRUCTION_TYPE_EQUITY_EX_DESTINATION", + "ORDER_INSTRUCTION_TYPE_EQUITY_PARTY_ID", + "ORDER_INSTRUCTION_TYPE_EQUITY_SELL_CLEARING_FIRM", + "ORDER_INSTRUCTION_TYPE_EQUITY_TRADE_PRICE", + "ORDER_INSTRUCTION_TYPE_EQUITY_TRADE_SIZE", + "ORDER_INSTRUCTION_TYPE_EQUITY_TRADE_VENUE", + "ORDER_INSTRUCTION_TYPE_EQUITY_TRANSACT_TS", + "ORDER_INSTRUCTION_TYPE_FLEX_AUCTION_DURATION", + "ORDER_INSTRUCTION_TYPE_FLEX_HEDGE_EXEC_INST", + "ORDER_INSTRUCTION_TYPE_FLEX_PRE_FACIL_PRICE", + "ORDER_INSTRUCTION_TYPE_FREQUENT_TRADER", + "ORDER_INSTRUCTION_TYPE_FREQUENT_TRADER_ID", + "ORDER_INSTRUCTION_TYPE_GOOD_TILL_DATE", + "ORDER_INSTRUCTION_TYPE_HELD", + "ORDER_INSTRUCTION_TYPE_INTERMARKET_SWEEP", + "ORDER_INSTRUCTION_TYPE_MAX_FLOOR", + "ORDER_INSTRUCTION_TYPE_MIN_QTY", + "ORDER_INSTRUCTION_TYPE_NO_COA", + "ORDER_INSTRUCTION_TYPE_NOT_HELD", + "ORDER_INSTRUCTION_TYPE_ORDER_ORIGIN", + "ORDER_INSTRUCTION_TYPE_O_R_S", + "ORDER_INSTRUCTION_TYPE_PEG_DIFFERENCE", + "ORDER_INSTRUCTION_TYPE_PEG_TYPE", + "ORDER_INSTRUCTION_TYPE_PREFERRED_M_M", + "ORDER_INSTRUCTION_TYPE_REPRESENT", + "ORDER_INSTRUCTION_TYPE_ROUTE_STRATEGY", + "ORDER_INSTRUCTION_TYPE_ROUTING_FIRM_ID", + "ORDER_INSTRUCTION_TYPE_ROUTING_INST", + "ORDER_INSTRUCTION_TYPE_SETTLEMENT_LIQUIDITY", + "ORDER_INSTRUCTION_TYPE_SOLICITED", + "ORDER_INSTRUCTION_TYPE_SPX_COMBO", + "ORDER_INSTRUCTION_TYPE_STRATEGY_ID", + "ORDER_INSTRUCTION_TYPE_SWEEP", + "ORDER_INSTRUCTION_TYPE_TIED_HEDGE", + "ORDER_INSTRUCTION_TYPE_LAST_PRIORITY", + "ORDER_INSTRUCTION_TYPE_BROKER_PERCENTAGE", + "ORDER_INSTRUCTION_TYPE_PHLX_QCC", + "ORDER_INSTRUCTION_TYPE_STEP_UP_PX", + "ORDER_INSTRUCTION_TYPE_SESSION_ELIGIBILITY" + ], + "type": "string" + }, + "OrderType": { + "enum": [ + "ORDER_TYPE_UNKNOWN", + "ORDER_TYPE_MULTI_LEG_ORDER_CROSS", + "ORDER_TYPE_MULTI_LEG_ORDER", + "ORDER_TYPE_ORDER", + "ORDER_TYPE_ORDER_CROSS" + ], + "type": "string" + }, + "OrderUpdate": { + "type": "object", + "properties": { + "accountId": { + "type": "integer", + "format": "int32" + }, + "Algo": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "allocId": { + "type": "string" + }, + "auxPrice": { + "type": "number", + "format": "double" + }, + "avgPrice": { + "type": "number", + "format": "double" + }, + "clearingInfo": { + "$ref": "#/components/schemas/ClearingInfo" + }, + "commission": { + "type": "number", + "format": "double" + }, + "cumQty": { + "type": "number", + "format": "double" + }, + "curOrdId": { + "type": "string" + }, + "execBroker": { + "type": "string" + }, + "execId": { + "type": "string" + }, + "execRefId": { + "type": "string" + }, + "execType": { + "$ref": "#/components/schemas/ExecType" + }, + "fee1": { + "type": "number", + "format": "double" + }, + "fee2": { + "type": "number", + "format": "double" + }, + "header": { + "$ref": "#/components/schemas/Header" + }, + "incomingClOrdId": { + "type": "string" + }, + "incomingOrdId": { + "type": "string" + }, + "incomingOrigClOrdId": { + "type": "string" + }, + "instructions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderInstruction" + } + }, + "lastMarket": { + "type": "string" + }, + "lastPrice": { + "type": "number", + "format": "double" + }, + "lastQty": { + "type": "number", + "format": "double" + }, + "leavesQty": { + "type": "number", + "format": "double" + }, + "legId": { + "type": "string" + }, + "liquidityFlag": { + "type": "string" + }, + "multiLegReportingType": { + "$ref": "#/components/schemas/MultiLegReportingType" + }, + "Notes": { + "type": "string" + }, + "optionalData": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "orderFlags": { + "type": "integer", + "format": "int32" + }, + "ordStatus": { + "$ref": "#/components/schemas/OrdStatus" + }, + "ordType": { + "$ref": "#/components/schemas/OrdType" + }, + "originationType": { + "$ref": "#/components/schemas/OriginationType" + }, + "origOrdId": { + "type": "string" + }, + "parentOrdId": { + "type": "string" + }, + "permOrdId": { + "type": "string" + }, + "positionEffect": { + "$ref": "#/components/schemas/PositionEffect" + }, + "price": { + "type": "number", + "format": "double" + }, + "priceType": { + "$ref": "#/components/schemas/PriceType" + }, + "qty": { + "type": "number", + "format": "double" + }, + "route": { + "type": "string" + }, + "security": { + "$ref": "#/components/schemas/Security" + }, + "side": { + "$ref": "#/components/schemas/Side" + }, + "source": { + "type": "string" + }, + "symbol": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "text": { + "type": "string" + }, + "tif": { + "$ref": "#/components/schemas/Tif" + }, + "traderId": { + "type": "string" + }, + "transactTs": { + "type": "string" + }, + "workingQty": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "OrderUpdateEvent": { + "type": "object", + "properties": { + "orderCancelRequest": { + "$ref": "#/components/schemas/OrderCancelRequest" + }, + "orderCancelReplaceRequest": { + "$ref": "#/components/schemas/OrderCancelReplaceRequest" + }, + "multiLegOrderCancelReplaceRequest": { + "$ref": "#/components/schemas/MultiLegOrderCancelReplaceRequest" + }, + "execution": { + "$ref": "#/components/schemas/Execution" + }, + "orderUpdate": { + "$ref": "#/components/schemas/OrderUpdate" + }, + "orderDelete": { + "$ref": "#/components/schemas/OrderDelete" + }, + "orderCancelReject": { + "$ref": "#/components/schemas/OrderCancelReject" + } + }, + "additionalProperties": false + }, + "OriginationType": { + "enum": [ + "ORIGINATION_TYPE_UNKNOWN", + "ORIGINATION_TYPE_ADMINISTRATIVE", + "ORIGINATION_TYPE_API_CHILD_ORDER", + "ORIGINATION_TYPE_API_ORDER", + "ORIGINATION_TYPE_API_ORDER_CANCEL_REPLACE_REQUEST", + "ORIGINATION_TYPE_API_ORDER_CANCEL_REQUEST", + "ORIGINATION_TYPE_API_PARENT_ORDER", + "ORIGINATION_TYPE_FIX_FROM_STREET_CHILD_ORDER", + "ORIGINATION_TYPE_FIX_FROM_STREET_DROP", + "ORIGINATION_TYPE_FIX_FROM_STREET_DROP_ORDER_UPDATE", + "ORIGINATION_TYPE_FIX_FROM_STREET_ORDER", + "ORIGINATION_TYPE_FIX_FROM_STREET_ORDER_CANCEL_REPLACE_REQUEST", + "ORIGINATION_TYPE_FIX_FROM_STREET_ORDER_CANCEL_REQUEST", + "ORIGINATION_TYPE_FIX_FROM_STREET_ORDER_UPDATE", + "ORIGINATION_TYPE_FIX_FROM_STREET_PARENT_ORDER", + "ORIGINATION_TYPE_ORDER_MANAGER" + ], + "type": "string" + }, + "Position": { + "type": "object", + "properties": { + "accountId": { + "type": "integer", + "format": "int32" + }, + "symbol": { + "type": "string" + }, + "avgCost": { + "type": "number", + "format": "double" + }, + "markedCost": { + "type": "number", + "format": "double" + }, + "netQty": { + "type": "number", + "format": "double" + }, + "notionalValue": { + "type": "number", + "format": "double" + }, + "openingCost": { + "type": "number", + "format": "double" + }, + "openingQty": { + "type": "number", + "format": "double" + }, + "realizedPnL": { + "type": "number", + "format": "double" + }, + "tradingAvgCost": { + "type": "number", + "format": "double" + }, + "tradingBuyAvgPrice": { + "type": "number", + "format": "double" + }, + "tradingBuyQty": { + "type": "number", + "format": "double" + }, + "tradingNetQty": { + "type": "number", + "format": "double" + }, + "tradingSellAvgPrice": { + "type": "number", + "format": "double" + }, + "tradingSellQty": { + "type": "number", + "format": "double" + }, + "tradingSellQtyLong": { + "type": "number", + "format": "double" + }, + "tradingSellQtyShort": { + "type": "number", + "format": "double" + }, + "transactTs": { + "type": "string" + } + }, + "additionalProperties": false + }, + "PositionAnalysis": { + "type": "object", + "properties": { + "positionTheo": { + "$ref": "#/components/schemas/PositionTheo" + }, + "scenarioTheos": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ScenarioTheo" + } + } + }, + "additionalProperties": false + }, + "PositionEffect": { + "enum": [ + "POSITION_EFFECT_NONE", + "POSITION_EFFECT_AUTO", + "POSITION_EFFECT_CLOSE", + "POSITION_EFFECT_OPEN" + ], + "type": "string" + }, + "PositionSource": { + "enum": [ + "POSITION_SOURCE_FROM_PORTFOLIO", + "POSITION_SOURCE_FROM_REQUEST" + ], + "type": "string" + }, + "PositionTheo": { + "type": "object", + "properties": { + "asOfTs": { + "type": "string" + }, + "delta": { + "type": "number", + "format": "double" + }, + "gamma": { + "type": "number", + "format": "double" + }, + "legs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PositionTheoLeg" + } + }, + "maxLoss": { + "type": "number", + "format": "double" + }, + "maxLossLsd": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + "maxProfit": { + "type": "number", + "format": "double" + }, + "maxProfitLsd": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + "prem": { + "type": "number", + "format": "double" + }, + "price": { + "type": "number", + "format": "double" + }, + "profit": { + "type": "number", + "format": "double" + }, + "profitProbability": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + "rho": { + "type": "number", + "format": "double" + }, + "theta": { + "type": "number", + "format": "double" + }, + "totalValue": { + "type": "number", + "format": "double" + }, + "vega": { + "type": "number", + "format": "double" + }, + "volatility": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "PositionTheoLeg": { + "type": "object", + "properties": { + "delta": { + "type": "number", + "format": "double" + }, + "gamma": { + "type": "number", + "format": "double" + }, + "maxLoss": { + "type": "number", + "format": "double" + }, + "maxLossLsd": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + "maxProfit": { + "type": "number", + "format": "double" + }, + "maxProfitLsd": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + "prem": { + "type": "number", + "format": "double" + }, + "profit": { + "type": "number", + "format": "double" + }, + "profitProbability": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + "rho": { + "type": "number", + "format": "double" + }, + "theta": { + "type": "number", + "format": "double" + }, + "vega": { + "type": "number", + "format": "double" + }, + "volatility": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "PriceType": { + "enum": [ + "PRICE_TYPE_UNKNOWN", + "PRICE_TYPE_CABINET", + "PRICE_TYPE_FIXED_AMT", + "PRICE_TYPE_D_A_C", + "PRICE_TYPE_PER_UNIT", + "PRICE_TYPE_PERCENTAGE", + "PRICE_TYPE_YIELD" + ], + "type": "string" + }, + "ProductGroup": { + "enum": [ + "PRODUCT_GROUP_UNKNOWN", + "PRODUCT_GROUP_AGRICULTURAL", + "PRODUCT_GROUP_ALTERNATIVE_MARKETS", + "PRODUCT_GROUP_CURRENCY", + "PRODUCT_GROUP_ENERGY", + "PRODUCT_GROUP_EQUITIES", + "PRODUCT_GROUP_FINANCIAL", + "PRODUCT_GROUP_INDEX", + "PRODUCT_GROUP_INTEREST_RATE", + "PRODUCT_GROUP_METAL", + "PRODUCT_GROUP_REAL_ESTATE", + "PRODUCT_GROUP_WEATHER" + ], + "type": "string" + }, + "ProductSubGroup": { + "enum": [ + "PRODUCT_SUB_GROUP_UNKNOWN" + ], + "type": "string" + }, + "PutCall": { + "enum": [ + "PUT_CALL_UNDEFINED", + "PUT_CALL_CALL", + "PUT_CALL_PUT" + ], + "type": "string" + }, + "RiskCalculationType": { + "enum": [ + "RISK_CALCULATION_TYPE_UNKNOWN", + "RISK_CALCULATION_TYPE_ACCOUNT", + "RISK_CALCULATION_TYPE_TRADING_FIRM", + "RISK_CALCULATION_TYPE_USER" + ], + "type": "string" + }, + "RiskEvalMode": { + "enum": [ + "RISK_EVAL_MODE_END_OF_DAY", + "RISK_EVAL_MODE_REAL_TIME" + ], + "type": "string" + }, + "RiskRadarAccountGroup": { + "type": "object", + "properties": { + "accountId": { + "type": "integer", + "format": "int32" + }, + "currency": { + "$ref": "#/components/schemas/Currency" + }, + "nav": { + "type": "number", + "format": "double" + }, + "productGroups": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RiskRadarProductGroup" + } + }, + "shockValues": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ShockValue" + } + } + }, + "additionalProperties": false + }, + "RiskRadarClassGroup": { + "type": "object", + "properties": { + "delta": { + "type": "number", + "format": "double" + }, + "dollarDelta": { + "type": "number", + "format": "double" + }, + "dollarGamma": { + "type": "number", + "format": "double" + }, + "gamma": { + "type": "number", + "format": "double" + }, + "nav": { + "type": "number", + "format": "double" + }, + "price": { + "type": "number", + "format": "double" + }, + "rho": { + "type": "number", + "format": "double" + }, + "shockKeys": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + "shockValues": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ShockValue" + } + }, + "symbol": { + "type": "string" + }, + "theta": { + "type": "number", + "format": "double" + }, + "vega": { + "type": "number", + "format": "double" + }, + "positions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RiskRadarPosition" + } + } + }, + "additionalProperties": false + }, + "RiskRadarData": { + "type": "object", + "properties": { + "risksResult": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RiskRadarAccountGroup" + } + }, + "shockKeys": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "RiskRadarPosition": { + "type": "object", + "properties": { + "delta": { + "type": "number", + "format": "double" + }, + "dollarDelta": { + "type": "number", + "format": "double" + }, + "dollarGamma": { + "type": "number", + "format": "double" + }, + "gamma": { + "type": "number", + "format": "double" + }, + "nav": { + "type": "number", + "format": "double" + }, + "price": { + "type": "number", + "format": "double" + }, + "pZero": { + "type": "number", + "format": "double" + }, + "rho": { + "type": "number", + "format": "double" + }, + "shockValues": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ShockValue" + } + }, + "symbol": { + "type": "string" + }, + "theta": { + "type": "number", + "format": "double" + }, + "vega": { + "type": "number", + "format": "double" + }, + "rpgRoot": { + "type": "string" + }, + "qty": { + "type": "number", + "format": "double" + }, + "impliedVolatility": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "RiskRadarProductGroup": { + "type": "object", + "properties": { + "group": { + "type": "string" + }, + "nav": { + "type": "number", + "format": "double" + }, + "classGroups": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RiskRadarClassGroup" + } + }, + "productId": { + "type": "string" + }, + "shockValues": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ShockValue" + } + } + }, + "additionalProperties": false + }, + "RiskRadarRequest": { + "type": "object", + "properties": { + "accountIds": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + }, + "positionsByAccountId": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RiskRadarRequestPositionList" + } + }, + "source": { + "$ref": "#/components/schemas/PositionSource" + }, + "range": { + "type": "number", + "format": "double" + }, + "timestep": { + "type": "string" + }, + "scenarioOrder": { + "$ref": "#/components/schemas/RiskRadarScenarioOrder" + }, + "evalMode": { + "$ref": "#/components/schemas/RiskEvalMode" + }, + "impliedVolatility": { + "type": "number", + "format": "double" + }, + "volatilityShockSkew": { + "$ref": "#/components/schemas/VolatilityShockSkew" + }, + "volatilityShockType": { + "$ref": "#/components/schemas/VolatilityShockType" + }, + "excludeExpiredContracts": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "RiskRadarRequestPosition": { + "type": "object", + "properties": { + "isSimulatedPosition": { + "type": "boolean" + }, + "qty": { + "type": "number", + "format": "double" + }, + "symbol": { + "type": "string" + } + }, + "additionalProperties": false + }, + "RiskRadarRequestPositionList": { + "type": "object", + "properties": { + "accountId": { + "type": "integer", + "format": "int32" + }, + "positions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RiskRadarRequestPosition" + } + } + }, + "additionalProperties": false + }, + "RiskRadarResponse": { + "type": "object", + "properties": { + "result": { + "$ref": "#/components/schemas/RiskRadarData" + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "RiskRadarScenarioOrder": { + "enum": [ + "RISK_RADAR_SCENARIO_ORDER_SHOCK_FIRST", + "RISK_RADAR_SCENARIO_ORDER_STEP_FIRST" + ], + "type": "string" + }, + "RiskReject": { + "type": "object", + "properties": { + "accountId": { + "type": "integer", + "format": "int32" + }, + "guid": { + "type": "string" + }, + "id": { + "type": "integer", + "format": "int32" + }, + "isOverridden": { + "type": "boolean" + }, + "message": { + "type": "string" + }, + "orderId": { + "type": "string" + }, + "transactTs": { + "type": "string" + }, + "calculationType": { + "$ref": "#/components/schemas/RiskCalculationType" + }, + "rejectType": { + "$ref": "#/components/schemas/RiskRejectType" + }, + "userId": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "RiskRejectType": { + "enum": [ + "RISK_REJECT_TYPE_ACCOUNT_INACTIVE", + "RISK_REJECT_TYPE_ACCOUNT_IN_LIQUIDATION", + "RISK_REJECT_TYPE_ALLOW_CRYPTO_ORDER_MARKET", + "RISK_REJECT_TYPE_ALLOW_EQ_ORDER_LONG_SALE", + "RISK_REJECT_TYPE_ALLOW_EQ_ORDER_MARKET", + "RISK_REJECT_TYPE_ALLOW_FUT_ORDER_MARKET", + "RISK_REJECT_TYPE_ALLOW_OPT_ORDER_MARKET", + "RISK_REJECT_TYPE_ALLOW_OPT_ORDER_SELL_TO_OPEN", + "RISK_REJECT_TYPE_GTC_ORDER_NOT_ALLOWED", + "RISK_REJECT_TYPE_HARD_TO_BORROW", + "RISK_REJECT_TYPE_INVALID_ORD_TYPE", + "RISK_REJECT_TYPE_INVALID_SIDE", + "RISK_REJECT_TYPE_RESTRICTED_SECURITY", + "RISK_REJECT_TYPE_SECURITY_NOT_SUPPORTED", + "RISK_REJECT_TYPE_ORDER_MAX_THRESHOLD_BREACHED", + "RISK_REJECT_TYPE_ALLOW_ORDER_WASH_TRADES", + "RISK_REJECT_TYPE_ACCOUNT_MAX_LOSS", + "RISK_REJECT_TYPE_ALLOW_LOCATE_ID_FOR_EASY_TO_BORROW", + "RISK_REJECT_TYPE_CRYPTO_MAX_GROSS_NOTIONAL_DAY", + "RISK_REJECT_TYPE_CRYPTO_MAX_GROSS_QTY_DAY", + "RISK_REJECT_TYPE_CRYPTO_MAX_NET_QTY_DAY", + "RISK_REJECT_TYPE_CRYPTO_ORDER_MAX_NOTIONAL", + "RISK_REJECT_TYPE_CRYPTO_ORDER_MAX_QTY", + "RISK_REJECT_TYPE_EQ_MAX_GROSS_NOTIONAL_DAY", + "RISK_REJECT_TYPE_EQ_MAX_GROSS_QTY_DAY", + "RISK_REJECT_TYPE_EQ_MAX_NET_POSITION", + "RISK_REJECT_TYPE_EQ_MAX_NET_QTY_DAY", + "RISK_REJECT_TYPE_EQ_ORDER_MAX_NOTIONAL", + "RISK_REJECT_TYPE_EQ_ORDER_MAX_QTY", + "RISK_REJECT_TYPE_FUT_MAX_GROSS_NOTIONAL_DAY", + "RISK_REJECT_TYPE_FUT_MAX_GROSS_QTY_DAY", + "RISK_REJECT_TYPE_FUT_MAX_NET_QTY_DAY", + "RISK_REJECT_TYPE_FUT_ORDER_MAX_NOTIONAL", + "RISK_REJECT_TYPE_FUT_ORDER_MAX_QTY", + "RISK_REJECT_TYPE_OPT_MAX_GROSS_NOTIONAL_DAY", + "RISK_REJECT_TYPE_OPT_MAX_GROSS_QTY_DAY", + "RISK_REJECT_TYPE_OPT_MAX_NET_QTY_DAY", + "RISK_REJECT_TYPE_OPT_ORDER_MAX_NOTIONAL", + "RISK_REJECT_TYPE_OPT_ORDER_MAX_QTY", + "RISK_REJECT_TYPE_CRYPTO_MAX_NET_POSITION", + "RISK_REJECT_TYPE_FUT_MAX_NET_POSITION", + "RISK_REJECT_TYPE_OPT_MAX_NET_POSITION", + "RISK_REJECT_TYPE_BUYING_POWER", + "RISK_REJECT_TYPE_CRYPTO_WARN_GROSS_NOTIONAL_DAY", + "RISK_REJECT_TYPE_CRYPTO_WARN_GROSS_QTY_DAY", + "RISK_REJECT_TYPE_CRYPTO_WARN_NET_QTY_DAY", + "RISK_REJECT_TYPE_CRYPTO_ORDER_WARN_NOTIONAL", + "RISK_REJECT_TYPE_CRYPTO_ORDER_WARN_QTY", + "RISK_REJECT_TYPE_EQ_WARN_GROSS_NOTIONAL_DAY", + "RISK_REJECT_TYPE_EQ_WARN_GROSS_QTY_DAY", + "RISK_REJECT_TYPE_EQ_WARN_NET_POSITION", + "RISK_REJECT_TYPE_EQ_WARN_NET_QTY_DAY", + "RISK_REJECT_TYPE_EQ_ORDER_WARN_NOTIONAL", + "RISK_REJECT_TYPE_EQ_ORDER_WARN_QTY", + "RISK_REJECT_TYPE_FUT_WARN_GROSS_NOTIONAL_DAY", + "RISK_REJECT_TYPE_FUT_WARN_GROSS_QTY_DAY", + "RISK_REJECT_TYPE_FUT_WARN_NET_QTY_DAY", + "RISK_REJECT_TYPE_FUT_ORDER_WARN_NOTIONAL", + "RISK_REJECT_TYPE_FUT_ORDER_WARN_QTY", + "RISK_REJECT_TYPE_OPT_WARN_GROSS_NOTIONAL_DAY", + "RISK_REJECT_TYPE_OPT_WARN_GROSS_QTY_DAY", + "RISK_REJECT_TYPE_OPT_WARN_NET_QTY_DAY", + "RISK_REJECT_TYPE_OPT_ORDER_WARN_NOTIONAL", + "RISK_REJECT_TYPE_OPT_ORDER_WARN_QTY", + "RISK_REJECT_TYPE_CRYPTO_WARN_NET_POSITION", + "RISK_REJECT_TYPE_FUT_WARN_NET_POSITION", + "RISK_REJECT_TYPE_OPT_WARN_NET_POSITION" + ], + "type": "string" + }, + "Route": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "algoSchema": { + "type": "string" + }, + "currency": { + "$ref": "#/components/schemas/Currency" + }, + "isEnabled": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "orderType": { + "$ref": "#/components/schemas/OrderType" + }, + "routeProperties": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RouteProperty" + } + }, + "securityType": { + "$ref": "#/components/schemas/SecurityType" + }, + "type": { + "$ref": "#/components/schemas/RouteType" + }, + "uiSchema": { + "type": "string" + }, + "venue": { + "type": "string" + } + }, + "additionalProperties": false + }, + "RouteApplicability": { + "type": "object", + "properties": { + "userId": { + "type": "integer", + "format": "int32" + }, + "accountId": { + "type": "integer", + "format": "int32" + }, + "securityType": { + "$ref": "#/components/schemas/SecurityType" + }, + "currency": { + "$ref": "#/components/schemas/Currency" + }, + "exchangeId": { + "type": "integer", + "format": "int32" + }, + "orderType": { + "$ref": "#/components/schemas/OrderType" + }, + "routeIds": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + "additionalProperties": false + }, + "RouteProperty": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "type": { + "$ref": "#/components/schemas/RoutePropertyType" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false + }, + "RoutePropertyType": { + "enum": [ + "ROUTE_PROPERTY_TYPE_UNKNOWN", + "ROUTE_PROPERTY_TYPE_ORDER_TYPE", + "ROUTE_PROPERTY_TYPE_PERMISSION", + "ROUTE_PROPERTY_TYPE_TIF", + "ROUTE_PROPERTY_TYPE_CROSS_TYPE", + "ROUTE_PROPERTY_TYPE_STRATEGY_ID", + "ROUTE_PROPERTY_TYPE_CONTINGENCY", + "ROUTE_PROPERTY_TYPE_INSTRUCTION", + "ROUTE_PROPERTY_TYPE_EQUITY_EX_DESTINATION", + "ROUTE_PROPERTY_TYPE_SESSION_ELIGIBILITY" + ], + "type": "string" + }, + "RouteType": { + "enum": [ + "ROUTE_TYPE_DMA", + "ROUTE_TYPE_ALGO", + "ROUTE_TYPE_STAGE", + "ROUTE_TYPE_AWAY", + "ROUTE_TYPE_PAR", + "ROUTE_TYPE_MANUAL", + "ROUTE_TYPE_P2P", + "ROUTE_TYPE_CBOE", + "ROUTE_TYPE_BROKER" + ], + "type": "string" + }, + "RoutingSessionGroup": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "name": { + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/RoutingSessionGroupType" + } + }, + "additionalProperties": false + }, + "RoutingSessionGroupType": { + "enum": [ + "ROUTING_SESSION_GROUP_TYPE_UNKNOWN", + "ROUTING_SESSION_GROUP_TYPE_BROKER", + "ROUTING_SESSION_GROUP_TYPE_EXCHANGE", + "ROUTING_SESSION_GROUP_TYPE_STAGE", + "ROUTING_SESSION_GROUP_TYPE_AWAY", + "ROUTING_SESSION_GROUP_TYPE_PAR", + "ROUTING_SESSION_GROUP_TYPE_MANUAL", + "ROUTING_SESSION_GROUP_TYPE_P2P" + ], + "type": "string" + }, + "Scenario": { + "type": "object", + "properties": { + "price": { + "type": "number", + "format": "double" + }, + "legs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ScenarioLeg" + } + }, + "position": { + "$ref": "#/components/schemas/ScenarioPosition" + } + }, + "additionalProperties": false + }, + "ScenarioLeg": { + "type": "object", + "properties": { + "delta": { + "type": "number", + "format": "double" + }, + "gamma": { + "type": "number", + "format": "double" + }, + "prem": { + "type": "number", + "format": "double" + }, + "profit": { + "type": "number", + "format": "double" + }, + "rho": { + "type": "number", + "format": "double" + }, + "theta": { + "type": "number", + "format": "double" + }, + "totalValue": { + "type": "number", + "format": "double" + }, + "vega": { + "type": "number", + "format": "double" + }, + "volatility": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "ScenarioPosition": { + "type": "object", + "properties": { + "delta": { + "type": "number", + "format": "double" + }, + "gamma": { + "type": "number", + "format": "double" + }, + "prem": { + "type": "number", + "format": "double" + }, + "profit": { + "type": "number", + "format": "double" + }, + "rho": { + "type": "number", + "format": "double" + }, + "theta": { + "type": "number", + "format": "double" + }, + "totalValue": { + "type": "number", + "format": "double" + }, + "vega": { + "type": "number", + "format": "double" + }, + "volatility": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "ScenarioTheo": { + "type": "object", + "properties": { + "asOfTs": { + "type": "string" + }, + "asOfEvalExpiry": { + "type": "boolean" + }, + "scenarios": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Scenario" + } + } + }, + "additionalProperties": false + }, + "SearchOrderHistoryResponse": { + "type": "object", + "properties": { + "orders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GenericOrder" + } + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "Security": { + "type": "object", + "properties": { + "stock": { + "$ref": "#/components/schemas/Stock" + }, + "option": { + "$ref": "#/components/schemas/Option" + }, + "optionRoot": { + "$ref": "#/components/schemas/OptionRoot" + }, + "future": { + "$ref": "#/components/schemas/Future" + }, + "futureRoot": { + "$ref": "#/components/schemas/FutureRoot" + }, + "index": { + "$ref": "#/components/schemas/Index" + }, + "futureSpread": { + "$ref": "#/components/schemas/FutureSpread" + }, + "fx": { + "$ref": "#/components/schemas/Fx" + }, + "crypto": { + "$ref": "#/components/schemas/Crypto" + }, + "flexOption": { + "$ref": "#/components/schemas/FlexOption" + } + }, + "additionalProperties": false + }, + "SecurityCategory": { + "enum": [ + "SECURITY_CATEGORY_UNKNOWN", + "SECURITY_CATEGORY_COMMON_STOCK", + "SECURITY_CATEGORY_PREFERRED_STOCK", + "SECURITY_CATEGORY_WARRANT", + "SECURITY_CATEGORY_TRUST_UNIT", + "SECURITY_CATEGORY_INSTALLMENT_RECEIPT", + "SECURITY_CATEGORY_DEBENTURE", + "SECURITY_CATEGORY_NOTE", + "SECURITY_CATEGORY_EQUITY_OPTION", + "SECURITY_CATEGORY_INDEX_OPTION", + "SECURITY_CATEGORY_FUTURE", + "SECURITY_CATEGORY_MUTUAL_FUND", + "SECURITY_CATEGORY_CORPORATE_BOND", + "SECURITY_CATEGORY_MUNICIPAL_BOND", + "SECURITY_CATEGORY_TREASURY_BILL", + "SECURITY_CATEGORY_RIGHT", + "SECURITY_CATEGORY_INDEX", + "SECURITY_CATEGORY_ETF", + "SECURITY_CATEGORY_ETN", + "SECURITY_CATEGORY_ADR", + "SECURITY_CATEGORY_FUTURE_SPREAD", + "SECURITY_CATEGORY_FUTURE_ROOT", + "SECURITY_CATEGORY_OPTION_ROOT", + "SECURITY_CATEGORY_FUTURE_OPTION", + "SECURITY_CATEGORY_FX", + "SECURITY_CATEGORY_CRYPTO", + "SECURITY_CATEGORY_FLEX_OPTION", + "SECURITY_CATEGORY_CONVERTIBLE", + "SECURITY_CATEGORY_UNIT", + "SECURITY_CATEGORY_WHEN_DISTRIBUTED", + "SECURITY_CATEGORY_WHEN_ISSUED", + "SECURITY_CATEGORY_TEST" + ], + "type": "string" + }, + "SecurityType": { + "enum": [ + "SECURITY_TYPE_UNKNOWN", + "SECURITY_TYPE_STOCK", + "SECURITY_TYPE_OPTION", + "SECURITY_TYPE_OPTION_ROOT", + "SECURITY_TYPE_FUTURE", + "SECURITY_TYPE_FUTURE_ROOT", + "SECURITY_TYPE_INDEX", + "SECURITY_TYPE_BOND", + "SECURITY_TYPE_FUTURE_SPREAD", + "SECURITY_TYPE_FX", + "SECURITY_TYPE_CRYPTO", + "SECURITY_TYPE_FLEX_OPTION" + ], + "type": "string" + }, + "SettlementDeliverableType": { + "enum": [ + "SETTLEMENT_DELIVERABLE_TYPE_UNDERLYING", + "SETTLEMENT_DELIVERABLE_TYPE_CASH", + "SETTLEMENT_DELIVERABLE_TYPE_PHYSICAL", + "SETTLEMENT_DELIVERABLE_TYPE_UNDEFINED" + ], + "type": "string" + }, + "SettlementInfo": { + "type": "object", + "properties": { + "amount": { + "type": "number", + "format": "double" + }, + "symbol": { + "type": "string" + }, + "deliverableType": { + "$ref": "#/components/schemas/SettlementDeliverableType" + } + }, + "additionalProperties": false + }, + "ShockValue": { + "type": "object", + "properties": { + "delta": { + "type": "number", + "format": "double" + }, + "dollarDelta": { + "type": "number", + "format": "double" + }, + "pnL": { + "type": "number", + "format": "double" + }, + "nav": { + "type": "number", + "format": "double" + }, + "volatility": { + "type": "number", + "format": "double" + }, + "flags": { + "$ref": "#/components/schemas/ShockValueFlags" + } + }, + "additionalProperties": false + }, + "ShockValueFlags": { + "type": "object", + "properties": { + "expired": { + "type": "boolean" + }, + "exercised": { + "type": "boolean" + }, + "delivered": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "Side": { + "enum": [ + "SIDE_NOT_SPECIFIED", + "SIDE_BUY", + "SIDE_SELL_SHORT_EXEMPT", + "SIDE_SELL", + "SIDE_SELL_SHORT", + "SIDE_CROSS" + ], + "type": "string" + }, + "SpreadLegSide": { + "enum": [ + "SPREAD_LEG_SIDE_UNKNOWN", + "SPREAD_LEG_SIDE_BUY", + "SPREAD_LEG_SIDE_SELL" + ], + "type": "string" + }, + "SpreadLegType": { + "enum": [ + "SPREAD_LEG_TYPE_UNKNOWN", + "SPREAD_LEG_TYPE_OUTRIGHT", + "SPREAD_LEG_TYPE_VOLATILITY" + ], + "type": "string" + }, + "Status": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Any" + } + } + }, + "additionalProperties": false + }, + "StatusCode": { + "enum": [ + "STATUS_CODE_OK", + "STATUS_CODE_ERROR", + "STATUS_CODE_DISCONNECTED", + "STATUS_CODE_NOT_AUTHORIZED", + "STATUS_CODE_TIMEOUT", + "STATUS_CODE_SERVER_BUSY", + "STATUS_CODE_SERVER_ERROR", + "STATUS_CODE_NOT_FOUND", + "STATUS_CODE_VALIDATION_ERROR", + "STATUS_CODE_NOT_CONNECTED", + "STATUS_CODE_PEER_ALREADY_EXISTS", + "STATUS_CODE_NOT_UPDATED" + ], + "type": "string" + }, + "Stock": { + "type": "object", + "properties": { + "aliases": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + }, + "currency": { + "$ref": "#/components/schemas/Currency" + }, + "listedDt": { + "$ref": "#/components/schemas/Date" + }, + "delistedDt": { + "$ref": "#/components/schemas/Date" + }, + "description": { + "type": "string" + }, + "exchangeId": { + "type": "integer", + "format": "int32" + }, + "id": { + "type": "integer", + "format": "int32" + }, + "multiplier": { + "type": "number", + "format": "double" + }, + "priceBaseFactor": { + "type": "number", + "format": "double" + }, + "priceDisplayFactor": { + "type": "number", + "format": "double" + }, + "priceDisplayFormat": { + "$ref": "#/components/schemas/NumericDisplayFormat" + }, + "qtyDisplayFactor": { + "type": "number", + "format": "double" + }, + "qtyDisplayFormat": { + "$ref": "#/components/schemas/NumericDisplayFormat" + }, + "securityCategory": { + "$ref": "#/components/schemas/SecurityCategory" + }, + "symbol": { + "type": "string" + }, + "tickRule": { + "type": "string" + }, + "tickSize": { + "type": "number", + "format": "double" + }, + "tickValue": { + "type": "number", + "format": "double" + }, + "tradedExchanges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExchangeCode" + } + }, + "category": { + "type": "string" + }, + "industry": { + "type": "string" + }, + "lotSize": { + "type": "integer", + "format": "int32" + }, + "sector": { + "type": "string" + } + }, + "additionalProperties": false + }, + "Tif": { + "enum": [ + "TIF_UNKNOWN", + "TIF_DAY", + "TIF_GTC", + "TIF_OPG", + "TIF_IOC", + "TIF_FOK", + "TIF_GTX", + "TIF_GTD", + "TIF_CLO", + "TIF_ETH" + ], + "type": "string" + }, + "TimeOfDay": { + "type": "object", + "properties": { + "hours": { + "type": "integer", + "format": "int32" + }, + "minutes": { + "type": "integer", + "format": "int32" + }, + "seconds": { + "type": "integer", + "format": "int32" + }, + "nanos": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "TimsClassGroup": { + "type": "object", + "properties": { + "delta": { + "type": "number", + "format": "double" + }, + "dollarDelta": { + "type": "number", + "format": "double" + }, + "dollarGamma": { + "type": "number", + "format": "double" + }, + "gamma": { + "type": "number", + "format": "double" + }, + "hc": { + "type": "number", + "format": "double" + }, + "hcMin": { + "type": "number", + "format": "double" + }, + "longNav": { + "type": "number", + "format": "double" + }, + "marginReq": { + "type": "number", + "format": "double" + }, + "nav": { + "type": "number", + "format": "double" + }, + "pnL": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + "positions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TimsPositionGroup" + } + }, + "productGroup": { + "type": "string" + }, + "rho": { + "type": "number", + "format": "double" + }, + "shortNav": { + "type": "number", + "format": "double" + }, + "symbol": { + "type": "string" + }, + "theta": { + "type": "number", + "format": "double" + }, + "vega": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "TimsMarginData": { + "type": "object", + "properties": { + "accountType": { + "type": "string" + }, + "classGroupCount": { + "type": "integer", + "format": "int32" + }, + "classGroups": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TimsClassGroup" + } + }, + "currency": { + "$ref": "#/components/schemas/Currency" + }, + "dollarDelta": { + "type": "number", + "format": "double" + }, + "dollarGamma": { + "type": "number", + "format": "double" + }, + "longNav": { + "type": "number", + "format": "double" + }, + "marginReq": { + "type": "number", + "format": "double" + }, + "nav": { + "type": "number", + "format": "double" + }, + "porfolioGroupCount": { + "type": "integer", + "format": "int32" + }, + "positionGroupCount": { + "type": "integer", + "format": "int32" + }, + "productGroupCount": { + "type": "integer", + "format": "int32" + }, + "productGroups": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TimsProductGroup" + } + }, + "rho": { + "type": "number", + "format": "double" + }, + "shortNav": { + "type": "number", + "format": "double" + }, + "theta": { + "type": "number", + "format": "double" + }, + "vega": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "TimsPositionGroup": { + "type": "object", + "properties": { + "delta": { + "type": "number", + "format": "double" + }, + "gamma": { + "type": "number", + "format": "double" + }, + "hcMin": { + "type": "number", + "format": "double" + }, + "hcMinval": { + "type": "number", + "format": "double" + }, + "marginReq": { + "type": "number", + "format": "double" + }, + "nav": { + "type": "number", + "format": "double" + }, + "pnL": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + "price": { + "type": "number", + "format": "double" + }, + "qty": { + "type": "number", + "format": "double" + }, + "rho": { + "type": "number", + "format": "double" + }, + "rpgRoot": { + "type": "string" + }, + "symbol": { + "type": "string" + }, + "theta": { + "type": "number", + "format": "double" + }, + "vega": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "TimsProductGroup": { + "type": "object", + "properties": { + "delta": { + "type": "number", + "format": "double" + }, + "dollarDelta": { + "type": "number", + "format": "double" + }, + "dollarGamma": { + "type": "number", + "format": "double" + }, + "gamma": { + "type": "number", + "format": "double" + }, + "group": { + "type": "string" + }, + "hc": { + "type": "number", + "format": "double" + }, + "hcMin": { + "type": "number", + "format": "double" + }, + "longNav": { + "type": "number", + "format": "double" + }, + "marginReq": { + "type": "number", + "format": "double" + }, + "nav": { + "type": "number", + "format": "double" + }, + "pnLRange": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + "portfolioGroup": { + "type": "string" + }, + "rho": { + "type": "number", + "format": "double" + }, + "shortNav": { + "type": "number", + "format": "double" + }, + "theta": { + "type": "number", + "format": "double" + }, + "vega": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "TradeConfirm": { + "type": "object", + "properties": { + "accountId": { + "type": "integer", + "format": "int32" + }, + "accountName": { + "type": "string" + }, + "allocId": { + "type": "string" + }, + "allocQty": { + "type": "number", + "format": "double" + }, + "auxPrice": { + "type": "number", + "format": "double" + }, + "avgPrice": { + "type": "number", + "format": "double" + }, + "billingCode": { + "type": "string" + }, + "capacity": { + "$ref": "#/components/schemas/CapacityCode" + }, + "clearingAccount": { + "type": "string" + }, + "clearingRange": { + "$ref": "#/components/schemas/ClearingRange" + }, + "clientId": { + "type": "string" + }, + "cmta": { + "type": "string" + }, + "commission": { + "type": "number", + "format": "double" + }, + "crossSideType": { + "$ref": "#/components/schemas/CrossSideType" + }, + "crossType": { + "$ref": "#/components/schemas/CrossType" + }, + "cumQty": { + "type": "number", + "format": "double" + }, + "curOrdId": { + "type": "string" + }, + "deliverToCompid": { + "type": "string" + }, + "deliverToSubid": { + "type": "string" + }, + "description": { + "type": "string" + }, + "drop": { + "type": "boolean" + }, + "efid": { + "type": "string" + }, + "execBroker": { + "type": "string" + }, + "execId": { + "type": "string" + }, + "execRefId": { + "type": "string" + }, + "execType": { + "$ref": "#/components/schemas/ExecType" + }, + "exerciseStyle": { + "$ref": "#/components/schemas/OptionExerciseStyle" + }, + "expirationDt": { + "$ref": "#/components/schemas/Date" + }, + "fee1": { + "type": "number", + "format": "double" + }, + "fee2": { + "type": "number", + "format": "double" + }, + "frequentTraderId": { + "type": "string" + }, + "giveUp": { + "type": "string" + }, + "id": { + "type": "integer", + "format": "int32" + }, + "incomingClOrdId": { + "type": "string" + }, + "incomingOrdId": { + "type": "string" + }, + "incomingOrigClordId": { + "type": "string" + }, + "lastMarket": { + "type": "string" + }, + "lastPrice": { + "type": "number", + "format": "double" + }, + "lastQty": { + "type": "number", + "format": "double" + }, + "leavesQty": { + "type": "number", + "format": "double" + }, + "legId": { + "type": "string" + }, + "liquidityFlag": { + "type": "string" + }, + "locateId": { + "type": "string" + }, + "mpid": { + "type": "string" + }, + "multiLegReportingtype": { + "$ref": "#/components/schemas/MultiLegReportingType" + }, + "ordType": { + "$ref": "#/components/schemas/OrdType" + }, + "originationType": { + "$ref": "#/components/schemas/OriginationType" + }, + "origOrdId": { + "type": "string" + }, + "parentOrdId": { + "type": "string" + }, + "permOrdId": { + "type": "string" + }, + "positionEffect": { + "$ref": "#/components/schemas/PositionEffect" + }, + "price": { + "type": "number", + "format": "double" + }, + "priceType": { + "$ref": "#/components/schemas/PriceType" + }, + "putCall": { + "$ref": "#/components/schemas/PutCall" + }, + "qty": { + "type": "number", + "format": "double" + }, + "reqOrdId": { + "type": "string" + }, + "root": { + "type": "string" + }, + "route": { + "type": "string" + }, + "routingSession": { + "type": "string" + }, + "securityType": { + "$ref": "#/components/schemas/SecurityType" + }, + "settlementType": { + "$ref": "#/components/schemas/OptionSettlementType" + }, + "side": { + "$ref": "#/components/schemas/Side" + }, + "source": { + "type": "string" + }, + "sourceAddress": { + "type": "string" + }, + "strategyId": { + "type": "string" + }, + "strike": { + "type": "number", + "format": "double" + }, + "symbol": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "tag1": { + "type": "string" + }, + "targetCompId": { + "type": "string" + }, + "targetSubId": { + "type": "string" + }, + "text": { + "type": "string" + }, + "tif": { + "$ref": "#/components/schemas/Tif" + }, + "tradedDt": { + "$ref": "#/components/schemas/Date" + }, + "traderId": { + "type": "string" + }, + "tradingFirmId": { + "type": "integer", + "format": "int32" + }, + "transactTs": { + "type": "string" + }, + "underlying": { + "type": "string" + }, + "userId": { + "type": "integer", + "format": "int32" + }, + "workingQty": { + "type": "number", + "format": "double" + }, + "multiplier": { + "type": "number", + "format": "double" + }, + "dacDelta": { + "type": "number", + "format": "double" + }, + "dacReferencePrice": { + "type": "number", + "format": "double" + }, + "manualFillTime": { + "type": "string" + } + }, + "additionalProperties": false + }, + "TradingFirm": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "eqMpid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "occClearingNumber": { + "type": "string" + } + }, + "additionalProperties": false + }, + "TradingFirmSlim": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false + }, + "TradingHoliday": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "country": { + "$ref": "#/components/schemas/Country" + }, + "date": { + "$ref": "#/components/schemas/Date" + }, + "description": { + "type": "string" + }, + "isEarlyClose": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "TradingSession": { + "type": "object", + "properties": { + "daysOfTheWeek": { + "type": "string" + }, + "endTime": { + "$ref": "#/components/schemas/TimeOfDay" + }, + "id": { + "type": "integer", + "format": "int32" + }, + "name": { + "type": "string" + }, + "startTime": { + "$ref": "#/components/schemas/TimeOfDay" + }, + "tradingSessionGroupId": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "TradingSessionGroup": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "name": { + "type": "string" + }, + "sessions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TradingSession" + } + } + }, + "additionalProperties": false + }, + "User": { + "type": "object", + "properties": { + "domain": { + "type": "string" + }, + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "id": { + "type": "integer", + "format": "int32" + }, + "isLockedOut": { + "type": "boolean" + }, + "lastName": { + "type": "string" + }, + "location": { + "$ref": "#/components/schemas/UserLocation" + }, + "phonePrimary": { + "type": "string" + }, + "phoneSecondary": { + "type": "string" + }, + "region": { + "type": "string" + }, + "regionCode": { + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/UserStatus" + }, + "tradingFirmId": { + "type": "integer", + "format": "int32" + }, + "type": { + "$ref": "#/components/schemas/UserType" + }, + "userName": { + "type": "string" + }, + "city": { + "type": "string" + }, + "permissions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserPermission" + } + }, + "setupTicket": { + "type": "string" + }, + "largeTraderId": { + "type": "string" + } + }, + "additionalProperties": false + }, + "UserLocation": { + "enum": [ + "USER_LOCATION_UNKNOWN", + "USER_LOCATION_ON_FLOOR", + "USER_LOCATION_OFF_FLOOR" + ], + "type": "string" + }, + "UserPermission": { + "type": "object", + "properties": { + "claim": { + "type": "string" + }, + "claimType": { + "$ref": "#/components/schemas/ClaimType" + }, + "description": { + "type": "string" + } + }, + "additionalProperties": false + }, + "UserStatus": { + "enum": [ + "USER_STATUS_UNKNOWN", + "USER_STATUS_ACTIVE", + "USER_STATUS_DELETED", + "USER_STATUS_VIEW_ONLY", + "USER_STATUS_DISABLED" + ], + "type": "string" + }, + "UserType": { + "enum": [ + "USER_TYPE_UNKNOWN", + "USER_TYPE_API", + "USER_TYPE_GUI" + ], + "type": "string" + }, + "ValidateRiskResponse": { + "type": "object", + "properties": { + "isValid": { + "type": "boolean" + }, + "riskRejects": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RiskReject" + } + }, + "errorMessage": { + "type": "string" + }, + "statusCode": { + "$ref": "#/components/schemas/StatusCode" + } + }, + "additionalProperties": false + }, + "VolatilityShockSkew": { + "enum": [ + "VOLATILITY_SHOCK_SKEW_STICKY_DELTA", + "VOLATILITY_SHOCK_SKEW_STICKY_STRIKE" + ], + "type": "string" + }, + "VolatilityShockType": { + "enum": [ + "VOLATILITY_SHOCK_TYPE_ABSOLUTE", + "VOLATILITY_SHOCK_TYPE_RELATIVE" + ], + "type": "string" + } + }, + "securitySchemes": { + "Bearer": { + "type": "http", + "description": "JSON Web Token based security", + "scheme": "Bearer", + "bearerFormat": "JWT" + } + } + }, + "security": [ + { + "Bearer": [] + } + ] +} \ No newline at end of file diff --git a/openapi/templates/api_init.py.jinja b/openapi/templates/api_init.py.jinja new file mode 100644 index 000000000..dc035f4ce --- /dev/null +++ b/openapi/templates/api_init.py.jinja @@ -0,0 +1 @@ +""" Contains methods for accessing the API """ diff --git a/openapi/templates/client.py.jinja b/openapi/templates/client.py.jinja new file mode 100644 index 000000000..7a166a013 --- /dev/null +++ b/openapi/templates/client.py.jinja @@ -0,0 +1,191 @@ +import ssl +from typing import Any + +from attrs import define, field, evolve +import httpx + + +{% set attrs_info = { + "raise_on_unexpected_status": namespace( + type="bool", + default="field(default=False, kw_only=True)", + docstring="Whether or not to raise an errors.UnexpectedStatus if the API returns a status code" + " that was not documented in the source OpenAPI document. Can also be provided as a keyword" + " argument to the constructor." + ), + "token": namespace(type="str", default="", docstring="The token to use for authentication"), + "prefix": namespace(type="str", default='"Bearer"', docstring="The prefix to use for the Authorization header"), + "auth_header_name": namespace(type="str", default='"Authorization"', docstring="The name of the Authorization header"), +} %} + +{% macro attr_in_class_docstring(name) %} +{{ name }}: {{ attrs_info[name].docstring }} +{%- endmacro %} + +{% macro declare_attr(name) %} +{% set attr = attrs_info[name] %} +{{ name }}: {{ attr.type }}{% if attr.default %} = {{ attr.default }}{% endif %} +{% if attr.docstring and config.docstrings_on_attributes +%} +"""{{ attr.docstring }}""" +{%- endif %} +{% endmacro %} + +@define +class Client: + """A class for keeping track of data related to the API + +{% macro httpx_args_docstring() %} + The following are accepted as keyword arguments and will be used to construct httpx Clients internally: + + ``base_url``: The base URL for the API, all requests are made to a relative path to this URL + + ``cookies``: A dictionary of cookies to be sent with every request + + ``headers``: A dictionary of headers to be sent with every request + + ``timeout``: The maximum amount of a time a request can take. API functions will raise + httpx.TimeoutException if this is exceeded. + + ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, + but can be set to False for testing purposes. + + ``follow_redirects``: Whether or not to follow redirects. Default value is False. + + ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. +{% endmacro %} +{{ httpx_args_docstring() }} +{% if not config.docstrings_on_attributes %} + + Attributes: + {{ attr_in_class_docstring("raise_on_unexpected_status") | wordwrap(101) | indent(12) }} +{% endif %} + """ +{% macro attributes() %} + {{ declare_attr("raise_on_unexpected_status") | indent(4) }} + _base_url: str = field(alias="base_url") + _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") + _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") + _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: str | bool | ssl.SSLContext = field(default=True, kw_only=True, alias="verify_ssl") + _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") + _client: httpx.Client | None = field(default=None, init=False) + _async_client: httpx.AsyncClient | None = field(default=None, init=False) +{% endmacro %}{{ attributes() }} +{% macro builders(self) %} + def with_headers(self, headers: dict[str, str]) -> "{{ self }}": + """Get a new client matching this one with additional headers""" + if self._client is not None: + self._client.headers.update(headers) + if self._async_client is not None: + self._async_client.headers.update(headers) + return evolve(self, headers={**self._headers, **headers}) + + def with_cookies(self, cookies: dict[str, str]) -> "{{ self }}": + """Get a new client matching this one with additional cookies""" + if self._client is not None: + self._client.cookies.update(cookies) + if self._async_client is not None: + self._async_client.cookies.update(cookies) + return evolve(self, cookies={**self._cookies, **cookies}) + + def with_timeout(self, timeout: httpx.Timeout) -> "{{ self }}": + """Get a new client matching this one with a new timeout (in seconds)""" + if self._client is not None: + self._client.timeout = timeout + if self._async_client is not None: + self._async_client.timeout = timeout + return evolve(self, timeout=timeout) +{% endmacro %}{{ builders("Client") }} +{% macro httpx_stuff(name, custom_constructor=None) %} + def set_httpx_client(self, client: httpx.Client) -> "{{ name }}": + """Manually set the underlying httpx.Client + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._client = client + return self + + def get_httpx_client(self) -> httpx.Client: + """Get the underlying httpx.Client, constructing a new one if not previously set""" + if self._client is None: + {% if custom_constructor %} + {{ custom_constructor | indent(12) }} + {% endif %} + self._client = httpx.Client( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._client + + def __enter__(self) -> "{{ name }}": + """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" + self.get_httpx_client().__enter__() + return self + + def __exit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for internal httpx.Client (see httpx docs)""" + self.get_httpx_client().__exit__(*args, **kwargs) + + def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "{{ name }}": + """Manually the underlying httpx.AsyncClient + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._async_client = async_client + return self + + def get_async_httpx_client(self) -> httpx.AsyncClient: + """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" + if self._async_client is None: + {% if custom_constructor %} + {{ custom_constructor | indent(12) }} + {% endif %} + self._async_client = httpx.AsyncClient( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._async_client + + async def __aenter__(self) -> "{{ name }}": + """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" + await self.get_async_httpx_client().__aenter__() + return self + + async def __aexit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" + await self.get_async_httpx_client().__aexit__(*args, **kwargs) +{% endmacro %}{{ httpx_stuff("Client") }} + +@define +class AuthenticatedClient: + """A Client which has been authenticated for use on secured endpoints + +{{ httpx_args_docstring() }} +{% if not config.docstrings_on_attributes %} + + Attributes: + {{ attr_in_class_docstring("raise_on_unexpected_status") | wordwrap(101) | indent(12) }} + {{ attr_in_class_docstring("token") | indent(8) }} + {{ attr_in_class_docstring("prefix") | indent(8) }} + {{ attr_in_class_docstring("auth_header_name") | indent(8) }} +{% endif %} + """ + +{{ attributes() }} + {{ declare_attr("token") | indent(4) }} + {{ declare_attr("prefix") | indent(4) }} + {{ declare_attr("auth_header_name") | indent(4) }} + +{{ builders("AuthenticatedClient") }} +{{ httpx_stuff("AuthenticatedClient", "self._headers[self.auth_header_name] = f\"{self.prefix} {self.token}\" if self.prefix else self.token") }} diff --git a/openapi/templates/endpoint_init.py.jinja b/openapi/templates/endpoint_init.py.jinja new file mode 100644 index 000000000..c9921b5fd --- /dev/null +++ b/openapi/templates/endpoint_init.py.jinja @@ -0,0 +1 @@ +""" Contains endpoint functions for accessing the API """ diff --git a/openapi/templates/endpoint_macros.py.jinja b/openapi/templates/endpoint_macros.py.jinja new file mode 100644 index 000000000..5fafa0125 --- /dev/null +++ b/openapi/templates/endpoint_macros.py.jinja @@ -0,0 +1,186 @@ +{% from "property_templates/helpers.jinja" import guarded_statement %} +{% from "helpers.jinja" import safe_docstring %} + +{% macro header_params(endpoint) %} +{% if endpoint.header_parameters or endpoint.bodies | length > 0 %} +headers: dict[str, Any] = {} +{% if endpoint.header_parameters %} + {% for parameter in endpoint.header_parameters %} + {% import "property_templates/" + parameter.template as param_template %} + {% if param_template.transform_header %} + {% set expression = param_template.transform_header(parameter.python_name) %} + {% else %} + {% set expression = parameter.python_name %} + {% endif %} + {% set statement = 'headers["' + parameter.name + '"]' + " = " + expression %} +{{ guarded_statement(parameter, parameter.python_name, statement) }} + {% endfor %} +{% endif %} +{% endif %} +{% endmacro %} + +{% macro cookie_params(endpoint) %} +{% if endpoint.cookie_parameters %} +cookies = {} + {% for parameter in endpoint.cookie_parameters %} + {% if parameter.required %} +cookies["{{ parameter.name}}"] = {{ parameter.python_name }} + {% else %} +if {{ parameter.python_name }} is not UNSET: + cookies["{{ parameter.name}}"] = {{ parameter.python_name }} + {% endif %} + + {% endfor %} +{% endif %} +{% endmacro %} + + +{% macro query_params(endpoint) %} +{% if endpoint.query_parameters %} +params: dict[str, Any] = {} + +{% for property in endpoint.query_parameters %} + {% set destination = property.python_name %} + {% import "property_templates/" + property.template as prop_template %} + {% if prop_template.transform %} + {% set destination = "json_" + property.python_name %} +{{ prop_template.transform(property, property.python_name, destination) }} + {% endif %} + {%- if not property.json_is_dict %} +params["{{ property.name }}"] = {{ destination }} + {% else %} +{{ guarded_statement(property, destination, "params.update(" + destination + ")") }} + {% endif %} + +{% endfor %} + +params = {k: v for k, v in params.items() if v is not UNSET and v is not None} +{% endif %} +{% endmacro %} + +{% macro body_to_kwarg(body) %} +{% if body.body_type == "data" %} +_kwargs["data"] = body.to_dict() +{% elif body.body_type == "files"%} +{{ multipart_body(body) }} +{% elif body.body_type == "json" %} +{{ json_body(body) }} +{% elif body.body_type == "content" %} +_kwargs["content"] = body.payload +{% endif %} +{% endmacro %} + +{% macro json_body(body) %} +{% set property = body.prop %} +{% import "property_templates/" + property.template as prop_template %} +{% if prop_template.transform %} +{{ prop_template.transform(property, property.python_name, "_kwargs[\"json\"]") }} +{% else %} +_kwargs["json"] = {{ property.python_name }} +{% endif %} +{% endmacro %} + +{% macro multipart_body(body) %} +{% set property = body.prop %} +{% import "property_templates/" + property.template as prop_template %} +{% if prop_template.transform_multipart_body %} +{{ prop_template.transform_multipart_body(property) }} +{% endif %} +{% endmacro %} + +{# The all the kwargs passed into an endpoint (and variants thereof)) #} +{% macro arguments(endpoint, include_client=True) %} +{# path parameters #} +{% for parameter in endpoint.path_parameters %} +{{ parameter.to_string() }}, +{% endfor %} +{% if include_client or ((endpoint.list_all_parameters() | length) > (endpoint.path_parameters | length)) %} +*, +{% endif %} +{# Proper client based on whether or not the endpoint requires authentication #} +{% if include_client %} +{% if endpoint.requires_security %} +client: AuthenticatedClient, +{% else %} +client: AuthenticatedClient | Client, +{% endif %} +{% endif %} +{# Any allowed bodies #} +{% if endpoint.bodies | length == 1 %} +body: {{ endpoint.bodies[0].prop.get_type_string() }}, +{% elif endpoint.bodies | length > 1 %} +body: ( + {% for body in endpoint.bodies %} + {{ body.prop.get_type_string() }}{% if not loop.last %} |{% endif %} + {% endfor %} +), +{% endif %} +{# query parameters #} +{% for parameter in endpoint.query_parameters %} +{{ parameter.to_string() }}, +{% endfor %} +{% for parameter in endpoint.header_parameters %} +{{ parameter.to_string() }}, +{% endfor %} +{# cookie parameters #} +{% for parameter in endpoint.cookie_parameters %} +{{ parameter.to_string() }}, +{% endfor %} +{% endmacro %} + +{# Just lists all kwargs to endpoints as name=name for passing to other functions #} +{% macro kwargs(endpoint, include_client=True) %} +{% for parameter in endpoint.path_parameters %} +{{ parameter.python_name }}={{ parameter.python_name }}, +{% endfor %} +{% if include_client %} +client=client, +{% endif %} +{% if endpoint.bodies | length > 0 %} +body=body, +{% endif %} +{% for parameter in endpoint.query_parameters %} +{{ parameter.python_name }}={{ parameter.python_name }}, +{% endfor %} +{% for parameter in endpoint.header_parameters %} +{{ parameter.python_name }}={{ parameter.python_name }}, +{% endfor %} +{% for parameter in endpoint.cookie_parameters %} +{{ parameter.python_name }}={{ parameter.python_name }}, +{% endfor %} +{% endmacro %} + +{% macro docstring_content(endpoint, return_string, is_detailed) %} +{% if endpoint.summary %}{{ endpoint.summary | wordwrap(100)}} + +{% endif -%} +{%- if endpoint.description %} {{ endpoint.description | wordwrap(100) }} + +{% endif %} +{% if not endpoint.summary and not endpoint.description %} +{# Leave extra space so that Args or Returns isn't at the top #} + +{% endif %} +{% set all_parameters = endpoint.list_all_parameters() %} +{% if all_parameters %} +Args: + {% for parameter in all_parameters %} + {{ parameter.to_docstring() | wordwrap(90) | indent(8) }} + {% endfor %} + +{% endif %} +Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + +Returns: +{% if is_detailed %} + Response[{{ return_string }}] +{% else %} + {{ return_string }} +{% endif %} +{% endmacro %} + +{% macro docstring(endpoint, return_string, is_detailed) %} +{{ safe_docstring(docstring_content(endpoint, return_string, is_detailed)) }} +{% endmacro %} diff --git a/openapi/templates/endpoint_module.py.jinja b/openapi/templates/endpoint_module.py.jinja new file mode 100644 index 000000000..d08cefab1 --- /dev/null +++ b/openapi/templates/endpoint_module.py.jinja @@ -0,0 +1,149 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +{% for relative in endpoint.relative_imports | sort %} +{{ relative }} +{% endfor %} + +{% from "endpoint_macros.py.jinja" import header_params, cookie_params, query_params, + arguments, client, kwargs, parse_response, docstring, body_to_kwarg %} + +{% set return_string = endpoint.response_type() %} +{% set parsed_responses = (endpoint.responses | length > 0) and return_string != "Any" %} + +def _get_kwargs( + {{ arguments(endpoint, include_client=False) | indent(4) }} +) -> dict[str, Any]: + {{ header_params(endpoint) | indent(4) }} + + {{ cookie_params(endpoint) | indent(4) }} + + {{ query_params(endpoint) | indent(4) }} + + _kwargs: dict[str, Any] = { + "method": "{{ endpoint.method }}", + {% if endpoint.path_parameters %} + "url": "{{ endpoint.path }}".format( + {%- for parameter in endpoint.path_parameters -%} + {{parameter.python_name}}={{parameter.python_name}}, + {%- endfor -%} + ), + {% else %} + "url": "{{ endpoint.path }}", + {% endif %} + {% if endpoint.query_parameters %} + "params": params, + {% endif %} + {% if endpoint.cookie_parameters %} + "cookies": cookies, + {% endif %} + } + +{% if endpoint.bodies | length > 1 %} +{% for body in endpoint.bodies %} + if isinstance(body, {{body.prop.get_type_string() }}): + {{ body_to_kwarg(body) | indent(8) }} + headers["Content-Type"] = "{{ body.content_type }}" +{% endfor %} +{% elif endpoint.bodies | length == 1 %} +{% set body = endpoint.bodies[0] %} + {{ body_to_kwarg(body) | indent(4) }} + {% if body.content_type != "multipart/form-data" %}{# Need httpx to set the boundary automatically #} + headers["Content-Type"] = "{{ body.content_type }}" + {% endif %} +{% endif %} + +{% if endpoint.header_parameters or endpoint.bodies | length > 0 %} + _kwargs["headers"] = headers +{% endif %} + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> {{ return_string }} | None: + {% for response in endpoint.responses %} + if response.status_code == {{ response.status_code.value }}: + {% if parsed_responses %}{% import "property_templates/" + response.prop.template as prop_template %} + {% if prop_template.construct %} + {{ prop_template.construct(response.prop, response.source.attribute) | indent(8) }} + {% elif response.source.return_type == response.prop.get_type_string() %} + {{ response.prop.python_name }} = {{ response.source.attribute }} + {% else %} + {{ response.prop.python_name }} = cast({{ response.prop.get_type_string() }}, {{ response.source.attribute }}) + {% endif %} + return {{ response.prop.python_name }} + {% else %} + return None + {% endif %} + {% endfor %} + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[{{ return_string }}]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + {{ arguments(endpoint) | indent(4) }} +) -> Response[{{ return_string }}]: + {{ docstring(endpoint, return_string, is_detailed=true) | indent(4) }} + + kwargs = _get_kwargs( + {{ kwargs(endpoint, include_client=False) }} + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +{% if parsed_responses %} +def sync( + {{ arguments(endpoint) | indent(4) }} +) -> {{ return_string }} | None: + {{ docstring(endpoint, return_string, is_detailed=false) | indent(4) }} + + return sync_detailed( + {{ kwargs(endpoint) }} + ).parsed +{% endif %} + +async def asyncio_detailed( + {{ arguments(endpoint) | indent(4) }} +) -> Response[{{ return_string }}]: + {{ docstring(endpoint, return_string, is_detailed=true) | indent(4) }} + + kwargs = _get_kwargs( + {{ kwargs(endpoint, include_client=False) }} + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +{% if parsed_responses %} +async def asyncio( + {{ arguments(endpoint) | indent(4) }} +) -> {{ return_string }} | None: + {{ docstring(endpoint, return_string, is_detailed=false) | indent(4) }} + + return (await asyncio_detailed( + {{ kwargs(endpoint) }} + )).parsed +{% endif %} diff --git a/openapi/templates/model.py.jinja b/openapi/templates/model.py.jinja new file mode 100644 index 000000000..905a0d0bf --- /dev/null +++ b/openapi/templates/model.py.jinja @@ -0,0 +1,236 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +{% if model.is_multipart_body %} +import json +from .. import types +{% endif %} + +from ..types import UNSET, Unset + +{% for relative in model.relative_imports | sort %} +{{ relative }} +{% endfor %} + +{% set all_lazy_imports = model.lazy_imports | list %} +{% if model.additional_properties and model.additional_properties.lazy_imports %} +{% set all_lazy_imports = all_lazy_imports + (model.additional_properties.lazy_imports | list) %} +{% endif %} +{% for lazy_import in all_lazy_imports %} +{% if loop.first %} +if TYPE_CHECKING: +{% endif %} + {{ lazy_import }} +{% endfor %} + + +{% if model.additional_properties %} +{% set additional_property_type = 'Any' if model.additional_properties == True else model.additional_properties.get_type_string(quoted=not model.additional_properties.is_base_type) %} +{% endif %} + +{% set class_name = model.class_info.name %} +{% set module_name = model.class_info.module_name %} + +{% from "helpers.jinja" import safe_docstring %} + +T = TypeVar("T", bound="{{ class_name }}") + +{% macro class_docstring_content(model) %} + {% if model.title %}{{ model.title | wordwrap(116) }} + + {% endif -%} + {%- if model.description %}{{ model.description | wordwrap(116) }} + + {% endif %} + {% if not model.title and not model.description %} + {# Leave extra space so that a section doesn't start on the first line #} + + {% endif %} + {% if model.example %} + Example: + {{ model.example | string | wordwrap(112) | indent(12) }} + + {% endif %} + {% if (not config.docstrings_on_attributes) and (model.required_properties or model.optional_properties) %} + Attributes: + {% for property in model.required_properties + model.optional_properties %} + {{ property.to_docstring() | wordwrap(112) | indent(12) }} + {% endfor %}{% endif %} +{% endmacro %} + +{% macro declare_property(property) %} +{%- if config.docstrings_on_attributes and property.description -%} +{{ property.to_string() }} +{{ safe_docstring(property.description, omit_if_empty=True) | wordwrap(112) }} +{%- else -%} +{{ property.to_string() }} +{%- endif -%} +{% endmacro %} + +@_attrs_define +class {{ class_name }}: + {{ safe_docstring(class_docstring_content(model), omit_if_empty=config.docstrings_on_attributes) | indent(4) }} + + {% for property in model.required_properties + model.optional_properties %} + {% if property.default is none and property.required %} + {{ declare_property(property) | indent(4) }} + {% endif %} + {% endfor %} + {% for property in model.required_properties + model.optional_properties %} + {% if property.default is not none or not property.required %} + {{ declare_property(property) | indent(4) }} + {% endif %} + {% endfor %} + {% if model.additional_properties %} + additional_properties: dict[str, {{ additional_property_type }}] = _attrs_field(init=False, factory=dict) + {% endif %} + +{% macro _transform_property(property, content) %} +{% import "property_templates/" + property.template as prop_template %} +{%- if prop_template.transform -%} +{{ prop_template.transform(property=property, source=content, destination=property.python_name) }} +{%- else -%} +{{ property.python_name }} = {{ content }} +{%- endif -%} +{% endmacro %} + +{% macro multipart(property, source, destination) %} +{% import "property_templates/" + property.template as prop_template %} +{% if not property.required %} +if not isinstance({{source}}, Unset): + {{ prop_template.multipart(property, source, destination) | indent(4) }} +{% else %} +{{ prop_template.multipart(property, source, destination) }} +{% endif %} +{% endmacro %} + +{% macro _prepare_field_dict() %} +field_dict: dict[str, Any] = {} +{% if model.additional_properties %} +{% import "property_templates/" + model.additional_properties.template as prop_template %} +{% if prop_template.transform %} +field_dict.update({ + prop_name: {{ prop_template.transform(model.additional_properties, "prop", "prop", declare_type=false) }} + for prop_name, prop in self.additional_properties.items() +}) +{% else %} +field_dict.update(self.additional_properties) +{%- endif -%} +{%- endif -%} +{% endmacro %} + +{% macro _to_dict() %} +{% for property in model.required_properties + model.optional_properties -%} +{{ _transform_property(property, "self." + property.python_name) }} + +{% endfor %} + +{{ _prepare_field_dict() }} +{% if model.required_properties | length > 0 or model.optional_properties | length > 0 %} +field_dict.update({ + {% for property in model.required_properties + model.optional_properties %} + {% if property.required %} + "{{ property.name }}": {{ property.python_name }}, + {% endif %} + {% endfor %} +}) +{% endif %} +{% for property in model.optional_properties %} +{% if not property.required %} +if {{ property.python_name }} is not UNSET: + field_dict["{{ property.name }}"] = {{ property.python_name }} +{% endif %} +{% endfor %} + +return field_dict +{% endmacro %} + + def to_dict(self) -> dict[str, Any]: + {{ _to_dict() | indent(8) }} + +{% if model.is_multipart_body %} + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + {% for property in model.required_properties + model.optional_properties %} + {% set destination = "\"" + property.name + "\"" %} + {{ multipart(property, "self." + property.python_name, destination) | indent(8) }} + + {% endfor %} + + {% if model.additional_properties %} + files.extend([ + {{ multipart(model.additional_properties, "prop", "prop_name") }} + for prop_name, prop in self.additional_properties.items() + ]) + {% endif %} + + return files + +{% endif %} + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: +{% if (model.required_properties or model.optional_properties or model.additional_properties) %} + d = dict(src_dict) +{% for property in model.required_properties + model.optional_properties %} + {% if property.required %} + {% set property_source = 'd.pop("' + property.name + '")' %} + {% else %} + {% set property_source = 'd.pop("' + property.name + '", UNSET)' %} + {% endif %} + {% import "property_templates/" + property.template as prop_template %} + {% if prop_template.construct %} + {{ prop_template.construct(property, property_source) | indent(8) }} + {% else %} + {{ property.python_name }} = {{ property_source }} + {% endif %} + +{% endfor %} +{% endif %} + {{ module_name }} = cls( +{% for property in model.required_properties + model.optional_properties %} + {{ property.python_name }}={{ property.python_name }}, +{% endfor %} + ) + +{% if model.additional_properties %} + {% if model.additional_properties.template %}{# Can be a bool instead of an object #} + {% import "property_templates/" + model.additional_properties.template as prop_template %} + + + {% else %} + {% set prop_template = None %} + {% endif %} + {% if prop_template and prop_template.construct %} + additional_properties = {} + for prop_name, prop_dict in d.items(): + {{ prop_template.construct(model.additional_properties, "prop_dict") | indent(12) }} + additional_properties[prop_name] = {{ model.additional_properties.python_name }} + + {{ module_name }}.additional_properties = additional_properties + {% else %} + {{ module_name }}.additional_properties = d + {% endif %} +{% endif %} + return {{ module_name }} + + {% if model.additional_properties %} + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> {{ additional_property_type }}: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: {{ additional_property_type }}) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties + {% endif %} diff --git a/openapi/templates/models_init.py.jinja b/openapi/templates/models_init.py.jinja new file mode 100644 index 000000000..7379e86ad --- /dev/null +++ b/openapi/templates/models_init.py.jinja @@ -0,0 +1,13 @@ +""" Contains all the data models used in inputs/outputs """ + +{% for import in imports | sort %} +{{ import }} +{% endfor %} + +{% if imports %} +__all__ = ( + {% for all in alls | sort %} + "{{ all }}", + {% endfor %} +) +{% endif %} diff --git a/openapi/templates/package_init.py.jinja b/openapi/templates/package_init.py.jinja new file mode 100644 index 000000000..ecf60e74d --- /dev/null +++ b/openapi/templates/package_init.py.jinja @@ -0,0 +1,9 @@ +{% from "helpers.jinja" import safe_docstring %} + +{{ safe_docstring(package_description) }} +from .client import AuthenticatedClient, Client + +__all__ = ( + "AuthenticatedClient", + "Client", +) diff --git a/openapi/templates/types.py.jinja b/openapi/templates/types.py.jinja new file mode 100644 index 000000000..aebf5f11c --- /dev/null +++ b/openapi/templates/types.py.jinja @@ -0,0 +1,53 @@ +""" Contains some shared types for properties """ + +from collections.abc import Mapping, MutableMapping +from http import HTTPStatus +from typing import BinaryIO, Generic, TypeVar, Literal, IO + +from attrs import define + + +class Unset: + def __bool__(self) -> Literal[False]: + return False + + +UNSET: Unset = Unset() + +# The types that `httpx.Client(files=)` can accept, copied from that library. +FileContent = IO[bytes] | bytes | str +FileTypes = ( + # (filename, file (or bytes), content_type) + tuple[str | None, FileContent, str | None] | + # (filename, file (or bytes), content_type, headers) + tuple[str | None, FileContent, str | None, Mapping[str, str]] +) +RequestFiles = list[tuple[str, FileTypes]] + +@define +class File: + """ Contains information for file uploads """ + + payload: BinaryIO + file_name: str | None = None + mime_type: str | None = None + + def to_tuple(self) -> FileTypes: + """ Return a tuple representation that httpx will accept for multipart/form-data """ + return self.file_name, self.payload, self.mime_type + + +T = TypeVar("T") + + +@define +class Response(Generic[T]): + """ A response from an endpoint """ + + status_code: HTTPStatus + content: bytes + headers: MutableMapping[str, str] + parsed: T | None + + +__all__ = ["UNSET", "File", "FileTypes", "RequestFiles", "Response", "Unset"] diff --git a/openapi_project/.gitignore b/openapi_project/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/openapi_project/README.md b/openapi_project/README.md new file mode 100644 index 000000000..126ad5b7e --- /dev/null +++ b/openapi_project/README.md @@ -0,0 +1,124 @@ +# openapi_project +A client library for accessing Silexx API + +## Usage +First, create a client: + +```python +from openapi_package import Client + +client = Client(base_url="https://api.example.com") +``` + +If the endpoints you're going to hit require authentication, use `AuthenticatedClient` instead: + +```python +from openapi_package import AuthenticatedClient + +client = AuthenticatedClient(base_url="https://api.example.com", token="SuperSecretToken") +``` + +Now call your endpoint and use your models: + +```python +from openapi_package.models import MyDataModel +from openapi_package.api.my_tag import get_my_data_model +from openapi_package.types import Response + +with client as client: + my_data: MyDataModel = get_my_data_model.sync(client=client) + # or if you need more info (e.g. status_code) + response: Response[MyDataModel] = get_my_data_model.sync_detailed(client=client) +``` + +Or do the same thing with an async version: + +```python +from openapi_package.models import MyDataModel +from openapi_package.api.my_tag import get_my_data_model +from openapi_package.types import Response + +async with client as client: + my_data: MyDataModel = await get_my_data_model.asyncio(client=client) + response: Response[MyDataModel] = await get_my_data_model.asyncio_detailed(client=client) +``` + +By default, when you're calling an HTTPS API it will attempt to verify that SSL is working correctly. Using certificate verification is highly recommended most of the time, but sometimes you may need to authenticate to a server (especially an internal server) using a custom certificate bundle. + +```python +client = AuthenticatedClient( + base_url="https://internal_api.example.com", + token="SuperSecretToken", + verify_ssl="/path/to/certificate_bundle.pem", +) +``` + +You can also disable certificate validation altogether, but beware that **this is a security risk**. + +```python +client = AuthenticatedClient( + base_url="https://internal_api.example.com", + token="SuperSecretToken", + verify_ssl=False +) +``` + +Things to know: +1. Every path/method combo becomes a Python module with four functions: + 1. `sync`: Blocking request that returns parsed data (if successful) or `None` + 1. `sync_detailed`: Blocking request that always returns a `Request`, optionally with `parsed` set if the request was successful. + 1. `asyncio`: Like `sync` but async instead of blocking + 1. `asyncio_detailed`: Like `sync_detailed` but async instead of blocking + +1. All path/query params, and bodies become method arguments. +1. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above) +1. Any endpoint which did not have a tag will be in `openapi_package.api.default` + +## Advanced customizations + +There are more settings on the generated `Client` class which let you control more runtime behavior, check out the docstring on that class for more info. You can also customize the underlying `httpx.Client` or `httpx.AsyncClient` (depending on your use-case): + +```python +from openapi_package import Client + +def log_request(request): + print(f"Request event hook: {request.method} {request.url} - Waiting for response") + +def log_response(response): + request = response.request + print(f"Response event hook: {request.method} {request.url} - Status {response.status_code}") + +client = Client( + base_url="https://api.example.com", + httpx_args={"event_hooks": {"request": [log_request], "response": [log_response]}}, +) + +# Or get the underlying httpx client to modify directly with client.get_httpx_client() or client.get_async_httpx_client() +``` + +You can even set the httpx client directly, but beware that this will override any existing settings (e.g., base_url): + +```python +import httpx +from openapi_package import Client + +client = Client( + base_url="https://api.example.com", +) +# Note that base_url needs to be re-set, as would any shared cookies, headers, etc. +client.set_httpx_client(httpx.Client(base_url="https://api.example.com", proxies="http://localhost:8030")) +``` + +## Building / publishing this package +This project uses [Poetry](https://python-poetry.org/) to manage dependencies and packaging. Here are the basics: +1. Update the metadata in pyproject.toml (e.g. authors, version) +1. If you're using a private repository, configure it with Poetry + 1. `poetry config repositories. ` + 1. `poetry config http-basic. ` +1. Publish the client with `poetry publish --build -r ` or, if for public PyPI, just `poetry publish --build` + +If you want to install this client into another project without publishing it (e.g. for development) then: +1. If that project **is using Poetry**, you can simply do `poetry add ` from that project +1. If that project is not using Poetry: + 1. Build a wheel with `poetry build -f wheel` + 1. Install that wheel from the other project `pip install ` diff --git a/openapi_project/openapi_package/__init__.py b/openapi_project/openapi_package/__init__.py new file mode 100644 index 000000000..4eeee1912 --- /dev/null +++ b/openapi_project/openapi_package/__init__.py @@ -0,0 +1,8 @@ +"""A client library for accessing Silexx API""" + +from .client import AuthenticatedClient, Client + +__all__ = ( + "AuthenticatedClient", + "Client", +) diff --git a/openapi_project/openapi_package/api/__init__.py b/openapi_project/openapi_package/api/__init__.py new file mode 100644 index 000000000..e6035bd9f --- /dev/null +++ b/openapi_project/openapi_package/api/__init__.py @@ -0,0 +1 @@ +"""Contains methods for accessing the API""" diff --git a/openapi_project/openapi_package/api/application_service/__init__.py b/openapi_project/openapi_package/api/application_service/__init__.py new file mode 100644 index 000000000..dcbab9a7a --- /dev/null +++ b/openapi_project/openapi_package/api/application_service/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/openapi_project/openapi_package/api/application_service/post_application_login.py b/openapi_project/openapi_package/api/application_service/post_application_login.py new file mode 100644 index 000000000..00c0ed4c7 --- /dev/null +++ b/openapi_project/openapi_package/api/application_service/post_application_login.py @@ -0,0 +1,157 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.login_request import LoginRequest +from ...models.login_response import LoginResponse +from typing import cast + + +def _get_kwargs( + *, + body: LoginRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/application/login", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> LoginResponse | None: + if response.status_code == 200: + response_200 = LoginResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[LoginResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: LoginRequest, +) -> Response[LoginResponse]: + """ + Args: + body (LoginRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LoginResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: LoginRequest, +) -> LoginResponse | None: + """ + Args: + body (LoginRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LoginResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: LoginRequest, +) -> Response[LoginResponse]: + """ + Args: + body (LoginRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LoginResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: LoginRequest, +) -> LoginResponse | None: + """ + Args: + body (LoginRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LoginResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/order_service/__init__.py b/openapi_project/openapi_package/api/order_service/__init__.py new file mode 100644 index 000000000..dcbab9a7a --- /dev/null +++ b/openapi_project/openapi_package/api/order_service/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/openapi_project/openapi_package/api/order_service/get_orders.py b/openapi_project/openapi_package/api/order_service/get_orders.py new file mode 100644 index 000000000..ab002a494 --- /dev/null +++ b/openapi_project/openapi_package/api/order_service/get_orders.py @@ -0,0 +1,125 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.list_orders_response import ListOrdersResponse +from typing import cast + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/orders", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ListOrdersResponse | None: + if response.status_code == 200: + response_200 = ListOrdersResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ListOrdersResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListOrdersResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListOrdersResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> ListOrdersResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListOrdersResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListOrdersResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListOrdersResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> ListOrdersResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListOrdersResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/order_service/get_orders_searchhistory.py b/openapi_project/openapi_package/api/order_service/get_orders_searchhistory.py new file mode 100644 index 000000000..694c55921 --- /dev/null +++ b/openapi_project/openapi_package/api/order_service/get_orders_searchhistory.py @@ -0,0 +1,248 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.search_order_history_response import SearchOrderHistoryResponse +from ...types import UNSET, Unset +from typing import cast + + +def _get_kwargs( + *, + account_ids: Unset | str = UNSET, + to_dt_year: Unset | str = UNSET, + to_dt_month: Unset | str = UNSET, + to_dt_day: Unset | str = UNSET, + from_dt_year: Unset | str = UNSET, + from_dt_month: Unset | str = UNSET, + from_dt_day: Unset | str = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["accountIds"] = account_ids + + params["toDt.year"] = to_dt_year + + params["toDt.month"] = to_dt_month + + params["toDt.day"] = to_dt_day + + params["fromDt.year"] = from_dt_year + + params["fromDt.month"] = from_dt_month + + params["fromDt.day"] = from_dt_day + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/orders/searchhistory", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> SearchOrderHistoryResponse | None: + if response.status_code == 200: + response_200 = SearchOrderHistoryResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[SearchOrderHistoryResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + account_ids: Unset | str = UNSET, + to_dt_year: Unset | str = UNSET, + to_dt_month: Unset | str = UNSET, + to_dt_day: Unset | str = UNSET, + from_dt_year: Unset | str = UNSET, + from_dt_month: Unset | str = UNSET, + from_dt_day: Unset | str = UNSET, +) -> Response[SearchOrderHistoryResponse]: + """ + Args: + account_ids (Unset | str): + to_dt_year (Unset | str): + to_dt_month (Unset | str): + to_dt_day (Unset | str): + from_dt_year (Unset | str): + from_dt_month (Unset | str): + from_dt_day (Unset | str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SearchOrderHistoryResponse] + """ + + kwargs = _get_kwargs( + account_ids=account_ids, + to_dt_year=to_dt_year, + to_dt_month=to_dt_month, + to_dt_day=to_dt_day, + from_dt_year=from_dt_year, + from_dt_month=from_dt_month, + from_dt_day=from_dt_day, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + account_ids: Unset | str = UNSET, + to_dt_year: Unset | str = UNSET, + to_dt_month: Unset | str = UNSET, + to_dt_day: Unset | str = UNSET, + from_dt_year: Unset | str = UNSET, + from_dt_month: Unset | str = UNSET, + from_dt_day: Unset | str = UNSET, +) -> SearchOrderHistoryResponse | None: + """ + Args: + account_ids (Unset | str): + to_dt_year (Unset | str): + to_dt_month (Unset | str): + to_dt_day (Unset | str): + from_dt_year (Unset | str): + from_dt_month (Unset | str): + from_dt_day (Unset | str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SearchOrderHistoryResponse + """ + + return sync_detailed( + client=client, + account_ids=account_ids, + to_dt_year=to_dt_year, + to_dt_month=to_dt_month, + to_dt_day=to_dt_day, + from_dt_year=from_dt_year, + from_dt_month=from_dt_month, + from_dt_day=from_dt_day, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + account_ids: Unset | str = UNSET, + to_dt_year: Unset | str = UNSET, + to_dt_month: Unset | str = UNSET, + to_dt_day: Unset | str = UNSET, + from_dt_year: Unset | str = UNSET, + from_dt_month: Unset | str = UNSET, + from_dt_day: Unset | str = UNSET, +) -> Response[SearchOrderHistoryResponse]: + """ + Args: + account_ids (Unset | str): + to_dt_year (Unset | str): + to_dt_month (Unset | str): + to_dt_day (Unset | str): + from_dt_year (Unset | str): + from_dt_month (Unset | str): + from_dt_day (Unset | str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SearchOrderHistoryResponse] + """ + + kwargs = _get_kwargs( + account_ids=account_ids, + to_dt_year=to_dt_year, + to_dt_month=to_dt_month, + to_dt_day=to_dt_day, + from_dt_year=from_dt_year, + from_dt_month=from_dt_month, + from_dt_day=from_dt_day, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + account_ids: Unset | str = UNSET, + to_dt_year: Unset | str = UNSET, + to_dt_month: Unset | str = UNSET, + to_dt_day: Unset | str = UNSET, + from_dt_year: Unset | str = UNSET, + from_dt_month: Unset | str = UNSET, + from_dt_day: Unset | str = UNSET, +) -> SearchOrderHistoryResponse | None: + """ + Args: + account_ids (Unset | str): + to_dt_year (Unset | str): + to_dt_month (Unset | str): + to_dt_day (Unset | str): + from_dt_year (Unset | str): + from_dt_month (Unset | str): + from_dt_day (Unset | str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SearchOrderHistoryResponse + """ + + return ( + await asyncio_detailed( + client=client, + account_ids=account_ids, + to_dt_year=to_dt_year, + to_dt_month=to_dt_month, + to_dt_day=to_dt_day, + from_dt_year=from_dt_year, + from_dt_month=from_dt_month, + from_dt_day=from_dt_day, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/order_service/get_orders_tradeconfirms.py b/openapi_project/openapi_package/api/order_service/get_orders_tradeconfirms.py new file mode 100644 index 000000000..829fbe149 --- /dev/null +++ b/openapi_project/openapi_package/api/order_service/get_orders_tradeconfirms.py @@ -0,0 +1,218 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.list_trade_confirms_response import ListTradeConfirmsResponse +from ...types import UNSET, Unset +from typing import cast + + +def _get_kwargs( + *, + account_ids: Unset | str = UNSET, + end_time_utc: Unset | str = UNSET, + start_time_utc: Unset | str = UNSET, + trading_firm_ids: Unset | str = UNSET, + user_ids: Unset | str = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["accountIds"] = account_ids + + params["endTimeUtc"] = end_time_utc + + params["startTimeUtc"] = start_time_utc + + params["tradingFirmIds"] = trading_firm_ids + + params["userIds"] = user_ids + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/orders/tradeconfirms", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ListTradeConfirmsResponse | None: + if response.status_code == 200: + response_200 = ListTradeConfirmsResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ListTradeConfirmsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + account_ids: Unset | str = UNSET, + end_time_utc: Unset | str = UNSET, + start_time_utc: Unset | str = UNSET, + trading_firm_ids: Unset | str = UNSET, + user_ids: Unset | str = UNSET, +) -> Response[ListTradeConfirmsResponse]: + """ + Args: + account_ids (Unset | str): + end_time_utc (Unset | str): + start_time_utc (Unset | str): + trading_firm_ids (Unset | str): + user_ids (Unset | str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListTradeConfirmsResponse] + """ + + kwargs = _get_kwargs( + account_ids=account_ids, + end_time_utc=end_time_utc, + start_time_utc=start_time_utc, + trading_firm_ids=trading_firm_ids, + user_ids=user_ids, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + account_ids: Unset | str = UNSET, + end_time_utc: Unset | str = UNSET, + start_time_utc: Unset | str = UNSET, + trading_firm_ids: Unset | str = UNSET, + user_ids: Unset | str = UNSET, +) -> ListTradeConfirmsResponse | None: + """ + Args: + account_ids (Unset | str): + end_time_utc (Unset | str): + start_time_utc (Unset | str): + trading_firm_ids (Unset | str): + user_ids (Unset | str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListTradeConfirmsResponse + """ + + return sync_detailed( + client=client, + account_ids=account_ids, + end_time_utc=end_time_utc, + start_time_utc=start_time_utc, + trading_firm_ids=trading_firm_ids, + user_ids=user_ids, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + account_ids: Unset | str = UNSET, + end_time_utc: Unset | str = UNSET, + start_time_utc: Unset | str = UNSET, + trading_firm_ids: Unset | str = UNSET, + user_ids: Unset | str = UNSET, +) -> Response[ListTradeConfirmsResponse]: + """ + Args: + account_ids (Unset | str): + end_time_utc (Unset | str): + start_time_utc (Unset | str): + trading_firm_ids (Unset | str): + user_ids (Unset | str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListTradeConfirmsResponse] + """ + + kwargs = _get_kwargs( + account_ids=account_ids, + end_time_utc=end_time_utc, + start_time_utc=start_time_utc, + trading_firm_ids=trading_firm_ids, + user_ids=user_ids, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + account_ids: Unset | str = UNSET, + end_time_utc: Unset | str = UNSET, + start_time_utc: Unset | str = UNSET, + trading_firm_ids: Unset | str = UNSET, + user_ids: Unset | str = UNSET, +) -> ListTradeConfirmsResponse | None: + """ + Args: + account_ids (Unset | str): + end_time_utc (Unset | str): + start_time_utc (Unset | str): + trading_firm_ids (Unset | str): + user_ids (Unset | str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListTradeConfirmsResponse + """ + + return ( + await asyncio_detailed( + client=client, + account_ids=account_ids, + end_time_utc=end_time_utc, + start_time_utc=start_time_utc, + trading_firm_ids=trading_firm_ids, + user_ids=user_ids, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/order_service/post_orders_cancelorder.py b/openapi_project/openapi_package/api/order_service/post_orders_cancelorder.py new file mode 100644 index 000000000..78e51f414 --- /dev/null +++ b/openapi_project/openapi_package/api/order_service/post_orders_cancelorder.py @@ -0,0 +1,157 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.cancel_order_request import CancelOrderRequest +from ...models.cancel_order_response import CancelOrderResponse +from typing import cast + + +def _get_kwargs( + *, + body: CancelOrderRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/orders/cancelorder", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CancelOrderResponse | None: + if response.status_code == 200: + response_200 = CancelOrderResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CancelOrderResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CancelOrderRequest, +) -> Response[CancelOrderResponse]: + """ + Args: + body (CancelOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CancelOrderResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CancelOrderRequest, +) -> CancelOrderResponse | None: + """ + Args: + body (CancelOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CancelOrderResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CancelOrderRequest, +) -> Response[CancelOrderResponse]: + """ + Args: + body (CancelOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CancelOrderResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CancelOrderRequest, +) -> CancelOrderResponse | None: + """ + Args: + body (CancelOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CancelOrderResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/order_service/post_orders_createmultilegorder.py b/openapi_project/openapi_package/api/order_service/post_orders_createmultilegorder.py new file mode 100644 index 000000000..3518ab8d1 --- /dev/null +++ b/openapi_project/openapi_package/api/order_service/post_orders_createmultilegorder.py @@ -0,0 +1,157 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.create_multi_leg_order_request import CreateMultiLegOrderRequest +from ...models.create_multi_leg_order_response import CreateMultiLegOrderResponse +from typing import cast + + +def _get_kwargs( + *, + body: CreateMultiLegOrderRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/orders/createmultilegorder", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateMultiLegOrderResponse | None: + if response.status_code == 200: + response_200 = CreateMultiLegOrderResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateMultiLegOrderResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderRequest, +) -> Response[CreateMultiLegOrderResponse]: + """ + Args: + body (CreateMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateMultiLegOrderResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderRequest, +) -> CreateMultiLegOrderResponse | None: + """ + Args: + body (CreateMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateMultiLegOrderResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderRequest, +) -> Response[CreateMultiLegOrderResponse]: + """ + Args: + body (CreateMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateMultiLegOrderResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderRequest, +) -> CreateMultiLegOrderResponse | None: + """ + Args: + body (CreateMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateMultiLegOrderResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/order_service/post_orders_createmultilegordercross.py b/openapi_project/openapi_package/api/order_service/post_orders_createmultilegordercross.py new file mode 100644 index 000000000..baf4e43b2 --- /dev/null +++ b/openapi_project/openapi_package/api/order_service/post_orders_createmultilegordercross.py @@ -0,0 +1,161 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.create_multi_leg_order_cross_request import ( + CreateMultiLegOrderCrossRequest, +) +from ...models.create_multi_leg_order_cross_response import ( + CreateMultiLegOrderCrossResponse, +) +from typing import cast + + +def _get_kwargs( + *, + body: CreateMultiLegOrderCrossRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/orders/createmultilegordercross", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateMultiLegOrderCrossResponse | None: + if response.status_code == 200: + response_200 = CreateMultiLegOrderCrossResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateMultiLegOrderCrossResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderCrossRequest, +) -> Response[CreateMultiLegOrderCrossResponse]: + """ + Args: + body (CreateMultiLegOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateMultiLegOrderCrossResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderCrossRequest, +) -> CreateMultiLegOrderCrossResponse | None: + """ + Args: + body (CreateMultiLegOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateMultiLegOrderCrossResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderCrossRequest, +) -> Response[CreateMultiLegOrderCrossResponse]: + """ + Args: + body (CreateMultiLegOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateMultiLegOrderCrossResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderCrossRequest, +) -> CreateMultiLegOrderCrossResponse | None: + """ + Args: + body (CreateMultiLegOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateMultiLegOrderCrossResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/order_service/post_orders_createorder.py b/openapi_project/openapi_package/api/order_service/post_orders_createorder.py new file mode 100644 index 000000000..07ab5ff01 --- /dev/null +++ b/openapi_project/openapi_package/api/order_service/post_orders_createorder.py @@ -0,0 +1,157 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.create_order_request import CreateOrderRequest +from ...models.create_order_response import CreateOrderResponse +from typing import cast + + +def _get_kwargs( + *, + body: CreateOrderRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/orders/createorder", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateOrderResponse | None: + if response.status_code == 200: + response_200 = CreateOrderResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateOrderResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateOrderRequest, +) -> Response[CreateOrderResponse]: + """ + Args: + body (CreateOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateOrderResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CreateOrderRequest, +) -> CreateOrderResponse | None: + """ + Args: + body (CreateOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateOrderResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateOrderRequest, +) -> Response[CreateOrderResponse]: + """ + Args: + body (CreateOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateOrderResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CreateOrderRequest, +) -> CreateOrderResponse | None: + """ + Args: + body (CreateOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateOrderResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/order_service/post_orders_createordercross.py b/openapi_project/openapi_package/api/order_service/post_orders_createordercross.py new file mode 100644 index 000000000..63713fada --- /dev/null +++ b/openapi_project/openapi_package/api/order_service/post_orders_createordercross.py @@ -0,0 +1,157 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.create_order_cross_request import CreateOrderCrossRequest +from ...models.create_order_cross_response import CreateOrderCrossResponse +from typing import cast + + +def _get_kwargs( + *, + body: CreateOrderCrossRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/orders/createordercross", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateOrderCrossResponse | None: + if response.status_code == 200: + response_200 = CreateOrderCrossResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateOrderCrossResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateOrderCrossRequest, +) -> Response[CreateOrderCrossResponse]: + """ + Args: + body (CreateOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateOrderCrossResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CreateOrderCrossRequest, +) -> CreateOrderCrossResponse | None: + """ + Args: + body (CreateOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateOrderCrossResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateOrderCrossRequest, +) -> Response[CreateOrderCrossResponse]: + """ + Args: + body (CreateOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateOrderCrossResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CreateOrderCrossRequest, +) -> CreateOrderCrossResponse | None: + """ + Args: + body (CreateOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateOrderCrossResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/order_service/post_orders_replacemultilegorder.py b/openapi_project/openapi_package/api/order_service/post_orders_replacemultilegorder.py new file mode 100644 index 000000000..ce90bcb82 --- /dev/null +++ b/openapi_project/openapi_package/api/order_service/post_orders_replacemultilegorder.py @@ -0,0 +1,161 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.cancel_replace_multi_leg_order_request import ( + CancelReplaceMultiLegOrderRequest, +) +from ...models.cancel_replace_multi_leg_order_response import ( + CancelReplaceMultiLegOrderResponse, +) +from typing import cast + + +def _get_kwargs( + *, + body: CancelReplaceMultiLegOrderRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/orders/replacemultilegorder", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CancelReplaceMultiLegOrderResponse | None: + if response.status_code == 200: + response_200 = CancelReplaceMultiLegOrderResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CancelReplaceMultiLegOrderResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceMultiLegOrderRequest, +) -> Response[CancelReplaceMultiLegOrderResponse]: + """ + Args: + body (CancelReplaceMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CancelReplaceMultiLegOrderResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceMultiLegOrderRequest, +) -> CancelReplaceMultiLegOrderResponse | None: + """ + Args: + body (CancelReplaceMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CancelReplaceMultiLegOrderResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceMultiLegOrderRequest, +) -> Response[CancelReplaceMultiLegOrderResponse]: + """ + Args: + body (CancelReplaceMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CancelReplaceMultiLegOrderResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceMultiLegOrderRequest, +) -> CancelReplaceMultiLegOrderResponse | None: + """ + Args: + body (CancelReplaceMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CancelReplaceMultiLegOrderResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/order_service/post_orders_replaceorder.py b/openapi_project/openapi_package/api/order_service/post_orders_replaceorder.py new file mode 100644 index 000000000..65c482272 --- /dev/null +++ b/openapi_project/openapi_package/api/order_service/post_orders_replaceorder.py @@ -0,0 +1,157 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.cancel_replace_order_request import CancelReplaceOrderRequest +from ...models.cancel_replace_order_response import CancelReplaceOrderResponse +from typing import cast + + +def _get_kwargs( + *, + body: CancelReplaceOrderRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/orders/replaceorder", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CancelReplaceOrderResponse | None: + if response.status_code == 200: + response_200 = CancelReplaceOrderResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CancelReplaceOrderResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceOrderRequest, +) -> Response[CancelReplaceOrderResponse]: + """ + Args: + body (CancelReplaceOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CancelReplaceOrderResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceOrderRequest, +) -> CancelReplaceOrderResponse | None: + """ + Args: + body (CancelReplaceOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CancelReplaceOrderResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceOrderRequest, +) -> Response[CancelReplaceOrderResponse]: + """ + Args: + body (CancelReplaceOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CancelReplaceOrderResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceOrderRequest, +) -> CancelReplaceOrderResponse | None: + """ + Args: + body (CancelReplaceOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CancelReplaceOrderResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegorder.py b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegorder.py new file mode 100644 index 000000000..6305e2063 --- /dev/null +++ b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegorder.py @@ -0,0 +1,157 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.create_multi_leg_order_request import CreateMultiLegOrderRequest +from ...models.validate_risk_response import ValidateRiskResponse +from typing import cast + + +def _get_kwargs( + *, + body: CreateMultiLegOrderRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/orders/validaterisk/createmultilegorder", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ValidateRiskResponse | None: + if response.status_code == 200: + response_200 = ValidateRiskResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ValidateRiskResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderRequest, +) -> Response[ValidateRiskResponse]: + """ + Args: + body (CreateMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ValidateRiskResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderRequest, +) -> ValidateRiskResponse | None: + """ + Args: + body (CreateMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ValidateRiskResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderRequest, +) -> Response[ValidateRiskResponse]: + """ + Args: + body (CreateMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ValidateRiskResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderRequest, +) -> ValidateRiskResponse | None: + """ + Args: + body (CreateMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ValidateRiskResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegordercross.py b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegordercross.py new file mode 100644 index 000000000..1cc1dbaec --- /dev/null +++ b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegordercross.py @@ -0,0 +1,159 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.create_multi_leg_order_cross_request import ( + CreateMultiLegOrderCrossRequest, +) +from ...models.validate_risk_response import ValidateRiskResponse +from typing import cast + + +def _get_kwargs( + *, + body: CreateMultiLegOrderCrossRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/orders/validaterisk/createmultilegordercross", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ValidateRiskResponse | None: + if response.status_code == 200: + response_200 = ValidateRiskResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ValidateRiskResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderCrossRequest, +) -> Response[ValidateRiskResponse]: + """ + Args: + body (CreateMultiLegOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ValidateRiskResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderCrossRequest, +) -> ValidateRiskResponse | None: + """ + Args: + body (CreateMultiLegOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ValidateRiskResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderCrossRequest, +) -> Response[ValidateRiskResponse]: + """ + Args: + body (CreateMultiLegOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ValidateRiskResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CreateMultiLegOrderCrossRequest, +) -> ValidateRiskResponse | None: + """ + Args: + body (CreateMultiLegOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ValidateRiskResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createorder.py b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createorder.py new file mode 100644 index 000000000..fdd131b23 --- /dev/null +++ b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createorder.py @@ -0,0 +1,157 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.create_order_request import CreateOrderRequest +from ...models.validate_risk_response import ValidateRiskResponse +from typing import cast + + +def _get_kwargs( + *, + body: CreateOrderRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/orders/validaterisk/createorder", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ValidateRiskResponse | None: + if response.status_code == 200: + response_200 = ValidateRiskResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ValidateRiskResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateOrderRequest, +) -> Response[ValidateRiskResponse]: + """ + Args: + body (CreateOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ValidateRiskResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CreateOrderRequest, +) -> ValidateRiskResponse | None: + """ + Args: + body (CreateOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ValidateRiskResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateOrderRequest, +) -> Response[ValidateRiskResponse]: + """ + Args: + body (CreateOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ValidateRiskResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CreateOrderRequest, +) -> ValidateRiskResponse | None: + """ + Args: + body (CreateOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ValidateRiskResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createordercross.py b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createordercross.py new file mode 100644 index 000000000..a574cbc60 --- /dev/null +++ b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createordercross.py @@ -0,0 +1,157 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.create_order_cross_request import CreateOrderCrossRequest +from ...models.validate_risk_response import ValidateRiskResponse +from typing import cast + + +def _get_kwargs( + *, + body: CreateOrderCrossRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/orders/validaterisk/createordercross", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ValidateRiskResponse | None: + if response.status_code == 200: + response_200 = ValidateRiskResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ValidateRiskResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateOrderCrossRequest, +) -> Response[ValidateRiskResponse]: + """ + Args: + body (CreateOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ValidateRiskResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CreateOrderCrossRequest, +) -> ValidateRiskResponse | None: + """ + Args: + body (CreateOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ValidateRiskResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateOrderCrossRequest, +) -> Response[ValidateRiskResponse]: + """ + Args: + body (CreateOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ValidateRiskResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CreateOrderCrossRequest, +) -> ValidateRiskResponse | None: + """ + Args: + body (CreateOrderCrossRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ValidateRiskResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replacemultilegorder.py b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replacemultilegorder.py new file mode 100644 index 000000000..231026daf --- /dev/null +++ b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replacemultilegorder.py @@ -0,0 +1,159 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.cancel_replace_multi_leg_order_request import ( + CancelReplaceMultiLegOrderRequest, +) +from ...models.validate_risk_response import ValidateRiskResponse +from typing import cast + + +def _get_kwargs( + *, + body: CancelReplaceMultiLegOrderRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/orders/validaterisk/replacemultilegorder", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ValidateRiskResponse | None: + if response.status_code == 200: + response_200 = ValidateRiskResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ValidateRiskResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceMultiLegOrderRequest, +) -> Response[ValidateRiskResponse]: + """ + Args: + body (CancelReplaceMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ValidateRiskResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceMultiLegOrderRequest, +) -> ValidateRiskResponse | None: + """ + Args: + body (CancelReplaceMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ValidateRiskResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceMultiLegOrderRequest, +) -> Response[ValidateRiskResponse]: + """ + Args: + body (CancelReplaceMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ValidateRiskResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceMultiLegOrderRequest, +) -> ValidateRiskResponse | None: + """ + Args: + body (CancelReplaceMultiLegOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ValidateRiskResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replaceorder.py b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replaceorder.py new file mode 100644 index 000000000..831203bd5 --- /dev/null +++ b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replaceorder.py @@ -0,0 +1,157 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.cancel_replace_order_request import CancelReplaceOrderRequest +from ...models.validate_risk_response import ValidateRiskResponse +from typing import cast + + +def _get_kwargs( + *, + body: CancelReplaceOrderRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/orders/validaterisk/replaceorder", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ValidateRiskResponse | None: + if response.status_code == 200: + response_200 = ValidateRiskResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ValidateRiskResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceOrderRequest, +) -> Response[ValidateRiskResponse]: + """ + Args: + body (CancelReplaceOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ValidateRiskResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceOrderRequest, +) -> ValidateRiskResponse | None: + """ + Args: + body (CancelReplaceOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ValidateRiskResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceOrderRequest, +) -> Response[ValidateRiskResponse]: + """ + Args: + body (CancelReplaceOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ValidateRiskResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CancelReplaceOrderRequest, +) -> ValidateRiskResponse | None: + """ + Args: + body (CancelReplaceOrderRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ValidateRiskResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/portfolio_service/__init__.py b/openapi_project/openapi_package/api/portfolio_service/__init__.py new file mode 100644 index 000000000..dcbab9a7a --- /dev/null +++ b/openapi_project/openapi_package/api/portfolio_service/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/openapi_project/openapi_package/api/portfolio_service/get_portfolio_positions.py b/openapi_project/openapi_package/api/portfolio_service/get_portfolio_positions.py new file mode 100644 index 000000000..2188e0beb --- /dev/null +++ b/openapi_project/openapi_package/api/portfolio_service/get_portfolio_positions.py @@ -0,0 +1,203 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.list_positions_response import ListPositionsResponse +from ...types import UNSET, Unset +from typing import cast + + +def _get_kwargs( + *, + all_: Unset | str = UNSET, + account_id: Unset | str = UNSET, + account_id_and_symbol_account_id: Unset | str = UNSET, + account_id_and_symbol_symbol: Unset | str = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["all"] = all_ + + params["accountId"] = account_id + + params["accountIdAndSymbol.accountId"] = account_id_and_symbol_account_id + + params["accountIdAndSymbol.symbol"] = account_id_and_symbol_symbol + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/portfolio/positions", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ListPositionsResponse | None: + if response.status_code == 200: + response_200 = ListPositionsResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ListPositionsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + all_: Unset | str = UNSET, + account_id: Unset | str = UNSET, + account_id_and_symbol_account_id: Unset | str = UNSET, + account_id_and_symbol_symbol: Unset | str = UNSET, +) -> Response[ListPositionsResponse]: + """ + Args: + all_ (Unset | str): + account_id (Unset | str): + account_id_and_symbol_account_id (Unset | str): + account_id_and_symbol_symbol (Unset | str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListPositionsResponse] + """ + + kwargs = _get_kwargs( + all_=all_, + account_id=account_id, + account_id_and_symbol_account_id=account_id_and_symbol_account_id, + account_id_and_symbol_symbol=account_id_and_symbol_symbol, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + all_: Unset | str = UNSET, + account_id: Unset | str = UNSET, + account_id_and_symbol_account_id: Unset | str = UNSET, + account_id_and_symbol_symbol: Unset | str = UNSET, +) -> ListPositionsResponse | None: + """ + Args: + all_ (Unset | str): + account_id (Unset | str): + account_id_and_symbol_account_id (Unset | str): + account_id_and_symbol_symbol (Unset | str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListPositionsResponse + """ + + return sync_detailed( + client=client, + all_=all_, + account_id=account_id, + account_id_and_symbol_account_id=account_id_and_symbol_account_id, + account_id_and_symbol_symbol=account_id_and_symbol_symbol, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + all_: Unset | str = UNSET, + account_id: Unset | str = UNSET, + account_id_and_symbol_account_id: Unset | str = UNSET, + account_id_and_symbol_symbol: Unset | str = UNSET, +) -> Response[ListPositionsResponse]: + """ + Args: + all_ (Unset | str): + account_id (Unset | str): + account_id_and_symbol_account_id (Unset | str): + account_id_and_symbol_symbol (Unset | str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListPositionsResponse] + """ + + kwargs = _get_kwargs( + all_=all_, + account_id=account_id, + account_id_and_symbol_account_id=account_id_and_symbol_account_id, + account_id_and_symbol_symbol=account_id_and_symbol_symbol, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + all_: Unset | str = UNSET, + account_id: Unset | str = UNSET, + account_id_and_symbol_account_id: Unset | str = UNSET, + account_id_and_symbol_symbol: Unset | str = UNSET, +) -> ListPositionsResponse | None: + """ + Args: + all_ (Unset | str): + account_id (Unset | str): + account_id_and_symbol_account_id (Unset | str): + account_id_and_symbol_symbol (Unset | str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListPositionsResponse + """ + + return ( + await asyncio_detailed( + client=client, + all_=all_, + account_id=account_id, + account_id_and_symbol_account_id=account_id_and_symbol_account_id, + account_id_and_symbol_symbol=account_id_and_symbol_symbol, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/portfolio_service/post_portfolio_analyzepositions.py b/openapi_project/openapi_package/api/portfolio_service/post_portfolio_analyzepositions.py new file mode 100644 index 000000000..6e0ba4369 --- /dev/null +++ b/openapi_project/openapi_package/api/portfolio_service/post_portfolio_analyzepositions.py @@ -0,0 +1,157 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.analyze_positions_request import AnalyzePositionsRequest +from ...models.analyze_positions_response import AnalyzePositionsResponse +from typing import cast + + +def _get_kwargs( + *, + body: AnalyzePositionsRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/portfolio/analyzepositions", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AnalyzePositionsResponse | None: + if response.status_code == 200: + response_200 = AnalyzePositionsResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AnalyzePositionsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: AnalyzePositionsRequest, +) -> Response[AnalyzePositionsResponse]: + """ + Args: + body (AnalyzePositionsRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AnalyzePositionsResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: AnalyzePositionsRequest, +) -> AnalyzePositionsResponse | None: + """ + Args: + body (AnalyzePositionsRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AnalyzePositionsResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: AnalyzePositionsRequest, +) -> Response[AnalyzePositionsResponse]: + """ + Args: + body (AnalyzePositionsRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AnalyzePositionsResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: AnalyzePositionsRequest, +) -> AnalyzePositionsResponse | None: + """ + Args: + body (AnalyzePositionsRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AnalyzePositionsResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/portfolio_service/post_portfolio_calculatemargins.py b/openapi_project/openapi_package/api/portfolio_service/post_portfolio_calculatemargins.py new file mode 100644 index 000000000..7f08dfec3 --- /dev/null +++ b/openapi_project/openapi_package/api/portfolio_service/post_portfolio_calculatemargins.py @@ -0,0 +1,157 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.calculate_margin_request import CalculateMarginRequest +from ...models.calculate_margin_response import CalculateMarginResponse +from typing import cast + + +def _get_kwargs( + *, + body: CalculateMarginRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/portfolio/calculatemargins", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CalculateMarginResponse | None: + if response.status_code == 200: + response_200 = CalculateMarginResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CalculateMarginResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CalculateMarginRequest, +) -> Response[CalculateMarginResponse]: + """ + Args: + body (CalculateMarginRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CalculateMarginResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CalculateMarginRequest, +) -> CalculateMarginResponse | None: + """ + Args: + body (CalculateMarginRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CalculateMarginResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CalculateMarginRequest, +) -> Response[CalculateMarginResponse]: + """ + Args: + body (CalculateMarginRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CalculateMarginResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CalculateMarginRequest, +) -> CalculateMarginResponse | None: + """ + Args: + body (CalculateMarginRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CalculateMarginResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/portfolio_service/post_portfolio_riskradar.py b/openapi_project/openapi_package/api/portfolio_service/post_portfolio_riskradar.py new file mode 100644 index 000000000..33fc1e5ce --- /dev/null +++ b/openapi_project/openapi_package/api/portfolio_service/post_portfolio_riskradar.py @@ -0,0 +1,157 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.risk_radar_request import RiskRadarRequest +from ...models.risk_radar_response import RiskRadarResponse +from typing import cast + + +def _get_kwargs( + *, + body: RiskRadarRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/portfolio/riskradar", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> RiskRadarResponse | None: + if response.status_code == 200: + response_200 = RiskRadarResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[RiskRadarResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: RiskRadarRequest, +) -> Response[RiskRadarResponse]: + """ + Args: + body (RiskRadarRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[RiskRadarResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: RiskRadarRequest, +) -> RiskRadarResponse | None: + """ + Args: + body (RiskRadarRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + RiskRadarResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: RiskRadarRequest, +) -> Response[RiskRadarResponse]: + """ + Args: + body (RiskRadarRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[RiskRadarResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: RiskRadarRequest, +) -> RiskRadarResponse | None: + """ + Args: + body (RiskRadarRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + RiskRadarResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/security_service/__init__.py b/openapi_project/openapi_package/api/security_service/__init__.py new file mode 100644 index 000000000..dcbab9a7a --- /dev/null +++ b/openapi_project/openapi_package/api/security_service/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/openapi_project/openapi_package/api/security_service/get_securities_exchanges.py b/openapi_project/openapi_package/api/security_service/get_securities_exchanges.py new file mode 100644 index 000000000..05d02833d --- /dev/null +++ b/openapi_project/openapi_package/api/security_service/get_securities_exchanges.py @@ -0,0 +1,125 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.list_exchanges_response import ListExchangesResponse +from typing import cast + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/securities/exchanges", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ListExchangesResponse | None: + if response.status_code == 200: + response_200 = ListExchangesResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ListExchangesResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListExchangesResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListExchangesResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> ListExchangesResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListExchangesResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListExchangesResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListExchangesResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> ListExchangesResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListExchangesResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/security_service/post_securities_easytoborrowsecurities.py b/openapi_project/openapi_package/api/security_service/post_securities_easytoborrowsecurities.py new file mode 100644 index 000000000..5e07308a3 --- /dev/null +++ b/openapi_project/openapi_package/api/security_service/post_securities_easytoborrowsecurities.py @@ -0,0 +1,161 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.list_easy_to_borrow_securities_request import ( + ListEasyToBorrowSecuritiesRequest, +) +from ...models.list_easy_to_borrow_securities_response import ( + ListEasyToBorrowSecuritiesResponse, +) +from typing import cast + + +def _get_kwargs( + *, + body: ListEasyToBorrowSecuritiesRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/securities/easytoborrowsecurities", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ListEasyToBorrowSecuritiesResponse | None: + if response.status_code == 200: + response_200 = ListEasyToBorrowSecuritiesResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ListEasyToBorrowSecuritiesResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: ListEasyToBorrowSecuritiesRequest, +) -> Response[ListEasyToBorrowSecuritiesResponse]: + """ + Args: + body (ListEasyToBorrowSecuritiesRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListEasyToBorrowSecuritiesResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: ListEasyToBorrowSecuritiesRequest, +) -> ListEasyToBorrowSecuritiesResponse | None: + """ + Args: + body (ListEasyToBorrowSecuritiesRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListEasyToBorrowSecuritiesResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: ListEasyToBorrowSecuritiesRequest, +) -> Response[ListEasyToBorrowSecuritiesResponse]: + """ + Args: + body (ListEasyToBorrowSecuritiesRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListEasyToBorrowSecuritiesResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: ListEasyToBorrowSecuritiesRequest, +) -> ListEasyToBorrowSecuritiesResponse | None: + """ + Args: + body (ListEasyToBorrowSecuritiesRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListEasyToBorrowSecuritiesResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/security_service/post_securities_flexoption.py b/openapi_project/openapi_package/api/security_service/post_securities_flexoption.py new file mode 100644 index 000000000..157a8d820 --- /dev/null +++ b/openapi_project/openapi_package/api/security_service/post_securities_flexoption.py @@ -0,0 +1,157 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.create_flex_option_request import CreateFlexOptionRequest +from ...models.create_flex_option_response import CreateFlexOptionResponse +from typing import cast + + +def _get_kwargs( + *, + body: CreateFlexOptionRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/securities/flexoption", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateFlexOptionResponse | None: + if response.status_code == 200: + response_200 = CreateFlexOptionResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateFlexOptionResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateFlexOptionRequest, +) -> Response[CreateFlexOptionResponse]: + """ + Args: + body (CreateFlexOptionRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateFlexOptionResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: CreateFlexOptionRequest, +) -> CreateFlexOptionResponse | None: + """ + Args: + body (CreateFlexOptionRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateFlexOptionResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: CreateFlexOptionRequest, +) -> Response[CreateFlexOptionResponse]: + """ + Args: + body (CreateFlexOptionRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateFlexOptionResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: CreateFlexOptionRequest, +) -> CreateFlexOptionResponse | None: + """ + Args: + body (CreateFlexOptionRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateFlexOptionResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/security_service/post_securities_optionchains.py b/openapi_project/openapi_package/api/security_service/post_securities_optionchains.py new file mode 100644 index 000000000..a8be05b0a --- /dev/null +++ b/openapi_project/openapi_package/api/security_service/post_securities_optionchains.py @@ -0,0 +1,157 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.list_option_chains_repsonse import ListOptionChainsRepsonse +from ...models.list_option_chains_request import ListOptionChainsRequest +from typing import cast + + +def _get_kwargs( + *, + body: ListOptionChainsRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/securities/optionchains", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ListOptionChainsRepsonse | None: + if response.status_code == 200: + response_200 = ListOptionChainsRepsonse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ListOptionChainsRepsonse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: ListOptionChainsRequest, +) -> Response[ListOptionChainsRepsonse]: + """ + Args: + body (ListOptionChainsRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListOptionChainsRepsonse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: ListOptionChainsRequest, +) -> ListOptionChainsRepsonse | None: + """ + Args: + body (ListOptionChainsRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListOptionChainsRepsonse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: ListOptionChainsRequest, +) -> Response[ListOptionChainsRepsonse]: + """ + Args: + body (ListOptionChainsRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListOptionChainsRepsonse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: ListOptionChainsRequest, +) -> ListOptionChainsRepsonse | None: + """ + Args: + body (ListOptionChainsRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListOptionChainsRepsonse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/security_service/post_securities_securities.py b/openapi_project/openapi_package/api/security_service/post_securities_securities.py new file mode 100644 index 000000000..8f41356c1 --- /dev/null +++ b/openapi_project/openapi_package/api/security_service/post_securities_securities.py @@ -0,0 +1,157 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.list_securities_request import ListSecuritiesRequest +from ...models.list_securities_response import ListSecuritiesResponse +from typing import cast + + +def _get_kwargs( + *, + body: ListSecuritiesRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/securities/securities", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ListSecuritiesResponse | None: + if response.status_code == 200: + response_200 = ListSecuritiesResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ListSecuritiesResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: ListSecuritiesRequest, +) -> Response[ListSecuritiesResponse]: + """ + Args: + body (ListSecuritiesRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListSecuritiesResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: ListSecuritiesRequest, +) -> ListSecuritiesResponse | None: + """ + Args: + body (ListSecuritiesRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListSecuritiesResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: ListSecuritiesRequest, +) -> Response[ListSecuritiesResponse]: + """ + Args: + body (ListSecuritiesRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListSecuritiesResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: ListSecuritiesRequest, +) -> ListSecuritiesResponse | None: + """ + Args: + body (ListSecuritiesRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListSecuritiesResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/user_data_service/__init__.py b/openapi_project/openapi_package/api/user_data_service/__init__.py new file mode 100644 index 000000000..dcbab9a7a --- /dev/null +++ b/openapi_project/openapi_package/api/user_data_service/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/openapi_project/openapi_package/api/user_data_service/get_userdata_accounts.py b/openapi_project/openapi_package/api/user_data_service/get_userdata_accounts.py new file mode 100644 index 000000000..af9ed4fd3 --- /dev/null +++ b/openapi_project/openapi_package/api/user_data_service/get_userdata_accounts.py @@ -0,0 +1,125 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.list_accounts_response import ListAccountsResponse +from typing import cast + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/userdata/accounts", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ListAccountsResponse | None: + if response.status_code == 200: + response_200 = ListAccountsResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ListAccountsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListAccountsResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListAccountsResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> ListAccountsResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListAccountsResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListAccountsResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListAccountsResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> ListAccountsResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListAccountsResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/user_data_service/get_userdata_activeuser.py b/openapi_project/openapi_package/api/user_data_service/get_userdata_activeuser.py new file mode 100644 index 000000000..0bc350f89 --- /dev/null +++ b/openapi_project/openapi_package/api/user_data_service/get_userdata_activeuser.py @@ -0,0 +1,125 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.get_active_user_response import GetActiveUserResponse +from typing import cast + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/userdata/activeuser", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> GetActiveUserResponse | None: + if response.status_code == 200: + response_200 = GetActiveUserResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[GetActiveUserResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[GetActiveUserResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetActiveUserResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> GetActiveUserResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetActiveUserResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[GetActiveUserResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetActiveUserResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> GetActiveUserResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetActiveUserResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/user_data_service/get_userdata_affiliatedtradingfirms.py b/openapi_project/openapi_package/api/user_data_service/get_userdata_affiliatedtradingfirms.py new file mode 100644 index 000000000..c8650eacd --- /dev/null +++ b/openapi_project/openapi_package/api/user_data_service/get_userdata_affiliatedtradingfirms.py @@ -0,0 +1,127 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.list_affiliated_trading_firms_response import ( + ListAffiliatedTradingFirmsResponse, +) +from typing import cast + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/userdata/affiliatedtradingfirms", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ListAffiliatedTradingFirmsResponse | None: + if response.status_code == 200: + response_200 = ListAffiliatedTradingFirmsResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ListAffiliatedTradingFirmsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListAffiliatedTradingFirmsResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListAffiliatedTradingFirmsResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> ListAffiliatedTradingFirmsResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListAffiliatedTradingFirmsResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListAffiliatedTradingFirmsResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListAffiliatedTradingFirmsResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> ListAffiliatedTradingFirmsResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListAffiliatedTradingFirmsResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/user_data_service/get_userdata_p2paccounts.py b/openapi_project/openapi_package/api/user_data_service/get_userdata_p2paccounts.py new file mode 100644 index 000000000..e2b47b578 --- /dev/null +++ b/openapi_project/openapi_package/api/user_data_service/get_userdata_p2paccounts.py @@ -0,0 +1,125 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.list_accounts_response import ListAccountsResponse +from typing import cast + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/userdata/p2paccounts", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ListAccountsResponse | None: + if response.status_code == 200: + response_200 = ListAccountsResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ListAccountsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListAccountsResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListAccountsResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> ListAccountsResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListAccountsResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListAccountsResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListAccountsResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> ListAccountsResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListAccountsResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/user_data_service/get_userdata_routes.py b/openapi_project/openapi_package/api/user_data_service/get_userdata_routes.py new file mode 100644 index 000000000..1acd9ac12 --- /dev/null +++ b/openapi_project/openapi_package/api/user_data_service/get_userdata_routes.py @@ -0,0 +1,125 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.list_routes_response import ListRoutesResponse +from typing import cast + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/userdata/routes", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ListRoutesResponse | None: + if response.status_code == 200: + response_200 = ListRoutesResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ListRoutesResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListRoutesResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListRoutesResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> ListRoutesResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListRoutesResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListRoutesResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListRoutesResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> ListRoutesResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListRoutesResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/user_data_service/get_userdata_tradingfirms.py b/openapi_project/openapi_package/api/user_data_service/get_userdata_tradingfirms.py new file mode 100644 index 000000000..c80823d2d --- /dev/null +++ b/openapi_project/openapi_package/api/user_data_service/get_userdata_tradingfirms.py @@ -0,0 +1,125 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.list_trading_firms_response import ListTradingFirmsResponse +from typing import cast + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/userdata/tradingfirms", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ListTradingFirmsResponse | None: + if response.status_code == 200: + response_200 = ListTradingFirmsResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ListTradingFirmsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListTradingFirmsResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListTradingFirmsResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> ListTradingFirmsResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListTradingFirmsResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListTradingFirmsResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListTradingFirmsResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> ListTradingFirmsResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListTradingFirmsResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/utility_service/__init__.py b/openapi_project/openapi_package/api/utility_service/__init__.py new file mode 100644 index 000000000..dcbab9a7a --- /dev/null +++ b/openapi_project/openapi_package/api/utility_service/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/openapi_project/openapi_package/api/utility_service/get_utility_serverinfo.py b/openapi_project/openapi_package/api/utility_service/get_utility_serverinfo.py new file mode 100644 index 000000000..7a85a32fb --- /dev/null +++ b/openapi_project/openapi_package/api/utility_service/get_utility_serverinfo.py @@ -0,0 +1,125 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.get_server_info_response import GetServerInfoResponse +from typing import cast + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/utility/serverinfo", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> GetServerInfoResponse | None: + if response.status_code == 200: + response_200 = GetServerInfoResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[GetServerInfoResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[GetServerInfoResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetServerInfoResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> GetServerInfoResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetServerInfoResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[GetServerInfoResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetServerInfoResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> GetServerInfoResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetServerInfoResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/utility_service/get_utility_servertime.py b/openapi_project/openapi_package/api/utility_service/get_utility_servertime.py new file mode 100644 index 000000000..692a0bcf2 --- /dev/null +++ b/openapi_project/openapi_package/api/utility_service/get_utility_servertime.py @@ -0,0 +1,125 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.get_server_time_response import GetServerTimeResponse +from typing import cast + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/utility/servertime", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> GetServerTimeResponse | None: + if response.status_code == 200: + response_200 = GetServerTimeResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[GetServerTimeResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[GetServerTimeResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetServerTimeResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> GetServerTimeResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetServerTimeResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[GetServerTimeResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetServerTimeResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> GetServerTimeResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetServerTimeResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/openapi_project/openapi_package/api/utility_service/get_utility_tradingholidays.py b/openapi_project/openapi_package/api/utility_service/get_utility_tradingholidays.py new file mode 100644 index 000000000..31d8cc7cf --- /dev/null +++ b/openapi_project/openapi_package/api/utility_service/get_utility_tradingholidays.py @@ -0,0 +1,125 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.get_trading_holidays_response import GetTradingHolidaysResponse +from typing import cast + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/utility/tradingholidays", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> GetTradingHolidaysResponse | None: + if response.status_code == 200: + response_200 = GetTradingHolidaysResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[GetTradingHolidaysResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[GetTradingHolidaysResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetTradingHolidaysResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> GetTradingHolidaysResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetTradingHolidaysResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[GetTradingHolidaysResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetTradingHolidaysResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> GetTradingHolidaysResponse | None: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetTradingHolidaysResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/openapi_project/openapi_package/client.py b/openapi_project/openapi_package/client.py new file mode 100644 index 000000000..eaec5c6e7 --- /dev/null +++ b/openapi_project/openapi_package/client.py @@ -0,0 +1,282 @@ +import ssl +from typing import Any + +from attrs import define, field, evolve +import httpx + + +@define +class Client: + """A class for keeping track of data related to the API + + The following are accepted as keyword arguments and will be used to construct httpx Clients internally: + + ``base_url``: The base URL for the API, all requests are made to a relative path to this URL + + ``cookies``: A dictionary of cookies to be sent with every request + + ``headers``: A dictionary of headers to be sent with every request + + ``timeout``: The maximum amount of a time a request can take. API functions will raise + httpx.TimeoutException if this is exceeded. + + ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, + but can be set to False for testing purposes. + + ``follow_redirects``: Whether or not to follow redirects. Default value is False. + + ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. + + + Attributes: + raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a + status code that was not documented in the source OpenAPI document. Can also be provided as a keyword + argument to the constructor. + """ + + raise_on_unexpected_status: bool = field(default=False, kw_only=True) + _base_url: str = field(alias="base_url") + _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") + _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") + _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: str | bool | ssl.SSLContext = field( + default=True, kw_only=True, alias="verify_ssl" + ) + _follow_redirects: bool = field( + default=False, kw_only=True, alias="follow_redirects" + ) + _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") + _client: httpx.Client | None = field(default=None, init=False) + _async_client: httpx.AsyncClient | None = field(default=None, init=False) + + def with_headers(self, headers: dict[str, str]) -> "Client": + """Get a new client matching this one with additional headers""" + if self._client is not None: + self._client.headers.update(headers) + if self._async_client is not None: + self._async_client.headers.update(headers) + return evolve(self, headers={**self._headers, **headers}) + + def with_cookies(self, cookies: dict[str, str]) -> "Client": + """Get a new client matching this one with additional cookies""" + if self._client is not None: + self._client.cookies.update(cookies) + if self._async_client is not None: + self._async_client.cookies.update(cookies) + return evolve(self, cookies={**self._cookies, **cookies}) + + def with_timeout(self, timeout: httpx.Timeout) -> "Client": + """Get a new client matching this one with a new timeout (in seconds)""" + if self._client is not None: + self._client.timeout = timeout + if self._async_client is not None: + self._async_client.timeout = timeout + return evolve(self, timeout=timeout) + + def set_httpx_client(self, client: httpx.Client) -> "Client": + """Manually set the underlying httpx.Client + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._client = client + return self + + def get_httpx_client(self) -> httpx.Client: + """Get the underlying httpx.Client, constructing a new one if not previously set""" + if self._client is None: + self._client = httpx.Client( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._client + + def __enter__(self) -> "Client": + """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" + self.get_httpx_client().__enter__() + return self + + def __exit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for internal httpx.Client (see httpx docs)""" + self.get_httpx_client().__exit__(*args, **kwargs) + + def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client": + """Manually the underlying httpx.AsyncClient + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._async_client = async_client + return self + + def get_async_httpx_client(self) -> httpx.AsyncClient: + """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" + if self._async_client is None: + self._async_client = httpx.AsyncClient( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._async_client + + async def __aenter__(self) -> "Client": + """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" + await self.get_async_httpx_client().__aenter__() + return self + + async def __aexit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" + await self.get_async_httpx_client().__aexit__(*args, **kwargs) + + +@define +class AuthenticatedClient: + """A Client which has been authenticated for use on secured endpoints + + The following are accepted as keyword arguments and will be used to construct httpx Clients internally: + + ``base_url``: The base URL for the API, all requests are made to a relative path to this URL + + ``cookies``: A dictionary of cookies to be sent with every request + + ``headers``: A dictionary of headers to be sent with every request + + ``timeout``: The maximum amount of a time a request can take. API functions will raise + httpx.TimeoutException if this is exceeded. + + ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, + but can be set to False for testing purposes. + + ``follow_redirects``: Whether or not to follow redirects. Default value is False. + + ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. + + + Attributes: + raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a + status code that was not documented in the source OpenAPI document. Can also be provided as a keyword + argument to the constructor. + token: The token to use for authentication + prefix: The prefix to use for the Authorization header + auth_header_name: The name of the Authorization header + """ + + raise_on_unexpected_status: bool = field(default=False, kw_only=True) + _base_url: str = field(alias="base_url") + _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") + _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") + _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: str | bool | ssl.SSLContext = field( + default=True, kw_only=True, alias="verify_ssl" + ) + _follow_redirects: bool = field( + default=False, kw_only=True, alias="follow_redirects" + ) + _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") + _client: httpx.Client | None = field(default=None, init=False) + _async_client: httpx.AsyncClient | None = field(default=None, init=False) + + token: str + prefix: str = "Bearer" + auth_header_name: str = "Authorization" + + def with_headers(self, headers: dict[str, str]) -> "AuthenticatedClient": + """Get a new client matching this one with additional headers""" + if self._client is not None: + self._client.headers.update(headers) + if self._async_client is not None: + self._async_client.headers.update(headers) + return evolve(self, headers={**self._headers, **headers}) + + def with_cookies(self, cookies: dict[str, str]) -> "AuthenticatedClient": + """Get a new client matching this one with additional cookies""" + if self._client is not None: + self._client.cookies.update(cookies) + if self._async_client is not None: + self._async_client.cookies.update(cookies) + return evolve(self, cookies={**self._cookies, **cookies}) + + def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient": + """Get a new client matching this one with a new timeout (in seconds)""" + if self._client is not None: + self._client.timeout = timeout + if self._async_client is not None: + self._async_client.timeout = timeout + return evolve(self, timeout=timeout) + + def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient": + """Manually set the underlying httpx.Client + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._client = client + return self + + def get_httpx_client(self) -> httpx.Client: + """Get the underlying httpx.Client, constructing a new one if not previously set""" + if self._client is None: + self._headers[self.auth_header_name] = ( + f"{self.prefix} {self.token}" if self.prefix else self.token + ) + self._client = httpx.Client( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._client + + def __enter__(self) -> "AuthenticatedClient": + """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" + self.get_httpx_client().__enter__() + return self + + def __exit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for internal httpx.Client (see httpx docs)""" + self.get_httpx_client().__exit__(*args, **kwargs) + + def set_async_httpx_client( + self, async_client: httpx.AsyncClient + ) -> "AuthenticatedClient": + """Manually the underlying httpx.AsyncClient + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._async_client = async_client + return self + + def get_async_httpx_client(self) -> httpx.AsyncClient: + """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" + if self._async_client is None: + self._headers[self.auth_header_name] = ( + f"{self.prefix} {self.token}" if self.prefix else self.token + ) + self._async_client = httpx.AsyncClient( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._async_client + + async def __aenter__(self) -> "AuthenticatedClient": + """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" + await self.get_async_httpx_client().__aenter__() + return self + + async def __aexit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" + await self.get_async_httpx_client().__aexit__(*args, **kwargs) diff --git a/openapi_project/openapi_package/errors.py b/openapi_project/openapi_package/errors.py new file mode 100644 index 000000000..9bf275435 --- /dev/null +++ b/openapi_project/openapi_package/errors.py @@ -0,0 +1,16 @@ +"""Contains shared errors types that can be raised from API functions""" + + +class UnexpectedStatus(Exception): + """Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True""" + + def __init__(self, status_code: int, content: bytes): + self.status_code = status_code + self.content = content + + super().__init__( + f"Unexpected status code: {status_code}\n\nResponse content:\n{content.decode(errors='ignore')}" + ) + + +__all__ = ["UnexpectedStatus"] diff --git a/openapi_project/openapi_package/models/__init__.py b/openapi_project/openapi_package/models/__init__.py new file mode 100644 index 000000000..fb15fd046 --- /dev/null +++ b/openapi_project/openapi_package/models/__init__.py @@ -0,0 +1,547 @@ +"""Contains all the data models used in inputs/outputs""" + +from .account import Account +from .account_script import AccountScript +from .account_status import AccountStatus +from .account_type import AccountType +from .analyze_position_item import AnalyzePositionItem +from .analyze_positions_request import AnalyzePositionsRequest +from .analyze_positions_response import AnalyzePositionsResponse +from .any_model import AnyModel +from .calculate_margin_request import CalculateMarginRequest +from .calculate_margin_request_position import CalculateMarginRequestPosition +from .calculate_margin_request_position_list import CalculateMarginRequestPositionList +from .calculate_margin_response import CalculateMarginResponse +from .cancel_order_request import CancelOrderRequest +from .cancel_order_request_optional_data import CancelOrderRequestOptionalData +from .cancel_order_response import CancelOrderResponse +from .cancel_replace_multi_leg_order_request import CancelReplaceMultiLegOrderRequest +from .cancel_replace_multi_leg_order_request_algo import ( + CancelReplaceMultiLegOrderRequestAlgo, +) +from .cancel_replace_multi_leg_order_request_market_condition import ( + CancelReplaceMultiLegOrderRequestMarketCondition, +) +from .cancel_replace_multi_leg_order_request_optional_data import ( + CancelReplaceMultiLegOrderRequestOptionalData, +) +from .cancel_replace_multi_leg_order_response import CancelReplaceMultiLegOrderResponse +from .cancel_replace_order_request import CancelReplaceOrderRequest +from .cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo +from .cancel_replace_order_request_market_condition import ( + CancelReplaceOrderRequestMarketCondition, +) +from .cancel_replace_order_request_optional_data import ( + CancelReplaceOrderRequestOptionalData, +) +from .cancel_replace_order_response import CancelReplaceOrderResponse +from .capacity_code import CapacityCode +from .claim_type import ClaimType +from .clearing_info import ClearingInfo +from .clearing_range import ClearingRange +from .country import Country +from .create_flex_option_request import CreateFlexOptionRequest +from .create_flex_option_response import CreateFlexOptionResponse +from .create_multi_leg_order_cross_allocation import CreateMultiLegOrderCrossAllocation +from .create_multi_leg_order_cross_allocation_optional_data import ( + CreateMultiLegOrderCrossAllocationOptionalData, +) +from .create_multi_leg_order_cross_request import CreateMultiLegOrderCrossRequest +from .create_multi_leg_order_cross_request_algo import ( + CreateMultiLegOrderCrossRequestAlgo, +) +from .create_multi_leg_order_cross_request_market_condition import ( + CreateMultiLegOrderCrossRequestMarketCondition, +) +from .create_multi_leg_order_cross_request_optional_data import ( + CreateMultiLegOrderCrossRequestOptionalData, +) +from .create_multi_leg_order_cross_response import CreateMultiLegOrderCrossResponse +from .create_multi_leg_order_leg import CreateMultiLegOrderLeg +from .create_multi_leg_order_leg_market_condition import ( + CreateMultiLegOrderLegMarketCondition, +) +from .create_multi_leg_order_leg_optional_data import CreateMultiLegOrderLegOptionalData +from .create_multi_leg_order_request import CreateMultiLegOrderRequest +from .create_multi_leg_order_request_algo import CreateMultiLegOrderRequestAlgo +from .create_multi_leg_order_request_market_condition import ( + CreateMultiLegOrderRequestMarketCondition, +) +from .create_multi_leg_order_request_optional_data import ( + CreateMultiLegOrderRequestOptionalData, +) +from .create_multi_leg_order_response import CreateMultiLegOrderResponse +from .create_order_cross_allocation import CreateOrderCrossAllocation +from .create_order_cross_allocation_optional_data import ( + CreateOrderCrossAllocationOptionalData, +) +from .create_order_cross_request import CreateOrderCrossRequest +from .create_order_cross_request_algo import CreateOrderCrossRequestAlgo +from .create_order_cross_request_market_condition import ( + CreateOrderCrossRequestMarketCondition, +) +from .create_order_cross_request_optional_data import ( + CreateOrderCrossRequestOptionalData, +) +from .create_order_cross_response import CreateOrderCrossResponse +from .create_order_request import CreateOrderRequest +from .create_order_request_algo import CreateOrderRequestAlgo +from .create_order_request_market_condition import CreateOrderRequestMarketCondition +from .create_order_request_optional_data import CreateOrderRequestOptionalData +from .create_order_response import CreateOrderResponse +from .cross_side_type import CrossSideType +from .cross_type import CrossType +from .crypto import Crypto +from .crypto_aliases import CryptoAliases +from .currency import Currency +from .cxl_rej_response_to import CxlRejResponseTo +from .date import Date +from .easy_to_borrow_security import EasyToBorrowSecurity +from .empty import Empty +from .exchange import Exchange +from .exchange_code import ExchangeCode +from .exec_type import ExecType +from .execution import Execution +from .execution_algo import ExecutionAlgo +from .execution_optional_data import ExecutionOptionalData +from .flex_option import FlexOption +from .flex_option_aliases import FlexOptionAliases +from .flex_settlement_type import FlexSettlementType +from .future import Future +from .future_aliases import FutureAliases +from .future_root import FutureRoot +from .future_root_aliases import FutureRootAliases +from .future_spread import FutureSpread +from .future_spread_aliases import FutureSpreadAliases +from .future_spread_leg import FutureSpreadLeg +from .fx import Fx +from .fx_aliases import FxAliases +from .generic_order import GenericOrder +from .get_active_user_response import GetActiveUserResponse +from .get_server_info_response import GetServerInfoResponse +from .get_server_info_response_system_settings import ( + GetServerInfoResponseSystemSettings, +) +from .get_server_time_response import GetServerTimeResponse +from .get_trading_holidays_response import GetTradingHolidaysResponse +from .header import Header +from .index import Index +from .index_aliases import IndexAliases +from .list_accounts_response import ListAccountsResponse +from .list_affiliated_trading_firms_response import ListAffiliatedTradingFirmsResponse +from .list_easy_to_borrow_securities_request import ListEasyToBorrowSecuritiesRequest +from .list_easy_to_borrow_securities_response import ListEasyToBorrowSecuritiesResponse +from .list_exchanges_response import ListExchangesResponse +from .list_option_chains_repsonse import ListOptionChainsRepsonse +from .list_option_chains_request import ListOptionChainsRequest +from .list_orders_response import ListOrdersResponse +from .list_positions_response import ListPositionsResponse +from .list_routes_response import ListRoutesResponse +from .list_securities_request import ListSecuritiesRequest +from .list_securities_response import ListSecuritiesResponse +from .list_trade_confirms_response import ListTradeConfirmsResponse +from .list_trading_firms_response import ListTradingFirmsResponse +from .login_request import LoginRequest +from .login_response import LoginResponse +from .login_response_system_settings import LoginResponseSystemSettings +from .login_status import LoginStatus +from .margin_data import MarginData +from .margin_data_type import MarginDataType +from .multi_leg_order import MultiLegOrder +from .multi_leg_order_algo import MultiLegOrderAlgo +from .multi_leg_order_cancel_replace_request import MultiLegOrderCancelReplaceRequest +from .multi_leg_order_cancel_replace_request_algo import ( + MultiLegOrderCancelReplaceRequestAlgo, +) +from .multi_leg_order_cancel_replace_request_market_condition import ( + MultiLegOrderCancelReplaceRequestMarketCondition, +) +from .multi_leg_order_cancel_replace_request_optional_data import ( + MultiLegOrderCancelReplaceRequestOptionalData, +) +from .multi_leg_order_cross import MultiLegOrderCross +from .multi_leg_order_cross_algo import MultiLegOrderCrossAlgo +from .multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation +from .multi_leg_order_cross_allocation_optional_data import ( + MultiLegOrderCrossAllocationOptionalData, +) +from .multi_leg_order_cross_market_condition import MultiLegOrderCrossMarketCondition +from .multi_leg_order_cross_optional_data import MultiLegOrderCrossOptionalData +from .multi_leg_order_leg import MultiLegOrderLeg +from .multi_leg_order_leg_market_condition import MultiLegOrderLegMarketCondition +from .multi_leg_order_leg_optional_data import MultiLegOrderLegOptionalData +from .multi_leg_order_market_condition import MultiLegOrderMarketCondition +from .multi_leg_order_optional_data import MultiLegOrderOptionalData +from .multi_leg_reporting_type import MultiLegReportingType +from .numeric_display_format import NumericDisplayFormat +from .option import Option +from .option_aliases import OptionAliases +from .option_chain import OptionChain +from .option_chain_option import OptionChainOption +from .option_chain_option_aliases import OptionChainOptionAliases +from .option_chain_options import OptionChainOptions +from .option_chain_roots import OptionChainRoots +from .option_exercise_style import OptionExerciseStyle +from .option_expiration_style import OptionExpirationStyle +from .option_root import OptionRoot +from .option_root_aliases import OptionRootAliases +from .option_series import OptionSeries +from .option_series_product_type import OptionSeriesProductType +from .option_series_type import OptionSeriesType +from .option_settlement_type import OptionSettlementType +from .ord_status import OrdStatus +from .ord_type import OrdType +from .order import Order +from .order_algo import OrderAlgo +from .order_cancel_reject import OrderCancelReject +from .order_cancel_reject_optional_data import OrderCancelRejectOptionalData +from .order_cancel_replace_request import OrderCancelReplaceRequest +from .order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo +from .order_cancel_replace_request_market_condition import ( + OrderCancelReplaceRequestMarketCondition, +) +from .order_cancel_replace_request_optional_data import ( + OrderCancelReplaceRequestOptionalData, +) +from .order_cancel_request import OrderCancelRequest +from .order_cancel_request_optional_data import OrderCancelRequestOptionalData +from .order_cross import OrderCross +from .order_cross_algo import OrderCrossAlgo +from .order_cross_allocation import OrderCrossAllocation +from .order_cross_allocation_optional_data import OrderCrossAllocationOptionalData +from .order_cross_market_condition import OrderCrossMarketCondition +from .order_cross_optional_data import OrderCrossOptionalData +from .order_delete import OrderDelete +from .order_delete_optional_data import OrderDeleteOptionalData +from .order_instruction import OrderInstruction +from .order_instruction_type import OrderInstructionType +from .order_market_condition import OrderMarketCondition +from .order_optional_data import OrderOptionalData +from .order_type import OrderType +from .order_update import OrderUpdate +from .order_update_algo import OrderUpdateAlgo +from .order_update_event import OrderUpdateEvent +from .order_update_optional_data import OrderUpdateOptionalData +from .origination_type import OriginationType +from .position import Position +from .position_analysis import PositionAnalysis +from .position_effect import PositionEffect +from .position_source import PositionSource +from .position_theo import PositionTheo +from .position_theo_leg import PositionTheoLeg +from .price_type import PriceType +from .product_group import ProductGroup +from .product_sub_group import ProductSubGroup +from .put_call import PutCall +from .risk_calculation_type import RiskCalculationType +from .risk_eval_mode import RiskEvalMode +from .risk_radar_account_group import RiskRadarAccountGroup +from .risk_radar_class_group import RiskRadarClassGroup +from .risk_radar_data import RiskRadarData +from .risk_radar_position import RiskRadarPosition +from .risk_radar_product_group import RiskRadarProductGroup +from .risk_radar_request import RiskRadarRequest +from .risk_radar_request_position import RiskRadarRequestPosition +from .risk_radar_request_position_list import RiskRadarRequestPositionList +from .risk_radar_response import RiskRadarResponse +from .risk_radar_scenario_order import RiskRadarScenarioOrder +from .risk_reject import RiskReject +from .risk_reject_type import RiskRejectType +from .route import Route +from .route_applicability import RouteApplicability +from .route_property import RouteProperty +from .route_property_type import RoutePropertyType +from .route_type import RouteType +from .routing_session_group import RoutingSessionGroup +from .routing_session_group_type import RoutingSessionGroupType +from .scenario import Scenario +from .scenario_leg import ScenarioLeg +from .scenario_position import ScenarioPosition +from .scenario_theo import ScenarioTheo +from .search_order_history_response import SearchOrderHistoryResponse +from .security import Security +from .security_category import SecurityCategory +from .security_type import SecurityType +from .settlement_deliverable_type import SettlementDeliverableType +from .settlement_info import SettlementInfo +from .shock_value import ShockValue +from .shock_value_flags import ShockValueFlags +from .side import Side +from .spread_leg_side import SpreadLegSide +from .spread_leg_type import SpreadLegType +from .status import Status +from .status_code import StatusCode +from .stock import Stock +from .stock_aliases import StockAliases +from .tif import Tif +from .time_of_day import TimeOfDay +from .tims_class_group import TimsClassGroup +from .tims_margin_data import TimsMarginData +from .tims_position_group import TimsPositionGroup +from .tims_product_group import TimsProductGroup +from .trade_confirm import TradeConfirm +from .trading_firm import TradingFirm +from .trading_firm_slim import TradingFirmSlim +from .trading_holiday import TradingHoliday +from .trading_session import TradingSession +from .trading_session_group import TradingSessionGroup +from .user import User +from .user_location import UserLocation +from .user_permission import UserPermission +from .user_status import UserStatus +from .user_type import UserType +from .validate_risk_response import ValidateRiskResponse +from .volatility_shock_skew import VolatilityShockSkew +from .volatility_shock_type import VolatilityShockType + +__all__ = ( + "Account", + "AccountScript", + "AccountStatus", + "AccountType", + "AnalyzePositionItem", + "AnalyzePositionsRequest", + "AnalyzePositionsResponse", + "AnyModel", + "CalculateMarginRequest", + "CalculateMarginRequestPosition", + "CalculateMarginRequestPositionList", + "CalculateMarginResponse", + "CancelOrderRequest", + "CancelOrderRequestOptionalData", + "CancelOrderResponse", + "CancelReplaceMultiLegOrderRequest", + "CancelReplaceMultiLegOrderRequestAlgo", + "CancelReplaceMultiLegOrderRequestMarketCondition", + "CancelReplaceMultiLegOrderRequestOptionalData", + "CancelReplaceMultiLegOrderResponse", + "CancelReplaceOrderRequest", + "CancelReplaceOrderRequestAlgo", + "CancelReplaceOrderRequestMarketCondition", + "CancelReplaceOrderRequestOptionalData", + "CancelReplaceOrderResponse", + "CapacityCode", + "ClaimType", + "ClearingInfo", + "ClearingRange", + "Country", + "CreateFlexOptionRequest", + "CreateFlexOptionResponse", + "CreateMultiLegOrderCrossAllocation", + "CreateMultiLegOrderCrossAllocationOptionalData", + "CreateMultiLegOrderCrossRequest", + "CreateMultiLegOrderCrossRequestAlgo", + "CreateMultiLegOrderCrossRequestMarketCondition", + "CreateMultiLegOrderCrossRequestOptionalData", + "CreateMultiLegOrderCrossResponse", + "CreateMultiLegOrderLeg", + "CreateMultiLegOrderLegMarketCondition", + "CreateMultiLegOrderLegOptionalData", + "CreateMultiLegOrderRequest", + "CreateMultiLegOrderRequestAlgo", + "CreateMultiLegOrderRequestMarketCondition", + "CreateMultiLegOrderRequestOptionalData", + "CreateMultiLegOrderResponse", + "CreateOrderCrossAllocation", + "CreateOrderCrossAllocationOptionalData", + "CreateOrderCrossRequest", + "CreateOrderCrossRequestAlgo", + "CreateOrderCrossRequestMarketCondition", + "CreateOrderCrossRequestOptionalData", + "CreateOrderCrossResponse", + "CreateOrderRequest", + "CreateOrderRequestAlgo", + "CreateOrderRequestMarketCondition", + "CreateOrderRequestOptionalData", + "CreateOrderResponse", + "CrossSideType", + "CrossType", + "Crypto", + "CryptoAliases", + "Currency", + "CxlRejResponseTo", + "Date", + "EasyToBorrowSecurity", + "Empty", + "Exchange", + "ExchangeCode", + "ExecType", + "Execution", + "ExecutionAlgo", + "ExecutionOptionalData", + "FlexOption", + "FlexOptionAliases", + "FlexSettlementType", + "Future", + "FutureAliases", + "FutureRoot", + "FutureRootAliases", + "FutureSpread", + "FutureSpreadAliases", + "FutureSpreadLeg", + "Fx", + "FxAliases", + "GenericOrder", + "GetActiveUserResponse", + "GetServerInfoResponse", + "GetServerInfoResponseSystemSettings", + "GetServerTimeResponse", + "GetTradingHolidaysResponse", + "Header", + "Index", + "IndexAliases", + "ListAccountsResponse", + "ListAffiliatedTradingFirmsResponse", + "ListEasyToBorrowSecuritiesRequest", + "ListEasyToBorrowSecuritiesResponse", + "ListExchangesResponse", + "ListOptionChainsRepsonse", + "ListOptionChainsRequest", + "ListOrdersResponse", + "ListPositionsResponse", + "ListRoutesResponse", + "ListSecuritiesRequest", + "ListSecuritiesResponse", + "ListTradeConfirmsResponse", + "ListTradingFirmsResponse", + "LoginRequest", + "LoginResponse", + "LoginResponseSystemSettings", + "LoginStatus", + "MarginData", + "MarginDataType", + "MultiLegOrder", + "MultiLegOrderAlgo", + "MultiLegOrderCancelReplaceRequest", + "MultiLegOrderCancelReplaceRequestAlgo", + "MultiLegOrderCancelReplaceRequestMarketCondition", + "MultiLegOrderCancelReplaceRequestOptionalData", + "MultiLegOrderCross", + "MultiLegOrderCrossAlgo", + "MultiLegOrderCrossAllocation", + "MultiLegOrderCrossAllocationOptionalData", + "MultiLegOrderCrossMarketCondition", + "MultiLegOrderCrossOptionalData", + "MultiLegOrderLeg", + "MultiLegOrderLegMarketCondition", + "MultiLegOrderLegOptionalData", + "MultiLegOrderMarketCondition", + "MultiLegOrderOptionalData", + "MultiLegReportingType", + "NumericDisplayFormat", + "Option", + "OptionAliases", + "OptionChain", + "OptionChainOption", + "OptionChainOptionAliases", + "OptionChainOptions", + "OptionChainRoots", + "OptionExerciseStyle", + "OptionExpirationStyle", + "OptionRoot", + "OptionRootAliases", + "OptionSeries", + "OptionSeriesProductType", + "OptionSeriesType", + "OptionSettlementType", + "Order", + "OrderAlgo", + "OrderCancelReject", + "OrderCancelRejectOptionalData", + "OrderCancelReplaceRequest", + "OrderCancelReplaceRequestAlgo", + "OrderCancelReplaceRequestMarketCondition", + "OrderCancelReplaceRequestOptionalData", + "OrderCancelRequest", + "OrderCancelRequestOptionalData", + "OrderCross", + "OrderCrossAlgo", + "OrderCrossAllocation", + "OrderCrossAllocationOptionalData", + "OrderCrossMarketCondition", + "OrderCrossOptionalData", + "OrderDelete", + "OrderDeleteOptionalData", + "OrderInstruction", + "OrderInstructionType", + "OrderMarketCondition", + "OrderOptionalData", + "OrderType", + "OrderUpdate", + "OrderUpdateAlgo", + "OrderUpdateEvent", + "OrderUpdateOptionalData", + "OrdStatus", + "OrdType", + "OriginationType", + "Position", + "PositionAnalysis", + "PositionEffect", + "PositionSource", + "PositionTheo", + "PositionTheoLeg", + "PriceType", + "ProductGroup", + "ProductSubGroup", + "PutCall", + "RiskCalculationType", + "RiskEvalMode", + "RiskRadarAccountGroup", + "RiskRadarClassGroup", + "RiskRadarData", + "RiskRadarPosition", + "RiskRadarProductGroup", + "RiskRadarRequest", + "RiskRadarRequestPosition", + "RiskRadarRequestPositionList", + "RiskRadarResponse", + "RiskRadarScenarioOrder", + "RiskReject", + "RiskRejectType", + "Route", + "RouteApplicability", + "RouteProperty", + "RoutePropertyType", + "RouteType", + "RoutingSessionGroup", + "RoutingSessionGroupType", + "Scenario", + "ScenarioLeg", + "ScenarioPosition", + "ScenarioTheo", + "SearchOrderHistoryResponse", + "Security", + "SecurityCategory", + "SecurityType", + "SettlementDeliverableType", + "SettlementInfo", + "ShockValue", + "ShockValueFlags", + "Side", + "SpreadLegSide", + "SpreadLegType", + "Status", + "StatusCode", + "Stock", + "StockAliases", + "Tif", + "TimeOfDay", + "TimsClassGroup", + "TimsMarginData", + "TimsPositionGroup", + "TimsProductGroup", + "TradeConfirm", + "TradingFirm", + "TradingFirmSlim", + "TradingHoliday", + "TradingSession", + "TradingSessionGroup", + "User", + "UserLocation", + "UserPermission", + "UserStatus", + "UserType", + "ValidateRiskResponse", + "VolatilityShockSkew", + "VolatilityShockType", +) diff --git a/openapi_project/openapi_package/models/account.py b/openapi_project/openapi_package/models/account.py new file mode 100644 index 000000000..9c083390f --- /dev/null +++ b/openapi_project/openapi_package/models/account.py @@ -0,0 +1,372 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.account_status import AccountStatus +from ..models.account_type import AccountType +from ..models.capacity_code import CapacityCode +from ..models.clearing_range import ClearingRange +from ..models.currency import Currency +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.routing_session_group import RoutingSessionGroup + from ..models.account_script import AccountScript + + +T = TypeVar("T", bound="Account") + + +@_attrs_define +class Account: + """ + Attributes: + id (Unset | int): + billing_code (Unset | str): + cti_code (Unset | str): + currency (Unset | Currency): + equities_capacity (Unset | CapacityCode): + equities_give_up (Unset | str): + equities_mpid (Unset | str): + futures_clearing_account (Unset | str): + futures_clearing_range (Unset | ClearingRange): + futures_cmta (Unset | str): + futures_execution_broker (Unset | str): + name (Unset | str): + occ_actionable_id (Unset | str): + options_clearing_account (Unset | str): + options_clearing_range (Unset | ClearingRange): + options_cmta (Unset | str): + options_efid (Unset | str): + options_give_up (Unset | str): + routing_session_groups (Unset | list['RoutingSessionGroup']): + status (Unset | AccountStatus): + tag1 (Unset | str): + trading_firm_id (Unset | int): + type_ (Unset | AccountType): + created_ts (Unset | str): + optional_data (Unset | str): + position_script (Unset | AccountScript): + buying_power_script (Unset | AccountScript): + clearing_script (Unset | AccountScript): + """ + + id: Unset | int = UNSET + billing_code: Unset | str = UNSET + cti_code: Unset | str = UNSET + currency: Unset | Currency = UNSET + equities_capacity: Unset | CapacityCode = UNSET + equities_give_up: Unset | str = UNSET + equities_mpid: Unset | str = UNSET + futures_clearing_account: Unset | str = UNSET + futures_clearing_range: Unset | ClearingRange = UNSET + futures_cmta: Unset | str = UNSET + futures_execution_broker: Unset | str = UNSET + name: Unset | str = UNSET + occ_actionable_id: Unset | str = UNSET + options_clearing_account: Unset | str = UNSET + options_clearing_range: Unset | ClearingRange = UNSET + options_cmta: Unset | str = UNSET + options_efid: Unset | str = UNSET + options_give_up: Unset | str = UNSET + routing_session_groups: Unset | list["RoutingSessionGroup"] = UNSET + status: Unset | AccountStatus = UNSET + tag1: Unset | str = UNSET + trading_firm_id: Unset | int = UNSET + type_: Unset | AccountType = UNSET + created_ts: Unset | str = UNSET + optional_data: Unset | str = UNSET + position_script: Unset | "AccountScript" = UNSET + buying_power_script: Unset | "AccountScript" = UNSET + clearing_script: Unset | "AccountScript" = UNSET + + def to_dict(self) -> dict[str, Any]: + id = self.id + + billing_code = self.billing_code + + cti_code = self.cti_code + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + equities_capacity: Unset | str = UNSET + if not isinstance(self.equities_capacity, Unset): + equities_capacity = self.equities_capacity.value + + equities_give_up = self.equities_give_up + + equities_mpid = self.equities_mpid + + futures_clearing_account = self.futures_clearing_account + + futures_clearing_range: Unset | str = UNSET + if not isinstance(self.futures_clearing_range, Unset): + futures_clearing_range = self.futures_clearing_range.value + + futures_cmta = self.futures_cmta + + futures_execution_broker = self.futures_execution_broker + + name = self.name + + occ_actionable_id = self.occ_actionable_id + + options_clearing_account = self.options_clearing_account + + options_clearing_range: Unset | str = UNSET + if not isinstance(self.options_clearing_range, Unset): + options_clearing_range = self.options_clearing_range.value + + options_cmta = self.options_cmta + + options_efid = self.options_efid + + options_give_up = self.options_give_up + + routing_session_groups: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.routing_session_groups, Unset): + routing_session_groups = [] + for routing_session_groups_item_data in self.routing_session_groups: + routing_session_groups_item = routing_session_groups_item_data.to_dict() + routing_session_groups.append(routing_session_groups_item) + + status: Unset | str = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + tag1 = self.tag1 + + trading_firm_id = self.trading_firm_id + + type_: Unset | str = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + created_ts = self.created_ts + + optional_data = self.optional_data + + position_script: Unset | dict[str, Any] = UNSET + if not isinstance(self.position_script, Unset): + position_script = self.position_script.to_dict() + + buying_power_script: Unset | dict[str, Any] = UNSET + if not isinstance(self.buying_power_script, Unset): + buying_power_script = self.buying_power_script.to_dict() + + clearing_script: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_script, Unset): + clearing_script = self.clearing_script.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if billing_code is not UNSET: + field_dict["billingCode"] = billing_code + if cti_code is not UNSET: + field_dict["ctiCode"] = cti_code + if currency is not UNSET: + field_dict["currency"] = currency + if equities_capacity is not UNSET: + field_dict["equitiesCapacity"] = equities_capacity + if equities_give_up is not UNSET: + field_dict["equitiesGiveUp"] = equities_give_up + if equities_mpid is not UNSET: + field_dict["equitiesMpid"] = equities_mpid + if futures_clearing_account is not UNSET: + field_dict["futuresClearingAccount"] = futures_clearing_account + if futures_clearing_range is not UNSET: + field_dict["futuresClearingRange"] = futures_clearing_range + if futures_cmta is not UNSET: + field_dict["futuresCmta"] = futures_cmta + if futures_execution_broker is not UNSET: + field_dict["futuresExecutionBroker"] = futures_execution_broker + if name is not UNSET: + field_dict["name"] = name + if occ_actionable_id is not UNSET: + field_dict["occActionableId"] = occ_actionable_id + if options_clearing_account is not UNSET: + field_dict["optionsClearingAccount"] = options_clearing_account + if options_clearing_range is not UNSET: + field_dict["optionsClearingRange"] = options_clearing_range + if options_cmta is not UNSET: + field_dict["optionsCmta"] = options_cmta + if options_efid is not UNSET: + field_dict["optionsEfid"] = options_efid + if options_give_up is not UNSET: + field_dict["optionsGiveUp"] = options_give_up + if routing_session_groups is not UNSET: + field_dict["routingSessionGroups"] = routing_session_groups + if status is not UNSET: + field_dict["status"] = status + if tag1 is not UNSET: + field_dict["tag1"] = tag1 + if trading_firm_id is not UNSET: + field_dict["tradingFirmId"] = trading_firm_id + if type_ is not UNSET: + field_dict["type"] = type_ + if created_ts is not UNSET: + field_dict["createdTs"] = created_ts + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if position_script is not UNSET: + field_dict["positionScript"] = position_script + if buying_power_script is not UNSET: + field_dict["buyingPowerScript"] = buying_power_script + if clearing_script is not UNSET: + field_dict["clearingScript"] = clearing_script + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + billing_code = d.pop("billingCode", UNSET) + + cti_code = d.pop("ctiCode", UNSET) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + _equities_capacity = d.pop("equitiesCapacity", UNSET) + equities_capacity: Unset | CapacityCode + if isinstance(_equities_capacity, Unset): + equities_capacity = UNSET + else: + equities_capacity = CapacityCode(_equities_capacity) + + equities_give_up = d.pop("equitiesGiveUp", UNSET) + + equities_mpid = d.pop("equitiesMpid", UNSET) + + futures_clearing_account = d.pop("futuresClearingAccount", UNSET) + + _futures_clearing_range = d.pop("futuresClearingRange", UNSET) + futures_clearing_range: Unset | ClearingRange + if isinstance(_futures_clearing_range, Unset): + futures_clearing_range = UNSET + else: + futures_clearing_range = ClearingRange(_futures_clearing_range) + + futures_cmta = d.pop("futuresCmta", UNSET) + + futures_execution_broker = d.pop("futuresExecutionBroker", UNSET) + + name = d.pop("name", UNSET) + + occ_actionable_id = d.pop("occActionableId", UNSET) + + options_clearing_account = d.pop("optionsClearingAccount", UNSET) + + _options_clearing_range = d.pop("optionsClearingRange", UNSET) + options_clearing_range: Unset | ClearingRange + if isinstance(_options_clearing_range, Unset): + options_clearing_range = UNSET + else: + options_clearing_range = ClearingRange(_options_clearing_range) + + options_cmta = d.pop("optionsCmta", UNSET) + + options_efid = d.pop("optionsEfid", UNSET) + + options_give_up = d.pop("optionsGiveUp", UNSET) + + routing_session_groups = [] + _routing_session_groups = d.pop("routingSessionGroups", UNSET) + for routing_session_groups_item_data in _routing_session_groups or []: + routing_session_groups_item = RoutingSessionGroup.from_dict( + routing_session_groups_item_data + ) + + routing_session_groups.append(routing_session_groups_item) + + _status = d.pop("status", UNSET) + status: Unset | AccountStatus + if isinstance(_status, Unset): + status = UNSET + else: + status = AccountStatus(_status) + + tag1 = d.pop("tag1", UNSET) + + trading_firm_id = d.pop("tradingFirmId", UNSET) + + _type_ = d.pop("type", UNSET) + type_: Unset | AccountType + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = AccountType(_type_) + + created_ts = d.pop("createdTs", UNSET) + + optional_data = d.pop("optionalData", UNSET) + + _position_script = d.pop("positionScript", UNSET) + position_script: Unset | AccountScript + if isinstance(_position_script, Unset): + position_script = UNSET + else: + position_script = AccountScript.from_dict(_position_script) + + _buying_power_script = d.pop("buyingPowerScript", UNSET) + buying_power_script: Unset | AccountScript + if isinstance(_buying_power_script, Unset): + buying_power_script = UNSET + else: + buying_power_script = AccountScript.from_dict(_buying_power_script) + + _clearing_script = d.pop("clearingScript", UNSET) + clearing_script: Unset | AccountScript + if isinstance(_clearing_script, Unset): + clearing_script = UNSET + else: + clearing_script = AccountScript.from_dict(_clearing_script) + + account = cls( + id=id, + billing_code=billing_code, + cti_code=cti_code, + currency=currency, + equities_capacity=equities_capacity, + equities_give_up=equities_give_up, + equities_mpid=equities_mpid, + futures_clearing_account=futures_clearing_account, + futures_clearing_range=futures_clearing_range, + futures_cmta=futures_cmta, + futures_execution_broker=futures_execution_broker, + name=name, + occ_actionable_id=occ_actionable_id, + options_clearing_account=options_clearing_account, + options_clearing_range=options_clearing_range, + options_cmta=options_cmta, + options_efid=options_efid, + options_give_up=options_give_up, + routing_session_groups=routing_session_groups, + status=status, + tag1=tag1, + trading_firm_id=trading_firm_id, + type_=type_, + created_ts=created_ts, + optional_data=optional_data, + position_script=position_script, + buying_power_script=buying_power_script, + clearing_script=clearing_script, + ) + + return account diff --git a/openapi_project/openapi_package/models/account_script.py b/openapi_project/openapi_package/models/account_script.py new file mode 100644 index 000000000..1dc214c93 --- /dev/null +++ b/openapi_project/openapi_package/models/account_script.py @@ -0,0 +1,53 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="AccountScript") + + +@_attrs_define +class AccountScript: + """ + Attributes: + script_name (Unset | str): + account_name (Unset | str): + """ + + script_name: Unset | str = UNSET + account_name: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + script_name = self.script_name + + account_name = self.account_name + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if script_name is not UNSET: + field_dict["scriptName"] = script_name + if account_name is not UNSET: + field_dict["accountName"] = account_name + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + script_name = d.pop("scriptName", UNSET) + + account_name = d.pop("accountName", UNSET) + + account_script = cls( + script_name=script_name, + account_name=account_name, + ) + + return account_script diff --git a/openapi_project/openapi_package/models/account_status.py b/openapi_project/openapi_package/models/account_status.py new file mode 100644 index 000000000..0a19e6040 --- /dev/null +++ b/openapi_project/openapi_package/models/account_status.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class AccountStatus(str, Enum): + ACCOUNT_STATUS_ACTIVE = "ACCOUNT_STATUS_ACTIVE" + ACCOUNT_STATUS_DELETED = "ACCOUNT_STATUS_DELETED" + ACCOUNT_STATUS_LIQUIDATION = "ACCOUNT_STATUS_LIQUIDATION" + ACCOUNT_STATUS_VIEW_ONLY = "ACCOUNT_STATUS_VIEW_ONLY" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/account_type.py b/openapi_project/openapi_package/models/account_type.py new file mode 100644 index 000000000..65c58c63a --- /dev/null +++ b/openapi_project/openapi_package/models/account_type.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class AccountType(str, Enum): + ACCOUNT_TYPE_CASH = "ACCOUNT_TYPE_CASH" + ACCOUNT_TYPE_INVENTORY = "ACCOUNT_TYPE_INVENTORY" + ACCOUNT_TYPE_MARGIN = "ACCOUNT_TYPE_MARGIN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/analyze_position_item.py b/openapi_project/openapi_package/models/analyze_position_item.py new file mode 100644 index 000000000..23ba27c6b --- /dev/null +++ b/openapi_project/openapi_package/models/analyze_position_item.py @@ -0,0 +1,71 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="AnalyzePositionItem") + + +@_attrs_define +class AnalyzePositionItem: + """ + Attributes: + price (Unset | float): + qty (Unset | int): + symbol (Unset | str): + volatility (Unset | float): + """ + + price: Unset | float = UNSET + qty: Unset | int = UNSET + symbol: Unset | str = UNSET + volatility: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + price = self.price + + qty = self.qty + + symbol = self.symbol + + volatility = self.volatility + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if price is not UNSET: + field_dict["price"] = price + if qty is not UNSET: + field_dict["qty"] = qty + if symbol is not UNSET: + field_dict["symbol"] = symbol + if volatility is not UNSET: + field_dict["volatility"] = volatility + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + price = d.pop("price", UNSET) + + qty = d.pop("qty", UNSET) + + symbol = d.pop("symbol", UNSET) + + volatility = d.pop("volatility", UNSET) + + analyze_position_item = cls( + price=price, + qty=qty, + symbol=symbol, + volatility=volatility, + ) + + return analyze_position_item diff --git a/openapi_project/openapi_package/models/analyze_positions_request.py b/openapi_project/openapi_package/models/analyze_positions_request.py new file mode 100644 index 000000000..b9e103093 --- /dev/null +++ b/openapi_project/openapi_package/models/analyze_positions_request.py @@ -0,0 +1,138 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.analyze_position_item import AnalyzePositionItem + + +T = TypeVar("T", bound="AnalyzePositionsRequest") + + +@_attrs_define +class AnalyzePositionsRequest: + """ + Attributes: + as_of_ts (Unset | str): + evaluate_at_expiry (Unset | bool): + evaluate_at_strike (Unset | bool): + evaluation_as_of (Unset | list[str]): + positions (Unset | list['AnalyzePositionItem']): + price (Unset | float): + underlying_volatility (Unset | list[float]): + historical_volatility_days (Unset | list[int]): + volatility_change (Unset | float): + """ + + as_of_ts: Unset | str = UNSET + evaluate_at_expiry: Unset | bool = UNSET + evaluate_at_strike: Unset | bool = UNSET + evaluation_as_of: Unset | list[str] = UNSET + positions: Unset | list["AnalyzePositionItem"] = UNSET + price: Unset | float = UNSET + underlying_volatility: Unset | list[float] = UNSET + historical_volatility_days: Unset | list[int] = UNSET + volatility_change: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + as_of_ts = self.as_of_ts + + evaluate_at_expiry = self.evaluate_at_expiry + + evaluate_at_strike = self.evaluate_at_strike + + evaluation_as_of: Unset | list[str] = UNSET + if not isinstance(self.evaluation_as_of, Unset): + evaluation_as_of = self.evaluation_as_of + + positions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.positions, Unset): + positions = [] + for positions_item_data in self.positions: + positions_item = positions_item_data.to_dict() + positions.append(positions_item) + + price = self.price + + underlying_volatility: Unset | list[float] = UNSET + if not isinstance(self.underlying_volatility, Unset): + underlying_volatility = self.underlying_volatility + + historical_volatility_days: Unset | list[int] = UNSET + if not isinstance(self.historical_volatility_days, Unset): + historical_volatility_days = self.historical_volatility_days + + volatility_change = self.volatility_change + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if as_of_ts is not UNSET: + field_dict["asOfTs"] = as_of_ts + if evaluate_at_expiry is not UNSET: + field_dict["evaluateAtExpiry"] = evaluate_at_expiry + if evaluate_at_strike is not UNSET: + field_dict["evaluateAtStrike"] = evaluate_at_strike + if evaluation_as_of is not UNSET: + field_dict["evaluationAsOf"] = evaluation_as_of + if positions is not UNSET: + field_dict["positions"] = positions + if price is not UNSET: + field_dict["price"] = price + if underlying_volatility is not UNSET: + field_dict["underlyingVolatility"] = underlying_volatility + if historical_volatility_days is not UNSET: + field_dict["historicalVolatilityDays"] = historical_volatility_days + if volatility_change is not UNSET: + field_dict["volatilityChange"] = volatility_change + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + as_of_ts = d.pop("asOfTs", UNSET) + + evaluate_at_expiry = d.pop("evaluateAtExpiry", UNSET) + + evaluate_at_strike = d.pop("evaluateAtStrike", UNSET) + + evaluation_as_of = cast(list[str], d.pop("evaluationAsOf", UNSET)) + + positions = [] + _positions = d.pop("positions", UNSET) + for positions_item_data in _positions or []: + positions_item = AnalyzePositionItem.from_dict(positions_item_data) + + positions.append(positions_item) + + price = d.pop("price", UNSET) + + underlying_volatility = cast(list[float], d.pop("underlyingVolatility", UNSET)) + + historical_volatility_days = cast( + list[int], d.pop("historicalVolatilityDays", UNSET) + ) + + volatility_change = d.pop("volatilityChange", UNSET) + + analyze_positions_request = cls( + as_of_ts=as_of_ts, + evaluate_at_expiry=evaluate_at_expiry, + evaluate_at_strike=evaluate_at_strike, + evaluation_as_of=evaluation_as_of, + positions=positions, + price=price, + underlying_volatility=underlying_volatility, + historical_volatility_days=historical_volatility_days, + volatility_change=volatility_change, + ) + + return analyze_positions_request diff --git a/openapi_project/openapi_package/models/analyze_positions_response.py b/openapi_project/openapi_package/models/analyze_positions_response.py new file mode 100644 index 000000000..48f11201e --- /dev/null +++ b/openapi_project/openapi_package/models/analyze_positions_response.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.position_analysis import PositionAnalysis + + +T = TypeVar("T", bound="AnalyzePositionsResponse") + + +@_attrs_define +class AnalyzePositionsResponse: + """ + Attributes: + analysis (Unset | PositionAnalysis): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + analysis: Unset | "PositionAnalysis" = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + analysis: Unset | dict[str, Any] = UNSET + if not isinstance(self.analysis, Unset): + analysis = self.analysis.to_dict() + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if analysis is not UNSET: + field_dict["analysis"] = analysis + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _analysis = d.pop("analysis", UNSET) + analysis: Unset | PositionAnalysis + if isinstance(_analysis, Unset): + analysis = UNSET + else: + analysis = PositionAnalysis.from_dict(_analysis) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + analyze_positions_response = cls( + analysis=analysis, + error_message=error_message, + status_code=status_code, + ) + + return analyze_positions_response diff --git a/openapi_project/openapi_package/models/any_model.py b/openapi_project/openapi_package/models/any_model.py new file mode 100644 index 000000000..1d6e8fcbe --- /dev/null +++ b/openapi_project/openapi_package/models/any_model.py @@ -0,0 +1,62 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="AnyModel") + + +@_attrs_define +class AnyModel: + """ + Attributes: + type_ (str): + """ + + type_: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + type_ = self.type_ + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "@type": type_, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + type_ = d.pop("@type") + + any_model = cls( + type_=type_, + ) + + any_model.additional_properties = d + return any_model + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/calculate_margin_request.py b/openapi_project/openapi_package/models/calculate_margin_request.py new file mode 100644 index 000000000..7385d21ec --- /dev/null +++ b/openapi_project/openapi_package/models/calculate_margin_request.py @@ -0,0 +1,126 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.margin_data_type import MarginDataType +from ..models.position_source import PositionSource +from ..models.risk_eval_mode import RiskEvalMode +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.calculate_margin_request_position_list import ( + CalculateMarginRequestPositionList, + ) + + +T = TypeVar("T", bound="CalculateMarginRequest") + + +@_attrs_define +class CalculateMarginRequest: + """ + Attributes: + account_ids (Unset | list[int]): + margin_data_type (Unset | MarginDataType): + positions_by_account_id (Unset | list['CalculateMarginRequestPositionList']): + eval_mode (Unset | RiskEvalMode): + source (Unset | PositionSource): + """ + + account_ids: Unset | list[int] = UNSET + margin_data_type: Unset | MarginDataType = UNSET + positions_by_account_id: Unset | list["CalculateMarginRequestPositionList"] = UNSET + eval_mode: Unset | RiskEvalMode = UNSET + source: Unset | PositionSource = UNSET + + def to_dict(self) -> dict[str, Any]: + account_ids: Unset | list[int] = UNSET + if not isinstance(self.account_ids, Unset): + account_ids = self.account_ids + + margin_data_type: Unset | str = UNSET + if not isinstance(self.margin_data_type, Unset): + margin_data_type = self.margin_data_type.value + + positions_by_account_id: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.positions_by_account_id, Unset): + positions_by_account_id = [] + for positions_by_account_id_item_data in self.positions_by_account_id: + positions_by_account_id_item = ( + positions_by_account_id_item_data.to_dict() + ) + positions_by_account_id.append(positions_by_account_id_item) + + eval_mode: Unset | str = UNSET + if not isinstance(self.eval_mode, Unset): + eval_mode = self.eval_mode.value + + source: Unset | str = UNSET + if not isinstance(self.source, Unset): + source = self.source.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_ids is not UNSET: + field_dict["accountIds"] = account_ids + if margin_data_type is not UNSET: + field_dict["marginDataType"] = margin_data_type + if positions_by_account_id is not UNSET: + field_dict["positionsByAccountId"] = positions_by_account_id + if eval_mode is not UNSET: + field_dict["evalMode"] = eval_mode + if source is not UNSET: + field_dict["source"] = source + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_ids = cast(list[int], d.pop("accountIds", UNSET)) + + _margin_data_type = d.pop("marginDataType", UNSET) + margin_data_type: Unset | MarginDataType + if isinstance(_margin_data_type, Unset): + margin_data_type = UNSET + else: + margin_data_type = MarginDataType(_margin_data_type) + + positions_by_account_id = [] + _positions_by_account_id = d.pop("positionsByAccountId", UNSET) + for positions_by_account_id_item_data in _positions_by_account_id or []: + positions_by_account_id_item = CalculateMarginRequestPositionList.from_dict( + positions_by_account_id_item_data + ) + + positions_by_account_id.append(positions_by_account_id_item) + + _eval_mode = d.pop("evalMode", UNSET) + eval_mode: Unset | RiskEvalMode + if isinstance(_eval_mode, Unset): + eval_mode = UNSET + else: + eval_mode = RiskEvalMode(_eval_mode) + + _source = d.pop("source", UNSET) + source: Unset | PositionSource + if isinstance(_source, Unset): + source = UNSET + else: + source = PositionSource(_source) + + calculate_margin_request = cls( + account_ids=account_ids, + margin_data_type=margin_data_type, + positions_by_account_id=positions_by_account_id, + eval_mode=eval_mode, + source=source, + ) + + return calculate_margin_request diff --git a/openapi_project/openapi_package/models/calculate_margin_request_position.py b/openapi_project/openapi_package/models/calculate_margin_request_position.py new file mode 100644 index 000000000..e798b620c --- /dev/null +++ b/openapi_project/openapi_package/models/calculate_margin_request_position.py @@ -0,0 +1,62 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="CalculateMarginRequestPosition") + + +@_attrs_define +class CalculateMarginRequestPosition: + """ + Attributes: + is_simulated_position (Unset | bool): + qty (Unset | float): + symbol (Unset | str): + """ + + is_simulated_position: Unset | bool = UNSET + qty: Unset | float = UNSET + symbol: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + is_simulated_position = self.is_simulated_position + + qty = self.qty + + symbol = self.symbol + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if is_simulated_position is not UNSET: + field_dict["isSimulatedPosition"] = is_simulated_position + if qty is not UNSET: + field_dict["qty"] = qty + if symbol is not UNSET: + field_dict["symbol"] = symbol + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + is_simulated_position = d.pop("isSimulatedPosition", UNSET) + + qty = d.pop("qty", UNSET) + + symbol = d.pop("symbol", UNSET) + + calculate_margin_request_position = cls( + is_simulated_position=is_simulated_position, + qty=qty, + symbol=symbol, + ) + + return calculate_margin_request_position diff --git a/openapi_project/openapi_package/models/calculate_margin_request_position_list.py b/openapi_project/openapi_package/models/calculate_margin_request_position_list.py new file mode 100644 index 000000000..4f454929b --- /dev/null +++ b/openapi_project/openapi_package/models/calculate_margin_request_position_list.py @@ -0,0 +1,71 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.calculate_margin_request_position import ( + CalculateMarginRequestPosition, + ) + + +T = TypeVar("T", bound="CalculateMarginRequestPositionList") + + +@_attrs_define +class CalculateMarginRequestPositionList: + """ + Attributes: + account_id (Unset | int): + positions (Unset | list['CalculateMarginRequestPosition']): + """ + + account_id: Unset | int = UNSET + positions: Unset | list["CalculateMarginRequestPosition"] = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + positions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.positions, Unset): + positions = [] + for positions_item_data in self.positions: + positions_item = positions_item_data.to_dict() + positions.append(positions_item) + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if positions is not UNSET: + field_dict["positions"] = positions + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + positions = [] + _positions = d.pop("positions", UNSET) + for positions_item_data in _positions or []: + positions_item = CalculateMarginRequestPosition.from_dict( + positions_item_data + ) + + positions.append(positions_item) + + calculate_margin_request_position_list = cls( + account_id=account_id, + positions=positions, + ) + + return calculate_margin_request_position_list diff --git a/openapi_project/openapi_package/models/calculate_margin_response.py b/openapi_project/openapi_package/models/calculate_margin_response.py new file mode 100644 index 000000000..243e0b9b4 --- /dev/null +++ b/openapi_project/openapi_package/models/calculate_margin_response.py @@ -0,0 +1,84 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.margin_data import MarginData + + +T = TypeVar("T", bound="CalculateMarginResponse") + + +@_attrs_define +class CalculateMarginResponse: + """ + Attributes: + margin_data (Unset | list['MarginData']): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + margin_data: Unset | list["MarginData"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + margin_data: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.margin_data, Unset): + margin_data = [] + for margin_data_item_data in self.margin_data: + margin_data_item = margin_data_item_data.to_dict() + margin_data.append(margin_data_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if margin_data is not UNSET: + field_dict["marginData"] = margin_data + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + margin_data = [] + _margin_data = d.pop("marginData", UNSET) + for margin_data_item_data in _margin_data or []: + margin_data_item = MarginData.from_dict(margin_data_item_data) + + margin_data.append(margin_data_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + calculate_margin_response = cls( + margin_data=margin_data, + error_message=error_message, + status_code=status_code, + ) + + return calculate_margin_response diff --git a/openapi_project/openapi_package/models/cancel_order_request.py b/openapi_project/openapi_package/models/cancel_order_request.py new file mode 100644 index 000000000..538f536aa --- /dev/null +++ b/openapi_project/openapi_package/models/cancel_order_request.py @@ -0,0 +1,95 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.order_instruction import OrderInstruction + from ..models.cancel_order_request_optional_data import ( + CancelOrderRequestOptionalData, + ) + + +T = TypeVar("T", bound="CancelOrderRequest") + + +@_attrs_define +class CancelOrderRequest: + """ + Attributes: + cur_ord_id (Unset | str): + instructions (Unset | list['OrderInstruction']): + perm_ord_id (Unset | str): + optional_data (Unset | CancelOrderRequestOptionalData): + """ + + cur_ord_id: Unset | str = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + perm_ord_id: Unset | str = UNSET + optional_data: Unset | "CancelOrderRequestOptionalData" = UNSET + + def to_dict(self) -> dict[str, Any]: + cur_ord_id = self.cur_ord_id + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + perm_ord_id = self.perm_ord_id + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if instructions is not UNSET: + field_dict["instructions"] = instructions + if perm_ord_id is not UNSET: + field_dict["permOrdId"] = perm_ord_id + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + cur_ord_id = d.pop("curOrdId", UNSET) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + perm_ord_id = d.pop("permOrdId", UNSET) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | CancelOrderRequestOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = CancelOrderRequestOptionalData.from_dict(_optional_data) + + cancel_order_request = cls( + cur_ord_id=cur_ord_id, + instructions=instructions, + perm_ord_id=perm_ord_id, + optional_data=optional_data, + ) + + return cancel_order_request diff --git a/openapi_project/openapi_package/models/cancel_order_request_optional_data.py b/openapi_project/openapi_package/models/cancel_order_request_optional_data.py new file mode 100644 index 000000000..bf9506da1 --- /dev/null +++ b/openapi_project/openapi_package/models/cancel_order_request_optional_data.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="CancelOrderRequestOptionalData") + + + +@_attrs_define +class CancelOrderRequestOptionalData: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + cancel_order_request_optional_data = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + cancel_order_request_optional_data.additional_properties = additional_properties + return cancel_order_request_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/cancel_order_response.py b/openapi_project/openapi_package/models/cancel_order_response.py new file mode 100644 index 000000000..5f3530369 --- /dev/null +++ b/openapi_project/openapi_package/models/cancel_order_response.py @@ -0,0 +1,79 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="CancelOrderResponse") + + +@_attrs_define +class CancelOrderResponse: + """ + Attributes: + submit_ts (Unset | str): + req_ord_id (Unset | str): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + submit_ts: Unset | str = UNSET + req_ord_id: Unset | str = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + submit_ts = self.submit_ts + + req_ord_id = self.req_ord_id + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if submit_ts is not UNSET: + field_dict["submitTs"] = submit_ts + if req_ord_id is not UNSET: + field_dict["reqOrdId"] = req_ord_id + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + submit_ts = d.pop("submitTs", UNSET) + + req_ord_id = d.pop("reqOrdId", UNSET) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + cancel_order_response = cls( + submit_ts=submit_ts, + req_ord_id=req_ord_id, + error_message=error_message, + status_code=status_code, + ) + + return cancel_order_response diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py new file mode 100644 index 000000000..274dc2f6c --- /dev/null +++ b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py @@ -0,0 +1,235 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.ord_type import OrdType +from ..models.tif import Tif +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.cancel_replace_multi_leg_order_request_algo import ( + CancelReplaceMultiLegOrderRequestAlgo, + ) + from ..models.cancel_replace_multi_leg_order_request_market_condition import ( + CancelReplaceMultiLegOrderRequestMarketCondition, + ) + from ..models.clearing_info import ClearingInfo + from ..models.cancel_replace_multi_leg_order_request_optional_data import ( + CancelReplaceMultiLegOrderRequestOptionalData, + ) + from ..models.order_instruction import OrderInstruction + + +T = TypeVar("T", bound="CancelReplaceMultiLegOrderRequest") + + +@_attrs_define +class CancelReplaceMultiLegOrderRequest: + """ + Attributes: + aux_price (Unset | float): + clearing_info (Unset | ClearingInfo): + cur_ord_id (Unset | str): + instructions (Unset | list['OrderInstruction']): + ord_type (Unset | OrdType): + perm_ord_id (Unset | str): + price (Unset | float): + qty (Unset | float): + tag (Unset | str): + text (Unset | str): + tif (Unset | Tif): + algo (Unset | CancelReplaceMultiLegOrderRequestAlgo): + market_condition (Unset | CancelReplaceMultiLegOrderRequestMarketCondition): + optional_data (Unset | CancelReplaceMultiLegOrderRequestOptionalData): + """ + + aux_price: Unset | float = UNSET + clearing_info: Unset | "ClearingInfo" = UNSET + cur_ord_id: Unset | str = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + ord_type: Unset | OrdType = UNSET + perm_ord_id: Unset | str = UNSET + price: Unset | float = UNSET + qty: Unset | float = UNSET + tag: Unset | str = UNSET + text: Unset | str = UNSET + tif: Unset | Tif = UNSET + algo: Unset | "CancelReplaceMultiLegOrderRequestAlgo" = UNSET + market_condition: Unset | "CancelReplaceMultiLegOrderRequestMarketCondition" = UNSET + optional_data: Unset | "CancelReplaceMultiLegOrderRequestOptionalData" = UNSET + + def to_dict(self) -> dict[str, Any]: + aux_price = self.aux_price + + clearing_info: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_info, Unset): + clearing_info = self.clearing_info.to_dict() + + cur_ord_id = self.cur_ord_id + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + perm_ord_id = self.perm_ord_id + + price = self.price + + qty = self.qty + + tag = self.tag + + text = self.text + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + algo: Unset | dict[str, Any] = UNSET + if not isinstance(self.algo, Unset): + algo = self.algo.to_dict() + + market_condition: Unset | dict[str, Any] = UNSET + if not isinstance(self.market_condition, Unset): + market_condition = self.market_condition.to_dict() + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if aux_price is not UNSET: + field_dict["auxPrice"] = aux_price + if clearing_info is not UNSET: + field_dict["clearingInfo"] = clearing_info + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if instructions is not UNSET: + field_dict["instructions"] = instructions + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if perm_ord_id is not UNSET: + field_dict["permOrdId"] = perm_ord_id + if price is not UNSET: + field_dict["price"] = price + if qty is not UNSET: + field_dict["qty"] = qty + if tag is not UNSET: + field_dict["tag"] = tag + if text is not UNSET: + field_dict["text"] = text + if tif is not UNSET: + field_dict["tif"] = tif + if algo is not UNSET: + field_dict["algo"] = algo + if market_condition is not UNSET: + field_dict["marketCondition"] = market_condition + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + aux_price = d.pop("auxPrice", UNSET) + + _clearing_info = d.pop("clearingInfo", UNSET) + clearing_info: Unset | ClearingInfo + if isinstance(_clearing_info, Unset): + clearing_info = UNSET + else: + clearing_info = ClearingInfo.from_dict(_clearing_info) + + cur_ord_id = d.pop("curOrdId", UNSET) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + perm_ord_id = d.pop("permOrdId", UNSET) + + price = d.pop("price", UNSET) + + qty = d.pop("qty", UNSET) + + tag = d.pop("tag", UNSET) + + text = d.pop("text", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + _algo = d.pop("algo", UNSET) + algo: Unset | CancelReplaceMultiLegOrderRequestAlgo + if isinstance(_algo, Unset): + algo = UNSET + else: + algo = CancelReplaceMultiLegOrderRequestAlgo.from_dict(_algo) + + _market_condition = d.pop("marketCondition", UNSET) + market_condition: Unset | CancelReplaceMultiLegOrderRequestMarketCondition + if isinstance(_market_condition, Unset): + market_condition = UNSET + else: + market_condition = ( + CancelReplaceMultiLegOrderRequestMarketCondition.from_dict( + _market_condition + ) + ) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | CancelReplaceMultiLegOrderRequestOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = CancelReplaceMultiLegOrderRequestOptionalData.from_dict( + _optional_data + ) + + cancel_replace_multi_leg_order_request = cls( + aux_price=aux_price, + clearing_info=clearing_info, + cur_ord_id=cur_ord_id, + instructions=instructions, + ord_type=ord_type, + perm_ord_id=perm_ord_id, + price=price, + qty=qty, + tag=tag, + text=text, + tif=tif, + algo=algo, + market_condition=market_condition, + optional_data=optional_data, + ) + + return cancel_replace_multi_leg_order_request diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py new file mode 100644 index 000000000..0772e27de --- /dev/null +++ b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="CancelReplaceMultiLegOrderRequestAlgo") + + + +@_attrs_define +class CancelReplaceMultiLegOrderRequestAlgo: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + cancel_replace_multi_leg_order_request_algo = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + cancel_replace_multi_leg_order_request_algo.additional_properties = additional_properties + return cancel_replace_multi_leg_order_request_algo + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py new file mode 100644 index 000000000..427fe102b --- /dev/null +++ b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="CancelReplaceMultiLegOrderRequestMarketCondition") + + + +@_attrs_define +class CancelReplaceMultiLegOrderRequestMarketCondition: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + cancel_replace_multi_leg_order_request_market_condition = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + cancel_replace_multi_leg_order_request_market_condition.additional_properties = additional_properties + return cancel_replace_multi_leg_order_request_market_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py new file mode 100644 index 000000000..72cdd8514 --- /dev/null +++ b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="CancelReplaceMultiLegOrderRequestOptionalData") + + + +@_attrs_define +class CancelReplaceMultiLegOrderRequestOptionalData: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + cancel_replace_multi_leg_order_request_optional_data = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + cancel_replace_multi_leg_order_request_optional_data.additional_properties = additional_properties + return cancel_replace_multi_leg_order_request_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py new file mode 100644 index 000000000..8c1b20d53 --- /dev/null +++ b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py @@ -0,0 +1,79 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="CancelReplaceMultiLegOrderResponse") + + +@_attrs_define +class CancelReplaceMultiLegOrderResponse: + """ + Attributes: + submit_ts (Unset | str): + req_ord_id (Unset | str): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + submit_ts: Unset | str = UNSET + req_ord_id: Unset | str = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + submit_ts = self.submit_ts + + req_ord_id = self.req_ord_id + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if submit_ts is not UNSET: + field_dict["submitTs"] = submit_ts + if req_ord_id is not UNSET: + field_dict["reqOrdId"] = req_ord_id + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + submit_ts = d.pop("submitTs", UNSET) + + req_ord_id = d.pop("reqOrdId", UNSET) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + cancel_replace_multi_leg_order_response = cls( + submit_ts=submit_ts, + req_ord_id=req_ord_id, + error_message=error_message, + status_code=status_code, + ) + + return cancel_replace_multi_leg_order_response diff --git a/openapi_project/openapi_package/models/cancel_replace_order_request.py b/openapi_project/openapi_package/models/cancel_replace_order_request.py new file mode 100644 index 000000000..8daf9594c --- /dev/null +++ b/openapi_project/openapi_package/models/cancel_replace_order_request.py @@ -0,0 +1,213 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.ord_type import OrdType +from ..models.tif import Tif +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.cancel_replace_order_request_market_condition import ( + CancelReplaceOrderRequestMarketCondition, + ) + from ..models.cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo + from ..models.clearing_info import ClearingInfo + from ..models.order_instruction import OrderInstruction + from ..models.cancel_replace_order_request_optional_data import ( + CancelReplaceOrderRequestOptionalData, + ) + + +T = TypeVar("T", bound="CancelReplaceOrderRequest") + + +@_attrs_define +class CancelReplaceOrderRequest: + """ + Attributes: + aux_price (Unset | float): + clearing_info (Unset | ClearingInfo): + cur_ord_id (Unset | str): + instructions (Unset | list['OrderInstruction']): + ord_type (Unset | OrdType): + perm_ord_id (Unset | str): + price (Unset | float): + qty (Unset | float): + tif (Unset | Tif): + algo (Unset | CancelReplaceOrderRequestAlgo): + market_condition (Unset | CancelReplaceOrderRequestMarketCondition): + optional_data (Unset | CancelReplaceOrderRequestOptionalData): + """ + + aux_price: Unset | float = UNSET + clearing_info: Unset | "ClearingInfo" = UNSET + cur_ord_id: Unset | str = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + ord_type: Unset | OrdType = UNSET + perm_ord_id: Unset | str = UNSET + price: Unset | float = UNSET + qty: Unset | float = UNSET + tif: Unset | Tif = UNSET + algo: Unset | "CancelReplaceOrderRequestAlgo" = UNSET + market_condition: Unset | "CancelReplaceOrderRequestMarketCondition" = UNSET + optional_data: Unset | "CancelReplaceOrderRequestOptionalData" = UNSET + + def to_dict(self) -> dict[str, Any]: + aux_price = self.aux_price + + clearing_info: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_info, Unset): + clearing_info = self.clearing_info.to_dict() + + cur_ord_id = self.cur_ord_id + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + perm_ord_id = self.perm_ord_id + + price = self.price + + qty = self.qty + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + algo: Unset | dict[str, Any] = UNSET + if not isinstance(self.algo, Unset): + algo = self.algo.to_dict() + + market_condition: Unset | dict[str, Any] = UNSET + if not isinstance(self.market_condition, Unset): + market_condition = self.market_condition.to_dict() + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if aux_price is not UNSET: + field_dict["auxPrice"] = aux_price + if clearing_info is not UNSET: + field_dict["clearingInfo"] = clearing_info + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if instructions is not UNSET: + field_dict["instructions"] = instructions + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if perm_ord_id is not UNSET: + field_dict["permOrdId"] = perm_ord_id + if price is not UNSET: + field_dict["price"] = price + if qty is not UNSET: + field_dict["qty"] = qty + if tif is not UNSET: + field_dict["tif"] = tif + if algo is not UNSET: + field_dict["algo"] = algo + if market_condition is not UNSET: + field_dict["marketCondition"] = market_condition + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + aux_price = d.pop("auxPrice", UNSET) + + _clearing_info = d.pop("clearingInfo", UNSET) + clearing_info: Unset | ClearingInfo + if isinstance(_clearing_info, Unset): + clearing_info = UNSET + else: + clearing_info = ClearingInfo.from_dict(_clearing_info) + + cur_ord_id = d.pop("curOrdId", UNSET) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + perm_ord_id = d.pop("permOrdId", UNSET) + + price = d.pop("price", UNSET) + + qty = d.pop("qty", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + _algo = d.pop("algo", UNSET) + algo: Unset | CancelReplaceOrderRequestAlgo + if isinstance(_algo, Unset): + algo = UNSET + else: + algo = CancelReplaceOrderRequestAlgo.from_dict(_algo) + + _market_condition = d.pop("marketCondition", UNSET) + market_condition: Unset | CancelReplaceOrderRequestMarketCondition + if isinstance(_market_condition, Unset): + market_condition = UNSET + else: + market_condition = CancelReplaceOrderRequestMarketCondition.from_dict( + _market_condition + ) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | CancelReplaceOrderRequestOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = CancelReplaceOrderRequestOptionalData.from_dict( + _optional_data + ) + + cancel_replace_order_request = cls( + aux_price=aux_price, + clearing_info=clearing_info, + cur_ord_id=cur_ord_id, + instructions=instructions, + ord_type=ord_type, + perm_ord_id=perm_ord_id, + price=price, + qty=qty, + tif=tif, + algo=algo, + market_condition=market_condition, + optional_data=optional_data, + ) + + return cancel_replace_order_request diff --git a/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py b/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py new file mode 100644 index 000000000..a8b354b68 --- /dev/null +++ b/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="CancelReplaceOrderRequestAlgo") + + + +@_attrs_define +class CancelReplaceOrderRequestAlgo: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + cancel_replace_order_request_algo = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + cancel_replace_order_request_algo.additional_properties = additional_properties + return cancel_replace_order_request_algo + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py b/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py new file mode 100644 index 000000000..07413494e --- /dev/null +++ b/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="CancelReplaceOrderRequestMarketCondition") + + + +@_attrs_define +class CancelReplaceOrderRequestMarketCondition: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + cancel_replace_order_request_market_condition = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + cancel_replace_order_request_market_condition.additional_properties = additional_properties + return cancel_replace_order_request_market_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py b/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py new file mode 100644 index 000000000..83f274703 --- /dev/null +++ b/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="CancelReplaceOrderRequestOptionalData") + + + +@_attrs_define +class CancelReplaceOrderRequestOptionalData: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + cancel_replace_order_request_optional_data = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + cancel_replace_order_request_optional_data.additional_properties = additional_properties + return cancel_replace_order_request_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/cancel_replace_order_response.py b/openapi_project/openapi_package/models/cancel_replace_order_response.py new file mode 100644 index 000000000..3770d87b5 --- /dev/null +++ b/openapi_project/openapi_package/models/cancel_replace_order_response.py @@ -0,0 +1,79 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="CancelReplaceOrderResponse") + + +@_attrs_define +class CancelReplaceOrderResponse: + """ + Attributes: + submit_ts (Unset | str): + req_ord_id (Unset | str): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + submit_ts: Unset | str = UNSET + req_ord_id: Unset | str = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + submit_ts = self.submit_ts + + req_ord_id = self.req_ord_id + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if submit_ts is not UNSET: + field_dict["submitTs"] = submit_ts + if req_ord_id is not UNSET: + field_dict["reqOrdId"] = req_ord_id + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + submit_ts = d.pop("submitTs", UNSET) + + req_ord_id = d.pop("reqOrdId", UNSET) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + cancel_replace_order_response = cls( + submit_ts=submit_ts, + req_ord_id=req_ord_id, + error_message=error_message, + status_code=status_code, + ) + + return cancel_replace_order_response diff --git a/openapi_project/openapi_package/models/capacity_code.py b/openapi_project/openapi_package/models/capacity_code.py new file mode 100644 index 000000000..db23b3407 --- /dev/null +++ b/openapi_project/openapi_package/models/capacity_code.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class CapacityCode(str, Enum): + CAPACITY_CODE_AGENT = "CAPACITY_CODE_AGENT" + CAPACITY_CODE_NOT_SET = "CAPACITY_CODE_NOT_SET" + CAPACITY_CODE_PRINCIPAL = "CAPACITY_CODE_PRINCIPAL" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/claim_type.py b/openapi_project/openapi_package/models/claim_type.py new file mode 100644 index 000000000..a4ac678ab --- /dev/null +++ b/openapi_project/openapi_package/models/claim_type.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class ClaimType(str, Enum): + CLAIM_TYPE_FUNCTIONALITY_PERMISSION = "CLAIM_TYPE_FUNCTIONALITY_PERMISSION" + CLAIM_TYPE_SYSOP_PERMISSION = "CLAIM_TYPE_SYSOP_PERMISSION" + CLAIM_TYPE_UI_MODULE_PERMISSION = "CLAIM_TYPE_UI_MODULE_PERMISSION" + CLAIM_TYPE_UNDEFINED = "CLAIM_TYPE_UNDEFINED" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/clearing_info.py b/openapi_project/openapi_package/models/clearing_info.py new file mode 100644 index 000000000..b084174fe --- /dev/null +++ b/openapi_project/openapi_package/models/clearing_info.py @@ -0,0 +1,220 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.capacity_code import CapacityCode +from ..models.clearing_range import ClearingRange +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="ClearingInfo") + + +@_attrs_define +class ClearingInfo: + """ + Attributes: + clearing_optional_data (Unset | str): + cti_code (Unset | str): + efid (Unset | str): + eq_capacity (Unset | CapacityCode): + eq_clearing_account (Unset | str): + eq_give_up (Unset | str): + eq_mpid (Unset | str): + fut_clearing_account (Unset | str): + fut_clearing_range (Unset | ClearingRange): + fut_cmta (Unset | str): + fut_exec_broker (Unset | str): + locate_id (Unset | str): + opt_clearing_account (Unset | str): + opt_clearing_range (Unset | ClearingRange): + opt_cmta (Unset | str): + opt_give_up (Unset | str): + tag1 (Unset | str): + billing_code (Unset | str): + """ + + clearing_optional_data: Unset | str = UNSET + cti_code: Unset | str = UNSET + efid: Unset | str = UNSET + eq_capacity: Unset | CapacityCode = UNSET + eq_clearing_account: Unset | str = UNSET + eq_give_up: Unset | str = UNSET + eq_mpid: Unset | str = UNSET + fut_clearing_account: Unset | str = UNSET + fut_clearing_range: Unset | ClearingRange = UNSET + fut_cmta: Unset | str = UNSET + fut_exec_broker: Unset | str = UNSET + locate_id: Unset | str = UNSET + opt_clearing_account: Unset | str = UNSET + opt_clearing_range: Unset | ClearingRange = UNSET + opt_cmta: Unset | str = UNSET + opt_give_up: Unset | str = UNSET + tag1: Unset | str = UNSET + billing_code: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + clearing_optional_data = self.clearing_optional_data + + cti_code = self.cti_code + + efid = self.efid + + eq_capacity: Unset | str = UNSET + if not isinstance(self.eq_capacity, Unset): + eq_capacity = self.eq_capacity.value + + eq_clearing_account = self.eq_clearing_account + + eq_give_up = self.eq_give_up + + eq_mpid = self.eq_mpid + + fut_clearing_account = self.fut_clearing_account + + fut_clearing_range: Unset | str = UNSET + if not isinstance(self.fut_clearing_range, Unset): + fut_clearing_range = self.fut_clearing_range.value + + fut_cmta = self.fut_cmta + + fut_exec_broker = self.fut_exec_broker + + locate_id = self.locate_id + + opt_clearing_account = self.opt_clearing_account + + opt_clearing_range: Unset | str = UNSET + if not isinstance(self.opt_clearing_range, Unset): + opt_clearing_range = self.opt_clearing_range.value + + opt_cmta = self.opt_cmta + + opt_give_up = self.opt_give_up + + tag1 = self.tag1 + + billing_code = self.billing_code + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if clearing_optional_data is not UNSET: + field_dict["clearingOptionalData"] = clearing_optional_data + if cti_code is not UNSET: + field_dict["ctiCode"] = cti_code + if efid is not UNSET: + field_dict["efid"] = efid + if eq_capacity is not UNSET: + field_dict["eqCapacity"] = eq_capacity + if eq_clearing_account is not UNSET: + field_dict["eqClearingAccount"] = eq_clearing_account + if eq_give_up is not UNSET: + field_dict["eqGiveUp"] = eq_give_up + if eq_mpid is not UNSET: + field_dict["eqMpid"] = eq_mpid + if fut_clearing_account is not UNSET: + field_dict["futClearingAccount"] = fut_clearing_account + if fut_clearing_range is not UNSET: + field_dict["futClearingRange"] = fut_clearing_range + if fut_cmta is not UNSET: + field_dict["futCmta"] = fut_cmta + if fut_exec_broker is not UNSET: + field_dict["futExecBroker"] = fut_exec_broker + if locate_id is not UNSET: + field_dict["locateId"] = locate_id + if opt_clearing_account is not UNSET: + field_dict["optClearingAccount"] = opt_clearing_account + if opt_clearing_range is not UNSET: + field_dict["optClearingRange"] = opt_clearing_range + if opt_cmta is not UNSET: + field_dict["optCmta"] = opt_cmta + if opt_give_up is not UNSET: + field_dict["optGiveUp"] = opt_give_up + if tag1 is not UNSET: + field_dict["tag1"] = tag1 + if billing_code is not UNSET: + field_dict["billingCode"] = billing_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + clearing_optional_data = d.pop("clearingOptionalData", UNSET) + + cti_code = d.pop("ctiCode", UNSET) + + efid = d.pop("efid", UNSET) + + _eq_capacity = d.pop("eqCapacity", UNSET) + eq_capacity: Unset | CapacityCode + if isinstance(_eq_capacity, Unset): + eq_capacity = UNSET + else: + eq_capacity = CapacityCode(_eq_capacity) + + eq_clearing_account = d.pop("eqClearingAccount", UNSET) + + eq_give_up = d.pop("eqGiveUp", UNSET) + + eq_mpid = d.pop("eqMpid", UNSET) + + fut_clearing_account = d.pop("futClearingAccount", UNSET) + + _fut_clearing_range = d.pop("futClearingRange", UNSET) + fut_clearing_range: Unset | ClearingRange + if isinstance(_fut_clearing_range, Unset): + fut_clearing_range = UNSET + else: + fut_clearing_range = ClearingRange(_fut_clearing_range) + + fut_cmta = d.pop("futCmta", UNSET) + + fut_exec_broker = d.pop("futExecBroker", UNSET) + + locate_id = d.pop("locateId", UNSET) + + opt_clearing_account = d.pop("optClearingAccount", UNSET) + + _opt_clearing_range = d.pop("optClearingRange", UNSET) + opt_clearing_range: Unset | ClearingRange + if isinstance(_opt_clearing_range, Unset): + opt_clearing_range = UNSET + else: + opt_clearing_range = ClearingRange(_opt_clearing_range) + + opt_cmta = d.pop("optCmta", UNSET) + + opt_give_up = d.pop("optGiveUp", UNSET) + + tag1 = d.pop("tag1", UNSET) + + billing_code = d.pop("billingCode", UNSET) + + clearing_info = cls( + clearing_optional_data=clearing_optional_data, + cti_code=cti_code, + efid=efid, + eq_capacity=eq_capacity, + eq_clearing_account=eq_clearing_account, + eq_give_up=eq_give_up, + eq_mpid=eq_mpid, + fut_clearing_account=fut_clearing_account, + fut_clearing_range=fut_clearing_range, + fut_cmta=fut_cmta, + fut_exec_broker=fut_exec_broker, + locate_id=locate_id, + opt_clearing_account=opt_clearing_account, + opt_clearing_range=opt_clearing_range, + opt_cmta=opt_cmta, + opt_give_up=opt_give_up, + tag1=tag1, + billing_code=billing_code, + ) + + return clearing_info diff --git a/openapi_project/openapi_package/models/clearing_range.py b/openapi_project/openapi_package/models/clearing_range.py new file mode 100644 index 000000000..a4f20d190 --- /dev/null +++ b/openapi_project/openapi_package/models/clearing_range.py @@ -0,0 +1,21 @@ +from enum import Enum + + +class ClearingRange(str, Enum): + CLEARING_RANGE_AWAY_MARKET_MAKER = "CLEARING_RANGE_AWAY_MARKET_MAKER" + CLEARING_RANGE_BROKER_DEALER = "CLEARING_RANGE_BROKER_DEALER" + CLEARING_RANGE_BROKER_DEALER_CUSTOMER = "CLEARING_RANGE_BROKER_DEALER_CUSTOMER" + CLEARING_RANGE_BROKER_DEALER_FIRM = "CLEARING_RANGE_BROKER_DEALER_FIRM" + CLEARING_RANGE_CUSTOMER = "CLEARING_RANGE_CUSTOMER" + CLEARING_RANGE_FIRM = "CLEARING_RANGE_FIRM" + CLEARING_RANGE_JOINT_BACK_OFFICE = "CLEARING_RANGE_JOINT_BACK_OFFICE" + CLEARING_RANGE_MARKET_MAKER = "CLEARING_RANGE_MARKET_MAKER" + CLEARING_RANGE_NON_TPH_AFFILIATE = "CLEARING_RANGE_NON_TPH_AFFILIATE" + CLEARING_RANGE_NON_TPH_BROKER_DEALER = "CLEARING_RANGE_NON_TPH_BROKER_DEALER" + CLEARING_RANGE_NOTSET = "CLEARING_RANGE_NOTSET" + CLEARING_RANGE_PROFESSIONAL_CUSTOMER = "CLEARING_RANGE_PROFESSIONAL_CUSTOMER" + CLEARING_RANGE_PROPRIETARY_CUSTOMER = "CLEARING_RANGE_PROPRIETARY_CUSTOMER" + CLEARING_RANGE_PROPRIETARY_FIRM = "CLEARING_RANGE_PROPRIETARY_FIRM" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/country.py b/openapi_project/openapi_package/models/country.py new file mode 100644 index 000000000..a29ba6b7a --- /dev/null +++ b/openapi_project/openapi_package/models/country.py @@ -0,0 +1,14 @@ +from enum import Enum + + +class Country(str, Enum): + COUNTRY_CHINA = "COUNTRY_CHINA" + COUNTRY_GERMANY = "COUNTRY_GERMANY" + COUNTRY_INDIA = "COUNTRY_INDIA" + COUNTRY_JAPAN = "COUNTRY_JAPAN" + COUNTRY_UNITED_KINGDOM = "COUNTRY_UNITED_KINGDOM" + COUNTRY_UNITED_STATES = "COUNTRY_UNITED_STATES" + COUNTRY_UNKNOWN = "COUNTRY_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/create_flex_option_request.py b/openapi_project/openapi_package/models/create_flex_option_request.py new file mode 100644 index 000000000..71b35e8d9 --- /dev/null +++ b/openapi_project/openapi_package/models/create_flex_option_request.py @@ -0,0 +1,184 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.flex_settlement_type import FlexSettlementType +from ..models.option_exercise_style import OptionExerciseStyle +from ..models.option_series_product_type import OptionSeriesProductType +from ..models.put_call import PutCall +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.date import Date + + +T = TypeVar("T", bound="CreateFlexOptionRequest") + + +@_attrs_define +class CreateFlexOptionRequest: + """ + Attributes: + root_symbol (Unset | str): + settlement_type (Unset | FlexSettlementType): + expiration_dt (Unset | Date): + strike (Unset | float): + put_call (Unset | PutCall): + product_type (Unset | OptionSeriesProductType): + exercise_style (Unset | OptionExerciseStyle): + creation_dt (Unset | Date): + observation_day (Unset | int): + is_percentage_priced (Unset | bool): + cap_percentage (Unset | float): + """ + + root_symbol: Unset | str = UNSET + settlement_type: Unset | FlexSettlementType = UNSET + expiration_dt: Unset | "Date" = UNSET + strike: Unset | float = UNSET + put_call: Unset | PutCall = UNSET + product_type: Unset | OptionSeriesProductType = UNSET + exercise_style: Unset | OptionExerciseStyle = UNSET + creation_dt: Unset | "Date" = UNSET + observation_day: Unset | int = UNSET + is_percentage_priced: Unset | bool = UNSET + cap_percentage: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + root_symbol = self.root_symbol + + settlement_type: Unset | str = UNSET + if not isinstance(self.settlement_type, Unset): + settlement_type = self.settlement_type.value + + expiration_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.expiration_dt, Unset): + expiration_dt = self.expiration_dt.to_dict() + + strike = self.strike + + put_call: Unset | str = UNSET + if not isinstance(self.put_call, Unset): + put_call = self.put_call.value + + product_type: Unset | str = UNSET + if not isinstance(self.product_type, Unset): + product_type = self.product_type.value + + exercise_style: Unset | str = UNSET + if not isinstance(self.exercise_style, Unset): + exercise_style = self.exercise_style.value + + creation_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.creation_dt, Unset): + creation_dt = self.creation_dt.to_dict() + + observation_day = self.observation_day + + is_percentage_priced = self.is_percentage_priced + + cap_percentage = self.cap_percentage + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if root_symbol is not UNSET: + field_dict["rootSymbol"] = root_symbol + if settlement_type is not UNSET: + field_dict["settlementType"] = settlement_type + if expiration_dt is not UNSET: + field_dict["expirationDt"] = expiration_dt + if strike is not UNSET: + field_dict["strike"] = strike + if put_call is not UNSET: + field_dict["putCall"] = put_call + if product_type is not UNSET: + field_dict["productType"] = product_type + if exercise_style is not UNSET: + field_dict["exerciseStyle"] = exercise_style + if creation_dt is not UNSET: + field_dict["creationDt"] = creation_dt + if observation_day is not UNSET: + field_dict["observationDay"] = observation_day + if is_percentage_priced is not UNSET: + field_dict["isPercentagePriced"] = is_percentage_priced + if cap_percentage is not UNSET: + field_dict["capPercentage"] = cap_percentage + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + root_symbol = d.pop("rootSymbol", UNSET) + + _settlement_type = d.pop("settlementType", UNSET) + settlement_type: Unset | FlexSettlementType + if isinstance(_settlement_type, Unset): + settlement_type = UNSET + else: + settlement_type = FlexSettlementType(_settlement_type) + + _expiration_dt = d.pop("expirationDt", UNSET) + expiration_dt: Unset | Date + if isinstance(_expiration_dt, Unset): + expiration_dt = UNSET + else: + expiration_dt = Date.from_dict(_expiration_dt) + + strike = d.pop("strike", UNSET) + + _put_call = d.pop("putCall", UNSET) + put_call: Unset | PutCall + if isinstance(_put_call, Unset): + put_call = UNSET + else: + put_call = PutCall(_put_call) + + _product_type = d.pop("productType", UNSET) + product_type: Unset | OptionSeriesProductType + if isinstance(_product_type, Unset): + product_type = UNSET + else: + product_type = OptionSeriesProductType(_product_type) + + _exercise_style = d.pop("exerciseStyle", UNSET) + exercise_style: Unset | OptionExerciseStyle + if isinstance(_exercise_style, Unset): + exercise_style = UNSET + else: + exercise_style = OptionExerciseStyle(_exercise_style) + + _creation_dt = d.pop("creationDt", UNSET) + creation_dt: Unset | Date + if isinstance(_creation_dt, Unset): + creation_dt = UNSET + else: + creation_dt = Date.from_dict(_creation_dt) + + observation_day = d.pop("observationDay", UNSET) + + is_percentage_priced = d.pop("isPercentagePriced", UNSET) + + cap_percentage = d.pop("capPercentage", UNSET) + + create_flex_option_request = cls( + root_symbol=root_symbol, + settlement_type=settlement_type, + expiration_dt=expiration_dt, + strike=strike, + put_call=put_call, + product_type=product_type, + exercise_style=exercise_style, + creation_dt=creation_dt, + observation_day=observation_day, + is_percentage_priced=is_percentage_priced, + cap_percentage=cap_percentage, + ) + + return create_flex_option_request diff --git a/openapi_project/openapi_package/models/create_flex_option_response.py b/openapi_project/openapi_package/models/create_flex_option_response.py new file mode 100644 index 000000000..4ac0360ba --- /dev/null +++ b/openapi_project/openapi_package/models/create_flex_option_response.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.flex_option import FlexOption + + +T = TypeVar("T", bound="CreateFlexOptionResponse") + + +@_attrs_define +class CreateFlexOptionResponse: + """ + Attributes: + flex_option (Unset | FlexOption): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + flex_option: Unset | "FlexOption" = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + flex_option: Unset | dict[str, Any] = UNSET + if not isinstance(self.flex_option, Unset): + flex_option = self.flex_option.to_dict() + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if flex_option is not UNSET: + field_dict["flexOption"] = flex_option + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _flex_option = d.pop("flexOption", UNSET) + flex_option: Unset | FlexOption + if isinstance(_flex_option, Unset): + flex_option = UNSET + else: + flex_option = FlexOption.from_dict(_flex_option) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + create_flex_option_response = cls( + flex_option=flex_option, + error_message=error_message, + status_code=status_code, + ) + + return create_flex_option_response diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py new file mode 100644 index 000000000..cf767e7f2 --- /dev/null +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py @@ -0,0 +1,151 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.cross_side_type import CrossSideType +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg + from ..models.clearing_info import ClearingInfo + from ..models.order_instruction import OrderInstruction + from ..models.create_multi_leg_order_cross_allocation_optional_data import ( + CreateMultiLegOrderCrossAllocationOptionalData, + ) + + +T = TypeVar("T", bound="CreateMultiLegOrderCrossAllocation") + + +@_attrs_define +class CreateMultiLegOrderCrossAllocation: + """ + Attributes: + account_id (Unset | int): + clearing_info (Unset | ClearingInfo): + instructions (Unset | list['OrderInstruction']): + legs (Unset | list['CreateMultiLegOrderLeg']): + optional_data (Unset | CreateMultiLegOrderCrossAllocationOptionalData): + qty (Unset | float): + side_type (Unset | CrossSideType): + """ + + account_id: Unset | int = UNSET + clearing_info: Unset | "ClearingInfo" = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + legs: Unset | list["CreateMultiLegOrderLeg"] = UNSET + optional_data: Unset | "CreateMultiLegOrderCrossAllocationOptionalData" = UNSET + qty: Unset | float = UNSET + side_type: Unset | CrossSideType = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + clearing_info: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_info, Unset): + clearing_info = self.clearing_info.to_dict() + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + legs: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.legs, Unset): + legs = [] + for legs_item_data in self.legs: + legs_item = legs_item_data.to_dict() + legs.append(legs_item) + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + qty = self.qty + + side_type: Unset | str = UNSET + if not isinstance(self.side_type, Unset): + side_type = self.side_type.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if clearing_info is not UNSET: + field_dict["clearingInfo"] = clearing_info + if instructions is not UNSET: + field_dict["instructions"] = instructions + if legs is not UNSET: + field_dict["legs"] = legs + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if qty is not UNSET: + field_dict["qty"] = qty + if side_type is not UNSET: + field_dict["sideType"] = side_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + _clearing_info = d.pop("clearingInfo", UNSET) + clearing_info: Unset | ClearingInfo + if isinstance(_clearing_info, Unset): + clearing_info = UNSET + else: + clearing_info = ClearingInfo.from_dict(_clearing_info) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + legs = [] + _legs = d.pop("legs", UNSET) + for legs_item_data in _legs or []: + legs_item = CreateMultiLegOrderLeg.from_dict(legs_item_data) + + legs.append(legs_item) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | CreateMultiLegOrderCrossAllocationOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = CreateMultiLegOrderCrossAllocationOptionalData.from_dict( + _optional_data + ) + + qty = d.pop("qty", UNSET) + + _side_type = d.pop("sideType", UNSET) + side_type: Unset | CrossSideType + if isinstance(_side_type, Unset): + side_type = UNSET + else: + side_type = CrossSideType(_side_type) + + create_multi_leg_order_cross_allocation = cls( + account_id=account_id, + clearing_info=clearing_info, + instructions=instructions, + legs=legs, + optional_data=optional_data, + qty=qty, + side_type=side_type, + ) + + return create_multi_leg_order_cross_allocation diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py new file mode 100644 index 000000000..823613875 --- /dev/null +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="CreateMultiLegOrderCrossAllocationOptionalData") + + + +@_attrs_define +class CreateMultiLegOrderCrossAllocationOptionalData: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_multi_leg_order_cross_allocation_optional_data = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_multi_leg_order_cross_allocation_optional_data.additional_properties = additional_properties + return create_multi_leg_order_cross_allocation_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py new file mode 100644 index 000000000..ef57c25b5 --- /dev/null +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py @@ -0,0 +1,283 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.cross_type import CrossType +from ..models.ord_type import OrdType +from ..models.price_type import PriceType +from ..models.tif import Tif +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.create_multi_leg_order_cross_request_market_condition import ( + CreateMultiLegOrderCrossRequestMarketCondition, + ) + from ..models.create_multi_leg_order_cross_request_optional_data import ( + CreateMultiLegOrderCrossRequestOptionalData, + ) + from ..models.create_multi_leg_order_cross_request_algo import ( + CreateMultiLegOrderCrossRequestAlgo, + ) + from ..models.order_instruction import OrderInstruction + from ..models.create_multi_leg_order_cross_allocation import ( + CreateMultiLegOrderCrossAllocation, + ) + + +T = TypeVar("T", bound="CreateMultiLegOrderCrossRequest") + + +@_attrs_define +class CreateMultiLegOrderCrossRequest: + """ + Attributes: + account_id (Unset | int): + allocations (Unset | list['CreateMultiLegOrderCrossAllocation']): + cross_type (Unset | CrossType): + instructions (Unset | list['OrderInstruction']): + ord_type (Unset | OrdType): + order_flags (Unset | int): + parent_ord_id (Unset | str): + price (Unset | float): + price_type (Unset | PriceType): + qty (Unset | float): + route (Unset | str): + tag (Unset | str): + text (Unset | str): + tif (Unset | Tif): + algo (Unset | CreateMultiLegOrderCrossRequestAlgo): + market_condition (Unset | CreateMultiLegOrderCrossRequestMarketCondition): + optional_data (Unset | CreateMultiLegOrderCrossRequestOptionalData): + """ + + account_id: Unset | int = UNSET + allocations: Unset | list["CreateMultiLegOrderCrossAllocation"] = UNSET + cross_type: Unset | CrossType = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + ord_type: Unset | OrdType = UNSET + order_flags: Unset | int = UNSET + parent_ord_id: Unset | str = UNSET + price: Unset | float = UNSET + price_type: Unset | PriceType = UNSET + qty: Unset | float = UNSET + route: Unset | str = UNSET + tag: Unset | str = UNSET + text: Unset | str = UNSET + tif: Unset | Tif = UNSET + algo: Unset | "CreateMultiLegOrderCrossRequestAlgo" = UNSET + market_condition: Unset | "CreateMultiLegOrderCrossRequestMarketCondition" = UNSET + optional_data: Unset | "CreateMultiLegOrderCrossRequestOptionalData" = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + allocations: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.allocations, Unset): + allocations = [] + for allocations_item_data in self.allocations: + allocations_item = allocations_item_data.to_dict() + allocations.append(allocations_item) + + cross_type: Unset | str = UNSET + if not isinstance(self.cross_type, Unset): + cross_type = self.cross_type.value + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + order_flags = self.order_flags + + parent_ord_id = self.parent_ord_id + + price = self.price + + price_type: Unset | str = UNSET + if not isinstance(self.price_type, Unset): + price_type = self.price_type.value + + qty = self.qty + + route = self.route + + tag = self.tag + + text = self.text + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + algo: Unset | dict[str, Any] = UNSET + if not isinstance(self.algo, Unset): + algo = self.algo.to_dict() + + market_condition: Unset | dict[str, Any] = UNSET + if not isinstance(self.market_condition, Unset): + market_condition = self.market_condition.to_dict() + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if allocations is not UNSET: + field_dict["allocations"] = allocations + if cross_type is not UNSET: + field_dict["crossType"] = cross_type + if instructions is not UNSET: + field_dict["instructions"] = instructions + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if order_flags is not UNSET: + field_dict["orderFlags"] = order_flags + if parent_ord_id is not UNSET: + field_dict["parentOrdId"] = parent_ord_id + if price is not UNSET: + field_dict["price"] = price + if price_type is not UNSET: + field_dict["priceType"] = price_type + if qty is not UNSET: + field_dict["qty"] = qty + if route is not UNSET: + field_dict["route"] = route + if tag is not UNSET: + field_dict["tag"] = tag + if text is not UNSET: + field_dict["text"] = text + if tif is not UNSET: + field_dict["tif"] = tif + if algo is not UNSET: + field_dict["algo"] = algo + if market_condition is not UNSET: + field_dict["marketCondition"] = market_condition + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + allocations = [] + _allocations = d.pop("allocations", UNSET) + for allocations_item_data in _allocations or []: + allocations_item = CreateMultiLegOrderCrossAllocation.from_dict( + allocations_item_data + ) + + allocations.append(allocations_item) + + _cross_type = d.pop("crossType", UNSET) + cross_type: Unset | CrossType + if isinstance(_cross_type, Unset): + cross_type = UNSET + else: + cross_type = CrossType(_cross_type) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + order_flags = d.pop("orderFlags", UNSET) + + parent_ord_id = d.pop("parentOrdId", UNSET) + + price = d.pop("price", UNSET) + + _price_type = d.pop("priceType", UNSET) + price_type: Unset | PriceType + if isinstance(_price_type, Unset): + price_type = UNSET + else: + price_type = PriceType(_price_type) + + qty = d.pop("qty", UNSET) + + route = d.pop("route", UNSET) + + tag = d.pop("tag", UNSET) + + text = d.pop("text", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + _algo = d.pop("algo", UNSET) + algo: Unset | CreateMultiLegOrderCrossRequestAlgo + if isinstance(_algo, Unset): + algo = UNSET + else: + algo = CreateMultiLegOrderCrossRequestAlgo.from_dict(_algo) + + _market_condition = d.pop("marketCondition", UNSET) + market_condition: Unset | CreateMultiLegOrderCrossRequestMarketCondition + if isinstance(_market_condition, Unset): + market_condition = UNSET + else: + market_condition = CreateMultiLegOrderCrossRequestMarketCondition.from_dict( + _market_condition + ) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | CreateMultiLegOrderCrossRequestOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = CreateMultiLegOrderCrossRequestOptionalData.from_dict( + _optional_data + ) + + create_multi_leg_order_cross_request = cls( + account_id=account_id, + allocations=allocations, + cross_type=cross_type, + instructions=instructions, + ord_type=ord_type, + order_flags=order_flags, + parent_ord_id=parent_ord_id, + price=price, + price_type=price_type, + qty=qty, + route=route, + tag=tag, + text=text, + tif=tif, + algo=algo, + market_condition=market_condition, + optional_data=optional_data, + ) + + return create_multi_leg_order_cross_request diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py new file mode 100644 index 000000000..6da95252a --- /dev/null +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="CreateMultiLegOrderCrossRequestAlgo") + + + +@_attrs_define +class CreateMultiLegOrderCrossRequestAlgo: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_multi_leg_order_cross_request_algo = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_multi_leg_order_cross_request_algo.additional_properties = additional_properties + return create_multi_leg_order_cross_request_algo + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py new file mode 100644 index 000000000..20c15d2b6 --- /dev/null +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="CreateMultiLegOrderCrossRequestMarketCondition") + + + +@_attrs_define +class CreateMultiLegOrderCrossRequestMarketCondition: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_multi_leg_order_cross_request_market_condition = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_multi_leg_order_cross_request_market_condition.additional_properties = additional_properties + return create_multi_leg_order_cross_request_market_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py new file mode 100644 index 000000000..f438de801 --- /dev/null +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="CreateMultiLegOrderCrossRequestOptionalData") + + + +@_attrs_define +class CreateMultiLegOrderCrossRequestOptionalData: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_multi_leg_order_cross_request_optional_data = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_multi_leg_order_cross_request_optional_data.additional_properties = additional_properties + return create_multi_leg_order_cross_request_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py new file mode 100644 index 000000000..95470cb1e --- /dev/null +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.multi_leg_order_cross import MultiLegOrderCross + + +T = TypeVar("T", bound="CreateMultiLegOrderCrossResponse") + + +@_attrs_define +class CreateMultiLegOrderCrossResponse: + """ + Attributes: + multi_leg_order_cross (Unset | MultiLegOrderCross): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + multi_leg_order_cross: Unset | "MultiLegOrderCross" = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + multi_leg_order_cross: Unset | dict[str, Any] = UNSET + if not isinstance(self.multi_leg_order_cross, Unset): + multi_leg_order_cross = self.multi_leg_order_cross.to_dict() + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if multi_leg_order_cross is not UNSET: + field_dict["multiLegOrderCross"] = multi_leg_order_cross + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _multi_leg_order_cross = d.pop("multiLegOrderCross", UNSET) + multi_leg_order_cross: Unset | MultiLegOrderCross + if isinstance(_multi_leg_order_cross, Unset): + multi_leg_order_cross = UNSET + else: + multi_leg_order_cross = MultiLegOrderCross.from_dict(_multi_leg_order_cross) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + create_multi_leg_order_cross_response = cls( + multi_leg_order_cross=multi_leg_order_cross, + error_message=error_message, + status_code=status_code, + ) + + return create_multi_leg_order_cross_response diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_leg.py b/openapi_project/openapi_package/models/create_multi_leg_order_leg.py new file mode 100644 index 000000000..cf7ebbf94 --- /dev/null +++ b/openapi_project/openapi_package/models/create_multi_leg_order_leg.py @@ -0,0 +1,156 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.position_effect import PositionEffect +from ..models.side import Side +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.flex_option import FlexOption + from ..models.create_multi_leg_order_leg_optional_data import ( + CreateMultiLegOrderLegOptionalData, + ) + from ..models.create_multi_leg_order_leg_market_condition import ( + CreateMultiLegOrderLegMarketCondition, + ) + + +T = TypeVar("T", bound="CreateMultiLegOrderLeg") + + +@_attrs_define +class CreateMultiLegOrderLeg: + """ + Attributes: + position_effect (Unset | PositionEffect): + price (Unset | float): + ratio (Unset | int): + side (Unset | Side): + symbol (Unset | str): + market_condition (Unset | CreateMultiLegOrderLegMarketCondition): + optional_data (Unset | CreateMultiLegOrderLegOptionalData): + flex_option (Unset | FlexOption): + """ + + position_effect: Unset | PositionEffect = UNSET + price: Unset | float = UNSET + ratio: Unset | int = UNSET + side: Unset | Side = UNSET + symbol: Unset | str = UNSET + market_condition: Unset | "CreateMultiLegOrderLegMarketCondition" = UNSET + optional_data: Unset | "CreateMultiLegOrderLegOptionalData" = UNSET + flex_option: Unset | "FlexOption" = UNSET + + def to_dict(self) -> dict[str, Any]: + position_effect: Unset | str = UNSET + if not isinstance(self.position_effect, Unset): + position_effect = self.position_effect.value + + price = self.price + + ratio = self.ratio + + side: Unset | str = UNSET + if not isinstance(self.side, Unset): + side = self.side.value + + symbol = self.symbol + + market_condition: Unset | dict[str, Any] = UNSET + if not isinstance(self.market_condition, Unset): + market_condition = self.market_condition.to_dict() + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + flex_option: Unset | dict[str, Any] = UNSET + if not isinstance(self.flex_option, Unset): + flex_option = self.flex_option.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if position_effect is not UNSET: + field_dict["positionEffect"] = position_effect + if price is not UNSET: + field_dict["price"] = price + if ratio is not UNSET: + field_dict["ratio"] = ratio + if side is not UNSET: + field_dict["side"] = side + if symbol is not UNSET: + field_dict["symbol"] = symbol + if market_condition is not UNSET: + field_dict["marketCondition"] = market_condition + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if flex_option is not UNSET: + field_dict["flexOption"] = flex_option + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _position_effect = d.pop("positionEffect", UNSET) + position_effect: Unset | PositionEffect + if isinstance(_position_effect, Unset): + position_effect = UNSET + else: + position_effect = PositionEffect(_position_effect) + + price = d.pop("price", UNSET) + + ratio = d.pop("ratio", UNSET) + + _side = d.pop("side", UNSET) + side: Unset | Side + if isinstance(_side, Unset): + side = UNSET + else: + side = Side(_side) + + symbol = d.pop("symbol", UNSET) + + _market_condition = d.pop("marketCondition", UNSET) + market_condition: Unset | CreateMultiLegOrderLegMarketCondition + if isinstance(_market_condition, Unset): + market_condition = UNSET + else: + market_condition = CreateMultiLegOrderLegMarketCondition.from_dict( + _market_condition + ) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | CreateMultiLegOrderLegOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = CreateMultiLegOrderLegOptionalData.from_dict(_optional_data) + + _flex_option = d.pop("flexOption", UNSET) + flex_option: Unset | FlexOption + if isinstance(_flex_option, Unset): + flex_option = UNSET + else: + flex_option = FlexOption.from_dict(_flex_option) + + create_multi_leg_order_leg = cls( + position_effect=position_effect, + price=price, + ratio=ratio, + side=side, + symbol=symbol, + market_condition=market_condition, + optional_data=optional_data, + flex_option=flex_option, + ) + + return create_multi_leg_order_leg diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py b/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py new file mode 100644 index 000000000..d3be82cf0 --- /dev/null +++ b/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="CreateMultiLegOrderLegMarketCondition") + + + +@_attrs_define +class CreateMultiLegOrderLegMarketCondition: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_multi_leg_order_leg_market_condition = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_multi_leg_order_leg_market_condition.additional_properties = additional_properties + return create_multi_leg_order_leg_market_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py b/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py new file mode 100644 index 000000000..d95403b37 --- /dev/null +++ b/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="CreateMultiLegOrderLegOptionalData") + + + +@_attrs_define +class CreateMultiLegOrderLegOptionalData: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_multi_leg_order_leg_optional_data = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_multi_leg_order_leg_optional_data.additional_properties = additional_properties + return create_multi_leg_order_leg_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_request.py b/openapi_project/openapi_package/models/create_multi_leg_order_request.py new file mode 100644 index 000000000..84e4d5467 --- /dev/null +++ b/openapi_project/openapi_package/models/create_multi_leg_order_request.py @@ -0,0 +1,288 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.ord_type import OrdType +from ..models.price_type import PriceType +from ..models.tif import Tif +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.create_multi_leg_order_request_algo import ( + CreateMultiLegOrderRequestAlgo, + ) + from ..models.clearing_info import ClearingInfo + from ..models.create_multi_leg_order_request_optional_data import ( + CreateMultiLegOrderRequestOptionalData, + ) + from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg + from ..models.create_multi_leg_order_request_market_condition import ( + CreateMultiLegOrderRequestMarketCondition, + ) + from ..models.order_instruction import OrderInstruction + + +T = TypeVar("T", bound="CreateMultiLegOrderRequest") + + +@_attrs_define +class CreateMultiLegOrderRequest: + """ + Attributes: + account_id (Unset | int): + aux_price (Unset | float): + clearing_info (Unset | ClearingInfo): + instructions (Unset | list['OrderInstruction']): + legs (Unset | list['CreateMultiLegOrderLeg']): + ord_type (Unset | OrdType): + order_flags (Unset | int): + parent_ord_id (Unset | str): + price (Unset | float): + price_type (Unset | PriceType): + qty (Unset | float): + route (Unset | str): + tag (Unset | str): + text (Unset | str): + tif (Unset | Tif): + algo (Unset | CreateMultiLegOrderRequestAlgo): + market_condition (Unset | CreateMultiLegOrderRequestMarketCondition): + optional_data (Unset | CreateMultiLegOrderRequestOptionalData): + """ + + account_id: Unset | int = UNSET + aux_price: Unset | float = UNSET + clearing_info: Unset | "ClearingInfo" = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + legs: Unset | list["CreateMultiLegOrderLeg"] = UNSET + ord_type: Unset | OrdType = UNSET + order_flags: Unset | int = UNSET + parent_ord_id: Unset | str = UNSET + price: Unset | float = UNSET + price_type: Unset | PriceType = UNSET + qty: Unset | float = UNSET + route: Unset | str = UNSET + tag: Unset | str = UNSET + text: Unset | str = UNSET + tif: Unset | Tif = UNSET + algo: Unset | "CreateMultiLegOrderRequestAlgo" = UNSET + market_condition: Unset | "CreateMultiLegOrderRequestMarketCondition" = UNSET + optional_data: Unset | "CreateMultiLegOrderRequestOptionalData" = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + aux_price = self.aux_price + + clearing_info: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_info, Unset): + clearing_info = self.clearing_info.to_dict() + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + legs: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.legs, Unset): + legs = [] + for legs_item_data in self.legs: + legs_item = legs_item_data.to_dict() + legs.append(legs_item) + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + order_flags = self.order_flags + + parent_ord_id = self.parent_ord_id + + price = self.price + + price_type: Unset | str = UNSET + if not isinstance(self.price_type, Unset): + price_type = self.price_type.value + + qty = self.qty + + route = self.route + + tag = self.tag + + text = self.text + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + algo: Unset | dict[str, Any] = UNSET + if not isinstance(self.algo, Unset): + algo = self.algo.to_dict() + + market_condition: Unset | dict[str, Any] = UNSET + if not isinstance(self.market_condition, Unset): + market_condition = self.market_condition.to_dict() + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if aux_price is not UNSET: + field_dict["auxPrice"] = aux_price + if clearing_info is not UNSET: + field_dict["clearingInfo"] = clearing_info + if instructions is not UNSET: + field_dict["instructions"] = instructions + if legs is not UNSET: + field_dict["legs"] = legs + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if order_flags is not UNSET: + field_dict["orderFlags"] = order_flags + if parent_ord_id is not UNSET: + field_dict["parentOrdId"] = parent_ord_id + if price is not UNSET: + field_dict["price"] = price + if price_type is not UNSET: + field_dict["priceType"] = price_type + if qty is not UNSET: + field_dict["qty"] = qty + if route is not UNSET: + field_dict["route"] = route + if tag is not UNSET: + field_dict["tag"] = tag + if text is not UNSET: + field_dict["text"] = text + if tif is not UNSET: + field_dict["tif"] = tif + if algo is not UNSET: + field_dict["algo"] = algo + if market_condition is not UNSET: + field_dict["marketCondition"] = market_condition + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + aux_price = d.pop("auxPrice", UNSET) + + _clearing_info = d.pop("clearingInfo", UNSET) + clearing_info: Unset | ClearingInfo + if isinstance(_clearing_info, Unset): + clearing_info = UNSET + else: + clearing_info = ClearingInfo.from_dict(_clearing_info) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + legs = [] + _legs = d.pop("legs", UNSET) + for legs_item_data in _legs or []: + legs_item = CreateMultiLegOrderLeg.from_dict(legs_item_data) + + legs.append(legs_item) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + order_flags = d.pop("orderFlags", UNSET) + + parent_ord_id = d.pop("parentOrdId", UNSET) + + price = d.pop("price", UNSET) + + _price_type = d.pop("priceType", UNSET) + price_type: Unset | PriceType + if isinstance(_price_type, Unset): + price_type = UNSET + else: + price_type = PriceType(_price_type) + + qty = d.pop("qty", UNSET) + + route = d.pop("route", UNSET) + + tag = d.pop("tag", UNSET) + + text = d.pop("text", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + _algo = d.pop("algo", UNSET) + algo: Unset | CreateMultiLegOrderRequestAlgo + if isinstance(_algo, Unset): + algo = UNSET + else: + algo = CreateMultiLegOrderRequestAlgo.from_dict(_algo) + + _market_condition = d.pop("marketCondition", UNSET) + market_condition: Unset | CreateMultiLegOrderRequestMarketCondition + if isinstance(_market_condition, Unset): + market_condition = UNSET + else: + market_condition = CreateMultiLegOrderRequestMarketCondition.from_dict( + _market_condition + ) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | CreateMultiLegOrderRequestOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = CreateMultiLegOrderRequestOptionalData.from_dict( + _optional_data + ) + + create_multi_leg_order_request = cls( + account_id=account_id, + aux_price=aux_price, + clearing_info=clearing_info, + instructions=instructions, + legs=legs, + ord_type=ord_type, + order_flags=order_flags, + parent_ord_id=parent_ord_id, + price=price, + price_type=price_type, + qty=qty, + route=route, + tag=tag, + text=text, + tif=tif, + algo=algo, + market_condition=market_condition, + optional_data=optional_data, + ) + + return create_multi_leg_order_request diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py b/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py new file mode 100644 index 000000000..a660746d6 --- /dev/null +++ b/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="CreateMultiLegOrderRequestAlgo") + + + +@_attrs_define +class CreateMultiLegOrderRequestAlgo: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_multi_leg_order_request_algo = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_multi_leg_order_request_algo.additional_properties = additional_properties + return create_multi_leg_order_request_algo + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py b/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py new file mode 100644 index 000000000..0ab061469 --- /dev/null +++ b/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="CreateMultiLegOrderRequestMarketCondition") + + + +@_attrs_define +class CreateMultiLegOrderRequestMarketCondition: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_multi_leg_order_request_market_condition = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_multi_leg_order_request_market_condition.additional_properties = additional_properties + return create_multi_leg_order_request_market_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py b/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py new file mode 100644 index 000000000..8e8a005bf --- /dev/null +++ b/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="CreateMultiLegOrderRequestOptionalData") + + + +@_attrs_define +class CreateMultiLegOrderRequestOptionalData: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_multi_leg_order_request_optional_data = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_multi_leg_order_request_optional_data.additional_properties = additional_properties + return create_multi_leg_order_request_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_response.py b/openapi_project/openapi_package/models/create_multi_leg_order_response.py new file mode 100644 index 000000000..979d62671 --- /dev/null +++ b/openapi_project/openapi_package/models/create_multi_leg_order_response.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.multi_leg_order import MultiLegOrder + + +T = TypeVar("T", bound="CreateMultiLegOrderResponse") + + +@_attrs_define +class CreateMultiLegOrderResponse: + """ + Attributes: + multi_leg_order (Unset | MultiLegOrder): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + multi_leg_order: Unset | "MultiLegOrder" = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + multi_leg_order: Unset | dict[str, Any] = UNSET + if not isinstance(self.multi_leg_order, Unset): + multi_leg_order = self.multi_leg_order.to_dict() + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if multi_leg_order is not UNSET: + field_dict["multiLegOrder"] = multi_leg_order + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _multi_leg_order = d.pop("multiLegOrder", UNSET) + multi_leg_order: Unset | MultiLegOrder + if isinstance(_multi_leg_order, Unset): + multi_leg_order = UNSET + else: + multi_leg_order = MultiLegOrder.from_dict(_multi_leg_order) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + create_multi_leg_order_response = cls( + multi_leg_order=multi_leg_order, + error_message=error_message, + status_code=status_code, + ) + + return create_multi_leg_order_response diff --git a/openapi_project/openapi_package/models/create_order_cross_allocation.py b/openapi_project/openapi_package/models/create_order_cross_allocation.py new file mode 100644 index 000000000..c4a16af6c --- /dev/null +++ b/openapi_project/openapi_package/models/create_order_cross_allocation.py @@ -0,0 +1,165 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.cross_side_type import CrossSideType +from ..models.position_effect import PositionEffect +from ..models.side import Side +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.clearing_info import ClearingInfo + from ..models.order_instruction import OrderInstruction + from ..models.create_order_cross_allocation_optional_data import ( + CreateOrderCrossAllocationOptionalData, + ) + + +T = TypeVar("T", bound="CreateOrderCrossAllocation") + + +@_attrs_define +class CreateOrderCrossAllocation: + """ + Attributes: + account_id (Unset | int): + clearing_info (Unset | ClearingInfo): + instructions (Unset | list['OrderInstruction']): + optional_data (Unset | CreateOrderCrossAllocationOptionalData): + position_effect (Unset | PositionEffect): + qty (Unset | float): + side (Unset | Side): + side_type (Unset | CrossSideType): + """ + + account_id: Unset | int = UNSET + clearing_info: Unset | "ClearingInfo" = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + optional_data: Unset | "CreateOrderCrossAllocationOptionalData" = UNSET + position_effect: Unset | PositionEffect = UNSET + qty: Unset | float = UNSET + side: Unset | Side = UNSET + side_type: Unset | CrossSideType = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + clearing_info: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_info, Unset): + clearing_info = self.clearing_info.to_dict() + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + position_effect: Unset | str = UNSET + if not isinstance(self.position_effect, Unset): + position_effect = self.position_effect.value + + qty = self.qty + + side: Unset | str = UNSET + if not isinstance(self.side, Unset): + side = self.side.value + + side_type: Unset | str = UNSET + if not isinstance(self.side_type, Unset): + side_type = self.side_type.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if clearing_info is not UNSET: + field_dict["clearingInfo"] = clearing_info + if instructions is not UNSET: + field_dict["instructions"] = instructions + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if position_effect is not UNSET: + field_dict["positionEffect"] = position_effect + if qty is not UNSET: + field_dict["qty"] = qty + if side is not UNSET: + field_dict["side"] = side + if side_type is not UNSET: + field_dict["sideType"] = side_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + _clearing_info = d.pop("clearingInfo", UNSET) + clearing_info: Unset | ClearingInfo + if isinstance(_clearing_info, Unset): + clearing_info = UNSET + else: + clearing_info = ClearingInfo.from_dict(_clearing_info) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | CreateOrderCrossAllocationOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = CreateOrderCrossAllocationOptionalData.from_dict( + _optional_data + ) + + _position_effect = d.pop("positionEffect", UNSET) + position_effect: Unset | PositionEffect + if isinstance(_position_effect, Unset): + position_effect = UNSET + else: + position_effect = PositionEffect(_position_effect) + + qty = d.pop("qty", UNSET) + + _side = d.pop("side", UNSET) + side: Unset | Side + if isinstance(_side, Unset): + side = UNSET + else: + side = Side(_side) + + _side_type = d.pop("sideType", UNSET) + side_type: Unset | CrossSideType + if isinstance(_side_type, Unset): + side_type = UNSET + else: + side_type = CrossSideType(_side_type) + + create_order_cross_allocation = cls( + account_id=account_id, + clearing_info=clearing_info, + instructions=instructions, + optional_data=optional_data, + position_effect=position_effect, + qty=qty, + side=side, + side_type=side_type, + ) + + return create_order_cross_allocation diff --git a/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py b/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py new file mode 100644 index 000000000..9abdd3ee9 --- /dev/null +++ b/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="CreateOrderCrossAllocationOptionalData") + + + +@_attrs_define +class CreateOrderCrossAllocationOptionalData: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_order_cross_allocation_optional_data = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_order_cross_allocation_optional_data.additional_properties = additional_properties + return create_order_cross_allocation_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_order_cross_request.py b/openapi_project/openapi_package/models/create_order_cross_request.py new file mode 100644 index 000000000..050cc19aa --- /dev/null +++ b/openapi_project/openapi_package/models/create_order_cross_request.py @@ -0,0 +1,305 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.cross_type import CrossType +from ..models.ord_type import OrdType +from ..models.price_type import PriceType +from ..models.tif import Tif +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.create_order_cross_request_market_condition import ( + CreateOrderCrossRequestMarketCondition, + ) + from ..models.create_order_cross_allocation import CreateOrderCrossAllocation + from ..models.flex_option import FlexOption + from ..models.create_order_cross_request_optional_data import ( + CreateOrderCrossRequestOptionalData, + ) + from ..models.order_instruction import OrderInstruction + from ..models.create_order_cross_request_algo import CreateOrderCrossRequestAlgo + + +T = TypeVar("T", bound="CreateOrderCrossRequest") + + +@_attrs_define +class CreateOrderCrossRequest: + """ + Attributes: + account_id (Unset | int): + allocations (Unset | list['CreateOrderCrossAllocation']): + cross_type (Unset | CrossType): + instructions (Unset | list['OrderInstruction']): + ord_type (Unset | OrdType): + order_flags (Unset | int): + parent_ord_id (Unset | str): + price (Unset | float): + price_type (Unset | PriceType): + qty (Unset | float): + route (Unset | str): + symbol (Unset | str): + tag (Unset | str): + text (Unset | str): + tif (Unset | Tif): + algo (Unset | CreateOrderCrossRequestAlgo): + market_condition (Unset | CreateOrderCrossRequestMarketCondition): + optional_data (Unset | CreateOrderCrossRequestOptionalData): + flex_option (Unset | FlexOption): + """ + + account_id: Unset | int = UNSET + allocations: Unset | list["CreateOrderCrossAllocation"] = UNSET + cross_type: Unset | CrossType = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + ord_type: Unset | OrdType = UNSET + order_flags: Unset | int = UNSET + parent_ord_id: Unset | str = UNSET + price: Unset | float = UNSET + price_type: Unset | PriceType = UNSET + qty: Unset | float = UNSET + route: Unset | str = UNSET + symbol: Unset | str = UNSET + tag: Unset | str = UNSET + text: Unset | str = UNSET + tif: Unset | Tif = UNSET + algo: Unset | "CreateOrderCrossRequestAlgo" = UNSET + market_condition: Unset | "CreateOrderCrossRequestMarketCondition" = UNSET + optional_data: Unset | "CreateOrderCrossRequestOptionalData" = UNSET + flex_option: Unset | "FlexOption" = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + allocations: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.allocations, Unset): + allocations = [] + for allocations_item_data in self.allocations: + allocations_item = allocations_item_data.to_dict() + allocations.append(allocations_item) + + cross_type: Unset | str = UNSET + if not isinstance(self.cross_type, Unset): + cross_type = self.cross_type.value + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + order_flags = self.order_flags + + parent_ord_id = self.parent_ord_id + + price = self.price + + price_type: Unset | str = UNSET + if not isinstance(self.price_type, Unset): + price_type = self.price_type.value + + qty = self.qty + + route = self.route + + symbol = self.symbol + + tag = self.tag + + text = self.text + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + algo: Unset | dict[str, Any] = UNSET + if not isinstance(self.algo, Unset): + algo = self.algo.to_dict() + + market_condition: Unset | dict[str, Any] = UNSET + if not isinstance(self.market_condition, Unset): + market_condition = self.market_condition.to_dict() + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + flex_option: Unset | dict[str, Any] = UNSET + if not isinstance(self.flex_option, Unset): + flex_option = self.flex_option.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if allocations is not UNSET: + field_dict["allocations"] = allocations + if cross_type is not UNSET: + field_dict["crossType"] = cross_type + if instructions is not UNSET: + field_dict["instructions"] = instructions + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if order_flags is not UNSET: + field_dict["orderFlags"] = order_flags + if parent_ord_id is not UNSET: + field_dict["parentOrdId"] = parent_ord_id + if price is not UNSET: + field_dict["price"] = price + if price_type is not UNSET: + field_dict["priceType"] = price_type + if qty is not UNSET: + field_dict["qty"] = qty + if route is not UNSET: + field_dict["route"] = route + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tag is not UNSET: + field_dict["tag"] = tag + if text is not UNSET: + field_dict["text"] = text + if tif is not UNSET: + field_dict["tif"] = tif + if algo is not UNSET: + field_dict["algo"] = algo + if market_condition is not UNSET: + field_dict["marketCondition"] = market_condition + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if flex_option is not UNSET: + field_dict["flexOption"] = flex_option + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + allocations = [] + _allocations = d.pop("allocations", UNSET) + for allocations_item_data in _allocations or []: + allocations_item = CreateOrderCrossAllocation.from_dict( + allocations_item_data + ) + + allocations.append(allocations_item) + + _cross_type = d.pop("crossType", UNSET) + cross_type: Unset | CrossType + if isinstance(_cross_type, Unset): + cross_type = UNSET + else: + cross_type = CrossType(_cross_type) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + order_flags = d.pop("orderFlags", UNSET) + + parent_ord_id = d.pop("parentOrdId", UNSET) + + price = d.pop("price", UNSET) + + _price_type = d.pop("priceType", UNSET) + price_type: Unset | PriceType + if isinstance(_price_type, Unset): + price_type = UNSET + else: + price_type = PriceType(_price_type) + + qty = d.pop("qty", UNSET) + + route = d.pop("route", UNSET) + + symbol = d.pop("symbol", UNSET) + + tag = d.pop("tag", UNSET) + + text = d.pop("text", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + _algo = d.pop("algo", UNSET) + algo: Unset | CreateOrderCrossRequestAlgo + if isinstance(_algo, Unset): + algo = UNSET + else: + algo = CreateOrderCrossRequestAlgo.from_dict(_algo) + + _market_condition = d.pop("marketCondition", UNSET) + market_condition: Unset | CreateOrderCrossRequestMarketCondition + if isinstance(_market_condition, Unset): + market_condition = UNSET + else: + market_condition = CreateOrderCrossRequestMarketCondition.from_dict( + _market_condition + ) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | CreateOrderCrossRequestOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = CreateOrderCrossRequestOptionalData.from_dict( + _optional_data + ) + + _flex_option = d.pop("flexOption", UNSET) + flex_option: Unset | FlexOption + if isinstance(_flex_option, Unset): + flex_option = UNSET + else: + flex_option = FlexOption.from_dict(_flex_option) + + create_order_cross_request = cls( + account_id=account_id, + allocations=allocations, + cross_type=cross_type, + instructions=instructions, + ord_type=ord_type, + order_flags=order_flags, + parent_ord_id=parent_ord_id, + price=price, + price_type=price_type, + qty=qty, + route=route, + symbol=symbol, + tag=tag, + text=text, + tif=tif, + algo=algo, + market_condition=market_condition, + optional_data=optional_data, + flex_option=flex_option, + ) + + return create_order_cross_request diff --git a/openapi_project/openapi_package/models/create_order_cross_request_algo.py b/openapi_project/openapi_package/models/create_order_cross_request_algo.py new file mode 100644 index 000000000..1cf349b68 --- /dev/null +++ b/openapi_project/openapi_package/models/create_order_cross_request_algo.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="CreateOrderCrossRequestAlgo") + + + +@_attrs_define +class CreateOrderCrossRequestAlgo: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_order_cross_request_algo = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_order_cross_request_algo.additional_properties = additional_properties + return create_order_cross_request_algo + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py b/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py new file mode 100644 index 000000000..a444023b9 --- /dev/null +++ b/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="CreateOrderCrossRequestMarketCondition") + + + +@_attrs_define +class CreateOrderCrossRequestMarketCondition: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_order_cross_request_market_condition = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_order_cross_request_market_condition.additional_properties = additional_properties + return create_order_cross_request_market_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py b/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py new file mode 100644 index 000000000..f51f8a5c7 --- /dev/null +++ b/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="CreateOrderCrossRequestOptionalData") + + + +@_attrs_define +class CreateOrderCrossRequestOptionalData: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_order_cross_request_optional_data = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_order_cross_request_optional_data.additional_properties = additional_properties + return create_order_cross_request_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_order_cross_response.py b/openapi_project/openapi_package/models/create_order_cross_response.py new file mode 100644 index 000000000..2c1bd9bdc --- /dev/null +++ b/openapi_project/openapi_package/models/create_order_cross_response.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.order_cross import OrderCross + + +T = TypeVar("T", bound="CreateOrderCrossResponse") + + +@_attrs_define +class CreateOrderCrossResponse: + """ + Attributes: + order_cross (Unset | OrderCross): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + order_cross: Unset | "OrderCross" = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + order_cross: Unset | dict[str, Any] = UNSET + if not isinstance(self.order_cross, Unset): + order_cross = self.order_cross.to_dict() + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if order_cross is not UNSET: + field_dict["orderCross"] = order_cross + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _order_cross = d.pop("orderCross", UNSET) + order_cross: Unset | OrderCross + if isinstance(_order_cross, Unset): + order_cross = UNSET + else: + order_cross = OrderCross.from_dict(_order_cross) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + create_order_cross_response = cls( + order_cross=order_cross, + error_message=error_message, + status_code=status_code, + ) + + return create_order_cross_response diff --git a/openapi_project/openapi_package/models/create_order_request.py b/openapi_project/openapi_package/models/create_order_request.py new file mode 100644 index 000000000..1880b4d6b --- /dev/null +++ b/openapi_project/openapi_package/models/create_order_request.py @@ -0,0 +1,324 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.ord_type import OrdType +from ..models.position_effect import PositionEffect +from ..models.price_type import PriceType +from ..models.side import Side +from ..models.tif import Tif +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.create_order_request_market_condition import ( + CreateOrderRequestMarketCondition, + ) + from ..models.clearing_info import ClearingInfo + from ..models.create_order_request_optional_data import ( + CreateOrderRequestOptionalData, + ) + from ..models.flex_option import FlexOption + from ..models.create_order_request_algo import CreateOrderRequestAlgo + from ..models.order_instruction import OrderInstruction + + +T = TypeVar("T", bound="CreateOrderRequest") + + +@_attrs_define +class CreateOrderRequest: + """ + Attributes: + account_id (Unset | int): + aux_price (Unset | float): + clearing_info (Unset | ClearingInfo): + instructions (Unset | list['OrderInstruction']): + ord_type (Unset | OrdType): + order_flags (Unset | int): + parent_ord_id (Unset | str): + position_effect (Unset | PositionEffect): + price (Unset | float): + price_type (Unset | PriceType): + qty (Unset | float): + route (Unset | str): + side (Unset | Side): + symbol (Unset | str): + tag (Unset | str): + text (Unset | str): + tif (Unset | Tif): + algo (Unset | CreateOrderRequestAlgo): + market_condition (Unset | CreateOrderRequestMarketCondition): + optional_data (Unset | CreateOrderRequestOptionalData): + flex_option (Unset | FlexOption): + """ + + account_id: Unset | int = UNSET + aux_price: Unset | float = UNSET + clearing_info: Unset | "ClearingInfo" = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + ord_type: Unset | OrdType = UNSET + order_flags: Unset | int = UNSET + parent_ord_id: Unset | str = UNSET + position_effect: Unset | PositionEffect = UNSET + price: Unset | float = UNSET + price_type: Unset | PriceType = UNSET + qty: Unset | float = UNSET + route: Unset | str = UNSET + side: Unset | Side = UNSET + symbol: Unset | str = UNSET + tag: Unset | str = UNSET + text: Unset | str = UNSET + tif: Unset | Tif = UNSET + algo: Unset | "CreateOrderRequestAlgo" = UNSET + market_condition: Unset | "CreateOrderRequestMarketCondition" = UNSET + optional_data: Unset | "CreateOrderRequestOptionalData" = UNSET + flex_option: Unset | "FlexOption" = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + aux_price = self.aux_price + + clearing_info: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_info, Unset): + clearing_info = self.clearing_info.to_dict() + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + order_flags = self.order_flags + + parent_ord_id = self.parent_ord_id + + position_effect: Unset | str = UNSET + if not isinstance(self.position_effect, Unset): + position_effect = self.position_effect.value + + price = self.price + + price_type: Unset | str = UNSET + if not isinstance(self.price_type, Unset): + price_type = self.price_type.value + + qty = self.qty + + route = self.route + + side: Unset | str = UNSET + if not isinstance(self.side, Unset): + side = self.side.value + + symbol = self.symbol + + tag = self.tag + + text = self.text + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + algo: Unset | dict[str, Any] = UNSET + if not isinstance(self.algo, Unset): + algo = self.algo.to_dict() + + market_condition: Unset | dict[str, Any] = UNSET + if not isinstance(self.market_condition, Unset): + market_condition = self.market_condition.to_dict() + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + flex_option: Unset | dict[str, Any] = UNSET + if not isinstance(self.flex_option, Unset): + flex_option = self.flex_option.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if aux_price is not UNSET: + field_dict["auxPrice"] = aux_price + if clearing_info is not UNSET: + field_dict["clearingInfo"] = clearing_info + if instructions is not UNSET: + field_dict["instructions"] = instructions + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if order_flags is not UNSET: + field_dict["orderFlags"] = order_flags + if parent_ord_id is not UNSET: + field_dict["parentOrdId"] = parent_ord_id + if position_effect is not UNSET: + field_dict["positionEffect"] = position_effect + if price is not UNSET: + field_dict["price"] = price + if price_type is not UNSET: + field_dict["priceType"] = price_type + if qty is not UNSET: + field_dict["qty"] = qty + if route is not UNSET: + field_dict["route"] = route + if side is not UNSET: + field_dict["side"] = side + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tag is not UNSET: + field_dict["tag"] = tag + if text is not UNSET: + field_dict["text"] = text + if tif is not UNSET: + field_dict["tif"] = tif + if algo is not UNSET: + field_dict["algo"] = algo + if market_condition is not UNSET: + field_dict["marketCondition"] = market_condition + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if flex_option is not UNSET: + field_dict["flexOption"] = flex_option + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + aux_price = d.pop("auxPrice", UNSET) + + _clearing_info = d.pop("clearingInfo", UNSET) + clearing_info: Unset | ClearingInfo + if isinstance(_clearing_info, Unset): + clearing_info = UNSET + else: + clearing_info = ClearingInfo.from_dict(_clearing_info) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + order_flags = d.pop("orderFlags", UNSET) + + parent_ord_id = d.pop("parentOrdId", UNSET) + + _position_effect = d.pop("positionEffect", UNSET) + position_effect: Unset | PositionEffect + if isinstance(_position_effect, Unset): + position_effect = UNSET + else: + position_effect = PositionEffect(_position_effect) + + price = d.pop("price", UNSET) + + _price_type = d.pop("priceType", UNSET) + price_type: Unset | PriceType + if isinstance(_price_type, Unset): + price_type = UNSET + else: + price_type = PriceType(_price_type) + + qty = d.pop("qty", UNSET) + + route = d.pop("route", UNSET) + + _side = d.pop("side", UNSET) + side: Unset | Side + if isinstance(_side, Unset): + side = UNSET + else: + side = Side(_side) + + symbol = d.pop("symbol", UNSET) + + tag = d.pop("tag", UNSET) + + text = d.pop("text", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + _algo = d.pop("algo", UNSET) + algo: Unset | CreateOrderRequestAlgo + if isinstance(_algo, Unset): + algo = UNSET + else: + algo = CreateOrderRequestAlgo.from_dict(_algo) + + _market_condition = d.pop("marketCondition", UNSET) + market_condition: Unset | CreateOrderRequestMarketCondition + if isinstance(_market_condition, Unset): + market_condition = UNSET + else: + market_condition = CreateOrderRequestMarketCondition.from_dict( + _market_condition + ) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | CreateOrderRequestOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = CreateOrderRequestOptionalData.from_dict(_optional_data) + + _flex_option = d.pop("flexOption", UNSET) + flex_option: Unset | FlexOption + if isinstance(_flex_option, Unset): + flex_option = UNSET + else: + flex_option = FlexOption.from_dict(_flex_option) + + create_order_request = cls( + account_id=account_id, + aux_price=aux_price, + clearing_info=clearing_info, + instructions=instructions, + ord_type=ord_type, + order_flags=order_flags, + parent_ord_id=parent_ord_id, + position_effect=position_effect, + price=price, + price_type=price_type, + qty=qty, + route=route, + side=side, + symbol=symbol, + tag=tag, + text=text, + tif=tif, + algo=algo, + market_condition=market_condition, + optional_data=optional_data, + flex_option=flex_option, + ) + + return create_order_request diff --git a/openapi_project/openapi_package/models/create_order_request_algo.py b/openapi_project/openapi_package/models/create_order_request_algo.py new file mode 100644 index 000000000..d102577cf --- /dev/null +++ b/openapi_project/openapi_package/models/create_order_request_algo.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="CreateOrderRequestAlgo") + + + +@_attrs_define +class CreateOrderRequestAlgo: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_order_request_algo = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_order_request_algo.additional_properties = additional_properties + return create_order_request_algo + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_order_request_market_condition.py b/openapi_project/openapi_package/models/create_order_request_market_condition.py new file mode 100644 index 000000000..a4c1a5a14 --- /dev/null +++ b/openapi_project/openapi_package/models/create_order_request_market_condition.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="CreateOrderRequestMarketCondition") + + + +@_attrs_define +class CreateOrderRequestMarketCondition: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_order_request_market_condition = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_order_request_market_condition.additional_properties = additional_properties + return create_order_request_market_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_order_request_optional_data.py b/openapi_project/openapi_package/models/create_order_request_optional_data.py new file mode 100644 index 000000000..374bc49db --- /dev/null +++ b/openapi_project/openapi_package/models/create_order_request_optional_data.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="CreateOrderRequestOptionalData") + + + +@_attrs_define +class CreateOrderRequestOptionalData: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_order_request_optional_data = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + create_order_request_optional_data.additional_properties = additional_properties + return create_order_request_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_order_response.py b/openapi_project/openapi_package/models/create_order_response.py new file mode 100644 index 000000000..db99fc9ef --- /dev/null +++ b/openapi_project/openapi_package/models/create_order_response.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.order import Order + + +T = TypeVar("T", bound="CreateOrderResponse") + + +@_attrs_define +class CreateOrderResponse: + """ + Attributes: + order (Unset | Order): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + order: Unset | "Order" = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + order: Unset | dict[str, Any] = UNSET + if not isinstance(self.order, Unset): + order = self.order.to_dict() + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if order is not UNSET: + field_dict["order"] = order + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _order = d.pop("order", UNSET) + order: Unset | Order + if isinstance(_order, Unset): + order = UNSET + else: + order = Order.from_dict(_order) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + create_order_response = cls( + order=order, + error_message=error_message, + status_code=status_code, + ) + + return create_order_response diff --git a/openapi_project/openapi_package/models/cross_side_type.py b/openapi_project/openapi_package/models/cross_side_type.py new file mode 100644 index 000000000..31e60a925 --- /dev/null +++ b/openapi_project/openapi_package/models/cross_side_type.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class CrossSideType(str, Enum): + CROSS_SIDE_TYPE_AGENCY = "CROSS_SIDE_TYPE_AGENCY" + CROSS_SIDE_TYPE_CONTRA = "CROSS_SIDE_TYPE_CONTRA" + CROSS_SIDE_TYPE_UNDEFINED = "CROSS_SIDE_TYPE_UNDEFINED" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/cross_type.py b/openapi_project/openapi_package/models/cross_type.py new file mode 100644 index 000000000..41cbd00c3 --- /dev/null +++ b/openapi_project/openapi_package/models/cross_type.py @@ -0,0 +1,20 @@ +from enum import Enum + + +class CrossType(str, Enum): + CROSS_TYPE_AIM = "CROSS_TYPE_AIM" + CROSS_TYPE_BAM = "CROSS_TYPE_BAM" + CROSS_TYPE_C2C = "CROSS_TYPE_C2C" + CROSS_TYPE_FACILITATION = "CROSS_TYPE_FACILITATION" + CROSS_TYPE_MATRIX_CROSS = "CROSS_TYPE_MATRIX_CROSS" + CROSS_TYPE_PCC = "CROSS_TYPE_PCC" + CROSS_TYPE_PIM = "CROSS_TYPE_PIM" + CROSS_TYPE_QCC = "CROSS_TYPE_QCC" + CROSS_TYPE_RFC = "CROSS_TYPE_RFC" + CROSS_TYPE_SAM = "CROSS_TYPE_SAM" + CROSS_TYPE_SWEEP_AND_AIM = "CROSS_TYPE_SWEEP_AND_AIM" + CROSS_TYPE_SWEEP_AND_CROSS = "CROSS_TYPE_SWEEP_AND_CROSS" + CROSS_TYPE_UNDEFINED = "CROSS_TYPE_UNDEFINED" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/crypto.py b/openapi_project/openapi_package/models/crypto.py new file mode 100644 index 000000000..efb310a57 --- /dev/null +++ b/openapi_project/openapi_package/models/crypto.py @@ -0,0 +1,290 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.currency import Currency +from ..models.exchange_code import ExchangeCode +from ..models.numeric_display_format import NumericDisplayFormat +from ..models.security_category import SecurityCategory +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.date import Date + from ..models.crypto_aliases import CryptoAliases + + +T = TypeVar("T", bound="Crypto") + + +@_attrs_define +class Crypto: + """ + Attributes: + aliases (Unset | CryptoAliases): + currency (Unset | Currency): + listed_dt (Unset | Date): + delisted_dt (Unset | Date): + description (Unset | str): + exchange_id (Unset | int): + id (Unset | int): + multiplier (Unset | float): + price_base_factor (Unset | float): + price_display_factor (Unset | float): + price_display_format (Unset | NumericDisplayFormat): + qty_display_factor (Unset | float): + qty_display_format (Unset | NumericDisplayFormat): + security_category (Unset | SecurityCategory): + symbol (Unset | str): + tick_rule (Unset | str): + tick_size (Unset | float): + tick_value (Unset | float): + traded_exchanges (Unset | list[ExchangeCode]): + quote_currency (Unset | Currency): + """ + + aliases: Unset | "CryptoAliases" = UNSET + currency: Unset | Currency = UNSET + listed_dt: Unset | "Date" = UNSET + delisted_dt: Unset | "Date" = UNSET + description: Unset | str = UNSET + exchange_id: Unset | int = UNSET + id: Unset | int = UNSET + multiplier: Unset | float = UNSET + price_base_factor: Unset | float = UNSET + price_display_factor: Unset | float = UNSET + price_display_format: Unset | NumericDisplayFormat = UNSET + qty_display_factor: Unset | float = UNSET + qty_display_format: Unset | NumericDisplayFormat = UNSET + security_category: Unset | SecurityCategory = UNSET + symbol: Unset | str = UNSET + tick_rule: Unset | str = UNSET + tick_size: Unset | float = UNSET + tick_value: Unset | float = UNSET + traded_exchanges: Unset | list[ExchangeCode] = UNSET + quote_currency: Unset | Currency = UNSET + + def to_dict(self) -> dict[str, Any]: + aliases: Unset | dict[str, Any] = UNSET + if not isinstance(self.aliases, Unset): + aliases = self.aliases.to_dict() + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + listed_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.listed_dt, Unset): + listed_dt = self.listed_dt.to_dict() + + delisted_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.delisted_dt, Unset): + delisted_dt = self.delisted_dt.to_dict() + + description = self.description + + exchange_id = self.exchange_id + + id = self.id + + multiplier = self.multiplier + + price_base_factor = self.price_base_factor + + price_display_factor = self.price_display_factor + + price_display_format: Unset | str = UNSET + if not isinstance(self.price_display_format, Unset): + price_display_format = self.price_display_format.value + + qty_display_factor = self.qty_display_factor + + qty_display_format: Unset | str = UNSET + if not isinstance(self.qty_display_format, Unset): + qty_display_format = self.qty_display_format.value + + security_category: Unset | str = UNSET + if not isinstance(self.security_category, Unset): + security_category = self.security_category.value + + symbol = self.symbol + + tick_rule = self.tick_rule + + tick_size = self.tick_size + + tick_value = self.tick_value + + traded_exchanges: Unset | list[str] = UNSET + if not isinstance(self.traded_exchanges, Unset): + traded_exchanges = [] + for traded_exchanges_item_data in self.traded_exchanges: + traded_exchanges_item = traded_exchanges_item_data.value + traded_exchanges.append(traded_exchanges_item) + + quote_currency: Unset | str = UNSET + if not isinstance(self.quote_currency, Unset): + quote_currency = self.quote_currency.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if aliases is not UNSET: + field_dict["aliases"] = aliases + if currency is not UNSET: + field_dict["currency"] = currency + if listed_dt is not UNSET: + field_dict["listedDt"] = listed_dt + if delisted_dt is not UNSET: + field_dict["delistedDt"] = delisted_dt + if description is not UNSET: + field_dict["description"] = description + if exchange_id is not UNSET: + field_dict["exchangeId"] = exchange_id + if id is not UNSET: + field_dict["id"] = id + if multiplier is not UNSET: + field_dict["multiplier"] = multiplier + if price_base_factor is not UNSET: + field_dict["priceBaseFactor"] = price_base_factor + if price_display_factor is not UNSET: + field_dict["priceDisplayFactor"] = price_display_factor + if price_display_format is not UNSET: + field_dict["priceDisplayFormat"] = price_display_format + if qty_display_factor is not UNSET: + field_dict["qtyDisplayFactor"] = qty_display_factor + if qty_display_format is not UNSET: + field_dict["qtyDisplayFormat"] = qty_display_format + if security_category is not UNSET: + field_dict["securityCategory"] = security_category + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tick_rule is not UNSET: + field_dict["tickRule"] = tick_rule + if tick_size is not UNSET: + field_dict["tickSize"] = tick_size + if tick_value is not UNSET: + field_dict["tickValue"] = tick_value + if traded_exchanges is not UNSET: + field_dict["tradedExchanges"] = traded_exchanges + if quote_currency is not UNSET: + field_dict["quoteCurrency"] = quote_currency + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _aliases = d.pop("aliases", UNSET) + aliases: Unset | CryptoAliases + if isinstance(_aliases, Unset): + aliases = UNSET + else: + aliases = CryptoAliases.from_dict(_aliases) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + _listed_dt = d.pop("listedDt", UNSET) + listed_dt: Unset | Date + if isinstance(_listed_dt, Unset): + listed_dt = UNSET + else: + listed_dt = Date.from_dict(_listed_dt) + + _delisted_dt = d.pop("delistedDt", UNSET) + delisted_dt: Unset | Date + if isinstance(_delisted_dt, Unset): + delisted_dt = UNSET + else: + delisted_dt = Date.from_dict(_delisted_dt) + + description = d.pop("description", UNSET) + + exchange_id = d.pop("exchangeId", UNSET) + + id = d.pop("id", UNSET) + + multiplier = d.pop("multiplier", UNSET) + + price_base_factor = d.pop("priceBaseFactor", UNSET) + + price_display_factor = d.pop("priceDisplayFactor", UNSET) + + _price_display_format = d.pop("priceDisplayFormat", UNSET) + price_display_format: Unset | NumericDisplayFormat + if isinstance(_price_display_format, Unset): + price_display_format = UNSET + else: + price_display_format = NumericDisplayFormat(_price_display_format) + + qty_display_factor = d.pop("qtyDisplayFactor", UNSET) + + _qty_display_format = d.pop("qtyDisplayFormat", UNSET) + qty_display_format: Unset | NumericDisplayFormat + if isinstance(_qty_display_format, Unset): + qty_display_format = UNSET + else: + qty_display_format = NumericDisplayFormat(_qty_display_format) + + _security_category = d.pop("securityCategory", UNSET) + security_category: Unset | SecurityCategory + if isinstance(_security_category, Unset): + security_category = UNSET + else: + security_category = SecurityCategory(_security_category) + + symbol = d.pop("symbol", UNSET) + + tick_rule = d.pop("tickRule", UNSET) + + tick_size = d.pop("tickSize", UNSET) + + tick_value = d.pop("tickValue", UNSET) + + traded_exchanges = [] + _traded_exchanges = d.pop("tradedExchanges", UNSET) + for traded_exchanges_item_data in _traded_exchanges or []: + traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) + + traded_exchanges.append(traded_exchanges_item) + + _quote_currency = d.pop("quoteCurrency", UNSET) + quote_currency: Unset | Currency + if isinstance(_quote_currency, Unset): + quote_currency = UNSET + else: + quote_currency = Currency(_quote_currency) + + crypto = cls( + aliases=aliases, + currency=currency, + listed_dt=listed_dt, + delisted_dt=delisted_dt, + description=description, + exchange_id=exchange_id, + id=id, + multiplier=multiplier, + price_base_factor=price_base_factor, + price_display_factor=price_display_factor, + price_display_format=price_display_format, + qty_display_factor=qty_display_factor, + qty_display_format=qty_display_format, + security_category=security_category, + symbol=symbol, + tick_rule=tick_rule, + tick_size=tick_size, + tick_value=tick_value, + traded_exchanges=traded_exchanges, + quote_currency=quote_currency, + ) + + return crypto diff --git a/openapi_project/openapi_package/models/crypto_aliases.py b/openapi_project/openapi_package/models/crypto_aliases.py new file mode 100644 index 000000000..1a1c2960c --- /dev/null +++ b/openapi_project/openapi_package/models/crypto_aliases.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="CryptoAliases") + + + +@_attrs_define +class CryptoAliases: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + crypto_aliases = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + crypto_aliases.additional_properties = additional_properties + return crypto_aliases + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/currency.py b/openapi_project/openapi_package/models/currency.py new file mode 100644 index 000000000..bb1f74189 --- /dev/null +++ b/openapi_project/openapi_package/models/currency.py @@ -0,0 +1,180 @@ +from enum import Enum + + +class Currency(str, Enum): + CURRENCY_AED = "CURRENCY_AED" + CURRENCY_AFN = "CURRENCY_AFN" + CURRENCY_ALL = "CURRENCY_ALL" + CURRENCY_AMD = "CURRENCY_AMD" + CURRENCY_ANG = "CURRENCY_ANG" + CURRENCY_AOA = "CURRENCY_AOA" + CURRENCY_ARS = "CURRENCY_ARS" + CURRENCY_AUD = "CURRENCY_AUD" + CURRENCY_AWG = "CURRENCY_AWG" + CURRENCY_AZN = "CURRENCY_AZN" + CURRENCY_BAM = "CURRENCY_BAM" + CURRENCY_BBD = "CURRENCY_BBD" + CURRENCY_BDT = "CURRENCY_BDT" + CURRENCY_BGN = "CURRENCY_BGN" + CURRENCY_BHD = "CURRENCY_BHD" + CURRENCY_BIF = "CURRENCY_BIF" + CURRENCY_BMD = "CURRENCY_BMD" + CURRENCY_BND = "CURRENCY_BND" + CURRENCY_BOB = "CURRENCY_BOB" + CURRENCY_BRL = "CURRENCY_BRL" + CURRENCY_BSD = "CURRENCY_BSD" + CURRENCY_BTC = "CURRENCY_BTC" + CURRENCY_BTN = "CURRENCY_BTN" + CURRENCY_BWP = "CURRENCY_BWP" + CURRENCY_BYR = "CURRENCY_BYR" + CURRENCY_BZD = "CURRENCY_BZD" + CURRENCY_CAD = "CURRENCY_CAD" + CURRENCY_CDF = "CURRENCY_CDF" + CURRENCY_CHF = "CURRENCY_CHF" + CURRENCY_CLP = "CURRENCY_CLP" + CURRENCY_CNH = "CURRENCY_CNH" + CURRENCY_CNY = "CURRENCY_CNY" + CURRENCY_COP = "CURRENCY_COP" + CURRENCY_CRC = "CURRENCY_CRC" + CURRENCY_CUC = "CURRENCY_CUC" + CURRENCY_CUP = "CURRENCY_CUP" + CURRENCY_CVE = "CURRENCY_CVE" + CURRENCY_CZK = "CURRENCY_CZK" + CURRENCY_DEM = "CURRENCY_DEM" + CURRENCY_DJF = "CURRENCY_DJF" + CURRENCY_DKK = "CURRENCY_DKK" + CURRENCY_DOP = "CURRENCY_DOP" + CURRENCY_DZD = "CURRENCY_DZD" + CURRENCY_EEK = "CURRENCY_EEK" + CURRENCY_EGP = "CURRENCY_EGP" + CURRENCY_ERN = "CURRENCY_ERN" + CURRENCY_ETB = "CURRENCY_ETB" + CURRENCY_ETH = "CURRENCY_ETH" + CURRENCY_EUR = "CURRENCY_EUR" + CURRENCY_FJD = "CURRENCY_FJD" + CURRENCY_FKP = "CURRENCY_FKP" + CURRENCY_GBP = "CURRENCY_GBP" + CURRENCY_GBX = "CURRENCY_GBX" + CURRENCY_GEL = "CURRENCY_GEL" + CURRENCY_GGP = "CURRENCY_GGP" + CURRENCY_GHS = "CURRENCY_GHS" + CURRENCY_GIP = "CURRENCY_GIP" + CURRENCY_GMD = "CURRENCY_GMD" + CURRENCY_GNF = "CURRENCY_GNF" + CURRENCY_GTQ = "CURRENCY_GTQ" + CURRENCY_GYD = "CURRENCY_GYD" + CURRENCY_HKD = "CURRENCY_HKD" + CURRENCY_HNL = "CURRENCY_HNL" + CURRENCY_HRK = "CURRENCY_HRK" + CURRENCY_HTG = "CURRENCY_HTG" + CURRENCY_HUF = "CURRENCY_HUF" + CURRENCY_IDR = "CURRENCY_IDR" + CURRENCY_ILS = "CURRENCY_ILS" + CURRENCY_IMP = "CURRENCY_IMP" + CURRENCY_INR = "CURRENCY_INR" + CURRENCY_IQD = "CURRENCY_IQD" + CURRENCY_IRR = "CURRENCY_IRR" + CURRENCY_ISK = "CURRENCY_ISK" + CURRENCY_JEP = "CURRENCY_JEP" + CURRENCY_JMD = "CURRENCY_JMD" + CURRENCY_JOD = "CURRENCY_JOD" + CURRENCY_JPY = "CURRENCY_JPY" + CURRENCY_KES = "CURRENCY_KES" + CURRENCY_KGS = "CURRENCY_KGS" + CURRENCY_KHR = "CURRENCY_KHR" + CURRENCY_KMF = "CURRENCY_KMF" + CURRENCY_KPW = "CURRENCY_KPW" + CURRENCY_KRW = "CURRENCY_KRW" + CURRENCY_KWD = "CURRENCY_KWD" + CURRENCY_KYD = "CURRENCY_KYD" + CURRENCY_KZT = "CURRENCY_KZT" + CURRENCY_LAK = "CURRENCY_LAK" + CURRENCY_LBP = "CURRENCY_LBP" + CURRENCY_LKR = "CURRENCY_LKR" + CURRENCY_LRD = "CURRENCY_LRD" + CURRENCY_LSL = "CURRENCY_LSL" + CURRENCY_LTL = "CURRENCY_LTL" + CURRENCY_LVL = "CURRENCY_LVL" + CURRENCY_LYD = "CURRENCY_LYD" + CURRENCY_MAD = "CURRENCY_MAD" + CURRENCY_MDL = "CURRENCY_MDL" + CURRENCY_MGA = "CURRENCY_MGA" + CURRENCY_MKD = "CURRENCY_MKD" + CURRENCY_MMK = "CURRENCY_MMK" + CURRENCY_MNT = "CURRENCY_MNT" + CURRENCY_MOP = "CURRENCY_MOP" + CURRENCY_MRO = "CURRENCY_MRO" + CURRENCY_MUR = "CURRENCY_MUR" + CURRENCY_MVR = "CURRENCY_MVR" + CURRENCY_MWK = "CURRENCY_MWK" + CURRENCY_MXN = "CURRENCY_MXN" + CURRENCY_MYR = "CURRENCY_MYR" + CURRENCY_MZN = "CURRENCY_MZN" + CURRENCY_NAD = "CURRENCY_NAD" + CURRENCY_NGN = "CURRENCY_NGN" + CURRENCY_NIO = "CURRENCY_NIO" + CURRENCY_NLG = "CURRENCY_NLG" + CURRENCY_NOK = "CURRENCY_NOK" + CURRENCY_NPR = "CURRENCY_NPR" + CURRENCY_NZD = "CURRENCY_NZD" + CURRENCY_OMR = "CURRENCY_OMR" + CURRENCY_PAB = "CURRENCY_PAB" + CURRENCY_PEN = "CURRENCY_PEN" + CURRENCY_PGK = "CURRENCY_PGK" + CURRENCY_PHP = "CURRENCY_PHP" + CURRENCY_PKR = "CURRENCY_PKR" + CURRENCY_PLN = "CURRENCY_PLN" + CURRENCY_PYG = "CURRENCY_PYG" + CURRENCY_QAR = "CURRENCY_QAR" + CURRENCY_RON = "CURRENCY_RON" + CURRENCY_RSD = "CURRENCY_RSD" + CURRENCY_RUB = "CURRENCY_RUB" + CURRENCY_RWF = "CURRENCY_RWF" + CURRENCY_SAR = "CURRENCY_SAR" + CURRENCY_SBD = "CURRENCY_SBD" + CURRENCY_SCR = "CURRENCY_SCR" + CURRENCY_SDG = "CURRENCY_SDG" + CURRENCY_SEK = "CURRENCY_SEK" + CURRENCY_SGD = "CURRENCY_SGD" + CURRENCY_SHP = "CURRENCY_SHP" + CURRENCY_SKK = "CURRENCY_SKK" + CURRENCY_SLL = "CURRENCY_SLL" + CURRENCY_SOS = "CURRENCY_SOS" + CURRENCY_SPL = "CURRENCY_SPL" + CURRENCY_SRD = "CURRENCY_SRD" + CURRENCY_STD = "CURRENCY_STD" + CURRENCY_SVC = "CURRENCY_SVC" + CURRENCY_SYP = "CURRENCY_SYP" + CURRENCY_SZL = "CURRENCY_SZL" + CURRENCY_THB = "CURRENCY_THB" + CURRENCY_TJS = "CURRENCY_TJS" + CURRENCY_TMT = "CURRENCY_TMT" + CURRENCY_TND = "CURRENCY_TND" + CURRENCY_TOP = "CURRENCY_TOP" + CURRENCY_TRY = "CURRENCY_TRY" + CURRENCY_TTD = "CURRENCY_TTD" + CURRENCY_TVD = "CURRENCY_TVD" + CURRENCY_TWD = "CURRENCY_TWD" + CURRENCY_TZS = "CURRENCY_TZS" + CURRENCY_UAH = "CURRENCY_UAH" + CURRENCY_UGX = "CURRENCY_UGX" + CURRENCY_USD = "CURRENCY_USD" + CURRENCY_UYU = "CURRENCY_UYU" + CURRENCY_UZS = "CURRENCY_UZS" + CURRENCY_VEF = "CURRENCY_VEF" + CURRENCY_VND = "CURRENCY_VND" + CURRENCY_VUV = "CURRENCY_VUV" + CURRENCY_WST = "CURRENCY_WST" + CURRENCY_XAF = "CURRENCY_XAF" + CURRENCY_XCD = "CURRENCY_XCD" + CURRENCY_XDR = "CURRENCY_XDR" + CURRENCY_XOF = "CURRENCY_XOF" + CURRENCY_XPF = "CURRENCY_XPF" + CURRENCY_XXX = "CURRENCY_XXX" + CURRENCY_YER = "CURRENCY_YER" + CURRENCY_ZAR = "CURRENCY_ZAR" + CURRENCY_ZMW = "CURRENCY_ZMW" + CURRENCY_ZWD = "CURRENCY_ZWD" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/cxl_rej_response_to.py b/openapi_project/openapi_package/models/cxl_rej_response_to.py new file mode 100644 index 000000000..294c6354a --- /dev/null +++ b/openapi_project/openapi_package/models/cxl_rej_response_to.py @@ -0,0 +1,14 @@ +from enum import Enum + + +class CxlRejResponseTo(str, Enum): + CXL_REJ_RESPONSE_TO_ORDER_CANCEL_REPLACE_REQUEST = ( + "CXL_REJ_RESPONSE_TO_ORDER_CANCEL_REPLACE_REQUEST" + ) + CXL_REJ_RESPONSE_TO_ORDER_CANCEL_REQUEST = ( + "CXL_REJ_RESPONSE_TO_ORDER_CANCEL_REQUEST" + ) + CXL_REJ_RESPONSE_TO_UNKNOWN = "CXL_REJ_RESPONSE_TO_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/date.py b/openapi_project/openapi_package/models/date.py new file mode 100644 index 000000000..978a5aea5 --- /dev/null +++ b/openapi_project/openapi_package/models/date.py @@ -0,0 +1,62 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="Date") + + +@_attrs_define +class Date: + """ + Attributes: + year (Unset | int): + month (Unset | int): + day (Unset | int): + """ + + year: Unset | int = UNSET + month: Unset | int = UNSET + day: Unset | int = UNSET + + def to_dict(self) -> dict[str, Any]: + year = self.year + + month = self.month + + day = self.day + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if year is not UNSET: + field_dict["year"] = year + if month is not UNSET: + field_dict["month"] = month + if day is not UNSET: + field_dict["day"] = day + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + year = d.pop("year", UNSET) + + month = d.pop("month", UNSET) + + day = d.pop("day", UNSET) + + date = cls( + year=year, + month=month, + day=day, + ) + + return date diff --git a/openapi_project/openapi_package/models/easy_to_borrow_security.py b/openapi_project/openapi_package/models/easy_to_borrow_security.py new file mode 100644 index 000000000..c7a4fd78d --- /dev/null +++ b/openapi_project/openapi_package/models/easy_to_borrow_security.py @@ -0,0 +1,53 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="EasyToBorrowSecurity") + + +@_attrs_define +class EasyToBorrowSecurity: + """ + Attributes: + symbol (Unset | str): + locate_id (Unset | str): + """ + + symbol: Unset | str = UNSET + locate_id: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + locate_id = self.locate_id + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if symbol is not UNSET: + field_dict["symbol"] = symbol + if locate_id is not UNSET: + field_dict["locateId"] = locate_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = d.pop("symbol", UNSET) + + locate_id = d.pop("locateId", UNSET) + + easy_to_borrow_security = cls( + symbol=symbol, + locate_id=locate_id, + ) + + return easy_to_borrow_security diff --git a/openapi_project/openapi_package/models/empty.py b/openapi_project/openapi_package/models/empty.py new file mode 100644 index 000000000..2eafd5b31 --- /dev/null +++ b/openapi_project/openapi_package/models/empty.py @@ -0,0 +1,27 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="Empty") + + +@_attrs_define +class Empty: + """ """ + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + empty = cls() + + return empty diff --git a/openapi_project/openapi_package/models/exchange.py b/openapi_project/openapi_package/models/exchange.py new file mode 100644 index 000000000..55fd9372a --- /dev/null +++ b/openapi_project/openapi_package/models/exchange.py @@ -0,0 +1,161 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="Exchange") + + +@_attrs_define +class Exchange: + """ + Attributes: + country (Unset | str): + description (Unset | str): + display_name (Unset | str): + id (Unset | int): + mic (Unset | str): + microsoft_timezone (Unset | str): + name (Unset | str): + olson_timezone (Unset | str): + operating_mic (Unset | str): + region (Unset | str): + short_code (Unset | str): + suffix (Unset | str): + utc_offset (Unset | int): + website (Unset | str): + """ + + country: Unset | str = UNSET + description: Unset | str = UNSET + display_name: Unset | str = UNSET + id: Unset | int = UNSET + mic: Unset | str = UNSET + microsoft_timezone: Unset | str = UNSET + name: Unset | str = UNSET + olson_timezone: Unset | str = UNSET + operating_mic: Unset | str = UNSET + region: Unset | str = UNSET + short_code: Unset | str = UNSET + suffix: Unset | str = UNSET + utc_offset: Unset | int = UNSET + website: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + country = self.country + + description = self.description + + display_name = self.display_name + + id = self.id + + mic = self.mic + + microsoft_timezone = self.microsoft_timezone + + name = self.name + + olson_timezone = self.olson_timezone + + operating_mic = self.operating_mic + + region = self.region + + short_code = self.short_code + + suffix = self.suffix + + utc_offset = self.utc_offset + + website = self.website + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if country is not UNSET: + field_dict["Country"] = country + if description is not UNSET: + field_dict["Description"] = description + if display_name is not UNSET: + field_dict["DisplayName"] = display_name + if id is not UNSET: + field_dict["Id"] = id + if mic is not UNSET: + field_dict["MIC"] = mic + if microsoft_timezone is not UNSET: + field_dict["MicrosoftTimezone"] = microsoft_timezone + if name is not UNSET: + field_dict["Name"] = name + if olson_timezone is not UNSET: + field_dict["OlsonTimezone"] = olson_timezone + if operating_mic is not UNSET: + field_dict["OperatingMIC"] = operating_mic + if region is not UNSET: + field_dict["Region"] = region + if short_code is not UNSET: + field_dict["ShortCode"] = short_code + if suffix is not UNSET: + field_dict["Suffix"] = suffix + if utc_offset is not UNSET: + field_dict["UtcOffset"] = utc_offset + if website is not UNSET: + field_dict["Website"] = website + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + country = d.pop("Country", UNSET) + + description = d.pop("Description", UNSET) + + display_name = d.pop("DisplayName", UNSET) + + id = d.pop("Id", UNSET) + + mic = d.pop("MIC", UNSET) + + microsoft_timezone = d.pop("MicrosoftTimezone", UNSET) + + name = d.pop("Name", UNSET) + + olson_timezone = d.pop("OlsonTimezone", UNSET) + + operating_mic = d.pop("OperatingMIC", UNSET) + + region = d.pop("Region", UNSET) + + short_code = d.pop("ShortCode", UNSET) + + suffix = d.pop("Suffix", UNSET) + + utc_offset = d.pop("UtcOffset", UNSET) + + website = d.pop("Website", UNSET) + + exchange = cls( + country=country, + description=description, + display_name=display_name, + id=id, + mic=mic, + microsoft_timezone=microsoft_timezone, + name=name, + olson_timezone=olson_timezone, + operating_mic=operating_mic, + region=region, + short_code=short_code, + suffix=suffix, + utc_offset=utc_offset, + website=website, + ) + + return exchange diff --git a/openapi_project/openapi_package/models/exchange_code.py b/openapi_project/openapi_package/models/exchange_code.py new file mode 100644 index 000000000..fff12c425 --- /dev/null +++ b/openapi_project/openapi_package/models/exchange_code.py @@ -0,0 +1,72 @@ +from enum import Enum + + +class ExchangeCode(str, Enum): + EXCHANGE_CODE_AMXO = "EXCHANGE_CODE_AMXO" + EXCHANGE_CODE_ARCO = "EXCHANGE_CODE_ARCO" + EXCHANGE_CODE_ARCX = "EXCHANGE_CODE_ARCX" + EXCHANGE_CODE_BATO = "EXCHANGE_CODE_BATO" + EXCHANGE_CODE_BATS = "EXCHANGE_CODE_BATS" + EXCHANGE_CODE_BATY = "EXCHANGE_CODE_BATY" + EXCHANGE_CODE_BLCK = "EXCHANGE_CODE_BLCK" + EXCHANGE_CODE_C2OX = "EXCHANGE_CODE_C2OX" + EXCHANGE_CODE_CBSX = "EXCHANGE_CODE_CBSX" + EXCHANGE_CODE_CGIX = "EXCHANGE_CODE_CGIX" + EXCHANGE_CODE_CSMI = "EXCHANGE_CODE_CSMI" + EXCHANGE_CODE_DJXX = "EXCHANGE_CODE_DJXX" + EXCHANGE_CODE_EDGA = "EXCHANGE_CODE_EDGA" + EXCHANGE_CODE_EDGO = "EXCHANGE_CODE_EDGO" + EXCHANGE_CODE_EDGX = "EXCHANGE_CODE_EDGX" + EXCHANGE_CODE_EMLD = "EXCHANGE_CODE_EMLD" + EXCHANGE_CODE_EPRL = "EXCHANGE_CODE_EPRL" + EXCHANGE_CODE_GIDS = "EXCHANGE_CODE_GIDS" + EXCHANGE_CODE_GLBX = "EXCHANGE_CODE_GLBX" + EXCHANGE_CODE_GMNI = "EXCHANGE_CODE_GMNI" + EXCHANGE_CODE_IEXG = "EXCHANGE_CODE_IEXG" + EXCHANGE_CODE_LTSE = "EXCHANGE_CODE_LTSE" + EXCHANGE_CODE_MCRY = "EXCHANGE_CODE_MCRY" + EXCHANGE_CODE_MEMX = "EXCHANGE_CODE_MEMX" + EXCHANGE_CODE_MPRL = "EXCHANGE_CODE_MPRL" + EXCHANGE_CODE_MSCI = "EXCHANGE_CODE_MSCI" + EXCHANGE_CODE_MSTR = "EXCHANGE_CODE_MSTR" + EXCHANGE_CODE_MXOP = "EXCHANGE_CODE_MXOP" + EXCHANGE_CODE_OOTC = "EXCHANGE_CODE_OOTC" + EXCHANGE_CODE_OPRA = "EXCHANGE_CODE_OPRA" + EXCHANGE_CODE_OTCB = "EXCHANGE_CODE_OTCB" + EXCHANGE_CODE_OTCM = "EXCHANGE_CODE_OTCM" + EXCHANGE_CODE_OTCQ = "EXCHANGE_CODE_OTCQ" + EXCHANGE_CODE_PINC = "EXCHANGE_CODE_PINC" + EXCHANGE_CODE_PINX = "EXCHANGE_CODE_PINX" + EXCHANGE_CODE_RTXX = "EXCHANGE_CODE_RTXX" + EXCHANGE_CODE_SPHR = "EXCHANGE_CODE_SPHR" + EXCHANGE_CODE_SPXX = "EXCHANGE_CODE_SPXX" + EXCHANGE_CODE_USEQ = "EXCHANGE_CODE_USEQ" + EXCHANGE_CODE_XADF = "EXCHANGE_CODE_XADF" + EXCHANGE_CODE_XASE = "EXCHANGE_CODE_XASE" + EXCHANGE_CODE_XBOS = "EXCHANGE_CODE_XBOS" + EXCHANGE_CODE_XBOX = "EXCHANGE_CODE_XBOX" + EXCHANGE_CODE_XBXO = "EXCHANGE_CODE_XBXO" + EXCHANGE_CODE_XCBF = "EXCHANGE_CODE_XCBF" + EXCHANGE_CODE_XCBO = "EXCHANGE_CODE_XCBO" + EXCHANGE_CODE_XCBT = "EXCHANGE_CODE_XCBT" + EXCHANGE_CODE_XCEC = "EXCHANGE_CODE_XCEC" + EXCHANGE_CODE_XCHI = "EXCHANGE_CODE_XCHI" + EXCHANGE_CODE_XCIS = "EXCHANGE_CODE_XCIS" + EXCHANGE_CODE_XCME = "EXCHANGE_CODE_XCME" + EXCHANGE_CODE_XISE = "EXCHANGE_CODE_XISE" + EXCHANGE_CODE_XISX = "EXCHANGE_CODE_XISX" + EXCHANGE_CODE_XKBT = "EXCHANGE_CODE_XKBT" + EXCHANGE_CODE_XMIO = "EXCHANGE_CODE_XMIO" + EXCHANGE_CODE_XNAS = "EXCHANGE_CODE_XNAS" + EXCHANGE_CODE_XNDQ = "EXCHANGE_CODE_XNDQ" + EXCHANGE_CODE_XNGS = "EXCHANGE_CODE_XNGS" + EXCHANGE_CODE_XNYM = "EXCHANGE_CODE_XNYM" + EXCHANGE_CODE_XNYS = "EXCHANGE_CODE_XNYS" + EXCHANGE_CODE_XOCC = "EXCHANGE_CODE_XOCC" + EXCHANGE_CODE_XOTC = "EXCHANGE_CODE_XOTC" + EXCHANGE_CODE_XPHO = "EXCHANGE_CODE_XPHO" + EXCHANGE_CODE_XPSX = "EXCHANGE_CODE_XPSX" + EXCHANGE_CODE_XXXX = "EXCHANGE_CODE_XXXX" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/exec_type.py b/openapi_project/openapi_package/models/exec_type.py new file mode 100644 index 000000000..851f1e912 --- /dev/null +++ b/openapi_project/openapi_package/models/exec_type.py @@ -0,0 +1,30 @@ +from enum import Enum + + +class ExecType(str, Enum): + EXEC_TYPE_CANCELED = "EXEC_TYPE_CANCELED" + EXEC_TYPE_CLAIM_REQUIRED = "EXEC_TYPE_CLAIM_REQUIRED" + EXEC_TYPE_DONE_FOR_DAY = "EXEC_TYPE_DONE_FOR_DAY" + EXEC_TYPE_EXPIRED = "EXEC_TYPE_EXPIRED" + EXEC_TYPE_NEW = "EXEC_TYPE_NEW" + EXEC_TYPE_NOTE = "EXEC_TYPE_NOTE" + EXEC_TYPE_PENDING_CANCEL = "EXEC_TYPE_PENDING_CANCEL" + EXEC_TYPE_PENDING_NEW = "EXEC_TYPE_PENDING_NEW" + EXEC_TYPE_PENDING_REPLACE = "EXEC_TYPE_PENDING_REPLACE" + EXEC_TYPE_QUEUED_ORDER = "EXEC_TYPE_QUEUED_ORDER" + EXEC_TYPE_REJECTED = "EXEC_TYPE_REJECTED" + EXEC_TYPE_REPLACED = "EXEC_TYPE_REPLACED" + EXEC_TYPE_REPRESENTED = "EXEC_TYPE_REPRESENTED" + EXEC_TYPE_RESTATED = "EXEC_TYPE_RESTATED" + EXEC_TYPE_STOPPED = "EXEC_TYPE_STOPPED" + EXEC_TYPE_SUSPENDED = "EXEC_TYPE_SUSPENDED" + EXEC_TYPE_TRADE = "EXEC_TYPE_TRADE" + EXEC_TYPE_TRADE_BUST = "EXEC_TYPE_TRADE_BUST" + EXEC_TYPE_TRADE_CORRECT = "EXEC_TYPE_TRADE_CORRECT" + EXEC_TYPE_UNKNOWN = "EXEC_TYPE_UNKNOWN" + EXEC_TYPE_UPDATE = "EXEC_TYPE_UPDATE" + EXEC_TYPE_UPDATE_OPTIONAL_DATA = "EXEC_TYPE_UPDATE_OPTIONAL_DATA" + EXEC_TYPE_USER_CLAIMED = "EXEC_TYPE_USER_CLAIMED" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/execution.py b/openapi_project/openapi_package/models/execution.py new file mode 100644 index 000000000..614990ad4 --- /dev/null +++ b/openapi_project/openapi_package/models/execution.py @@ -0,0 +1,638 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.exec_type import ExecType +from ..models.multi_leg_reporting_type import MultiLegReportingType +from ..models.ord_status import OrdStatus +from ..models.ord_type import OrdType +from ..models.origination_type import OriginationType +from ..models.position_effect import PositionEffect +from ..models.price_type import PriceType +from ..models.side import Side +from ..models.tif import Tif +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.clearing_info import ClearingInfo + from ..models.header import Header + from ..models.execution_optional_data import ExecutionOptionalData + from ..models.security import Security + from ..models.order_instruction import OrderInstruction + from ..models.execution_algo import ExecutionAlgo + + +T = TypeVar("T", bound="Execution") + + +@_attrs_define +class Execution: + """ + Attributes: + account_id (Unset | int): + algo (Unset | ExecutionAlgo): + alloc_id (Unset | str): + aux_price (Unset | float): + avg_price (Unset | float): + claimed_by (Unset | str): + clearing_info (Unset | ClearingInfo): + commission (Unset | float): + cum_qty (Unset | float): + cur_ord_id (Unset | str): + exec_broker (Unset | str): + exec_id (Unset | str): + exec_ref_id (Unset | str): + exec_type (Unset | ExecType): + fee1 (Unset | float): + fee2 (Unset | float): + header (Unset | Header): + incoming_cl_ord_id (Unset | str): + incoming_ord_id (Unset | str): + incoming_orig_cl_ord_id (Unset | str): + instructions (Unset | list['OrderInstruction']): + last_market (Unset | str): + last_price (Unset | float): + last_qty (Unset | float): + leaves_qty (Unset | float): + leg_id (Unset | str): + liquidity_flag (Unset | str): + multi_leg_reporting_type (Unset | MultiLegReportingType): + optional_data (Unset | ExecutionOptionalData): + order_flags (Unset | int): + ord_status (Unset | OrdStatus): + ord_type (Unset | OrdType): + origination_type (Unset | OriginationType): + orig_ord_id (Unset | str): + parent_ord_id (Unset | str): + perm_ord_id (Unset | str): + position_effect (Unset | PositionEffect): + price (Unset | float): + price_type (Unset | PriceType): + qty (Unset | float): + route (Unset | str): + routing_session (Unset | str): + security (Unset | Security): + side (Unset | Side): + source (Unset | str): + symbol (Unset | str): + tag (Unset | str): + text (Unset | str): + tif (Unset | Tif): + trader_id (Unset | str): + transact_ts (Unset | str): + user_id (Unset | int): + working_qty (Unset | float): + """ + + account_id: Unset | int = UNSET + algo: Unset | "ExecutionAlgo" = UNSET + alloc_id: Unset | str = UNSET + aux_price: Unset | float = UNSET + avg_price: Unset | float = UNSET + claimed_by: Unset | str = UNSET + clearing_info: Unset | "ClearingInfo" = UNSET + commission: Unset | float = UNSET + cum_qty: Unset | float = UNSET + cur_ord_id: Unset | str = UNSET + exec_broker: Unset | str = UNSET + exec_id: Unset | str = UNSET + exec_ref_id: Unset | str = UNSET + exec_type: Unset | ExecType = UNSET + fee1: Unset | float = UNSET + fee2: Unset | float = UNSET + header: Unset | "Header" = UNSET + incoming_cl_ord_id: Unset | str = UNSET + incoming_ord_id: Unset | str = UNSET + incoming_orig_cl_ord_id: Unset | str = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + last_market: Unset | str = UNSET + last_price: Unset | float = UNSET + last_qty: Unset | float = UNSET + leaves_qty: Unset | float = UNSET + leg_id: Unset | str = UNSET + liquidity_flag: Unset | str = UNSET + multi_leg_reporting_type: Unset | MultiLegReportingType = UNSET + optional_data: Unset | "ExecutionOptionalData" = UNSET + order_flags: Unset | int = UNSET + ord_status: Unset | OrdStatus = UNSET + ord_type: Unset | OrdType = UNSET + origination_type: Unset | OriginationType = UNSET + orig_ord_id: Unset | str = UNSET + parent_ord_id: Unset | str = UNSET + perm_ord_id: Unset | str = UNSET + position_effect: Unset | PositionEffect = UNSET + price: Unset | float = UNSET + price_type: Unset | PriceType = UNSET + qty: Unset | float = UNSET + route: Unset | str = UNSET + routing_session: Unset | str = UNSET + security: Unset | "Security" = UNSET + side: Unset | Side = UNSET + source: Unset | str = UNSET + symbol: Unset | str = UNSET + tag: Unset | str = UNSET + text: Unset | str = UNSET + tif: Unset | Tif = UNSET + trader_id: Unset | str = UNSET + transact_ts: Unset | str = UNSET + user_id: Unset | int = UNSET + working_qty: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + algo: Unset | dict[str, Any] = UNSET + if not isinstance(self.algo, Unset): + algo = self.algo.to_dict() + + alloc_id = self.alloc_id + + aux_price = self.aux_price + + avg_price = self.avg_price + + claimed_by = self.claimed_by + + clearing_info: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_info, Unset): + clearing_info = self.clearing_info.to_dict() + + commission = self.commission + + cum_qty = self.cum_qty + + cur_ord_id = self.cur_ord_id + + exec_broker = self.exec_broker + + exec_id = self.exec_id + + exec_ref_id = self.exec_ref_id + + exec_type: Unset | str = UNSET + if not isinstance(self.exec_type, Unset): + exec_type = self.exec_type.value + + fee1 = self.fee1 + + fee2 = self.fee2 + + header: Unset | dict[str, Any] = UNSET + if not isinstance(self.header, Unset): + header = self.header.to_dict() + + incoming_cl_ord_id = self.incoming_cl_ord_id + + incoming_ord_id = self.incoming_ord_id + + incoming_orig_cl_ord_id = self.incoming_orig_cl_ord_id + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + last_market = self.last_market + + last_price = self.last_price + + last_qty = self.last_qty + + leaves_qty = self.leaves_qty + + leg_id = self.leg_id + + liquidity_flag = self.liquidity_flag + + multi_leg_reporting_type: Unset | str = UNSET + if not isinstance(self.multi_leg_reporting_type, Unset): + multi_leg_reporting_type = self.multi_leg_reporting_type.value + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + order_flags = self.order_flags + + ord_status: Unset | str = UNSET + if not isinstance(self.ord_status, Unset): + ord_status = self.ord_status.value + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + origination_type: Unset | str = UNSET + if not isinstance(self.origination_type, Unset): + origination_type = self.origination_type.value + + orig_ord_id = self.orig_ord_id + + parent_ord_id = self.parent_ord_id + + perm_ord_id = self.perm_ord_id + + position_effect: Unset | str = UNSET + if not isinstance(self.position_effect, Unset): + position_effect = self.position_effect.value + + price = self.price + + price_type: Unset | str = UNSET + if not isinstance(self.price_type, Unset): + price_type = self.price_type.value + + qty = self.qty + + route = self.route + + routing_session = self.routing_session + + security: Unset | dict[str, Any] = UNSET + if not isinstance(self.security, Unset): + security = self.security.to_dict() + + side: Unset | str = UNSET + if not isinstance(self.side, Unset): + side = self.side.value + + source = self.source + + symbol = self.symbol + + tag = self.tag + + text = self.text + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + trader_id = self.trader_id + + transact_ts = self.transact_ts + + user_id = self.user_id + + working_qty = self.working_qty + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if algo is not UNSET: + field_dict["algo"] = algo + if alloc_id is not UNSET: + field_dict["allocId"] = alloc_id + if aux_price is not UNSET: + field_dict["auxPrice"] = aux_price + if avg_price is not UNSET: + field_dict["avgPrice"] = avg_price + if claimed_by is not UNSET: + field_dict["claimedBy"] = claimed_by + if clearing_info is not UNSET: + field_dict["clearingInfo"] = clearing_info + if commission is not UNSET: + field_dict["commission"] = commission + if cum_qty is not UNSET: + field_dict["cumQty"] = cum_qty + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if exec_broker is not UNSET: + field_dict["execBroker"] = exec_broker + if exec_id is not UNSET: + field_dict["execId"] = exec_id + if exec_ref_id is not UNSET: + field_dict["execRefId"] = exec_ref_id + if exec_type is not UNSET: + field_dict["execType"] = exec_type + if fee1 is not UNSET: + field_dict["fee1"] = fee1 + if fee2 is not UNSET: + field_dict["fee2"] = fee2 + if header is not UNSET: + field_dict["header"] = header + if incoming_cl_ord_id is not UNSET: + field_dict["incomingClOrdId"] = incoming_cl_ord_id + if incoming_ord_id is not UNSET: + field_dict["incomingOrdId"] = incoming_ord_id + if incoming_orig_cl_ord_id is not UNSET: + field_dict["incomingOrigClOrdId"] = incoming_orig_cl_ord_id + if instructions is not UNSET: + field_dict["instructions"] = instructions + if last_market is not UNSET: + field_dict["lastMarket"] = last_market + if last_price is not UNSET: + field_dict["lastPrice"] = last_price + if last_qty is not UNSET: + field_dict["lastQty"] = last_qty + if leaves_qty is not UNSET: + field_dict["leavesQty"] = leaves_qty + if leg_id is not UNSET: + field_dict["legId"] = leg_id + if liquidity_flag is not UNSET: + field_dict["liquidityFlag"] = liquidity_flag + if multi_leg_reporting_type is not UNSET: + field_dict["multiLegReportingType"] = multi_leg_reporting_type + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if order_flags is not UNSET: + field_dict["orderFlags"] = order_flags + if ord_status is not UNSET: + field_dict["ordStatus"] = ord_status + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if origination_type is not UNSET: + field_dict["originationType"] = origination_type + if orig_ord_id is not UNSET: + field_dict["origOrdId"] = orig_ord_id + if parent_ord_id is not UNSET: + field_dict["parentOrdId"] = parent_ord_id + if perm_ord_id is not UNSET: + field_dict["permOrdId"] = perm_ord_id + if position_effect is not UNSET: + field_dict["positionEffect"] = position_effect + if price is not UNSET: + field_dict["price"] = price + if price_type is not UNSET: + field_dict["priceType"] = price_type + if qty is not UNSET: + field_dict["qty"] = qty + if route is not UNSET: + field_dict["route"] = route + if routing_session is not UNSET: + field_dict["routingSession"] = routing_session + if security is not UNSET: + field_dict["security"] = security + if side is not UNSET: + field_dict["side"] = side + if source is not UNSET: + field_dict["source"] = source + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tag is not UNSET: + field_dict["tag"] = tag + if text is not UNSET: + field_dict["text"] = text + if tif is not UNSET: + field_dict["tif"] = tif + if trader_id is not UNSET: + field_dict["traderId"] = trader_id + if transact_ts is not UNSET: + field_dict["transactTs"] = transact_ts + if user_id is not UNSET: + field_dict["userId"] = user_id + if working_qty is not UNSET: + field_dict["workingQty"] = working_qty + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + _algo = d.pop("algo", UNSET) + algo: Unset | ExecutionAlgo + if isinstance(_algo, Unset): + algo = UNSET + else: + algo = ExecutionAlgo.from_dict(_algo) + + alloc_id = d.pop("allocId", UNSET) + + aux_price = d.pop("auxPrice", UNSET) + + avg_price = d.pop("avgPrice", UNSET) + + claimed_by = d.pop("claimedBy", UNSET) + + _clearing_info = d.pop("clearingInfo", UNSET) + clearing_info: Unset | ClearingInfo + if isinstance(_clearing_info, Unset): + clearing_info = UNSET + else: + clearing_info = ClearingInfo.from_dict(_clearing_info) + + commission = d.pop("commission", UNSET) + + cum_qty = d.pop("cumQty", UNSET) + + cur_ord_id = d.pop("curOrdId", UNSET) + + exec_broker = d.pop("execBroker", UNSET) + + exec_id = d.pop("execId", UNSET) + + exec_ref_id = d.pop("execRefId", UNSET) + + _exec_type = d.pop("execType", UNSET) + exec_type: Unset | ExecType + if isinstance(_exec_type, Unset): + exec_type = UNSET + else: + exec_type = ExecType(_exec_type) + + fee1 = d.pop("fee1", UNSET) + + fee2 = d.pop("fee2", UNSET) + + _header = d.pop("header", UNSET) + header: Unset | Header + if isinstance(_header, Unset): + header = UNSET + else: + header = Header.from_dict(_header) + + incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) + + incoming_ord_id = d.pop("incomingOrdId", UNSET) + + incoming_orig_cl_ord_id = d.pop("incomingOrigClOrdId", UNSET) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + last_market = d.pop("lastMarket", UNSET) + + last_price = d.pop("lastPrice", UNSET) + + last_qty = d.pop("lastQty", UNSET) + + leaves_qty = d.pop("leavesQty", UNSET) + + leg_id = d.pop("legId", UNSET) + + liquidity_flag = d.pop("liquidityFlag", UNSET) + + _multi_leg_reporting_type = d.pop("multiLegReportingType", UNSET) + multi_leg_reporting_type: Unset | MultiLegReportingType + if isinstance(_multi_leg_reporting_type, Unset): + multi_leg_reporting_type = UNSET + else: + multi_leg_reporting_type = MultiLegReportingType(_multi_leg_reporting_type) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | ExecutionOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = ExecutionOptionalData.from_dict(_optional_data) + + order_flags = d.pop("orderFlags", UNSET) + + _ord_status = d.pop("ordStatus", UNSET) + ord_status: Unset | OrdStatus + if isinstance(_ord_status, Unset): + ord_status = UNSET + else: + ord_status = OrdStatus(_ord_status) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + _origination_type = d.pop("originationType", UNSET) + origination_type: Unset | OriginationType + if isinstance(_origination_type, Unset): + origination_type = UNSET + else: + origination_type = OriginationType(_origination_type) + + orig_ord_id = d.pop("origOrdId", UNSET) + + parent_ord_id = d.pop("parentOrdId", UNSET) + + perm_ord_id = d.pop("permOrdId", UNSET) + + _position_effect = d.pop("positionEffect", UNSET) + position_effect: Unset | PositionEffect + if isinstance(_position_effect, Unset): + position_effect = UNSET + else: + position_effect = PositionEffect(_position_effect) + + price = d.pop("price", UNSET) + + _price_type = d.pop("priceType", UNSET) + price_type: Unset | PriceType + if isinstance(_price_type, Unset): + price_type = UNSET + else: + price_type = PriceType(_price_type) + + qty = d.pop("qty", UNSET) + + route = d.pop("route", UNSET) + + routing_session = d.pop("routingSession", UNSET) + + _security = d.pop("security", UNSET) + security: Unset | Security + if isinstance(_security, Unset): + security = UNSET + else: + security = Security.from_dict(_security) + + _side = d.pop("side", UNSET) + side: Unset | Side + if isinstance(_side, Unset): + side = UNSET + else: + side = Side(_side) + + source = d.pop("source", UNSET) + + symbol = d.pop("symbol", UNSET) + + tag = d.pop("tag", UNSET) + + text = d.pop("text", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + trader_id = d.pop("traderId", UNSET) + + transact_ts = d.pop("transactTs", UNSET) + + user_id = d.pop("userId", UNSET) + + working_qty = d.pop("workingQty", UNSET) + + execution = cls( + account_id=account_id, + algo=algo, + alloc_id=alloc_id, + aux_price=aux_price, + avg_price=avg_price, + claimed_by=claimed_by, + clearing_info=clearing_info, + commission=commission, + cum_qty=cum_qty, + cur_ord_id=cur_ord_id, + exec_broker=exec_broker, + exec_id=exec_id, + exec_ref_id=exec_ref_id, + exec_type=exec_type, + fee1=fee1, + fee2=fee2, + header=header, + incoming_cl_ord_id=incoming_cl_ord_id, + incoming_ord_id=incoming_ord_id, + incoming_orig_cl_ord_id=incoming_orig_cl_ord_id, + instructions=instructions, + last_market=last_market, + last_price=last_price, + last_qty=last_qty, + leaves_qty=leaves_qty, + leg_id=leg_id, + liquidity_flag=liquidity_flag, + multi_leg_reporting_type=multi_leg_reporting_type, + optional_data=optional_data, + order_flags=order_flags, + ord_status=ord_status, + ord_type=ord_type, + origination_type=origination_type, + orig_ord_id=orig_ord_id, + parent_ord_id=parent_ord_id, + perm_ord_id=perm_ord_id, + position_effect=position_effect, + price=price, + price_type=price_type, + qty=qty, + route=route, + routing_session=routing_session, + security=security, + side=side, + source=source, + symbol=symbol, + tag=tag, + text=text, + tif=tif, + trader_id=trader_id, + transact_ts=transact_ts, + user_id=user_id, + working_qty=working_qty, + ) + + return execution diff --git a/openapi_project/openapi_package/models/execution_algo.py b/openapi_project/openapi_package/models/execution_algo.py new file mode 100644 index 000000000..7d067b654 --- /dev/null +++ b/openapi_project/openapi_package/models/execution_algo.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="ExecutionAlgo") + + + +@_attrs_define +class ExecutionAlgo: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + execution_algo = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + execution_algo.additional_properties = additional_properties + return execution_algo + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/execution_optional_data.py b/openapi_project/openapi_package/models/execution_optional_data.py new file mode 100644 index 000000000..6214e0765 --- /dev/null +++ b/openapi_project/openapi_package/models/execution_optional_data.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="ExecutionOptionalData") + + + +@_attrs_define +class ExecutionOptionalData: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + execution_optional_data = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + execution_optional_data.additional_properties = additional_properties + return execution_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/flex_option.py b/openapi_project/openapi_package/models/flex_option.py new file mode 100644 index 000000000..32f581fb7 --- /dev/null +++ b/openapi_project/openapi_package/models/flex_option.py @@ -0,0 +1,446 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.currency import Currency +from ..models.exchange_code import ExchangeCode +from ..models.numeric_display_format import NumericDisplayFormat +from ..models.option_exercise_style import OptionExerciseStyle +from ..models.option_series_product_type import OptionSeriesProductType +from ..models.option_settlement_type import OptionSettlementType +from ..models.put_call import PutCall +from ..models.security_category import SecurityCategory +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.flex_option_aliases import FlexOptionAliases + from ..models.date import Date + + +T = TypeVar("T", bound="FlexOption") + + +@_attrs_define +class FlexOption: + """ + Attributes: + aliases (Unset | FlexOptionAliases): + currency (Unset | Currency): + listed_dt (Unset | Date): + delisted_dt (Unset | Date): + description (Unset | str): + exchange_id (Unset | int): + id (Unset | int): + multiplier (Unset | float): + price_base_factor (Unset | float): + price_display_factor (Unset | float): + price_display_format (Unset | NumericDisplayFormat): + qty_display_factor (Unset | float): + qty_display_format (Unset | NumericDisplayFormat): + security_category (Unset | SecurityCategory): + symbol (Unset | str): + tick_rule (Unset | str): + tick_size (Unset | float): + tick_value (Unset | float): + traded_exchanges (Unset | list[ExchangeCode]): + cap_percentage (Unset | float): + creation_dt (Unset | Date): + deliverable_per_contract (Unset | float): + exercise_style (Unset | OptionExerciseStyle): + expiration_dt (Unset | Date): + observation_day (Unset | int): + percentage_pricing (Unset | bool): + product_type (Unset | OptionSeriesProductType): + put_call (Unset | PutCall): + root (Unset | str): + root_base (Unset | str): + settlement_type (Unset | OptionSettlementType): + strike (Unset | float): + underlying (Unset | str): + """ + + aliases: Unset | "FlexOptionAliases" = UNSET + currency: Unset | Currency = UNSET + listed_dt: Unset | "Date" = UNSET + delisted_dt: Unset | "Date" = UNSET + description: Unset | str = UNSET + exchange_id: Unset | int = UNSET + id: Unset | int = UNSET + multiplier: Unset | float = UNSET + price_base_factor: Unset | float = UNSET + price_display_factor: Unset | float = UNSET + price_display_format: Unset | NumericDisplayFormat = UNSET + qty_display_factor: Unset | float = UNSET + qty_display_format: Unset | NumericDisplayFormat = UNSET + security_category: Unset | SecurityCategory = UNSET + symbol: Unset | str = UNSET + tick_rule: Unset | str = UNSET + tick_size: Unset | float = UNSET + tick_value: Unset | float = UNSET + traded_exchanges: Unset | list[ExchangeCode] = UNSET + cap_percentage: Unset | float = UNSET + creation_dt: Unset | "Date" = UNSET + deliverable_per_contract: Unset | float = UNSET + exercise_style: Unset | OptionExerciseStyle = UNSET + expiration_dt: Unset | "Date" = UNSET + observation_day: Unset | int = UNSET + percentage_pricing: Unset | bool = UNSET + product_type: Unset | OptionSeriesProductType = UNSET + put_call: Unset | PutCall = UNSET + root: Unset | str = UNSET + root_base: Unset | str = UNSET + settlement_type: Unset | OptionSettlementType = UNSET + strike: Unset | float = UNSET + underlying: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + aliases: Unset | dict[str, Any] = UNSET + if not isinstance(self.aliases, Unset): + aliases = self.aliases.to_dict() + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + listed_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.listed_dt, Unset): + listed_dt = self.listed_dt.to_dict() + + delisted_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.delisted_dt, Unset): + delisted_dt = self.delisted_dt.to_dict() + + description = self.description + + exchange_id = self.exchange_id + + id = self.id + + multiplier = self.multiplier + + price_base_factor = self.price_base_factor + + price_display_factor = self.price_display_factor + + price_display_format: Unset | str = UNSET + if not isinstance(self.price_display_format, Unset): + price_display_format = self.price_display_format.value + + qty_display_factor = self.qty_display_factor + + qty_display_format: Unset | str = UNSET + if not isinstance(self.qty_display_format, Unset): + qty_display_format = self.qty_display_format.value + + security_category: Unset | str = UNSET + if not isinstance(self.security_category, Unset): + security_category = self.security_category.value + + symbol = self.symbol + + tick_rule = self.tick_rule + + tick_size = self.tick_size + + tick_value = self.tick_value + + traded_exchanges: Unset | list[str] = UNSET + if not isinstance(self.traded_exchanges, Unset): + traded_exchanges = [] + for traded_exchanges_item_data in self.traded_exchanges: + traded_exchanges_item = traded_exchanges_item_data.value + traded_exchanges.append(traded_exchanges_item) + + cap_percentage = self.cap_percentage + + creation_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.creation_dt, Unset): + creation_dt = self.creation_dt.to_dict() + + deliverable_per_contract = self.deliverable_per_contract + + exercise_style: Unset | str = UNSET + if not isinstance(self.exercise_style, Unset): + exercise_style = self.exercise_style.value + + expiration_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.expiration_dt, Unset): + expiration_dt = self.expiration_dt.to_dict() + + observation_day = self.observation_day + + percentage_pricing = self.percentage_pricing + + product_type: Unset | str = UNSET + if not isinstance(self.product_type, Unset): + product_type = self.product_type.value + + put_call: Unset | str = UNSET + if not isinstance(self.put_call, Unset): + put_call = self.put_call.value + + root = self.root + + root_base = self.root_base + + settlement_type: Unset | str = UNSET + if not isinstance(self.settlement_type, Unset): + settlement_type = self.settlement_type.value + + strike = self.strike + + underlying = self.underlying + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if aliases is not UNSET: + field_dict["aliases"] = aliases + if currency is not UNSET: + field_dict["currency"] = currency + if listed_dt is not UNSET: + field_dict["listedDt"] = listed_dt + if delisted_dt is not UNSET: + field_dict["delistedDt"] = delisted_dt + if description is not UNSET: + field_dict["description"] = description + if exchange_id is not UNSET: + field_dict["exchangeId"] = exchange_id + if id is not UNSET: + field_dict["id"] = id + if multiplier is not UNSET: + field_dict["multiplier"] = multiplier + if price_base_factor is not UNSET: + field_dict["priceBaseFactor"] = price_base_factor + if price_display_factor is not UNSET: + field_dict["priceDisplayFactor"] = price_display_factor + if price_display_format is not UNSET: + field_dict["priceDisplayFormat"] = price_display_format + if qty_display_factor is not UNSET: + field_dict["qtyDisplayFactor"] = qty_display_factor + if qty_display_format is not UNSET: + field_dict["qtyDisplayFormat"] = qty_display_format + if security_category is not UNSET: + field_dict["securityCategory"] = security_category + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tick_rule is not UNSET: + field_dict["tickRule"] = tick_rule + if tick_size is not UNSET: + field_dict["tickSize"] = tick_size + if tick_value is not UNSET: + field_dict["tickValue"] = tick_value + if traded_exchanges is not UNSET: + field_dict["tradedExchanges"] = traded_exchanges + if cap_percentage is not UNSET: + field_dict["capPercentage"] = cap_percentage + if creation_dt is not UNSET: + field_dict["creationDt"] = creation_dt + if deliverable_per_contract is not UNSET: + field_dict["deliverablePerContract"] = deliverable_per_contract + if exercise_style is not UNSET: + field_dict["exerciseStyle"] = exercise_style + if expiration_dt is not UNSET: + field_dict["expirationDt"] = expiration_dt + if observation_day is not UNSET: + field_dict["observationDay"] = observation_day + if percentage_pricing is not UNSET: + field_dict["percentagePricing"] = percentage_pricing + if product_type is not UNSET: + field_dict["productType"] = product_type + if put_call is not UNSET: + field_dict["putCall"] = put_call + if root is not UNSET: + field_dict["root"] = root + if root_base is not UNSET: + field_dict["rootBase"] = root_base + if settlement_type is not UNSET: + field_dict["settlementType"] = settlement_type + if strike is not UNSET: + field_dict["strike"] = strike + if underlying is not UNSET: + field_dict["underlying"] = underlying + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _aliases = d.pop("aliases", UNSET) + aliases: Unset | FlexOptionAliases + if isinstance(_aliases, Unset): + aliases = UNSET + else: + aliases = FlexOptionAliases.from_dict(_aliases) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + _listed_dt = d.pop("listedDt", UNSET) + listed_dt: Unset | Date + if isinstance(_listed_dt, Unset): + listed_dt = UNSET + else: + listed_dt = Date.from_dict(_listed_dt) + + _delisted_dt = d.pop("delistedDt", UNSET) + delisted_dt: Unset | Date + if isinstance(_delisted_dt, Unset): + delisted_dt = UNSET + else: + delisted_dt = Date.from_dict(_delisted_dt) + + description = d.pop("description", UNSET) + + exchange_id = d.pop("exchangeId", UNSET) + + id = d.pop("id", UNSET) + + multiplier = d.pop("multiplier", UNSET) + + price_base_factor = d.pop("priceBaseFactor", UNSET) + + price_display_factor = d.pop("priceDisplayFactor", UNSET) + + _price_display_format = d.pop("priceDisplayFormat", UNSET) + price_display_format: Unset | NumericDisplayFormat + if isinstance(_price_display_format, Unset): + price_display_format = UNSET + else: + price_display_format = NumericDisplayFormat(_price_display_format) + + qty_display_factor = d.pop("qtyDisplayFactor", UNSET) + + _qty_display_format = d.pop("qtyDisplayFormat", UNSET) + qty_display_format: Unset | NumericDisplayFormat + if isinstance(_qty_display_format, Unset): + qty_display_format = UNSET + else: + qty_display_format = NumericDisplayFormat(_qty_display_format) + + _security_category = d.pop("securityCategory", UNSET) + security_category: Unset | SecurityCategory + if isinstance(_security_category, Unset): + security_category = UNSET + else: + security_category = SecurityCategory(_security_category) + + symbol = d.pop("symbol", UNSET) + + tick_rule = d.pop("tickRule", UNSET) + + tick_size = d.pop("tickSize", UNSET) + + tick_value = d.pop("tickValue", UNSET) + + traded_exchanges = [] + _traded_exchanges = d.pop("tradedExchanges", UNSET) + for traded_exchanges_item_data in _traded_exchanges or []: + traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) + + traded_exchanges.append(traded_exchanges_item) + + cap_percentage = d.pop("capPercentage", UNSET) + + _creation_dt = d.pop("creationDt", UNSET) + creation_dt: Unset | Date + if isinstance(_creation_dt, Unset): + creation_dt = UNSET + else: + creation_dt = Date.from_dict(_creation_dt) + + deliverable_per_contract = d.pop("deliverablePerContract", UNSET) + + _exercise_style = d.pop("exerciseStyle", UNSET) + exercise_style: Unset | OptionExerciseStyle + if isinstance(_exercise_style, Unset): + exercise_style = UNSET + else: + exercise_style = OptionExerciseStyle(_exercise_style) + + _expiration_dt = d.pop("expirationDt", UNSET) + expiration_dt: Unset | Date + if isinstance(_expiration_dt, Unset): + expiration_dt = UNSET + else: + expiration_dt = Date.from_dict(_expiration_dt) + + observation_day = d.pop("observationDay", UNSET) + + percentage_pricing = d.pop("percentagePricing", UNSET) + + _product_type = d.pop("productType", UNSET) + product_type: Unset | OptionSeriesProductType + if isinstance(_product_type, Unset): + product_type = UNSET + else: + product_type = OptionSeriesProductType(_product_type) + + _put_call = d.pop("putCall", UNSET) + put_call: Unset | PutCall + if isinstance(_put_call, Unset): + put_call = UNSET + else: + put_call = PutCall(_put_call) + + root = d.pop("root", UNSET) + + root_base = d.pop("rootBase", UNSET) + + _settlement_type = d.pop("settlementType", UNSET) + settlement_type: Unset | OptionSettlementType + if isinstance(_settlement_type, Unset): + settlement_type = UNSET + else: + settlement_type = OptionSettlementType(_settlement_type) + + strike = d.pop("strike", UNSET) + + underlying = d.pop("underlying", UNSET) + + flex_option = cls( + aliases=aliases, + currency=currency, + listed_dt=listed_dt, + delisted_dt=delisted_dt, + description=description, + exchange_id=exchange_id, + id=id, + multiplier=multiplier, + price_base_factor=price_base_factor, + price_display_factor=price_display_factor, + price_display_format=price_display_format, + qty_display_factor=qty_display_factor, + qty_display_format=qty_display_format, + security_category=security_category, + symbol=symbol, + tick_rule=tick_rule, + tick_size=tick_size, + tick_value=tick_value, + traded_exchanges=traded_exchanges, + cap_percentage=cap_percentage, + creation_dt=creation_dt, + deliverable_per_contract=deliverable_per_contract, + exercise_style=exercise_style, + expiration_dt=expiration_dt, + observation_day=observation_day, + percentage_pricing=percentage_pricing, + product_type=product_type, + put_call=put_call, + root=root, + root_base=root_base, + settlement_type=settlement_type, + strike=strike, + underlying=underlying, + ) + + return flex_option diff --git a/openapi_project/openapi_package/models/flex_option_aliases.py b/openapi_project/openapi_package/models/flex_option_aliases.py new file mode 100644 index 000000000..b181a7352 --- /dev/null +++ b/openapi_project/openapi_package/models/flex_option_aliases.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="FlexOptionAliases") + + + +@_attrs_define +class FlexOptionAliases: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + flex_option_aliases = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + flex_option_aliases.additional_properties = additional_properties + return flex_option_aliases + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/flex_settlement_type.py b/openapi_project/openapi_package/models/flex_settlement_type.py new file mode 100644 index 000000000..4c2b8eb1a --- /dev/null +++ b/openapi_project/openapi_package/models/flex_settlement_type.py @@ -0,0 +1,12 @@ +from enum import Enum + + +class FlexSettlementType(str, Enum): + FLEX_SETTLEMENT_TYPE_AM = "FLEX_SETTLEMENT_TYPE_AM" + FLEX_SETTLEMENT_TYPE_ASIAN = "FLEX_SETTLEMENT_TYPE_ASIAN" + FLEX_SETTLEMENT_TYPE_CLIQUET = "FLEX_SETTLEMENT_TYPE_CLIQUET" + FLEX_SETTLEMENT_TYPE_PM = "FLEX_SETTLEMENT_TYPE_PM" + FLEX_SETTLEMENT_TYPE_PM_CASH = "FLEX_SETTLEMENT_TYPE_PM_CASH" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/future.py b/openapi_project/openapi_package/models/future.py new file mode 100644 index 000000000..b491f14b1 --- /dev/null +++ b/openapi_project/openapi_package/models/future.py @@ -0,0 +1,364 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.currency import Currency +from ..models.exchange_code import ExchangeCode +from ..models.numeric_display_format import NumericDisplayFormat +from ..models.security_category import SecurityCategory +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.future_root import FutureRoot + from ..models.date import Date + from ..models.future_aliases import FutureAliases + + +T = TypeVar("T", bound="Future") + + +@_attrs_define +class Future: + """ + Attributes: + aliases (Unset | FutureAliases): + currency (Unset | Currency): + listed_dt (Unset | Date): + delisted_dt (Unset | Date): + description (Unset | str): + exchange_id (Unset | int): + id (Unset | int): + multiplier (Unset | float): + price_base_factor (Unset | float): + price_display_factor (Unset | float): + price_display_format (Unset | NumericDisplayFormat): + qty_display_factor (Unset | float): + qty_display_format (Unset | NumericDisplayFormat): + security_category (Unset | SecurityCategory): + symbol (Unset | str): + tick_rule (Unset | str): + tick_size (Unset | float): + tick_value (Unset | float): + traded_exchanges (Unset | list[ExchangeCode]): + contract_myy (Unset | str): + first_notice_dt (Unset | Date): + first_trade_dt (Unset | Date): + last_notice_dt (Unset | Date): + last_trade_dt (Unset | Date): + root (Unset | FutureRoot): + """ + + aliases: Unset | "FutureAliases" = UNSET + currency: Unset | Currency = UNSET + listed_dt: Unset | "Date" = UNSET + delisted_dt: Unset | "Date" = UNSET + description: Unset | str = UNSET + exchange_id: Unset | int = UNSET + id: Unset | int = UNSET + multiplier: Unset | float = UNSET + price_base_factor: Unset | float = UNSET + price_display_factor: Unset | float = UNSET + price_display_format: Unset | NumericDisplayFormat = UNSET + qty_display_factor: Unset | float = UNSET + qty_display_format: Unset | NumericDisplayFormat = UNSET + security_category: Unset | SecurityCategory = UNSET + symbol: Unset | str = UNSET + tick_rule: Unset | str = UNSET + tick_size: Unset | float = UNSET + tick_value: Unset | float = UNSET + traded_exchanges: Unset | list[ExchangeCode] = UNSET + contract_myy: Unset | str = UNSET + first_notice_dt: Unset | "Date" = UNSET + first_trade_dt: Unset | "Date" = UNSET + last_notice_dt: Unset | "Date" = UNSET + last_trade_dt: Unset | "Date" = UNSET + root: Unset | "FutureRoot" = UNSET + + def to_dict(self) -> dict[str, Any]: + aliases: Unset | dict[str, Any] = UNSET + if not isinstance(self.aliases, Unset): + aliases = self.aliases.to_dict() + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + listed_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.listed_dt, Unset): + listed_dt = self.listed_dt.to_dict() + + delisted_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.delisted_dt, Unset): + delisted_dt = self.delisted_dt.to_dict() + + description = self.description + + exchange_id = self.exchange_id + + id = self.id + + multiplier = self.multiplier + + price_base_factor = self.price_base_factor + + price_display_factor = self.price_display_factor + + price_display_format: Unset | str = UNSET + if not isinstance(self.price_display_format, Unset): + price_display_format = self.price_display_format.value + + qty_display_factor = self.qty_display_factor + + qty_display_format: Unset | str = UNSET + if not isinstance(self.qty_display_format, Unset): + qty_display_format = self.qty_display_format.value + + security_category: Unset | str = UNSET + if not isinstance(self.security_category, Unset): + security_category = self.security_category.value + + symbol = self.symbol + + tick_rule = self.tick_rule + + tick_size = self.tick_size + + tick_value = self.tick_value + + traded_exchanges: Unset | list[str] = UNSET + if not isinstance(self.traded_exchanges, Unset): + traded_exchanges = [] + for traded_exchanges_item_data in self.traded_exchanges: + traded_exchanges_item = traded_exchanges_item_data.value + traded_exchanges.append(traded_exchanges_item) + + contract_myy = self.contract_myy + + first_notice_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.first_notice_dt, Unset): + first_notice_dt = self.first_notice_dt.to_dict() + + first_trade_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.first_trade_dt, Unset): + first_trade_dt = self.first_trade_dt.to_dict() + + last_notice_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.last_notice_dt, Unset): + last_notice_dt = self.last_notice_dt.to_dict() + + last_trade_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.last_trade_dt, Unset): + last_trade_dt = self.last_trade_dt.to_dict() + + root: Unset | dict[str, Any] = UNSET + if not isinstance(self.root, Unset): + root = self.root.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if aliases is not UNSET: + field_dict["aliases"] = aliases + if currency is not UNSET: + field_dict["currency"] = currency + if listed_dt is not UNSET: + field_dict["listedDt"] = listed_dt + if delisted_dt is not UNSET: + field_dict["delistedDt"] = delisted_dt + if description is not UNSET: + field_dict["description"] = description + if exchange_id is not UNSET: + field_dict["exchangeId"] = exchange_id + if id is not UNSET: + field_dict["id"] = id + if multiplier is not UNSET: + field_dict["multiplier"] = multiplier + if price_base_factor is not UNSET: + field_dict["priceBaseFactor"] = price_base_factor + if price_display_factor is not UNSET: + field_dict["priceDisplayFactor"] = price_display_factor + if price_display_format is not UNSET: + field_dict["priceDisplayFormat"] = price_display_format + if qty_display_factor is not UNSET: + field_dict["qtyDisplayFactor"] = qty_display_factor + if qty_display_format is not UNSET: + field_dict["qtyDisplayFormat"] = qty_display_format + if security_category is not UNSET: + field_dict["securityCategory"] = security_category + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tick_rule is not UNSET: + field_dict["tickRule"] = tick_rule + if tick_size is not UNSET: + field_dict["tickSize"] = tick_size + if tick_value is not UNSET: + field_dict["tickValue"] = tick_value + if traded_exchanges is not UNSET: + field_dict["tradedExchanges"] = traded_exchanges + if contract_myy is not UNSET: + field_dict["contractMYY"] = contract_myy + if first_notice_dt is not UNSET: + field_dict["firstNoticeDt"] = first_notice_dt + if first_trade_dt is not UNSET: + field_dict["firstTradeDt"] = first_trade_dt + if last_notice_dt is not UNSET: + field_dict["lastNoticeDt"] = last_notice_dt + if last_trade_dt is not UNSET: + field_dict["lastTradeDt"] = last_trade_dt + if root is not UNSET: + field_dict["root"] = root + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _aliases = d.pop("aliases", UNSET) + aliases: Unset | FutureAliases + if isinstance(_aliases, Unset): + aliases = UNSET + else: + aliases = FutureAliases.from_dict(_aliases) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + _listed_dt = d.pop("listedDt", UNSET) + listed_dt: Unset | Date + if isinstance(_listed_dt, Unset): + listed_dt = UNSET + else: + listed_dt = Date.from_dict(_listed_dt) + + _delisted_dt = d.pop("delistedDt", UNSET) + delisted_dt: Unset | Date + if isinstance(_delisted_dt, Unset): + delisted_dt = UNSET + else: + delisted_dt = Date.from_dict(_delisted_dt) + + description = d.pop("description", UNSET) + + exchange_id = d.pop("exchangeId", UNSET) + + id = d.pop("id", UNSET) + + multiplier = d.pop("multiplier", UNSET) + + price_base_factor = d.pop("priceBaseFactor", UNSET) + + price_display_factor = d.pop("priceDisplayFactor", UNSET) + + _price_display_format = d.pop("priceDisplayFormat", UNSET) + price_display_format: Unset | NumericDisplayFormat + if isinstance(_price_display_format, Unset): + price_display_format = UNSET + else: + price_display_format = NumericDisplayFormat(_price_display_format) + + qty_display_factor = d.pop("qtyDisplayFactor", UNSET) + + _qty_display_format = d.pop("qtyDisplayFormat", UNSET) + qty_display_format: Unset | NumericDisplayFormat + if isinstance(_qty_display_format, Unset): + qty_display_format = UNSET + else: + qty_display_format = NumericDisplayFormat(_qty_display_format) + + _security_category = d.pop("securityCategory", UNSET) + security_category: Unset | SecurityCategory + if isinstance(_security_category, Unset): + security_category = UNSET + else: + security_category = SecurityCategory(_security_category) + + symbol = d.pop("symbol", UNSET) + + tick_rule = d.pop("tickRule", UNSET) + + tick_size = d.pop("tickSize", UNSET) + + tick_value = d.pop("tickValue", UNSET) + + traded_exchanges = [] + _traded_exchanges = d.pop("tradedExchanges", UNSET) + for traded_exchanges_item_data in _traded_exchanges or []: + traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) + + traded_exchanges.append(traded_exchanges_item) + + contract_myy = d.pop("contractMYY", UNSET) + + _first_notice_dt = d.pop("firstNoticeDt", UNSET) + first_notice_dt: Unset | Date + if isinstance(_first_notice_dt, Unset): + first_notice_dt = UNSET + else: + first_notice_dt = Date.from_dict(_first_notice_dt) + + _first_trade_dt = d.pop("firstTradeDt", UNSET) + first_trade_dt: Unset | Date + if isinstance(_first_trade_dt, Unset): + first_trade_dt = UNSET + else: + first_trade_dt = Date.from_dict(_first_trade_dt) + + _last_notice_dt = d.pop("lastNoticeDt", UNSET) + last_notice_dt: Unset | Date + if isinstance(_last_notice_dt, Unset): + last_notice_dt = UNSET + else: + last_notice_dt = Date.from_dict(_last_notice_dt) + + _last_trade_dt = d.pop("lastTradeDt", UNSET) + last_trade_dt: Unset | Date + if isinstance(_last_trade_dt, Unset): + last_trade_dt = UNSET + else: + last_trade_dt = Date.from_dict(_last_trade_dt) + + _root = d.pop("root", UNSET) + root: Unset | FutureRoot + if isinstance(_root, Unset): + root = UNSET + else: + root = FutureRoot.from_dict(_root) + + future = cls( + aliases=aliases, + currency=currency, + listed_dt=listed_dt, + delisted_dt=delisted_dt, + description=description, + exchange_id=exchange_id, + id=id, + multiplier=multiplier, + price_base_factor=price_base_factor, + price_display_factor=price_display_factor, + price_display_format=price_display_format, + qty_display_factor=qty_display_factor, + qty_display_format=qty_display_format, + security_category=security_category, + symbol=symbol, + tick_rule=tick_rule, + tick_size=tick_size, + tick_value=tick_value, + traded_exchanges=traded_exchanges, + contract_myy=contract_myy, + first_notice_dt=first_notice_dt, + first_trade_dt=first_trade_dt, + last_notice_dt=last_notice_dt, + last_trade_dt=last_trade_dt, + root=root, + ) + + return future diff --git a/openapi_project/openapi_package/models/future_aliases.py b/openapi_project/openapi_package/models/future_aliases.py new file mode 100644 index 000000000..e387c648b --- /dev/null +++ b/openapi_project/openapi_package/models/future_aliases.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="FutureAliases") + + + +@_attrs_define +class FutureAliases: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + future_aliases = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + future_aliases.additional_properties = additional_properties + return future_aliases + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/future_root.py b/openapi_project/openapi_package/models/future_root.py new file mode 100644 index 000000000..e0bbf6ffa --- /dev/null +++ b/openapi_project/openapi_package/models/future_root.py @@ -0,0 +1,364 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.currency import Currency +from ..models.exchange_code import ExchangeCode +from ..models.numeric_display_format import NumericDisplayFormat +from ..models.product_group import ProductGroup +from ..models.product_sub_group import ProductSubGroup +from ..models.security_category import SecurityCategory +from ..models.settlement_deliverable_type import SettlementDeliverableType +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.future_root_aliases import FutureRootAliases + from ..models.date import Date + from ..models.trading_session_group import TradingSessionGroup + + +T = TypeVar("T", bound="FutureRoot") + + +@_attrs_define +class FutureRoot: + """ + Attributes: + aliases (Unset | FutureRootAliases): + currency (Unset | Currency): + listed_dt (Unset | Date): + delisted_dt (Unset | Date): + description (Unset | str): + exchange_id (Unset | int): + id (Unset | int): + multiplier (Unset | float): + price_base_factor (Unset | float): + price_display_factor (Unset | float): + price_display_format (Unset | NumericDisplayFormat): + qty_display_factor (Unset | float): + qty_display_format (Unset | NumericDisplayFormat): + security_category (Unset | SecurityCategory): + symbol (Unset | str): + tick_rule (Unset | str): + tick_size (Unset | float): + tick_value (Unset | float): + traded_exchanges (Unset | list[ExchangeCode]): + product_group (Unset | ProductGroup): + product_sub_group (Unset | ProductSubGroup): + settlement_deliverable_type (Unset | SettlementDeliverableType): + unit_of_measure (Unset | str): + unit_of_measure_qty (Unset | float): + trading_session_group (Unset | TradingSessionGroup): + """ + + aliases: Unset | "FutureRootAliases" = UNSET + currency: Unset | Currency = UNSET + listed_dt: Unset | "Date" = UNSET + delisted_dt: Unset | "Date" = UNSET + description: Unset | str = UNSET + exchange_id: Unset | int = UNSET + id: Unset | int = UNSET + multiplier: Unset | float = UNSET + price_base_factor: Unset | float = UNSET + price_display_factor: Unset | float = UNSET + price_display_format: Unset | NumericDisplayFormat = UNSET + qty_display_factor: Unset | float = UNSET + qty_display_format: Unset | NumericDisplayFormat = UNSET + security_category: Unset | SecurityCategory = UNSET + symbol: Unset | str = UNSET + tick_rule: Unset | str = UNSET + tick_size: Unset | float = UNSET + tick_value: Unset | float = UNSET + traded_exchanges: Unset | list[ExchangeCode] = UNSET + product_group: Unset | ProductGroup = UNSET + product_sub_group: Unset | ProductSubGroup = UNSET + settlement_deliverable_type: Unset | SettlementDeliverableType = UNSET + unit_of_measure: Unset | str = UNSET + unit_of_measure_qty: Unset | float = UNSET + trading_session_group: Unset | "TradingSessionGroup" = UNSET + + def to_dict(self) -> dict[str, Any]: + aliases: Unset | dict[str, Any] = UNSET + if not isinstance(self.aliases, Unset): + aliases = self.aliases.to_dict() + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + listed_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.listed_dt, Unset): + listed_dt = self.listed_dt.to_dict() + + delisted_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.delisted_dt, Unset): + delisted_dt = self.delisted_dt.to_dict() + + description = self.description + + exchange_id = self.exchange_id + + id = self.id + + multiplier = self.multiplier + + price_base_factor = self.price_base_factor + + price_display_factor = self.price_display_factor + + price_display_format: Unset | str = UNSET + if not isinstance(self.price_display_format, Unset): + price_display_format = self.price_display_format.value + + qty_display_factor = self.qty_display_factor + + qty_display_format: Unset | str = UNSET + if not isinstance(self.qty_display_format, Unset): + qty_display_format = self.qty_display_format.value + + security_category: Unset | str = UNSET + if not isinstance(self.security_category, Unset): + security_category = self.security_category.value + + symbol = self.symbol + + tick_rule = self.tick_rule + + tick_size = self.tick_size + + tick_value = self.tick_value + + traded_exchanges: Unset | list[str] = UNSET + if not isinstance(self.traded_exchanges, Unset): + traded_exchanges = [] + for traded_exchanges_item_data in self.traded_exchanges: + traded_exchanges_item = traded_exchanges_item_data.value + traded_exchanges.append(traded_exchanges_item) + + product_group: Unset | str = UNSET + if not isinstance(self.product_group, Unset): + product_group = self.product_group.value + + product_sub_group: Unset | str = UNSET + if not isinstance(self.product_sub_group, Unset): + product_sub_group = self.product_sub_group.value + + settlement_deliverable_type: Unset | str = UNSET + if not isinstance(self.settlement_deliverable_type, Unset): + settlement_deliverable_type = self.settlement_deliverable_type.value + + unit_of_measure = self.unit_of_measure + + unit_of_measure_qty = self.unit_of_measure_qty + + trading_session_group: Unset | dict[str, Any] = UNSET + if not isinstance(self.trading_session_group, Unset): + trading_session_group = self.trading_session_group.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if aliases is not UNSET: + field_dict["aliases"] = aliases + if currency is not UNSET: + field_dict["currency"] = currency + if listed_dt is not UNSET: + field_dict["listedDt"] = listed_dt + if delisted_dt is not UNSET: + field_dict["delistedDt"] = delisted_dt + if description is not UNSET: + field_dict["description"] = description + if exchange_id is not UNSET: + field_dict["exchangeId"] = exchange_id + if id is not UNSET: + field_dict["id"] = id + if multiplier is not UNSET: + field_dict["multiplier"] = multiplier + if price_base_factor is not UNSET: + field_dict["priceBaseFactor"] = price_base_factor + if price_display_factor is not UNSET: + field_dict["priceDisplayFactor"] = price_display_factor + if price_display_format is not UNSET: + field_dict["priceDisplayFormat"] = price_display_format + if qty_display_factor is not UNSET: + field_dict["qtyDisplayFactor"] = qty_display_factor + if qty_display_format is not UNSET: + field_dict["qtyDisplayFormat"] = qty_display_format + if security_category is not UNSET: + field_dict["securityCategory"] = security_category + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tick_rule is not UNSET: + field_dict["tickRule"] = tick_rule + if tick_size is not UNSET: + field_dict["tickSize"] = tick_size + if tick_value is not UNSET: + field_dict["tickValue"] = tick_value + if traded_exchanges is not UNSET: + field_dict["tradedExchanges"] = traded_exchanges + if product_group is not UNSET: + field_dict["productGroup"] = product_group + if product_sub_group is not UNSET: + field_dict["productSubGroup"] = product_sub_group + if settlement_deliverable_type is not UNSET: + field_dict["settlementDeliverableType"] = settlement_deliverable_type + if unit_of_measure is not UNSET: + field_dict["unitOfMeasure"] = unit_of_measure + if unit_of_measure_qty is not UNSET: + field_dict["unitOfMeasureQty"] = unit_of_measure_qty + if trading_session_group is not UNSET: + field_dict["tradingSessionGroup"] = trading_session_group + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _aliases = d.pop("aliases", UNSET) + aliases: Unset | FutureRootAliases + if isinstance(_aliases, Unset): + aliases = UNSET + else: + aliases = FutureRootAliases.from_dict(_aliases) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + _listed_dt = d.pop("listedDt", UNSET) + listed_dt: Unset | Date + if isinstance(_listed_dt, Unset): + listed_dt = UNSET + else: + listed_dt = Date.from_dict(_listed_dt) + + _delisted_dt = d.pop("delistedDt", UNSET) + delisted_dt: Unset | Date + if isinstance(_delisted_dt, Unset): + delisted_dt = UNSET + else: + delisted_dt = Date.from_dict(_delisted_dt) + + description = d.pop("description", UNSET) + + exchange_id = d.pop("exchangeId", UNSET) + + id = d.pop("id", UNSET) + + multiplier = d.pop("multiplier", UNSET) + + price_base_factor = d.pop("priceBaseFactor", UNSET) + + price_display_factor = d.pop("priceDisplayFactor", UNSET) + + _price_display_format = d.pop("priceDisplayFormat", UNSET) + price_display_format: Unset | NumericDisplayFormat + if isinstance(_price_display_format, Unset): + price_display_format = UNSET + else: + price_display_format = NumericDisplayFormat(_price_display_format) + + qty_display_factor = d.pop("qtyDisplayFactor", UNSET) + + _qty_display_format = d.pop("qtyDisplayFormat", UNSET) + qty_display_format: Unset | NumericDisplayFormat + if isinstance(_qty_display_format, Unset): + qty_display_format = UNSET + else: + qty_display_format = NumericDisplayFormat(_qty_display_format) + + _security_category = d.pop("securityCategory", UNSET) + security_category: Unset | SecurityCategory + if isinstance(_security_category, Unset): + security_category = UNSET + else: + security_category = SecurityCategory(_security_category) + + symbol = d.pop("symbol", UNSET) + + tick_rule = d.pop("tickRule", UNSET) + + tick_size = d.pop("tickSize", UNSET) + + tick_value = d.pop("tickValue", UNSET) + + traded_exchanges = [] + _traded_exchanges = d.pop("tradedExchanges", UNSET) + for traded_exchanges_item_data in _traded_exchanges or []: + traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) + + traded_exchanges.append(traded_exchanges_item) + + _product_group = d.pop("productGroup", UNSET) + product_group: Unset | ProductGroup + if isinstance(_product_group, Unset): + product_group = UNSET + else: + product_group = ProductGroup(_product_group) + + _product_sub_group = d.pop("productSubGroup", UNSET) + product_sub_group: Unset | ProductSubGroup + if isinstance(_product_sub_group, Unset): + product_sub_group = UNSET + else: + product_sub_group = ProductSubGroup(_product_sub_group) + + _settlement_deliverable_type = d.pop("settlementDeliverableType", UNSET) + settlement_deliverable_type: Unset | SettlementDeliverableType + if isinstance(_settlement_deliverable_type, Unset): + settlement_deliverable_type = UNSET + else: + settlement_deliverable_type = SettlementDeliverableType( + _settlement_deliverable_type + ) + + unit_of_measure = d.pop("unitOfMeasure", UNSET) + + unit_of_measure_qty = d.pop("unitOfMeasureQty", UNSET) + + _trading_session_group = d.pop("tradingSessionGroup", UNSET) + trading_session_group: Unset | TradingSessionGroup + if isinstance(_trading_session_group, Unset): + trading_session_group = UNSET + else: + trading_session_group = TradingSessionGroup.from_dict( + _trading_session_group + ) + + future_root = cls( + aliases=aliases, + currency=currency, + listed_dt=listed_dt, + delisted_dt=delisted_dt, + description=description, + exchange_id=exchange_id, + id=id, + multiplier=multiplier, + price_base_factor=price_base_factor, + price_display_factor=price_display_factor, + price_display_format=price_display_format, + qty_display_factor=qty_display_factor, + qty_display_format=qty_display_format, + security_category=security_category, + symbol=symbol, + tick_rule=tick_rule, + tick_size=tick_size, + tick_value=tick_value, + traded_exchanges=traded_exchanges, + product_group=product_group, + product_sub_group=product_sub_group, + settlement_deliverable_type=settlement_deliverable_type, + unit_of_measure=unit_of_measure, + unit_of_measure_qty=unit_of_measure_qty, + trading_session_group=trading_session_group, + ) + + return future_root diff --git a/openapi_project/openapi_package/models/future_root_aliases.py b/openapi_project/openapi_package/models/future_root_aliases.py new file mode 100644 index 000000000..1bc59fe59 --- /dev/null +++ b/openapi_project/openapi_package/models/future_root_aliases.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="FutureRootAliases") + + + +@_attrs_define +class FutureRootAliases: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + future_root_aliases = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + future_root_aliases.additional_properties = additional_properties + return future_root_aliases + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/future_spread.py b/openapi_project/openapi_package/models/future_spread.py new file mode 100644 index 000000000..ffd9d8d0c --- /dev/null +++ b/openapi_project/openapi_package/models/future_spread.py @@ -0,0 +1,385 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.currency import Currency +from ..models.exchange_code import ExchangeCode +from ..models.numeric_display_format import NumericDisplayFormat +from ..models.security_category import SecurityCategory +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.date import Date + from ..models.future_spread_aliases import FutureSpreadAliases + from ..models.future_spread_leg import FutureSpreadLeg + + +T = TypeVar("T", bound="FutureSpread") + + +@_attrs_define +class FutureSpread: + """ + Attributes: + aliases (Unset | FutureSpreadAliases): + currency (Unset | Currency): + listed_dt (Unset | Date): + delisted_dt (Unset | Date): + description (Unset | str): + exchange_id (Unset | int): + id (Unset | int): + multiplier (Unset | float): + price_base_factor (Unset | float): + price_display_factor (Unset | float): + price_display_format (Unset | NumericDisplayFormat): + qty_display_factor (Unset | float): + qty_display_format (Unset | NumericDisplayFormat): + security_category (Unset | SecurityCategory): + symbol (Unset | str): + tick_rule (Unset | str): + tick_size (Unset | float): + tick_value (Unset | float): + traded_exchanges (Unset | list[ExchangeCode]): + contract_myy (Unset | str): + display_factor (Unset | float): + first_notice_dt (Unset | Date): + first_trade_dt (Unset | Date): + last_notice_dt (Unset | Date): + last_trade_dt (Unset | Date): + legs (Unset | list['FutureSpreadLeg']): + spread_code (Unset | str): + """ + + aliases: Unset | "FutureSpreadAliases" = UNSET + currency: Unset | Currency = UNSET + listed_dt: Unset | "Date" = UNSET + delisted_dt: Unset | "Date" = UNSET + description: Unset | str = UNSET + exchange_id: Unset | int = UNSET + id: Unset | int = UNSET + multiplier: Unset | float = UNSET + price_base_factor: Unset | float = UNSET + price_display_factor: Unset | float = UNSET + price_display_format: Unset | NumericDisplayFormat = UNSET + qty_display_factor: Unset | float = UNSET + qty_display_format: Unset | NumericDisplayFormat = UNSET + security_category: Unset | SecurityCategory = UNSET + symbol: Unset | str = UNSET + tick_rule: Unset | str = UNSET + tick_size: Unset | float = UNSET + tick_value: Unset | float = UNSET + traded_exchanges: Unset | list[ExchangeCode] = UNSET + contract_myy: Unset | str = UNSET + display_factor: Unset | float = UNSET + first_notice_dt: Unset | "Date" = UNSET + first_trade_dt: Unset | "Date" = UNSET + last_notice_dt: Unset | "Date" = UNSET + last_trade_dt: Unset | "Date" = UNSET + legs: Unset | list["FutureSpreadLeg"] = UNSET + spread_code: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + aliases: Unset | dict[str, Any] = UNSET + if not isinstance(self.aliases, Unset): + aliases = self.aliases.to_dict() + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + listed_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.listed_dt, Unset): + listed_dt = self.listed_dt.to_dict() + + delisted_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.delisted_dt, Unset): + delisted_dt = self.delisted_dt.to_dict() + + description = self.description + + exchange_id = self.exchange_id + + id = self.id + + multiplier = self.multiplier + + price_base_factor = self.price_base_factor + + price_display_factor = self.price_display_factor + + price_display_format: Unset | str = UNSET + if not isinstance(self.price_display_format, Unset): + price_display_format = self.price_display_format.value + + qty_display_factor = self.qty_display_factor + + qty_display_format: Unset | str = UNSET + if not isinstance(self.qty_display_format, Unset): + qty_display_format = self.qty_display_format.value + + security_category: Unset | str = UNSET + if not isinstance(self.security_category, Unset): + security_category = self.security_category.value + + symbol = self.symbol + + tick_rule = self.tick_rule + + tick_size = self.tick_size + + tick_value = self.tick_value + + traded_exchanges: Unset | list[str] = UNSET + if not isinstance(self.traded_exchanges, Unset): + traded_exchanges = [] + for traded_exchanges_item_data in self.traded_exchanges: + traded_exchanges_item = traded_exchanges_item_data.value + traded_exchanges.append(traded_exchanges_item) + + contract_myy = self.contract_myy + + display_factor = self.display_factor + + first_notice_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.first_notice_dt, Unset): + first_notice_dt = self.first_notice_dt.to_dict() + + first_trade_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.first_trade_dt, Unset): + first_trade_dt = self.first_trade_dt.to_dict() + + last_notice_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.last_notice_dt, Unset): + last_notice_dt = self.last_notice_dt.to_dict() + + last_trade_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.last_trade_dt, Unset): + last_trade_dt = self.last_trade_dt.to_dict() + + legs: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.legs, Unset): + legs = [] + for legs_item_data in self.legs: + legs_item = legs_item_data.to_dict() + legs.append(legs_item) + + spread_code = self.spread_code + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if aliases is not UNSET: + field_dict["aliases"] = aliases + if currency is not UNSET: + field_dict["currency"] = currency + if listed_dt is not UNSET: + field_dict["listedDt"] = listed_dt + if delisted_dt is not UNSET: + field_dict["delistedDt"] = delisted_dt + if description is not UNSET: + field_dict["description"] = description + if exchange_id is not UNSET: + field_dict["exchangeId"] = exchange_id + if id is not UNSET: + field_dict["id"] = id + if multiplier is not UNSET: + field_dict["multiplier"] = multiplier + if price_base_factor is not UNSET: + field_dict["priceBaseFactor"] = price_base_factor + if price_display_factor is not UNSET: + field_dict["priceDisplayFactor"] = price_display_factor + if price_display_format is not UNSET: + field_dict["priceDisplayFormat"] = price_display_format + if qty_display_factor is not UNSET: + field_dict["qtyDisplayFactor"] = qty_display_factor + if qty_display_format is not UNSET: + field_dict["qtyDisplayFormat"] = qty_display_format + if security_category is not UNSET: + field_dict["securityCategory"] = security_category + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tick_rule is not UNSET: + field_dict["tickRule"] = tick_rule + if tick_size is not UNSET: + field_dict["tickSize"] = tick_size + if tick_value is not UNSET: + field_dict["tickValue"] = tick_value + if traded_exchanges is not UNSET: + field_dict["tradedExchanges"] = traded_exchanges + if contract_myy is not UNSET: + field_dict["contractMYY"] = contract_myy + if display_factor is not UNSET: + field_dict["displayFactor"] = display_factor + if first_notice_dt is not UNSET: + field_dict["firstNoticeDt"] = first_notice_dt + if first_trade_dt is not UNSET: + field_dict["firstTradeDt"] = first_trade_dt + if last_notice_dt is not UNSET: + field_dict["lastNoticeDt"] = last_notice_dt + if last_trade_dt is not UNSET: + field_dict["lastTradeDt"] = last_trade_dt + if legs is not UNSET: + field_dict["legs"] = legs + if spread_code is not UNSET: + field_dict["spreadCode"] = spread_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _aliases = d.pop("aliases", UNSET) + aliases: Unset | FutureSpreadAliases + if isinstance(_aliases, Unset): + aliases = UNSET + else: + aliases = FutureSpreadAliases.from_dict(_aliases) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + _listed_dt = d.pop("listedDt", UNSET) + listed_dt: Unset | Date + if isinstance(_listed_dt, Unset): + listed_dt = UNSET + else: + listed_dt = Date.from_dict(_listed_dt) + + _delisted_dt = d.pop("delistedDt", UNSET) + delisted_dt: Unset | Date + if isinstance(_delisted_dt, Unset): + delisted_dt = UNSET + else: + delisted_dt = Date.from_dict(_delisted_dt) + + description = d.pop("description", UNSET) + + exchange_id = d.pop("exchangeId", UNSET) + + id = d.pop("id", UNSET) + + multiplier = d.pop("multiplier", UNSET) + + price_base_factor = d.pop("priceBaseFactor", UNSET) + + price_display_factor = d.pop("priceDisplayFactor", UNSET) + + _price_display_format = d.pop("priceDisplayFormat", UNSET) + price_display_format: Unset | NumericDisplayFormat + if isinstance(_price_display_format, Unset): + price_display_format = UNSET + else: + price_display_format = NumericDisplayFormat(_price_display_format) + + qty_display_factor = d.pop("qtyDisplayFactor", UNSET) + + _qty_display_format = d.pop("qtyDisplayFormat", UNSET) + qty_display_format: Unset | NumericDisplayFormat + if isinstance(_qty_display_format, Unset): + qty_display_format = UNSET + else: + qty_display_format = NumericDisplayFormat(_qty_display_format) + + _security_category = d.pop("securityCategory", UNSET) + security_category: Unset | SecurityCategory + if isinstance(_security_category, Unset): + security_category = UNSET + else: + security_category = SecurityCategory(_security_category) + + symbol = d.pop("symbol", UNSET) + + tick_rule = d.pop("tickRule", UNSET) + + tick_size = d.pop("tickSize", UNSET) + + tick_value = d.pop("tickValue", UNSET) + + traded_exchanges = [] + _traded_exchanges = d.pop("tradedExchanges", UNSET) + for traded_exchanges_item_data in _traded_exchanges or []: + traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) + + traded_exchanges.append(traded_exchanges_item) + + contract_myy = d.pop("contractMYY", UNSET) + + display_factor = d.pop("displayFactor", UNSET) + + _first_notice_dt = d.pop("firstNoticeDt", UNSET) + first_notice_dt: Unset | Date + if isinstance(_first_notice_dt, Unset): + first_notice_dt = UNSET + else: + first_notice_dt = Date.from_dict(_first_notice_dt) + + _first_trade_dt = d.pop("firstTradeDt", UNSET) + first_trade_dt: Unset | Date + if isinstance(_first_trade_dt, Unset): + first_trade_dt = UNSET + else: + first_trade_dt = Date.from_dict(_first_trade_dt) + + _last_notice_dt = d.pop("lastNoticeDt", UNSET) + last_notice_dt: Unset | Date + if isinstance(_last_notice_dt, Unset): + last_notice_dt = UNSET + else: + last_notice_dt = Date.from_dict(_last_notice_dt) + + _last_trade_dt = d.pop("lastTradeDt", UNSET) + last_trade_dt: Unset | Date + if isinstance(_last_trade_dt, Unset): + last_trade_dt = UNSET + else: + last_trade_dt = Date.from_dict(_last_trade_dt) + + legs = [] + _legs = d.pop("legs", UNSET) + for legs_item_data in _legs or []: + legs_item = FutureSpreadLeg.from_dict(legs_item_data) + + legs.append(legs_item) + + spread_code = d.pop("spreadCode", UNSET) + + future_spread = cls( + aliases=aliases, + currency=currency, + listed_dt=listed_dt, + delisted_dt=delisted_dt, + description=description, + exchange_id=exchange_id, + id=id, + multiplier=multiplier, + price_base_factor=price_base_factor, + price_display_factor=price_display_factor, + price_display_format=price_display_format, + qty_display_factor=qty_display_factor, + qty_display_format=qty_display_format, + security_category=security_category, + symbol=symbol, + tick_rule=tick_rule, + tick_size=tick_size, + tick_value=tick_value, + traded_exchanges=traded_exchanges, + contract_myy=contract_myy, + display_factor=display_factor, + first_notice_dt=first_notice_dt, + first_trade_dt=first_trade_dt, + last_notice_dt=last_notice_dt, + last_trade_dt=last_trade_dt, + legs=legs, + spread_code=spread_code, + ) + + return future_spread diff --git a/openapi_project/openapi_package/models/future_spread_aliases.py b/openapi_project/openapi_package/models/future_spread_aliases.py new file mode 100644 index 000000000..411d5f2c9 --- /dev/null +++ b/openapi_project/openapi_package/models/future_spread_aliases.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="FutureSpreadAliases") + + + +@_attrs_define +class FutureSpreadAliases: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + future_spread_aliases = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + future_spread_aliases.additional_properties = additional_properties + return future_spread_aliases + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/future_spread_leg.py b/openapi_project/openapi_package/models/future_spread_leg.py new file mode 100644 index 000000000..d7fadd883 --- /dev/null +++ b/openapi_project/openapi_package/models/future_spread_leg.py @@ -0,0 +1,116 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.spread_leg_side import SpreadLegSide +from ..models.spread_leg_type import SpreadLegType +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.future import Future + + +T = TypeVar("T", bound="FutureSpreadLeg") + + +@_attrs_define +class FutureSpreadLeg: + """ + Attributes: + delta (Unset | float): + price (Unset | float): + ratio (Unset | int): + future (Unset | Future): + side (Unset | SpreadLegSide): + spread_leg_type (Unset | SpreadLegType): + """ + + delta: Unset | float = UNSET + price: Unset | float = UNSET + ratio: Unset | int = UNSET + future: Unset | "Future" = UNSET + side: Unset | SpreadLegSide = UNSET + spread_leg_type: Unset | SpreadLegType = UNSET + + def to_dict(self) -> dict[str, Any]: + delta = self.delta + + price = self.price + + ratio = self.ratio + + future: Unset | dict[str, Any] = UNSET + if not isinstance(self.future, Unset): + future = self.future.to_dict() + + side: Unset | str = UNSET + if not isinstance(self.side, Unset): + side = self.side.value + + spread_leg_type: Unset | str = UNSET + if not isinstance(self.spread_leg_type, Unset): + spread_leg_type = self.spread_leg_type.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if delta is not UNSET: + field_dict["delta"] = delta + if price is not UNSET: + field_dict["price"] = price + if ratio is not UNSET: + field_dict["ratio"] = ratio + if future is not UNSET: + field_dict["future"] = future + if side is not UNSET: + field_dict["side"] = side + if spread_leg_type is not UNSET: + field_dict["spreadLegType"] = spread_leg_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + delta = d.pop("delta", UNSET) + + price = d.pop("price", UNSET) + + ratio = d.pop("ratio", UNSET) + + _future = d.pop("future", UNSET) + future: Unset | Future + if isinstance(_future, Unset): + future = UNSET + else: + future = Future.from_dict(_future) + + _side = d.pop("side", UNSET) + side: Unset | SpreadLegSide + if isinstance(_side, Unset): + side = UNSET + else: + side = SpreadLegSide(_side) + + _spread_leg_type = d.pop("spreadLegType", UNSET) + spread_leg_type: Unset | SpreadLegType + if isinstance(_spread_leg_type, Unset): + spread_leg_type = UNSET + else: + spread_leg_type = SpreadLegType(_spread_leg_type) + + future_spread_leg = cls( + delta=delta, + price=price, + ratio=ratio, + future=future, + side=side, + spread_leg_type=spread_leg_type, + ) + + return future_spread_leg diff --git a/openapi_project/openapi_package/models/fx.py b/openapi_project/openapi_package/models/fx.py new file mode 100644 index 000000000..8b321568b --- /dev/null +++ b/openapi_project/openapi_package/models/fx.py @@ -0,0 +1,290 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.currency import Currency +from ..models.exchange_code import ExchangeCode +from ..models.numeric_display_format import NumericDisplayFormat +from ..models.security_category import SecurityCategory +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.date import Date + from ..models.fx_aliases import FxAliases + + +T = TypeVar("T", bound="Fx") + + +@_attrs_define +class Fx: + """ + Attributes: + aliases (Unset | FxAliases): + currency (Unset | Currency): + listed_dt (Unset | Date): + delisted_dt (Unset | Date): + description (Unset | str): + exchange_id (Unset | int): + id (Unset | int): + multiplier (Unset | float): + price_base_factor (Unset | float): + price_display_factor (Unset | float): + price_display_format (Unset | NumericDisplayFormat): + qty_display_factor (Unset | float): + qty_display_format (Unset | NumericDisplayFormat): + security_category (Unset | SecurityCategory): + symbol (Unset | str): + tick_rule (Unset | str): + tick_size (Unset | float): + tick_value (Unset | float): + traded_exchanges (Unset | list[ExchangeCode]): + quote_currency (Unset | Currency): + """ + + aliases: Unset | "FxAliases" = UNSET + currency: Unset | Currency = UNSET + listed_dt: Unset | "Date" = UNSET + delisted_dt: Unset | "Date" = UNSET + description: Unset | str = UNSET + exchange_id: Unset | int = UNSET + id: Unset | int = UNSET + multiplier: Unset | float = UNSET + price_base_factor: Unset | float = UNSET + price_display_factor: Unset | float = UNSET + price_display_format: Unset | NumericDisplayFormat = UNSET + qty_display_factor: Unset | float = UNSET + qty_display_format: Unset | NumericDisplayFormat = UNSET + security_category: Unset | SecurityCategory = UNSET + symbol: Unset | str = UNSET + tick_rule: Unset | str = UNSET + tick_size: Unset | float = UNSET + tick_value: Unset | float = UNSET + traded_exchanges: Unset | list[ExchangeCode] = UNSET + quote_currency: Unset | Currency = UNSET + + def to_dict(self) -> dict[str, Any]: + aliases: Unset | dict[str, Any] = UNSET + if not isinstance(self.aliases, Unset): + aliases = self.aliases.to_dict() + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + listed_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.listed_dt, Unset): + listed_dt = self.listed_dt.to_dict() + + delisted_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.delisted_dt, Unset): + delisted_dt = self.delisted_dt.to_dict() + + description = self.description + + exchange_id = self.exchange_id + + id = self.id + + multiplier = self.multiplier + + price_base_factor = self.price_base_factor + + price_display_factor = self.price_display_factor + + price_display_format: Unset | str = UNSET + if not isinstance(self.price_display_format, Unset): + price_display_format = self.price_display_format.value + + qty_display_factor = self.qty_display_factor + + qty_display_format: Unset | str = UNSET + if not isinstance(self.qty_display_format, Unset): + qty_display_format = self.qty_display_format.value + + security_category: Unset | str = UNSET + if not isinstance(self.security_category, Unset): + security_category = self.security_category.value + + symbol = self.symbol + + tick_rule = self.tick_rule + + tick_size = self.tick_size + + tick_value = self.tick_value + + traded_exchanges: Unset | list[str] = UNSET + if not isinstance(self.traded_exchanges, Unset): + traded_exchanges = [] + for traded_exchanges_item_data in self.traded_exchanges: + traded_exchanges_item = traded_exchanges_item_data.value + traded_exchanges.append(traded_exchanges_item) + + quote_currency: Unset | str = UNSET + if not isinstance(self.quote_currency, Unset): + quote_currency = self.quote_currency.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if aliases is not UNSET: + field_dict["aliases"] = aliases + if currency is not UNSET: + field_dict["currency"] = currency + if listed_dt is not UNSET: + field_dict["listedDt"] = listed_dt + if delisted_dt is not UNSET: + field_dict["delistedDt"] = delisted_dt + if description is not UNSET: + field_dict["description"] = description + if exchange_id is not UNSET: + field_dict["exchangeId"] = exchange_id + if id is not UNSET: + field_dict["id"] = id + if multiplier is not UNSET: + field_dict["multiplier"] = multiplier + if price_base_factor is not UNSET: + field_dict["priceBaseFactor"] = price_base_factor + if price_display_factor is not UNSET: + field_dict["priceDisplayFactor"] = price_display_factor + if price_display_format is not UNSET: + field_dict["priceDisplayFormat"] = price_display_format + if qty_display_factor is not UNSET: + field_dict["qtyDisplayFactor"] = qty_display_factor + if qty_display_format is not UNSET: + field_dict["qtyDisplayFormat"] = qty_display_format + if security_category is not UNSET: + field_dict["securityCategory"] = security_category + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tick_rule is not UNSET: + field_dict["tickRule"] = tick_rule + if tick_size is not UNSET: + field_dict["tickSize"] = tick_size + if tick_value is not UNSET: + field_dict["tickValue"] = tick_value + if traded_exchanges is not UNSET: + field_dict["tradedExchanges"] = traded_exchanges + if quote_currency is not UNSET: + field_dict["quoteCurrency"] = quote_currency + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _aliases = d.pop("aliases", UNSET) + aliases: Unset | FxAliases + if isinstance(_aliases, Unset): + aliases = UNSET + else: + aliases = FxAliases.from_dict(_aliases) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + _listed_dt = d.pop("listedDt", UNSET) + listed_dt: Unset | Date + if isinstance(_listed_dt, Unset): + listed_dt = UNSET + else: + listed_dt = Date.from_dict(_listed_dt) + + _delisted_dt = d.pop("delistedDt", UNSET) + delisted_dt: Unset | Date + if isinstance(_delisted_dt, Unset): + delisted_dt = UNSET + else: + delisted_dt = Date.from_dict(_delisted_dt) + + description = d.pop("description", UNSET) + + exchange_id = d.pop("exchangeId", UNSET) + + id = d.pop("id", UNSET) + + multiplier = d.pop("multiplier", UNSET) + + price_base_factor = d.pop("priceBaseFactor", UNSET) + + price_display_factor = d.pop("priceDisplayFactor", UNSET) + + _price_display_format = d.pop("priceDisplayFormat", UNSET) + price_display_format: Unset | NumericDisplayFormat + if isinstance(_price_display_format, Unset): + price_display_format = UNSET + else: + price_display_format = NumericDisplayFormat(_price_display_format) + + qty_display_factor = d.pop("qtyDisplayFactor", UNSET) + + _qty_display_format = d.pop("qtyDisplayFormat", UNSET) + qty_display_format: Unset | NumericDisplayFormat + if isinstance(_qty_display_format, Unset): + qty_display_format = UNSET + else: + qty_display_format = NumericDisplayFormat(_qty_display_format) + + _security_category = d.pop("securityCategory", UNSET) + security_category: Unset | SecurityCategory + if isinstance(_security_category, Unset): + security_category = UNSET + else: + security_category = SecurityCategory(_security_category) + + symbol = d.pop("symbol", UNSET) + + tick_rule = d.pop("tickRule", UNSET) + + tick_size = d.pop("tickSize", UNSET) + + tick_value = d.pop("tickValue", UNSET) + + traded_exchanges = [] + _traded_exchanges = d.pop("tradedExchanges", UNSET) + for traded_exchanges_item_data in _traded_exchanges or []: + traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) + + traded_exchanges.append(traded_exchanges_item) + + _quote_currency = d.pop("quoteCurrency", UNSET) + quote_currency: Unset | Currency + if isinstance(_quote_currency, Unset): + quote_currency = UNSET + else: + quote_currency = Currency(_quote_currency) + + fx = cls( + aliases=aliases, + currency=currency, + listed_dt=listed_dt, + delisted_dt=delisted_dt, + description=description, + exchange_id=exchange_id, + id=id, + multiplier=multiplier, + price_base_factor=price_base_factor, + price_display_factor=price_display_factor, + price_display_format=price_display_format, + qty_display_factor=qty_display_factor, + qty_display_format=qty_display_format, + security_category=security_category, + symbol=symbol, + tick_rule=tick_rule, + tick_size=tick_size, + tick_value=tick_value, + traded_exchanges=traded_exchanges, + quote_currency=quote_currency, + ) + + return fx diff --git a/openapi_project/openapi_package/models/fx_aliases.py b/openapi_project/openapi_package/models/fx_aliases.py new file mode 100644 index 000000000..98f318abc --- /dev/null +++ b/openapi_project/openapi_package/models/fx_aliases.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="FxAliases") + + + +@_attrs_define +class FxAliases: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + fx_aliases = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + fx_aliases.additional_properties = additional_properties + return fx_aliases + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/generic_order.py b/openapi_project/openapi_package/models/generic_order.py new file mode 100644 index 000000000..d0f85e0e4 --- /dev/null +++ b/openapi_project/openapi_package/models/generic_order.py @@ -0,0 +1,106 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.order_cross import OrderCross + from ..models.order import Order + from ..models.multi_leg_order import MultiLegOrder + from ..models.multi_leg_order_cross import MultiLegOrderCross + + +T = TypeVar("T", bound="GenericOrder") + + +@_attrs_define +class GenericOrder: + """ + Attributes: + order (Unset | Order): + order_cross (Unset | OrderCross): + multi_leg_order (Unset | MultiLegOrder): + multi_leg_order_cross (Unset | MultiLegOrderCross): + """ + + order: Unset | "Order" = UNSET + order_cross: Unset | "OrderCross" = UNSET + multi_leg_order: Unset | "MultiLegOrder" = UNSET + multi_leg_order_cross: Unset | "MultiLegOrderCross" = UNSET + + def to_dict(self) -> dict[str, Any]: + order: Unset | dict[str, Any] = UNSET + if not isinstance(self.order, Unset): + order = self.order.to_dict() + + order_cross: Unset | dict[str, Any] = UNSET + if not isinstance(self.order_cross, Unset): + order_cross = self.order_cross.to_dict() + + multi_leg_order: Unset | dict[str, Any] = UNSET + if not isinstance(self.multi_leg_order, Unset): + multi_leg_order = self.multi_leg_order.to_dict() + + multi_leg_order_cross: Unset | dict[str, Any] = UNSET + if not isinstance(self.multi_leg_order_cross, Unset): + multi_leg_order_cross = self.multi_leg_order_cross.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if order is not UNSET: + field_dict["order"] = order + if order_cross is not UNSET: + field_dict["orderCross"] = order_cross + if multi_leg_order is not UNSET: + field_dict["multiLegOrder"] = multi_leg_order + if multi_leg_order_cross is not UNSET: + field_dict["multiLegOrderCross"] = multi_leg_order_cross + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _order = d.pop("order", UNSET) + order: Unset | Order + if isinstance(_order, Unset): + order = UNSET + else: + order = Order.from_dict(_order) + + _order_cross = d.pop("orderCross", UNSET) + order_cross: Unset | OrderCross + if isinstance(_order_cross, Unset): + order_cross = UNSET + else: + order_cross = OrderCross.from_dict(_order_cross) + + _multi_leg_order = d.pop("multiLegOrder", UNSET) + multi_leg_order: Unset | MultiLegOrder + if isinstance(_multi_leg_order, Unset): + multi_leg_order = UNSET + else: + multi_leg_order = MultiLegOrder.from_dict(_multi_leg_order) + + _multi_leg_order_cross = d.pop("multiLegOrderCross", UNSET) + multi_leg_order_cross: Unset | MultiLegOrderCross + if isinstance(_multi_leg_order_cross, Unset): + multi_leg_order_cross = UNSET + else: + multi_leg_order_cross = MultiLegOrderCross.from_dict(_multi_leg_order_cross) + + generic_order = cls( + order=order, + order_cross=order_cross, + multi_leg_order=multi_leg_order, + multi_leg_order_cross=multi_leg_order_cross, + ) + + return generic_order diff --git a/openapi_project/openapi_package/models/get_active_user_response.py b/openapi_project/openapi_package/models/get_active_user_response.py new file mode 100644 index 000000000..85db97409 --- /dev/null +++ b/openapi_project/openapi_package/models/get_active_user_response.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.user import User + + +T = TypeVar("T", bound="GetActiveUserResponse") + + +@_attrs_define +class GetActiveUserResponse: + """ + Attributes: + user (Unset | User): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + user: Unset | "User" = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + user: Unset | dict[str, Any] = UNSET + if not isinstance(self.user, Unset): + user = self.user.to_dict() + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if user is not UNSET: + field_dict["user"] = user + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _user = d.pop("user", UNSET) + user: Unset | User + if isinstance(_user, Unset): + user = UNSET + else: + user = User.from_dict(_user) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + get_active_user_response = cls( + user=user, + error_message=error_message, + status_code=status_code, + ) + + return get_active_user_response diff --git a/openapi_project/openapi_package/models/get_server_info_response.py b/openapi_project/openapi_package/models/get_server_info_response.py new file mode 100644 index 000000000..4b2760c0b --- /dev/null +++ b/openapi_project/openapi_package/models/get_server_info_response.py @@ -0,0 +1,139 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.get_server_info_response_system_settings import ( + GetServerInfoResponseSystemSettings, + ) + + +T = TypeVar("T", bound="GetServerInfoResponse") + + +@_attrs_define +class GetServerInfoResponse: + """ + Attributes: + environment (Unset | str): + server_build_ts (Unset | str): + server_hash (Unset | str): + server_name (Unset | str): + server_version (Unset | str): + site (Unset | str): + system_settings (Unset | GetServerInfoResponseSystemSettings): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + environment: Unset | str = UNSET + server_build_ts: Unset | str = UNSET + server_hash: Unset | str = UNSET + server_name: Unset | str = UNSET + server_version: Unset | str = UNSET + site: Unset | str = UNSET + system_settings: Unset | "GetServerInfoResponseSystemSettings" = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + environment = self.environment + + server_build_ts = self.server_build_ts + + server_hash = self.server_hash + + server_name = self.server_name + + server_version = self.server_version + + site = self.site + + system_settings: Unset | dict[str, Any] = UNSET + if not isinstance(self.system_settings, Unset): + system_settings = self.system_settings.to_dict() + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if environment is not UNSET: + field_dict["environment"] = environment + if server_build_ts is not UNSET: + field_dict["serverBuildTs"] = server_build_ts + if server_hash is not UNSET: + field_dict["serverHash"] = server_hash + if server_name is not UNSET: + field_dict["serverName"] = server_name + if server_version is not UNSET: + field_dict["serverVersion"] = server_version + if site is not UNSET: + field_dict["site"] = site + if system_settings is not UNSET: + field_dict["systemSettings"] = system_settings + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + environment = d.pop("environment", UNSET) + + server_build_ts = d.pop("serverBuildTs", UNSET) + + server_hash = d.pop("serverHash", UNSET) + + server_name = d.pop("serverName", UNSET) + + server_version = d.pop("serverVersion", UNSET) + + site = d.pop("site", UNSET) + + _system_settings = d.pop("systemSettings", UNSET) + system_settings: Unset | GetServerInfoResponseSystemSettings + if isinstance(_system_settings, Unset): + system_settings = UNSET + else: + system_settings = GetServerInfoResponseSystemSettings.from_dict( + _system_settings + ) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + get_server_info_response = cls( + environment=environment, + server_build_ts=server_build_ts, + server_hash=server_hash, + server_name=server_name, + server_version=server_version, + site=site, + system_settings=system_settings, + error_message=error_message, + status_code=status_code, + ) + + return get_server_info_response diff --git a/openapi_project/openapi_package/models/get_server_info_response_system_settings.py b/openapi_project/openapi_package/models/get_server_info_response_system_settings.py new file mode 100644 index 000000000..f05016b8c --- /dev/null +++ b/openapi_project/openapi_package/models/get_server_info_response_system_settings.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="GetServerInfoResponseSystemSettings") + + + +@_attrs_define +class GetServerInfoResponseSystemSettings: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + get_server_info_response_system_settings = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + get_server_info_response_system_settings.additional_properties = additional_properties + return get_server_info_response_system_settings + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/get_server_time_response.py b/openapi_project/openapi_package/models/get_server_time_response.py new file mode 100644 index 000000000..55f425c51 --- /dev/null +++ b/openapi_project/openapi_package/models/get_server_time_response.py @@ -0,0 +1,70 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="GetServerTimeResponse") + + +@_attrs_define +class GetServerTimeResponse: + """ + Attributes: + server_time_utc (Unset | str): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + server_time_utc: Unset | str = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + server_time_utc = self.server_time_utc + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if server_time_utc is not UNSET: + field_dict["serverTimeUtc"] = server_time_utc + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + server_time_utc = d.pop("serverTimeUtc", UNSET) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + get_server_time_response = cls( + server_time_utc=server_time_utc, + error_message=error_message, + status_code=status_code, + ) + + return get_server_time_response diff --git a/openapi_project/openapi_package/models/get_trading_holidays_response.py b/openapi_project/openapi_package/models/get_trading_holidays_response.py new file mode 100644 index 000000000..3eb203b70 --- /dev/null +++ b/openapi_project/openapi_package/models/get_trading_holidays_response.py @@ -0,0 +1,84 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.trading_holiday import TradingHoliday + + +T = TypeVar("T", bound="GetTradingHolidaysResponse") + + +@_attrs_define +class GetTradingHolidaysResponse: + """ + Attributes: + trading_holidays (Unset | list['TradingHoliday']): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + trading_holidays: Unset | list["TradingHoliday"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + trading_holidays: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.trading_holidays, Unset): + trading_holidays = [] + for trading_holidays_item_data in self.trading_holidays: + trading_holidays_item = trading_holidays_item_data.to_dict() + trading_holidays.append(trading_holidays_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if trading_holidays is not UNSET: + field_dict["tradingHolidays"] = trading_holidays + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + trading_holidays = [] + _trading_holidays = d.pop("tradingHolidays", UNSET) + for trading_holidays_item_data in _trading_holidays or []: + trading_holidays_item = TradingHoliday.from_dict(trading_holidays_item_data) + + trading_holidays.append(trading_holidays_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + get_trading_holidays_response = cls( + trading_holidays=trading_holidays, + error_message=error_message, + status_code=status_code, + ) + + return get_trading_holidays_response diff --git a/openapi_project/openapi_package/models/header.py b/openapi_project/openapi_package/models/header.py new file mode 100644 index 000000000..6ef8db824 --- /dev/null +++ b/openapi_project/openapi_package/models/header.py @@ -0,0 +1,107 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="Header") + + +@_attrs_define +class Header: + """ + Attributes: + deliver_to_comp_id (Unset | str): + deliver_to_sub_id (Unset | str): + on_behalf_of_comp_id (Unset | str): + on_behalf_of_sub_id (Unset | str): + sender_comp_id (Unset | str): + sender_sub_id (Unset | str): + target_comp_id (Unset | str): + target_sub_id (Unset | str): + """ + + deliver_to_comp_id: Unset | str = UNSET + deliver_to_sub_id: Unset | str = UNSET + on_behalf_of_comp_id: Unset | str = UNSET + on_behalf_of_sub_id: Unset | str = UNSET + sender_comp_id: Unset | str = UNSET + sender_sub_id: Unset | str = UNSET + target_comp_id: Unset | str = UNSET + target_sub_id: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + deliver_to_comp_id = self.deliver_to_comp_id + + deliver_to_sub_id = self.deliver_to_sub_id + + on_behalf_of_comp_id = self.on_behalf_of_comp_id + + on_behalf_of_sub_id = self.on_behalf_of_sub_id + + sender_comp_id = self.sender_comp_id + + sender_sub_id = self.sender_sub_id + + target_comp_id = self.target_comp_id + + target_sub_id = self.target_sub_id + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if deliver_to_comp_id is not UNSET: + field_dict["deliverToCompId"] = deliver_to_comp_id + if deliver_to_sub_id is not UNSET: + field_dict["deliverToSubId"] = deliver_to_sub_id + if on_behalf_of_comp_id is not UNSET: + field_dict["onBehalfOfCompId"] = on_behalf_of_comp_id + if on_behalf_of_sub_id is not UNSET: + field_dict["onBehalfOfSubId"] = on_behalf_of_sub_id + if sender_comp_id is not UNSET: + field_dict["senderCompId"] = sender_comp_id + if sender_sub_id is not UNSET: + field_dict["senderSubId"] = sender_sub_id + if target_comp_id is not UNSET: + field_dict["targetCompId"] = target_comp_id + if target_sub_id is not UNSET: + field_dict["targetSubId"] = target_sub_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + deliver_to_comp_id = d.pop("deliverToCompId", UNSET) + + deliver_to_sub_id = d.pop("deliverToSubId", UNSET) + + on_behalf_of_comp_id = d.pop("onBehalfOfCompId", UNSET) + + on_behalf_of_sub_id = d.pop("onBehalfOfSubId", UNSET) + + sender_comp_id = d.pop("senderCompId", UNSET) + + sender_sub_id = d.pop("senderSubId", UNSET) + + target_comp_id = d.pop("targetCompId", UNSET) + + target_sub_id = d.pop("targetSubId", UNSET) + + header = cls( + deliver_to_comp_id=deliver_to_comp_id, + deliver_to_sub_id=deliver_to_sub_id, + on_behalf_of_comp_id=on_behalf_of_comp_id, + on_behalf_of_sub_id=on_behalf_of_sub_id, + sender_comp_id=sender_comp_id, + sender_sub_id=sender_sub_id, + target_comp_id=target_comp_id, + target_sub_id=target_sub_id, + ) + + return header diff --git a/openapi_project/openapi_package/models/index.py b/openapi_project/openapi_package/models/index.py new file mode 100644 index 000000000..890c2f656 --- /dev/null +++ b/openapi_project/openapi_package/models/index.py @@ -0,0 +1,274 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.currency import Currency +from ..models.exchange_code import ExchangeCode +from ..models.numeric_display_format import NumericDisplayFormat +from ..models.security_category import SecurityCategory +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.date import Date + from ..models.index_aliases import IndexAliases + + +T = TypeVar("T", bound="Index") + + +@_attrs_define +class Index: + """ + Attributes: + aliases (Unset | IndexAliases): + currency (Unset | Currency): + listed_dt (Unset | Date): + delisted_dt (Unset | Date): + description (Unset | str): + exchange_id (Unset | int): + id (Unset | int): + multiplier (Unset | float): + price_base_factor (Unset | float): + price_display_factor (Unset | float): + price_display_format (Unset | NumericDisplayFormat): + qty_display_factor (Unset | float): + qty_display_format (Unset | NumericDisplayFormat): + security_category (Unset | SecurityCategory): + symbol (Unset | str): + tick_rule (Unset | str): + tick_size (Unset | float): + tick_value (Unset | float): + traded_exchanges (Unset | list[ExchangeCode]): + """ + + aliases: Unset | "IndexAliases" = UNSET + currency: Unset | Currency = UNSET + listed_dt: Unset | "Date" = UNSET + delisted_dt: Unset | "Date" = UNSET + description: Unset | str = UNSET + exchange_id: Unset | int = UNSET + id: Unset | int = UNSET + multiplier: Unset | float = UNSET + price_base_factor: Unset | float = UNSET + price_display_factor: Unset | float = UNSET + price_display_format: Unset | NumericDisplayFormat = UNSET + qty_display_factor: Unset | float = UNSET + qty_display_format: Unset | NumericDisplayFormat = UNSET + security_category: Unset | SecurityCategory = UNSET + symbol: Unset | str = UNSET + tick_rule: Unset | str = UNSET + tick_size: Unset | float = UNSET + tick_value: Unset | float = UNSET + traded_exchanges: Unset | list[ExchangeCode] = UNSET + + def to_dict(self) -> dict[str, Any]: + aliases: Unset | dict[str, Any] = UNSET + if not isinstance(self.aliases, Unset): + aliases = self.aliases.to_dict() + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + listed_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.listed_dt, Unset): + listed_dt = self.listed_dt.to_dict() + + delisted_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.delisted_dt, Unset): + delisted_dt = self.delisted_dt.to_dict() + + description = self.description + + exchange_id = self.exchange_id + + id = self.id + + multiplier = self.multiplier + + price_base_factor = self.price_base_factor + + price_display_factor = self.price_display_factor + + price_display_format: Unset | str = UNSET + if not isinstance(self.price_display_format, Unset): + price_display_format = self.price_display_format.value + + qty_display_factor = self.qty_display_factor + + qty_display_format: Unset | str = UNSET + if not isinstance(self.qty_display_format, Unset): + qty_display_format = self.qty_display_format.value + + security_category: Unset | str = UNSET + if not isinstance(self.security_category, Unset): + security_category = self.security_category.value + + symbol = self.symbol + + tick_rule = self.tick_rule + + tick_size = self.tick_size + + tick_value = self.tick_value + + traded_exchanges: Unset | list[str] = UNSET + if not isinstance(self.traded_exchanges, Unset): + traded_exchanges = [] + for traded_exchanges_item_data in self.traded_exchanges: + traded_exchanges_item = traded_exchanges_item_data.value + traded_exchanges.append(traded_exchanges_item) + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if aliases is not UNSET: + field_dict["aliases"] = aliases + if currency is not UNSET: + field_dict["currency"] = currency + if listed_dt is not UNSET: + field_dict["listedDt"] = listed_dt + if delisted_dt is not UNSET: + field_dict["delistedDt"] = delisted_dt + if description is not UNSET: + field_dict["description"] = description + if exchange_id is not UNSET: + field_dict["exchangeId"] = exchange_id + if id is not UNSET: + field_dict["id"] = id + if multiplier is not UNSET: + field_dict["multiplier"] = multiplier + if price_base_factor is not UNSET: + field_dict["priceBaseFactor"] = price_base_factor + if price_display_factor is not UNSET: + field_dict["priceDisplayFactor"] = price_display_factor + if price_display_format is not UNSET: + field_dict["priceDisplayFormat"] = price_display_format + if qty_display_factor is not UNSET: + field_dict["qtyDisplayFactor"] = qty_display_factor + if qty_display_format is not UNSET: + field_dict["qtyDisplayFormat"] = qty_display_format + if security_category is not UNSET: + field_dict["securityCategory"] = security_category + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tick_rule is not UNSET: + field_dict["tickRule"] = tick_rule + if tick_size is not UNSET: + field_dict["tickSize"] = tick_size + if tick_value is not UNSET: + field_dict["tickValue"] = tick_value + if traded_exchanges is not UNSET: + field_dict["tradedExchanges"] = traded_exchanges + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _aliases = d.pop("aliases", UNSET) + aliases: Unset | IndexAliases + if isinstance(_aliases, Unset): + aliases = UNSET + else: + aliases = IndexAliases.from_dict(_aliases) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + _listed_dt = d.pop("listedDt", UNSET) + listed_dt: Unset | Date + if isinstance(_listed_dt, Unset): + listed_dt = UNSET + else: + listed_dt = Date.from_dict(_listed_dt) + + _delisted_dt = d.pop("delistedDt", UNSET) + delisted_dt: Unset | Date + if isinstance(_delisted_dt, Unset): + delisted_dt = UNSET + else: + delisted_dt = Date.from_dict(_delisted_dt) + + description = d.pop("description", UNSET) + + exchange_id = d.pop("exchangeId", UNSET) + + id = d.pop("id", UNSET) + + multiplier = d.pop("multiplier", UNSET) + + price_base_factor = d.pop("priceBaseFactor", UNSET) + + price_display_factor = d.pop("priceDisplayFactor", UNSET) + + _price_display_format = d.pop("priceDisplayFormat", UNSET) + price_display_format: Unset | NumericDisplayFormat + if isinstance(_price_display_format, Unset): + price_display_format = UNSET + else: + price_display_format = NumericDisplayFormat(_price_display_format) + + qty_display_factor = d.pop("qtyDisplayFactor", UNSET) + + _qty_display_format = d.pop("qtyDisplayFormat", UNSET) + qty_display_format: Unset | NumericDisplayFormat + if isinstance(_qty_display_format, Unset): + qty_display_format = UNSET + else: + qty_display_format = NumericDisplayFormat(_qty_display_format) + + _security_category = d.pop("securityCategory", UNSET) + security_category: Unset | SecurityCategory + if isinstance(_security_category, Unset): + security_category = UNSET + else: + security_category = SecurityCategory(_security_category) + + symbol = d.pop("symbol", UNSET) + + tick_rule = d.pop("tickRule", UNSET) + + tick_size = d.pop("tickSize", UNSET) + + tick_value = d.pop("tickValue", UNSET) + + traded_exchanges = [] + _traded_exchanges = d.pop("tradedExchanges", UNSET) + for traded_exchanges_item_data in _traded_exchanges or []: + traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) + + traded_exchanges.append(traded_exchanges_item) + + index = cls( + aliases=aliases, + currency=currency, + listed_dt=listed_dt, + delisted_dt=delisted_dt, + description=description, + exchange_id=exchange_id, + id=id, + multiplier=multiplier, + price_base_factor=price_base_factor, + price_display_factor=price_display_factor, + price_display_format=price_display_format, + qty_display_factor=qty_display_factor, + qty_display_format=qty_display_format, + security_category=security_category, + symbol=symbol, + tick_rule=tick_rule, + tick_size=tick_size, + tick_value=tick_value, + traded_exchanges=traded_exchanges, + ) + + return index diff --git a/openapi_project/openapi_package/models/index_aliases.py b/openapi_project/openapi_package/models/index_aliases.py new file mode 100644 index 000000000..e77914b97 --- /dev/null +++ b/openapi_project/openapi_package/models/index_aliases.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="IndexAliases") + + + +@_attrs_define +class IndexAliases: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + index_aliases = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + index_aliases.additional_properties = additional_properties + return index_aliases + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/list_accounts_response.py b/openapi_project/openapi_package/models/list_accounts_response.py new file mode 100644 index 000000000..65c7b55dd --- /dev/null +++ b/openapi_project/openapi_package/models/list_accounts_response.py @@ -0,0 +1,84 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.account import Account + + +T = TypeVar("T", bound="ListAccountsResponse") + + +@_attrs_define +class ListAccountsResponse: + """ + Attributes: + accounts (Unset | list['Account']): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + accounts: Unset | list["Account"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + accounts: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.accounts, Unset): + accounts = [] + for accounts_item_data in self.accounts: + accounts_item = accounts_item_data.to_dict() + accounts.append(accounts_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if accounts is not UNSET: + field_dict["accounts"] = accounts + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + accounts = [] + _accounts = d.pop("accounts", UNSET) + for accounts_item_data in _accounts or []: + accounts_item = Account.from_dict(accounts_item_data) + + accounts.append(accounts_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + list_accounts_response = cls( + accounts=accounts, + error_message=error_message, + status_code=status_code, + ) + + return list_accounts_response diff --git a/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py b/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py new file mode 100644 index 000000000..5ad1cc69a --- /dev/null +++ b/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py @@ -0,0 +1,86 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.trading_firm_slim import TradingFirmSlim + + +T = TypeVar("T", bound="ListAffiliatedTradingFirmsResponse") + + +@_attrs_define +class ListAffiliatedTradingFirmsResponse: + """ + Attributes: + affiliated_firms (Unset | list['TradingFirmSlim']): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + affiliated_firms: Unset | list["TradingFirmSlim"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + affiliated_firms: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.affiliated_firms, Unset): + affiliated_firms = [] + for affiliated_firms_item_data in self.affiliated_firms: + affiliated_firms_item = affiliated_firms_item_data.to_dict() + affiliated_firms.append(affiliated_firms_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if affiliated_firms is not UNSET: + field_dict["affiliatedFirms"] = affiliated_firms + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + affiliated_firms = [] + _affiliated_firms = d.pop("affiliatedFirms", UNSET) + for affiliated_firms_item_data in _affiliated_firms or []: + affiliated_firms_item = TradingFirmSlim.from_dict( + affiliated_firms_item_data + ) + + affiliated_firms.append(affiliated_firms_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + list_affiliated_trading_firms_response = cls( + affiliated_firms=affiliated_firms, + error_message=error_message, + status_code=status_code, + ) + + return list_affiliated_trading_firms_response diff --git a/openapi_project/openapi_package/models/list_easy_to_borrow_securities_request.py b/openapi_project/openapi_package/models/list_easy_to_borrow_securities_request.py new file mode 100644 index 000000000..7ecce79fe --- /dev/null +++ b/openapi_project/openapi_package/models/list_easy_to_borrow_securities_request.py @@ -0,0 +1,53 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="ListEasyToBorrowSecuritiesRequest") + + +@_attrs_define +class ListEasyToBorrowSecuritiesRequest: + """ + Attributes: + trading_firm_id (Unset | int): + account_id (Unset | int): + """ + + trading_firm_id: Unset | int = UNSET + account_id: Unset | int = UNSET + + def to_dict(self) -> dict[str, Any]: + trading_firm_id = self.trading_firm_id + + account_id = self.account_id + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if trading_firm_id is not UNSET: + field_dict["tradingFirmId"] = trading_firm_id + if account_id is not UNSET: + field_dict["accountId"] = account_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + trading_firm_id = d.pop("tradingFirmId", UNSET) + + account_id = d.pop("accountId", UNSET) + + list_easy_to_borrow_securities_request = cls( + trading_firm_id=trading_firm_id, + account_id=account_id, + ) + + return list_easy_to_borrow_securities_request diff --git a/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py b/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py new file mode 100644 index 000000000..7e06170a3 --- /dev/null +++ b/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py @@ -0,0 +1,84 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.easy_to_borrow_security import EasyToBorrowSecurity + + +T = TypeVar("T", bound="ListEasyToBorrowSecuritiesResponse") + + +@_attrs_define +class ListEasyToBorrowSecuritiesResponse: + """ + Attributes: + securities (Unset | list['EasyToBorrowSecurity']): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + securities: Unset | list["EasyToBorrowSecurity"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + securities: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.securities, Unset): + securities = [] + for securities_item_data in self.securities: + securities_item = securities_item_data.to_dict() + securities.append(securities_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if securities is not UNSET: + field_dict["securities"] = securities + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + securities = [] + _securities = d.pop("securities", UNSET) + for securities_item_data in _securities or []: + securities_item = EasyToBorrowSecurity.from_dict(securities_item_data) + + securities.append(securities_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + list_easy_to_borrow_securities_response = cls( + securities=securities, + error_message=error_message, + status_code=status_code, + ) + + return list_easy_to_borrow_securities_response diff --git a/openapi_project/openapi_package/models/list_exchanges_response.py b/openapi_project/openapi_package/models/list_exchanges_response.py new file mode 100644 index 000000000..7783340b3 --- /dev/null +++ b/openapi_project/openapi_package/models/list_exchanges_response.py @@ -0,0 +1,84 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.exchange import Exchange + + +T = TypeVar("T", bound="ListExchangesResponse") + + +@_attrs_define +class ListExchangesResponse: + """ + Attributes: + exchanges (Unset | list['Exchange']): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + exchanges: Unset | list["Exchange"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + exchanges: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.exchanges, Unset): + exchanges = [] + for exchanges_item_data in self.exchanges: + exchanges_item = exchanges_item_data.to_dict() + exchanges.append(exchanges_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if exchanges is not UNSET: + field_dict["exchanges"] = exchanges + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + exchanges = [] + _exchanges = d.pop("exchanges", UNSET) + for exchanges_item_data in _exchanges or []: + exchanges_item = Exchange.from_dict(exchanges_item_data) + + exchanges.append(exchanges_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + list_exchanges_response = cls( + exchanges=exchanges, + error_message=error_message, + status_code=status_code, + ) + + return list_exchanges_response diff --git a/openapi_project/openapi_package/models/list_option_chains_repsonse.py b/openapi_project/openapi_package/models/list_option_chains_repsonse.py new file mode 100644 index 000000000..89755d630 --- /dev/null +++ b/openapi_project/openapi_package/models/list_option_chains_repsonse.py @@ -0,0 +1,84 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.option_chain import OptionChain + + +T = TypeVar("T", bound="ListOptionChainsRepsonse") + + +@_attrs_define +class ListOptionChainsRepsonse: + """ + Attributes: + option_chains (Unset | list['OptionChain']): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + option_chains: Unset | list["OptionChain"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + option_chains: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.option_chains, Unset): + option_chains = [] + for option_chains_item_data in self.option_chains: + option_chains_item = option_chains_item_data.to_dict() + option_chains.append(option_chains_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if option_chains is not UNSET: + field_dict["optionChains"] = option_chains + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + option_chains = [] + _option_chains = d.pop("optionChains", UNSET) + for option_chains_item_data in _option_chains or []: + option_chains_item = OptionChain.from_dict(option_chains_item_data) + + option_chains.append(option_chains_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + list_option_chains_repsonse = cls( + option_chains=option_chains, + error_message=error_message, + status_code=status_code, + ) + + return list_option_chains_repsonse diff --git a/openapi_project/openapi_package/models/list_option_chains_request.py b/openapi_project/openapi_package/models/list_option_chains_request.py new file mode 100644 index 000000000..78f1e7a62 --- /dev/null +++ b/openapi_project/openapi_package/models/list_option_chains_request.py @@ -0,0 +1,47 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + + +T = TypeVar("T", bound="ListOptionChainsRequest") + + +@_attrs_define +class ListOptionChainsRequest: + """ + Attributes: + underlying_symbols (Unset | list[str]): + """ + + underlying_symbols: Unset | list[str] = UNSET + + def to_dict(self) -> dict[str, Any]: + underlying_symbols: Unset | list[str] = UNSET + if not isinstance(self.underlying_symbols, Unset): + underlying_symbols = self.underlying_symbols + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if underlying_symbols is not UNSET: + field_dict["underlyingSymbols"] = underlying_symbols + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + underlying_symbols = cast(list[str], d.pop("underlyingSymbols", UNSET)) + + list_option_chains_request = cls( + underlying_symbols=underlying_symbols, + ) + + return list_option_chains_request diff --git a/openapi_project/openapi_package/models/list_orders_response.py b/openapi_project/openapi_package/models/list_orders_response.py new file mode 100644 index 000000000..b7078e18a --- /dev/null +++ b/openapi_project/openapi_package/models/list_orders_response.py @@ -0,0 +1,84 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.generic_order import GenericOrder + + +T = TypeVar("T", bound="ListOrdersResponse") + + +@_attrs_define +class ListOrdersResponse: + """ + Attributes: + orders (Unset | list['GenericOrder']): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + orders: Unset | list["GenericOrder"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + orders: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.orders, Unset): + orders = [] + for orders_item_data in self.orders: + orders_item = orders_item_data.to_dict() + orders.append(orders_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if orders is not UNSET: + field_dict["orders"] = orders + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + orders = [] + _orders = d.pop("orders", UNSET) + for orders_item_data in _orders or []: + orders_item = GenericOrder.from_dict(orders_item_data) + + orders.append(orders_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + list_orders_response = cls( + orders=orders, + error_message=error_message, + status_code=status_code, + ) + + return list_orders_response diff --git a/openapi_project/openapi_package/models/list_positions_response.py b/openapi_project/openapi_package/models/list_positions_response.py new file mode 100644 index 000000000..2c23bd577 --- /dev/null +++ b/openapi_project/openapi_package/models/list_positions_response.py @@ -0,0 +1,84 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.position import Position + + +T = TypeVar("T", bound="ListPositionsResponse") + + +@_attrs_define +class ListPositionsResponse: + """ + Attributes: + positions (Unset | list['Position']): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + positions: Unset | list["Position"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + positions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.positions, Unset): + positions = [] + for positions_item_data in self.positions: + positions_item = positions_item_data.to_dict() + positions.append(positions_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if positions is not UNSET: + field_dict["positions"] = positions + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + positions = [] + _positions = d.pop("positions", UNSET) + for positions_item_data in _positions or []: + positions_item = Position.from_dict(positions_item_data) + + positions.append(positions_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + list_positions_response = cls( + positions=positions, + error_message=error_message, + status_code=status_code, + ) + + return list_positions_response diff --git a/openapi_project/openapi_package/models/list_routes_response.py b/openapi_project/openapi_package/models/list_routes_response.py new file mode 100644 index 000000000..58f7a5565 --- /dev/null +++ b/openapi_project/openapi_package/models/list_routes_response.py @@ -0,0 +1,106 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.route import Route + from ..models.route_applicability import RouteApplicability + + +T = TypeVar("T", bound="ListRoutesResponse") + + +@_attrs_define +class ListRoutesResponse: + """ + Attributes: + routes (Unset | list['Route']): + route_applicabilities (Unset | list['RouteApplicability']): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + routes: Unset | list["Route"] = UNSET + route_applicabilities: Unset | list["RouteApplicability"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + routes: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.routes, Unset): + routes = [] + for routes_item_data in self.routes: + routes_item = routes_item_data.to_dict() + routes.append(routes_item) + + route_applicabilities: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.route_applicabilities, Unset): + route_applicabilities = [] + for route_applicabilities_item_data in self.route_applicabilities: + route_applicabilities_item = route_applicabilities_item_data.to_dict() + route_applicabilities.append(route_applicabilities_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if routes is not UNSET: + field_dict["routes"] = routes + if route_applicabilities is not UNSET: + field_dict["routeApplicabilities"] = route_applicabilities + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + routes = [] + _routes = d.pop("routes", UNSET) + for routes_item_data in _routes or []: + routes_item = Route.from_dict(routes_item_data) + + routes.append(routes_item) + + route_applicabilities = [] + _route_applicabilities = d.pop("routeApplicabilities", UNSET) + for route_applicabilities_item_data in _route_applicabilities or []: + route_applicabilities_item = RouteApplicability.from_dict( + route_applicabilities_item_data + ) + + route_applicabilities.append(route_applicabilities_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + list_routes_response = cls( + routes=routes, + route_applicabilities=route_applicabilities, + error_message=error_message, + status_code=status_code, + ) + + return list_routes_response diff --git a/openapi_project/openapi_package/models/list_securities_request.py b/openapi_project/openapi_package/models/list_securities_request.py new file mode 100644 index 000000000..6469e7d52 --- /dev/null +++ b/openapi_project/openapi_package/models/list_securities_request.py @@ -0,0 +1,47 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + + +T = TypeVar("T", bound="ListSecuritiesRequest") + + +@_attrs_define +class ListSecuritiesRequest: + """ + Attributes: + symbols (Unset | list[str]): + """ + + symbols: Unset | list[str] = UNSET + + def to_dict(self) -> dict[str, Any]: + symbols: Unset | list[str] = UNSET + if not isinstance(self.symbols, Unset): + symbols = self.symbols + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if symbols is not UNSET: + field_dict["symbols"] = symbols + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbols = cast(list[str], d.pop("symbols", UNSET)) + + list_securities_request = cls( + symbols=symbols, + ) + + return list_securities_request diff --git a/openapi_project/openapi_package/models/list_securities_response.py b/openapi_project/openapi_package/models/list_securities_response.py new file mode 100644 index 000000000..8ff2fbd9c --- /dev/null +++ b/openapi_project/openapi_package/models/list_securities_response.py @@ -0,0 +1,84 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.security import Security + + +T = TypeVar("T", bound="ListSecuritiesResponse") + + +@_attrs_define +class ListSecuritiesResponse: + """ + Attributes: + securities (Unset | list['Security']): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + securities: Unset | list["Security"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + securities: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.securities, Unset): + securities = [] + for securities_item_data in self.securities: + securities_item = securities_item_data.to_dict() + securities.append(securities_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if securities is not UNSET: + field_dict["securities"] = securities + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + securities = [] + _securities = d.pop("securities", UNSET) + for securities_item_data in _securities or []: + securities_item = Security.from_dict(securities_item_data) + + securities.append(securities_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + list_securities_response = cls( + securities=securities, + error_message=error_message, + status_code=status_code, + ) + + return list_securities_response diff --git a/openapi_project/openapi_package/models/list_trade_confirms_response.py b/openapi_project/openapi_package/models/list_trade_confirms_response.py new file mode 100644 index 000000000..1a0fbf23e --- /dev/null +++ b/openapi_project/openapi_package/models/list_trade_confirms_response.py @@ -0,0 +1,84 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.trade_confirm import TradeConfirm + + +T = TypeVar("T", bound="ListTradeConfirmsResponse") + + +@_attrs_define +class ListTradeConfirmsResponse: + """ + Attributes: + trade_confirms (Unset | list['TradeConfirm']): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + trade_confirms: Unset | list["TradeConfirm"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + trade_confirms: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.trade_confirms, Unset): + trade_confirms = [] + for trade_confirms_item_data in self.trade_confirms: + trade_confirms_item = trade_confirms_item_data.to_dict() + trade_confirms.append(trade_confirms_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if trade_confirms is not UNSET: + field_dict["tradeConfirms"] = trade_confirms + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + trade_confirms = [] + _trade_confirms = d.pop("tradeConfirms", UNSET) + for trade_confirms_item_data in _trade_confirms or []: + trade_confirms_item = TradeConfirm.from_dict(trade_confirms_item_data) + + trade_confirms.append(trade_confirms_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + list_trade_confirms_response = cls( + trade_confirms=trade_confirms, + error_message=error_message, + status_code=status_code, + ) + + return list_trade_confirms_response diff --git a/openapi_project/openapi_package/models/list_trading_firms_response.py b/openapi_project/openapi_package/models/list_trading_firms_response.py new file mode 100644 index 000000000..a65bac9a9 --- /dev/null +++ b/openapi_project/openapi_package/models/list_trading_firms_response.py @@ -0,0 +1,84 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.trading_firm import TradingFirm + + +T = TypeVar("T", bound="ListTradingFirmsResponse") + + +@_attrs_define +class ListTradingFirmsResponse: + """ + Attributes: + trading_firms (Unset | list['TradingFirm']): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + trading_firms: Unset | list["TradingFirm"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + trading_firms: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.trading_firms, Unset): + trading_firms = [] + for trading_firms_item_data in self.trading_firms: + trading_firms_item = trading_firms_item_data.to_dict() + trading_firms.append(trading_firms_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if trading_firms is not UNSET: + field_dict["tradingFirms"] = trading_firms + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + trading_firms = [] + _trading_firms = d.pop("tradingFirms", UNSET) + for trading_firms_item_data in _trading_firms or []: + trading_firms_item = TradingFirm.from_dict(trading_firms_item_data) + + trading_firms.append(trading_firms_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + list_trading_firms_response = cls( + trading_firms=trading_firms, + error_message=error_message, + status_code=status_code, + ) + + return list_trading_firms_response diff --git a/openapi_project/openapi_package/models/login_request.py b/openapi_project/openapi_package/models/login_request.py new file mode 100644 index 000000000..149a07954 --- /dev/null +++ b/openapi_project/openapi_package/models/login_request.py @@ -0,0 +1,80 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="LoginRequest") + + +@_attrs_define +class LoginRequest: + """ + Attributes: + domain (Unset | str): + username (Unset | str): + password (Unset | str): + application_name (Unset | str): + application_version (Unset | str): + """ + + domain: Unset | str = UNSET + username: Unset | str = UNSET + password: Unset | str = UNSET + application_name: Unset | str = UNSET + application_version: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + domain = self.domain + + username = self.username + + password = self.password + + application_name = self.application_name + + application_version = self.application_version + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if domain is not UNSET: + field_dict["domain"] = domain + if username is not UNSET: + field_dict["username"] = username + if password is not UNSET: + field_dict["password"] = password + if application_name is not UNSET: + field_dict["applicationName"] = application_name + if application_version is not UNSET: + field_dict["applicationVersion"] = application_version + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + domain = d.pop("domain", UNSET) + + username = d.pop("username", UNSET) + + password = d.pop("password", UNSET) + + application_name = d.pop("applicationName", UNSET) + + application_version = d.pop("applicationVersion", UNSET) + + login_request = cls( + domain=domain, + username=username, + password=password, + application_name=application_name, + application_version=application_version, + ) + + return login_request diff --git a/openapi_project/openapi_package/models/login_response.py b/openapi_project/openapi_package/models/login_response.py new file mode 100644 index 000000000..83b23c4fb --- /dev/null +++ b/openapi_project/openapi_package/models/login_response.py @@ -0,0 +1,205 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.login_status import LoginStatus +from ..models.status_code import StatusCode +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.login_response_system_settings import LoginResponseSystemSettings + from ..models.user import User + + +T = TypeVar("T", bound="LoginResponse") + + +@_attrs_define +class LoginResponse: + """ + Attributes: + token (Unset | str): + environment (Unset | str): + login_attempts_remaining (Unset | int): + login_status (Unset | LoginStatus): + server_build_ts (Unset | str): + server_hash (Unset | str): + server_name (Unset | str): + server_time_utc (Unset | str): + server_version (Unset | str): + site (Unset | str): + text (Unset | str): + user (Unset | User): + system_settings (Unset | LoginResponseSystemSettings): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + token: Unset | str = UNSET + environment: Unset | str = UNSET + login_attempts_remaining: Unset | int = UNSET + login_status: Unset | LoginStatus = UNSET + server_build_ts: Unset | str = UNSET + server_hash: Unset | str = UNSET + server_name: Unset | str = UNSET + server_time_utc: Unset | str = UNSET + server_version: Unset | str = UNSET + site: Unset | str = UNSET + text: Unset | str = UNSET + user: Unset | "User" = UNSET + system_settings: Unset | "LoginResponseSystemSettings" = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + token = self.token + + environment = self.environment + + login_attempts_remaining = self.login_attempts_remaining + + login_status: Unset | str = UNSET + if not isinstance(self.login_status, Unset): + login_status = self.login_status.value + + server_build_ts = self.server_build_ts + + server_hash = self.server_hash + + server_name = self.server_name + + server_time_utc = self.server_time_utc + + server_version = self.server_version + + site = self.site + + text = self.text + + user: Unset | dict[str, Any] = UNSET + if not isinstance(self.user, Unset): + user = self.user.to_dict() + + system_settings: Unset | dict[str, Any] = UNSET + if not isinstance(self.system_settings, Unset): + system_settings = self.system_settings.to_dict() + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if token is not UNSET: + field_dict["token"] = token + if environment is not UNSET: + field_dict["environment"] = environment + if login_attempts_remaining is not UNSET: + field_dict["loginAttemptsRemaining"] = login_attempts_remaining + if login_status is not UNSET: + field_dict["loginStatus"] = login_status + if server_build_ts is not UNSET: + field_dict["serverBuildTs"] = server_build_ts + if server_hash is not UNSET: + field_dict["serverHash"] = server_hash + if server_name is not UNSET: + field_dict["serverName"] = server_name + if server_time_utc is not UNSET: + field_dict["serverTimeUtc"] = server_time_utc + if server_version is not UNSET: + field_dict["serverVersion"] = server_version + if site is not UNSET: + field_dict["site"] = site + if text is not UNSET: + field_dict["text"] = text + if user is not UNSET: + field_dict["user"] = user + if system_settings is not UNSET: + field_dict["systemSettings"] = system_settings + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + token = d.pop("token", UNSET) + + environment = d.pop("environment", UNSET) + + login_attempts_remaining = d.pop("loginAttemptsRemaining", UNSET) + + _login_status = d.pop("loginStatus", UNSET) + login_status: Unset | LoginStatus + if isinstance(_login_status, Unset): + login_status = UNSET + else: + login_status = LoginStatus(_login_status) + + server_build_ts = d.pop("serverBuildTs", UNSET) + + server_hash = d.pop("serverHash", UNSET) + + server_name = d.pop("serverName", UNSET) + + server_time_utc = d.pop("serverTimeUtc", UNSET) + + server_version = d.pop("serverVersion", UNSET) + + site = d.pop("site", UNSET) + + text = d.pop("text", UNSET) + + _user = d.pop("user", UNSET) + user: Unset | User + if isinstance(_user, Unset): + user = UNSET + else: + user = User.from_dict(_user) + + _system_settings = d.pop("systemSettings", UNSET) + system_settings: Unset | LoginResponseSystemSettings + if isinstance(_system_settings, Unset): + system_settings = UNSET + else: + system_settings = LoginResponseSystemSettings.from_dict(_system_settings) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + login_response = cls( + token=token, + environment=environment, + login_attempts_remaining=login_attempts_remaining, + login_status=login_status, + server_build_ts=server_build_ts, + server_hash=server_hash, + server_name=server_name, + server_time_utc=server_time_utc, + server_version=server_version, + site=site, + text=text, + user=user, + system_settings=system_settings, + error_message=error_message, + status_code=status_code, + ) + + return login_response diff --git a/openapi_project/openapi_package/models/login_response_system_settings.py b/openapi_project/openapi_package/models/login_response_system_settings.py new file mode 100644 index 000000000..743cb498d --- /dev/null +++ b/openapi_project/openapi_package/models/login_response_system_settings.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="LoginResponseSystemSettings") + + + +@_attrs_define +class LoginResponseSystemSettings: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + login_response_system_settings = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + login_response_system_settings.additional_properties = additional_properties + return login_response_system_settings + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/login_status.py b/openapi_project/openapi_package/models/login_status.py new file mode 100644 index 000000000..30ad89211 --- /dev/null +++ b/openapi_project/openapi_package/models/login_status.py @@ -0,0 +1,19 @@ +from enum import Enum + + +class LoginStatus(str, Enum): + CONNECTION_FAILED = "CONNECTION_FAILED" + LOGIN_DISALLOWED = "LOGIN_DISALLOWED" + LOGIN_SUCCESS = "LOGIN_SUCCESS" + MFA_FAILED = "MFA_FAILED" + MFA_REQUIRED = "MFA_REQUIRED" + NOT_AUTHORIZED = "NOT_AUTHORIZED" + PASSWORD_CHANGE_FAILED = "PASSWORD_CHANGE_FAILED" + PASSWORD_CHANGE_SUCCESSFUL = "PASSWORD_CHANGE_SUCCESSFUL" + PASSWORD_EXPIRED = "PASSWORD_EXPIRED" + SERVER_HASH_CHANGED = "SERVER_HASH_CHANGED" + UNDEFINED = "UNDEFINED" + VERSION_TOO_OLD = "VERSION_TOO_OLD" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/margin_data.py b/openapi_project/openapi_package/models/margin_data.py new file mode 100644 index 000000000..0740c965b --- /dev/null +++ b/openapi_project/openapi_package/models/margin_data.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.tims_margin_data import TimsMarginData + from ..models.empty import Empty + + +T = TypeVar("T", bound="MarginData") + + +@_attrs_define +class MarginData: + """ + Attributes: + account_id (Unset | int): + tims (Unset | TimsMarginData): + span (Unset | Empty): + """ + + account_id: Unset | int = UNSET + tims: Unset | "TimsMarginData" = UNSET + span: Unset | "Empty" = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + tims: Unset | dict[str, Any] = UNSET + if not isinstance(self.tims, Unset): + tims = self.tims.to_dict() + + span: Unset | dict[str, Any] = UNSET + if not isinstance(self.span, Unset): + span = self.span.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if tims is not UNSET: + field_dict["tims"] = tims + if span is not UNSET: + field_dict["span"] = span + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + _tims = d.pop("tims", UNSET) + tims: Unset | TimsMarginData + if isinstance(_tims, Unset): + tims = UNSET + else: + tims = TimsMarginData.from_dict(_tims) + + _span = d.pop("span", UNSET) + span: Unset | Empty + if isinstance(_span, Unset): + span = UNSET + else: + span = Empty.from_dict(_span) + + margin_data = cls( + account_id=account_id, + tims=tims, + span=span, + ) + + return margin_data diff --git a/openapi_project/openapi_package/models/margin_data_type.py b/openapi_project/openapi_package/models/margin_data_type.py new file mode 100644 index 000000000..aecc4034d --- /dev/null +++ b/openapi_project/openapi_package/models/margin_data_type.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class MarginDataType(str, Enum): + MARGIN_DATA_TYPE_SPAN = "MARGIN_DATA_TYPE_SPAN" + MARGIN_DATA_TYPE_TIMS = "MARGIN_DATA_TYPE_TIMS" + MARGIN_DATA_TYPE_UNKNOWN = "MARGIN_DATA_TYPE_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/multi_leg_order.py b/openapi_project/openapi_package/models/multi_leg_order.py new file mode 100644 index 000000000..956838941 --- /dev/null +++ b/openapi_project/openapi_package/models/multi_leg_order.py @@ -0,0 +1,538 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.ord_status import OrdStatus +from ..models.ord_type import OrdType +from ..models.origination_type import OriginationType +from ..models.price_type import PriceType +from ..models.tif import Tif +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.clearing_info import ClearingInfo + from ..models.multi_leg_order_market_condition import MultiLegOrderMarketCondition + from ..models.multi_leg_order_leg import MultiLegOrderLeg + from ..models.order_update_event import OrderUpdateEvent + from ..models.multi_leg_order_algo import MultiLegOrderAlgo + from ..models.header import Header + from ..models.multi_leg_order_optional_data import MultiLegOrderOptionalData + from ..models.order_instruction import OrderInstruction + + +T = TypeVar("T", bound="MultiLegOrder") + + +@_attrs_define +class MultiLegOrder: + """ + Attributes: + account_id (Unset | int): + algo (Unset | MultiLegOrderAlgo): + aux_price (Unset | float): + clearing_info (Unset | ClearingInfo): + cur_ord_id (Unset | str): + header (Unset | Header): + id (Unset | str): + incoming_cl_ord_id (Unset | str): + incoming_ord_id (Unset | str): + instructions (Unset | list['OrderInstruction']): + legs (Unset | list['MultiLegOrderLeg']): + market_condition (Unset | MultiLegOrderMarketCondition): + optional_data (Unset | MultiLegOrderOptionalData): + order_flags (Unset | int): + order_updates (Unset | list['OrderUpdateEvent']): + ord_type (Unset | OrdType): + origination_type (Unset | OriginationType): + parent_ord_id (Unset | str): + price (Unset | float): + price_type (Unset | PriceType): + qty (Unset | float): + route (Unset | str): + source (Unset | str): + source_address (Unset | str): + submit_ts (Unset | str): + tag (Unset | str): + text (Unset | str): + tif (Unset | Tif): + user_id (Unset | int): + trader_id (Unset | str): + ord_status (Unset | OrdStatus): + avg_price (Unset | float): + claimed_by (Unset | str): + last_price (Unset | float): + last_qty (Unset | float): + last_market (Unset | str): + leaves_qty (Unset | float): + cum_qty (Unset | float): + transact_ts (Unset | str): + working_qty (Unset | float): + has_busts (Unset | bool): + has_corrects (Unset | bool): + has_notes (Unset | bool): + """ + + account_id: Unset | int = UNSET + algo: Unset | "MultiLegOrderAlgo" = UNSET + aux_price: Unset | float = UNSET + clearing_info: Unset | "ClearingInfo" = UNSET + cur_ord_id: Unset | str = UNSET + header: Unset | "Header" = UNSET + id: Unset | str = UNSET + incoming_cl_ord_id: Unset | str = UNSET + incoming_ord_id: Unset | str = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + legs: Unset | list["MultiLegOrderLeg"] = UNSET + market_condition: Unset | "MultiLegOrderMarketCondition" = UNSET + optional_data: Unset | "MultiLegOrderOptionalData" = UNSET + order_flags: Unset | int = UNSET + order_updates: Unset | list["OrderUpdateEvent"] = UNSET + ord_type: Unset | OrdType = UNSET + origination_type: Unset | OriginationType = UNSET + parent_ord_id: Unset | str = UNSET + price: Unset | float = UNSET + price_type: Unset | PriceType = UNSET + qty: Unset | float = UNSET + route: Unset | str = UNSET + source: Unset | str = UNSET + source_address: Unset | str = UNSET + submit_ts: Unset | str = UNSET + tag: Unset | str = UNSET + text: Unset | str = UNSET + tif: Unset | Tif = UNSET + user_id: Unset | int = UNSET + trader_id: Unset | str = UNSET + ord_status: Unset | OrdStatus = UNSET + avg_price: Unset | float = UNSET + claimed_by: Unset | str = UNSET + last_price: Unset | float = UNSET + last_qty: Unset | float = UNSET + last_market: Unset | str = UNSET + leaves_qty: Unset | float = UNSET + cum_qty: Unset | float = UNSET + transact_ts: Unset | str = UNSET + working_qty: Unset | float = UNSET + has_busts: Unset | bool = UNSET + has_corrects: Unset | bool = UNSET + has_notes: Unset | bool = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + algo: Unset | dict[str, Any] = UNSET + if not isinstance(self.algo, Unset): + algo = self.algo.to_dict() + + aux_price = self.aux_price + + clearing_info: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_info, Unset): + clearing_info = self.clearing_info.to_dict() + + cur_ord_id = self.cur_ord_id + + header: Unset | dict[str, Any] = UNSET + if not isinstance(self.header, Unset): + header = self.header.to_dict() + + id = self.id + + incoming_cl_ord_id = self.incoming_cl_ord_id + + incoming_ord_id = self.incoming_ord_id + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + legs: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.legs, Unset): + legs = [] + for legs_item_data in self.legs: + legs_item = legs_item_data.to_dict() + legs.append(legs_item) + + market_condition: Unset | dict[str, Any] = UNSET + if not isinstance(self.market_condition, Unset): + market_condition = self.market_condition.to_dict() + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + order_flags = self.order_flags + + order_updates: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.order_updates, Unset): + order_updates = [] + for order_updates_item_data in self.order_updates: + order_updates_item = order_updates_item_data.to_dict() + order_updates.append(order_updates_item) + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + origination_type: Unset | str = UNSET + if not isinstance(self.origination_type, Unset): + origination_type = self.origination_type.value + + parent_ord_id = self.parent_ord_id + + price = self.price + + price_type: Unset | str = UNSET + if not isinstance(self.price_type, Unset): + price_type = self.price_type.value + + qty = self.qty + + route = self.route + + source = self.source + + source_address = self.source_address + + submit_ts = self.submit_ts + + tag = self.tag + + text = self.text + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + user_id = self.user_id + + trader_id = self.trader_id + + ord_status: Unset | str = UNSET + if not isinstance(self.ord_status, Unset): + ord_status = self.ord_status.value + + avg_price = self.avg_price + + claimed_by = self.claimed_by + + last_price = self.last_price + + last_qty = self.last_qty + + last_market = self.last_market + + leaves_qty = self.leaves_qty + + cum_qty = self.cum_qty + + transact_ts = self.transact_ts + + working_qty = self.working_qty + + has_busts = self.has_busts + + has_corrects = self.has_corrects + + has_notes = self.has_notes + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if algo is not UNSET: + field_dict["algo"] = algo + if aux_price is not UNSET: + field_dict["auxPrice"] = aux_price + if clearing_info is not UNSET: + field_dict["clearingInfo"] = clearing_info + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if header is not UNSET: + field_dict["header"] = header + if id is not UNSET: + field_dict["id"] = id + if incoming_cl_ord_id is not UNSET: + field_dict["incomingClOrdId"] = incoming_cl_ord_id + if incoming_ord_id is not UNSET: + field_dict["incomingOrdId"] = incoming_ord_id + if instructions is not UNSET: + field_dict["instructions"] = instructions + if legs is not UNSET: + field_dict["legs"] = legs + if market_condition is not UNSET: + field_dict["marketCondition"] = market_condition + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if order_flags is not UNSET: + field_dict["orderFlags"] = order_flags + if order_updates is not UNSET: + field_dict["orderUpdates"] = order_updates + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if origination_type is not UNSET: + field_dict["originationType"] = origination_type + if parent_ord_id is not UNSET: + field_dict["parentOrdId"] = parent_ord_id + if price is not UNSET: + field_dict["price"] = price + if price_type is not UNSET: + field_dict["priceType"] = price_type + if qty is not UNSET: + field_dict["qty"] = qty + if route is not UNSET: + field_dict["route"] = route + if source is not UNSET: + field_dict["source"] = source + if source_address is not UNSET: + field_dict["sourceAddress"] = source_address + if submit_ts is not UNSET: + field_dict["submitTs"] = submit_ts + if tag is not UNSET: + field_dict["tag"] = tag + if text is not UNSET: + field_dict["text"] = text + if tif is not UNSET: + field_dict["tif"] = tif + if user_id is not UNSET: + field_dict["userId"] = user_id + if trader_id is not UNSET: + field_dict["traderId"] = trader_id + if ord_status is not UNSET: + field_dict["ordStatus"] = ord_status + if avg_price is not UNSET: + field_dict["avgPrice"] = avg_price + if claimed_by is not UNSET: + field_dict["claimedBy"] = claimed_by + if last_price is not UNSET: + field_dict["lastPrice"] = last_price + if last_qty is not UNSET: + field_dict["lastQty"] = last_qty + if last_market is not UNSET: + field_dict["lastMarket"] = last_market + if leaves_qty is not UNSET: + field_dict["leavesQty"] = leaves_qty + if cum_qty is not UNSET: + field_dict["cumQty"] = cum_qty + if transact_ts is not UNSET: + field_dict["transactTs"] = transact_ts + if working_qty is not UNSET: + field_dict["workingQty"] = working_qty + if has_busts is not UNSET: + field_dict["hasBusts"] = has_busts + if has_corrects is not UNSET: + field_dict["hasCorrects"] = has_corrects + if has_notes is not UNSET: + field_dict["hasNotes"] = has_notes + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + _algo = d.pop("algo", UNSET) + algo: Unset | MultiLegOrderAlgo + if isinstance(_algo, Unset): + algo = UNSET + else: + algo = MultiLegOrderAlgo.from_dict(_algo) + + aux_price = d.pop("auxPrice", UNSET) + + _clearing_info = d.pop("clearingInfo", UNSET) + clearing_info: Unset | ClearingInfo + if isinstance(_clearing_info, Unset): + clearing_info = UNSET + else: + clearing_info = ClearingInfo.from_dict(_clearing_info) + + cur_ord_id = d.pop("curOrdId", UNSET) + + _header = d.pop("header", UNSET) + header: Unset | Header + if isinstance(_header, Unset): + header = UNSET + else: + header = Header.from_dict(_header) + + id = d.pop("id", UNSET) + + incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) + + incoming_ord_id = d.pop("incomingOrdId", UNSET) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + legs = [] + _legs = d.pop("legs", UNSET) + for legs_item_data in _legs or []: + legs_item = MultiLegOrderLeg.from_dict(legs_item_data) + + legs.append(legs_item) + + _market_condition = d.pop("marketCondition", UNSET) + market_condition: Unset | MultiLegOrderMarketCondition + if isinstance(_market_condition, Unset): + market_condition = UNSET + else: + market_condition = MultiLegOrderMarketCondition.from_dict(_market_condition) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | MultiLegOrderOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = MultiLegOrderOptionalData.from_dict(_optional_data) + + order_flags = d.pop("orderFlags", UNSET) + + order_updates = [] + _order_updates = d.pop("orderUpdates", UNSET) + for order_updates_item_data in _order_updates or []: + order_updates_item = OrderUpdateEvent.from_dict(order_updates_item_data) + + order_updates.append(order_updates_item) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + _origination_type = d.pop("originationType", UNSET) + origination_type: Unset | OriginationType + if isinstance(_origination_type, Unset): + origination_type = UNSET + else: + origination_type = OriginationType(_origination_type) + + parent_ord_id = d.pop("parentOrdId", UNSET) + + price = d.pop("price", UNSET) + + _price_type = d.pop("priceType", UNSET) + price_type: Unset | PriceType + if isinstance(_price_type, Unset): + price_type = UNSET + else: + price_type = PriceType(_price_type) + + qty = d.pop("qty", UNSET) + + route = d.pop("route", UNSET) + + source = d.pop("source", UNSET) + + source_address = d.pop("sourceAddress", UNSET) + + submit_ts = d.pop("submitTs", UNSET) + + tag = d.pop("tag", UNSET) + + text = d.pop("text", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + user_id = d.pop("userId", UNSET) + + trader_id = d.pop("traderId", UNSET) + + _ord_status = d.pop("ordStatus", UNSET) + ord_status: Unset | OrdStatus + if isinstance(_ord_status, Unset): + ord_status = UNSET + else: + ord_status = OrdStatus(_ord_status) + + avg_price = d.pop("avgPrice", UNSET) + + claimed_by = d.pop("claimedBy", UNSET) + + last_price = d.pop("lastPrice", UNSET) + + last_qty = d.pop("lastQty", UNSET) + + last_market = d.pop("lastMarket", UNSET) + + leaves_qty = d.pop("leavesQty", UNSET) + + cum_qty = d.pop("cumQty", UNSET) + + transact_ts = d.pop("transactTs", UNSET) + + working_qty = d.pop("workingQty", UNSET) + + has_busts = d.pop("hasBusts", UNSET) + + has_corrects = d.pop("hasCorrects", UNSET) + + has_notes = d.pop("hasNotes", UNSET) + + multi_leg_order = cls( + account_id=account_id, + algo=algo, + aux_price=aux_price, + clearing_info=clearing_info, + cur_ord_id=cur_ord_id, + header=header, + id=id, + incoming_cl_ord_id=incoming_cl_ord_id, + incoming_ord_id=incoming_ord_id, + instructions=instructions, + legs=legs, + market_condition=market_condition, + optional_data=optional_data, + order_flags=order_flags, + order_updates=order_updates, + ord_type=ord_type, + origination_type=origination_type, + parent_ord_id=parent_ord_id, + price=price, + price_type=price_type, + qty=qty, + route=route, + source=source, + source_address=source_address, + submit_ts=submit_ts, + tag=tag, + text=text, + tif=tif, + user_id=user_id, + trader_id=trader_id, + ord_status=ord_status, + avg_price=avg_price, + claimed_by=claimed_by, + last_price=last_price, + last_qty=last_qty, + last_market=last_market, + leaves_qty=leaves_qty, + cum_qty=cum_qty, + transact_ts=transact_ts, + working_qty=working_qty, + has_busts=has_busts, + has_corrects=has_corrects, + has_notes=has_notes, + ) + + return multi_leg_order diff --git a/openapi_project/openapi_package/models/multi_leg_order_algo.py b/openapi_project/openapi_package/models/multi_leg_order_algo.py new file mode 100644 index 000000000..17d1f9558 --- /dev/null +++ b/openapi_project/openapi_package/models/multi_leg_order_algo.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="MultiLegOrderAlgo") + + + +@_attrs_define +class MultiLegOrderAlgo: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + multi_leg_order_algo = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + multi_leg_order_algo.additional_properties = additional_properties + return multi_leg_order_algo + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py new file mode 100644 index 000000000..3cddead1a --- /dev/null +++ b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py @@ -0,0 +1,366 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.ord_type import OrdType +from ..models.origination_type import OriginationType +from ..models.price_type import PriceType +from ..models.side import Side +from ..models.tif import Tif +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.multi_leg_order_cancel_replace_request_optional_data import ( + MultiLegOrderCancelReplaceRequestOptionalData, + ) + from ..models.clearing_info import ClearingInfo + from ..models.multi_leg_order_cancel_replace_request_algo import ( + MultiLegOrderCancelReplaceRequestAlgo, + ) + from ..models.header import Header + from ..models.order_instruction import OrderInstruction + from ..models.multi_leg_order_cancel_replace_request_market_condition import ( + MultiLegOrderCancelReplaceRequestMarketCondition, + ) + + +T = TypeVar("T", bound="MultiLegOrderCancelReplaceRequest") + + +@_attrs_define +class MultiLegOrderCancelReplaceRequest: + """ + Attributes: + algo (Unset | MultiLegOrderCancelReplaceRequestAlgo): + aux_price (Unset | float): + clearing_info (Unset | ClearingInfo): + cur_ord_id (Unset | str): + header (Unset | Header): + incoming_cl_ord_id (Unset | str): + incoming_orig_cl_ord_id (Unset | str): + instructions (Unset | list['OrderInstruction']): + optional_data (Unset | MultiLegOrderCancelReplaceRequestOptionalData): + market_condition (Unset | MultiLegOrderCancelReplaceRequestMarketCondition): + ord_type (Unset | OrdType): + origination_type (Unset | OriginationType): + perm_ord_id (Unset | str): + price (Unset | float): + price_type (Unset | PriceType): + qty (Unset | float): + req_ord_id (Unset | str): + side (Unset | Side): + source (Unset | str): + submit_ts (Unset | str): + tag (Unset | str): + text (Unset | str): + tif (Unset | Tif): + trader_id (Unset | str): + user_id (Unset | int): + """ + + algo: Unset | "MultiLegOrderCancelReplaceRequestAlgo" = UNSET + aux_price: Unset | float = UNSET + clearing_info: Unset | "ClearingInfo" = UNSET + cur_ord_id: Unset | str = UNSET + header: Unset | "Header" = UNSET + incoming_cl_ord_id: Unset | str = UNSET + incoming_orig_cl_ord_id: Unset | str = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + optional_data: Unset | "MultiLegOrderCancelReplaceRequestOptionalData" = UNSET + market_condition: Unset | "MultiLegOrderCancelReplaceRequestMarketCondition" = UNSET + ord_type: Unset | OrdType = UNSET + origination_type: Unset | OriginationType = UNSET + perm_ord_id: Unset | str = UNSET + price: Unset | float = UNSET + price_type: Unset | PriceType = UNSET + qty: Unset | float = UNSET + req_ord_id: Unset | str = UNSET + side: Unset | Side = UNSET + source: Unset | str = UNSET + submit_ts: Unset | str = UNSET + tag: Unset | str = UNSET + text: Unset | str = UNSET + tif: Unset | Tif = UNSET + trader_id: Unset | str = UNSET + user_id: Unset | int = UNSET + + def to_dict(self) -> dict[str, Any]: + algo: Unset | dict[str, Any] = UNSET + if not isinstance(self.algo, Unset): + algo = self.algo.to_dict() + + aux_price = self.aux_price + + clearing_info: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_info, Unset): + clearing_info = self.clearing_info.to_dict() + + cur_ord_id = self.cur_ord_id + + header: Unset | dict[str, Any] = UNSET + if not isinstance(self.header, Unset): + header = self.header.to_dict() + + incoming_cl_ord_id = self.incoming_cl_ord_id + + incoming_orig_cl_ord_id = self.incoming_orig_cl_ord_id + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + market_condition: Unset | dict[str, Any] = UNSET + if not isinstance(self.market_condition, Unset): + market_condition = self.market_condition.to_dict() + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + origination_type: Unset | str = UNSET + if not isinstance(self.origination_type, Unset): + origination_type = self.origination_type.value + + perm_ord_id = self.perm_ord_id + + price = self.price + + price_type: Unset | str = UNSET + if not isinstance(self.price_type, Unset): + price_type = self.price_type.value + + qty = self.qty + + req_ord_id = self.req_ord_id + + side: Unset | str = UNSET + if not isinstance(self.side, Unset): + side = self.side.value + + source = self.source + + submit_ts = self.submit_ts + + tag = self.tag + + text = self.text + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + trader_id = self.trader_id + + user_id = self.user_id + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if algo is not UNSET: + field_dict["algo"] = algo + if aux_price is not UNSET: + field_dict["auxPrice"] = aux_price + if clearing_info is not UNSET: + field_dict["clearingInfo"] = clearing_info + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if header is not UNSET: + field_dict["header"] = header + if incoming_cl_ord_id is not UNSET: + field_dict["incomingClOrdId"] = incoming_cl_ord_id + if incoming_orig_cl_ord_id is not UNSET: + field_dict["incomingOrigClOrdId"] = incoming_orig_cl_ord_id + if instructions is not UNSET: + field_dict["instructions"] = instructions + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if market_condition is not UNSET: + field_dict["marketCondition"] = market_condition + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if origination_type is not UNSET: + field_dict["originationType"] = origination_type + if perm_ord_id is not UNSET: + field_dict["permOrdId"] = perm_ord_id + if price is not UNSET: + field_dict["price"] = price + if price_type is not UNSET: + field_dict["priceType"] = price_type + if qty is not UNSET: + field_dict["qty"] = qty + if req_ord_id is not UNSET: + field_dict["reqOrdId"] = req_ord_id + if side is not UNSET: + field_dict["side"] = side + if source is not UNSET: + field_dict["source"] = source + if submit_ts is not UNSET: + field_dict["submitTs"] = submit_ts + if tag is not UNSET: + field_dict["tag"] = tag + if text is not UNSET: + field_dict["text"] = text + if tif is not UNSET: + field_dict["tif"] = tif + if trader_id is not UNSET: + field_dict["traderId"] = trader_id + if user_id is not UNSET: + field_dict["userId"] = user_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _algo = d.pop("algo", UNSET) + algo: Unset | MultiLegOrderCancelReplaceRequestAlgo + if isinstance(_algo, Unset): + algo = UNSET + else: + algo = MultiLegOrderCancelReplaceRequestAlgo.from_dict(_algo) + + aux_price = d.pop("auxPrice", UNSET) + + _clearing_info = d.pop("clearingInfo", UNSET) + clearing_info: Unset | ClearingInfo + if isinstance(_clearing_info, Unset): + clearing_info = UNSET + else: + clearing_info = ClearingInfo.from_dict(_clearing_info) + + cur_ord_id = d.pop("curOrdId", UNSET) + + _header = d.pop("header", UNSET) + header: Unset | Header + if isinstance(_header, Unset): + header = UNSET + else: + header = Header.from_dict(_header) + + incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) + + incoming_orig_cl_ord_id = d.pop("incomingOrigClOrdId", UNSET) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | MultiLegOrderCancelReplaceRequestOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = MultiLegOrderCancelReplaceRequestOptionalData.from_dict( + _optional_data + ) + + _market_condition = d.pop("marketCondition", UNSET) + market_condition: Unset | MultiLegOrderCancelReplaceRequestMarketCondition + if isinstance(_market_condition, Unset): + market_condition = UNSET + else: + market_condition = ( + MultiLegOrderCancelReplaceRequestMarketCondition.from_dict( + _market_condition + ) + ) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + _origination_type = d.pop("originationType", UNSET) + origination_type: Unset | OriginationType + if isinstance(_origination_type, Unset): + origination_type = UNSET + else: + origination_type = OriginationType(_origination_type) + + perm_ord_id = d.pop("permOrdId", UNSET) + + price = d.pop("price", UNSET) + + _price_type = d.pop("priceType", UNSET) + price_type: Unset | PriceType + if isinstance(_price_type, Unset): + price_type = UNSET + else: + price_type = PriceType(_price_type) + + qty = d.pop("qty", UNSET) + + req_ord_id = d.pop("reqOrdId", UNSET) + + _side = d.pop("side", UNSET) + side: Unset | Side + if isinstance(_side, Unset): + side = UNSET + else: + side = Side(_side) + + source = d.pop("source", UNSET) + + submit_ts = d.pop("submitTs", UNSET) + + tag = d.pop("tag", UNSET) + + text = d.pop("text", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + trader_id = d.pop("traderId", UNSET) + + user_id = d.pop("userId", UNSET) + + multi_leg_order_cancel_replace_request = cls( + algo=algo, + aux_price=aux_price, + clearing_info=clearing_info, + cur_ord_id=cur_ord_id, + header=header, + incoming_cl_ord_id=incoming_cl_ord_id, + incoming_orig_cl_ord_id=incoming_orig_cl_ord_id, + instructions=instructions, + optional_data=optional_data, + market_condition=market_condition, + ord_type=ord_type, + origination_type=origination_type, + perm_ord_id=perm_ord_id, + price=price, + price_type=price_type, + qty=qty, + req_ord_id=req_ord_id, + side=side, + source=source, + submit_ts=submit_ts, + tag=tag, + text=text, + tif=tif, + trader_id=trader_id, + user_id=user_id, + ) + + return multi_leg_order_cancel_replace_request diff --git a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py new file mode 100644 index 000000000..82b711b32 --- /dev/null +++ b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="MultiLegOrderCancelReplaceRequestAlgo") + + + +@_attrs_define +class MultiLegOrderCancelReplaceRequestAlgo: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + multi_leg_order_cancel_replace_request_algo = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + multi_leg_order_cancel_replace_request_algo.additional_properties = additional_properties + return multi_leg_order_cancel_replace_request_algo + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py new file mode 100644 index 000000000..3a3e22417 --- /dev/null +++ b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="MultiLegOrderCancelReplaceRequestMarketCondition") + + + +@_attrs_define +class MultiLegOrderCancelReplaceRequestMarketCondition: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + multi_leg_order_cancel_replace_request_market_condition = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + multi_leg_order_cancel_replace_request_market_condition.additional_properties = additional_properties + return multi_leg_order_cancel_replace_request_market_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py new file mode 100644 index 000000000..f3b56983f --- /dev/null +++ b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="MultiLegOrderCancelReplaceRequestOptionalData") + + + +@_attrs_define +class MultiLegOrderCancelReplaceRequestOptionalData: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + multi_leg_order_cancel_replace_request_optional_data = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + multi_leg_order_cancel_replace_request_optional_data.additional_properties = additional_properties + return multi_leg_order_cancel_replace_request_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross.py b/openapi_project/openapi_package/models/multi_leg_order_cross.py new file mode 100644 index 000000000..9816df389 --- /dev/null +++ b/openapi_project/openapi_package/models/multi_leg_order_cross.py @@ -0,0 +1,474 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.cross_type import CrossType +from ..models.ord_status import OrdStatus +from ..models.ord_type import OrdType +from ..models.origination_type import OriginationType +from ..models.price_type import PriceType +from ..models.tif import Tif +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation + from ..models.multi_leg_order_cross_market_condition import ( + MultiLegOrderCrossMarketCondition, + ) + from ..models.order_update_event import OrderUpdateEvent + from ..models.header import Header + from ..models.multi_leg_order_cross_algo import MultiLegOrderCrossAlgo + from ..models.order_instruction import OrderInstruction + from ..models.multi_leg_order_cross_optional_data import ( + MultiLegOrderCrossOptionalData, + ) + + +T = TypeVar("T", bound="MultiLegOrderCross") + + +@_attrs_define +class MultiLegOrderCross: + """ + Attributes: + account_id (Unset | int): + algo (Unset | MultiLegOrderCrossAlgo): + allocations (Unset | list['MultiLegOrderCrossAllocation']): + cross_type (Unset | CrossType): + cur_ord_id (Unset | str): + header (Unset | Header): + id (Unset | str): + incoming_cl_ord_id (Unset | str): + incoming_ord_id (Unset | str): + instructions (Unset | list['OrderInstruction']): + market_condition (Unset | MultiLegOrderCrossMarketCondition): + optional_data (Unset | MultiLegOrderCrossOptionalData): + order_flags (Unset | int): + order_updates (Unset | list['OrderUpdateEvent']): + ord_type (Unset | OrdType): + origination_type (Unset | OriginationType): + parent_ord_id (Unset | str): + price (Unset | float): + price_type (Unset | PriceType): + qty (Unset | float): + route (Unset | str): + source (Unset | str): + source_address (Unset | str): + submit_ts (Unset | str): + tag (Unset | str): + text (Unset | str): + tif (Unset | Tif): + user_id (Unset | int): + trader_id (Unset | str): + claimed_by (Unset | str): + ord_status (Unset | OrdStatus): + transact_ts (Unset | str): + has_busts (Unset | bool): + has_corrects (Unset | bool): + has_notes (Unset | bool): + """ + + account_id: Unset | int = UNSET + algo: Unset | "MultiLegOrderCrossAlgo" = UNSET + allocations: Unset | list["MultiLegOrderCrossAllocation"] = UNSET + cross_type: Unset | CrossType = UNSET + cur_ord_id: Unset | str = UNSET + header: Unset | "Header" = UNSET + id: Unset | str = UNSET + incoming_cl_ord_id: Unset | str = UNSET + incoming_ord_id: Unset | str = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + market_condition: Unset | "MultiLegOrderCrossMarketCondition" = UNSET + optional_data: Unset | "MultiLegOrderCrossOptionalData" = UNSET + order_flags: Unset | int = UNSET + order_updates: Unset | list["OrderUpdateEvent"] = UNSET + ord_type: Unset | OrdType = UNSET + origination_type: Unset | OriginationType = UNSET + parent_ord_id: Unset | str = UNSET + price: Unset | float = UNSET + price_type: Unset | PriceType = UNSET + qty: Unset | float = UNSET + route: Unset | str = UNSET + source: Unset | str = UNSET + source_address: Unset | str = UNSET + submit_ts: Unset | str = UNSET + tag: Unset | str = UNSET + text: Unset | str = UNSET + tif: Unset | Tif = UNSET + user_id: Unset | int = UNSET + trader_id: Unset | str = UNSET + claimed_by: Unset | str = UNSET + ord_status: Unset | OrdStatus = UNSET + transact_ts: Unset | str = UNSET + has_busts: Unset | bool = UNSET + has_corrects: Unset | bool = UNSET + has_notes: Unset | bool = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + algo: Unset | dict[str, Any] = UNSET + if not isinstance(self.algo, Unset): + algo = self.algo.to_dict() + + allocations: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.allocations, Unset): + allocations = [] + for allocations_item_data in self.allocations: + allocations_item = allocations_item_data.to_dict() + allocations.append(allocations_item) + + cross_type: Unset | str = UNSET + if not isinstance(self.cross_type, Unset): + cross_type = self.cross_type.value + + cur_ord_id = self.cur_ord_id + + header: Unset | dict[str, Any] = UNSET + if not isinstance(self.header, Unset): + header = self.header.to_dict() + + id = self.id + + incoming_cl_ord_id = self.incoming_cl_ord_id + + incoming_ord_id = self.incoming_ord_id + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + market_condition: Unset | dict[str, Any] = UNSET + if not isinstance(self.market_condition, Unset): + market_condition = self.market_condition.to_dict() + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + order_flags = self.order_flags + + order_updates: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.order_updates, Unset): + order_updates = [] + for order_updates_item_data in self.order_updates: + order_updates_item = order_updates_item_data.to_dict() + order_updates.append(order_updates_item) + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + origination_type: Unset | str = UNSET + if not isinstance(self.origination_type, Unset): + origination_type = self.origination_type.value + + parent_ord_id = self.parent_ord_id + + price = self.price + + price_type: Unset | str = UNSET + if not isinstance(self.price_type, Unset): + price_type = self.price_type.value + + qty = self.qty + + route = self.route + + source = self.source + + source_address = self.source_address + + submit_ts = self.submit_ts + + tag = self.tag + + text = self.text + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + user_id = self.user_id + + trader_id = self.trader_id + + claimed_by = self.claimed_by + + ord_status: Unset | str = UNSET + if not isinstance(self.ord_status, Unset): + ord_status = self.ord_status.value + + transact_ts = self.transact_ts + + has_busts = self.has_busts + + has_corrects = self.has_corrects + + has_notes = self.has_notes + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if algo is not UNSET: + field_dict["algo"] = algo + if allocations is not UNSET: + field_dict["allocations"] = allocations + if cross_type is not UNSET: + field_dict["crossType"] = cross_type + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if header is not UNSET: + field_dict["header"] = header + if id is not UNSET: + field_dict["id"] = id + if incoming_cl_ord_id is not UNSET: + field_dict["incomingClOrdId"] = incoming_cl_ord_id + if incoming_ord_id is not UNSET: + field_dict["incomingOrdId"] = incoming_ord_id + if instructions is not UNSET: + field_dict["instructions"] = instructions + if market_condition is not UNSET: + field_dict["marketCondition"] = market_condition + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if order_flags is not UNSET: + field_dict["orderFlags"] = order_flags + if order_updates is not UNSET: + field_dict["orderUpdates"] = order_updates + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if origination_type is not UNSET: + field_dict["originationType"] = origination_type + if parent_ord_id is not UNSET: + field_dict["parentOrdId"] = parent_ord_id + if price is not UNSET: + field_dict["price"] = price + if price_type is not UNSET: + field_dict["priceType"] = price_type + if qty is not UNSET: + field_dict["qty"] = qty + if route is not UNSET: + field_dict["route"] = route + if source is not UNSET: + field_dict["source"] = source + if source_address is not UNSET: + field_dict["sourceAddress"] = source_address + if submit_ts is not UNSET: + field_dict["submitTs"] = submit_ts + if tag is not UNSET: + field_dict["tag"] = tag + if text is not UNSET: + field_dict["text"] = text + if tif is not UNSET: + field_dict["tif"] = tif + if user_id is not UNSET: + field_dict["userId"] = user_id + if trader_id is not UNSET: + field_dict["traderId"] = trader_id + if claimed_by is not UNSET: + field_dict["claimedBy"] = claimed_by + if ord_status is not UNSET: + field_dict["ordStatus"] = ord_status + if transact_ts is not UNSET: + field_dict["transactTs"] = transact_ts + if has_busts is not UNSET: + field_dict["hasBusts"] = has_busts + if has_corrects is not UNSET: + field_dict["hasCorrects"] = has_corrects + if has_notes is not UNSET: + field_dict["hasNotes"] = has_notes + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + _algo = d.pop("algo", UNSET) + algo: Unset | MultiLegOrderCrossAlgo + if isinstance(_algo, Unset): + algo = UNSET + else: + algo = MultiLegOrderCrossAlgo.from_dict(_algo) + + allocations = [] + _allocations = d.pop("allocations", UNSET) + for allocations_item_data in _allocations or []: + allocations_item = MultiLegOrderCrossAllocation.from_dict( + allocations_item_data + ) + + allocations.append(allocations_item) + + _cross_type = d.pop("crossType", UNSET) + cross_type: Unset | CrossType + if isinstance(_cross_type, Unset): + cross_type = UNSET + else: + cross_type = CrossType(_cross_type) + + cur_ord_id = d.pop("curOrdId", UNSET) + + _header = d.pop("header", UNSET) + header: Unset | Header + if isinstance(_header, Unset): + header = UNSET + else: + header = Header.from_dict(_header) + + id = d.pop("id", UNSET) + + incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) + + incoming_ord_id = d.pop("incomingOrdId", UNSET) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + _market_condition = d.pop("marketCondition", UNSET) + market_condition: Unset | MultiLegOrderCrossMarketCondition + if isinstance(_market_condition, Unset): + market_condition = UNSET + else: + market_condition = MultiLegOrderCrossMarketCondition.from_dict( + _market_condition + ) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | MultiLegOrderCrossOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = MultiLegOrderCrossOptionalData.from_dict(_optional_data) + + order_flags = d.pop("orderFlags", UNSET) + + order_updates = [] + _order_updates = d.pop("orderUpdates", UNSET) + for order_updates_item_data in _order_updates or []: + order_updates_item = OrderUpdateEvent.from_dict(order_updates_item_data) + + order_updates.append(order_updates_item) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + _origination_type = d.pop("originationType", UNSET) + origination_type: Unset | OriginationType + if isinstance(_origination_type, Unset): + origination_type = UNSET + else: + origination_type = OriginationType(_origination_type) + + parent_ord_id = d.pop("parentOrdId", UNSET) + + price = d.pop("price", UNSET) + + _price_type = d.pop("priceType", UNSET) + price_type: Unset | PriceType + if isinstance(_price_type, Unset): + price_type = UNSET + else: + price_type = PriceType(_price_type) + + qty = d.pop("qty", UNSET) + + route = d.pop("route", UNSET) + + source = d.pop("source", UNSET) + + source_address = d.pop("sourceAddress", UNSET) + + submit_ts = d.pop("submitTs", UNSET) + + tag = d.pop("tag", UNSET) + + text = d.pop("text", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + user_id = d.pop("userId", UNSET) + + trader_id = d.pop("traderId", UNSET) + + claimed_by = d.pop("claimedBy", UNSET) + + _ord_status = d.pop("ordStatus", UNSET) + ord_status: Unset | OrdStatus + if isinstance(_ord_status, Unset): + ord_status = UNSET + else: + ord_status = OrdStatus(_ord_status) + + transact_ts = d.pop("transactTs", UNSET) + + has_busts = d.pop("hasBusts", UNSET) + + has_corrects = d.pop("hasCorrects", UNSET) + + has_notes = d.pop("hasNotes", UNSET) + + multi_leg_order_cross = cls( + account_id=account_id, + algo=algo, + allocations=allocations, + cross_type=cross_type, + cur_ord_id=cur_ord_id, + header=header, + id=id, + incoming_cl_ord_id=incoming_cl_ord_id, + incoming_ord_id=incoming_ord_id, + instructions=instructions, + market_condition=market_condition, + optional_data=optional_data, + order_flags=order_flags, + order_updates=order_updates, + ord_type=ord_type, + origination_type=origination_type, + parent_ord_id=parent_ord_id, + price=price, + price_type=price_type, + qty=qty, + route=route, + source=source, + source_address=source_address, + submit_ts=submit_ts, + tag=tag, + text=text, + tif=tif, + user_id=user_id, + trader_id=trader_id, + claimed_by=claimed_by, + ord_status=ord_status, + transact_ts=transact_ts, + has_busts=has_busts, + has_corrects=has_corrects, + has_notes=has_notes, + ) + + return multi_leg_order_cross diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py b/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py new file mode 100644 index 000000000..64c1511ad --- /dev/null +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="MultiLegOrderCrossAlgo") + + + +@_attrs_define +class MultiLegOrderCrossAlgo: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + multi_leg_order_cross_algo = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + multi_leg_order_cross_algo.additional_properties = additional_properties + return multi_leg_order_cross_algo + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py new file mode 100644 index 000000000..9b25d73dd --- /dev/null +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py @@ -0,0 +1,258 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.cross_side_type import CrossSideType +from ..models.ord_status import OrdStatus +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.clearing_info import ClearingInfo + from ..models.order_instruction import OrderInstruction + from ..models.multi_leg_order_leg import MultiLegOrderLeg + from ..models.multi_leg_order_cross_allocation_optional_data import ( + MultiLegOrderCrossAllocationOptionalData, + ) + + +T = TypeVar("T", bound="MultiLegOrderCrossAllocation") + + +@_attrs_define +class MultiLegOrderCrossAllocation: + """ + Attributes: + account_id (Unset | int): + clearing_info (Unset | ClearingInfo): + id (Unset | str): + instructions (Unset | list['OrderInstruction']): + legs (Unset | list['MultiLegOrderLeg']): + optional_data (Unset | MultiLegOrderCrossAllocationOptionalData): + qty (Unset | float): + side_type (Unset | CrossSideType): + avg_price (Unset | float): + last_price (Unset | float): + last_qty (Unset | float): + last_market (Unset | str): + leaves_qty (Unset | float): + cum_qty (Unset | float): + transact_ts (Unset | str): + ord_status (Unset | OrdStatus): + incoming_cl_ord_id (Unset | str): + incoming_ord_id (Unset | str): + """ + + account_id: Unset | int = UNSET + clearing_info: Unset | "ClearingInfo" = UNSET + id: Unset | str = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + legs: Unset | list["MultiLegOrderLeg"] = UNSET + optional_data: Unset | "MultiLegOrderCrossAllocationOptionalData" = UNSET + qty: Unset | float = UNSET + side_type: Unset | CrossSideType = UNSET + avg_price: Unset | float = UNSET + last_price: Unset | float = UNSET + last_qty: Unset | float = UNSET + last_market: Unset | str = UNSET + leaves_qty: Unset | float = UNSET + cum_qty: Unset | float = UNSET + transact_ts: Unset | str = UNSET + ord_status: Unset | OrdStatus = UNSET + incoming_cl_ord_id: Unset | str = UNSET + incoming_ord_id: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + clearing_info: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_info, Unset): + clearing_info = self.clearing_info.to_dict() + + id = self.id + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + legs: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.legs, Unset): + legs = [] + for legs_item_data in self.legs: + legs_item = legs_item_data.to_dict() + legs.append(legs_item) + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + qty = self.qty + + side_type: Unset | str = UNSET + if not isinstance(self.side_type, Unset): + side_type = self.side_type.value + + avg_price = self.avg_price + + last_price = self.last_price + + last_qty = self.last_qty + + last_market = self.last_market + + leaves_qty = self.leaves_qty + + cum_qty = self.cum_qty + + transact_ts = self.transact_ts + + ord_status: Unset | str = UNSET + if not isinstance(self.ord_status, Unset): + ord_status = self.ord_status.value + + incoming_cl_ord_id = self.incoming_cl_ord_id + + incoming_ord_id = self.incoming_ord_id + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if clearing_info is not UNSET: + field_dict["clearingInfo"] = clearing_info + if id is not UNSET: + field_dict["id"] = id + if instructions is not UNSET: + field_dict["instructions"] = instructions + if legs is not UNSET: + field_dict["legs"] = legs + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if qty is not UNSET: + field_dict["qty"] = qty + if side_type is not UNSET: + field_dict["sideType"] = side_type + if avg_price is not UNSET: + field_dict["avgPrice"] = avg_price + if last_price is not UNSET: + field_dict["lastPrice"] = last_price + if last_qty is not UNSET: + field_dict["lastQty"] = last_qty + if last_market is not UNSET: + field_dict["lastMarket"] = last_market + if leaves_qty is not UNSET: + field_dict["leavesQty"] = leaves_qty + if cum_qty is not UNSET: + field_dict["cumQty"] = cum_qty + if transact_ts is not UNSET: + field_dict["transactTs"] = transact_ts + if ord_status is not UNSET: + field_dict["ordStatus"] = ord_status + if incoming_cl_ord_id is not UNSET: + field_dict["incomingClOrdId"] = incoming_cl_ord_id + if incoming_ord_id is not UNSET: + field_dict["incomingOrdId"] = incoming_ord_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + _clearing_info = d.pop("clearingInfo", UNSET) + clearing_info: Unset | ClearingInfo + if isinstance(_clearing_info, Unset): + clearing_info = UNSET + else: + clearing_info = ClearingInfo.from_dict(_clearing_info) + + id = d.pop("id", UNSET) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + legs = [] + _legs = d.pop("legs", UNSET) + for legs_item_data in _legs or []: + legs_item = MultiLegOrderLeg.from_dict(legs_item_data) + + legs.append(legs_item) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | MultiLegOrderCrossAllocationOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = MultiLegOrderCrossAllocationOptionalData.from_dict( + _optional_data + ) + + qty = d.pop("qty", UNSET) + + _side_type = d.pop("sideType", UNSET) + side_type: Unset | CrossSideType + if isinstance(_side_type, Unset): + side_type = UNSET + else: + side_type = CrossSideType(_side_type) + + avg_price = d.pop("avgPrice", UNSET) + + last_price = d.pop("lastPrice", UNSET) + + last_qty = d.pop("lastQty", UNSET) + + last_market = d.pop("lastMarket", UNSET) + + leaves_qty = d.pop("leavesQty", UNSET) + + cum_qty = d.pop("cumQty", UNSET) + + transact_ts = d.pop("transactTs", UNSET) + + _ord_status = d.pop("ordStatus", UNSET) + ord_status: Unset | OrdStatus + if isinstance(_ord_status, Unset): + ord_status = UNSET + else: + ord_status = OrdStatus(_ord_status) + + incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) + + incoming_ord_id = d.pop("incomingOrdId", UNSET) + + multi_leg_order_cross_allocation = cls( + account_id=account_id, + clearing_info=clearing_info, + id=id, + instructions=instructions, + legs=legs, + optional_data=optional_data, + qty=qty, + side_type=side_type, + avg_price=avg_price, + last_price=last_price, + last_qty=last_qty, + last_market=last_market, + leaves_qty=leaves_qty, + cum_qty=cum_qty, + transact_ts=transact_ts, + ord_status=ord_status, + incoming_cl_ord_id=incoming_cl_ord_id, + incoming_ord_id=incoming_ord_id, + ) + + return multi_leg_order_cross_allocation diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py new file mode 100644 index 000000000..0bbc1c65d --- /dev/null +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="MultiLegOrderCrossAllocationOptionalData") + + + +@_attrs_define +class MultiLegOrderCrossAllocationOptionalData: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + multi_leg_order_cross_allocation_optional_data = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + multi_leg_order_cross_allocation_optional_data.additional_properties = additional_properties + return multi_leg_order_cross_allocation_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py b/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py new file mode 100644 index 000000000..d981f3e27 --- /dev/null +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="MultiLegOrderCrossMarketCondition") + + + +@_attrs_define +class MultiLegOrderCrossMarketCondition: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + multi_leg_order_cross_market_condition = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + multi_leg_order_cross_market_condition.additional_properties = additional_properties + return multi_leg_order_cross_market_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py new file mode 100644 index 000000000..8cfddc219 --- /dev/null +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="MultiLegOrderCrossOptionalData") + + + +@_attrs_define +class MultiLegOrderCrossOptionalData: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + multi_leg_order_cross_optional_data = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + multi_leg_order_cross_optional_data.additional_properties = additional_properties + return multi_leg_order_cross_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/multi_leg_order_leg.py b/openapi_project/openapi_package/models/multi_leg_order_leg.py new file mode 100644 index 000000000..483ecb7a6 --- /dev/null +++ b/openapi_project/openapi_package/models/multi_leg_order_leg.py @@ -0,0 +1,255 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.position_effect import PositionEffect +from ..models.side import Side +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.multi_leg_order_leg_market_condition import ( + MultiLegOrderLegMarketCondition, + ) + from ..models.security import Security + from ..models.order_update_event import OrderUpdateEvent + from ..models.multi_leg_order_leg_optional_data import MultiLegOrderLegOptionalData + + +T = TypeVar("T", bound="MultiLegOrderLeg") + + +@_attrs_define +class MultiLegOrderLeg: + """ + Attributes: + id (Unset | str): + market_condition (Unset | MultiLegOrderLegMarketCondition): + optional_data (Unset | MultiLegOrderLegOptionalData): + order_updates (Unset | list['OrderUpdateEvent']): + position_effect (Unset | PositionEffect): + price (Unset | float): + qty (Unset | float): + ratio (Unset | int): + security (Unset | Security): + side (Unset | Side): + symbol (Unset | str): + avg_price (Unset | float): + last_price (Unset | float): + last_qty (Unset | float): + last_market (Unset | str): + leaves_qty (Unset | float): + cum_qty (Unset | float): + transact_ts (Unset | str): + """ + + id: Unset | str = UNSET + market_condition: Unset | "MultiLegOrderLegMarketCondition" = UNSET + optional_data: Unset | "MultiLegOrderLegOptionalData" = UNSET + order_updates: Unset | list["OrderUpdateEvent"] = UNSET + position_effect: Unset | PositionEffect = UNSET + price: Unset | float = UNSET + qty: Unset | float = UNSET + ratio: Unset | int = UNSET + security: Unset | "Security" = UNSET + side: Unset | Side = UNSET + symbol: Unset | str = UNSET + avg_price: Unset | float = UNSET + last_price: Unset | float = UNSET + last_qty: Unset | float = UNSET + last_market: Unset | str = UNSET + leaves_qty: Unset | float = UNSET + cum_qty: Unset | float = UNSET + transact_ts: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + id = self.id + + market_condition: Unset | dict[str, Any] = UNSET + if not isinstance(self.market_condition, Unset): + market_condition = self.market_condition.to_dict() + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + order_updates: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.order_updates, Unset): + order_updates = [] + for order_updates_item_data in self.order_updates: + order_updates_item = order_updates_item_data.to_dict() + order_updates.append(order_updates_item) + + position_effect: Unset | str = UNSET + if not isinstance(self.position_effect, Unset): + position_effect = self.position_effect.value + + price = self.price + + qty = self.qty + + ratio = self.ratio + + security: Unset | dict[str, Any] = UNSET + if not isinstance(self.security, Unset): + security = self.security.to_dict() + + side: Unset | str = UNSET + if not isinstance(self.side, Unset): + side = self.side.value + + symbol = self.symbol + + avg_price = self.avg_price + + last_price = self.last_price + + last_qty = self.last_qty + + last_market = self.last_market + + leaves_qty = self.leaves_qty + + cum_qty = self.cum_qty + + transact_ts = self.transact_ts + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if market_condition is not UNSET: + field_dict["marketCondition"] = market_condition + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if order_updates is not UNSET: + field_dict["orderUpdates"] = order_updates + if position_effect is not UNSET: + field_dict["positionEffect"] = position_effect + if price is not UNSET: + field_dict["price"] = price + if qty is not UNSET: + field_dict["qty"] = qty + if ratio is not UNSET: + field_dict["ratio"] = ratio + if security is not UNSET: + field_dict["security"] = security + if side is not UNSET: + field_dict["side"] = side + if symbol is not UNSET: + field_dict["symbol"] = symbol + if avg_price is not UNSET: + field_dict["avgPrice"] = avg_price + if last_price is not UNSET: + field_dict["lastPrice"] = last_price + if last_qty is not UNSET: + field_dict["lastQty"] = last_qty + if last_market is not UNSET: + field_dict["lastMarket"] = last_market + if leaves_qty is not UNSET: + field_dict["leavesQty"] = leaves_qty + if cum_qty is not UNSET: + field_dict["cumQty"] = cum_qty + if transact_ts is not UNSET: + field_dict["transactTs"] = transact_ts + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + _market_condition = d.pop("marketCondition", UNSET) + market_condition: Unset | MultiLegOrderLegMarketCondition + if isinstance(_market_condition, Unset): + market_condition = UNSET + else: + market_condition = MultiLegOrderLegMarketCondition.from_dict( + _market_condition + ) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | MultiLegOrderLegOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = MultiLegOrderLegOptionalData.from_dict(_optional_data) + + order_updates = [] + _order_updates = d.pop("orderUpdates", UNSET) + for order_updates_item_data in _order_updates or []: + order_updates_item = OrderUpdateEvent.from_dict(order_updates_item_data) + + order_updates.append(order_updates_item) + + _position_effect = d.pop("positionEffect", UNSET) + position_effect: Unset | PositionEffect + if isinstance(_position_effect, Unset): + position_effect = UNSET + else: + position_effect = PositionEffect(_position_effect) + + price = d.pop("price", UNSET) + + qty = d.pop("qty", UNSET) + + ratio = d.pop("ratio", UNSET) + + _security = d.pop("security", UNSET) + security: Unset | Security + if isinstance(_security, Unset): + security = UNSET + else: + security = Security.from_dict(_security) + + _side = d.pop("side", UNSET) + side: Unset | Side + if isinstance(_side, Unset): + side = UNSET + else: + side = Side(_side) + + symbol = d.pop("symbol", UNSET) + + avg_price = d.pop("avgPrice", UNSET) + + last_price = d.pop("lastPrice", UNSET) + + last_qty = d.pop("lastQty", UNSET) + + last_market = d.pop("lastMarket", UNSET) + + leaves_qty = d.pop("leavesQty", UNSET) + + cum_qty = d.pop("cumQty", UNSET) + + transact_ts = d.pop("transactTs", UNSET) + + multi_leg_order_leg = cls( + id=id, + market_condition=market_condition, + optional_data=optional_data, + order_updates=order_updates, + position_effect=position_effect, + price=price, + qty=qty, + ratio=ratio, + security=security, + side=side, + symbol=symbol, + avg_price=avg_price, + last_price=last_price, + last_qty=last_qty, + last_market=last_market, + leaves_qty=leaves_qty, + cum_qty=cum_qty, + transact_ts=transact_ts, + ) + + return multi_leg_order_leg diff --git a/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py b/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py new file mode 100644 index 000000000..521d7b5be --- /dev/null +++ b/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="MultiLegOrderLegMarketCondition") + + + +@_attrs_define +class MultiLegOrderLegMarketCondition: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + multi_leg_order_leg_market_condition = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + multi_leg_order_leg_market_condition.additional_properties = additional_properties + return multi_leg_order_leg_market_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py new file mode 100644 index 000000000..b35659d55 --- /dev/null +++ b/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="MultiLegOrderLegOptionalData") + + + +@_attrs_define +class MultiLegOrderLegOptionalData: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + multi_leg_order_leg_optional_data = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + multi_leg_order_leg_optional_data.additional_properties = additional_properties + return multi_leg_order_leg_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/multi_leg_order_market_condition.py b/openapi_project/openapi_package/models/multi_leg_order_market_condition.py new file mode 100644 index 000000000..2772291ec --- /dev/null +++ b/openapi_project/openapi_package/models/multi_leg_order_market_condition.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="MultiLegOrderMarketCondition") + + + +@_attrs_define +class MultiLegOrderMarketCondition: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + multi_leg_order_market_condition = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + multi_leg_order_market_condition.additional_properties = additional_properties + return multi_leg_order_market_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/multi_leg_order_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_optional_data.py new file mode 100644 index 000000000..dc153acba --- /dev/null +++ b/openapi_project/openapi_package/models/multi_leg_order_optional_data.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="MultiLegOrderOptionalData") + + + +@_attrs_define +class MultiLegOrderOptionalData: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + multi_leg_order_optional_data = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + multi_leg_order_optional_data.additional_properties = additional_properties + return multi_leg_order_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/multi_leg_reporting_type.py b/openapi_project/openapi_package/models/multi_leg_reporting_type.py new file mode 100644 index 000000000..3bfe5e229 --- /dev/null +++ b/openapi_project/openapi_package/models/multi_leg_reporting_type.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class MultiLegReportingType(str, Enum): + MULTI_LEG_REPORTING_TYPE_LEG = "MULTI_LEG_REPORTING_TYPE_LEG" + MULTI_LEG_REPORTING_TYPE_PARENT = "MULTI_LEG_REPORTING_TYPE_PARENT" + MULTI_LEG_REPORTING_TYPE_SINGLE = "MULTI_LEG_REPORTING_TYPE_SINGLE" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/numeric_display_format.py b/openapi_project/openapi_package/models/numeric_display_format.py new file mode 100644 index 000000000..f28c58032 --- /dev/null +++ b/openapi_project/openapi_package/models/numeric_display_format.py @@ -0,0 +1,32 @@ +from enum import Enum + + +class NumericDisplayFormat(str, Enum): + NUMERIC_DISPLAY_FORMAT_AUTO = "NUMERIC_DISPLAY_FORMAT_AUTO" + NUMERIC_DISPLAY_FORMAT_DECIMAL_00 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_00" + NUMERIC_DISPLAY_FORMAT_DECIMAL_01 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_01" + NUMERIC_DISPLAY_FORMAT_DECIMAL_02 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_02" + NUMERIC_DISPLAY_FORMAT_DECIMAL_03 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_03" + NUMERIC_DISPLAY_FORMAT_DECIMAL_04 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_04" + NUMERIC_DISPLAY_FORMAT_DECIMAL_05 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_05" + NUMERIC_DISPLAY_FORMAT_DECIMAL_06 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_06" + NUMERIC_DISPLAY_FORMAT_DECIMAL_07 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_07" + NUMERIC_DISPLAY_FORMAT_DECIMAL_08 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_08" + NUMERIC_DISPLAY_FORMAT_DECIMAL_09 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_09" + NUMERIC_DISPLAY_FORMAT_DECIMAL_10 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_10" + NUMERIC_DISPLAY_FORMAT_DECIMAL_11 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_11" + NUMERIC_DISPLAY_FORMAT_FRACTIONAL_128TH = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_128TH" + NUMERIC_DISPLAY_FORMAT_FRACTIONAL_16TH = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_16TH" + NUMERIC_DISPLAY_FORMAT_FRACTIONAL_256TH = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_256TH" + NUMERIC_DISPLAY_FORMAT_FRACTIONAL_32ND = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_32ND" + NUMERIC_DISPLAY_FORMAT_FRACTIONAL_512ND = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_512ND" + NUMERIC_DISPLAY_FORMAT_FRACTIONAL_64TH = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_64TH" + NUMERIC_DISPLAY_FORMAT_FRACTIONAL_8TH = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_8TH" + NUMERIC_DISPLAY_FORMAT_FRACTIONAL_HALF = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_HALF" + NUMERIC_DISPLAY_FORMAT_FRACTIONAL_QUARTER = ( + "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_QUARTER" + ) + NUMERIC_DISPLAY_FORMAT_FRACTIONAL_WHOLE = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_WHOLE" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option.py b/openapi_project/openapi_package/models/option.py new file mode 100644 index 000000000..73fdc0ec6 --- /dev/null +++ b/openapi_project/openapi_package/models/option.py @@ -0,0 +1,391 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.currency import Currency +from ..models.exchange_code import ExchangeCode +from ..models.numeric_display_format import NumericDisplayFormat +from ..models.option_expiration_style import OptionExpirationStyle +from ..models.put_call import PutCall +from ..models.security_category import SecurityCategory +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.option_aliases import OptionAliases + from ..models.date import Date + from ..models.option_root import OptionRoot + + +T = TypeVar("T", bound="Option") + + +@_attrs_define +class Option: + """ + Attributes: + aliases (Unset | OptionAliases): + currency (Unset | Currency): + listed_dt (Unset | Date): + delisted_dt (Unset | Date): + description (Unset | str): + exchange_id (Unset | int): + id (Unset | int): + multiplier (Unset | float): + price_base_factor (Unset | float): + price_display_factor (Unset | float): + price_display_format (Unset | NumericDisplayFormat): + qty_display_factor (Unset | float): + qty_display_format (Unset | NumericDisplayFormat): + security_category (Unset | SecurityCategory): + symbol (Unset | str): + tick_rule (Unset | str): + tick_size (Unset | float): + tick_value (Unset | float): + traded_exchanges (Unset | list[ExchangeCode]): + expiration_dt (Unset | Date): + expiration_style (Unset | OptionExpirationStyle): + first_trade_dt (Unset | Date): + last_trade_dt (Unset | Date): + put_call (Unset | PutCall): + root (Unset | OptionRoot): + strike (Unset | float): + underlying (Unset | str): + """ + + aliases: Unset | "OptionAliases" = UNSET + currency: Unset | Currency = UNSET + listed_dt: Unset | "Date" = UNSET + delisted_dt: Unset | "Date" = UNSET + description: Unset | str = UNSET + exchange_id: Unset | int = UNSET + id: Unset | int = UNSET + multiplier: Unset | float = UNSET + price_base_factor: Unset | float = UNSET + price_display_factor: Unset | float = UNSET + price_display_format: Unset | NumericDisplayFormat = UNSET + qty_display_factor: Unset | float = UNSET + qty_display_format: Unset | NumericDisplayFormat = UNSET + security_category: Unset | SecurityCategory = UNSET + symbol: Unset | str = UNSET + tick_rule: Unset | str = UNSET + tick_size: Unset | float = UNSET + tick_value: Unset | float = UNSET + traded_exchanges: Unset | list[ExchangeCode] = UNSET + expiration_dt: Unset | "Date" = UNSET + expiration_style: Unset | OptionExpirationStyle = UNSET + first_trade_dt: Unset | "Date" = UNSET + last_trade_dt: Unset | "Date" = UNSET + put_call: Unset | PutCall = UNSET + root: Unset | "OptionRoot" = UNSET + strike: Unset | float = UNSET + underlying: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + aliases: Unset | dict[str, Any] = UNSET + if not isinstance(self.aliases, Unset): + aliases = self.aliases.to_dict() + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + listed_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.listed_dt, Unset): + listed_dt = self.listed_dt.to_dict() + + delisted_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.delisted_dt, Unset): + delisted_dt = self.delisted_dt.to_dict() + + description = self.description + + exchange_id = self.exchange_id + + id = self.id + + multiplier = self.multiplier + + price_base_factor = self.price_base_factor + + price_display_factor = self.price_display_factor + + price_display_format: Unset | str = UNSET + if not isinstance(self.price_display_format, Unset): + price_display_format = self.price_display_format.value + + qty_display_factor = self.qty_display_factor + + qty_display_format: Unset | str = UNSET + if not isinstance(self.qty_display_format, Unset): + qty_display_format = self.qty_display_format.value + + security_category: Unset | str = UNSET + if not isinstance(self.security_category, Unset): + security_category = self.security_category.value + + symbol = self.symbol + + tick_rule = self.tick_rule + + tick_size = self.tick_size + + tick_value = self.tick_value + + traded_exchanges: Unset | list[str] = UNSET + if not isinstance(self.traded_exchanges, Unset): + traded_exchanges = [] + for traded_exchanges_item_data in self.traded_exchanges: + traded_exchanges_item = traded_exchanges_item_data.value + traded_exchanges.append(traded_exchanges_item) + + expiration_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.expiration_dt, Unset): + expiration_dt = self.expiration_dt.to_dict() + + expiration_style: Unset | str = UNSET + if not isinstance(self.expiration_style, Unset): + expiration_style = self.expiration_style.value + + first_trade_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.first_trade_dt, Unset): + first_trade_dt = self.first_trade_dt.to_dict() + + last_trade_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.last_trade_dt, Unset): + last_trade_dt = self.last_trade_dt.to_dict() + + put_call: Unset | str = UNSET + if not isinstance(self.put_call, Unset): + put_call = self.put_call.value + + root: Unset | dict[str, Any] = UNSET + if not isinstance(self.root, Unset): + root = self.root.to_dict() + + strike = self.strike + + underlying = self.underlying + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if aliases is not UNSET: + field_dict["aliases"] = aliases + if currency is not UNSET: + field_dict["currency"] = currency + if listed_dt is not UNSET: + field_dict["listedDt"] = listed_dt + if delisted_dt is not UNSET: + field_dict["delistedDt"] = delisted_dt + if description is not UNSET: + field_dict["description"] = description + if exchange_id is not UNSET: + field_dict["exchangeId"] = exchange_id + if id is not UNSET: + field_dict["id"] = id + if multiplier is not UNSET: + field_dict["multiplier"] = multiplier + if price_base_factor is not UNSET: + field_dict["priceBaseFactor"] = price_base_factor + if price_display_factor is not UNSET: + field_dict["priceDisplayFactor"] = price_display_factor + if price_display_format is not UNSET: + field_dict["priceDisplayFormat"] = price_display_format + if qty_display_factor is not UNSET: + field_dict["qtyDisplayFactor"] = qty_display_factor + if qty_display_format is not UNSET: + field_dict["qtyDisplayFormat"] = qty_display_format + if security_category is not UNSET: + field_dict["securityCategory"] = security_category + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tick_rule is not UNSET: + field_dict["tickRule"] = tick_rule + if tick_size is not UNSET: + field_dict["tickSize"] = tick_size + if tick_value is not UNSET: + field_dict["tickValue"] = tick_value + if traded_exchanges is not UNSET: + field_dict["tradedExchanges"] = traded_exchanges + if expiration_dt is not UNSET: + field_dict["expirationDt"] = expiration_dt + if expiration_style is not UNSET: + field_dict["expirationStyle"] = expiration_style + if first_trade_dt is not UNSET: + field_dict["firstTradeDt"] = first_trade_dt + if last_trade_dt is not UNSET: + field_dict["lastTradeDt"] = last_trade_dt + if put_call is not UNSET: + field_dict["putCall"] = put_call + if root is not UNSET: + field_dict["root"] = root + if strike is not UNSET: + field_dict["strike"] = strike + if underlying is not UNSET: + field_dict["underlying"] = underlying + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _aliases = d.pop("aliases", UNSET) + aliases: Unset | OptionAliases + if isinstance(_aliases, Unset): + aliases = UNSET + else: + aliases = OptionAliases.from_dict(_aliases) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + _listed_dt = d.pop("listedDt", UNSET) + listed_dt: Unset | Date + if isinstance(_listed_dt, Unset): + listed_dt = UNSET + else: + listed_dt = Date.from_dict(_listed_dt) + + _delisted_dt = d.pop("delistedDt", UNSET) + delisted_dt: Unset | Date + if isinstance(_delisted_dt, Unset): + delisted_dt = UNSET + else: + delisted_dt = Date.from_dict(_delisted_dt) + + description = d.pop("description", UNSET) + + exchange_id = d.pop("exchangeId", UNSET) + + id = d.pop("id", UNSET) + + multiplier = d.pop("multiplier", UNSET) + + price_base_factor = d.pop("priceBaseFactor", UNSET) + + price_display_factor = d.pop("priceDisplayFactor", UNSET) + + _price_display_format = d.pop("priceDisplayFormat", UNSET) + price_display_format: Unset | NumericDisplayFormat + if isinstance(_price_display_format, Unset): + price_display_format = UNSET + else: + price_display_format = NumericDisplayFormat(_price_display_format) + + qty_display_factor = d.pop("qtyDisplayFactor", UNSET) + + _qty_display_format = d.pop("qtyDisplayFormat", UNSET) + qty_display_format: Unset | NumericDisplayFormat + if isinstance(_qty_display_format, Unset): + qty_display_format = UNSET + else: + qty_display_format = NumericDisplayFormat(_qty_display_format) + + _security_category = d.pop("securityCategory", UNSET) + security_category: Unset | SecurityCategory + if isinstance(_security_category, Unset): + security_category = UNSET + else: + security_category = SecurityCategory(_security_category) + + symbol = d.pop("symbol", UNSET) + + tick_rule = d.pop("tickRule", UNSET) + + tick_size = d.pop("tickSize", UNSET) + + tick_value = d.pop("tickValue", UNSET) + + traded_exchanges = [] + _traded_exchanges = d.pop("tradedExchanges", UNSET) + for traded_exchanges_item_data in _traded_exchanges or []: + traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) + + traded_exchanges.append(traded_exchanges_item) + + _expiration_dt = d.pop("expirationDt", UNSET) + expiration_dt: Unset | Date + if isinstance(_expiration_dt, Unset): + expiration_dt = UNSET + else: + expiration_dt = Date.from_dict(_expiration_dt) + + _expiration_style = d.pop("expirationStyle", UNSET) + expiration_style: Unset | OptionExpirationStyle + if isinstance(_expiration_style, Unset): + expiration_style = UNSET + else: + expiration_style = OptionExpirationStyle(_expiration_style) + + _first_trade_dt = d.pop("firstTradeDt", UNSET) + first_trade_dt: Unset | Date + if isinstance(_first_trade_dt, Unset): + first_trade_dt = UNSET + else: + first_trade_dt = Date.from_dict(_first_trade_dt) + + _last_trade_dt = d.pop("lastTradeDt", UNSET) + last_trade_dt: Unset | Date + if isinstance(_last_trade_dt, Unset): + last_trade_dt = UNSET + else: + last_trade_dt = Date.from_dict(_last_trade_dt) + + _put_call = d.pop("putCall", UNSET) + put_call: Unset | PutCall + if isinstance(_put_call, Unset): + put_call = UNSET + else: + put_call = PutCall(_put_call) + + _root = d.pop("root", UNSET) + root: Unset | OptionRoot + if isinstance(_root, Unset): + root = UNSET + else: + root = OptionRoot.from_dict(_root) + + strike = d.pop("strike", UNSET) + + underlying = d.pop("underlying", UNSET) + + option = cls( + aliases=aliases, + currency=currency, + listed_dt=listed_dt, + delisted_dt=delisted_dt, + description=description, + exchange_id=exchange_id, + id=id, + multiplier=multiplier, + price_base_factor=price_base_factor, + price_display_factor=price_display_factor, + price_display_format=price_display_format, + qty_display_factor=qty_display_factor, + qty_display_format=qty_display_format, + security_category=security_category, + symbol=symbol, + tick_rule=tick_rule, + tick_size=tick_size, + tick_value=tick_value, + traded_exchanges=traded_exchanges, + expiration_dt=expiration_dt, + expiration_style=expiration_style, + first_trade_dt=first_trade_dt, + last_trade_dt=last_trade_dt, + put_call=put_call, + root=root, + strike=strike, + underlying=underlying, + ) + + return option diff --git a/openapi_project/openapi_package/models/option_aliases.py b/openapi_project/openapi_package/models/option_aliases.py new file mode 100644 index 000000000..ac9bba3fe --- /dev/null +++ b/openapi_project/openapi_package/models/option_aliases.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="OptionAliases") + + + +@_attrs_define +class OptionAliases: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + option_aliases = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + option_aliases.additional_properties = additional_properties + return option_aliases + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_chain.py b/openapi_project/openapi_package/models/option_chain.py new file mode 100644 index 000000000..9dc12f061 --- /dev/null +++ b/openapi_project/openapi_package/models/option_chain.py @@ -0,0 +1,127 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.option_series import OptionSeries + from ..models.option_chain_roots import OptionChainRoots + from ..models.security import Security + from ..models.option_chain_options import OptionChainOptions + + +T = TypeVar("T", bound="OptionChain") + + +@_attrs_define +class OptionChain: + """ + Attributes: + underlying (Unset | Security): + roots (Unset | OptionChainRoots): + options (Unset | OptionChainOptions): + option_series (Unset | list['OptionSeries']): + post (Unset | str): + station (Unset | str): + """ + + underlying: Unset | "Security" = UNSET + roots: Unset | "OptionChainRoots" = UNSET + options: Unset | "OptionChainOptions" = UNSET + option_series: Unset | list["OptionSeries"] = UNSET + post: Unset | str = UNSET + station: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + underlying: Unset | dict[str, Any] = UNSET + if not isinstance(self.underlying, Unset): + underlying = self.underlying.to_dict() + + roots: Unset | dict[str, Any] = UNSET + if not isinstance(self.roots, Unset): + roots = self.roots.to_dict() + + options: Unset | dict[str, Any] = UNSET + if not isinstance(self.options, Unset): + options = self.options.to_dict() + + option_series: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.option_series, Unset): + option_series = [] + for option_series_item_data in self.option_series: + option_series_item = option_series_item_data.to_dict() + option_series.append(option_series_item) + + post = self.post + + station = self.station + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if underlying is not UNSET: + field_dict["underlying"] = underlying + if roots is not UNSET: + field_dict["roots"] = roots + if options is not UNSET: + field_dict["options"] = options + if option_series is not UNSET: + field_dict["optionSeries"] = option_series + if post is not UNSET: + field_dict["post"] = post + if station is not UNSET: + field_dict["station"] = station + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _underlying = d.pop("underlying", UNSET) + underlying: Unset | Security + if isinstance(_underlying, Unset): + underlying = UNSET + else: + underlying = Security.from_dict(_underlying) + + _roots = d.pop("roots", UNSET) + roots: Unset | OptionChainRoots + if isinstance(_roots, Unset): + roots = UNSET + else: + roots = OptionChainRoots.from_dict(_roots) + + _options = d.pop("options", UNSET) + options: Unset | OptionChainOptions + if isinstance(_options, Unset): + options = UNSET + else: + options = OptionChainOptions.from_dict(_options) + + option_series = [] + _option_series = d.pop("optionSeries", UNSET) + for option_series_item_data in _option_series or []: + option_series_item = OptionSeries.from_dict(option_series_item_data) + + option_series.append(option_series_item) + + post = d.pop("post", UNSET) + + station = d.pop("station", UNSET) + + option_chain = cls( + underlying=underlying, + roots=roots, + options=options, + option_series=option_series, + post=post, + station=station, + ) + + return option_chain diff --git a/openapi_project/openapi_package/models/option_chain_option.py b/openapi_project/openapi_package/models/option_chain_option.py new file mode 100644 index 000000000..0d2afca00 --- /dev/null +++ b/openapi_project/openapi_package/models/option_chain_option.py @@ -0,0 +1,220 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.exchange_code import ExchangeCode +from ..models.put_call import PutCall +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.option_chain_option_aliases import OptionChainOptionAliases + from ..models.date import Date + + +T = TypeVar("T", bound="OptionChainOption") + + +@_attrs_define +class OptionChainOption: + """ + Attributes: + aliases (Unset | OptionChainOptionAliases): + listed_dt (Unset | Date): + delisted_dt (Unset | Date): + description (Unset | str): + exchange_id (Unset | int): + id (Unset | int): + tick_rule (Unset | str): + tick_size (Unset | float): + tick_value (Unset | float): + traded_exchanges (Unset | list[ExchangeCode]): + first_trade_dt (Unset | Date): + last_trade_dt (Unset | Date): + put_call (Unset | PutCall): + strike (Unset | float): + """ + + aliases: Unset | "OptionChainOptionAliases" = UNSET + listed_dt: Unset | "Date" = UNSET + delisted_dt: Unset | "Date" = UNSET + description: Unset | str = UNSET + exchange_id: Unset | int = UNSET + id: Unset | int = UNSET + tick_rule: Unset | str = UNSET + tick_size: Unset | float = UNSET + tick_value: Unset | float = UNSET + traded_exchanges: Unset | list[ExchangeCode] = UNSET + first_trade_dt: Unset | "Date" = UNSET + last_trade_dt: Unset | "Date" = UNSET + put_call: Unset | PutCall = UNSET + strike: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + aliases: Unset | dict[str, Any] = UNSET + if not isinstance(self.aliases, Unset): + aliases = self.aliases.to_dict() + + listed_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.listed_dt, Unset): + listed_dt = self.listed_dt.to_dict() + + delisted_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.delisted_dt, Unset): + delisted_dt = self.delisted_dt.to_dict() + + description = self.description + + exchange_id = self.exchange_id + + id = self.id + + tick_rule = self.tick_rule + + tick_size = self.tick_size + + tick_value = self.tick_value + + traded_exchanges: Unset | list[str] = UNSET + if not isinstance(self.traded_exchanges, Unset): + traded_exchanges = [] + for traded_exchanges_item_data in self.traded_exchanges: + traded_exchanges_item = traded_exchanges_item_data.value + traded_exchanges.append(traded_exchanges_item) + + first_trade_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.first_trade_dt, Unset): + first_trade_dt = self.first_trade_dt.to_dict() + + last_trade_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.last_trade_dt, Unset): + last_trade_dt = self.last_trade_dt.to_dict() + + put_call: Unset | str = UNSET + if not isinstance(self.put_call, Unset): + put_call = self.put_call.value + + strike = self.strike + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if aliases is not UNSET: + field_dict["aliases"] = aliases + if listed_dt is not UNSET: + field_dict["listedDt"] = listed_dt + if delisted_dt is not UNSET: + field_dict["delistedDt"] = delisted_dt + if description is not UNSET: + field_dict["description"] = description + if exchange_id is not UNSET: + field_dict["exchangeId"] = exchange_id + if id is not UNSET: + field_dict["id"] = id + if tick_rule is not UNSET: + field_dict["tickRule"] = tick_rule + if tick_size is not UNSET: + field_dict["tickSize"] = tick_size + if tick_value is not UNSET: + field_dict["tickValue"] = tick_value + if traded_exchanges is not UNSET: + field_dict["tradedExchanges"] = traded_exchanges + if first_trade_dt is not UNSET: + field_dict["firstTradeDt"] = first_trade_dt + if last_trade_dt is not UNSET: + field_dict["lastTradeDt"] = last_trade_dt + if put_call is not UNSET: + field_dict["putCall"] = put_call + if strike is not UNSET: + field_dict["strike"] = strike + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _aliases = d.pop("aliases", UNSET) + aliases: Unset | OptionChainOptionAliases + if isinstance(_aliases, Unset): + aliases = UNSET + else: + aliases = OptionChainOptionAliases.from_dict(_aliases) + + _listed_dt = d.pop("listedDt", UNSET) + listed_dt: Unset | Date + if isinstance(_listed_dt, Unset): + listed_dt = UNSET + else: + listed_dt = Date.from_dict(_listed_dt) + + _delisted_dt = d.pop("delistedDt", UNSET) + delisted_dt: Unset | Date + if isinstance(_delisted_dt, Unset): + delisted_dt = UNSET + else: + delisted_dt = Date.from_dict(_delisted_dt) + + description = d.pop("description", UNSET) + + exchange_id = d.pop("exchangeId", UNSET) + + id = d.pop("id", UNSET) + + tick_rule = d.pop("tickRule", UNSET) + + tick_size = d.pop("tickSize", UNSET) + + tick_value = d.pop("tickValue", UNSET) + + traded_exchanges = [] + _traded_exchanges = d.pop("tradedExchanges", UNSET) + for traded_exchanges_item_data in _traded_exchanges or []: + traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) + + traded_exchanges.append(traded_exchanges_item) + + _first_trade_dt = d.pop("firstTradeDt", UNSET) + first_trade_dt: Unset | Date + if isinstance(_first_trade_dt, Unset): + first_trade_dt = UNSET + else: + first_trade_dt = Date.from_dict(_first_trade_dt) + + _last_trade_dt = d.pop("lastTradeDt", UNSET) + last_trade_dt: Unset | Date + if isinstance(_last_trade_dt, Unset): + last_trade_dt = UNSET + else: + last_trade_dt = Date.from_dict(_last_trade_dt) + + _put_call = d.pop("putCall", UNSET) + put_call: Unset | PutCall + if isinstance(_put_call, Unset): + put_call = UNSET + else: + put_call = PutCall(_put_call) + + strike = d.pop("strike", UNSET) + + option_chain_option = cls( + aliases=aliases, + listed_dt=listed_dt, + delisted_dt=delisted_dt, + description=description, + exchange_id=exchange_id, + id=id, + tick_rule=tick_rule, + tick_size=tick_size, + tick_value=tick_value, + traded_exchanges=traded_exchanges, + first_trade_dt=first_trade_dt, + last_trade_dt=last_trade_dt, + put_call=put_call, + strike=strike, + ) + + return option_chain_option diff --git a/openapi_project/openapi_package/models/option_chain_option_aliases.py b/openapi_project/openapi_package/models/option_chain_option_aliases.py new file mode 100644 index 000000000..5160afee2 --- /dev/null +++ b/openapi_project/openapi_package/models/option_chain_option_aliases.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="OptionChainOptionAliases") + + + +@_attrs_define +class OptionChainOptionAliases: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + option_chain_option_aliases = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + option_chain_option_aliases.additional_properties = additional_properties + return option_chain_option_aliases + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_chain_options.py b/openapi_project/openapi_package/models/option_chain_options.py new file mode 100644 index 000000000..ff87cf6e9 --- /dev/null +++ b/openapi_project/openapi_package/models/option_chain_options.py @@ -0,0 +1,79 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.option_chain_option import OptionChainOption + + + + + +T = TypeVar("T", bound="OptionChainOptions") + + + +@_attrs_define +class OptionChainOptions: + """ + """ + + additional_properties: dict[str, 'OptionChainOption'] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop = prop.to_dict() + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + option_chain_options = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = OptionChainOption.from_dict(prop_dict) + + + + additional_properties[prop_name] = additional_property + + option_chain_options.additional_properties = additional_properties + return option_chain_options + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> 'OptionChainOption': + return self.additional_properties[key] + + def __setitem__(self, key: str, value: 'OptionChainOption') -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_chain_roots.py b/openapi_project/openapi_package/models/option_chain_roots.py new file mode 100644 index 000000000..3bbb14f53 --- /dev/null +++ b/openapi_project/openapi_package/models/option_chain_roots.py @@ -0,0 +1,79 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.option_root import OptionRoot + + + + + +T = TypeVar("T", bound="OptionChainRoots") + + + +@_attrs_define +class OptionChainRoots: + """ + """ + + additional_properties: dict[str, 'OptionRoot'] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop = prop.to_dict() + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + option_chain_roots = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = OptionRoot.from_dict(prop_dict) + + + + additional_properties[prop_name] = additional_property + + option_chain_roots.additional_properties = additional_properties + return option_chain_roots + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> 'OptionRoot': + return self.additional_properties[key] + + def __setitem__(self, key: str, value: 'OptionRoot') -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_exercise_style.py b/openapi_project/openapi_package/models/option_exercise_style.py new file mode 100644 index 000000000..147be4d65 --- /dev/null +++ b/openapi_project/openapi_package/models/option_exercise_style.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class OptionExerciseStyle(str, Enum): + OPTION_EXERCISE_STYLE_AMERICAN = "OPTION_EXERCISE_STYLE_AMERICAN" + OPTION_EXERCISE_STYLE_BERMUDAN = "OPTION_EXERCISE_STYLE_BERMUDAN" + OPTION_EXERCISE_STYLE_EUROPEAN = "OPTION_EXERCISE_STYLE_EUROPEAN" + OPTION_EXERCISE_STYLE_UNDEFINED = "OPTION_EXERCISE_STYLE_UNDEFINED" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_expiration_style.py b/openapi_project/openapi_package/models/option_expiration_style.py new file mode 100644 index 000000000..bf0ad8c56 --- /dev/null +++ b/openapi_project/openapi_package/models/option_expiration_style.py @@ -0,0 +1,19 @@ +from enum import Enum + + +class OptionExpirationStyle(str, Enum): + OPTION_EXPIRATION_STYLE_DAILY = "OPTION_EXPIRATION_STYLE_DAILY" + OPTION_EXPIRATION_STYLE_E_O_M = "OPTION_EXPIRATION_STYLE_E_O_M" + OPTION_EXPIRATION_STYLE_LEAP = "OPTION_EXPIRATION_STYLE_LEAP" + OPTION_EXPIRATION_STYLE_MONTHLY = "OPTION_EXPIRATION_STYLE_MONTHLY" + OPTION_EXPIRATION_STYLE_QUARTERLY = "OPTION_EXPIRATION_STYLE_QUARTERLY" + OPTION_EXPIRATION_STYLE_UNKNOWN = "OPTION_EXPIRATION_STYLE_UNKNOWN" + OPTION_EXPIRATION_STYLE_WEEKLY = "OPTION_EXPIRATION_STYLE_WEEKLY" + OPTION_EXPIRATION_STYLE_WK1 = "OPTION_EXPIRATION_STYLE_WK1" + OPTION_EXPIRATION_STYLE_WK2 = "OPTION_EXPIRATION_STYLE_WK2" + OPTION_EXPIRATION_STYLE_WK3 = "OPTION_EXPIRATION_STYLE_WK3" + OPTION_EXPIRATION_STYLE_WK4 = "OPTION_EXPIRATION_STYLE_WK4" + OPTION_EXPIRATION_STYLE_WK5 = "OPTION_EXPIRATION_STYLE_WK5" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_root.py b/openapi_project/openapi_package/models/option_root.py new file mode 100644 index 000000000..6b837fb8f --- /dev/null +++ b/openapi_project/openapi_package/models/option_root.py @@ -0,0 +1,417 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.currency import Currency +from ..models.exchange_code import ExchangeCode +from ..models.numeric_display_format import NumericDisplayFormat +from ..models.option_exercise_style import OptionExerciseStyle +from ..models.option_series_product_type import OptionSeriesProductType +from ..models.option_series_type import OptionSeriesType +from ..models.option_settlement_type import OptionSettlementType +from ..models.security_category import SecurityCategory +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.option_root_aliases import OptionRootAliases + from ..models.settlement_info import SettlementInfo + from ..models.date import Date + from ..models.trading_session_group import TradingSessionGroup + + +T = TypeVar("T", bound="OptionRoot") + + +@_attrs_define +class OptionRoot: + """ + Attributes: + aliases (Unset | OptionRootAliases): + currency (Unset | Currency): + listed_dt (Unset | Date): + delisted_dt (Unset | Date): + description (Unset | str): + exchange_id (Unset | int): + id (Unset | int): + multiplier (Unset | float): + price_base_factor (Unset | float): + price_display_factor (Unset | float): + price_display_format (Unset | NumericDisplayFormat): + qty_display_factor (Unset | float): + qty_display_format (Unset | NumericDisplayFormat): + security_category (Unset | SecurityCategory): + symbol (Unset | str): + tick_rule (Unset | str): + tick_size (Unset | float): + tick_value (Unset | float): + traded_exchanges (Unset | list[ExchangeCode]): + deliverable_per_contract (Unset | float): + exercise_style (Unset | OptionExerciseStyle): + product_type (Unset | OptionSeriesProductType): + series_type (Unset | OptionSeriesType): + settlement_infos (Unset | list['SettlementInfo']): + settlement_type (Unset | OptionSettlementType): + strike_multiplier (Unset | float): + strike_value (Unset | float): + trading_session_group (Unset | TradingSessionGroup): + underlying (Unset | str): + """ + + aliases: Unset | "OptionRootAliases" = UNSET + currency: Unset | Currency = UNSET + listed_dt: Unset | "Date" = UNSET + delisted_dt: Unset | "Date" = UNSET + description: Unset | str = UNSET + exchange_id: Unset | int = UNSET + id: Unset | int = UNSET + multiplier: Unset | float = UNSET + price_base_factor: Unset | float = UNSET + price_display_factor: Unset | float = UNSET + price_display_format: Unset | NumericDisplayFormat = UNSET + qty_display_factor: Unset | float = UNSET + qty_display_format: Unset | NumericDisplayFormat = UNSET + security_category: Unset | SecurityCategory = UNSET + symbol: Unset | str = UNSET + tick_rule: Unset | str = UNSET + tick_size: Unset | float = UNSET + tick_value: Unset | float = UNSET + traded_exchanges: Unset | list[ExchangeCode] = UNSET + deliverable_per_contract: Unset | float = UNSET + exercise_style: Unset | OptionExerciseStyle = UNSET + product_type: Unset | OptionSeriesProductType = UNSET + series_type: Unset | OptionSeriesType = UNSET + settlement_infos: Unset | list["SettlementInfo"] = UNSET + settlement_type: Unset | OptionSettlementType = UNSET + strike_multiplier: Unset | float = UNSET + strike_value: Unset | float = UNSET + trading_session_group: Unset | "TradingSessionGroup" = UNSET + underlying: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + aliases: Unset | dict[str, Any] = UNSET + if not isinstance(self.aliases, Unset): + aliases = self.aliases.to_dict() + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + listed_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.listed_dt, Unset): + listed_dt = self.listed_dt.to_dict() + + delisted_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.delisted_dt, Unset): + delisted_dt = self.delisted_dt.to_dict() + + description = self.description + + exchange_id = self.exchange_id + + id = self.id + + multiplier = self.multiplier + + price_base_factor = self.price_base_factor + + price_display_factor = self.price_display_factor + + price_display_format: Unset | str = UNSET + if not isinstance(self.price_display_format, Unset): + price_display_format = self.price_display_format.value + + qty_display_factor = self.qty_display_factor + + qty_display_format: Unset | str = UNSET + if not isinstance(self.qty_display_format, Unset): + qty_display_format = self.qty_display_format.value + + security_category: Unset | str = UNSET + if not isinstance(self.security_category, Unset): + security_category = self.security_category.value + + symbol = self.symbol + + tick_rule = self.tick_rule + + tick_size = self.tick_size + + tick_value = self.tick_value + + traded_exchanges: Unset | list[str] = UNSET + if not isinstance(self.traded_exchanges, Unset): + traded_exchanges = [] + for traded_exchanges_item_data in self.traded_exchanges: + traded_exchanges_item = traded_exchanges_item_data.value + traded_exchanges.append(traded_exchanges_item) + + deliverable_per_contract = self.deliverable_per_contract + + exercise_style: Unset | str = UNSET + if not isinstance(self.exercise_style, Unset): + exercise_style = self.exercise_style.value + + product_type: Unset | str = UNSET + if not isinstance(self.product_type, Unset): + product_type = self.product_type.value + + series_type: Unset | str = UNSET + if not isinstance(self.series_type, Unset): + series_type = self.series_type.value + + settlement_infos: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.settlement_infos, Unset): + settlement_infos = [] + for settlement_infos_item_data in self.settlement_infos: + settlement_infos_item = settlement_infos_item_data.to_dict() + settlement_infos.append(settlement_infos_item) + + settlement_type: Unset | str = UNSET + if not isinstance(self.settlement_type, Unset): + settlement_type = self.settlement_type.value + + strike_multiplier = self.strike_multiplier + + strike_value = self.strike_value + + trading_session_group: Unset | dict[str, Any] = UNSET + if not isinstance(self.trading_session_group, Unset): + trading_session_group = self.trading_session_group.to_dict() + + underlying = self.underlying + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if aliases is not UNSET: + field_dict["aliases"] = aliases + if currency is not UNSET: + field_dict["currency"] = currency + if listed_dt is not UNSET: + field_dict["listedDt"] = listed_dt + if delisted_dt is not UNSET: + field_dict["delistedDt"] = delisted_dt + if description is not UNSET: + field_dict["description"] = description + if exchange_id is not UNSET: + field_dict["exchangeId"] = exchange_id + if id is not UNSET: + field_dict["id"] = id + if multiplier is not UNSET: + field_dict["multiplier"] = multiplier + if price_base_factor is not UNSET: + field_dict["priceBaseFactor"] = price_base_factor + if price_display_factor is not UNSET: + field_dict["priceDisplayFactor"] = price_display_factor + if price_display_format is not UNSET: + field_dict["priceDisplayFormat"] = price_display_format + if qty_display_factor is not UNSET: + field_dict["qtyDisplayFactor"] = qty_display_factor + if qty_display_format is not UNSET: + field_dict["qtyDisplayFormat"] = qty_display_format + if security_category is not UNSET: + field_dict["securityCategory"] = security_category + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tick_rule is not UNSET: + field_dict["tickRule"] = tick_rule + if tick_size is not UNSET: + field_dict["tickSize"] = tick_size + if tick_value is not UNSET: + field_dict["tickValue"] = tick_value + if traded_exchanges is not UNSET: + field_dict["tradedExchanges"] = traded_exchanges + if deliverable_per_contract is not UNSET: + field_dict["deliverablePerContract"] = deliverable_per_contract + if exercise_style is not UNSET: + field_dict["exerciseStyle"] = exercise_style + if product_type is not UNSET: + field_dict["productType"] = product_type + if series_type is not UNSET: + field_dict["seriesType"] = series_type + if settlement_infos is not UNSET: + field_dict["settlementInfos"] = settlement_infos + if settlement_type is not UNSET: + field_dict["settlementType"] = settlement_type + if strike_multiplier is not UNSET: + field_dict["strikeMultiplier"] = strike_multiplier + if strike_value is not UNSET: + field_dict["strikeValue"] = strike_value + if trading_session_group is not UNSET: + field_dict["tradingSessionGroup"] = trading_session_group + if underlying is not UNSET: + field_dict["underlying"] = underlying + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _aliases = d.pop("aliases", UNSET) + aliases: Unset | OptionRootAliases + if isinstance(_aliases, Unset): + aliases = UNSET + else: + aliases = OptionRootAliases.from_dict(_aliases) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + _listed_dt = d.pop("listedDt", UNSET) + listed_dt: Unset | Date + if isinstance(_listed_dt, Unset): + listed_dt = UNSET + else: + listed_dt = Date.from_dict(_listed_dt) + + _delisted_dt = d.pop("delistedDt", UNSET) + delisted_dt: Unset | Date + if isinstance(_delisted_dt, Unset): + delisted_dt = UNSET + else: + delisted_dt = Date.from_dict(_delisted_dt) + + description = d.pop("description", UNSET) + + exchange_id = d.pop("exchangeId", UNSET) + + id = d.pop("id", UNSET) + + multiplier = d.pop("multiplier", UNSET) + + price_base_factor = d.pop("priceBaseFactor", UNSET) + + price_display_factor = d.pop("priceDisplayFactor", UNSET) + + _price_display_format = d.pop("priceDisplayFormat", UNSET) + price_display_format: Unset | NumericDisplayFormat + if isinstance(_price_display_format, Unset): + price_display_format = UNSET + else: + price_display_format = NumericDisplayFormat(_price_display_format) + + qty_display_factor = d.pop("qtyDisplayFactor", UNSET) + + _qty_display_format = d.pop("qtyDisplayFormat", UNSET) + qty_display_format: Unset | NumericDisplayFormat + if isinstance(_qty_display_format, Unset): + qty_display_format = UNSET + else: + qty_display_format = NumericDisplayFormat(_qty_display_format) + + _security_category = d.pop("securityCategory", UNSET) + security_category: Unset | SecurityCategory + if isinstance(_security_category, Unset): + security_category = UNSET + else: + security_category = SecurityCategory(_security_category) + + symbol = d.pop("symbol", UNSET) + + tick_rule = d.pop("tickRule", UNSET) + + tick_size = d.pop("tickSize", UNSET) + + tick_value = d.pop("tickValue", UNSET) + + traded_exchanges = [] + _traded_exchanges = d.pop("tradedExchanges", UNSET) + for traded_exchanges_item_data in _traded_exchanges or []: + traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) + + traded_exchanges.append(traded_exchanges_item) + + deliverable_per_contract = d.pop("deliverablePerContract", UNSET) + + _exercise_style = d.pop("exerciseStyle", UNSET) + exercise_style: Unset | OptionExerciseStyle + if isinstance(_exercise_style, Unset): + exercise_style = UNSET + else: + exercise_style = OptionExerciseStyle(_exercise_style) + + _product_type = d.pop("productType", UNSET) + product_type: Unset | OptionSeriesProductType + if isinstance(_product_type, Unset): + product_type = UNSET + else: + product_type = OptionSeriesProductType(_product_type) + + _series_type = d.pop("seriesType", UNSET) + series_type: Unset | OptionSeriesType + if isinstance(_series_type, Unset): + series_type = UNSET + else: + series_type = OptionSeriesType(_series_type) + + settlement_infos = [] + _settlement_infos = d.pop("settlementInfos", UNSET) + for settlement_infos_item_data in _settlement_infos or []: + settlement_infos_item = SettlementInfo.from_dict(settlement_infos_item_data) + + settlement_infos.append(settlement_infos_item) + + _settlement_type = d.pop("settlementType", UNSET) + settlement_type: Unset | OptionSettlementType + if isinstance(_settlement_type, Unset): + settlement_type = UNSET + else: + settlement_type = OptionSettlementType(_settlement_type) + + strike_multiplier = d.pop("strikeMultiplier", UNSET) + + strike_value = d.pop("strikeValue", UNSET) + + _trading_session_group = d.pop("tradingSessionGroup", UNSET) + trading_session_group: Unset | TradingSessionGroup + if isinstance(_trading_session_group, Unset): + trading_session_group = UNSET + else: + trading_session_group = TradingSessionGroup.from_dict( + _trading_session_group + ) + + underlying = d.pop("underlying", UNSET) + + option_root = cls( + aliases=aliases, + currency=currency, + listed_dt=listed_dt, + delisted_dt=delisted_dt, + description=description, + exchange_id=exchange_id, + id=id, + multiplier=multiplier, + price_base_factor=price_base_factor, + price_display_factor=price_display_factor, + price_display_format=price_display_format, + qty_display_factor=qty_display_factor, + qty_display_format=qty_display_format, + security_category=security_category, + symbol=symbol, + tick_rule=tick_rule, + tick_size=tick_size, + tick_value=tick_value, + traded_exchanges=traded_exchanges, + deliverable_per_contract=deliverable_per_contract, + exercise_style=exercise_style, + product_type=product_type, + series_type=series_type, + settlement_infos=settlement_infos, + settlement_type=settlement_type, + strike_multiplier=strike_multiplier, + strike_value=strike_value, + trading_session_group=trading_session_group, + underlying=underlying, + ) + + return option_root diff --git a/openapi_project/openapi_package/models/option_root_aliases.py b/openapi_project/openapi_package/models/option_root_aliases.py new file mode 100644 index 000000000..71b236120 --- /dev/null +++ b/openapi_project/openapi_package/models/option_root_aliases.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="OptionRootAliases") + + + +@_attrs_define +class OptionRootAliases: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + option_root_aliases = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + option_root_aliases.additional_properties = additional_properties + return option_root_aliases + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_series.py b/openapi_project/openapi_package/models/option_series.py new file mode 100644 index 000000000..702de8b65 --- /dev/null +++ b/openapi_project/openapi_package/models/option_series.py @@ -0,0 +1,229 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.currency import Currency +from ..models.numeric_display_format import NumericDisplayFormat +from ..models.option_expiration_style import OptionExpirationStyle +from ..models.option_series_type import OptionSeriesType +from ..models.option_settlement_type import OptionSettlementType +from ..models.security_category import SecurityCategory +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.date import Date + + +T = TypeVar("T", bound="OptionSeries") + + +@_attrs_define +class OptionSeries: + """ + Attributes: + expiration_dt (Unset | Date): + expiration_style (Unset | OptionExpirationStyle): + root_symbol (Unset | str): + series_type (Unset | OptionSeriesType): + settlement_type (Unset | OptionSettlementType): + option_symbols (Unset | list[str]): + currency (Unset | Currency): + multiplier (Unset | float): + price_base_factor (Unset | float): + price_display_factor (Unset | float): + price_display_format (Unset | NumericDisplayFormat): + qty_display_factor (Unset | float): + qty_display_format (Unset | NumericDisplayFormat): + security_category (Unset | SecurityCategory): + """ + + expiration_dt: Unset | "Date" = UNSET + expiration_style: Unset | OptionExpirationStyle = UNSET + root_symbol: Unset | str = UNSET + series_type: Unset | OptionSeriesType = UNSET + settlement_type: Unset | OptionSettlementType = UNSET + option_symbols: Unset | list[str] = UNSET + currency: Unset | Currency = UNSET + multiplier: Unset | float = UNSET + price_base_factor: Unset | float = UNSET + price_display_factor: Unset | float = UNSET + price_display_format: Unset | NumericDisplayFormat = UNSET + qty_display_factor: Unset | float = UNSET + qty_display_format: Unset | NumericDisplayFormat = UNSET + security_category: Unset | SecurityCategory = UNSET + + def to_dict(self) -> dict[str, Any]: + expiration_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.expiration_dt, Unset): + expiration_dt = self.expiration_dt.to_dict() + + expiration_style: Unset | str = UNSET + if not isinstance(self.expiration_style, Unset): + expiration_style = self.expiration_style.value + + root_symbol = self.root_symbol + + series_type: Unset | str = UNSET + if not isinstance(self.series_type, Unset): + series_type = self.series_type.value + + settlement_type: Unset | str = UNSET + if not isinstance(self.settlement_type, Unset): + settlement_type = self.settlement_type.value + + option_symbols: Unset | list[str] = UNSET + if not isinstance(self.option_symbols, Unset): + option_symbols = self.option_symbols + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + multiplier = self.multiplier + + price_base_factor = self.price_base_factor + + price_display_factor = self.price_display_factor + + price_display_format: Unset | str = UNSET + if not isinstance(self.price_display_format, Unset): + price_display_format = self.price_display_format.value + + qty_display_factor = self.qty_display_factor + + qty_display_format: Unset | str = UNSET + if not isinstance(self.qty_display_format, Unset): + qty_display_format = self.qty_display_format.value + + security_category: Unset | str = UNSET + if not isinstance(self.security_category, Unset): + security_category = self.security_category.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if expiration_dt is not UNSET: + field_dict["expirationDt"] = expiration_dt + if expiration_style is not UNSET: + field_dict["expirationStyle"] = expiration_style + if root_symbol is not UNSET: + field_dict["rootSymbol"] = root_symbol + if series_type is not UNSET: + field_dict["seriesType"] = series_type + if settlement_type is not UNSET: + field_dict["settlementType"] = settlement_type + if option_symbols is not UNSET: + field_dict["optionSymbols"] = option_symbols + if currency is not UNSET: + field_dict["currency"] = currency + if multiplier is not UNSET: + field_dict["multiplier"] = multiplier + if price_base_factor is not UNSET: + field_dict["priceBaseFactor"] = price_base_factor + if price_display_factor is not UNSET: + field_dict["priceDisplayFactor"] = price_display_factor + if price_display_format is not UNSET: + field_dict["priceDisplayFormat"] = price_display_format + if qty_display_factor is not UNSET: + field_dict["qtyDisplayFactor"] = qty_display_factor + if qty_display_format is not UNSET: + field_dict["qtyDisplayFormat"] = qty_display_format + if security_category is not UNSET: + field_dict["securityCategory"] = security_category + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _expiration_dt = d.pop("expirationDt", UNSET) + expiration_dt: Unset | Date + if isinstance(_expiration_dt, Unset): + expiration_dt = UNSET + else: + expiration_dt = Date.from_dict(_expiration_dt) + + _expiration_style = d.pop("expirationStyle", UNSET) + expiration_style: Unset | OptionExpirationStyle + if isinstance(_expiration_style, Unset): + expiration_style = UNSET + else: + expiration_style = OptionExpirationStyle(_expiration_style) + + root_symbol = d.pop("rootSymbol", UNSET) + + _series_type = d.pop("seriesType", UNSET) + series_type: Unset | OptionSeriesType + if isinstance(_series_type, Unset): + series_type = UNSET + else: + series_type = OptionSeriesType(_series_type) + + _settlement_type = d.pop("settlementType", UNSET) + settlement_type: Unset | OptionSettlementType + if isinstance(_settlement_type, Unset): + settlement_type = UNSET + else: + settlement_type = OptionSettlementType(_settlement_type) + + option_symbols = cast(list[str], d.pop("optionSymbols", UNSET)) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + multiplier = d.pop("multiplier", UNSET) + + price_base_factor = d.pop("priceBaseFactor", UNSET) + + price_display_factor = d.pop("priceDisplayFactor", UNSET) + + _price_display_format = d.pop("priceDisplayFormat", UNSET) + price_display_format: Unset | NumericDisplayFormat + if isinstance(_price_display_format, Unset): + price_display_format = UNSET + else: + price_display_format = NumericDisplayFormat(_price_display_format) + + qty_display_factor = d.pop("qtyDisplayFactor", UNSET) + + _qty_display_format = d.pop("qtyDisplayFormat", UNSET) + qty_display_format: Unset | NumericDisplayFormat + if isinstance(_qty_display_format, Unset): + qty_display_format = UNSET + else: + qty_display_format = NumericDisplayFormat(_qty_display_format) + + _security_category = d.pop("securityCategory", UNSET) + security_category: Unset | SecurityCategory + if isinstance(_security_category, Unset): + security_category = UNSET + else: + security_category = SecurityCategory(_security_category) + + option_series = cls( + expiration_dt=expiration_dt, + expiration_style=expiration_style, + root_symbol=root_symbol, + series_type=series_type, + settlement_type=settlement_type, + option_symbols=option_symbols, + currency=currency, + multiplier=multiplier, + price_base_factor=price_base_factor, + price_display_factor=price_display_factor, + price_display_format=price_display_format, + qty_display_factor=qty_display_factor, + qty_display_format=qty_display_format, + security_category=security_category, + ) + + return option_series diff --git a/openapi_project/openapi_package/models/option_series_product_type.py b/openapi_project/openapi_package/models/option_series_product_type.py new file mode 100644 index 000000000..5fed3ad30 --- /dev/null +++ b/openapi_project/openapi_package/models/option_series_product_type.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class OptionSeriesProductType(str, Enum): + OPTION_SERIES_PRODUCT_TYPE_MICRO = "OPTION_SERIES_PRODUCT_TYPE_MICRO" + OPTION_SERIES_PRODUCT_TYPE_STANDARD = "OPTION_SERIES_PRODUCT_TYPE_STANDARD" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_series_type.py b/openapi_project/openapi_package/models/option_series_type.py new file mode 100644 index 000000000..44b47e8ea --- /dev/null +++ b/openapi_project/openapi_package/models/option_series_type.py @@ -0,0 +1,13 @@ +from enum import Enum + + +class OptionSeriesType(str, Enum): + OPTION_SERIES_TYPE_BINARY = "OPTION_SERIES_TYPE_BINARY" + OPTION_SERIES_TYPE_FLEX = "OPTION_SERIES_TYPE_FLEX" + OPTION_SERIES_TYPE_LEAP = "OPTION_SERIES_TYPE_LEAP" + OPTION_SERIES_TYPE_RANGE = "OPTION_SERIES_TYPE_RANGE" + OPTION_SERIES_TYPE_STANDARD = "OPTION_SERIES_TYPE_STANDARD" + OPTION_SERIES_TYPE_UNKNOWN = "OPTION_SERIES_TYPE_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_settlement_type.py b/openapi_project/openapi_package/models/option_settlement_type.py new file mode 100644 index 000000000..8ff8df614 --- /dev/null +++ b/openapi_project/openapi_package/models/option_settlement_type.py @@ -0,0 +1,12 @@ +from enum import Enum + + +class OptionSettlementType(str, Enum): + OPTION_SETTLEMENT_TYPE_AM = "OPTION_SETTLEMENT_TYPE_AM" + OPTION_SETTLEMENT_TYPE_ASIAN = "OPTION_SETTLEMENT_TYPE_ASIAN" + OPTION_SETTLEMENT_TYPE_CLIQUET = "OPTION_SETTLEMENT_TYPE_CLIQUET" + OPTION_SETTLEMENT_TYPE_PM = "OPTION_SETTLEMENT_TYPE_PM" + OPTION_SETTLEMENT_TYPE_UNDEFINED = "OPTION_SETTLEMENT_TYPE_UNDEFINED" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/ord_status.py b/openapi_project/openapi_package/models/ord_status.py new file mode 100644 index 000000000..920d81f37 --- /dev/null +++ b/openapi_project/openapi_package/models/ord_status.py @@ -0,0 +1,30 @@ +from enum import Enum + + +class OrdStatus(str, Enum): + ORD_STATUS_ACCEPTED = "ORD_STATUS_ACCEPTED" + ORD_STATUS_ACCEPTED_FOR_BIDDING = "ORD_STATUS_ACCEPTED_FOR_BIDDING" + ORD_STATUS_CANCELED = "ORD_STATUS_CANCELED" + ORD_STATUS_DECLINED = "ORD_STATUS_DECLINED" + ORD_STATUS_DONE_FOR_DAY = "ORD_STATUS_DONE_FOR_DAY" + ORD_STATUS_EXPIRED = "ORD_STATUS_EXPIRED" + ORD_STATUS_FILLED = "ORD_STATUS_FILLED" + ORD_STATUS_NEW = "ORD_STATUS_NEW" + ORD_STATUS_PARTIALLY_FILLED = "ORD_STATUS_PARTIALLY_FILLED" + ORD_STATUS_PENDING_CANCEL = "ORD_STATUS_PENDING_CANCEL" + ORD_STATUS_PENDING_NEW = "ORD_STATUS_PENDING_NEW" + ORD_STATUS_PENDING_REPLACE = "ORD_STATUS_PENDING_REPLACE" + ORD_STATUS_PUSHED = "ORD_STATUS_PUSHED" + ORD_STATUS_QUEUED = "ORD_STATUS_QUEUED" + ORD_STATUS_REJECTED = "ORD_STATUS_REJECTED" + ORD_STATUS_REPLACED = "ORD_STATUS_REPLACED" + ORD_STATUS_REPRESENTED = "ORD_STATUS_REPRESENTED" + ORD_STATUS_STAGED = "ORD_STATUS_STAGED" + ORD_STATUS_STOPPED = "ORD_STATUS_STOPPED" + ORD_STATUS_SUSPENDED = "ORD_STATUS_SUSPENDED" + ORD_STATUS_TIMED_OUT = "ORD_STATUS_TIMED_OUT" + ORD_STATUS_UNKNOWN = "ORD_STATUS_UNKNOWN" + ORD_STATUS_WORKING = "ORD_STATUS_WORKING" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/ord_type.py b/openapi_project/openapi_package/models/ord_type.py new file mode 100644 index 000000000..4ef641095 --- /dev/null +++ b/openapi_project/openapi_package/models/ord_type.py @@ -0,0 +1,14 @@ +from enum import Enum + + +class OrdType(str, Enum): + ORD_TYPE_LIMIT = "ORD_TYPE_LIMIT" + ORD_TYPE_MARKET = "ORD_TYPE_MARKET" + ORD_TYPE_MARKET_IF_TOUCHED = "ORD_TYPE_MARKET_IF_TOUCHED" + ORD_TYPE_PEGGED = "ORD_TYPE_PEGGED" + ORD_TYPE_STOP = "ORD_TYPE_STOP" + ORD_TYPE_STOP_LIMIT = "ORD_TYPE_STOP_LIMIT" + ORD_TYPE_UNKNOWN = "ORD_TYPE_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/order.py b/openapi_project/openapi_package/models/order.py new file mode 100644 index 000000000..4945befa1 --- /dev/null +++ b/openapi_project/openapi_package/models/order.py @@ -0,0 +1,578 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.ord_status import OrdStatus +from ..models.ord_type import OrdType +from ..models.origination_type import OriginationType +from ..models.position_effect import PositionEffect +from ..models.price_type import PriceType +from ..models.side import Side +from ..models.tif import Tif +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.order_market_condition import OrderMarketCondition + from ..models.order_algo import OrderAlgo + from ..models.clearing_info import ClearingInfo + from ..models.order_update_event import OrderUpdateEvent + from ..models.order_optional_data import OrderOptionalData + from ..models.header import Header + from ..models.security import Security + from ..models.order_instruction import OrderInstruction + + +T = TypeVar("T", bound="Order") + + +@_attrs_define +class Order: + """ + Attributes: + account_id (Unset | int): + algo (Unset | OrderAlgo): + aux_price (Unset | float): + clearing_info (Unset | ClearingInfo): + cur_ord_id (Unset | str): + header (Unset | Header): + id (Unset | str): + incoming_cl_ord_id (Unset | str): + incoming_ord_id (Unset | str): + instructions (Unset | list['OrderInstruction']): + market_condition (Unset | OrderMarketCondition): + optional_data (Unset | OrderOptionalData): + order_flags (Unset | int): + order_updates (Unset | list['OrderUpdateEvent']): + ord_type (Unset | OrdType): + origination_type (Unset | OriginationType): + parent_ord_id (Unset | str): + position_effect (Unset | PositionEffect): + price (Unset | float): + price_type (Unset | PriceType): + qty (Unset | float): + route (Unset | str): + security (Unset | Security): + side (Unset | Side): + source (Unset | str): + source_address (Unset | str): + submit_ts (Unset | str): + symbol (Unset | str): + tag (Unset | str): + text (Unset | str): + tif (Unset | Tif): + trader_id (Unset | str): + user_id (Unset | int): + ord_status (Unset | OrdStatus): + avg_price (Unset | float): + claimed_by (Unset | str): + last_price (Unset | float): + last_qty (Unset | float): + last_market (Unset | str): + leaves_qty (Unset | float): + cum_qty (Unset | float): + transact_ts (Unset | str): + working_qty (Unset | float): + has_busts (Unset | bool): + has_corrects (Unset | bool): + has_notes (Unset | bool): + """ + + account_id: Unset | int = UNSET + algo: Unset | "OrderAlgo" = UNSET + aux_price: Unset | float = UNSET + clearing_info: Unset | "ClearingInfo" = UNSET + cur_ord_id: Unset | str = UNSET + header: Unset | "Header" = UNSET + id: Unset | str = UNSET + incoming_cl_ord_id: Unset | str = UNSET + incoming_ord_id: Unset | str = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + market_condition: Unset | "OrderMarketCondition" = UNSET + optional_data: Unset | "OrderOptionalData" = UNSET + order_flags: Unset | int = UNSET + order_updates: Unset | list["OrderUpdateEvent"] = UNSET + ord_type: Unset | OrdType = UNSET + origination_type: Unset | OriginationType = UNSET + parent_ord_id: Unset | str = UNSET + position_effect: Unset | PositionEffect = UNSET + price: Unset | float = UNSET + price_type: Unset | PriceType = UNSET + qty: Unset | float = UNSET + route: Unset | str = UNSET + security: Unset | "Security" = UNSET + side: Unset | Side = UNSET + source: Unset | str = UNSET + source_address: Unset | str = UNSET + submit_ts: Unset | str = UNSET + symbol: Unset | str = UNSET + tag: Unset | str = UNSET + text: Unset | str = UNSET + tif: Unset | Tif = UNSET + trader_id: Unset | str = UNSET + user_id: Unset | int = UNSET + ord_status: Unset | OrdStatus = UNSET + avg_price: Unset | float = UNSET + claimed_by: Unset | str = UNSET + last_price: Unset | float = UNSET + last_qty: Unset | float = UNSET + last_market: Unset | str = UNSET + leaves_qty: Unset | float = UNSET + cum_qty: Unset | float = UNSET + transact_ts: Unset | str = UNSET + working_qty: Unset | float = UNSET + has_busts: Unset | bool = UNSET + has_corrects: Unset | bool = UNSET + has_notes: Unset | bool = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + algo: Unset | dict[str, Any] = UNSET + if not isinstance(self.algo, Unset): + algo = self.algo.to_dict() + + aux_price = self.aux_price + + clearing_info: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_info, Unset): + clearing_info = self.clearing_info.to_dict() + + cur_ord_id = self.cur_ord_id + + header: Unset | dict[str, Any] = UNSET + if not isinstance(self.header, Unset): + header = self.header.to_dict() + + id = self.id + + incoming_cl_ord_id = self.incoming_cl_ord_id + + incoming_ord_id = self.incoming_ord_id + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + market_condition: Unset | dict[str, Any] = UNSET + if not isinstance(self.market_condition, Unset): + market_condition = self.market_condition.to_dict() + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + order_flags = self.order_flags + + order_updates: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.order_updates, Unset): + order_updates = [] + for order_updates_item_data in self.order_updates: + order_updates_item = order_updates_item_data.to_dict() + order_updates.append(order_updates_item) + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + origination_type: Unset | str = UNSET + if not isinstance(self.origination_type, Unset): + origination_type = self.origination_type.value + + parent_ord_id = self.parent_ord_id + + position_effect: Unset | str = UNSET + if not isinstance(self.position_effect, Unset): + position_effect = self.position_effect.value + + price = self.price + + price_type: Unset | str = UNSET + if not isinstance(self.price_type, Unset): + price_type = self.price_type.value + + qty = self.qty + + route = self.route + + security: Unset | dict[str, Any] = UNSET + if not isinstance(self.security, Unset): + security = self.security.to_dict() + + side: Unset | str = UNSET + if not isinstance(self.side, Unset): + side = self.side.value + + source = self.source + + source_address = self.source_address + + submit_ts = self.submit_ts + + symbol = self.symbol + + tag = self.tag + + text = self.text + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + trader_id = self.trader_id + + user_id = self.user_id + + ord_status: Unset | str = UNSET + if not isinstance(self.ord_status, Unset): + ord_status = self.ord_status.value + + avg_price = self.avg_price + + claimed_by = self.claimed_by + + last_price = self.last_price + + last_qty = self.last_qty + + last_market = self.last_market + + leaves_qty = self.leaves_qty + + cum_qty = self.cum_qty + + transact_ts = self.transact_ts + + working_qty = self.working_qty + + has_busts = self.has_busts + + has_corrects = self.has_corrects + + has_notes = self.has_notes + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if algo is not UNSET: + field_dict["algo"] = algo + if aux_price is not UNSET: + field_dict["auxPrice"] = aux_price + if clearing_info is not UNSET: + field_dict["clearingInfo"] = clearing_info + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if header is not UNSET: + field_dict["header"] = header + if id is not UNSET: + field_dict["id"] = id + if incoming_cl_ord_id is not UNSET: + field_dict["incomingClOrdId"] = incoming_cl_ord_id + if incoming_ord_id is not UNSET: + field_dict["incomingOrdId"] = incoming_ord_id + if instructions is not UNSET: + field_dict["instructions"] = instructions + if market_condition is not UNSET: + field_dict["marketCondition"] = market_condition + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if order_flags is not UNSET: + field_dict["orderFlags"] = order_flags + if order_updates is not UNSET: + field_dict["orderUpdates"] = order_updates + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if origination_type is not UNSET: + field_dict["originationType"] = origination_type + if parent_ord_id is not UNSET: + field_dict["parentOrdId"] = parent_ord_id + if position_effect is not UNSET: + field_dict["positionEffect"] = position_effect + if price is not UNSET: + field_dict["price"] = price + if price_type is not UNSET: + field_dict["priceType"] = price_type + if qty is not UNSET: + field_dict["qty"] = qty + if route is not UNSET: + field_dict["route"] = route + if security is not UNSET: + field_dict["security"] = security + if side is not UNSET: + field_dict["side"] = side + if source is not UNSET: + field_dict["source"] = source + if source_address is not UNSET: + field_dict["sourceAddress"] = source_address + if submit_ts is not UNSET: + field_dict["submitTs"] = submit_ts + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tag is not UNSET: + field_dict["tag"] = tag + if text is not UNSET: + field_dict["text"] = text + if tif is not UNSET: + field_dict["tif"] = tif + if trader_id is not UNSET: + field_dict["traderId"] = trader_id + if user_id is not UNSET: + field_dict["userId"] = user_id + if ord_status is not UNSET: + field_dict["ordStatus"] = ord_status + if avg_price is not UNSET: + field_dict["avgPrice"] = avg_price + if claimed_by is not UNSET: + field_dict["claimedBy"] = claimed_by + if last_price is not UNSET: + field_dict["lastPrice"] = last_price + if last_qty is not UNSET: + field_dict["lastQty"] = last_qty + if last_market is not UNSET: + field_dict["lastMarket"] = last_market + if leaves_qty is not UNSET: + field_dict["leavesQty"] = leaves_qty + if cum_qty is not UNSET: + field_dict["cumQty"] = cum_qty + if transact_ts is not UNSET: + field_dict["transactTs"] = transact_ts + if working_qty is not UNSET: + field_dict["workingQty"] = working_qty + if has_busts is not UNSET: + field_dict["hasBusts"] = has_busts + if has_corrects is not UNSET: + field_dict["hasCorrects"] = has_corrects + if has_notes is not UNSET: + field_dict["hasNotes"] = has_notes + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + _algo = d.pop("algo", UNSET) + algo: Unset | OrderAlgo + if isinstance(_algo, Unset): + algo = UNSET + else: + algo = OrderAlgo.from_dict(_algo) + + aux_price = d.pop("auxPrice", UNSET) + + _clearing_info = d.pop("clearingInfo", UNSET) + clearing_info: Unset | ClearingInfo + if isinstance(_clearing_info, Unset): + clearing_info = UNSET + else: + clearing_info = ClearingInfo.from_dict(_clearing_info) + + cur_ord_id = d.pop("curOrdId", UNSET) + + _header = d.pop("header", UNSET) + header: Unset | Header + if isinstance(_header, Unset): + header = UNSET + else: + header = Header.from_dict(_header) + + id = d.pop("id", UNSET) + + incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) + + incoming_ord_id = d.pop("incomingOrdId", UNSET) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + _market_condition = d.pop("marketCondition", UNSET) + market_condition: Unset | OrderMarketCondition + if isinstance(_market_condition, Unset): + market_condition = UNSET + else: + market_condition = OrderMarketCondition.from_dict(_market_condition) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | OrderOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = OrderOptionalData.from_dict(_optional_data) + + order_flags = d.pop("orderFlags", UNSET) + + order_updates = [] + _order_updates = d.pop("orderUpdates", UNSET) + for order_updates_item_data in _order_updates or []: + order_updates_item = OrderUpdateEvent.from_dict(order_updates_item_data) + + order_updates.append(order_updates_item) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + _origination_type = d.pop("originationType", UNSET) + origination_type: Unset | OriginationType + if isinstance(_origination_type, Unset): + origination_type = UNSET + else: + origination_type = OriginationType(_origination_type) + + parent_ord_id = d.pop("parentOrdId", UNSET) + + _position_effect = d.pop("positionEffect", UNSET) + position_effect: Unset | PositionEffect + if isinstance(_position_effect, Unset): + position_effect = UNSET + else: + position_effect = PositionEffect(_position_effect) + + price = d.pop("price", UNSET) + + _price_type = d.pop("priceType", UNSET) + price_type: Unset | PriceType + if isinstance(_price_type, Unset): + price_type = UNSET + else: + price_type = PriceType(_price_type) + + qty = d.pop("qty", UNSET) + + route = d.pop("route", UNSET) + + _security = d.pop("security", UNSET) + security: Unset | Security + if isinstance(_security, Unset): + security = UNSET + else: + security = Security.from_dict(_security) + + _side = d.pop("side", UNSET) + side: Unset | Side + if isinstance(_side, Unset): + side = UNSET + else: + side = Side(_side) + + source = d.pop("source", UNSET) + + source_address = d.pop("sourceAddress", UNSET) + + submit_ts = d.pop("submitTs", UNSET) + + symbol = d.pop("symbol", UNSET) + + tag = d.pop("tag", UNSET) + + text = d.pop("text", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + trader_id = d.pop("traderId", UNSET) + + user_id = d.pop("userId", UNSET) + + _ord_status = d.pop("ordStatus", UNSET) + ord_status: Unset | OrdStatus + if isinstance(_ord_status, Unset): + ord_status = UNSET + else: + ord_status = OrdStatus(_ord_status) + + avg_price = d.pop("avgPrice", UNSET) + + claimed_by = d.pop("claimedBy", UNSET) + + last_price = d.pop("lastPrice", UNSET) + + last_qty = d.pop("lastQty", UNSET) + + last_market = d.pop("lastMarket", UNSET) + + leaves_qty = d.pop("leavesQty", UNSET) + + cum_qty = d.pop("cumQty", UNSET) + + transact_ts = d.pop("transactTs", UNSET) + + working_qty = d.pop("workingQty", UNSET) + + has_busts = d.pop("hasBusts", UNSET) + + has_corrects = d.pop("hasCorrects", UNSET) + + has_notes = d.pop("hasNotes", UNSET) + + order = cls( + account_id=account_id, + algo=algo, + aux_price=aux_price, + clearing_info=clearing_info, + cur_ord_id=cur_ord_id, + header=header, + id=id, + incoming_cl_ord_id=incoming_cl_ord_id, + incoming_ord_id=incoming_ord_id, + instructions=instructions, + market_condition=market_condition, + optional_data=optional_data, + order_flags=order_flags, + order_updates=order_updates, + ord_type=ord_type, + origination_type=origination_type, + parent_ord_id=parent_ord_id, + position_effect=position_effect, + price=price, + price_type=price_type, + qty=qty, + route=route, + security=security, + side=side, + source=source, + source_address=source_address, + submit_ts=submit_ts, + symbol=symbol, + tag=tag, + text=text, + tif=tif, + trader_id=trader_id, + user_id=user_id, + ord_status=ord_status, + avg_price=avg_price, + claimed_by=claimed_by, + last_price=last_price, + last_qty=last_qty, + last_market=last_market, + leaves_qty=leaves_qty, + cum_qty=cum_qty, + transact_ts=transact_ts, + working_qty=working_qty, + has_busts=has_busts, + has_corrects=has_corrects, + has_notes=has_notes, + ) + + return order diff --git a/openapi_project/openapi_package/models/order_algo.py b/openapi_project/openapi_package/models/order_algo.py new file mode 100644 index 000000000..048c3434b --- /dev/null +++ b/openapi_project/openapi_package/models/order_algo.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="OrderAlgo") + + + +@_attrs_define +class OrderAlgo: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_algo = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_algo.additional_properties = additional_properties + return order_algo + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/order_cancel_reject.py b/openapi_project/openapi_package/models/order_cancel_reject.py new file mode 100644 index 000000000..c367d449b --- /dev/null +++ b/openapi_project/openapi_package/models/order_cancel_reject.py @@ -0,0 +1,187 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.cxl_rej_response_to import CxlRejResponseTo +from ..models.ord_status import OrdStatus +from ..models.origination_type import OriginationType +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.order_cancel_reject_optional_data import OrderCancelRejectOptionalData + + +T = TypeVar("T", bound="OrderCancelReject") + + +@_attrs_define +class OrderCancelReject: + """ + Attributes: + cur_ord_id (Unset | str): + incoming_cl_ord_id (Unset | str): + incoming_orig_cl_ord_id (Unset | str): + ord_status (Unset | OrdStatus): + optional_data (Unset | OrderCancelRejectOptionalData): + origination_type (Unset | OriginationType): + perm_ord_id (Unset | str): + req_ord_id (Unset | str): + source (Unset | str): + text (Unset | str): + trader_id (Unset | str): + transact_ts (Unset | str): + cxl_rej_response_to (Unset | CxlRejResponseTo): + """ + + cur_ord_id: Unset | str = UNSET + incoming_cl_ord_id: Unset | str = UNSET + incoming_orig_cl_ord_id: Unset | str = UNSET + ord_status: Unset | OrdStatus = UNSET + optional_data: Unset | "OrderCancelRejectOptionalData" = UNSET + origination_type: Unset | OriginationType = UNSET + perm_ord_id: Unset | str = UNSET + req_ord_id: Unset | str = UNSET + source: Unset | str = UNSET + text: Unset | str = UNSET + trader_id: Unset | str = UNSET + transact_ts: Unset | str = UNSET + cxl_rej_response_to: Unset | CxlRejResponseTo = UNSET + + def to_dict(self) -> dict[str, Any]: + cur_ord_id = self.cur_ord_id + + incoming_cl_ord_id = self.incoming_cl_ord_id + + incoming_orig_cl_ord_id = self.incoming_orig_cl_ord_id + + ord_status: Unset | str = UNSET + if not isinstance(self.ord_status, Unset): + ord_status = self.ord_status.value + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + origination_type: Unset | str = UNSET + if not isinstance(self.origination_type, Unset): + origination_type = self.origination_type.value + + perm_ord_id = self.perm_ord_id + + req_ord_id = self.req_ord_id + + source = self.source + + text = self.text + + trader_id = self.trader_id + + transact_ts = self.transact_ts + + cxl_rej_response_to: Unset | str = UNSET + if not isinstance(self.cxl_rej_response_to, Unset): + cxl_rej_response_to = self.cxl_rej_response_to.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if incoming_cl_ord_id is not UNSET: + field_dict["incomingClOrdId"] = incoming_cl_ord_id + if incoming_orig_cl_ord_id is not UNSET: + field_dict["incomingOrigClOrdId"] = incoming_orig_cl_ord_id + if ord_status is not UNSET: + field_dict["ordStatus"] = ord_status + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if origination_type is not UNSET: + field_dict["originationType"] = origination_type + if perm_ord_id is not UNSET: + field_dict["permOrdId"] = perm_ord_id + if req_ord_id is not UNSET: + field_dict["reqOrdId"] = req_ord_id + if source is not UNSET: + field_dict["source"] = source + if text is not UNSET: + field_dict["text"] = text + if trader_id is not UNSET: + field_dict["traderId"] = trader_id + if transact_ts is not UNSET: + field_dict["transactTs"] = transact_ts + if cxl_rej_response_to is not UNSET: + field_dict["cxlRejResponseTo"] = cxl_rej_response_to + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + cur_ord_id = d.pop("curOrdId", UNSET) + + incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) + + incoming_orig_cl_ord_id = d.pop("incomingOrigClOrdId", UNSET) + + _ord_status = d.pop("ordStatus", UNSET) + ord_status: Unset | OrdStatus + if isinstance(_ord_status, Unset): + ord_status = UNSET + else: + ord_status = OrdStatus(_ord_status) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | OrderCancelRejectOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = OrderCancelRejectOptionalData.from_dict(_optional_data) + + _origination_type = d.pop("originationType", UNSET) + origination_type: Unset | OriginationType + if isinstance(_origination_type, Unset): + origination_type = UNSET + else: + origination_type = OriginationType(_origination_type) + + perm_ord_id = d.pop("permOrdId", UNSET) + + req_ord_id = d.pop("reqOrdId", UNSET) + + source = d.pop("source", UNSET) + + text = d.pop("text", UNSET) + + trader_id = d.pop("traderId", UNSET) + + transact_ts = d.pop("transactTs", UNSET) + + _cxl_rej_response_to = d.pop("cxlRejResponseTo", UNSET) + cxl_rej_response_to: Unset | CxlRejResponseTo + if isinstance(_cxl_rej_response_to, Unset): + cxl_rej_response_to = UNSET + else: + cxl_rej_response_to = CxlRejResponseTo(_cxl_rej_response_to) + + order_cancel_reject = cls( + cur_ord_id=cur_ord_id, + incoming_cl_ord_id=incoming_cl_ord_id, + incoming_orig_cl_ord_id=incoming_orig_cl_ord_id, + ord_status=ord_status, + optional_data=optional_data, + origination_type=origination_type, + perm_ord_id=perm_ord_id, + req_ord_id=req_ord_id, + source=source, + text=text, + trader_id=trader_id, + transact_ts=transact_ts, + cxl_rej_response_to=cxl_rej_response_to, + ) + + return order_cancel_reject diff --git a/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py b/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py new file mode 100644 index 000000000..9e4b4615c --- /dev/null +++ b/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="OrderCancelRejectOptionalData") + + + +@_attrs_define +class OrderCancelRejectOptionalData: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_cancel_reject_optional_data = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_cancel_reject_optional_data.additional_properties = additional_properties + return order_cancel_reject_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/order_cancel_replace_request.py b/openapi_project/openapi_package/models/order_cancel_replace_request.py new file mode 100644 index 000000000..3d3956d10 --- /dev/null +++ b/openapi_project/openapi_package/models/order_cancel_replace_request.py @@ -0,0 +1,344 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.ord_type import OrdType +from ..models.origination_type import OriginationType +from ..models.price_type import PriceType +from ..models.side import Side +from ..models.tif import Tif +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo + from ..models.clearing_info import ClearingInfo + from ..models.order_cancel_replace_request_market_condition import ( + OrderCancelReplaceRequestMarketCondition, + ) + from ..models.header import Header + from ..models.order_cancel_replace_request_optional_data import ( + OrderCancelReplaceRequestOptionalData, + ) + from ..models.order_instruction import OrderInstruction + + +T = TypeVar("T", bound="OrderCancelReplaceRequest") + + +@_attrs_define +class OrderCancelReplaceRequest: + """ + Attributes: + algo (Unset | OrderCancelReplaceRequestAlgo): + aux_price (Unset | float): + clearing_info (Unset | ClearingInfo): + cur_ord_id (Unset | str): + header (Unset | Header): + incoming_cl_ord_id (Unset | str): + incoming_orig_cl_ord_id (Unset | str): + instructions (Unset | list['OrderInstruction']): + optional_data (Unset | OrderCancelReplaceRequestOptionalData): + market_condition (Unset | OrderCancelReplaceRequestMarketCondition): + ord_type (Unset | OrdType): + origination_type (Unset | OriginationType): + perm_ord_id (Unset | str): + price (Unset | float): + price_type (Unset | PriceType): + qty (Unset | float): + req_ord_id (Unset | str): + side (Unset | Side): + source (Unset | str): + submit_ts (Unset | str): + tif (Unset | Tif): + trader_id (Unset | str): + user_id (Unset | int): + """ + + algo: Unset | "OrderCancelReplaceRequestAlgo" = UNSET + aux_price: Unset | float = UNSET + clearing_info: Unset | "ClearingInfo" = UNSET + cur_ord_id: Unset | str = UNSET + header: Unset | "Header" = UNSET + incoming_cl_ord_id: Unset | str = UNSET + incoming_orig_cl_ord_id: Unset | str = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + optional_data: Unset | "OrderCancelReplaceRequestOptionalData" = UNSET + market_condition: Unset | "OrderCancelReplaceRequestMarketCondition" = UNSET + ord_type: Unset | OrdType = UNSET + origination_type: Unset | OriginationType = UNSET + perm_ord_id: Unset | str = UNSET + price: Unset | float = UNSET + price_type: Unset | PriceType = UNSET + qty: Unset | float = UNSET + req_ord_id: Unset | str = UNSET + side: Unset | Side = UNSET + source: Unset | str = UNSET + submit_ts: Unset | str = UNSET + tif: Unset | Tif = UNSET + trader_id: Unset | str = UNSET + user_id: Unset | int = UNSET + + def to_dict(self) -> dict[str, Any]: + algo: Unset | dict[str, Any] = UNSET + if not isinstance(self.algo, Unset): + algo = self.algo.to_dict() + + aux_price = self.aux_price + + clearing_info: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_info, Unset): + clearing_info = self.clearing_info.to_dict() + + cur_ord_id = self.cur_ord_id + + header: Unset | dict[str, Any] = UNSET + if not isinstance(self.header, Unset): + header = self.header.to_dict() + + incoming_cl_ord_id = self.incoming_cl_ord_id + + incoming_orig_cl_ord_id = self.incoming_orig_cl_ord_id + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + market_condition: Unset | dict[str, Any] = UNSET + if not isinstance(self.market_condition, Unset): + market_condition = self.market_condition.to_dict() + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + origination_type: Unset | str = UNSET + if not isinstance(self.origination_type, Unset): + origination_type = self.origination_type.value + + perm_ord_id = self.perm_ord_id + + price = self.price + + price_type: Unset | str = UNSET + if not isinstance(self.price_type, Unset): + price_type = self.price_type.value + + qty = self.qty + + req_ord_id = self.req_ord_id + + side: Unset | str = UNSET + if not isinstance(self.side, Unset): + side = self.side.value + + source = self.source + + submit_ts = self.submit_ts + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + trader_id = self.trader_id + + user_id = self.user_id + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if algo is not UNSET: + field_dict["algo"] = algo + if aux_price is not UNSET: + field_dict["auxPrice"] = aux_price + if clearing_info is not UNSET: + field_dict["clearingInfo"] = clearing_info + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if header is not UNSET: + field_dict["header"] = header + if incoming_cl_ord_id is not UNSET: + field_dict["incomingClOrdId"] = incoming_cl_ord_id + if incoming_orig_cl_ord_id is not UNSET: + field_dict["incomingOrigClOrdId"] = incoming_orig_cl_ord_id + if instructions is not UNSET: + field_dict["instructions"] = instructions + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if market_condition is not UNSET: + field_dict["marketCondition"] = market_condition + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if origination_type is not UNSET: + field_dict["originationType"] = origination_type + if perm_ord_id is not UNSET: + field_dict["permOrdId"] = perm_ord_id + if price is not UNSET: + field_dict["price"] = price + if price_type is not UNSET: + field_dict["priceType"] = price_type + if qty is not UNSET: + field_dict["qty"] = qty + if req_ord_id is not UNSET: + field_dict["reqOrdId"] = req_ord_id + if side is not UNSET: + field_dict["side"] = side + if source is not UNSET: + field_dict["source"] = source + if submit_ts is not UNSET: + field_dict["submitTs"] = submit_ts + if tif is not UNSET: + field_dict["tif"] = tif + if trader_id is not UNSET: + field_dict["traderId"] = trader_id + if user_id is not UNSET: + field_dict["userId"] = user_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _algo = d.pop("algo", UNSET) + algo: Unset | OrderCancelReplaceRequestAlgo + if isinstance(_algo, Unset): + algo = UNSET + else: + algo = OrderCancelReplaceRequestAlgo.from_dict(_algo) + + aux_price = d.pop("auxPrice", UNSET) + + _clearing_info = d.pop("clearingInfo", UNSET) + clearing_info: Unset | ClearingInfo + if isinstance(_clearing_info, Unset): + clearing_info = UNSET + else: + clearing_info = ClearingInfo.from_dict(_clearing_info) + + cur_ord_id = d.pop("curOrdId", UNSET) + + _header = d.pop("header", UNSET) + header: Unset | Header + if isinstance(_header, Unset): + header = UNSET + else: + header = Header.from_dict(_header) + + incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) + + incoming_orig_cl_ord_id = d.pop("incomingOrigClOrdId", UNSET) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | OrderCancelReplaceRequestOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = OrderCancelReplaceRequestOptionalData.from_dict( + _optional_data + ) + + _market_condition = d.pop("marketCondition", UNSET) + market_condition: Unset | OrderCancelReplaceRequestMarketCondition + if isinstance(_market_condition, Unset): + market_condition = UNSET + else: + market_condition = OrderCancelReplaceRequestMarketCondition.from_dict( + _market_condition + ) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + _origination_type = d.pop("originationType", UNSET) + origination_type: Unset | OriginationType + if isinstance(_origination_type, Unset): + origination_type = UNSET + else: + origination_type = OriginationType(_origination_type) + + perm_ord_id = d.pop("permOrdId", UNSET) + + price = d.pop("price", UNSET) + + _price_type = d.pop("priceType", UNSET) + price_type: Unset | PriceType + if isinstance(_price_type, Unset): + price_type = UNSET + else: + price_type = PriceType(_price_type) + + qty = d.pop("qty", UNSET) + + req_ord_id = d.pop("reqOrdId", UNSET) + + _side = d.pop("side", UNSET) + side: Unset | Side + if isinstance(_side, Unset): + side = UNSET + else: + side = Side(_side) + + source = d.pop("source", UNSET) + + submit_ts = d.pop("submitTs", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + trader_id = d.pop("traderId", UNSET) + + user_id = d.pop("userId", UNSET) + + order_cancel_replace_request = cls( + algo=algo, + aux_price=aux_price, + clearing_info=clearing_info, + cur_ord_id=cur_ord_id, + header=header, + incoming_cl_ord_id=incoming_cl_ord_id, + incoming_orig_cl_ord_id=incoming_orig_cl_ord_id, + instructions=instructions, + optional_data=optional_data, + market_condition=market_condition, + ord_type=ord_type, + origination_type=origination_type, + perm_ord_id=perm_ord_id, + price=price, + price_type=price_type, + qty=qty, + req_ord_id=req_ord_id, + side=side, + source=source, + submit_ts=submit_ts, + tif=tif, + trader_id=trader_id, + user_id=user_id, + ) + + return order_cancel_replace_request diff --git a/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py b/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py new file mode 100644 index 000000000..4b8859063 --- /dev/null +++ b/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="OrderCancelReplaceRequestAlgo") + + + +@_attrs_define +class OrderCancelReplaceRequestAlgo: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_cancel_replace_request_algo = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_cancel_replace_request_algo.additional_properties = additional_properties + return order_cancel_replace_request_algo + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py b/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py new file mode 100644 index 000000000..103028a69 --- /dev/null +++ b/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="OrderCancelReplaceRequestMarketCondition") + + + +@_attrs_define +class OrderCancelReplaceRequestMarketCondition: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_cancel_replace_request_market_condition = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_cancel_replace_request_market_condition.additional_properties = additional_properties + return order_cancel_replace_request_market_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py b/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py new file mode 100644 index 000000000..7e1a08d27 --- /dev/null +++ b/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="OrderCancelReplaceRequestOptionalData") + + + +@_attrs_define +class OrderCancelReplaceRequestOptionalData: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_cancel_replace_request_optional_data = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_cancel_replace_request_optional_data.additional_properties = additional_properties + return order_cancel_replace_request_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/order_cancel_request.py b/openapi_project/openapi_package/models/order_cancel_request.py new file mode 100644 index 000000000..312dd22d8 --- /dev/null +++ b/openapi_project/openapi_package/models/order_cancel_request.py @@ -0,0 +1,175 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.origination_type import OriginationType +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.order_cancel_request_optional_data import ( + OrderCancelRequestOptionalData, + ) + from ..models.order_instruction import OrderInstruction + + +T = TypeVar("T", bound="OrderCancelRequest") + + +@_attrs_define +class OrderCancelRequest: + """ + Attributes: + cur_ord_id (Unset | str): + incoming_cl_ord_id (Unset | str): + incoming_orig_cl_ord_id (Unset | str): + instructions (Unset | list['OrderInstruction']): + optional_data (Unset | OrderCancelRequestOptionalData): + origination_type (Unset | OriginationType): + perm_ord_id (Unset | str): + req_ord_id (Unset | str): + source (Unset | str): + submit_ts (Unset | str): + trader_id (Unset | str): + user_id (Unset | int): + """ + + cur_ord_id: Unset | str = UNSET + incoming_cl_ord_id: Unset | str = UNSET + incoming_orig_cl_ord_id: Unset | str = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + optional_data: Unset | "OrderCancelRequestOptionalData" = UNSET + origination_type: Unset | OriginationType = UNSET + perm_ord_id: Unset | str = UNSET + req_ord_id: Unset | str = UNSET + source: Unset | str = UNSET + submit_ts: Unset | str = UNSET + trader_id: Unset | str = UNSET + user_id: Unset | int = UNSET + + def to_dict(self) -> dict[str, Any]: + cur_ord_id = self.cur_ord_id + + incoming_cl_ord_id = self.incoming_cl_ord_id + + incoming_orig_cl_ord_id = self.incoming_orig_cl_ord_id + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + origination_type: Unset | str = UNSET + if not isinstance(self.origination_type, Unset): + origination_type = self.origination_type.value + + perm_ord_id = self.perm_ord_id + + req_ord_id = self.req_ord_id + + source = self.source + + submit_ts = self.submit_ts + + trader_id = self.trader_id + + user_id = self.user_id + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if incoming_cl_ord_id is not UNSET: + field_dict["incomingClOrdId"] = incoming_cl_ord_id + if incoming_orig_cl_ord_id is not UNSET: + field_dict["incomingOrigClOrdId"] = incoming_orig_cl_ord_id + if instructions is not UNSET: + field_dict["instructions"] = instructions + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if origination_type is not UNSET: + field_dict["originationType"] = origination_type + if perm_ord_id is not UNSET: + field_dict["permOrdId"] = perm_ord_id + if req_ord_id is not UNSET: + field_dict["reqOrdId"] = req_ord_id + if source is not UNSET: + field_dict["source"] = source + if submit_ts is not UNSET: + field_dict["submitTs"] = submit_ts + if trader_id is not UNSET: + field_dict["traderId"] = trader_id + if user_id is not UNSET: + field_dict["userId"] = user_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + cur_ord_id = d.pop("curOrdId", UNSET) + + incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) + + incoming_orig_cl_ord_id = d.pop("incomingOrigClOrdId", UNSET) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | OrderCancelRequestOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = OrderCancelRequestOptionalData.from_dict(_optional_data) + + _origination_type = d.pop("originationType", UNSET) + origination_type: Unset | OriginationType + if isinstance(_origination_type, Unset): + origination_type = UNSET + else: + origination_type = OriginationType(_origination_type) + + perm_ord_id = d.pop("permOrdId", UNSET) + + req_ord_id = d.pop("reqOrdId", UNSET) + + source = d.pop("source", UNSET) + + submit_ts = d.pop("submitTs", UNSET) + + trader_id = d.pop("traderId", UNSET) + + user_id = d.pop("userId", UNSET) + + order_cancel_request = cls( + cur_ord_id=cur_ord_id, + incoming_cl_ord_id=incoming_cl_ord_id, + incoming_orig_cl_ord_id=incoming_orig_cl_ord_id, + instructions=instructions, + optional_data=optional_data, + origination_type=origination_type, + perm_ord_id=perm_ord_id, + req_ord_id=req_ord_id, + source=source, + submit_ts=submit_ts, + trader_id=trader_id, + user_id=user_id, + ) + + return order_cancel_request diff --git a/openapi_project/openapi_package/models/order_cancel_request_optional_data.py b/openapi_project/openapi_package/models/order_cancel_request_optional_data.py new file mode 100644 index 000000000..ea1c809f3 --- /dev/null +++ b/openapi_project/openapi_package/models/order_cancel_request_optional_data.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="OrderCancelRequestOptionalData") + + + +@_attrs_define +class OrderCancelRequestOptionalData: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_cancel_request_optional_data = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_cancel_request_optional_data.additional_properties = additional_properties + return order_cancel_request_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/order_cross.py b/openapi_project/openapi_package/models/order_cross.py new file mode 100644 index 000000000..1e1688684 --- /dev/null +++ b/openapi_project/openapi_package/models/order_cross.py @@ -0,0 +1,492 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.cross_type import CrossType +from ..models.ord_status import OrdStatus +from ..models.ord_type import OrdType +from ..models.origination_type import OriginationType +from ..models.price_type import PriceType +from ..models.tif import Tif +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.order_cross_optional_data import OrderCrossOptionalData + from ..models.order_update_event import OrderUpdateEvent + from ..models.header import Header + from ..models.order_cross_allocation import OrderCrossAllocation + from ..models.order_cross_algo import OrderCrossAlgo + from ..models.security import Security + from ..models.order_instruction import OrderInstruction + from ..models.order_cross_market_condition import OrderCrossMarketCondition + + +T = TypeVar("T", bound="OrderCross") + + +@_attrs_define +class OrderCross: + """ + Attributes: + account_id (Unset | int): + algo (Unset | OrderCrossAlgo): + allocations (Unset | list['OrderCrossAllocation']): + cross_type (Unset | CrossType): + cur_ord_id (Unset | str): + header (Unset | Header): + id (Unset | str): + incoming_cl_ord_id (Unset | str): + incoming_ord_id (Unset | str): + instructions (Unset | list['OrderInstruction']): + market_condition (Unset | OrderCrossMarketCondition): + optional_data (Unset | OrderCrossOptionalData): + order_flags (Unset | int): + order_updates (Unset | list['OrderUpdateEvent']): + ord_type (Unset | OrdType): + origination_type (Unset | OriginationType): + parent_ord_id (Unset | str): + price (Unset | float): + price_type (Unset | PriceType): + qty (Unset | float): + route (Unset | str): + security (Unset | Security): + source (Unset | str): + source_address (Unset | str): + submit_ts (Unset | str): + symbol (Unset | str): + tag (Unset | str): + text (Unset | str): + tif (Unset | Tif): + user_id (Unset | int): + trader_id (Unset | str): + ord_status (Unset | OrdStatus): + claimed_by (Unset | str): + transact_ts (Unset | str): + has_busts (Unset | bool): + has_corrects (Unset | bool): + has_notes (Unset | bool): + """ + + account_id: Unset | int = UNSET + algo: Unset | "OrderCrossAlgo" = UNSET + allocations: Unset | list["OrderCrossAllocation"] = UNSET + cross_type: Unset | CrossType = UNSET + cur_ord_id: Unset | str = UNSET + header: Unset | "Header" = UNSET + id: Unset | str = UNSET + incoming_cl_ord_id: Unset | str = UNSET + incoming_ord_id: Unset | str = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + market_condition: Unset | "OrderCrossMarketCondition" = UNSET + optional_data: Unset | "OrderCrossOptionalData" = UNSET + order_flags: Unset | int = UNSET + order_updates: Unset | list["OrderUpdateEvent"] = UNSET + ord_type: Unset | OrdType = UNSET + origination_type: Unset | OriginationType = UNSET + parent_ord_id: Unset | str = UNSET + price: Unset | float = UNSET + price_type: Unset | PriceType = UNSET + qty: Unset | float = UNSET + route: Unset | str = UNSET + security: Unset | "Security" = UNSET + source: Unset | str = UNSET + source_address: Unset | str = UNSET + submit_ts: Unset | str = UNSET + symbol: Unset | str = UNSET + tag: Unset | str = UNSET + text: Unset | str = UNSET + tif: Unset | Tif = UNSET + user_id: Unset | int = UNSET + trader_id: Unset | str = UNSET + ord_status: Unset | OrdStatus = UNSET + claimed_by: Unset | str = UNSET + transact_ts: Unset | str = UNSET + has_busts: Unset | bool = UNSET + has_corrects: Unset | bool = UNSET + has_notes: Unset | bool = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + algo: Unset | dict[str, Any] = UNSET + if not isinstance(self.algo, Unset): + algo = self.algo.to_dict() + + allocations: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.allocations, Unset): + allocations = [] + for allocations_item_data in self.allocations: + allocations_item = allocations_item_data.to_dict() + allocations.append(allocations_item) + + cross_type: Unset | str = UNSET + if not isinstance(self.cross_type, Unset): + cross_type = self.cross_type.value + + cur_ord_id = self.cur_ord_id + + header: Unset | dict[str, Any] = UNSET + if not isinstance(self.header, Unset): + header = self.header.to_dict() + + id = self.id + + incoming_cl_ord_id = self.incoming_cl_ord_id + + incoming_ord_id = self.incoming_ord_id + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + market_condition: Unset | dict[str, Any] = UNSET + if not isinstance(self.market_condition, Unset): + market_condition = self.market_condition.to_dict() + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + order_flags = self.order_flags + + order_updates: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.order_updates, Unset): + order_updates = [] + for order_updates_item_data in self.order_updates: + order_updates_item = order_updates_item_data.to_dict() + order_updates.append(order_updates_item) + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + origination_type: Unset | str = UNSET + if not isinstance(self.origination_type, Unset): + origination_type = self.origination_type.value + + parent_ord_id = self.parent_ord_id + + price = self.price + + price_type: Unset | str = UNSET + if not isinstance(self.price_type, Unset): + price_type = self.price_type.value + + qty = self.qty + + route = self.route + + security: Unset | dict[str, Any] = UNSET + if not isinstance(self.security, Unset): + security = self.security.to_dict() + + source = self.source + + source_address = self.source_address + + submit_ts = self.submit_ts + + symbol = self.symbol + + tag = self.tag + + text = self.text + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + user_id = self.user_id + + trader_id = self.trader_id + + ord_status: Unset | str = UNSET + if not isinstance(self.ord_status, Unset): + ord_status = self.ord_status.value + + claimed_by = self.claimed_by + + transact_ts = self.transact_ts + + has_busts = self.has_busts + + has_corrects = self.has_corrects + + has_notes = self.has_notes + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if algo is not UNSET: + field_dict["algo"] = algo + if allocations is not UNSET: + field_dict["allocations"] = allocations + if cross_type is not UNSET: + field_dict["crossType"] = cross_type + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if header is not UNSET: + field_dict["header"] = header + if id is not UNSET: + field_dict["id"] = id + if incoming_cl_ord_id is not UNSET: + field_dict["incomingClOrdId"] = incoming_cl_ord_id + if incoming_ord_id is not UNSET: + field_dict["incomingOrdId"] = incoming_ord_id + if instructions is not UNSET: + field_dict["instructions"] = instructions + if market_condition is not UNSET: + field_dict["marketCondition"] = market_condition + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if order_flags is not UNSET: + field_dict["orderFlags"] = order_flags + if order_updates is not UNSET: + field_dict["orderUpdates"] = order_updates + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if origination_type is not UNSET: + field_dict["originationType"] = origination_type + if parent_ord_id is not UNSET: + field_dict["parentOrdId"] = parent_ord_id + if price is not UNSET: + field_dict["price"] = price + if price_type is not UNSET: + field_dict["priceType"] = price_type + if qty is not UNSET: + field_dict["qty"] = qty + if route is not UNSET: + field_dict["route"] = route + if security is not UNSET: + field_dict["security"] = security + if source is not UNSET: + field_dict["source"] = source + if source_address is not UNSET: + field_dict["sourceAddress"] = source_address + if submit_ts is not UNSET: + field_dict["submitTs"] = submit_ts + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tag is not UNSET: + field_dict["tag"] = tag + if text is not UNSET: + field_dict["text"] = text + if tif is not UNSET: + field_dict["tif"] = tif + if user_id is not UNSET: + field_dict["userId"] = user_id + if trader_id is not UNSET: + field_dict["traderId"] = trader_id + if ord_status is not UNSET: + field_dict["ordStatus"] = ord_status + if claimed_by is not UNSET: + field_dict["claimedBy"] = claimed_by + if transact_ts is not UNSET: + field_dict["transactTs"] = transact_ts + if has_busts is not UNSET: + field_dict["hasBusts"] = has_busts + if has_corrects is not UNSET: + field_dict["hasCorrects"] = has_corrects + if has_notes is not UNSET: + field_dict["hasNotes"] = has_notes + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + _algo = d.pop("algo", UNSET) + algo: Unset | OrderCrossAlgo + if isinstance(_algo, Unset): + algo = UNSET + else: + algo = OrderCrossAlgo.from_dict(_algo) + + allocations = [] + _allocations = d.pop("allocations", UNSET) + for allocations_item_data in _allocations or []: + allocations_item = OrderCrossAllocation.from_dict(allocations_item_data) + + allocations.append(allocations_item) + + _cross_type = d.pop("crossType", UNSET) + cross_type: Unset | CrossType + if isinstance(_cross_type, Unset): + cross_type = UNSET + else: + cross_type = CrossType(_cross_type) + + cur_ord_id = d.pop("curOrdId", UNSET) + + _header = d.pop("header", UNSET) + header: Unset | Header + if isinstance(_header, Unset): + header = UNSET + else: + header = Header.from_dict(_header) + + id = d.pop("id", UNSET) + + incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) + + incoming_ord_id = d.pop("incomingOrdId", UNSET) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + _market_condition = d.pop("marketCondition", UNSET) + market_condition: Unset | OrderCrossMarketCondition + if isinstance(_market_condition, Unset): + market_condition = UNSET + else: + market_condition = OrderCrossMarketCondition.from_dict(_market_condition) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | OrderCrossOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = OrderCrossOptionalData.from_dict(_optional_data) + + order_flags = d.pop("orderFlags", UNSET) + + order_updates = [] + _order_updates = d.pop("orderUpdates", UNSET) + for order_updates_item_data in _order_updates or []: + order_updates_item = OrderUpdateEvent.from_dict(order_updates_item_data) + + order_updates.append(order_updates_item) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + _origination_type = d.pop("originationType", UNSET) + origination_type: Unset | OriginationType + if isinstance(_origination_type, Unset): + origination_type = UNSET + else: + origination_type = OriginationType(_origination_type) + + parent_ord_id = d.pop("parentOrdId", UNSET) + + price = d.pop("price", UNSET) + + _price_type = d.pop("priceType", UNSET) + price_type: Unset | PriceType + if isinstance(_price_type, Unset): + price_type = UNSET + else: + price_type = PriceType(_price_type) + + qty = d.pop("qty", UNSET) + + route = d.pop("route", UNSET) + + _security = d.pop("security", UNSET) + security: Unset | Security + if isinstance(_security, Unset): + security = UNSET + else: + security = Security.from_dict(_security) + + source = d.pop("source", UNSET) + + source_address = d.pop("sourceAddress", UNSET) + + submit_ts = d.pop("submitTs", UNSET) + + symbol = d.pop("symbol", UNSET) + + tag = d.pop("tag", UNSET) + + text = d.pop("text", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + user_id = d.pop("userId", UNSET) + + trader_id = d.pop("traderId", UNSET) + + _ord_status = d.pop("ordStatus", UNSET) + ord_status: Unset | OrdStatus + if isinstance(_ord_status, Unset): + ord_status = UNSET + else: + ord_status = OrdStatus(_ord_status) + + claimed_by = d.pop("claimedBy", UNSET) + + transact_ts = d.pop("transactTs", UNSET) + + has_busts = d.pop("hasBusts", UNSET) + + has_corrects = d.pop("hasCorrects", UNSET) + + has_notes = d.pop("hasNotes", UNSET) + + order_cross = cls( + account_id=account_id, + algo=algo, + allocations=allocations, + cross_type=cross_type, + cur_ord_id=cur_ord_id, + header=header, + id=id, + incoming_cl_ord_id=incoming_cl_ord_id, + incoming_ord_id=incoming_ord_id, + instructions=instructions, + market_condition=market_condition, + optional_data=optional_data, + order_flags=order_flags, + order_updates=order_updates, + ord_type=ord_type, + origination_type=origination_type, + parent_ord_id=parent_ord_id, + price=price, + price_type=price_type, + qty=qty, + route=route, + security=security, + source=source, + source_address=source_address, + submit_ts=submit_ts, + symbol=symbol, + tag=tag, + text=text, + tif=tif, + user_id=user_id, + trader_id=trader_id, + ord_status=ord_status, + claimed_by=claimed_by, + transact_ts=transact_ts, + has_busts=has_busts, + has_corrects=has_corrects, + has_notes=has_notes, + ) + + return order_cross diff --git a/openapi_project/openapi_package/models/order_cross_algo.py b/openapi_project/openapi_package/models/order_cross_algo.py new file mode 100644 index 000000000..36a69f06e --- /dev/null +++ b/openapi_project/openapi_package/models/order_cross_algo.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="OrderCrossAlgo") + + + +@_attrs_define +class OrderCrossAlgo: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_cross_algo = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_cross_algo.additional_properties = additional_properties + return order_cross_algo + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/order_cross_allocation.py b/openapi_project/openapi_package/models/order_cross_allocation.py new file mode 100644 index 000000000..ac9325e30 --- /dev/null +++ b/openapi_project/openapi_package/models/order_cross_allocation.py @@ -0,0 +1,261 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.cross_side_type import CrossSideType +from ..models.ord_status import OrdStatus +from ..models.position_effect import PositionEffect +from ..models.side import Side +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.clearing_info import ClearingInfo + from ..models.order_instruction import OrderInstruction + from ..models.order_cross_allocation_optional_data import ( + OrderCrossAllocationOptionalData, + ) + + +T = TypeVar("T", bound="OrderCrossAllocation") + + +@_attrs_define +class OrderCrossAllocation: + """ + Attributes: + account_id (Unset | int): + clearing_info (Unset | ClearingInfo): + id (Unset | str): + incoming_ord_id (Unset | str): + instructions (Unset | list['OrderInstruction']): + optional_data (Unset | OrderCrossAllocationOptionalData): + position_effect (Unset | PositionEffect): + qty (Unset | float): + side (Unset | Side): + side_type (Unset | CrossSideType): + avg_price (Unset | float): + last_price (Unset | float): + last_qty (Unset | float): + last_market (Unset | str): + leaves_qty (Unset | float): + cum_qty (Unset | float): + transact_ts (Unset | str): + ord_status (Unset | OrdStatus): + """ + + account_id: Unset | int = UNSET + clearing_info: Unset | "ClearingInfo" = UNSET + id: Unset | str = UNSET + incoming_ord_id: Unset | str = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + optional_data: Unset | "OrderCrossAllocationOptionalData" = UNSET + position_effect: Unset | PositionEffect = UNSET + qty: Unset | float = UNSET + side: Unset | Side = UNSET + side_type: Unset | CrossSideType = UNSET + avg_price: Unset | float = UNSET + last_price: Unset | float = UNSET + last_qty: Unset | float = UNSET + last_market: Unset | str = UNSET + leaves_qty: Unset | float = UNSET + cum_qty: Unset | float = UNSET + transact_ts: Unset | str = UNSET + ord_status: Unset | OrdStatus = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + clearing_info: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_info, Unset): + clearing_info = self.clearing_info.to_dict() + + id = self.id + + incoming_ord_id = self.incoming_ord_id + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + position_effect: Unset | str = UNSET + if not isinstance(self.position_effect, Unset): + position_effect = self.position_effect.value + + qty = self.qty + + side: Unset | str = UNSET + if not isinstance(self.side, Unset): + side = self.side.value + + side_type: Unset | str = UNSET + if not isinstance(self.side_type, Unset): + side_type = self.side_type.value + + avg_price = self.avg_price + + last_price = self.last_price + + last_qty = self.last_qty + + last_market = self.last_market + + leaves_qty = self.leaves_qty + + cum_qty = self.cum_qty + + transact_ts = self.transact_ts + + ord_status: Unset | str = UNSET + if not isinstance(self.ord_status, Unset): + ord_status = self.ord_status.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if clearing_info is not UNSET: + field_dict["clearingInfo"] = clearing_info + if id is not UNSET: + field_dict["id"] = id + if incoming_ord_id is not UNSET: + field_dict["incomingOrdId"] = incoming_ord_id + if instructions is not UNSET: + field_dict["instructions"] = instructions + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if position_effect is not UNSET: + field_dict["positionEffect"] = position_effect + if qty is not UNSET: + field_dict["qty"] = qty + if side is not UNSET: + field_dict["side"] = side + if side_type is not UNSET: + field_dict["sideType"] = side_type + if avg_price is not UNSET: + field_dict["avgPrice"] = avg_price + if last_price is not UNSET: + field_dict["lastPrice"] = last_price + if last_qty is not UNSET: + field_dict["lastQty"] = last_qty + if last_market is not UNSET: + field_dict["lastMarket"] = last_market + if leaves_qty is not UNSET: + field_dict["leavesQty"] = leaves_qty + if cum_qty is not UNSET: + field_dict["cumQty"] = cum_qty + if transact_ts is not UNSET: + field_dict["transactTs"] = transact_ts + if ord_status is not UNSET: + field_dict["ordStatus"] = ord_status + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + _clearing_info = d.pop("clearingInfo", UNSET) + clearing_info: Unset | ClearingInfo + if isinstance(_clearing_info, Unset): + clearing_info = UNSET + else: + clearing_info = ClearingInfo.from_dict(_clearing_info) + + id = d.pop("id", UNSET) + + incoming_ord_id = d.pop("incomingOrdId", UNSET) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | OrderCrossAllocationOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = OrderCrossAllocationOptionalData.from_dict(_optional_data) + + _position_effect = d.pop("positionEffect", UNSET) + position_effect: Unset | PositionEffect + if isinstance(_position_effect, Unset): + position_effect = UNSET + else: + position_effect = PositionEffect(_position_effect) + + qty = d.pop("qty", UNSET) + + _side = d.pop("side", UNSET) + side: Unset | Side + if isinstance(_side, Unset): + side = UNSET + else: + side = Side(_side) + + _side_type = d.pop("sideType", UNSET) + side_type: Unset | CrossSideType + if isinstance(_side_type, Unset): + side_type = UNSET + else: + side_type = CrossSideType(_side_type) + + avg_price = d.pop("avgPrice", UNSET) + + last_price = d.pop("lastPrice", UNSET) + + last_qty = d.pop("lastQty", UNSET) + + last_market = d.pop("lastMarket", UNSET) + + leaves_qty = d.pop("leavesQty", UNSET) + + cum_qty = d.pop("cumQty", UNSET) + + transact_ts = d.pop("transactTs", UNSET) + + _ord_status = d.pop("ordStatus", UNSET) + ord_status: Unset | OrdStatus + if isinstance(_ord_status, Unset): + ord_status = UNSET + else: + ord_status = OrdStatus(_ord_status) + + order_cross_allocation = cls( + account_id=account_id, + clearing_info=clearing_info, + id=id, + incoming_ord_id=incoming_ord_id, + instructions=instructions, + optional_data=optional_data, + position_effect=position_effect, + qty=qty, + side=side, + side_type=side_type, + avg_price=avg_price, + last_price=last_price, + last_qty=last_qty, + last_market=last_market, + leaves_qty=leaves_qty, + cum_qty=cum_qty, + transact_ts=transact_ts, + ord_status=ord_status, + ) + + return order_cross_allocation diff --git a/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py b/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py new file mode 100644 index 000000000..9d802155a --- /dev/null +++ b/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="OrderCrossAllocationOptionalData") + + + +@_attrs_define +class OrderCrossAllocationOptionalData: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_cross_allocation_optional_data = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_cross_allocation_optional_data.additional_properties = additional_properties + return order_cross_allocation_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/order_cross_market_condition.py b/openapi_project/openapi_package/models/order_cross_market_condition.py new file mode 100644 index 000000000..5d10c9e2a --- /dev/null +++ b/openapi_project/openapi_package/models/order_cross_market_condition.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="OrderCrossMarketCondition") + + + +@_attrs_define +class OrderCrossMarketCondition: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_cross_market_condition = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_cross_market_condition.additional_properties = additional_properties + return order_cross_market_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/order_cross_optional_data.py b/openapi_project/openapi_package/models/order_cross_optional_data.py new file mode 100644 index 000000000..f583fa115 --- /dev/null +++ b/openapi_project/openapi_package/models/order_cross_optional_data.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="OrderCrossOptionalData") + + + +@_attrs_define +class OrderCrossOptionalData: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_cross_optional_data = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_cross_optional_data.additional_properties = additional_properties + return order_cross_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/order_delete.py b/openapi_project/openapi_package/models/order_delete.py new file mode 100644 index 000000000..79e6dedba --- /dev/null +++ b/openapi_project/openapi_package/models/order_delete.py @@ -0,0 +1,108 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.origination_type import OriginationType +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.order_delete_optional_data import OrderDeleteOptionalData + + +T = TypeVar("T", bound="OrderDelete") + + +@_attrs_define +class OrderDelete: + """ + Attributes: + cur_ord_id (Unset | str): + optional_data (Unset | OrderDeleteOptionalData): + origination_type (Unset | OriginationType): + perm_ord_id (Unset | str): + trader_id (Unset | str): + submit_ts (Unset | str): + """ + + cur_ord_id: Unset | str = UNSET + optional_data: Unset | "OrderDeleteOptionalData" = UNSET + origination_type: Unset | OriginationType = UNSET + perm_ord_id: Unset | str = UNSET + trader_id: Unset | str = UNSET + submit_ts: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + cur_ord_id = self.cur_ord_id + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + origination_type: Unset | str = UNSET + if not isinstance(self.origination_type, Unset): + origination_type = self.origination_type.value + + perm_ord_id = self.perm_ord_id + + trader_id = self.trader_id + + submit_ts = self.submit_ts + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if origination_type is not UNSET: + field_dict["originationType"] = origination_type + if perm_ord_id is not UNSET: + field_dict["permOrdId"] = perm_ord_id + if trader_id is not UNSET: + field_dict["traderId"] = trader_id + if submit_ts is not UNSET: + field_dict["submitTs"] = submit_ts + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + cur_ord_id = d.pop("curOrdId", UNSET) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | OrderDeleteOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = OrderDeleteOptionalData.from_dict(_optional_data) + + _origination_type = d.pop("originationType", UNSET) + origination_type: Unset | OriginationType + if isinstance(_origination_type, Unset): + origination_type = UNSET + else: + origination_type = OriginationType(_origination_type) + + perm_ord_id = d.pop("permOrdId", UNSET) + + trader_id = d.pop("traderId", UNSET) + + submit_ts = d.pop("submitTs", UNSET) + + order_delete = cls( + cur_ord_id=cur_ord_id, + optional_data=optional_data, + origination_type=origination_type, + perm_ord_id=perm_ord_id, + trader_id=trader_id, + submit_ts=submit_ts, + ) + + return order_delete diff --git a/openapi_project/openapi_package/models/order_delete_optional_data.py b/openapi_project/openapi_package/models/order_delete_optional_data.py new file mode 100644 index 000000000..400004ae6 --- /dev/null +++ b/openapi_project/openapi_package/models/order_delete_optional_data.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="OrderDeleteOptionalData") + + + +@_attrs_define +class OrderDeleteOptionalData: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_delete_optional_data = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_delete_optional_data.additional_properties = additional_properties + return order_delete_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/order_instruction.py b/openapi_project/openapi_package/models/order_instruction.py new file mode 100644 index 000000000..f29115e45 --- /dev/null +++ b/openapi_project/openapi_package/models/order_instruction.py @@ -0,0 +1,61 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.order_instruction_type import OrderInstructionType +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="OrderInstruction") + + +@_attrs_define +class OrderInstruction: + """ + Attributes: + type_ (Unset | OrderInstructionType): + value (Unset | str): + """ + + type_: Unset | OrderInstructionType = UNSET + value: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + type_: Unset | str = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + value = self.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if type_ is not UNSET: + field_dict["type"] = type_ + if value is not UNSET: + field_dict["value"] = value + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _type_ = d.pop("type", UNSET) + type_: Unset | OrderInstructionType + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = OrderInstructionType(_type_) + + value = d.pop("value", UNSET) + + order_instruction = cls( + type_=type_, + value=value, + ) + + return order_instruction diff --git a/openapi_project/openapi_package/models/order_instruction_type.py b/openapi_project/openapi_package/models/order_instruction_type.py new file mode 100644 index 000000000..2dc45378a --- /dev/null +++ b/openapi_project/openapi_package/models/order_instruction_type.py @@ -0,0 +1,91 @@ +from enum import Enum + + +class OrderInstructionType(str, Enum): + ORDER_INSTRUCTION_TYPE_ALL_OR_NONE = "ORDER_INSTRUCTION_TYPE_ALL_OR_NONE" + ORDER_INSTRUCTION_TYPE_AUCTION_ID = "ORDER_INSTRUCTION_TYPE_AUCTION_ID" + ORDER_INSTRUCTION_TYPE_AUTO_MATCH = "ORDER_INSTRUCTION_TYPE_AUTO_MATCH" + ORDER_INSTRUCTION_TYPE_AUTO_MATCH_PRICE = "ORDER_INSTRUCTION_TYPE_AUTO_MATCH_PRICE" + ORDER_INSTRUCTION_TYPE_BROKER_PERCENTAGE = ( + "ORDER_INSTRUCTION_TYPE_BROKER_PERCENTAGE" + ) + ORDER_INSTRUCTION_TYPE_CLIENT_ID = "ORDER_INSTRUCTION_TYPE_CLIENT_ID" + ORDER_INSTRUCTION_TYPE_COMMISSION = "ORDER_INSTRUCTION_TYPE_COMMISSION" + ORDER_INSTRUCTION_TYPE_COMPRESSION = "ORDER_INSTRUCTION_TYPE_COMPRESSION" + ORDER_INSTRUCTION_TYPE_CROSS_PRIORITIZATION = ( + "ORDER_INSTRUCTION_TYPE_CROSS_PRIORITIZATION" + ) + ORDER_INSTRUCTION_TYPE_DO_NOT_REDUCE = "ORDER_INSTRUCTION_TYPE_DO_NOT_REDUCE" + ORDER_INSTRUCTION_TYPE_DO_NOT_ROUTE = "ORDER_INSTRUCTION_TYPE_DO_NOT_ROUTE" + ORDER_INSTRUCTION_TYPE_DROP = "ORDER_INSTRUCTION_TYPE_DROP" + ORDER_INSTRUCTION_TYPE_EQUITY_BUY_CLEARING_FIRM = ( + "ORDER_INSTRUCTION_TYPE_EQUITY_BUY_CLEARING_FIRM" + ) + ORDER_INSTRUCTION_TYPE_EQUITY_EX_DESTINATION = ( + "ORDER_INSTRUCTION_TYPE_EQUITY_EX_DESTINATION" + ) + ORDER_INSTRUCTION_TYPE_EQUITY_PARTY_ID = "ORDER_INSTRUCTION_TYPE_EQUITY_PARTY_ID" + ORDER_INSTRUCTION_TYPE_EQUITY_SELL_CLEARING_FIRM = ( + "ORDER_INSTRUCTION_TYPE_EQUITY_SELL_CLEARING_FIRM" + ) + ORDER_INSTRUCTION_TYPE_EQUITY_TRADE_PRICE = ( + "ORDER_INSTRUCTION_TYPE_EQUITY_TRADE_PRICE" + ) + ORDER_INSTRUCTION_TYPE_EQUITY_TRADE_SIZE = ( + "ORDER_INSTRUCTION_TYPE_EQUITY_TRADE_SIZE" + ) + ORDER_INSTRUCTION_TYPE_EQUITY_TRADE_VENUE = ( + "ORDER_INSTRUCTION_TYPE_EQUITY_TRADE_VENUE" + ) + ORDER_INSTRUCTION_TYPE_EQUITY_TRANSACT_TS = ( + "ORDER_INSTRUCTION_TYPE_EQUITY_TRANSACT_TS" + ) + ORDER_INSTRUCTION_TYPE_FLEX_AUCTION_DURATION = ( + "ORDER_INSTRUCTION_TYPE_FLEX_AUCTION_DURATION" + ) + ORDER_INSTRUCTION_TYPE_FLEX_HEDGE_EXEC_INST = ( + "ORDER_INSTRUCTION_TYPE_FLEX_HEDGE_EXEC_INST" + ) + ORDER_INSTRUCTION_TYPE_FLEX_PRE_FACIL_PRICE = ( + "ORDER_INSTRUCTION_TYPE_FLEX_PRE_FACIL_PRICE" + ) + ORDER_INSTRUCTION_TYPE_FREQUENT_TRADER = "ORDER_INSTRUCTION_TYPE_FREQUENT_TRADER" + ORDER_INSTRUCTION_TYPE_FREQUENT_TRADER_ID = ( + "ORDER_INSTRUCTION_TYPE_FREQUENT_TRADER_ID" + ) + ORDER_INSTRUCTION_TYPE_GOOD_TILL_DATE = "ORDER_INSTRUCTION_TYPE_GOOD_TILL_DATE" + ORDER_INSTRUCTION_TYPE_HELD = "ORDER_INSTRUCTION_TYPE_HELD" + ORDER_INSTRUCTION_TYPE_INTERMARKET_SWEEP = ( + "ORDER_INSTRUCTION_TYPE_INTERMARKET_SWEEP" + ) + ORDER_INSTRUCTION_TYPE_LAST_PRIORITY = "ORDER_INSTRUCTION_TYPE_LAST_PRIORITY" + ORDER_INSTRUCTION_TYPE_MAX_FLOOR = "ORDER_INSTRUCTION_TYPE_MAX_FLOOR" + ORDER_INSTRUCTION_TYPE_MIN_QTY = "ORDER_INSTRUCTION_TYPE_MIN_QTY" + ORDER_INSTRUCTION_TYPE_NONE = "ORDER_INSTRUCTION_TYPE_NONE" + ORDER_INSTRUCTION_TYPE_NOT_HELD = "ORDER_INSTRUCTION_TYPE_NOT_HELD" + ORDER_INSTRUCTION_TYPE_NO_COA = "ORDER_INSTRUCTION_TYPE_NO_COA" + ORDER_INSTRUCTION_TYPE_ORDER_ORIGIN = "ORDER_INSTRUCTION_TYPE_ORDER_ORIGIN" + ORDER_INSTRUCTION_TYPE_O_R_S = "ORDER_INSTRUCTION_TYPE_O_R_S" + ORDER_INSTRUCTION_TYPE_PEG_DIFFERENCE = "ORDER_INSTRUCTION_TYPE_PEG_DIFFERENCE" + ORDER_INSTRUCTION_TYPE_PEG_TYPE = "ORDER_INSTRUCTION_TYPE_PEG_TYPE" + ORDER_INSTRUCTION_TYPE_PHLX_QCC = "ORDER_INSTRUCTION_TYPE_PHLX_QCC" + ORDER_INSTRUCTION_TYPE_PREFERRED_M_M = "ORDER_INSTRUCTION_TYPE_PREFERRED_M_M" + ORDER_INSTRUCTION_TYPE_REPRESENT = "ORDER_INSTRUCTION_TYPE_REPRESENT" + ORDER_INSTRUCTION_TYPE_ROUTE_STRATEGY = "ORDER_INSTRUCTION_TYPE_ROUTE_STRATEGY" + ORDER_INSTRUCTION_TYPE_ROUTING_FIRM_ID = "ORDER_INSTRUCTION_TYPE_ROUTING_FIRM_ID" + ORDER_INSTRUCTION_TYPE_ROUTING_INST = "ORDER_INSTRUCTION_TYPE_ROUTING_INST" + ORDER_INSTRUCTION_TYPE_SESSION_ELIGIBILITY = ( + "ORDER_INSTRUCTION_TYPE_SESSION_ELIGIBILITY" + ) + ORDER_INSTRUCTION_TYPE_SETTLEMENT_LIQUIDITY = ( + "ORDER_INSTRUCTION_TYPE_SETTLEMENT_LIQUIDITY" + ) + ORDER_INSTRUCTION_TYPE_SOLICITED = "ORDER_INSTRUCTION_TYPE_SOLICITED" + ORDER_INSTRUCTION_TYPE_SPX_COMBO = "ORDER_INSTRUCTION_TYPE_SPX_COMBO" + ORDER_INSTRUCTION_TYPE_STEP_UP_PX = "ORDER_INSTRUCTION_TYPE_STEP_UP_PX" + ORDER_INSTRUCTION_TYPE_STRATEGY_ID = "ORDER_INSTRUCTION_TYPE_STRATEGY_ID" + ORDER_INSTRUCTION_TYPE_SWEEP = "ORDER_INSTRUCTION_TYPE_SWEEP" + ORDER_INSTRUCTION_TYPE_TIED_HEDGE = "ORDER_INSTRUCTION_TYPE_TIED_HEDGE" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/order_market_condition.py b/openapi_project/openapi_package/models/order_market_condition.py new file mode 100644 index 000000000..5e8731251 --- /dev/null +++ b/openapi_project/openapi_package/models/order_market_condition.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="OrderMarketCondition") + + + +@_attrs_define +class OrderMarketCondition: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_market_condition = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_market_condition.additional_properties = additional_properties + return order_market_condition + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/order_optional_data.py b/openapi_project/openapi_package/models/order_optional_data.py new file mode 100644 index 000000000..aee3cef71 --- /dev/null +++ b/openapi_project/openapi_package/models/order_optional_data.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="OrderOptionalData") + + + +@_attrs_define +class OrderOptionalData: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_optional_data = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_optional_data.additional_properties = additional_properties + return order_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/order_type.py b/openapi_project/openapi_package/models/order_type.py new file mode 100644 index 000000000..f59ced1fa --- /dev/null +++ b/openapi_project/openapi_package/models/order_type.py @@ -0,0 +1,12 @@ +from enum import Enum + + +class OrderType(str, Enum): + ORDER_TYPE_MULTI_LEG_ORDER = "ORDER_TYPE_MULTI_LEG_ORDER" + ORDER_TYPE_MULTI_LEG_ORDER_CROSS = "ORDER_TYPE_MULTI_LEG_ORDER_CROSS" + ORDER_TYPE_ORDER = "ORDER_TYPE_ORDER" + ORDER_TYPE_ORDER_CROSS = "ORDER_TYPE_ORDER_CROSS" + ORDER_TYPE_UNKNOWN = "ORDER_TYPE_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/order_update.py b/openapi_project/openapi_package/models/order_update.py new file mode 100644 index 000000000..cc64cc700 --- /dev/null +++ b/openapi_project/openapi_package/models/order_update.py @@ -0,0 +1,620 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.exec_type import ExecType +from ..models.multi_leg_reporting_type import MultiLegReportingType +from ..models.ord_status import OrdStatus +from ..models.ord_type import OrdType +from ..models.origination_type import OriginationType +from ..models.position_effect import PositionEffect +from ..models.price_type import PriceType +from ..models.side import Side +from ..models.tif import Tif +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.order_update_algo import OrderUpdateAlgo + from ..models.clearing_info import ClearingInfo + from ..models.order_update_optional_data import OrderUpdateOptionalData + from ..models.header import Header + from ..models.security import Security + from ..models.order_instruction import OrderInstruction + + +T = TypeVar("T", bound="OrderUpdate") + + +@_attrs_define +class OrderUpdate: + """ + Attributes: + account_id (Unset | int): + algo (Unset | OrderUpdateAlgo): + alloc_id (Unset | str): + aux_price (Unset | float): + avg_price (Unset | float): + clearing_info (Unset | ClearingInfo): + commission (Unset | float): + cum_qty (Unset | float): + cur_ord_id (Unset | str): + exec_broker (Unset | str): + exec_id (Unset | str): + exec_ref_id (Unset | str): + exec_type (Unset | ExecType): + fee1 (Unset | float): + fee2 (Unset | float): + header (Unset | Header): + incoming_cl_ord_id (Unset | str): + incoming_ord_id (Unset | str): + incoming_orig_cl_ord_id (Unset | str): + instructions (Unset | list['OrderInstruction']): + last_market (Unset | str): + last_price (Unset | float): + last_qty (Unset | float): + leaves_qty (Unset | float): + leg_id (Unset | str): + liquidity_flag (Unset | str): + multi_leg_reporting_type (Unset | MultiLegReportingType): + notes (Unset | str): + optional_data (Unset | OrderUpdateOptionalData): + order_flags (Unset | int): + ord_status (Unset | OrdStatus): + ord_type (Unset | OrdType): + origination_type (Unset | OriginationType): + orig_ord_id (Unset | str): + parent_ord_id (Unset | str): + perm_ord_id (Unset | str): + position_effect (Unset | PositionEffect): + price (Unset | float): + price_type (Unset | PriceType): + qty (Unset | float): + route (Unset | str): + security (Unset | Security): + side (Unset | Side): + source (Unset | str): + symbol (Unset | str): + tag (Unset | str): + text (Unset | str): + tif (Unset | Tif): + trader_id (Unset | str): + transact_ts (Unset | str): + working_qty (Unset | float): + """ + + account_id: Unset | int = UNSET + algo: Unset | "OrderUpdateAlgo" = UNSET + alloc_id: Unset | str = UNSET + aux_price: Unset | float = UNSET + avg_price: Unset | float = UNSET + clearing_info: Unset | "ClearingInfo" = UNSET + commission: Unset | float = UNSET + cum_qty: Unset | float = UNSET + cur_ord_id: Unset | str = UNSET + exec_broker: Unset | str = UNSET + exec_id: Unset | str = UNSET + exec_ref_id: Unset | str = UNSET + exec_type: Unset | ExecType = UNSET + fee1: Unset | float = UNSET + fee2: Unset | float = UNSET + header: Unset | "Header" = UNSET + incoming_cl_ord_id: Unset | str = UNSET + incoming_ord_id: Unset | str = UNSET + incoming_orig_cl_ord_id: Unset | str = UNSET + instructions: Unset | list["OrderInstruction"] = UNSET + last_market: Unset | str = UNSET + last_price: Unset | float = UNSET + last_qty: Unset | float = UNSET + leaves_qty: Unset | float = UNSET + leg_id: Unset | str = UNSET + liquidity_flag: Unset | str = UNSET + multi_leg_reporting_type: Unset | MultiLegReportingType = UNSET + notes: Unset | str = UNSET + optional_data: Unset | "OrderUpdateOptionalData" = UNSET + order_flags: Unset | int = UNSET + ord_status: Unset | OrdStatus = UNSET + ord_type: Unset | OrdType = UNSET + origination_type: Unset | OriginationType = UNSET + orig_ord_id: Unset | str = UNSET + parent_ord_id: Unset | str = UNSET + perm_ord_id: Unset | str = UNSET + position_effect: Unset | PositionEffect = UNSET + price: Unset | float = UNSET + price_type: Unset | PriceType = UNSET + qty: Unset | float = UNSET + route: Unset | str = UNSET + security: Unset | "Security" = UNSET + side: Unset | Side = UNSET + source: Unset | str = UNSET + symbol: Unset | str = UNSET + tag: Unset | str = UNSET + text: Unset | str = UNSET + tif: Unset | Tif = UNSET + trader_id: Unset | str = UNSET + transact_ts: Unset | str = UNSET + working_qty: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + algo: Unset | dict[str, Any] = UNSET + if not isinstance(self.algo, Unset): + algo = self.algo.to_dict() + + alloc_id = self.alloc_id + + aux_price = self.aux_price + + avg_price = self.avg_price + + clearing_info: Unset | dict[str, Any] = UNSET + if not isinstance(self.clearing_info, Unset): + clearing_info = self.clearing_info.to_dict() + + commission = self.commission + + cum_qty = self.cum_qty + + cur_ord_id = self.cur_ord_id + + exec_broker = self.exec_broker + + exec_id = self.exec_id + + exec_ref_id = self.exec_ref_id + + exec_type: Unset | str = UNSET + if not isinstance(self.exec_type, Unset): + exec_type = self.exec_type.value + + fee1 = self.fee1 + + fee2 = self.fee2 + + header: Unset | dict[str, Any] = UNSET + if not isinstance(self.header, Unset): + header = self.header.to_dict() + + incoming_cl_ord_id = self.incoming_cl_ord_id + + incoming_ord_id = self.incoming_ord_id + + incoming_orig_cl_ord_id = self.incoming_orig_cl_ord_id + + instructions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.instructions, Unset): + instructions = [] + for instructions_item_data in self.instructions: + instructions_item = instructions_item_data.to_dict() + instructions.append(instructions_item) + + last_market = self.last_market + + last_price = self.last_price + + last_qty = self.last_qty + + leaves_qty = self.leaves_qty + + leg_id = self.leg_id + + liquidity_flag = self.liquidity_flag + + multi_leg_reporting_type: Unset | str = UNSET + if not isinstance(self.multi_leg_reporting_type, Unset): + multi_leg_reporting_type = self.multi_leg_reporting_type.value + + notes = self.notes + + optional_data: Unset | dict[str, Any] = UNSET + if not isinstance(self.optional_data, Unset): + optional_data = self.optional_data.to_dict() + + order_flags = self.order_flags + + ord_status: Unset | str = UNSET + if not isinstance(self.ord_status, Unset): + ord_status = self.ord_status.value + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + origination_type: Unset | str = UNSET + if not isinstance(self.origination_type, Unset): + origination_type = self.origination_type.value + + orig_ord_id = self.orig_ord_id + + parent_ord_id = self.parent_ord_id + + perm_ord_id = self.perm_ord_id + + position_effect: Unset | str = UNSET + if not isinstance(self.position_effect, Unset): + position_effect = self.position_effect.value + + price = self.price + + price_type: Unset | str = UNSET + if not isinstance(self.price_type, Unset): + price_type = self.price_type.value + + qty = self.qty + + route = self.route + + security: Unset | dict[str, Any] = UNSET + if not isinstance(self.security, Unset): + security = self.security.to_dict() + + side: Unset | str = UNSET + if not isinstance(self.side, Unset): + side = self.side.value + + source = self.source + + symbol = self.symbol + + tag = self.tag + + text = self.text + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + trader_id = self.trader_id + + transact_ts = self.transact_ts + + working_qty = self.working_qty + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if algo is not UNSET: + field_dict["Algo"] = algo + if alloc_id is not UNSET: + field_dict["allocId"] = alloc_id + if aux_price is not UNSET: + field_dict["auxPrice"] = aux_price + if avg_price is not UNSET: + field_dict["avgPrice"] = avg_price + if clearing_info is not UNSET: + field_dict["clearingInfo"] = clearing_info + if commission is not UNSET: + field_dict["commission"] = commission + if cum_qty is not UNSET: + field_dict["cumQty"] = cum_qty + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if exec_broker is not UNSET: + field_dict["execBroker"] = exec_broker + if exec_id is not UNSET: + field_dict["execId"] = exec_id + if exec_ref_id is not UNSET: + field_dict["execRefId"] = exec_ref_id + if exec_type is not UNSET: + field_dict["execType"] = exec_type + if fee1 is not UNSET: + field_dict["fee1"] = fee1 + if fee2 is not UNSET: + field_dict["fee2"] = fee2 + if header is not UNSET: + field_dict["header"] = header + if incoming_cl_ord_id is not UNSET: + field_dict["incomingClOrdId"] = incoming_cl_ord_id + if incoming_ord_id is not UNSET: + field_dict["incomingOrdId"] = incoming_ord_id + if incoming_orig_cl_ord_id is not UNSET: + field_dict["incomingOrigClOrdId"] = incoming_orig_cl_ord_id + if instructions is not UNSET: + field_dict["instructions"] = instructions + if last_market is not UNSET: + field_dict["lastMarket"] = last_market + if last_price is not UNSET: + field_dict["lastPrice"] = last_price + if last_qty is not UNSET: + field_dict["lastQty"] = last_qty + if leaves_qty is not UNSET: + field_dict["leavesQty"] = leaves_qty + if leg_id is not UNSET: + field_dict["legId"] = leg_id + if liquidity_flag is not UNSET: + field_dict["liquidityFlag"] = liquidity_flag + if multi_leg_reporting_type is not UNSET: + field_dict["multiLegReportingType"] = multi_leg_reporting_type + if notes is not UNSET: + field_dict["Notes"] = notes + if optional_data is not UNSET: + field_dict["optionalData"] = optional_data + if order_flags is not UNSET: + field_dict["orderFlags"] = order_flags + if ord_status is not UNSET: + field_dict["ordStatus"] = ord_status + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if origination_type is not UNSET: + field_dict["originationType"] = origination_type + if orig_ord_id is not UNSET: + field_dict["origOrdId"] = orig_ord_id + if parent_ord_id is not UNSET: + field_dict["parentOrdId"] = parent_ord_id + if perm_ord_id is not UNSET: + field_dict["permOrdId"] = perm_ord_id + if position_effect is not UNSET: + field_dict["positionEffect"] = position_effect + if price is not UNSET: + field_dict["price"] = price + if price_type is not UNSET: + field_dict["priceType"] = price_type + if qty is not UNSET: + field_dict["qty"] = qty + if route is not UNSET: + field_dict["route"] = route + if security is not UNSET: + field_dict["security"] = security + if side is not UNSET: + field_dict["side"] = side + if source is not UNSET: + field_dict["source"] = source + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tag is not UNSET: + field_dict["tag"] = tag + if text is not UNSET: + field_dict["text"] = text + if tif is not UNSET: + field_dict["tif"] = tif + if trader_id is not UNSET: + field_dict["traderId"] = trader_id + if transact_ts is not UNSET: + field_dict["transactTs"] = transact_ts + if working_qty is not UNSET: + field_dict["workingQty"] = working_qty + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + _algo = d.pop("Algo", UNSET) + algo: Unset | OrderUpdateAlgo + if isinstance(_algo, Unset): + algo = UNSET + else: + algo = OrderUpdateAlgo.from_dict(_algo) + + alloc_id = d.pop("allocId", UNSET) + + aux_price = d.pop("auxPrice", UNSET) + + avg_price = d.pop("avgPrice", UNSET) + + _clearing_info = d.pop("clearingInfo", UNSET) + clearing_info: Unset | ClearingInfo + if isinstance(_clearing_info, Unset): + clearing_info = UNSET + else: + clearing_info = ClearingInfo.from_dict(_clearing_info) + + commission = d.pop("commission", UNSET) + + cum_qty = d.pop("cumQty", UNSET) + + cur_ord_id = d.pop("curOrdId", UNSET) + + exec_broker = d.pop("execBroker", UNSET) + + exec_id = d.pop("execId", UNSET) + + exec_ref_id = d.pop("execRefId", UNSET) + + _exec_type = d.pop("execType", UNSET) + exec_type: Unset | ExecType + if isinstance(_exec_type, Unset): + exec_type = UNSET + else: + exec_type = ExecType(_exec_type) + + fee1 = d.pop("fee1", UNSET) + + fee2 = d.pop("fee2", UNSET) + + _header = d.pop("header", UNSET) + header: Unset | Header + if isinstance(_header, Unset): + header = UNSET + else: + header = Header.from_dict(_header) + + incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) + + incoming_ord_id = d.pop("incomingOrdId", UNSET) + + incoming_orig_cl_ord_id = d.pop("incomingOrigClOrdId", UNSET) + + instructions = [] + _instructions = d.pop("instructions", UNSET) + for instructions_item_data in _instructions or []: + instructions_item = OrderInstruction.from_dict(instructions_item_data) + + instructions.append(instructions_item) + + last_market = d.pop("lastMarket", UNSET) + + last_price = d.pop("lastPrice", UNSET) + + last_qty = d.pop("lastQty", UNSET) + + leaves_qty = d.pop("leavesQty", UNSET) + + leg_id = d.pop("legId", UNSET) + + liquidity_flag = d.pop("liquidityFlag", UNSET) + + _multi_leg_reporting_type = d.pop("multiLegReportingType", UNSET) + multi_leg_reporting_type: Unset | MultiLegReportingType + if isinstance(_multi_leg_reporting_type, Unset): + multi_leg_reporting_type = UNSET + else: + multi_leg_reporting_type = MultiLegReportingType(_multi_leg_reporting_type) + + notes = d.pop("Notes", UNSET) + + _optional_data = d.pop("optionalData", UNSET) + optional_data: Unset | OrderUpdateOptionalData + if isinstance(_optional_data, Unset): + optional_data = UNSET + else: + optional_data = OrderUpdateOptionalData.from_dict(_optional_data) + + order_flags = d.pop("orderFlags", UNSET) + + _ord_status = d.pop("ordStatus", UNSET) + ord_status: Unset | OrdStatus + if isinstance(_ord_status, Unset): + ord_status = UNSET + else: + ord_status = OrdStatus(_ord_status) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + _origination_type = d.pop("originationType", UNSET) + origination_type: Unset | OriginationType + if isinstance(_origination_type, Unset): + origination_type = UNSET + else: + origination_type = OriginationType(_origination_type) + + orig_ord_id = d.pop("origOrdId", UNSET) + + parent_ord_id = d.pop("parentOrdId", UNSET) + + perm_ord_id = d.pop("permOrdId", UNSET) + + _position_effect = d.pop("positionEffect", UNSET) + position_effect: Unset | PositionEffect + if isinstance(_position_effect, Unset): + position_effect = UNSET + else: + position_effect = PositionEffect(_position_effect) + + price = d.pop("price", UNSET) + + _price_type = d.pop("priceType", UNSET) + price_type: Unset | PriceType + if isinstance(_price_type, Unset): + price_type = UNSET + else: + price_type = PriceType(_price_type) + + qty = d.pop("qty", UNSET) + + route = d.pop("route", UNSET) + + _security = d.pop("security", UNSET) + security: Unset | Security + if isinstance(_security, Unset): + security = UNSET + else: + security = Security.from_dict(_security) + + _side = d.pop("side", UNSET) + side: Unset | Side + if isinstance(_side, Unset): + side = UNSET + else: + side = Side(_side) + + source = d.pop("source", UNSET) + + symbol = d.pop("symbol", UNSET) + + tag = d.pop("tag", UNSET) + + text = d.pop("text", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + trader_id = d.pop("traderId", UNSET) + + transact_ts = d.pop("transactTs", UNSET) + + working_qty = d.pop("workingQty", UNSET) + + order_update = cls( + account_id=account_id, + algo=algo, + alloc_id=alloc_id, + aux_price=aux_price, + avg_price=avg_price, + clearing_info=clearing_info, + commission=commission, + cum_qty=cum_qty, + cur_ord_id=cur_ord_id, + exec_broker=exec_broker, + exec_id=exec_id, + exec_ref_id=exec_ref_id, + exec_type=exec_type, + fee1=fee1, + fee2=fee2, + header=header, + incoming_cl_ord_id=incoming_cl_ord_id, + incoming_ord_id=incoming_ord_id, + incoming_orig_cl_ord_id=incoming_orig_cl_ord_id, + instructions=instructions, + last_market=last_market, + last_price=last_price, + last_qty=last_qty, + leaves_qty=leaves_qty, + leg_id=leg_id, + liquidity_flag=liquidity_flag, + multi_leg_reporting_type=multi_leg_reporting_type, + notes=notes, + optional_data=optional_data, + order_flags=order_flags, + ord_status=ord_status, + ord_type=ord_type, + origination_type=origination_type, + orig_ord_id=orig_ord_id, + parent_ord_id=parent_ord_id, + perm_ord_id=perm_ord_id, + position_effect=position_effect, + price=price, + price_type=price_type, + qty=qty, + route=route, + security=security, + side=side, + source=source, + symbol=symbol, + tag=tag, + text=text, + tif=tif, + trader_id=trader_id, + transact_ts=transact_ts, + working_qty=working_qty, + ) + + return order_update diff --git a/openapi_project/openapi_package/models/order_update_algo.py b/openapi_project/openapi_package/models/order_update_algo.py new file mode 100644 index 000000000..eb02c03ab --- /dev/null +++ b/openapi_project/openapi_package/models/order_update_algo.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="OrderUpdateAlgo") + + + +@_attrs_define +class OrderUpdateAlgo: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_update_algo = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_update_algo.additional_properties = additional_properties + return order_update_algo + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/order_update_event.py b/openapi_project/openapi_package/models/order_update_event.py new file mode 100644 index 000000000..60fe25fd4 --- /dev/null +++ b/openapi_project/openapi_package/models/order_update_event.py @@ -0,0 +1,175 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.order_delete import OrderDelete + from ..models.order_update import OrderUpdate + from ..models.execution import Execution + from ..models.multi_leg_order_cancel_replace_request import ( + MultiLegOrderCancelReplaceRequest, + ) + from ..models.order_cancel_replace_request import OrderCancelReplaceRequest + from ..models.order_cancel_request import OrderCancelRequest + from ..models.order_cancel_reject import OrderCancelReject + + +T = TypeVar("T", bound="OrderUpdateEvent") + + +@_attrs_define +class OrderUpdateEvent: + """ + Attributes: + order_cancel_request (Unset | OrderCancelRequest): + order_cancel_replace_request (Unset | OrderCancelReplaceRequest): + multi_leg_order_cancel_replace_request (Unset | MultiLegOrderCancelReplaceRequest): + execution (Unset | Execution): + order_update (Unset | OrderUpdate): + order_delete (Unset | OrderDelete): + order_cancel_reject (Unset | OrderCancelReject): + """ + + order_cancel_request: Unset | "OrderCancelRequest" = UNSET + order_cancel_replace_request: Unset | "OrderCancelReplaceRequest" = UNSET + multi_leg_order_cancel_replace_request: ( + Unset | "MultiLegOrderCancelReplaceRequest" + ) = UNSET + execution: Unset | "Execution" = UNSET + order_update: Unset | "OrderUpdate" = UNSET + order_delete: Unset | "OrderDelete" = UNSET + order_cancel_reject: Unset | "OrderCancelReject" = UNSET + + def to_dict(self) -> dict[str, Any]: + order_cancel_request: Unset | dict[str, Any] = UNSET + if not isinstance(self.order_cancel_request, Unset): + order_cancel_request = self.order_cancel_request.to_dict() + + order_cancel_replace_request: Unset | dict[str, Any] = UNSET + if not isinstance(self.order_cancel_replace_request, Unset): + order_cancel_replace_request = self.order_cancel_replace_request.to_dict() + + multi_leg_order_cancel_replace_request: Unset | dict[str, Any] = UNSET + if not isinstance(self.multi_leg_order_cancel_replace_request, Unset): + multi_leg_order_cancel_replace_request = ( + self.multi_leg_order_cancel_replace_request.to_dict() + ) + + execution: Unset | dict[str, Any] = UNSET + if not isinstance(self.execution, Unset): + execution = self.execution.to_dict() + + order_update: Unset | dict[str, Any] = UNSET + if not isinstance(self.order_update, Unset): + order_update = self.order_update.to_dict() + + order_delete: Unset | dict[str, Any] = UNSET + if not isinstance(self.order_delete, Unset): + order_delete = self.order_delete.to_dict() + + order_cancel_reject: Unset | dict[str, Any] = UNSET + if not isinstance(self.order_cancel_reject, Unset): + order_cancel_reject = self.order_cancel_reject.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if order_cancel_request is not UNSET: + field_dict["orderCancelRequest"] = order_cancel_request + if order_cancel_replace_request is not UNSET: + field_dict["orderCancelReplaceRequest"] = order_cancel_replace_request + if multi_leg_order_cancel_replace_request is not UNSET: + field_dict["multiLegOrderCancelReplaceRequest"] = ( + multi_leg_order_cancel_replace_request + ) + if execution is not UNSET: + field_dict["execution"] = execution + if order_update is not UNSET: + field_dict["orderUpdate"] = order_update + if order_delete is not UNSET: + field_dict["orderDelete"] = order_delete + if order_cancel_reject is not UNSET: + field_dict["orderCancelReject"] = order_cancel_reject + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _order_cancel_request = d.pop("orderCancelRequest", UNSET) + order_cancel_request: Unset | OrderCancelRequest + if isinstance(_order_cancel_request, Unset): + order_cancel_request = UNSET + else: + order_cancel_request = OrderCancelRequest.from_dict(_order_cancel_request) + + _order_cancel_replace_request = d.pop("orderCancelReplaceRequest", UNSET) + order_cancel_replace_request: Unset | OrderCancelReplaceRequest + if isinstance(_order_cancel_replace_request, Unset): + order_cancel_replace_request = UNSET + else: + order_cancel_replace_request = OrderCancelReplaceRequest.from_dict( + _order_cancel_replace_request + ) + + _multi_leg_order_cancel_replace_request = d.pop( + "multiLegOrderCancelReplaceRequest", UNSET + ) + multi_leg_order_cancel_replace_request: ( + Unset | MultiLegOrderCancelReplaceRequest + ) + if isinstance(_multi_leg_order_cancel_replace_request, Unset): + multi_leg_order_cancel_replace_request = UNSET + else: + multi_leg_order_cancel_replace_request = ( + MultiLegOrderCancelReplaceRequest.from_dict( + _multi_leg_order_cancel_replace_request + ) + ) + + _execution = d.pop("execution", UNSET) + execution: Unset | Execution + if isinstance(_execution, Unset): + execution = UNSET + else: + execution = Execution.from_dict(_execution) + + _order_update = d.pop("orderUpdate", UNSET) + order_update: Unset | OrderUpdate + if isinstance(_order_update, Unset): + order_update = UNSET + else: + order_update = OrderUpdate.from_dict(_order_update) + + _order_delete = d.pop("orderDelete", UNSET) + order_delete: Unset | OrderDelete + if isinstance(_order_delete, Unset): + order_delete = UNSET + else: + order_delete = OrderDelete.from_dict(_order_delete) + + _order_cancel_reject = d.pop("orderCancelReject", UNSET) + order_cancel_reject: Unset | OrderCancelReject + if isinstance(_order_cancel_reject, Unset): + order_cancel_reject = UNSET + else: + order_cancel_reject = OrderCancelReject.from_dict(_order_cancel_reject) + + order_update_event = cls( + order_cancel_request=order_cancel_request, + order_cancel_replace_request=order_cancel_replace_request, + multi_leg_order_cancel_replace_request=multi_leg_order_cancel_replace_request, + execution=execution, + order_update=order_update, + order_delete=order_delete, + order_cancel_reject=order_cancel_reject, + ) + + return order_update_event diff --git a/openapi_project/openapi_package/models/order_update_optional_data.py b/openapi_project/openapi_package/models/order_update_optional_data.py new file mode 100644 index 000000000..6de822e5e --- /dev/null +++ b/openapi_project/openapi_package/models/order_update_optional_data.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="OrderUpdateOptionalData") + + + +@_attrs_define +class OrderUpdateOptionalData: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + order_update_optional_data = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + order_update_optional_data.additional_properties = additional_properties + return order_update_optional_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/origination_type.py b/openapi_project/openapi_package/models/origination_type.py new file mode 100644 index 000000000..e8e7a27f4 --- /dev/null +++ b/openapi_project/openapi_package/models/origination_type.py @@ -0,0 +1,39 @@ +from enum import Enum + + +class OriginationType(str, Enum): + ORIGINATION_TYPE_ADMINISTRATIVE = "ORIGINATION_TYPE_ADMINISTRATIVE" + ORIGINATION_TYPE_API_CHILD_ORDER = "ORIGINATION_TYPE_API_CHILD_ORDER" + ORIGINATION_TYPE_API_ORDER = "ORIGINATION_TYPE_API_ORDER" + ORIGINATION_TYPE_API_ORDER_CANCEL_REPLACE_REQUEST = ( + "ORIGINATION_TYPE_API_ORDER_CANCEL_REPLACE_REQUEST" + ) + ORIGINATION_TYPE_API_ORDER_CANCEL_REQUEST = ( + "ORIGINATION_TYPE_API_ORDER_CANCEL_REQUEST" + ) + ORIGINATION_TYPE_API_PARENT_ORDER = "ORIGINATION_TYPE_API_PARENT_ORDER" + ORIGINATION_TYPE_FIX_FROM_STREET_CHILD_ORDER = ( + "ORIGINATION_TYPE_FIX_FROM_STREET_CHILD_ORDER" + ) + ORIGINATION_TYPE_FIX_FROM_STREET_DROP = "ORIGINATION_TYPE_FIX_FROM_STREET_DROP" + ORIGINATION_TYPE_FIX_FROM_STREET_DROP_ORDER_UPDATE = ( + "ORIGINATION_TYPE_FIX_FROM_STREET_DROP_ORDER_UPDATE" + ) + ORIGINATION_TYPE_FIX_FROM_STREET_ORDER = "ORIGINATION_TYPE_FIX_FROM_STREET_ORDER" + ORIGINATION_TYPE_FIX_FROM_STREET_ORDER_CANCEL_REPLACE_REQUEST = ( + "ORIGINATION_TYPE_FIX_FROM_STREET_ORDER_CANCEL_REPLACE_REQUEST" + ) + ORIGINATION_TYPE_FIX_FROM_STREET_ORDER_CANCEL_REQUEST = ( + "ORIGINATION_TYPE_FIX_FROM_STREET_ORDER_CANCEL_REQUEST" + ) + ORIGINATION_TYPE_FIX_FROM_STREET_ORDER_UPDATE = ( + "ORIGINATION_TYPE_FIX_FROM_STREET_ORDER_UPDATE" + ) + ORIGINATION_TYPE_FIX_FROM_STREET_PARENT_ORDER = ( + "ORIGINATION_TYPE_FIX_FROM_STREET_PARENT_ORDER" + ) + ORIGINATION_TYPE_ORDER_MANAGER = "ORIGINATION_TYPE_ORDER_MANAGER" + ORIGINATION_TYPE_UNKNOWN = "ORIGINATION_TYPE_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/position.py b/openapi_project/openapi_package/models/position.py new file mode 100644 index 000000000..dd3fea1ab --- /dev/null +++ b/openapi_project/openapi_package/models/position.py @@ -0,0 +1,197 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="Position") + + +@_attrs_define +class Position: + """ + Attributes: + account_id (Unset | int): + symbol (Unset | str): + avg_cost (Unset | float): + marked_cost (Unset | float): + net_qty (Unset | float): + notional_value (Unset | float): + opening_cost (Unset | float): + opening_qty (Unset | float): + realized_pn_l (Unset | float): + trading_avg_cost (Unset | float): + trading_buy_avg_price (Unset | float): + trading_buy_qty (Unset | float): + trading_net_qty (Unset | float): + trading_sell_avg_price (Unset | float): + trading_sell_qty (Unset | float): + trading_sell_qty_long (Unset | float): + trading_sell_qty_short (Unset | float): + transact_ts (Unset | str): + """ + + account_id: Unset | int = UNSET + symbol: Unset | str = UNSET + avg_cost: Unset | float = UNSET + marked_cost: Unset | float = UNSET + net_qty: Unset | float = UNSET + notional_value: Unset | float = UNSET + opening_cost: Unset | float = UNSET + opening_qty: Unset | float = UNSET + realized_pn_l: Unset | float = UNSET + trading_avg_cost: Unset | float = UNSET + trading_buy_avg_price: Unset | float = UNSET + trading_buy_qty: Unset | float = UNSET + trading_net_qty: Unset | float = UNSET + trading_sell_avg_price: Unset | float = UNSET + trading_sell_qty: Unset | float = UNSET + trading_sell_qty_long: Unset | float = UNSET + trading_sell_qty_short: Unset | float = UNSET + transact_ts: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + symbol = self.symbol + + avg_cost = self.avg_cost + + marked_cost = self.marked_cost + + net_qty = self.net_qty + + notional_value = self.notional_value + + opening_cost = self.opening_cost + + opening_qty = self.opening_qty + + realized_pn_l = self.realized_pn_l + + trading_avg_cost = self.trading_avg_cost + + trading_buy_avg_price = self.trading_buy_avg_price + + trading_buy_qty = self.trading_buy_qty + + trading_net_qty = self.trading_net_qty + + trading_sell_avg_price = self.trading_sell_avg_price + + trading_sell_qty = self.trading_sell_qty + + trading_sell_qty_long = self.trading_sell_qty_long + + trading_sell_qty_short = self.trading_sell_qty_short + + transact_ts = self.transact_ts + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if symbol is not UNSET: + field_dict["symbol"] = symbol + if avg_cost is not UNSET: + field_dict["avgCost"] = avg_cost + if marked_cost is not UNSET: + field_dict["markedCost"] = marked_cost + if net_qty is not UNSET: + field_dict["netQty"] = net_qty + if notional_value is not UNSET: + field_dict["notionalValue"] = notional_value + if opening_cost is not UNSET: + field_dict["openingCost"] = opening_cost + if opening_qty is not UNSET: + field_dict["openingQty"] = opening_qty + if realized_pn_l is not UNSET: + field_dict["realizedPnL"] = realized_pn_l + if trading_avg_cost is not UNSET: + field_dict["tradingAvgCost"] = trading_avg_cost + if trading_buy_avg_price is not UNSET: + field_dict["tradingBuyAvgPrice"] = trading_buy_avg_price + if trading_buy_qty is not UNSET: + field_dict["tradingBuyQty"] = trading_buy_qty + if trading_net_qty is not UNSET: + field_dict["tradingNetQty"] = trading_net_qty + if trading_sell_avg_price is not UNSET: + field_dict["tradingSellAvgPrice"] = trading_sell_avg_price + if trading_sell_qty is not UNSET: + field_dict["tradingSellQty"] = trading_sell_qty + if trading_sell_qty_long is not UNSET: + field_dict["tradingSellQtyLong"] = trading_sell_qty_long + if trading_sell_qty_short is not UNSET: + field_dict["tradingSellQtyShort"] = trading_sell_qty_short + if transact_ts is not UNSET: + field_dict["transactTs"] = transact_ts + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + symbol = d.pop("symbol", UNSET) + + avg_cost = d.pop("avgCost", UNSET) + + marked_cost = d.pop("markedCost", UNSET) + + net_qty = d.pop("netQty", UNSET) + + notional_value = d.pop("notionalValue", UNSET) + + opening_cost = d.pop("openingCost", UNSET) + + opening_qty = d.pop("openingQty", UNSET) + + realized_pn_l = d.pop("realizedPnL", UNSET) + + trading_avg_cost = d.pop("tradingAvgCost", UNSET) + + trading_buy_avg_price = d.pop("tradingBuyAvgPrice", UNSET) + + trading_buy_qty = d.pop("tradingBuyQty", UNSET) + + trading_net_qty = d.pop("tradingNetQty", UNSET) + + trading_sell_avg_price = d.pop("tradingSellAvgPrice", UNSET) + + trading_sell_qty = d.pop("tradingSellQty", UNSET) + + trading_sell_qty_long = d.pop("tradingSellQtyLong", UNSET) + + trading_sell_qty_short = d.pop("tradingSellQtyShort", UNSET) + + transact_ts = d.pop("transactTs", UNSET) + + position = cls( + account_id=account_id, + symbol=symbol, + avg_cost=avg_cost, + marked_cost=marked_cost, + net_qty=net_qty, + notional_value=notional_value, + opening_cost=opening_cost, + opening_qty=opening_qty, + realized_pn_l=realized_pn_l, + trading_avg_cost=trading_avg_cost, + trading_buy_avg_price=trading_buy_avg_price, + trading_buy_qty=trading_buy_qty, + trading_net_qty=trading_net_qty, + trading_sell_avg_price=trading_sell_avg_price, + trading_sell_qty=trading_sell_qty, + trading_sell_qty_long=trading_sell_qty_long, + trading_sell_qty_short=trading_sell_qty_short, + transact_ts=transact_ts, + ) + + return position diff --git a/openapi_project/openapi_package/models/position_analysis.py b/openapi_project/openapi_package/models/position_analysis.py new file mode 100644 index 000000000..45038504d --- /dev/null +++ b/openapi_project/openapi_package/models/position_analysis.py @@ -0,0 +1,75 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.scenario_theo import ScenarioTheo + from ..models.position_theo import PositionTheo + + +T = TypeVar("T", bound="PositionAnalysis") + + +@_attrs_define +class PositionAnalysis: + """ + Attributes: + position_theo (Unset | PositionTheo): + scenario_theos (Unset | list['ScenarioTheo']): + """ + + position_theo: Unset | "PositionTheo" = UNSET + scenario_theos: Unset | list["ScenarioTheo"] = UNSET + + def to_dict(self) -> dict[str, Any]: + position_theo: Unset | dict[str, Any] = UNSET + if not isinstance(self.position_theo, Unset): + position_theo = self.position_theo.to_dict() + + scenario_theos: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.scenario_theos, Unset): + scenario_theos = [] + for scenario_theos_item_data in self.scenario_theos: + scenario_theos_item = scenario_theos_item_data.to_dict() + scenario_theos.append(scenario_theos_item) + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if position_theo is not UNSET: + field_dict["positionTheo"] = position_theo + if scenario_theos is not UNSET: + field_dict["scenarioTheos"] = scenario_theos + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _position_theo = d.pop("positionTheo", UNSET) + position_theo: Unset | PositionTheo + if isinstance(_position_theo, Unset): + position_theo = UNSET + else: + position_theo = PositionTheo.from_dict(_position_theo) + + scenario_theos = [] + _scenario_theos = d.pop("scenarioTheos", UNSET) + for scenario_theos_item_data in _scenario_theos or []: + scenario_theos_item = ScenarioTheo.from_dict(scenario_theos_item_data) + + scenario_theos.append(scenario_theos_item) + + position_analysis = cls( + position_theo=position_theo, + scenario_theos=scenario_theos, + ) + + return position_analysis diff --git a/openapi_project/openapi_package/models/position_effect.py b/openapi_project/openapi_package/models/position_effect.py new file mode 100644 index 000000000..0441467a8 --- /dev/null +++ b/openapi_project/openapi_package/models/position_effect.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class PositionEffect(str, Enum): + POSITION_EFFECT_AUTO = "POSITION_EFFECT_AUTO" + POSITION_EFFECT_CLOSE = "POSITION_EFFECT_CLOSE" + POSITION_EFFECT_NONE = "POSITION_EFFECT_NONE" + POSITION_EFFECT_OPEN = "POSITION_EFFECT_OPEN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/position_source.py b/openapi_project/openapi_package/models/position_source.py new file mode 100644 index 000000000..881fcceaa --- /dev/null +++ b/openapi_project/openapi_package/models/position_source.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class PositionSource(str, Enum): + POSITION_SOURCE_FROM_PORTFOLIO = "POSITION_SOURCE_FROM_PORTFOLIO" + POSITION_SOURCE_FROM_REQUEST = "POSITION_SOURCE_FROM_REQUEST" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/position_theo.py b/openapi_project/openapi_package/models/position_theo.py new file mode 100644 index 000000000..86d8320ff --- /dev/null +++ b/openapi_project/openapi_package/models/position_theo.py @@ -0,0 +1,208 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.position_theo_leg import PositionTheoLeg + + +T = TypeVar("T", bound="PositionTheo") + + +@_attrs_define +class PositionTheo: + """ + Attributes: + as_of_ts (Unset | str): + delta (Unset | float): + gamma (Unset | float): + legs (Unset | list['PositionTheoLeg']): + max_loss (Unset | float): + max_loss_lsd (Unset | list[float]): + max_profit (Unset | float): + max_profit_lsd (Unset | list[float]): + prem (Unset | float): + price (Unset | float): + profit (Unset | float): + profit_probability (Unset | list[float]): + rho (Unset | float): + theta (Unset | float): + total_value (Unset | float): + vega (Unset | float): + volatility (Unset | float): + """ + + as_of_ts: Unset | str = UNSET + delta: Unset | float = UNSET + gamma: Unset | float = UNSET + legs: Unset | list["PositionTheoLeg"] = UNSET + max_loss: Unset | float = UNSET + max_loss_lsd: Unset | list[float] = UNSET + max_profit: Unset | float = UNSET + max_profit_lsd: Unset | list[float] = UNSET + prem: Unset | float = UNSET + price: Unset | float = UNSET + profit: Unset | float = UNSET + profit_probability: Unset | list[float] = UNSET + rho: Unset | float = UNSET + theta: Unset | float = UNSET + total_value: Unset | float = UNSET + vega: Unset | float = UNSET + volatility: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + as_of_ts = self.as_of_ts + + delta = self.delta + + gamma = self.gamma + + legs: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.legs, Unset): + legs = [] + for legs_item_data in self.legs: + legs_item = legs_item_data.to_dict() + legs.append(legs_item) + + max_loss = self.max_loss + + max_loss_lsd: Unset | list[float] = UNSET + if not isinstance(self.max_loss_lsd, Unset): + max_loss_lsd = self.max_loss_lsd + + max_profit = self.max_profit + + max_profit_lsd: Unset | list[float] = UNSET + if not isinstance(self.max_profit_lsd, Unset): + max_profit_lsd = self.max_profit_lsd + + prem = self.prem + + price = self.price + + profit = self.profit + + profit_probability: Unset | list[float] = UNSET + if not isinstance(self.profit_probability, Unset): + profit_probability = self.profit_probability + + rho = self.rho + + theta = self.theta + + total_value = self.total_value + + vega = self.vega + + volatility = self.volatility + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if as_of_ts is not UNSET: + field_dict["asOfTs"] = as_of_ts + if delta is not UNSET: + field_dict["delta"] = delta + if gamma is not UNSET: + field_dict["gamma"] = gamma + if legs is not UNSET: + field_dict["legs"] = legs + if max_loss is not UNSET: + field_dict["maxLoss"] = max_loss + if max_loss_lsd is not UNSET: + field_dict["maxLossLsd"] = max_loss_lsd + if max_profit is not UNSET: + field_dict["maxProfit"] = max_profit + if max_profit_lsd is not UNSET: + field_dict["maxProfitLsd"] = max_profit_lsd + if prem is not UNSET: + field_dict["prem"] = prem + if price is not UNSET: + field_dict["price"] = price + if profit is not UNSET: + field_dict["profit"] = profit + if profit_probability is not UNSET: + field_dict["profitProbability"] = profit_probability + if rho is not UNSET: + field_dict["rho"] = rho + if theta is not UNSET: + field_dict["theta"] = theta + if total_value is not UNSET: + field_dict["totalValue"] = total_value + if vega is not UNSET: + field_dict["vega"] = vega + if volatility is not UNSET: + field_dict["volatility"] = volatility + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + as_of_ts = d.pop("asOfTs", UNSET) + + delta = d.pop("delta", UNSET) + + gamma = d.pop("gamma", UNSET) + + legs = [] + _legs = d.pop("legs", UNSET) + for legs_item_data in _legs or []: + legs_item = PositionTheoLeg.from_dict(legs_item_data) + + legs.append(legs_item) + + max_loss = d.pop("maxLoss", UNSET) + + max_loss_lsd = cast(list[float], d.pop("maxLossLsd", UNSET)) + + max_profit = d.pop("maxProfit", UNSET) + + max_profit_lsd = cast(list[float], d.pop("maxProfitLsd", UNSET)) + + prem = d.pop("prem", UNSET) + + price = d.pop("price", UNSET) + + profit = d.pop("profit", UNSET) + + profit_probability = cast(list[float], d.pop("profitProbability", UNSET)) + + rho = d.pop("rho", UNSET) + + theta = d.pop("theta", UNSET) + + total_value = d.pop("totalValue", UNSET) + + vega = d.pop("vega", UNSET) + + volatility = d.pop("volatility", UNSET) + + position_theo = cls( + as_of_ts=as_of_ts, + delta=delta, + gamma=gamma, + legs=legs, + max_loss=max_loss, + max_loss_lsd=max_loss_lsd, + max_profit=max_profit, + max_profit_lsd=max_profit_lsd, + prem=prem, + price=price, + profit=profit, + profit_probability=profit_probability, + rho=rho, + theta=theta, + total_value=total_value, + vega=vega, + volatility=volatility, + ) + + return position_theo diff --git a/openapi_project/openapi_package/models/position_theo_leg.py b/openapi_project/openapi_package/models/position_theo_leg.py new file mode 100644 index 000000000..786e4dda7 --- /dev/null +++ b/openapi_project/openapi_package/models/position_theo_leg.py @@ -0,0 +1,159 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + + +T = TypeVar("T", bound="PositionTheoLeg") + + +@_attrs_define +class PositionTheoLeg: + """ + Attributes: + delta (Unset | float): + gamma (Unset | float): + max_loss (Unset | float): + max_loss_lsd (Unset | list[float]): + max_profit (Unset | float): + max_profit_lsd (Unset | list[float]): + prem (Unset | float): + profit (Unset | float): + profit_probability (Unset | list[float]): + rho (Unset | float): + theta (Unset | float): + vega (Unset | float): + volatility (Unset | float): + """ + + delta: Unset | float = UNSET + gamma: Unset | float = UNSET + max_loss: Unset | float = UNSET + max_loss_lsd: Unset | list[float] = UNSET + max_profit: Unset | float = UNSET + max_profit_lsd: Unset | list[float] = UNSET + prem: Unset | float = UNSET + profit: Unset | float = UNSET + profit_probability: Unset | list[float] = UNSET + rho: Unset | float = UNSET + theta: Unset | float = UNSET + vega: Unset | float = UNSET + volatility: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + delta = self.delta + + gamma = self.gamma + + max_loss = self.max_loss + + max_loss_lsd: Unset | list[float] = UNSET + if not isinstance(self.max_loss_lsd, Unset): + max_loss_lsd = self.max_loss_lsd + + max_profit = self.max_profit + + max_profit_lsd: Unset | list[float] = UNSET + if not isinstance(self.max_profit_lsd, Unset): + max_profit_lsd = self.max_profit_lsd + + prem = self.prem + + profit = self.profit + + profit_probability: Unset | list[float] = UNSET + if not isinstance(self.profit_probability, Unset): + profit_probability = self.profit_probability + + rho = self.rho + + theta = self.theta + + vega = self.vega + + volatility = self.volatility + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if delta is not UNSET: + field_dict["delta"] = delta + if gamma is not UNSET: + field_dict["gamma"] = gamma + if max_loss is not UNSET: + field_dict["maxLoss"] = max_loss + if max_loss_lsd is not UNSET: + field_dict["maxLossLsd"] = max_loss_lsd + if max_profit is not UNSET: + field_dict["maxProfit"] = max_profit + if max_profit_lsd is not UNSET: + field_dict["maxProfitLsd"] = max_profit_lsd + if prem is not UNSET: + field_dict["prem"] = prem + if profit is not UNSET: + field_dict["profit"] = profit + if profit_probability is not UNSET: + field_dict["profitProbability"] = profit_probability + if rho is not UNSET: + field_dict["rho"] = rho + if theta is not UNSET: + field_dict["theta"] = theta + if vega is not UNSET: + field_dict["vega"] = vega + if volatility is not UNSET: + field_dict["volatility"] = volatility + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + delta = d.pop("delta", UNSET) + + gamma = d.pop("gamma", UNSET) + + max_loss = d.pop("maxLoss", UNSET) + + max_loss_lsd = cast(list[float], d.pop("maxLossLsd", UNSET)) + + max_profit = d.pop("maxProfit", UNSET) + + max_profit_lsd = cast(list[float], d.pop("maxProfitLsd", UNSET)) + + prem = d.pop("prem", UNSET) + + profit = d.pop("profit", UNSET) + + profit_probability = cast(list[float], d.pop("profitProbability", UNSET)) + + rho = d.pop("rho", UNSET) + + theta = d.pop("theta", UNSET) + + vega = d.pop("vega", UNSET) + + volatility = d.pop("volatility", UNSET) + + position_theo_leg = cls( + delta=delta, + gamma=gamma, + max_loss=max_loss, + max_loss_lsd=max_loss_lsd, + max_profit=max_profit, + max_profit_lsd=max_profit_lsd, + prem=prem, + profit=profit, + profit_probability=profit_probability, + rho=rho, + theta=theta, + vega=vega, + volatility=volatility, + ) + + return position_theo_leg diff --git a/openapi_project/openapi_package/models/price_type.py b/openapi_project/openapi_package/models/price_type.py new file mode 100644 index 000000000..c277980ed --- /dev/null +++ b/openapi_project/openapi_package/models/price_type.py @@ -0,0 +1,14 @@ +from enum import Enum + + +class PriceType(str, Enum): + PRICE_TYPE_CABINET = "PRICE_TYPE_CABINET" + PRICE_TYPE_D_A_C = "PRICE_TYPE_D_A_C" + PRICE_TYPE_FIXED_AMT = "PRICE_TYPE_FIXED_AMT" + PRICE_TYPE_PERCENTAGE = "PRICE_TYPE_PERCENTAGE" + PRICE_TYPE_PER_UNIT = "PRICE_TYPE_PER_UNIT" + PRICE_TYPE_UNKNOWN = "PRICE_TYPE_UNKNOWN" + PRICE_TYPE_YIELD = "PRICE_TYPE_YIELD" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/product_group.py b/openapi_project/openapi_package/models/product_group.py new file mode 100644 index 000000000..aa90857b8 --- /dev/null +++ b/openapi_project/openapi_package/models/product_group.py @@ -0,0 +1,19 @@ +from enum import Enum + + +class ProductGroup(str, Enum): + PRODUCT_GROUP_AGRICULTURAL = "PRODUCT_GROUP_AGRICULTURAL" + PRODUCT_GROUP_ALTERNATIVE_MARKETS = "PRODUCT_GROUP_ALTERNATIVE_MARKETS" + PRODUCT_GROUP_CURRENCY = "PRODUCT_GROUP_CURRENCY" + PRODUCT_GROUP_ENERGY = "PRODUCT_GROUP_ENERGY" + PRODUCT_GROUP_EQUITIES = "PRODUCT_GROUP_EQUITIES" + PRODUCT_GROUP_FINANCIAL = "PRODUCT_GROUP_FINANCIAL" + PRODUCT_GROUP_INDEX = "PRODUCT_GROUP_INDEX" + PRODUCT_GROUP_INTEREST_RATE = "PRODUCT_GROUP_INTEREST_RATE" + PRODUCT_GROUP_METAL = "PRODUCT_GROUP_METAL" + PRODUCT_GROUP_REAL_ESTATE = "PRODUCT_GROUP_REAL_ESTATE" + PRODUCT_GROUP_UNKNOWN = "PRODUCT_GROUP_UNKNOWN" + PRODUCT_GROUP_WEATHER = "PRODUCT_GROUP_WEATHER" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/product_sub_group.py b/openapi_project/openapi_package/models/product_sub_group.py new file mode 100644 index 000000000..5acb9ee95 --- /dev/null +++ b/openapi_project/openapi_package/models/product_sub_group.py @@ -0,0 +1,8 @@ +from enum import Enum + + +class ProductSubGroup(str, Enum): + PRODUCT_SUB_GROUP_UNKNOWN = "PRODUCT_SUB_GROUP_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/put_call.py b/openapi_project/openapi_package/models/put_call.py new file mode 100644 index 000000000..680cfcf36 --- /dev/null +++ b/openapi_project/openapi_package/models/put_call.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class PutCall(str, Enum): + PUT_CALL_CALL = "PUT_CALL_CALL" + PUT_CALL_PUT = "PUT_CALL_PUT" + PUT_CALL_UNDEFINED = "PUT_CALL_UNDEFINED" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/risk_calculation_type.py b/openapi_project/openapi_package/models/risk_calculation_type.py new file mode 100644 index 000000000..1b51d3094 --- /dev/null +++ b/openapi_project/openapi_package/models/risk_calculation_type.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class RiskCalculationType(str, Enum): + RISK_CALCULATION_TYPE_ACCOUNT = "RISK_CALCULATION_TYPE_ACCOUNT" + RISK_CALCULATION_TYPE_TRADING_FIRM = "RISK_CALCULATION_TYPE_TRADING_FIRM" + RISK_CALCULATION_TYPE_UNKNOWN = "RISK_CALCULATION_TYPE_UNKNOWN" + RISK_CALCULATION_TYPE_USER = "RISK_CALCULATION_TYPE_USER" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/risk_eval_mode.py b/openapi_project/openapi_package/models/risk_eval_mode.py new file mode 100644 index 000000000..c44b177fd --- /dev/null +++ b/openapi_project/openapi_package/models/risk_eval_mode.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class RiskEvalMode(str, Enum): + RISK_EVAL_MODE_END_OF_DAY = "RISK_EVAL_MODE_END_OF_DAY" + RISK_EVAL_MODE_REAL_TIME = "RISK_EVAL_MODE_REAL_TIME" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/risk_radar_account_group.py b/openapi_project/openapi_package/models/risk_radar_account_group.py new file mode 100644 index 000000000..a794fb36a --- /dev/null +++ b/openapi_project/openapi_package/models/risk_radar_account_group.py @@ -0,0 +1,115 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.currency import Currency +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.shock_value import ShockValue + from ..models.risk_radar_product_group import RiskRadarProductGroup + + +T = TypeVar("T", bound="RiskRadarAccountGroup") + + +@_attrs_define +class RiskRadarAccountGroup: + """ + Attributes: + account_id (Unset | int): + currency (Unset | Currency): + nav (Unset | float): + product_groups (Unset | list['RiskRadarProductGroup']): + shock_values (Unset | list['ShockValue']): + """ + + account_id: Unset | int = UNSET + currency: Unset | Currency = UNSET + nav: Unset | float = UNSET + product_groups: Unset | list["RiskRadarProductGroup"] = UNSET + shock_values: Unset | list["ShockValue"] = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + nav = self.nav + + product_groups: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.product_groups, Unset): + product_groups = [] + for product_groups_item_data in self.product_groups: + product_groups_item = product_groups_item_data.to_dict() + product_groups.append(product_groups_item) + + shock_values: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.shock_values, Unset): + shock_values = [] + for shock_values_item_data in self.shock_values: + shock_values_item = shock_values_item_data.to_dict() + shock_values.append(shock_values_item) + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if currency is not UNSET: + field_dict["currency"] = currency + if nav is not UNSET: + field_dict["nav"] = nav + if product_groups is not UNSET: + field_dict["productGroups"] = product_groups + if shock_values is not UNSET: + field_dict["shockValues"] = shock_values + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + nav = d.pop("nav", UNSET) + + product_groups = [] + _product_groups = d.pop("productGroups", UNSET) + for product_groups_item_data in _product_groups or []: + product_groups_item = RiskRadarProductGroup.from_dict( + product_groups_item_data + ) + + product_groups.append(product_groups_item) + + shock_values = [] + _shock_values = d.pop("shockValues", UNSET) + for shock_values_item_data in _shock_values or []: + shock_values_item = ShockValue.from_dict(shock_values_item_data) + + shock_values.append(shock_values_item) + + risk_radar_account_group = cls( + account_id=account_id, + currency=currency, + nav=nav, + product_groups=product_groups, + shock_values=shock_values, + ) + + return risk_radar_account_group diff --git a/openapi_project/openapi_package/models/risk_radar_class_group.py b/openapi_project/openapi_package/models/risk_radar_class_group.py new file mode 100644 index 000000000..19fc1aa09 --- /dev/null +++ b/openapi_project/openapi_package/models/risk_radar_class_group.py @@ -0,0 +1,179 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.shock_value import ShockValue + from ..models.risk_radar_position import RiskRadarPosition + + +T = TypeVar("T", bound="RiskRadarClassGroup") + + +@_attrs_define +class RiskRadarClassGroup: + """ + Attributes: + delta (Unset | float): + dollar_delta (Unset | float): + dollar_gamma (Unset | float): + gamma (Unset | float): + nav (Unset | float): + price (Unset | float): + rho (Unset | float): + shock_keys (Unset | list[float]): + shock_values (Unset | list['ShockValue']): + symbol (Unset | str): + theta (Unset | float): + vega (Unset | float): + positions (Unset | list['RiskRadarPosition']): + """ + + delta: Unset | float = UNSET + dollar_delta: Unset | float = UNSET + dollar_gamma: Unset | float = UNSET + gamma: Unset | float = UNSET + nav: Unset | float = UNSET + price: Unset | float = UNSET + rho: Unset | float = UNSET + shock_keys: Unset | list[float] = UNSET + shock_values: Unset | list["ShockValue"] = UNSET + symbol: Unset | str = UNSET + theta: Unset | float = UNSET + vega: Unset | float = UNSET + positions: Unset | list["RiskRadarPosition"] = UNSET + + def to_dict(self) -> dict[str, Any]: + delta = self.delta + + dollar_delta = self.dollar_delta + + dollar_gamma = self.dollar_gamma + + gamma = self.gamma + + nav = self.nav + + price = self.price + + rho = self.rho + + shock_keys: Unset | list[float] = UNSET + if not isinstance(self.shock_keys, Unset): + shock_keys = self.shock_keys + + shock_values: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.shock_values, Unset): + shock_values = [] + for shock_values_item_data in self.shock_values: + shock_values_item = shock_values_item_data.to_dict() + shock_values.append(shock_values_item) + + symbol = self.symbol + + theta = self.theta + + vega = self.vega + + positions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.positions, Unset): + positions = [] + for positions_item_data in self.positions: + positions_item = positions_item_data.to_dict() + positions.append(positions_item) + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if delta is not UNSET: + field_dict["delta"] = delta + if dollar_delta is not UNSET: + field_dict["dollarDelta"] = dollar_delta + if dollar_gamma is not UNSET: + field_dict["dollarGamma"] = dollar_gamma + if gamma is not UNSET: + field_dict["gamma"] = gamma + if nav is not UNSET: + field_dict["nav"] = nav + if price is not UNSET: + field_dict["price"] = price + if rho is not UNSET: + field_dict["rho"] = rho + if shock_keys is not UNSET: + field_dict["shockKeys"] = shock_keys + if shock_values is not UNSET: + field_dict["shockValues"] = shock_values + if symbol is not UNSET: + field_dict["symbol"] = symbol + if theta is not UNSET: + field_dict["theta"] = theta + if vega is not UNSET: + field_dict["vega"] = vega + if positions is not UNSET: + field_dict["positions"] = positions + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + delta = d.pop("delta", UNSET) + + dollar_delta = d.pop("dollarDelta", UNSET) + + dollar_gamma = d.pop("dollarGamma", UNSET) + + gamma = d.pop("gamma", UNSET) + + nav = d.pop("nav", UNSET) + + price = d.pop("price", UNSET) + + rho = d.pop("rho", UNSET) + + shock_keys = cast(list[float], d.pop("shockKeys", UNSET)) + + shock_values = [] + _shock_values = d.pop("shockValues", UNSET) + for shock_values_item_data in _shock_values or []: + shock_values_item = ShockValue.from_dict(shock_values_item_data) + + shock_values.append(shock_values_item) + + symbol = d.pop("symbol", UNSET) + + theta = d.pop("theta", UNSET) + + vega = d.pop("vega", UNSET) + + positions = [] + _positions = d.pop("positions", UNSET) + for positions_item_data in _positions or []: + positions_item = RiskRadarPosition.from_dict(positions_item_data) + + positions.append(positions_item) + + risk_radar_class_group = cls( + delta=delta, + dollar_delta=dollar_delta, + dollar_gamma=dollar_gamma, + gamma=gamma, + nav=nav, + price=price, + rho=rho, + shock_keys=shock_keys, + shock_values=shock_values, + symbol=symbol, + theta=theta, + vega=vega, + positions=positions, + ) + + return risk_radar_class_group diff --git a/openapi_project/openapi_package/models/risk_radar_data.py b/openapi_project/openapi_package/models/risk_radar_data.py new file mode 100644 index 000000000..44599568a --- /dev/null +++ b/openapi_project/openapi_package/models/risk_radar_data.py @@ -0,0 +1,69 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.risk_radar_account_group import RiskRadarAccountGroup + + +T = TypeVar("T", bound="RiskRadarData") + + +@_attrs_define +class RiskRadarData: + """ + Attributes: + risks_result (Unset | list['RiskRadarAccountGroup']): + shock_keys (Unset | list[str]): + """ + + risks_result: Unset | list["RiskRadarAccountGroup"] = UNSET + shock_keys: Unset | list[str] = UNSET + + def to_dict(self) -> dict[str, Any]: + risks_result: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.risks_result, Unset): + risks_result = [] + for risks_result_item_data in self.risks_result: + risks_result_item = risks_result_item_data.to_dict() + risks_result.append(risks_result_item) + + shock_keys: Unset | list[str] = UNSET + if not isinstance(self.shock_keys, Unset): + shock_keys = self.shock_keys + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if risks_result is not UNSET: + field_dict["risksResult"] = risks_result + if shock_keys is not UNSET: + field_dict["shockKeys"] = shock_keys + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + risks_result = [] + _risks_result = d.pop("risksResult", UNSET) + for risks_result_item_data in _risks_result or []: + risks_result_item = RiskRadarAccountGroup.from_dict(risks_result_item_data) + + risks_result.append(risks_result_item) + + shock_keys = cast(list[str], d.pop("shockKeys", UNSET)) + + risk_radar_data = cls( + risks_result=risks_result, + shock_keys=shock_keys, + ) + + return risk_radar_data diff --git a/openapi_project/openapi_package/models/risk_radar_position.py b/openapi_project/openapi_package/models/risk_radar_position.py new file mode 100644 index 000000000..0d0793192 --- /dev/null +++ b/openapi_project/openapi_package/models/risk_radar_position.py @@ -0,0 +1,184 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.shock_value import ShockValue + + +T = TypeVar("T", bound="RiskRadarPosition") + + +@_attrs_define +class RiskRadarPosition: + """ + Attributes: + delta (Unset | float): + dollar_delta (Unset | float): + dollar_gamma (Unset | float): + gamma (Unset | float): + nav (Unset | float): + price (Unset | float): + p_zero (Unset | float): + rho (Unset | float): + shock_values (Unset | list['ShockValue']): + symbol (Unset | str): + theta (Unset | float): + vega (Unset | float): + rpg_root (Unset | str): + qty (Unset | float): + implied_volatility (Unset | float): + """ + + delta: Unset | float = UNSET + dollar_delta: Unset | float = UNSET + dollar_gamma: Unset | float = UNSET + gamma: Unset | float = UNSET + nav: Unset | float = UNSET + price: Unset | float = UNSET + p_zero: Unset | float = UNSET + rho: Unset | float = UNSET + shock_values: Unset | list["ShockValue"] = UNSET + symbol: Unset | str = UNSET + theta: Unset | float = UNSET + vega: Unset | float = UNSET + rpg_root: Unset | str = UNSET + qty: Unset | float = UNSET + implied_volatility: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + delta = self.delta + + dollar_delta = self.dollar_delta + + dollar_gamma = self.dollar_gamma + + gamma = self.gamma + + nav = self.nav + + price = self.price + + p_zero = self.p_zero + + rho = self.rho + + shock_values: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.shock_values, Unset): + shock_values = [] + for shock_values_item_data in self.shock_values: + shock_values_item = shock_values_item_data.to_dict() + shock_values.append(shock_values_item) + + symbol = self.symbol + + theta = self.theta + + vega = self.vega + + rpg_root = self.rpg_root + + qty = self.qty + + implied_volatility = self.implied_volatility + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if delta is not UNSET: + field_dict["delta"] = delta + if dollar_delta is not UNSET: + field_dict["dollarDelta"] = dollar_delta + if dollar_gamma is not UNSET: + field_dict["dollarGamma"] = dollar_gamma + if gamma is not UNSET: + field_dict["gamma"] = gamma + if nav is not UNSET: + field_dict["nav"] = nav + if price is not UNSET: + field_dict["price"] = price + if p_zero is not UNSET: + field_dict["pZero"] = p_zero + if rho is not UNSET: + field_dict["rho"] = rho + if shock_values is not UNSET: + field_dict["shockValues"] = shock_values + if symbol is not UNSET: + field_dict["symbol"] = symbol + if theta is not UNSET: + field_dict["theta"] = theta + if vega is not UNSET: + field_dict["vega"] = vega + if rpg_root is not UNSET: + field_dict["rpgRoot"] = rpg_root + if qty is not UNSET: + field_dict["qty"] = qty + if implied_volatility is not UNSET: + field_dict["impliedVolatility"] = implied_volatility + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + delta = d.pop("delta", UNSET) + + dollar_delta = d.pop("dollarDelta", UNSET) + + dollar_gamma = d.pop("dollarGamma", UNSET) + + gamma = d.pop("gamma", UNSET) + + nav = d.pop("nav", UNSET) + + price = d.pop("price", UNSET) + + p_zero = d.pop("pZero", UNSET) + + rho = d.pop("rho", UNSET) + + shock_values = [] + _shock_values = d.pop("shockValues", UNSET) + for shock_values_item_data in _shock_values or []: + shock_values_item = ShockValue.from_dict(shock_values_item_data) + + shock_values.append(shock_values_item) + + symbol = d.pop("symbol", UNSET) + + theta = d.pop("theta", UNSET) + + vega = d.pop("vega", UNSET) + + rpg_root = d.pop("rpgRoot", UNSET) + + qty = d.pop("qty", UNSET) + + implied_volatility = d.pop("impliedVolatility", UNSET) + + risk_radar_position = cls( + delta=delta, + dollar_delta=dollar_delta, + dollar_gamma=dollar_gamma, + gamma=gamma, + nav=nav, + price=price, + p_zero=p_zero, + rho=rho, + shock_values=shock_values, + symbol=symbol, + theta=theta, + vega=vega, + rpg_root=rpg_root, + qty=qty, + implied_volatility=implied_volatility, + ) + + return risk_radar_position diff --git a/openapi_project/openapi_package/models/risk_radar_product_group.py b/openapi_project/openapi_package/models/risk_radar_product_group.py new file mode 100644 index 000000000..88be9c2b7 --- /dev/null +++ b/openapi_project/openapi_package/models/risk_radar_product_group.py @@ -0,0 +1,105 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.shock_value import ShockValue + from ..models.risk_radar_class_group import RiskRadarClassGroup + + +T = TypeVar("T", bound="RiskRadarProductGroup") + + +@_attrs_define +class RiskRadarProductGroup: + """ + Attributes: + group (Unset | str): + nav (Unset | float): + class_groups (Unset | list['RiskRadarClassGroup']): + product_id (Unset | str): + shock_values (Unset | list['ShockValue']): + """ + + group: Unset | str = UNSET + nav: Unset | float = UNSET + class_groups: Unset | list["RiskRadarClassGroup"] = UNSET + product_id: Unset | str = UNSET + shock_values: Unset | list["ShockValue"] = UNSET + + def to_dict(self) -> dict[str, Any]: + group = self.group + + nav = self.nav + + class_groups: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.class_groups, Unset): + class_groups = [] + for class_groups_item_data in self.class_groups: + class_groups_item = class_groups_item_data.to_dict() + class_groups.append(class_groups_item) + + product_id = self.product_id + + shock_values: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.shock_values, Unset): + shock_values = [] + for shock_values_item_data in self.shock_values: + shock_values_item = shock_values_item_data.to_dict() + shock_values.append(shock_values_item) + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if group is not UNSET: + field_dict["group"] = group + if nav is not UNSET: + field_dict["nav"] = nav + if class_groups is not UNSET: + field_dict["classGroups"] = class_groups + if product_id is not UNSET: + field_dict["productId"] = product_id + if shock_values is not UNSET: + field_dict["shockValues"] = shock_values + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + group = d.pop("group", UNSET) + + nav = d.pop("nav", UNSET) + + class_groups = [] + _class_groups = d.pop("classGroups", UNSET) + for class_groups_item_data in _class_groups or []: + class_groups_item = RiskRadarClassGroup.from_dict(class_groups_item_data) + + class_groups.append(class_groups_item) + + product_id = d.pop("productId", UNSET) + + shock_values = [] + _shock_values = d.pop("shockValues", UNSET) + for shock_values_item_data in _shock_values or []: + shock_values_item = ShockValue.from_dict(shock_values_item_data) + + shock_values.append(shock_values_item) + + risk_radar_product_group = cls( + group=group, + nav=nav, + class_groups=class_groups, + product_id=product_id, + shock_values=shock_values, + ) + + return risk_radar_product_group diff --git a/openapi_project/openapi_package/models/risk_radar_request.py b/openapi_project/openapi_package/models/risk_radar_request.py new file mode 100644 index 000000000..e441751be --- /dev/null +++ b/openapi_project/openapi_package/models/risk_radar_request.py @@ -0,0 +1,194 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.position_source import PositionSource +from ..models.risk_eval_mode import RiskEvalMode +from ..models.risk_radar_scenario_order import RiskRadarScenarioOrder +from ..models.volatility_shock_skew import VolatilityShockSkew +from ..models.volatility_shock_type import VolatilityShockType +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.risk_radar_request_position_list import RiskRadarRequestPositionList + + +T = TypeVar("T", bound="RiskRadarRequest") + + +@_attrs_define +class RiskRadarRequest: + """ + Attributes: + account_ids (Unset | list[int]): + positions_by_account_id (Unset | list['RiskRadarRequestPositionList']): + source (Unset | PositionSource): + range_ (Unset | float): + timestep (Unset | str): + scenario_order (Unset | RiskRadarScenarioOrder): + eval_mode (Unset | RiskEvalMode): + implied_volatility (Unset | float): + volatility_shock_skew (Unset | VolatilityShockSkew): + volatility_shock_type (Unset | VolatilityShockType): + exclude_expired_contracts (Unset | bool): + """ + + account_ids: Unset | list[int] = UNSET + positions_by_account_id: Unset | list["RiskRadarRequestPositionList"] = UNSET + source: Unset | PositionSource = UNSET + range_: Unset | float = UNSET + timestep: Unset | str = UNSET + scenario_order: Unset | RiskRadarScenarioOrder = UNSET + eval_mode: Unset | RiskEvalMode = UNSET + implied_volatility: Unset | float = UNSET + volatility_shock_skew: Unset | VolatilityShockSkew = UNSET + volatility_shock_type: Unset | VolatilityShockType = UNSET + exclude_expired_contracts: Unset | bool = UNSET + + def to_dict(self) -> dict[str, Any]: + account_ids: Unset | list[int] = UNSET + if not isinstance(self.account_ids, Unset): + account_ids = self.account_ids + + positions_by_account_id: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.positions_by_account_id, Unset): + positions_by_account_id = [] + for positions_by_account_id_item_data in self.positions_by_account_id: + positions_by_account_id_item = ( + positions_by_account_id_item_data.to_dict() + ) + positions_by_account_id.append(positions_by_account_id_item) + + source: Unset | str = UNSET + if not isinstance(self.source, Unset): + source = self.source.value + + range_ = self.range_ + + timestep = self.timestep + + scenario_order: Unset | str = UNSET + if not isinstance(self.scenario_order, Unset): + scenario_order = self.scenario_order.value + + eval_mode: Unset | str = UNSET + if not isinstance(self.eval_mode, Unset): + eval_mode = self.eval_mode.value + + implied_volatility = self.implied_volatility + + volatility_shock_skew: Unset | str = UNSET + if not isinstance(self.volatility_shock_skew, Unset): + volatility_shock_skew = self.volatility_shock_skew.value + + volatility_shock_type: Unset | str = UNSET + if not isinstance(self.volatility_shock_type, Unset): + volatility_shock_type = self.volatility_shock_type.value + + exclude_expired_contracts = self.exclude_expired_contracts + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_ids is not UNSET: + field_dict["accountIds"] = account_ids + if positions_by_account_id is not UNSET: + field_dict["positionsByAccountId"] = positions_by_account_id + if source is not UNSET: + field_dict["source"] = source + if range_ is not UNSET: + field_dict["range"] = range_ + if timestep is not UNSET: + field_dict["timestep"] = timestep + if scenario_order is not UNSET: + field_dict["scenarioOrder"] = scenario_order + if eval_mode is not UNSET: + field_dict["evalMode"] = eval_mode + if implied_volatility is not UNSET: + field_dict["impliedVolatility"] = implied_volatility + if volatility_shock_skew is not UNSET: + field_dict["volatilityShockSkew"] = volatility_shock_skew + if volatility_shock_type is not UNSET: + field_dict["volatilityShockType"] = volatility_shock_type + if exclude_expired_contracts is not UNSET: + field_dict["excludeExpiredContracts"] = exclude_expired_contracts + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_ids = cast(list[int], d.pop("accountIds", UNSET)) + + positions_by_account_id = [] + _positions_by_account_id = d.pop("positionsByAccountId", UNSET) + for positions_by_account_id_item_data in _positions_by_account_id or []: + positions_by_account_id_item = RiskRadarRequestPositionList.from_dict( + positions_by_account_id_item_data + ) + + positions_by_account_id.append(positions_by_account_id_item) + + _source = d.pop("source", UNSET) + source: Unset | PositionSource + if isinstance(_source, Unset): + source = UNSET + else: + source = PositionSource(_source) + + range_ = d.pop("range", UNSET) + + timestep = d.pop("timestep", UNSET) + + _scenario_order = d.pop("scenarioOrder", UNSET) + scenario_order: Unset | RiskRadarScenarioOrder + if isinstance(_scenario_order, Unset): + scenario_order = UNSET + else: + scenario_order = RiskRadarScenarioOrder(_scenario_order) + + _eval_mode = d.pop("evalMode", UNSET) + eval_mode: Unset | RiskEvalMode + if isinstance(_eval_mode, Unset): + eval_mode = UNSET + else: + eval_mode = RiskEvalMode(_eval_mode) + + implied_volatility = d.pop("impliedVolatility", UNSET) + + _volatility_shock_skew = d.pop("volatilityShockSkew", UNSET) + volatility_shock_skew: Unset | VolatilityShockSkew + if isinstance(_volatility_shock_skew, Unset): + volatility_shock_skew = UNSET + else: + volatility_shock_skew = VolatilityShockSkew(_volatility_shock_skew) + + _volatility_shock_type = d.pop("volatilityShockType", UNSET) + volatility_shock_type: Unset | VolatilityShockType + if isinstance(_volatility_shock_type, Unset): + volatility_shock_type = UNSET + else: + volatility_shock_type = VolatilityShockType(_volatility_shock_type) + + exclude_expired_contracts = d.pop("excludeExpiredContracts", UNSET) + + risk_radar_request = cls( + account_ids=account_ids, + positions_by_account_id=positions_by_account_id, + source=source, + range_=range_, + timestep=timestep, + scenario_order=scenario_order, + eval_mode=eval_mode, + implied_volatility=implied_volatility, + volatility_shock_skew=volatility_shock_skew, + volatility_shock_type=volatility_shock_type, + exclude_expired_contracts=exclude_expired_contracts, + ) + + return risk_radar_request diff --git a/openapi_project/openapi_package/models/risk_radar_request_position.py b/openapi_project/openapi_package/models/risk_radar_request_position.py new file mode 100644 index 000000000..245f8eaec --- /dev/null +++ b/openapi_project/openapi_package/models/risk_radar_request_position.py @@ -0,0 +1,62 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="RiskRadarRequestPosition") + + +@_attrs_define +class RiskRadarRequestPosition: + """ + Attributes: + is_simulated_position (Unset | bool): + qty (Unset | float): + symbol (Unset | str): + """ + + is_simulated_position: Unset | bool = UNSET + qty: Unset | float = UNSET + symbol: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + is_simulated_position = self.is_simulated_position + + qty = self.qty + + symbol = self.symbol + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if is_simulated_position is not UNSET: + field_dict["isSimulatedPosition"] = is_simulated_position + if qty is not UNSET: + field_dict["qty"] = qty + if symbol is not UNSET: + field_dict["symbol"] = symbol + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + is_simulated_position = d.pop("isSimulatedPosition", UNSET) + + qty = d.pop("qty", UNSET) + + symbol = d.pop("symbol", UNSET) + + risk_radar_request_position = cls( + is_simulated_position=is_simulated_position, + qty=qty, + symbol=symbol, + ) + + return risk_radar_request_position diff --git a/openapi_project/openapi_package/models/risk_radar_request_position_list.py b/openapi_project/openapi_package/models/risk_radar_request_position_list.py new file mode 100644 index 000000000..d68af186c --- /dev/null +++ b/openapi_project/openapi_package/models/risk_radar_request_position_list.py @@ -0,0 +1,67 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.risk_radar_request_position import RiskRadarRequestPosition + + +T = TypeVar("T", bound="RiskRadarRequestPositionList") + + +@_attrs_define +class RiskRadarRequestPositionList: + """ + Attributes: + account_id (Unset | int): + positions (Unset | list['RiskRadarRequestPosition']): + """ + + account_id: Unset | int = UNSET + positions: Unset | list["RiskRadarRequestPosition"] = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + positions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.positions, Unset): + positions = [] + for positions_item_data in self.positions: + positions_item = positions_item_data.to_dict() + positions.append(positions_item) + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if positions is not UNSET: + field_dict["positions"] = positions + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + positions = [] + _positions = d.pop("positions", UNSET) + for positions_item_data in _positions or []: + positions_item = RiskRadarRequestPosition.from_dict(positions_item_data) + + positions.append(positions_item) + + risk_radar_request_position_list = cls( + account_id=account_id, + positions=positions, + ) + + return risk_radar_request_position_list diff --git a/openapi_project/openapi_package/models/risk_radar_response.py b/openapi_project/openapi_package/models/risk_radar_response.py new file mode 100644 index 000000000..e3f7e8629 --- /dev/null +++ b/openapi_project/openapi_package/models/risk_radar_response.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.risk_radar_data import RiskRadarData + + +T = TypeVar("T", bound="RiskRadarResponse") + + +@_attrs_define +class RiskRadarResponse: + """ + Attributes: + result (Unset | RiskRadarData): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + result: Unset | "RiskRadarData" = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + result: Unset | dict[str, Any] = UNSET + if not isinstance(self.result, Unset): + result = self.result.to_dict() + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if result is not UNSET: + field_dict["result"] = result + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _result = d.pop("result", UNSET) + result: Unset | RiskRadarData + if isinstance(_result, Unset): + result = UNSET + else: + result = RiskRadarData.from_dict(_result) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + risk_radar_response = cls( + result=result, + error_message=error_message, + status_code=status_code, + ) + + return risk_radar_response diff --git a/openapi_project/openapi_package/models/risk_radar_scenario_order.py b/openapi_project/openapi_package/models/risk_radar_scenario_order.py new file mode 100644 index 000000000..99a247430 --- /dev/null +++ b/openapi_project/openapi_package/models/risk_radar_scenario_order.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class RiskRadarScenarioOrder(str, Enum): + RISK_RADAR_SCENARIO_ORDER_SHOCK_FIRST = "RISK_RADAR_SCENARIO_ORDER_SHOCK_FIRST" + RISK_RADAR_SCENARIO_ORDER_STEP_FIRST = "RISK_RADAR_SCENARIO_ORDER_STEP_FIRST" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/risk_reject.py b/openapi_project/openapi_package/models/risk_reject.py new file mode 100644 index 000000000..23feb71b8 --- /dev/null +++ b/openapi_project/openapi_package/models/risk_reject.py @@ -0,0 +1,141 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.risk_calculation_type import RiskCalculationType +from ..models.risk_reject_type import RiskRejectType +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="RiskReject") + + +@_attrs_define +class RiskReject: + """ + Attributes: + account_id (Unset | int): + guid (Unset | str): + id (Unset | int): + is_overridden (Unset | bool): + message (Unset | str): + order_id (Unset | str): + transact_ts (Unset | str): + calculation_type (Unset | RiskCalculationType): + reject_type (Unset | RiskRejectType): + user_id (Unset | int): + """ + + account_id: Unset | int = UNSET + guid: Unset | str = UNSET + id: Unset | int = UNSET + is_overridden: Unset | bool = UNSET + message: Unset | str = UNSET + order_id: Unset | str = UNSET + transact_ts: Unset | str = UNSET + calculation_type: Unset | RiskCalculationType = UNSET + reject_type: Unset | RiskRejectType = UNSET + user_id: Unset | int = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + guid = self.guid + + id = self.id + + is_overridden = self.is_overridden + + message = self.message + + order_id = self.order_id + + transact_ts = self.transact_ts + + calculation_type: Unset | str = UNSET + if not isinstance(self.calculation_type, Unset): + calculation_type = self.calculation_type.value + + reject_type: Unset | str = UNSET + if not isinstance(self.reject_type, Unset): + reject_type = self.reject_type.value + + user_id = self.user_id + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if guid is not UNSET: + field_dict["guid"] = guid + if id is not UNSET: + field_dict["id"] = id + if is_overridden is not UNSET: + field_dict["isOverridden"] = is_overridden + if message is not UNSET: + field_dict["message"] = message + if order_id is not UNSET: + field_dict["orderId"] = order_id + if transact_ts is not UNSET: + field_dict["transactTs"] = transact_ts + if calculation_type is not UNSET: + field_dict["calculationType"] = calculation_type + if reject_type is not UNSET: + field_dict["rejectType"] = reject_type + if user_id is not UNSET: + field_dict["userId"] = user_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + guid = d.pop("guid", UNSET) + + id = d.pop("id", UNSET) + + is_overridden = d.pop("isOverridden", UNSET) + + message = d.pop("message", UNSET) + + order_id = d.pop("orderId", UNSET) + + transact_ts = d.pop("transactTs", UNSET) + + _calculation_type = d.pop("calculationType", UNSET) + calculation_type: Unset | RiskCalculationType + if isinstance(_calculation_type, Unset): + calculation_type = UNSET + else: + calculation_type = RiskCalculationType(_calculation_type) + + _reject_type = d.pop("rejectType", UNSET) + reject_type: Unset | RiskRejectType + if isinstance(_reject_type, Unset): + reject_type = UNSET + else: + reject_type = RiskRejectType(_reject_type) + + user_id = d.pop("userId", UNSET) + + risk_reject = cls( + account_id=account_id, + guid=guid, + id=id, + is_overridden=is_overridden, + message=message, + order_id=order_id, + transact_ts=transact_ts, + calculation_type=calculation_type, + reject_type=reject_type, + user_id=user_id, + ) + + return risk_reject diff --git a/openapi_project/openapi_package/models/risk_reject_type.py b/openapi_project/openapi_package/models/risk_reject_type.py new file mode 100644 index 000000000..eed836c58 --- /dev/null +++ b/openapi_project/openapi_package/models/risk_reject_type.py @@ -0,0 +1,120 @@ +from enum import Enum + + +class RiskRejectType(str, Enum): + RISK_REJECT_TYPE_ACCOUNT_INACTIVE = "RISK_REJECT_TYPE_ACCOUNT_INACTIVE" + RISK_REJECT_TYPE_ACCOUNT_IN_LIQUIDATION = "RISK_REJECT_TYPE_ACCOUNT_IN_LIQUIDATION" + RISK_REJECT_TYPE_ACCOUNT_MAX_LOSS = "RISK_REJECT_TYPE_ACCOUNT_MAX_LOSS" + RISK_REJECT_TYPE_ALLOW_CRYPTO_ORDER_MARKET = ( + "RISK_REJECT_TYPE_ALLOW_CRYPTO_ORDER_MARKET" + ) + RISK_REJECT_TYPE_ALLOW_EQ_ORDER_LONG_SALE = ( + "RISK_REJECT_TYPE_ALLOW_EQ_ORDER_LONG_SALE" + ) + RISK_REJECT_TYPE_ALLOW_EQ_ORDER_MARKET = "RISK_REJECT_TYPE_ALLOW_EQ_ORDER_MARKET" + RISK_REJECT_TYPE_ALLOW_FUT_ORDER_MARKET = "RISK_REJECT_TYPE_ALLOW_FUT_ORDER_MARKET" + RISK_REJECT_TYPE_ALLOW_LOCATE_ID_FOR_EASY_TO_BORROW = ( + "RISK_REJECT_TYPE_ALLOW_LOCATE_ID_FOR_EASY_TO_BORROW" + ) + RISK_REJECT_TYPE_ALLOW_OPT_ORDER_MARKET = "RISK_REJECT_TYPE_ALLOW_OPT_ORDER_MARKET" + RISK_REJECT_TYPE_ALLOW_OPT_ORDER_SELL_TO_OPEN = ( + "RISK_REJECT_TYPE_ALLOW_OPT_ORDER_SELL_TO_OPEN" + ) + RISK_REJECT_TYPE_ALLOW_ORDER_WASH_TRADES = ( + "RISK_REJECT_TYPE_ALLOW_ORDER_WASH_TRADES" + ) + RISK_REJECT_TYPE_BUYING_POWER = "RISK_REJECT_TYPE_BUYING_POWER" + RISK_REJECT_TYPE_CRYPTO_MAX_GROSS_NOTIONAL_DAY = ( + "RISK_REJECT_TYPE_CRYPTO_MAX_GROSS_NOTIONAL_DAY" + ) + RISK_REJECT_TYPE_CRYPTO_MAX_GROSS_QTY_DAY = ( + "RISK_REJECT_TYPE_CRYPTO_MAX_GROSS_QTY_DAY" + ) + RISK_REJECT_TYPE_CRYPTO_MAX_NET_POSITION = ( + "RISK_REJECT_TYPE_CRYPTO_MAX_NET_POSITION" + ) + RISK_REJECT_TYPE_CRYPTO_MAX_NET_QTY_DAY = "RISK_REJECT_TYPE_CRYPTO_MAX_NET_QTY_DAY" + RISK_REJECT_TYPE_CRYPTO_ORDER_MAX_NOTIONAL = ( + "RISK_REJECT_TYPE_CRYPTO_ORDER_MAX_NOTIONAL" + ) + RISK_REJECT_TYPE_CRYPTO_ORDER_MAX_QTY = "RISK_REJECT_TYPE_CRYPTO_ORDER_MAX_QTY" + RISK_REJECT_TYPE_CRYPTO_ORDER_WARN_NOTIONAL = ( + "RISK_REJECT_TYPE_CRYPTO_ORDER_WARN_NOTIONAL" + ) + RISK_REJECT_TYPE_CRYPTO_ORDER_WARN_QTY = "RISK_REJECT_TYPE_CRYPTO_ORDER_WARN_QTY" + RISK_REJECT_TYPE_CRYPTO_WARN_GROSS_NOTIONAL_DAY = ( + "RISK_REJECT_TYPE_CRYPTO_WARN_GROSS_NOTIONAL_DAY" + ) + RISK_REJECT_TYPE_CRYPTO_WARN_GROSS_QTY_DAY = ( + "RISK_REJECT_TYPE_CRYPTO_WARN_GROSS_QTY_DAY" + ) + RISK_REJECT_TYPE_CRYPTO_WARN_NET_POSITION = ( + "RISK_REJECT_TYPE_CRYPTO_WARN_NET_POSITION" + ) + RISK_REJECT_TYPE_CRYPTO_WARN_NET_QTY_DAY = ( + "RISK_REJECT_TYPE_CRYPTO_WARN_NET_QTY_DAY" + ) + RISK_REJECT_TYPE_EQ_MAX_GROSS_NOTIONAL_DAY = ( + "RISK_REJECT_TYPE_EQ_MAX_GROSS_NOTIONAL_DAY" + ) + RISK_REJECT_TYPE_EQ_MAX_GROSS_QTY_DAY = "RISK_REJECT_TYPE_EQ_MAX_GROSS_QTY_DAY" + RISK_REJECT_TYPE_EQ_MAX_NET_POSITION = "RISK_REJECT_TYPE_EQ_MAX_NET_POSITION" + RISK_REJECT_TYPE_EQ_MAX_NET_QTY_DAY = "RISK_REJECT_TYPE_EQ_MAX_NET_QTY_DAY" + RISK_REJECT_TYPE_EQ_ORDER_MAX_NOTIONAL = "RISK_REJECT_TYPE_EQ_ORDER_MAX_NOTIONAL" + RISK_REJECT_TYPE_EQ_ORDER_MAX_QTY = "RISK_REJECT_TYPE_EQ_ORDER_MAX_QTY" + RISK_REJECT_TYPE_EQ_ORDER_WARN_NOTIONAL = "RISK_REJECT_TYPE_EQ_ORDER_WARN_NOTIONAL" + RISK_REJECT_TYPE_EQ_ORDER_WARN_QTY = "RISK_REJECT_TYPE_EQ_ORDER_WARN_QTY" + RISK_REJECT_TYPE_EQ_WARN_GROSS_NOTIONAL_DAY = ( + "RISK_REJECT_TYPE_EQ_WARN_GROSS_NOTIONAL_DAY" + ) + RISK_REJECT_TYPE_EQ_WARN_GROSS_QTY_DAY = "RISK_REJECT_TYPE_EQ_WARN_GROSS_QTY_DAY" + RISK_REJECT_TYPE_EQ_WARN_NET_POSITION = "RISK_REJECT_TYPE_EQ_WARN_NET_POSITION" + RISK_REJECT_TYPE_EQ_WARN_NET_QTY_DAY = "RISK_REJECT_TYPE_EQ_WARN_NET_QTY_DAY" + RISK_REJECT_TYPE_FUT_MAX_GROSS_NOTIONAL_DAY = ( + "RISK_REJECT_TYPE_FUT_MAX_GROSS_NOTIONAL_DAY" + ) + RISK_REJECT_TYPE_FUT_MAX_GROSS_QTY_DAY = "RISK_REJECT_TYPE_FUT_MAX_GROSS_QTY_DAY" + RISK_REJECT_TYPE_FUT_MAX_NET_POSITION = "RISK_REJECT_TYPE_FUT_MAX_NET_POSITION" + RISK_REJECT_TYPE_FUT_MAX_NET_QTY_DAY = "RISK_REJECT_TYPE_FUT_MAX_NET_QTY_DAY" + RISK_REJECT_TYPE_FUT_ORDER_MAX_NOTIONAL = "RISK_REJECT_TYPE_FUT_ORDER_MAX_NOTIONAL" + RISK_REJECT_TYPE_FUT_ORDER_MAX_QTY = "RISK_REJECT_TYPE_FUT_ORDER_MAX_QTY" + RISK_REJECT_TYPE_FUT_ORDER_WARN_NOTIONAL = ( + "RISK_REJECT_TYPE_FUT_ORDER_WARN_NOTIONAL" + ) + RISK_REJECT_TYPE_FUT_ORDER_WARN_QTY = "RISK_REJECT_TYPE_FUT_ORDER_WARN_QTY" + RISK_REJECT_TYPE_FUT_WARN_GROSS_NOTIONAL_DAY = ( + "RISK_REJECT_TYPE_FUT_WARN_GROSS_NOTIONAL_DAY" + ) + RISK_REJECT_TYPE_FUT_WARN_GROSS_QTY_DAY = "RISK_REJECT_TYPE_FUT_WARN_GROSS_QTY_DAY" + RISK_REJECT_TYPE_FUT_WARN_NET_POSITION = "RISK_REJECT_TYPE_FUT_WARN_NET_POSITION" + RISK_REJECT_TYPE_FUT_WARN_NET_QTY_DAY = "RISK_REJECT_TYPE_FUT_WARN_NET_QTY_DAY" + RISK_REJECT_TYPE_GTC_ORDER_NOT_ALLOWED = "RISK_REJECT_TYPE_GTC_ORDER_NOT_ALLOWED" + RISK_REJECT_TYPE_HARD_TO_BORROW = "RISK_REJECT_TYPE_HARD_TO_BORROW" + RISK_REJECT_TYPE_INVALID_ORD_TYPE = "RISK_REJECT_TYPE_INVALID_ORD_TYPE" + RISK_REJECT_TYPE_INVALID_SIDE = "RISK_REJECT_TYPE_INVALID_SIDE" + RISK_REJECT_TYPE_OPT_MAX_GROSS_NOTIONAL_DAY = ( + "RISK_REJECT_TYPE_OPT_MAX_GROSS_NOTIONAL_DAY" + ) + RISK_REJECT_TYPE_OPT_MAX_GROSS_QTY_DAY = "RISK_REJECT_TYPE_OPT_MAX_GROSS_QTY_DAY" + RISK_REJECT_TYPE_OPT_MAX_NET_POSITION = "RISK_REJECT_TYPE_OPT_MAX_NET_POSITION" + RISK_REJECT_TYPE_OPT_MAX_NET_QTY_DAY = "RISK_REJECT_TYPE_OPT_MAX_NET_QTY_DAY" + RISK_REJECT_TYPE_OPT_ORDER_MAX_NOTIONAL = "RISK_REJECT_TYPE_OPT_ORDER_MAX_NOTIONAL" + RISK_REJECT_TYPE_OPT_ORDER_MAX_QTY = "RISK_REJECT_TYPE_OPT_ORDER_MAX_QTY" + RISK_REJECT_TYPE_OPT_ORDER_WARN_NOTIONAL = ( + "RISK_REJECT_TYPE_OPT_ORDER_WARN_NOTIONAL" + ) + RISK_REJECT_TYPE_OPT_ORDER_WARN_QTY = "RISK_REJECT_TYPE_OPT_ORDER_WARN_QTY" + RISK_REJECT_TYPE_OPT_WARN_GROSS_NOTIONAL_DAY = ( + "RISK_REJECT_TYPE_OPT_WARN_GROSS_NOTIONAL_DAY" + ) + RISK_REJECT_TYPE_OPT_WARN_GROSS_QTY_DAY = "RISK_REJECT_TYPE_OPT_WARN_GROSS_QTY_DAY" + RISK_REJECT_TYPE_OPT_WARN_NET_POSITION = "RISK_REJECT_TYPE_OPT_WARN_NET_POSITION" + RISK_REJECT_TYPE_OPT_WARN_NET_QTY_DAY = "RISK_REJECT_TYPE_OPT_WARN_NET_QTY_DAY" + RISK_REJECT_TYPE_ORDER_MAX_THRESHOLD_BREACHED = ( + "RISK_REJECT_TYPE_ORDER_MAX_THRESHOLD_BREACHED" + ) + RISK_REJECT_TYPE_RESTRICTED_SECURITY = "RISK_REJECT_TYPE_RESTRICTED_SECURITY" + RISK_REJECT_TYPE_SECURITY_NOT_SUPPORTED = "RISK_REJECT_TYPE_SECURITY_NOT_SUPPORTED" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/route.py b/openapi_project/openapi_package/models/route.py new file mode 100644 index 000000000..ebb6735f6 --- /dev/null +++ b/openapi_project/openapi_package/models/route.py @@ -0,0 +1,180 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.currency import Currency +from ..models.order_type import OrderType +from ..models.route_type import RouteType +from ..models.security_type import SecurityType +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.route_property import RouteProperty + + +T = TypeVar("T", bound="Route") + + +@_attrs_define +class Route: + """ + Attributes: + id (Unset | int): + algo_schema (Unset | str): + currency (Unset | Currency): + is_enabled (Unset | bool): + name (Unset | str): + order_type (Unset | OrderType): + route_properties (Unset | list['RouteProperty']): + security_type (Unset | SecurityType): + type_ (Unset | RouteType): + ui_schema (Unset | str): + venue (Unset | str): + """ + + id: Unset | int = UNSET + algo_schema: Unset | str = UNSET + currency: Unset | Currency = UNSET + is_enabled: Unset | bool = UNSET + name: Unset | str = UNSET + order_type: Unset | OrderType = UNSET + route_properties: Unset | list["RouteProperty"] = UNSET + security_type: Unset | SecurityType = UNSET + type_: Unset | RouteType = UNSET + ui_schema: Unset | str = UNSET + venue: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + id = self.id + + algo_schema = self.algo_schema + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + is_enabled = self.is_enabled + + name = self.name + + order_type: Unset | str = UNSET + if not isinstance(self.order_type, Unset): + order_type = self.order_type.value + + route_properties: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.route_properties, Unset): + route_properties = [] + for route_properties_item_data in self.route_properties: + route_properties_item = route_properties_item_data.to_dict() + route_properties.append(route_properties_item) + + security_type: Unset | str = UNSET + if not isinstance(self.security_type, Unset): + security_type = self.security_type.value + + type_: Unset | str = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + ui_schema = self.ui_schema + + venue = self.venue + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if algo_schema is not UNSET: + field_dict["algoSchema"] = algo_schema + if currency is not UNSET: + field_dict["currency"] = currency + if is_enabled is not UNSET: + field_dict["isEnabled"] = is_enabled + if name is not UNSET: + field_dict["name"] = name + if order_type is not UNSET: + field_dict["orderType"] = order_type + if route_properties is not UNSET: + field_dict["routeProperties"] = route_properties + if security_type is not UNSET: + field_dict["securityType"] = security_type + if type_ is not UNSET: + field_dict["type"] = type_ + if ui_schema is not UNSET: + field_dict["uiSchema"] = ui_schema + if venue is not UNSET: + field_dict["venue"] = venue + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + algo_schema = d.pop("algoSchema", UNSET) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + is_enabled = d.pop("isEnabled", UNSET) + + name = d.pop("name", UNSET) + + _order_type = d.pop("orderType", UNSET) + order_type: Unset | OrderType + if isinstance(_order_type, Unset): + order_type = UNSET + else: + order_type = OrderType(_order_type) + + route_properties = [] + _route_properties = d.pop("routeProperties", UNSET) + for route_properties_item_data in _route_properties or []: + route_properties_item = RouteProperty.from_dict(route_properties_item_data) + + route_properties.append(route_properties_item) + + _security_type = d.pop("securityType", UNSET) + security_type: Unset | SecurityType + if isinstance(_security_type, Unset): + security_type = UNSET + else: + security_type = SecurityType(_security_type) + + _type_ = d.pop("type", UNSET) + type_: Unset | RouteType + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = RouteType(_type_) + + ui_schema = d.pop("uiSchema", UNSET) + + venue = d.pop("venue", UNSET) + + route = cls( + id=id, + algo_schema=algo_schema, + currency=currency, + is_enabled=is_enabled, + name=name, + order_type=order_type, + route_properties=route_properties, + security_type=security_type, + type_=type_, + ui_schema=ui_schema, + venue=venue, + ) + + return route diff --git a/openapi_project/openapi_package/models/route_applicability.py b/openapi_project/openapi_package/models/route_applicability.py new file mode 100644 index 000000000..6d5493001 --- /dev/null +++ b/openapi_project/openapi_package/models/route_applicability.py @@ -0,0 +1,125 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.currency import Currency +from ..models.order_type import OrderType +from ..models.security_type import SecurityType +from ..types import UNSET, Unset +from typing import cast + + +T = TypeVar("T", bound="RouteApplicability") + + +@_attrs_define +class RouteApplicability: + """ + Attributes: + user_id (Unset | int): + account_id (Unset | int): + security_type (Unset | SecurityType): + currency (Unset | Currency): + exchange_id (Unset | int): + order_type (Unset | OrderType): + route_ids (Unset | list[int]): + """ + + user_id: Unset | int = UNSET + account_id: Unset | int = UNSET + security_type: Unset | SecurityType = UNSET + currency: Unset | Currency = UNSET + exchange_id: Unset | int = UNSET + order_type: Unset | OrderType = UNSET + route_ids: Unset | list[int] = UNSET + + def to_dict(self) -> dict[str, Any]: + user_id = self.user_id + + account_id = self.account_id + + security_type: Unset | str = UNSET + if not isinstance(self.security_type, Unset): + security_type = self.security_type.value + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + exchange_id = self.exchange_id + + order_type: Unset | str = UNSET + if not isinstance(self.order_type, Unset): + order_type = self.order_type.value + + route_ids: Unset | list[int] = UNSET + if not isinstance(self.route_ids, Unset): + route_ids = self.route_ids + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if user_id is not UNSET: + field_dict["userId"] = user_id + if account_id is not UNSET: + field_dict["accountId"] = account_id + if security_type is not UNSET: + field_dict["securityType"] = security_type + if currency is not UNSET: + field_dict["currency"] = currency + if exchange_id is not UNSET: + field_dict["exchangeId"] = exchange_id + if order_type is not UNSET: + field_dict["orderType"] = order_type + if route_ids is not UNSET: + field_dict["routeIds"] = route_ids + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + user_id = d.pop("userId", UNSET) + + account_id = d.pop("accountId", UNSET) + + _security_type = d.pop("securityType", UNSET) + security_type: Unset | SecurityType + if isinstance(_security_type, Unset): + security_type = UNSET + else: + security_type = SecurityType(_security_type) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + exchange_id = d.pop("exchangeId", UNSET) + + _order_type = d.pop("orderType", UNSET) + order_type: Unset | OrderType + if isinstance(_order_type, Unset): + order_type = UNSET + else: + order_type = OrderType(_order_type) + + route_ids = cast(list[int], d.pop("routeIds", UNSET)) + + route_applicability = cls( + user_id=user_id, + account_id=account_id, + security_type=security_type, + currency=currency, + exchange_id=exchange_id, + order_type=order_type, + route_ids=route_ids, + ) + + return route_applicability diff --git a/openapi_project/openapi_package/models/route_property.py b/openapi_project/openapi_package/models/route_property.py new file mode 100644 index 000000000..701143133 --- /dev/null +++ b/openapi_project/openapi_package/models/route_property.py @@ -0,0 +1,70 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.route_property_type import RoutePropertyType +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="RouteProperty") + + +@_attrs_define +class RouteProperty: + """ + Attributes: + id (Unset | int): + type_ (Unset | RoutePropertyType): + value (Unset | str): + """ + + id: Unset | int = UNSET + type_: Unset | RoutePropertyType = UNSET + value: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + id = self.id + + type_: Unset | str = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + value = self.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if type_ is not UNSET: + field_dict["type"] = type_ + if value is not UNSET: + field_dict["value"] = value + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + _type_ = d.pop("type", UNSET) + type_: Unset | RoutePropertyType + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = RoutePropertyType(_type_) + + value = d.pop("value", UNSET) + + route_property = cls( + id=id, + type_=type_, + value=value, + ) + + return route_property diff --git a/openapi_project/openapi_package/models/route_property_type.py b/openapi_project/openapi_package/models/route_property_type.py new file mode 100644 index 000000000..df376dcfa --- /dev/null +++ b/openapi_project/openapi_package/models/route_property_type.py @@ -0,0 +1,19 @@ +from enum import Enum + + +class RoutePropertyType(str, Enum): + ROUTE_PROPERTY_TYPE_CONTINGENCY = "ROUTE_PROPERTY_TYPE_CONTINGENCY" + ROUTE_PROPERTY_TYPE_CROSS_TYPE = "ROUTE_PROPERTY_TYPE_CROSS_TYPE" + ROUTE_PROPERTY_TYPE_EQUITY_EX_DESTINATION = ( + "ROUTE_PROPERTY_TYPE_EQUITY_EX_DESTINATION" + ) + ROUTE_PROPERTY_TYPE_INSTRUCTION = "ROUTE_PROPERTY_TYPE_INSTRUCTION" + ROUTE_PROPERTY_TYPE_ORDER_TYPE = "ROUTE_PROPERTY_TYPE_ORDER_TYPE" + ROUTE_PROPERTY_TYPE_PERMISSION = "ROUTE_PROPERTY_TYPE_PERMISSION" + ROUTE_PROPERTY_TYPE_SESSION_ELIGIBILITY = "ROUTE_PROPERTY_TYPE_SESSION_ELIGIBILITY" + ROUTE_PROPERTY_TYPE_STRATEGY_ID = "ROUTE_PROPERTY_TYPE_STRATEGY_ID" + ROUTE_PROPERTY_TYPE_TIF = "ROUTE_PROPERTY_TYPE_TIF" + ROUTE_PROPERTY_TYPE_UNKNOWN = "ROUTE_PROPERTY_TYPE_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/route_type.py b/openapi_project/openapi_package/models/route_type.py new file mode 100644 index 000000000..d8faa457c --- /dev/null +++ b/openapi_project/openapi_package/models/route_type.py @@ -0,0 +1,16 @@ +from enum import Enum + + +class RouteType(str, Enum): + ROUTE_TYPE_ALGO = "ROUTE_TYPE_ALGO" + ROUTE_TYPE_AWAY = "ROUTE_TYPE_AWAY" + ROUTE_TYPE_BROKER = "ROUTE_TYPE_BROKER" + ROUTE_TYPE_CBOE = "ROUTE_TYPE_CBOE" + ROUTE_TYPE_DMA = "ROUTE_TYPE_DMA" + ROUTE_TYPE_MANUAL = "ROUTE_TYPE_MANUAL" + ROUTE_TYPE_P2P = "ROUTE_TYPE_P2P" + ROUTE_TYPE_PAR = "ROUTE_TYPE_PAR" + ROUTE_TYPE_STAGE = "ROUTE_TYPE_STAGE" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/routing_session_group.py b/openapi_project/openapi_package/models/routing_session_group.py new file mode 100644 index 000000000..230e88d02 --- /dev/null +++ b/openapi_project/openapi_package/models/routing_session_group.py @@ -0,0 +1,70 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.routing_session_group_type import RoutingSessionGroupType +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="RoutingSessionGroup") + + +@_attrs_define +class RoutingSessionGroup: + """ + Attributes: + id (Unset | int): + name (Unset | str): + type_ (Unset | RoutingSessionGroupType): + """ + + id: Unset | int = UNSET + name: Unset | str = UNSET + type_: Unset | RoutingSessionGroupType = UNSET + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + type_: Unset | str = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if name is not UNSET: + field_dict["name"] = name + if type_ is not UNSET: + field_dict["type"] = type_ + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + name = d.pop("name", UNSET) + + _type_ = d.pop("type", UNSET) + type_: Unset | RoutingSessionGroupType + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = RoutingSessionGroupType(_type_) + + routing_session_group = cls( + id=id, + name=name, + type_=type_, + ) + + return routing_session_group diff --git a/openapi_project/openapi_package/models/routing_session_group_type.py b/openapi_project/openapi_package/models/routing_session_group_type.py new file mode 100644 index 000000000..1eba5b629 --- /dev/null +++ b/openapi_project/openapi_package/models/routing_session_group_type.py @@ -0,0 +1,15 @@ +from enum import Enum + + +class RoutingSessionGroupType(str, Enum): + ROUTING_SESSION_GROUP_TYPE_AWAY = "ROUTING_SESSION_GROUP_TYPE_AWAY" + ROUTING_SESSION_GROUP_TYPE_BROKER = "ROUTING_SESSION_GROUP_TYPE_BROKER" + ROUTING_SESSION_GROUP_TYPE_EXCHANGE = "ROUTING_SESSION_GROUP_TYPE_EXCHANGE" + ROUTING_SESSION_GROUP_TYPE_MANUAL = "ROUTING_SESSION_GROUP_TYPE_MANUAL" + ROUTING_SESSION_GROUP_TYPE_P2P = "ROUTING_SESSION_GROUP_TYPE_P2P" + ROUTING_SESSION_GROUP_TYPE_PAR = "ROUTING_SESSION_GROUP_TYPE_PAR" + ROUTING_SESSION_GROUP_TYPE_STAGE = "ROUTING_SESSION_GROUP_TYPE_STAGE" + ROUTING_SESSION_GROUP_TYPE_UNKNOWN = "ROUTING_SESSION_GROUP_TYPE_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/scenario.py b/openapi_project/openapi_package/models/scenario.py new file mode 100644 index 000000000..a5028c480 --- /dev/null +++ b/openapi_project/openapi_package/models/scenario.py @@ -0,0 +1,84 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.scenario_position import ScenarioPosition + from ..models.scenario_leg import ScenarioLeg + + +T = TypeVar("T", bound="Scenario") + + +@_attrs_define +class Scenario: + """ + Attributes: + price (Unset | float): + legs (Unset | list['ScenarioLeg']): + position (Unset | ScenarioPosition): + """ + + price: Unset | float = UNSET + legs: Unset | list["ScenarioLeg"] = UNSET + position: Unset | "ScenarioPosition" = UNSET + + def to_dict(self) -> dict[str, Any]: + price = self.price + + legs: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.legs, Unset): + legs = [] + for legs_item_data in self.legs: + legs_item = legs_item_data.to_dict() + legs.append(legs_item) + + position: Unset | dict[str, Any] = UNSET + if not isinstance(self.position, Unset): + position = self.position.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if price is not UNSET: + field_dict["price"] = price + if legs is not UNSET: + field_dict["legs"] = legs + if position is not UNSET: + field_dict["position"] = position + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + price = d.pop("price", UNSET) + + legs = [] + _legs = d.pop("legs", UNSET) + for legs_item_data in _legs or []: + legs_item = ScenarioLeg.from_dict(legs_item_data) + + legs.append(legs_item) + + _position = d.pop("position", UNSET) + position: Unset | ScenarioPosition + if isinstance(_position, Unset): + position = UNSET + else: + position = ScenarioPosition.from_dict(_position) + + scenario = cls( + price=price, + legs=legs, + position=position, + ) + + return scenario diff --git a/openapi_project/openapi_package/models/scenario_leg.py b/openapi_project/openapi_package/models/scenario_leg.py new file mode 100644 index 000000000..3a3e06b73 --- /dev/null +++ b/openapi_project/openapi_package/models/scenario_leg.py @@ -0,0 +1,116 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="ScenarioLeg") + + +@_attrs_define +class ScenarioLeg: + """ + Attributes: + delta (Unset | float): + gamma (Unset | float): + prem (Unset | float): + profit (Unset | float): + rho (Unset | float): + theta (Unset | float): + total_value (Unset | float): + vega (Unset | float): + volatility (Unset | float): + """ + + delta: Unset | float = UNSET + gamma: Unset | float = UNSET + prem: Unset | float = UNSET + profit: Unset | float = UNSET + rho: Unset | float = UNSET + theta: Unset | float = UNSET + total_value: Unset | float = UNSET + vega: Unset | float = UNSET + volatility: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + delta = self.delta + + gamma = self.gamma + + prem = self.prem + + profit = self.profit + + rho = self.rho + + theta = self.theta + + total_value = self.total_value + + vega = self.vega + + volatility = self.volatility + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if delta is not UNSET: + field_dict["delta"] = delta + if gamma is not UNSET: + field_dict["gamma"] = gamma + if prem is not UNSET: + field_dict["prem"] = prem + if profit is not UNSET: + field_dict["profit"] = profit + if rho is not UNSET: + field_dict["rho"] = rho + if theta is not UNSET: + field_dict["theta"] = theta + if total_value is not UNSET: + field_dict["totalValue"] = total_value + if vega is not UNSET: + field_dict["vega"] = vega + if volatility is not UNSET: + field_dict["volatility"] = volatility + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + delta = d.pop("delta", UNSET) + + gamma = d.pop("gamma", UNSET) + + prem = d.pop("prem", UNSET) + + profit = d.pop("profit", UNSET) + + rho = d.pop("rho", UNSET) + + theta = d.pop("theta", UNSET) + + total_value = d.pop("totalValue", UNSET) + + vega = d.pop("vega", UNSET) + + volatility = d.pop("volatility", UNSET) + + scenario_leg = cls( + delta=delta, + gamma=gamma, + prem=prem, + profit=profit, + rho=rho, + theta=theta, + total_value=total_value, + vega=vega, + volatility=volatility, + ) + + return scenario_leg diff --git a/openapi_project/openapi_package/models/scenario_position.py b/openapi_project/openapi_package/models/scenario_position.py new file mode 100644 index 000000000..48a5d02b9 --- /dev/null +++ b/openapi_project/openapi_package/models/scenario_position.py @@ -0,0 +1,116 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="ScenarioPosition") + + +@_attrs_define +class ScenarioPosition: + """ + Attributes: + delta (Unset | float): + gamma (Unset | float): + prem (Unset | float): + profit (Unset | float): + rho (Unset | float): + theta (Unset | float): + total_value (Unset | float): + vega (Unset | float): + volatility (Unset | float): + """ + + delta: Unset | float = UNSET + gamma: Unset | float = UNSET + prem: Unset | float = UNSET + profit: Unset | float = UNSET + rho: Unset | float = UNSET + theta: Unset | float = UNSET + total_value: Unset | float = UNSET + vega: Unset | float = UNSET + volatility: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + delta = self.delta + + gamma = self.gamma + + prem = self.prem + + profit = self.profit + + rho = self.rho + + theta = self.theta + + total_value = self.total_value + + vega = self.vega + + volatility = self.volatility + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if delta is not UNSET: + field_dict["delta"] = delta + if gamma is not UNSET: + field_dict["gamma"] = gamma + if prem is not UNSET: + field_dict["prem"] = prem + if profit is not UNSET: + field_dict["profit"] = profit + if rho is not UNSET: + field_dict["rho"] = rho + if theta is not UNSET: + field_dict["theta"] = theta + if total_value is not UNSET: + field_dict["totalValue"] = total_value + if vega is not UNSET: + field_dict["vega"] = vega + if volatility is not UNSET: + field_dict["volatility"] = volatility + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + delta = d.pop("delta", UNSET) + + gamma = d.pop("gamma", UNSET) + + prem = d.pop("prem", UNSET) + + profit = d.pop("profit", UNSET) + + rho = d.pop("rho", UNSET) + + theta = d.pop("theta", UNSET) + + total_value = d.pop("totalValue", UNSET) + + vega = d.pop("vega", UNSET) + + volatility = d.pop("volatility", UNSET) + + scenario_position = cls( + delta=delta, + gamma=gamma, + prem=prem, + profit=profit, + rho=rho, + theta=theta, + total_value=total_value, + vega=vega, + volatility=volatility, + ) + + return scenario_position diff --git a/openapi_project/openapi_package/models/scenario_theo.py b/openapi_project/openapi_package/models/scenario_theo.py new file mode 100644 index 000000000..f85b20d9a --- /dev/null +++ b/openapi_project/openapi_package/models/scenario_theo.py @@ -0,0 +1,76 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.scenario import Scenario + + +T = TypeVar("T", bound="ScenarioTheo") + + +@_attrs_define +class ScenarioTheo: + """ + Attributes: + as_of_ts (Unset | str): + as_of_eval_expiry (Unset | bool): + scenarios (Unset | list['Scenario']): + """ + + as_of_ts: Unset | str = UNSET + as_of_eval_expiry: Unset | bool = UNSET + scenarios: Unset | list["Scenario"] = UNSET + + def to_dict(self) -> dict[str, Any]: + as_of_ts = self.as_of_ts + + as_of_eval_expiry = self.as_of_eval_expiry + + scenarios: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.scenarios, Unset): + scenarios = [] + for scenarios_item_data in self.scenarios: + scenarios_item = scenarios_item_data.to_dict() + scenarios.append(scenarios_item) + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if as_of_ts is not UNSET: + field_dict["asOfTs"] = as_of_ts + if as_of_eval_expiry is not UNSET: + field_dict["asOfEvalExpiry"] = as_of_eval_expiry + if scenarios is not UNSET: + field_dict["scenarios"] = scenarios + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + as_of_ts = d.pop("asOfTs", UNSET) + + as_of_eval_expiry = d.pop("asOfEvalExpiry", UNSET) + + scenarios = [] + _scenarios = d.pop("scenarios", UNSET) + for scenarios_item_data in _scenarios or []: + scenarios_item = Scenario.from_dict(scenarios_item_data) + + scenarios.append(scenarios_item) + + scenario_theo = cls( + as_of_ts=as_of_ts, + as_of_eval_expiry=as_of_eval_expiry, + scenarios=scenarios, + ) + + return scenario_theo diff --git a/openapi_project/openapi_package/models/search_order_history_response.py b/openapi_project/openapi_package/models/search_order_history_response.py new file mode 100644 index 000000000..7aebe6e45 --- /dev/null +++ b/openapi_project/openapi_package/models/search_order_history_response.py @@ -0,0 +1,84 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.generic_order import GenericOrder + + +T = TypeVar("T", bound="SearchOrderHistoryResponse") + + +@_attrs_define +class SearchOrderHistoryResponse: + """ + Attributes: + orders (Unset | list['GenericOrder']): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + orders: Unset | list["GenericOrder"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + orders: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.orders, Unset): + orders = [] + for orders_item_data in self.orders: + orders_item = orders_item_data.to_dict() + orders.append(orders_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if orders is not UNSET: + field_dict["orders"] = orders + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + orders = [] + _orders = d.pop("orders", UNSET) + for orders_item_data in _orders or []: + orders_item = GenericOrder.from_dict(orders_item_data) + + orders.append(orders_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + search_order_history_response = cls( + orders=orders, + error_message=error_message, + status_code=status_code, + ) + + return search_order_history_response diff --git a/openapi_project/openapi_package/models/security.py b/openapi_project/openapi_package/models/security.py new file mode 100644 index 000000000..1e3e36520 --- /dev/null +++ b/openapi_project/openapi_package/models/security.py @@ -0,0 +1,208 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.stock import Stock + from ..models.future_spread import FutureSpread + from ..models.fx import Fx + from ..models.crypto import Crypto + from ..models.future_root import FutureRoot + from ..models.future import Future + from ..models.flex_option import FlexOption + from ..models.option_root import OptionRoot + from ..models.option import Option + from ..models.index import Index + + +T = TypeVar("T", bound="Security") + + +@_attrs_define +class Security: + """ + Attributes: + stock (Unset | Stock): + option (Unset | Option): + option_root (Unset | OptionRoot): + future (Unset | Future): + future_root (Unset | FutureRoot): + index (Unset | Index): + future_spread (Unset | FutureSpread): + fx (Unset | Fx): + crypto (Unset | Crypto): + flex_option (Unset | FlexOption): + """ + + stock: Unset | "Stock" = UNSET + option: Unset | "Option" = UNSET + option_root: Unset | "OptionRoot" = UNSET + future: Unset | "Future" = UNSET + future_root: Unset | "FutureRoot" = UNSET + index: Unset | "Index" = UNSET + future_spread: Unset | "FutureSpread" = UNSET + fx: Unset | "Fx" = UNSET + crypto: Unset | "Crypto" = UNSET + flex_option: Unset | "FlexOption" = UNSET + + def to_dict(self) -> dict[str, Any]: + stock: Unset | dict[str, Any] = UNSET + if not isinstance(self.stock, Unset): + stock = self.stock.to_dict() + + option: Unset | dict[str, Any] = UNSET + if not isinstance(self.option, Unset): + option = self.option.to_dict() + + option_root: Unset | dict[str, Any] = UNSET + if not isinstance(self.option_root, Unset): + option_root = self.option_root.to_dict() + + future: Unset | dict[str, Any] = UNSET + if not isinstance(self.future, Unset): + future = self.future.to_dict() + + future_root: Unset | dict[str, Any] = UNSET + if not isinstance(self.future_root, Unset): + future_root = self.future_root.to_dict() + + index: Unset | dict[str, Any] = UNSET + if not isinstance(self.index, Unset): + index = self.index.to_dict() + + future_spread: Unset | dict[str, Any] = UNSET + if not isinstance(self.future_spread, Unset): + future_spread = self.future_spread.to_dict() + + fx: Unset | dict[str, Any] = UNSET + if not isinstance(self.fx, Unset): + fx = self.fx.to_dict() + + crypto: Unset | dict[str, Any] = UNSET + if not isinstance(self.crypto, Unset): + crypto = self.crypto.to_dict() + + flex_option: Unset | dict[str, Any] = UNSET + if not isinstance(self.flex_option, Unset): + flex_option = self.flex_option.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if stock is not UNSET: + field_dict["stock"] = stock + if option is not UNSET: + field_dict["option"] = option + if option_root is not UNSET: + field_dict["optionRoot"] = option_root + if future is not UNSET: + field_dict["future"] = future + if future_root is not UNSET: + field_dict["futureRoot"] = future_root + if index is not UNSET: + field_dict["index"] = index + if future_spread is not UNSET: + field_dict["futureSpread"] = future_spread + if fx is not UNSET: + field_dict["fx"] = fx + if crypto is not UNSET: + field_dict["crypto"] = crypto + if flex_option is not UNSET: + field_dict["flexOption"] = flex_option + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _stock = d.pop("stock", UNSET) + stock: Unset | Stock + if isinstance(_stock, Unset): + stock = UNSET + else: + stock = Stock.from_dict(_stock) + + _option = d.pop("option", UNSET) + option: Unset | Option + if isinstance(_option, Unset): + option = UNSET + else: + option = Option.from_dict(_option) + + _option_root = d.pop("optionRoot", UNSET) + option_root: Unset | OptionRoot + if isinstance(_option_root, Unset): + option_root = UNSET + else: + option_root = OptionRoot.from_dict(_option_root) + + _future = d.pop("future", UNSET) + future: Unset | Future + if isinstance(_future, Unset): + future = UNSET + else: + future = Future.from_dict(_future) + + _future_root = d.pop("futureRoot", UNSET) + future_root: Unset | FutureRoot + if isinstance(_future_root, Unset): + future_root = UNSET + else: + future_root = FutureRoot.from_dict(_future_root) + + _index = d.pop("index", UNSET) + index: Unset | Index + if isinstance(_index, Unset): + index = UNSET + else: + index = Index.from_dict(_index) + + _future_spread = d.pop("futureSpread", UNSET) + future_spread: Unset | FutureSpread + if isinstance(_future_spread, Unset): + future_spread = UNSET + else: + future_spread = FutureSpread.from_dict(_future_spread) + + _fx = d.pop("fx", UNSET) + fx: Unset | Fx + if isinstance(_fx, Unset): + fx = UNSET + else: + fx = Fx.from_dict(_fx) + + _crypto = d.pop("crypto", UNSET) + crypto: Unset | Crypto + if isinstance(_crypto, Unset): + crypto = UNSET + else: + crypto = Crypto.from_dict(_crypto) + + _flex_option = d.pop("flexOption", UNSET) + flex_option: Unset | FlexOption + if isinstance(_flex_option, Unset): + flex_option = UNSET + else: + flex_option = FlexOption.from_dict(_flex_option) + + security = cls( + stock=stock, + option=option, + option_root=option_root, + future=future, + future_root=future_root, + index=index, + future_spread=future_spread, + fx=fx, + crypto=crypto, + flex_option=flex_option, + ) + + return security diff --git a/openapi_project/openapi_package/models/security_category.py b/openapi_project/openapi_package/models/security_category.py new file mode 100644 index 000000000..2d7108ca9 --- /dev/null +++ b/openapi_project/openapi_package/models/security_category.py @@ -0,0 +1,39 @@ +from enum import Enum + + +class SecurityCategory(str, Enum): + SECURITY_CATEGORY_ADR = "SECURITY_CATEGORY_ADR" + SECURITY_CATEGORY_COMMON_STOCK = "SECURITY_CATEGORY_COMMON_STOCK" + SECURITY_CATEGORY_CONVERTIBLE = "SECURITY_CATEGORY_CONVERTIBLE" + SECURITY_CATEGORY_CORPORATE_BOND = "SECURITY_CATEGORY_CORPORATE_BOND" + SECURITY_CATEGORY_CRYPTO = "SECURITY_CATEGORY_CRYPTO" + SECURITY_CATEGORY_DEBENTURE = "SECURITY_CATEGORY_DEBENTURE" + SECURITY_CATEGORY_EQUITY_OPTION = "SECURITY_CATEGORY_EQUITY_OPTION" + SECURITY_CATEGORY_ETF = "SECURITY_CATEGORY_ETF" + SECURITY_CATEGORY_ETN = "SECURITY_CATEGORY_ETN" + SECURITY_CATEGORY_FLEX_OPTION = "SECURITY_CATEGORY_FLEX_OPTION" + SECURITY_CATEGORY_FUTURE = "SECURITY_CATEGORY_FUTURE" + SECURITY_CATEGORY_FUTURE_OPTION = "SECURITY_CATEGORY_FUTURE_OPTION" + SECURITY_CATEGORY_FUTURE_ROOT = "SECURITY_CATEGORY_FUTURE_ROOT" + SECURITY_CATEGORY_FUTURE_SPREAD = "SECURITY_CATEGORY_FUTURE_SPREAD" + SECURITY_CATEGORY_FX = "SECURITY_CATEGORY_FX" + SECURITY_CATEGORY_INDEX = "SECURITY_CATEGORY_INDEX" + SECURITY_CATEGORY_INDEX_OPTION = "SECURITY_CATEGORY_INDEX_OPTION" + SECURITY_CATEGORY_INSTALLMENT_RECEIPT = "SECURITY_CATEGORY_INSTALLMENT_RECEIPT" + SECURITY_CATEGORY_MUNICIPAL_BOND = "SECURITY_CATEGORY_MUNICIPAL_BOND" + SECURITY_CATEGORY_MUTUAL_FUND = "SECURITY_CATEGORY_MUTUAL_FUND" + SECURITY_CATEGORY_NOTE = "SECURITY_CATEGORY_NOTE" + SECURITY_CATEGORY_OPTION_ROOT = "SECURITY_CATEGORY_OPTION_ROOT" + SECURITY_CATEGORY_PREFERRED_STOCK = "SECURITY_CATEGORY_PREFERRED_STOCK" + SECURITY_CATEGORY_RIGHT = "SECURITY_CATEGORY_RIGHT" + SECURITY_CATEGORY_TEST = "SECURITY_CATEGORY_TEST" + SECURITY_CATEGORY_TREASURY_BILL = "SECURITY_CATEGORY_TREASURY_BILL" + SECURITY_CATEGORY_TRUST_UNIT = "SECURITY_CATEGORY_TRUST_UNIT" + SECURITY_CATEGORY_UNIT = "SECURITY_CATEGORY_UNIT" + SECURITY_CATEGORY_UNKNOWN = "SECURITY_CATEGORY_UNKNOWN" + SECURITY_CATEGORY_WARRANT = "SECURITY_CATEGORY_WARRANT" + SECURITY_CATEGORY_WHEN_DISTRIBUTED = "SECURITY_CATEGORY_WHEN_DISTRIBUTED" + SECURITY_CATEGORY_WHEN_ISSUED = "SECURITY_CATEGORY_WHEN_ISSUED" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/security_type.py b/openapi_project/openapi_package/models/security_type.py new file mode 100644 index 000000000..891a6dcbc --- /dev/null +++ b/openapi_project/openapi_package/models/security_type.py @@ -0,0 +1,19 @@ +from enum import Enum + + +class SecurityType(str, Enum): + SECURITY_TYPE_BOND = "SECURITY_TYPE_BOND" + SECURITY_TYPE_CRYPTO = "SECURITY_TYPE_CRYPTO" + SECURITY_TYPE_FLEX_OPTION = "SECURITY_TYPE_FLEX_OPTION" + SECURITY_TYPE_FUTURE = "SECURITY_TYPE_FUTURE" + SECURITY_TYPE_FUTURE_ROOT = "SECURITY_TYPE_FUTURE_ROOT" + SECURITY_TYPE_FUTURE_SPREAD = "SECURITY_TYPE_FUTURE_SPREAD" + SECURITY_TYPE_FX = "SECURITY_TYPE_FX" + SECURITY_TYPE_INDEX = "SECURITY_TYPE_INDEX" + SECURITY_TYPE_OPTION = "SECURITY_TYPE_OPTION" + SECURITY_TYPE_OPTION_ROOT = "SECURITY_TYPE_OPTION_ROOT" + SECURITY_TYPE_STOCK = "SECURITY_TYPE_STOCK" + SECURITY_TYPE_UNKNOWN = "SECURITY_TYPE_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/settlement_deliverable_type.py b/openapi_project/openapi_package/models/settlement_deliverable_type.py new file mode 100644 index 000000000..0163027b4 --- /dev/null +++ b/openapi_project/openapi_package/models/settlement_deliverable_type.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class SettlementDeliverableType(str, Enum): + SETTLEMENT_DELIVERABLE_TYPE_CASH = "SETTLEMENT_DELIVERABLE_TYPE_CASH" + SETTLEMENT_DELIVERABLE_TYPE_PHYSICAL = "SETTLEMENT_DELIVERABLE_TYPE_PHYSICAL" + SETTLEMENT_DELIVERABLE_TYPE_UNDEFINED = "SETTLEMENT_DELIVERABLE_TYPE_UNDEFINED" + SETTLEMENT_DELIVERABLE_TYPE_UNDERLYING = "SETTLEMENT_DELIVERABLE_TYPE_UNDERLYING" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/settlement_info.py b/openapi_project/openapi_package/models/settlement_info.py new file mode 100644 index 000000000..668565580 --- /dev/null +++ b/openapi_project/openapi_package/models/settlement_info.py @@ -0,0 +1,70 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.settlement_deliverable_type import SettlementDeliverableType +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="SettlementInfo") + + +@_attrs_define +class SettlementInfo: + """ + Attributes: + amount (Unset | float): + symbol (Unset | str): + deliverable_type (Unset | SettlementDeliverableType): + """ + + amount: Unset | float = UNSET + symbol: Unset | str = UNSET + deliverable_type: Unset | SettlementDeliverableType = UNSET + + def to_dict(self) -> dict[str, Any]: + amount = self.amount + + symbol = self.symbol + + deliverable_type: Unset | str = UNSET + if not isinstance(self.deliverable_type, Unset): + deliverable_type = self.deliverable_type.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if amount is not UNSET: + field_dict["amount"] = amount + if symbol is not UNSET: + field_dict["symbol"] = symbol + if deliverable_type is not UNSET: + field_dict["deliverableType"] = deliverable_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + amount = d.pop("amount", UNSET) + + symbol = d.pop("symbol", UNSET) + + _deliverable_type = d.pop("deliverableType", UNSET) + deliverable_type: Unset | SettlementDeliverableType + if isinstance(_deliverable_type, Unset): + deliverable_type = UNSET + else: + deliverable_type = SettlementDeliverableType(_deliverable_type) + + settlement_info = cls( + amount=amount, + symbol=symbol, + deliverable_type=deliverable_type, + ) + + return settlement_info diff --git a/openapi_project/openapi_package/models/shock_value.py b/openapi_project/openapi_package/models/shock_value.py new file mode 100644 index 000000000..11318a613 --- /dev/null +++ b/openapi_project/openapi_package/models/shock_value.py @@ -0,0 +1,100 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.shock_value_flags import ShockValueFlags + + +T = TypeVar("T", bound="ShockValue") + + +@_attrs_define +class ShockValue: + """ + Attributes: + delta (Unset | float): + dollar_delta (Unset | float): + pn_l (Unset | float): + nav (Unset | float): + volatility (Unset | float): + flags (Unset | ShockValueFlags): + """ + + delta: Unset | float = UNSET + dollar_delta: Unset | float = UNSET + pn_l: Unset | float = UNSET + nav: Unset | float = UNSET + volatility: Unset | float = UNSET + flags: Unset | "ShockValueFlags" = UNSET + + def to_dict(self) -> dict[str, Any]: + delta = self.delta + + dollar_delta = self.dollar_delta + + pn_l = self.pn_l + + nav = self.nav + + volatility = self.volatility + + flags: Unset | dict[str, Any] = UNSET + if not isinstance(self.flags, Unset): + flags = self.flags.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if delta is not UNSET: + field_dict["delta"] = delta + if dollar_delta is not UNSET: + field_dict["dollarDelta"] = dollar_delta + if pn_l is not UNSET: + field_dict["pnL"] = pn_l + if nav is not UNSET: + field_dict["nav"] = nav + if volatility is not UNSET: + field_dict["volatility"] = volatility + if flags is not UNSET: + field_dict["flags"] = flags + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + delta = d.pop("delta", UNSET) + + dollar_delta = d.pop("dollarDelta", UNSET) + + pn_l = d.pop("pnL", UNSET) + + nav = d.pop("nav", UNSET) + + volatility = d.pop("volatility", UNSET) + + _flags = d.pop("flags", UNSET) + flags: Unset | ShockValueFlags + if isinstance(_flags, Unset): + flags = UNSET + else: + flags = ShockValueFlags.from_dict(_flags) + + shock_value = cls( + delta=delta, + dollar_delta=dollar_delta, + pn_l=pn_l, + nav=nav, + volatility=volatility, + flags=flags, + ) + + return shock_value diff --git a/openapi_project/openapi_package/models/shock_value_flags.py b/openapi_project/openapi_package/models/shock_value_flags.py new file mode 100644 index 000000000..df55be608 --- /dev/null +++ b/openapi_project/openapi_package/models/shock_value_flags.py @@ -0,0 +1,62 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="ShockValueFlags") + + +@_attrs_define +class ShockValueFlags: + """ + Attributes: + expired (Unset | bool): + exercised (Unset | bool): + delivered (Unset | bool): + """ + + expired: Unset | bool = UNSET + exercised: Unset | bool = UNSET + delivered: Unset | bool = UNSET + + def to_dict(self) -> dict[str, Any]: + expired = self.expired + + exercised = self.exercised + + delivered = self.delivered + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if expired is not UNSET: + field_dict["expired"] = expired + if exercised is not UNSET: + field_dict["exercised"] = exercised + if delivered is not UNSET: + field_dict["delivered"] = delivered + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + expired = d.pop("expired", UNSET) + + exercised = d.pop("exercised", UNSET) + + delivered = d.pop("delivered", UNSET) + + shock_value_flags = cls( + expired=expired, + exercised=exercised, + delivered=delivered, + ) + + return shock_value_flags diff --git a/openapi_project/openapi_package/models/side.py b/openapi_project/openapi_package/models/side.py new file mode 100644 index 000000000..c85e0bf27 --- /dev/null +++ b/openapi_project/openapi_package/models/side.py @@ -0,0 +1,13 @@ +from enum import Enum + + +class Side(str, Enum): + SIDE_BUY = "SIDE_BUY" + SIDE_CROSS = "SIDE_CROSS" + SIDE_NOT_SPECIFIED = "SIDE_NOT_SPECIFIED" + SIDE_SELL = "SIDE_SELL" + SIDE_SELL_SHORT = "SIDE_SELL_SHORT" + SIDE_SELL_SHORT_EXEMPT = "SIDE_SELL_SHORT_EXEMPT" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/spread_leg_side.py b/openapi_project/openapi_package/models/spread_leg_side.py new file mode 100644 index 000000000..af9adc8ff --- /dev/null +++ b/openapi_project/openapi_package/models/spread_leg_side.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class SpreadLegSide(str, Enum): + SPREAD_LEG_SIDE_BUY = "SPREAD_LEG_SIDE_BUY" + SPREAD_LEG_SIDE_SELL = "SPREAD_LEG_SIDE_SELL" + SPREAD_LEG_SIDE_UNKNOWN = "SPREAD_LEG_SIDE_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/spread_leg_type.py b/openapi_project/openapi_package/models/spread_leg_type.py new file mode 100644 index 000000000..a6813e623 --- /dev/null +++ b/openapi_project/openapi_package/models/spread_leg_type.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class SpreadLegType(str, Enum): + SPREAD_LEG_TYPE_OUTRIGHT = "SPREAD_LEG_TYPE_OUTRIGHT" + SPREAD_LEG_TYPE_UNKNOWN = "SPREAD_LEG_TYPE_UNKNOWN" + SPREAD_LEG_TYPE_VOLATILITY = "SPREAD_LEG_TYPE_VOLATILITY" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/status.py b/openapi_project/openapi_package/models/status.py new file mode 100644 index 000000000..5ad15ca5d --- /dev/null +++ b/openapi_project/openapi_package/models/status.py @@ -0,0 +1,76 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.any_model import AnyModel + + +T = TypeVar("T", bound="Status") + + +@_attrs_define +class Status: + """ + Attributes: + code (Unset | int): + message (Unset | str): + details (Unset | list['AnyModel']): + """ + + code: Unset | int = UNSET + message: Unset | str = UNSET + details: Unset | list["AnyModel"] = UNSET + + def to_dict(self) -> dict[str, Any]: + code = self.code + + message = self.message + + details: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.details, Unset): + details = [] + for details_item_data in self.details: + details_item = details_item_data.to_dict() + details.append(details_item) + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if code is not UNSET: + field_dict["code"] = code + if message is not UNSET: + field_dict["message"] = message + if details is not UNSET: + field_dict["details"] = details + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + code = d.pop("code", UNSET) + + message = d.pop("message", UNSET) + + details = [] + _details = d.pop("details", UNSET) + for details_item_data in _details or []: + details_item = AnyModel.from_dict(details_item_data) + + details.append(details_item) + + status = cls( + code=code, + message=message, + details=details, + ) + + return status diff --git a/openapi_project/openapi_package/models/status_code.py b/openapi_project/openapi_package/models/status_code.py new file mode 100644 index 000000000..3f7c54600 --- /dev/null +++ b/openapi_project/openapi_package/models/status_code.py @@ -0,0 +1,19 @@ +from enum import Enum + + +class StatusCode(str, Enum): + STATUS_CODE_DISCONNECTED = "STATUS_CODE_DISCONNECTED" + STATUS_CODE_ERROR = "STATUS_CODE_ERROR" + STATUS_CODE_NOT_AUTHORIZED = "STATUS_CODE_NOT_AUTHORIZED" + STATUS_CODE_NOT_CONNECTED = "STATUS_CODE_NOT_CONNECTED" + STATUS_CODE_NOT_FOUND = "STATUS_CODE_NOT_FOUND" + STATUS_CODE_NOT_UPDATED = "STATUS_CODE_NOT_UPDATED" + STATUS_CODE_OK = "STATUS_CODE_OK" + STATUS_CODE_PEER_ALREADY_EXISTS = "STATUS_CODE_PEER_ALREADY_EXISTS" + STATUS_CODE_SERVER_BUSY = "STATUS_CODE_SERVER_BUSY" + STATUS_CODE_SERVER_ERROR = "STATUS_CODE_SERVER_ERROR" + STATUS_CODE_TIMEOUT = "STATUS_CODE_TIMEOUT" + STATUS_CODE_VALIDATION_ERROR = "STATUS_CODE_VALIDATION_ERROR" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/stock.py b/openapi_project/openapi_package/models/stock.py new file mode 100644 index 000000000..23e03b0d1 --- /dev/null +++ b/openapi_project/openapi_package/models/stock.py @@ -0,0 +1,310 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.currency import Currency +from ..models.exchange_code import ExchangeCode +from ..models.numeric_display_format import NumericDisplayFormat +from ..models.security_category import SecurityCategory +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.stock_aliases import StockAliases + from ..models.date import Date + + +T = TypeVar("T", bound="Stock") + + +@_attrs_define +class Stock: + """ + Attributes: + aliases (Unset | StockAliases): + currency (Unset | Currency): + listed_dt (Unset | Date): + delisted_dt (Unset | Date): + description (Unset | str): + exchange_id (Unset | int): + id (Unset | int): + multiplier (Unset | float): + price_base_factor (Unset | float): + price_display_factor (Unset | float): + price_display_format (Unset | NumericDisplayFormat): + qty_display_factor (Unset | float): + qty_display_format (Unset | NumericDisplayFormat): + security_category (Unset | SecurityCategory): + symbol (Unset | str): + tick_rule (Unset | str): + tick_size (Unset | float): + tick_value (Unset | float): + traded_exchanges (Unset | list[ExchangeCode]): + category (Unset | str): + industry (Unset | str): + lot_size (Unset | int): + sector (Unset | str): + """ + + aliases: Unset | "StockAliases" = UNSET + currency: Unset | Currency = UNSET + listed_dt: Unset | "Date" = UNSET + delisted_dt: Unset | "Date" = UNSET + description: Unset | str = UNSET + exchange_id: Unset | int = UNSET + id: Unset | int = UNSET + multiplier: Unset | float = UNSET + price_base_factor: Unset | float = UNSET + price_display_factor: Unset | float = UNSET + price_display_format: Unset | NumericDisplayFormat = UNSET + qty_display_factor: Unset | float = UNSET + qty_display_format: Unset | NumericDisplayFormat = UNSET + security_category: Unset | SecurityCategory = UNSET + symbol: Unset | str = UNSET + tick_rule: Unset | str = UNSET + tick_size: Unset | float = UNSET + tick_value: Unset | float = UNSET + traded_exchanges: Unset | list[ExchangeCode] = UNSET + category: Unset | str = UNSET + industry: Unset | str = UNSET + lot_size: Unset | int = UNSET + sector: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + aliases: Unset | dict[str, Any] = UNSET + if not isinstance(self.aliases, Unset): + aliases = self.aliases.to_dict() + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + listed_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.listed_dt, Unset): + listed_dt = self.listed_dt.to_dict() + + delisted_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.delisted_dt, Unset): + delisted_dt = self.delisted_dt.to_dict() + + description = self.description + + exchange_id = self.exchange_id + + id = self.id + + multiplier = self.multiplier + + price_base_factor = self.price_base_factor + + price_display_factor = self.price_display_factor + + price_display_format: Unset | str = UNSET + if not isinstance(self.price_display_format, Unset): + price_display_format = self.price_display_format.value + + qty_display_factor = self.qty_display_factor + + qty_display_format: Unset | str = UNSET + if not isinstance(self.qty_display_format, Unset): + qty_display_format = self.qty_display_format.value + + security_category: Unset | str = UNSET + if not isinstance(self.security_category, Unset): + security_category = self.security_category.value + + symbol = self.symbol + + tick_rule = self.tick_rule + + tick_size = self.tick_size + + tick_value = self.tick_value + + traded_exchanges: Unset | list[str] = UNSET + if not isinstance(self.traded_exchanges, Unset): + traded_exchanges = [] + for traded_exchanges_item_data in self.traded_exchanges: + traded_exchanges_item = traded_exchanges_item_data.value + traded_exchanges.append(traded_exchanges_item) + + category = self.category + + industry = self.industry + + lot_size = self.lot_size + + sector = self.sector + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if aliases is not UNSET: + field_dict["aliases"] = aliases + if currency is not UNSET: + field_dict["currency"] = currency + if listed_dt is not UNSET: + field_dict["listedDt"] = listed_dt + if delisted_dt is not UNSET: + field_dict["delistedDt"] = delisted_dt + if description is not UNSET: + field_dict["description"] = description + if exchange_id is not UNSET: + field_dict["exchangeId"] = exchange_id + if id is not UNSET: + field_dict["id"] = id + if multiplier is not UNSET: + field_dict["multiplier"] = multiplier + if price_base_factor is not UNSET: + field_dict["priceBaseFactor"] = price_base_factor + if price_display_factor is not UNSET: + field_dict["priceDisplayFactor"] = price_display_factor + if price_display_format is not UNSET: + field_dict["priceDisplayFormat"] = price_display_format + if qty_display_factor is not UNSET: + field_dict["qtyDisplayFactor"] = qty_display_factor + if qty_display_format is not UNSET: + field_dict["qtyDisplayFormat"] = qty_display_format + if security_category is not UNSET: + field_dict["securityCategory"] = security_category + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tick_rule is not UNSET: + field_dict["tickRule"] = tick_rule + if tick_size is not UNSET: + field_dict["tickSize"] = tick_size + if tick_value is not UNSET: + field_dict["tickValue"] = tick_value + if traded_exchanges is not UNSET: + field_dict["tradedExchanges"] = traded_exchanges + if category is not UNSET: + field_dict["category"] = category + if industry is not UNSET: + field_dict["industry"] = industry + if lot_size is not UNSET: + field_dict["lotSize"] = lot_size + if sector is not UNSET: + field_dict["sector"] = sector + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _aliases = d.pop("aliases", UNSET) + aliases: Unset | StockAliases + if isinstance(_aliases, Unset): + aliases = UNSET + else: + aliases = StockAliases.from_dict(_aliases) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + _listed_dt = d.pop("listedDt", UNSET) + listed_dt: Unset | Date + if isinstance(_listed_dt, Unset): + listed_dt = UNSET + else: + listed_dt = Date.from_dict(_listed_dt) + + _delisted_dt = d.pop("delistedDt", UNSET) + delisted_dt: Unset | Date + if isinstance(_delisted_dt, Unset): + delisted_dt = UNSET + else: + delisted_dt = Date.from_dict(_delisted_dt) + + description = d.pop("description", UNSET) + + exchange_id = d.pop("exchangeId", UNSET) + + id = d.pop("id", UNSET) + + multiplier = d.pop("multiplier", UNSET) + + price_base_factor = d.pop("priceBaseFactor", UNSET) + + price_display_factor = d.pop("priceDisplayFactor", UNSET) + + _price_display_format = d.pop("priceDisplayFormat", UNSET) + price_display_format: Unset | NumericDisplayFormat + if isinstance(_price_display_format, Unset): + price_display_format = UNSET + else: + price_display_format = NumericDisplayFormat(_price_display_format) + + qty_display_factor = d.pop("qtyDisplayFactor", UNSET) + + _qty_display_format = d.pop("qtyDisplayFormat", UNSET) + qty_display_format: Unset | NumericDisplayFormat + if isinstance(_qty_display_format, Unset): + qty_display_format = UNSET + else: + qty_display_format = NumericDisplayFormat(_qty_display_format) + + _security_category = d.pop("securityCategory", UNSET) + security_category: Unset | SecurityCategory + if isinstance(_security_category, Unset): + security_category = UNSET + else: + security_category = SecurityCategory(_security_category) + + symbol = d.pop("symbol", UNSET) + + tick_rule = d.pop("tickRule", UNSET) + + tick_size = d.pop("tickSize", UNSET) + + tick_value = d.pop("tickValue", UNSET) + + traded_exchanges = [] + _traded_exchanges = d.pop("tradedExchanges", UNSET) + for traded_exchanges_item_data in _traded_exchanges or []: + traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) + + traded_exchanges.append(traded_exchanges_item) + + category = d.pop("category", UNSET) + + industry = d.pop("industry", UNSET) + + lot_size = d.pop("lotSize", UNSET) + + sector = d.pop("sector", UNSET) + + stock = cls( + aliases=aliases, + currency=currency, + listed_dt=listed_dt, + delisted_dt=delisted_dt, + description=description, + exchange_id=exchange_id, + id=id, + multiplier=multiplier, + price_base_factor=price_base_factor, + price_display_factor=price_display_factor, + price_display_format=price_display_format, + qty_display_factor=qty_display_factor, + qty_display_format=qty_display_format, + security_category=security_category, + symbol=symbol, + tick_rule=tick_rule, + tick_size=tick_size, + tick_value=tick_value, + traded_exchanges=traded_exchanges, + category=category, + industry=industry, + lot_size=lot_size, + sector=sector, + ) + + return stock diff --git a/openapi_project/openapi_package/models/stock_aliases.py b/openapi_project/openapi_package/models/stock_aliases.py new file mode 100644 index 000000000..da9585b50 --- /dev/null +++ b/openapi_project/openapi_package/models/stock_aliases.py @@ -0,0 +1,81 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast, Union + + + + + + +T = TypeVar("T", bound="StockAliases") + + + +@_attrs_define +class StockAliases: + """ + """ + + additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: + prop = prop + for prop_name, prop in self.additional_properties.items() + }) + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + stock_aliases = cls( + ) + + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + stock_aliases.additional_properties = additional_properties + return stock_aliases + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Union[None, str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Union[None, str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/tif.py b/openapi_project/openapi_package/models/tif.py new file mode 100644 index 000000000..ef5cc26ce --- /dev/null +++ b/openapi_project/openapi_package/models/tif.py @@ -0,0 +1,17 @@ +from enum import Enum + + +class Tif(str, Enum): + TIF_CLO = "TIF_CLO" + TIF_DAY = "TIF_DAY" + TIF_ETH = "TIF_ETH" + TIF_FOK = "TIF_FOK" + TIF_GTC = "TIF_GTC" + TIF_GTD = "TIF_GTD" + TIF_GTX = "TIF_GTX" + TIF_IOC = "TIF_IOC" + TIF_OPG = "TIF_OPG" + TIF_UNKNOWN = "TIF_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/time_of_day.py b/openapi_project/openapi_package/models/time_of_day.py new file mode 100644 index 000000000..33f1c9353 --- /dev/null +++ b/openapi_project/openapi_package/models/time_of_day.py @@ -0,0 +1,71 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="TimeOfDay") + + +@_attrs_define +class TimeOfDay: + """ + Attributes: + hours (Unset | int): + minutes (Unset | int): + seconds (Unset | int): + nanos (Unset | int): + """ + + hours: Unset | int = UNSET + minutes: Unset | int = UNSET + seconds: Unset | int = UNSET + nanos: Unset | int = UNSET + + def to_dict(self) -> dict[str, Any]: + hours = self.hours + + minutes = self.minutes + + seconds = self.seconds + + nanos = self.nanos + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if hours is not UNSET: + field_dict["hours"] = hours + if minutes is not UNSET: + field_dict["minutes"] = minutes + if seconds is not UNSET: + field_dict["seconds"] = seconds + if nanos is not UNSET: + field_dict["nanos"] = nanos + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + hours = d.pop("hours", UNSET) + + minutes = d.pop("minutes", UNSET) + + seconds = d.pop("seconds", UNSET) + + nanos = d.pop("nanos", UNSET) + + time_of_day = cls( + hours=hours, + minutes=minutes, + seconds=seconds, + nanos=nanos, + ) + + return time_of_day diff --git a/openapi_project/openapi_package/models/tims_class_group.py b/openapi_project/openapi_package/models/tims_class_group.py new file mode 100644 index 000000000..9e63777a8 --- /dev/null +++ b/openapi_project/openapi_package/models/tims_class_group.py @@ -0,0 +1,204 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.tims_position_group import TimsPositionGroup + + +T = TypeVar("T", bound="TimsClassGroup") + + +@_attrs_define +class TimsClassGroup: + """ + Attributes: + delta (Unset | float): + dollar_delta (Unset | float): + dollar_gamma (Unset | float): + gamma (Unset | float): + hc (Unset | float): + hc_min (Unset | float): + long_nav (Unset | float): + margin_req (Unset | float): + nav (Unset | float): + pn_l (Unset | list[float]): + positions (Unset | list['TimsPositionGroup']): + product_group (Unset | str): + rho (Unset | float): + short_nav (Unset | float): + symbol (Unset | str): + theta (Unset | float): + vega (Unset | float): + """ + + delta: Unset | float = UNSET + dollar_delta: Unset | float = UNSET + dollar_gamma: Unset | float = UNSET + gamma: Unset | float = UNSET + hc: Unset | float = UNSET + hc_min: Unset | float = UNSET + long_nav: Unset | float = UNSET + margin_req: Unset | float = UNSET + nav: Unset | float = UNSET + pn_l: Unset | list[float] = UNSET + positions: Unset | list["TimsPositionGroup"] = UNSET + product_group: Unset | str = UNSET + rho: Unset | float = UNSET + short_nav: Unset | float = UNSET + symbol: Unset | str = UNSET + theta: Unset | float = UNSET + vega: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + delta = self.delta + + dollar_delta = self.dollar_delta + + dollar_gamma = self.dollar_gamma + + gamma = self.gamma + + hc = self.hc + + hc_min = self.hc_min + + long_nav = self.long_nav + + margin_req = self.margin_req + + nav = self.nav + + pn_l: Unset | list[float] = UNSET + if not isinstance(self.pn_l, Unset): + pn_l = self.pn_l + + positions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.positions, Unset): + positions = [] + for positions_item_data in self.positions: + positions_item = positions_item_data.to_dict() + positions.append(positions_item) + + product_group = self.product_group + + rho = self.rho + + short_nav = self.short_nav + + symbol = self.symbol + + theta = self.theta + + vega = self.vega + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if delta is not UNSET: + field_dict["delta"] = delta + if dollar_delta is not UNSET: + field_dict["dollarDelta"] = dollar_delta + if dollar_gamma is not UNSET: + field_dict["dollarGamma"] = dollar_gamma + if gamma is not UNSET: + field_dict["gamma"] = gamma + if hc is not UNSET: + field_dict["hc"] = hc + if hc_min is not UNSET: + field_dict["hcMin"] = hc_min + if long_nav is not UNSET: + field_dict["longNav"] = long_nav + if margin_req is not UNSET: + field_dict["marginReq"] = margin_req + if nav is not UNSET: + field_dict["nav"] = nav + if pn_l is not UNSET: + field_dict["pnL"] = pn_l + if positions is not UNSET: + field_dict["positions"] = positions + if product_group is not UNSET: + field_dict["productGroup"] = product_group + if rho is not UNSET: + field_dict["rho"] = rho + if short_nav is not UNSET: + field_dict["shortNav"] = short_nav + if symbol is not UNSET: + field_dict["symbol"] = symbol + if theta is not UNSET: + field_dict["theta"] = theta + if vega is not UNSET: + field_dict["vega"] = vega + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + delta = d.pop("delta", UNSET) + + dollar_delta = d.pop("dollarDelta", UNSET) + + dollar_gamma = d.pop("dollarGamma", UNSET) + + gamma = d.pop("gamma", UNSET) + + hc = d.pop("hc", UNSET) + + hc_min = d.pop("hcMin", UNSET) + + long_nav = d.pop("longNav", UNSET) + + margin_req = d.pop("marginReq", UNSET) + + nav = d.pop("nav", UNSET) + + pn_l = cast(list[float], d.pop("pnL", UNSET)) + + positions = [] + _positions = d.pop("positions", UNSET) + for positions_item_data in _positions or []: + positions_item = TimsPositionGroup.from_dict(positions_item_data) + + positions.append(positions_item) + + product_group = d.pop("productGroup", UNSET) + + rho = d.pop("rho", UNSET) + + short_nav = d.pop("shortNav", UNSET) + + symbol = d.pop("symbol", UNSET) + + theta = d.pop("theta", UNSET) + + vega = d.pop("vega", UNSET) + + tims_class_group = cls( + delta=delta, + dollar_delta=dollar_delta, + dollar_gamma=dollar_gamma, + gamma=gamma, + hc=hc, + hc_min=hc_min, + long_nav=long_nav, + margin_req=margin_req, + nav=nav, + pn_l=pn_l, + positions=positions, + product_group=product_group, + rho=rho, + short_nav=short_nav, + symbol=symbol, + theta=theta, + vega=vega, + ) + + return tims_class_group diff --git a/openapi_project/openapi_package/models/tims_margin_data.py b/openapi_project/openapi_package/models/tims_margin_data.py new file mode 100644 index 000000000..53167f98e --- /dev/null +++ b/openapi_project/openapi_package/models/tims_margin_data.py @@ -0,0 +1,221 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.currency import Currency +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.tims_class_group import TimsClassGroup + from ..models.tims_product_group import TimsProductGroup + + +T = TypeVar("T", bound="TimsMarginData") + + +@_attrs_define +class TimsMarginData: + """ + Attributes: + account_type (Unset | str): + class_group_count (Unset | int): + class_groups (Unset | list['TimsClassGroup']): + currency (Unset | Currency): + dollar_delta (Unset | float): + dollar_gamma (Unset | float): + long_nav (Unset | float): + margin_req (Unset | float): + nav (Unset | float): + porfolio_group_count (Unset | int): + position_group_count (Unset | int): + product_group_count (Unset | int): + product_groups (Unset | list['TimsProductGroup']): + rho (Unset | float): + short_nav (Unset | float): + theta (Unset | float): + vega (Unset | float): + """ + + account_type: Unset | str = UNSET + class_group_count: Unset | int = UNSET + class_groups: Unset | list["TimsClassGroup"] = UNSET + currency: Unset | Currency = UNSET + dollar_delta: Unset | float = UNSET + dollar_gamma: Unset | float = UNSET + long_nav: Unset | float = UNSET + margin_req: Unset | float = UNSET + nav: Unset | float = UNSET + porfolio_group_count: Unset | int = UNSET + position_group_count: Unset | int = UNSET + product_group_count: Unset | int = UNSET + product_groups: Unset | list["TimsProductGroup"] = UNSET + rho: Unset | float = UNSET + short_nav: Unset | float = UNSET + theta: Unset | float = UNSET + vega: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + account_type = self.account_type + + class_group_count = self.class_group_count + + class_groups: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.class_groups, Unset): + class_groups = [] + for class_groups_item_data in self.class_groups: + class_groups_item = class_groups_item_data.to_dict() + class_groups.append(class_groups_item) + + currency: Unset | str = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.value + + dollar_delta = self.dollar_delta + + dollar_gamma = self.dollar_gamma + + long_nav = self.long_nav + + margin_req = self.margin_req + + nav = self.nav + + porfolio_group_count = self.porfolio_group_count + + position_group_count = self.position_group_count + + product_group_count = self.product_group_count + + product_groups: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.product_groups, Unset): + product_groups = [] + for product_groups_item_data in self.product_groups: + product_groups_item = product_groups_item_data.to_dict() + product_groups.append(product_groups_item) + + rho = self.rho + + short_nav = self.short_nav + + theta = self.theta + + vega = self.vega + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_type is not UNSET: + field_dict["accountType"] = account_type + if class_group_count is not UNSET: + field_dict["classGroupCount"] = class_group_count + if class_groups is not UNSET: + field_dict["classGroups"] = class_groups + if currency is not UNSET: + field_dict["currency"] = currency + if dollar_delta is not UNSET: + field_dict["dollarDelta"] = dollar_delta + if dollar_gamma is not UNSET: + field_dict["dollarGamma"] = dollar_gamma + if long_nav is not UNSET: + field_dict["longNav"] = long_nav + if margin_req is not UNSET: + field_dict["marginReq"] = margin_req + if nav is not UNSET: + field_dict["nav"] = nav + if porfolio_group_count is not UNSET: + field_dict["porfolioGroupCount"] = porfolio_group_count + if position_group_count is not UNSET: + field_dict["positionGroupCount"] = position_group_count + if product_group_count is not UNSET: + field_dict["productGroupCount"] = product_group_count + if product_groups is not UNSET: + field_dict["productGroups"] = product_groups + if rho is not UNSET: + field_dict["rho"] = rho + if short_nav is not UNSET: + field_dict["shortNav"] = short_nav + if theta is not UNSET: + field_dict["theta"] = theta + if vega is not UNSET: + field_dict["vega"] = vega + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_type = d.pop("accountType", UNSET) + + class_group_count = d.pop("classGroupCount", UNSET) + + class_groups = [] + _class_groups = d.pop("classGroups", UNSET) + for class_groups_item_data in _class_groups or []: + class_groups_item = TimsClassGroup.from_dict(class_groups_item_data) + + class_groups.append(class_groups_item) + + _currency = d.pop("currency", UNSET) + currency: Unset | Currency + if isinstance(_currency, Unset): + currency = UNSET + else: + currency = Currency(_currency) + + dollar_delta = d.pop("dollarDelta", UNSET) + + dollar_gamma = d.pop("dollarGamma", UNSET) + + long_nav = d.pop("longNav", UNSET) + + margin_req = d.pop("marginReq", UNSET) + + nav = d.pop("nav", UNSET) + + porfolio_group_count = d.pop("porfolioGroupCount", UNSET) + + position_group_count = d.pop("positionGroupCount", UNSET) + + product_group_count = d.pop("productGroupCount", UNSET) + + product_groups = [] + _product_groups = d.pop("productGroups", UNSET) + for product_groups_item_data in _product_groups or []: + product_groups_item = TimsProductGroup.from_dict(product_groups_item_data) + + product_groups.append(product_groups_item) + + rho = d.pop("rho", UNSET) + + short_nav = d.pop("shortNav", UNSET) + + theta = d.pop("theta", UNSET) + + vega = d.pop("vega", UNSET) + + tims_margin_data = cls( + account_type=account_type, + class_group_count=class_group_count, + class_groups=class_groups, + currency=currency, + dollar_delta=dollar_delta, + dollar_gamma=dollar_gamma, + long_nav=long_nav, + margin_req=margin_req, + nav=nav, + porfolio_group_count=porfolio_group_count, + position_group_count=position_group_count, + product_group_count=product_group_count, + product_groups=product_groups, + rho=rho, + short_nav=short_nav, + theta=theta, + vega=vega, + ) + + return tims_margin_data diff --git a/openapi_project/openapi_package/models/tims_position_group.py b/openapi_project/openapi_package/models/tims_position_group.py new file mode 100644 index 000000000..3bd798745 --- /dev/null +++ b/openapi_project/openapi_package/models/tims_position_group.py @@ -0,0 +1,164 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + + +T = TypeVar("T", bound="TimsPositionGroup") + + +@_attrs_define +class TimsPositionGroup: + """ + Attributes: + delta (Unset | float): + gamma (Unset | float): + hc_min (Unset | float): + hc_minval (Unset | float): + margin_req (Unset | float): + nav (Unset | float): + pn_l (Unset | list[float]): + price (Unset | float): + qty (Unset | float): + rho (Unset | float): + rpg_root (Unset | str): + symbol (Unset | str): + theta (Unset | float): + vega (Unset | float): + """ + + delta: Unset | float = UNSET + gamma: Unset | float = UNSET + hc_min: Unset | float = UNSET + hc_minval: Unset | float = UNSET + margin_req: Unset | float = UNSET + nav: Unset | float = UNSET + pn_l: Unset | list[float] = UNSET + price: Unset | float = UNSET + qty: Unset | float = UNSET + rho: Unset | float = UNSET + rpg_root: Unset | str = UNSET + symbol: Unset | str = UNSET + theta: Unset | float = UNSET + vega: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + delta = self.delta + + gamma = self.gamma + + hc_min = self.hc_min + + hc_minval = self.hc_minval + + margin_req = self.margin_req + + nav = self.nav + + pn_l: Unset | list[float] = UNSET + if not isinstance(self.pn_l, Unset): + pn_l = self.pn_l + + price = self.price + + qty = self.qty + + rho = self.rho + + rpg_root = self.rpg_root + + symbol = self.symbol + + theta = self.theta + + vega = self.vega + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if delta is not UNSET: + field_dict["delta"] = delta + if gamma is not UNSET: + field_dict["gamma"] = gamma + if hc_min is not UNSET: + field_dict["hcMin"] = hc_min + if hc_minval is not UNSET: + field_dict["hcMinval"] = hc_minval + if margin_req is not UNSET: + field_dict["marginReq"] = margin_req + if nav is not UNSET: + field_dict["nav"] = nav + if pn_l is not UNSET: + field_dict["pnL"] = pn_l + if price is not UNSET: + field_dict["price"] = price + if qty is not UNSET: + field_dict["qty"] = qty + if rho is not UNSET: + field_dict["rho"] = rho + if rpg_root is not UNSET: + field_dict["rpgRoot"] = rpg_root + if symbol is not UNSET: + field_dict["symbol"] = symbol + if theta is not UNSET: + field_dict["theta"] = theta + if vega is not UNSET: + field_dict["vega"] = vega + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + delta = d.pop("delta", UNSET) + + gamma = d.pop("gamma", UNSET) + + hc_min = d.pop("hcMin", UNSET) + + hc_minval = d.pop("hcMinval", UNSET) + + margin_req = d.pop("marginReq", UNSET) + + nav = d.pop("nav", UNSET) + + pn_l = cast(list[float], d.pop("pnL", UNSET)) + + price = d.pop("price", UNSET) + + qty = d.pop("qty", UNSET) + + rho = d.pop("rho", UNSET) + + rpg_root = d.pop("rpgRoot", UNSET) + + symbol = d.pop("symbol", UNSET) + + theta = d.pop("theta", UNSET) + + vega = d.pop("vega", UNSET) + + tims_position_group = cls( + delta=delta, + gamma=gamma, + hc_min=hc_min, + hc_minval=hc_minval, + margin_req=margin_req, + nav=nav, + pn_l=pn_l, + price=price, + qty=qty, + rho=rho, + rpg_root=rpg_root, + symbol=symbol, + theta=theta, + vega=vega, + ) + + return tims_position_group diff --git a/openapi_project/openapi_package/models/tims_product_group.py b/openapi_project/openapi_package/models/tims_product_group.py new file mode 100644 index 000000000..bfcd30ebe --- /dev/null +++ b/openapi_project/openapi_package/models/tims_product_group.py @@ -0,0 +1,182 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + + +T = TypeVar("T", bound="TimsProductGroup") + + +@_attrs_define +class TimsProductGroup: + """ + Attributes: + delta (Unset | float): + dollar_delta (Unset | float): + dollar_gamma (Unset | float): + gamma (Unset | float): + group (Unset | str): + hc (Unset | float): + hc_min (Unset | float): + long_nav (Unset | float): + margin_req (Unset | float): + nav (Unset | float): + pn_l_range (Unset | list[float]): + portfolio_group (Unset | str): + rho (Unset | float): + short_nav (Unset | float): + theta (Unset | float): + vega (Unset | float): + """ + + delta: Unset | float = UNSET + dollar_delta: Unset | float = UNSET + dollar_gamma: Unset | float = UNSET + gamma: Unset | float = UNSET + group: Unset | str = UNSET + hc: Unset | float = UNSET + hc_min: Unset | float = UNSET + long_nav: Unset | float = UNSET + margin_req: Unset | float = UNSET + nav: Unset | float = UNSET + pn_l_range: Unset | list[float] = UNSET + portfolio_group: Unset | str = UNSET + rho: Unset | float = UNSET + short_nav: Unset | float = UNSET + theta: Unset | float = UNSET + vega: Unset | float = UNSET + + def to_dict(self) -> dict[str, Any]: + delta = self.delta + + dollar_delta = self.dollar_delta + + dollar_gamma = self.dollar_gamma + + gamma = self.gamma + + group = self.group + + hc = self.hc + + hc_min = self.hc_min + + long_nav = self.long_nav + + margin_req = self.margin_req + + nav = self.nav + + pn_l_range: Unset | list[float] = UNSET + if not isinstance(self.pn_l_range, Unset): + pn_l_range = self.pn_l_range + + portfolio_group = self.portfolio_group + + rho = self.rho + + short_nav = self.short_nav + + theta = self.theta + + vega = self.vega + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if delta is not UNSET: + field_dict["delta"] = delta + if dollar_delta is not UNSET: + field_dict["dollarDelta"] = dollar_delta + if dollar_gamma is not UNSET: + field_dict["dollarGamma"] = dollar_gamma + if gamma is not UNSET: + field_dict["gamma"] = gamma + if group is not UNSET: + field_dict["group"] = group + if hc is not UNSET: + field_dict["hc"] = hc + if hc_min is not UNSET: + field_dict["hcMin"] = hc_min + if long_nav is not UNSET: + field_dict["longNav"] = long_nav + if margin_req is not UNSET: + field_dict["marginReq"] = margin_req + if nav is not UNSET: + field_dict["nav"] = nav + if pn_l_range is not UNSET: + field_dict["pnLRange"] = pn_l_range + if portfolio_group is not UNSET: + field_dict["portfolioGroup"] = portfolio_group + if rho is not UNSET: + field_dict["rho"] = rho + if short_nav is not UNSET: + field_dict["shortNav"] = short_nav + if theta is not UNSET: + field_dict["theta"] = theta + if vega is not UNSET: + field_dict["vega"] = vega + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + delta = d.pop("delta", UNSET) + + dollar_delta = d.pop("dollarDelta", UNSET) + + dollar_gamma = d.pop("dollarGamma", UNSET) + + gamma = d.pop("gamma", UNSET) + + group = d.pop("group", UNSET) + + hc = d.pop("hc", UNSET) + + hc_min = d.pop("hcMin", UNSET) + + long_nav = d.pop("longNav", UNSET) + + margin_req = d.pop("marginReq", UNSET) + + nav = d.pop("nav", UNSET) + + pn_l_range = cast(list[float], d.pop("pnLRange", UNSET)) + + portfolio_group = d.pop("portfolioGroup", UNSET) + + rho = d.pop("rho", UNSET) + + short_nav = d.pop("shortNav", UNSET) + + theta = d.pop("theta", UNSET) + + vega = d.pop("vega", UNSET) + + tims_product_group = cls( + delta=delta, + dollar_delta=dollar_delta, + dollar_gamma=dollar_gamma, + gamma=gamma, + group=group, + hc=hc, + hc_min=hc_min, + long_nav=long_nav, + margin_req=margin_req, + nav=nav, + pn_l_range=pn_l_range, + portfolio_group=portfolio_group, + rho=rho, + short_nav=short_nav, + theta=theta, + vega=vega, + ) + + return tims_product_group diff --git a/openapi_project/openapi_package/models/trade_confirm.py b/openapi_project/openapi_package/models/trade_confirm.py new file mode 100644 index 000000000..5db1e1b5b --- /dev/null +++ b/openapi_project/openapi_package/models/trade_confirm.py @@ -0,0 +1,937 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.capacity_code import CapacityCode +from ..models.clearing_range import ClearingRange +from ..models.cross_side_type import CrossSideType +from ..models.cross_type import CrossType +from ..models.exec_type import ExecType +from ..models.multi_leg_reporting_type import MultiLegReportingType +from ..models.option_exercise_style import OptionExerciseStyle +from ..models.option_settlement_type import OptionSettlementType +from ..models.ord_type import OrdType +from ..models.origination_type import OriginationType +from ..models.position_effect import PositionEffect +from ..models.price_type import PriceType +from ..models.put_call import PutCall +from ..models.security_type import SecurityType +from ..models.side import Side +from ..models.tif import Tif +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.date import Date + + +T = TypeVar("T", bound="TradeConfirm") + + +@_attrs_define +class TradeConfirm: + """ + Attributes: + account_id (Unset | int): + account_name (Unset | str): + alloc_id (Unset | str): + alloc_qty (Unset | float): + aux_price (Unset | float): + avg_price (Unset | float): + billing_code (Unset | str): + capacity (Unset | CapacityCode): + clearing_account (Unset | str): + clearing_range (Unset | ClearingRange): + client_id (Unset | str): + cmta (Unset | str): + commission (Unset | float): + cross_side_type (Unset | CrossSideType): + cross_type (Unset | CrossType): + cum_qty (Unset | float): + cur_ord_id (Unset | str): + deliver_to_compid (Unset | str): + deliver_to_subid (Unset | str): + description (Unset | str): + drop (Unset | bool): + efid (Unset | str): + exec_broker (Unset | str): + exec_id (Unset | str): + exec_ref_id (Unset | str): + exec_type (Unset | ExecType): + exercise_style (Unset | OptionExerciseStyle): + expiration_dt (Unset | Date): + fee1 (Unset | float): + fee2 (Unset | float): + frequent_trader_id (Unset | str): + give_up (Unset | str): + id (Unset | int): + incoming_cl_ord_id (Unset | str): + incoming_ord_id (Unset | str): + incoming_orig_clord_id (Unset | str): + last_market (Unset | str): + last_price (Unset | float): + last_qty (Unset | float): + leaves_qty (Unset | float): + leg_id (Unset | str): + liquidity_flag (Unset | str): + locate_id (Unset | str): + mpid (Unset | str): + multi_leg_reportingtype (Unset | MultiLegReportingType): + ord_type (Unset | OrdType): + origination_type (Unset | OriginationType): + orig_ord_id (Unset | str): + parent_ord_id (Unset | str): + perm_ord_id (Unset | str): + position_effect (Unset | PositionEffect): + price (Unset | float): + price_type (Unset | PriceType): + put_call (Unset | PutCall): + qty (Unset | float): + req_ord_id (Unset | str): + root (Unset | str): + route (Unset | str): + routing_session (Unset | str): + security_type (Unset | SecurityType): + settlement_type (Unset | OptionSettlementType): + side (Unset | Side): + source (Unset | str): + source_address (Unset | str): + strategy_id (Unset | str): + strike (Unset | float): + symbol (Unset | str): + tag (Unset | str): + tag1 (Unset | str): + target_comp_id (Unset | str): + target_sub_id (Unset | str): + text (Unset | str): + tif (Unset | Tif): + traded_dt (Unset | Date): + trader_id (Unset | str): + trading_firm_id (Unset | int): + transact_ts (Unset | str): + underlying (Unset | str): + user_id (Unset | int): + working_qty (Unset | float): + multiplier (Unset | float): + dac_delta (Unset | float): + dac_reference_price (Unset | float): + manual_fill_time (Unset | str): + """ + + account_id: Unset | int = UNSET + account_name: Unset | str = UNSET + alloc_id: Unset | str = UNSET + alloc_qty: Unset | float = UNSET + aux_price: Unset | float = UNSET + avg_price: Unset | float = UNSET + billing_code: Unset | str = UNSET + capacity: Unset | CapacityCode = UNSET + clearing_account: Unset | str = UNSET + clearing_range: Unset | ClearingRange = UNSET + client_id: Unset | str = UNSET + cmta: Unset | str = UNSET + commission: Unset | float = UNSET + cross_side_type: Unset | CrossSideType = UNSET + cross_type: Unset | CrossType = UNSET + cum_qty: Unset | float = UNSET + cur_ord_id: Unset | str = UNSET + deliver_to_compid: Unset | str = UNSET + deliver_to_subid: Unset | str = UNSET + description: Unset | str = UNSET + drop: Unset | bool = UNSET + efid: Unset | str = UNSET + exec_broker: Unset | str = UNSET + exec_id: Unset | str = UNSET + exec_ref_id: Unset | str = UNSET + exec_type: Unset | ExecType = UNSET + exercise_style: Unset | OptionExerciseStyle = UNSET + expiration_dt: Unset | "Date" = UNSET + fee1: Unset | float = UNSET + fee2: Unset | float = UNSET + frequent_trader_id: Unset | str = UNSET + give_up: Unset | str = UNSET + id: Unset | int = UNSET + incoming_cl_ord_id: Unset | str = UNSET + incoming_ord_id: Unset | str = UNSET + incoming_orig_clord_id: Unset | str = UNSET + last_market: Unset | str = UNSET + last_price: Unset | float = UNSET + last_qty: Unset | float = UNSET + leaves_qty: Unset | float = UNSET + leg_id: Unset | str = UNSET + liquidity_flag: Unset | str = UNSET + locate_id: Unset | str = UNSET + mpid: Unset | str = UNSET + multi_leg_reportingtype: Unset | MultiLegReportingType = UNSET + ord_type: Unset | OrdType = UNSET + origination_type: Unset | OriginationType = UNSET + orig_ord_id: Unset | str = UNSET + parent_ord_id: Unset | str = UNSET + perm_ord_id: Unset | str = UNSET + position_effect: Unset | PositionEffect = UNSET + price: Unset | float = UNSET + price_type: Unset | PriceType = UNSET + put_call: Unset | PutCall = UNSET + qty: Unset | float = UNSET + req_ord_id: Unset | str = UNSET + root: Unset | str = UNSET + route: Unset | str = UNSET + routing_session: Unset | str = UNSET + security_type: Unset | SecurityType = UNSET + settlement_type: Unset | OptionSettlementType = UNSET + side: Unset | Side = UNSET + source: Unset | str = UNSET + source_address: Unset | str = UNSET + strategy_id: Unset | str = UNSET + strike: Unset | float = UNSET + symbol: Unset | str = UNSET + tag: Unset | str = UNSET + tag1: Unset | str = UNSET + target_comp_id: Unset | str = UNSET + target_sub_id: Unset | str = UNSET + text: Unset | str = UNSET + tif: Unset | Tif = UNSET + traded_dt: Unset | "Date" = UNSET + trader_id: Unset | str = UNSET + trading_firm_id: Unset | int = UNSET + transact_ts: Unset | str = UNSET + underlying: Unset | str = UNSET + user_id: Unset | int = UNSET + working_qty: Unset | float = UNSET + multiplier: Unset | float = UNSET + dac_delta: Unset | float = UNSET + dac_reference_price: Unset | float = UNSET + manual_fill_time: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + account_name = self.account_name + + alloc_id = self.alloc_id + + alloc_qty = self.alloc_qty + + aux_price = self.aux_price + + avg_price = self.avg_price + + billing_code = self.billing_code + + capacity: Unset | str = UNSET + if not isinstance(self.capacity, Unset): + capacity = self.capacity.value + + clearing_account = self.clearing_account + + clearing_range: Unset | str = UNSET + if not isinstance(self.clearing_range, Unset): + clearing_range = self.clearing_range.value + + client_id = self.client_id + + cmta = self.cmta + + commission = self.commission + + cross_side_type: Unset | str = UNSET + if not isinstance(self.cross_side_type, Unset): + cross_side_type = self.cross_side_type.value + + cross_type: Unset | str = UNSET + if not isinstance(self.cross_type, Unset): + cross_type = self.cross_type.value + + cum_qty = self.cum_qty + + cur_ord_id = self.cur_ord_id + + deliver_to_compid = self.deliver_to_compid + + deliver_to_subid = self.deliver_to_subid + + description = self.description + + drop = self.drop + + efid = self.efid + + exec_broker = self.exec_broker + + exec_id = self.exec_id + + exec_ref_id = self.exec_ref_id + + exec_type: Unset | str = UNSET + if not isinstance(self.exec_type, Unset): + exec_type = self.exec_type.value + + exercise_style: Unset | str = UNSET + if not isinstance(self.exercise_style, Unset): + exercise_style = self.exercise_style.value + + expiration_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.expiration_dt, Unset): + expiration_dt = self.expiration_dt.to_dict() + + fee1 = self.fee1 + + fee2 = self.fee2 + + frequent_trader_id = self.frequent_trader_id + + give_up = self.give_up + + id = self.id + + incoming_cl_ord_id = self.incoming_cl_ord_id + + incoming_ord_id = self.incoming_ord_id + + incoming_orig_clord_id = self.incoming_orig_clord_id + + last_market = self.last_market + + last_price = self.last_price + + last_qty = self.last_qty + + leaves_qty = self.leaves_qty + + leg_id = self.leg_id + + liquidity_flag = self.liquidity_flag + + locate_id = self.locate_id + + mpid = self.mpid + + multi_leg_reportingtype: Unset | str = UNSET + if not isinstance(self.multi_leg_reportingtype, Unset): + multi_leg_reportingtype = self.multi_leg_reportingtype.value + + ord_type: Unset | str = UNSET + if not isinstance(self.ord_type, Unset): + ord_type = self.ord_type.value + + origination_type: Unset | str = UNSET + if not isinstance(self.origination_type, Unset): + origination_type = self.origination_type.value + + orig_ord_id = self.orig_ord_id + + parent_ord_id = self.parent_ord_id + + perm_ord_id = self.perm_ord_id + + position_effect: Unset | str = UNSET + if not isinstance(self.position_effect, Unset): + position_effect = self.position_effect.value + + price = self.price + + price_type: Unset | str = UNSET + if not isinstance(self.price_type, Unset): + price_type = self.price_type.value + + put_call: Unset | str = UNSET + if not isinstance(self.put_call, Unset): + put_call = self.put_call.value + + qty = self.qty + + req_ord_id = self.req_ord_id + + root = self.root + + route = self.route + + routing_session = self.routing_session + + security_type: Unset | str = UNSET + if not isinstance(self.security_type, Unset): + security_type = self.security_type.value + + settlement_type: Unset | str = UNSET + if not isinstance(self.settlement_type, Unset): + settlement_type = self.settlement_type.value + + side: Unset | str = UNSET + if not isinstance(self.side, Unset): + side = self.side.value + + source = self.source + + source_address = self.source_address + + strategy_id = self.strategy_id + + strike = self.strike + + symbol = self.symbol + + tag = self.tag + + tag1 = self.tag1 + + target_comp_id = self.target_comp_id + + target_sub_id = self.target_sub_id + + text = self.text + + tif: Unset | str = UNSET + if not isinstance(self.tif, Unset): + tif = self.tif.value + + traded_dt: Unset | dict[str, Any] = UNSET + if not isinstance(self.traded_dt, Unset): + traded_dt = self.traded_dt.to_dict() + + trader_id = self.trader_id + + trading_firm_id = self.trading_firm_id + + transact_ts = self.transact_ts + + underlying = self.underlying + + user_id = self.user_id + + working_qty = self.working_qty + + multiplier = self.multiplier + + dac_delta = self.dac_delta + + dac_reference_price = self.dac_reference_price + + manual_fill_time = self.manual_fill_time + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if account_id is not UNSET: + field_dict["accountId"] = account_id + if account_name is not UNSET: + field_dict["accountName"] = account_name + if alloc_id is not UNSET: + field_dict["allocId"] = alloc_id + if alloc_qty is not UNSET: + field_dict["allocQty"] = alloc_qty + if aux_price is not UNSET: + field_dict["auxPrice"] = aux_price + if avg_price is not UNSET: + field_dict["avgPrice"] = avg_price + if billing_code is not UNSET: + field_dict["billingCode"] = billing_code + if capacity is not UNSET: + field_dict["capacity"] = capacity + if clearing_account is not UNSET: + field_dict["clearingAccount"] = clearing_account + if clearing_range is not UNSET: + field_dict["clearingRange"] = clearing_range + if client_id is not UNSET: + field_dict["clientId"] = client_id + if cmta is not UNSET: + field_dict["cmta"] = cmta + if commission is not UNSET: + field_dict["commission"] = commission + if cross_side_type is not UNSET: + field_dict["crossSideType"] = cross_side_type + if cross_type is not UNSET: + field_dict["crossType"] = cross_type + if cum_qty is not UNSET: + field_dict["cumQty"] = cum_qty + if cur_ord_id is not UNSET: + field_dict["curOrdId"] = cur_ord_id + if deliver_to_compid is not UNSET: + field_dict["deliverToCompid"] = deliver_to_compid + if deliver_to_subid is not UNSET: + field_dict["deliverToSubid"] = deliver_to_subid + if description is not UNSET: + field_dict["description"] = description + if drop is not UNSET: + field_dict["drop"] = drop + if efid is not UNSET: + field_dict["efid"] = efid + if exec_broker is not UNSET: + field_dict["execBroker"] = exec_broker + if exec_id is not UNSET: + field_dict["execId"] = exec_id + if exec_ref_id is not UNSET: + field_dict["execRefId"] = exec_ref_id + if exec_type is not UNSET: + field_dict["execType"] = exec_type + if exercise_style is not UNSET: + field_dict["exerciseStyle"] = exercise_style + if expiration_dt is not UNSET: + field_dict["expirationDt"] = expiration_dt + if fee1 is not UNSET: + field_dict["fee1"] = fee1 + if fee2 is not UNSET: + field_dict["fee2"] = fee2 + if frequent_trader_id is not UNSET: + field_dict["frequentTraderId"] = frequent_trader_id + if give_up is not UNSET: + field_dict["giveUp"] = give_up + if id is not UNSET: + field_dict["id"] = id + if incoming_cl_ord_id is not UNSET: + field_dict["incomingClOrdId"] = incoming_cl_ord_id + if incoming_ord_id is not UNSET: + field_dict["incomingOrdId"] = incoming_ord_id + if incoming_orig_clord_id is not UNSET: + field_dict["incomingOrigClordId"] = incoming_orig_clord_id + if last_market is not UNSET: + field_dict["lastMarket"] = last_market + if last_price is not UNSET: + field_dict["lastPrice"] = last_price + if last_qty is not UNSET: + field_dict["lastQty"] = last_qty + if leaves_qty is not UNSET: + field_dict["leavesQty"] = leaves_qty + if leg_id is not UNSET: + field_dict["legId"] = leg_id + if liquidity_flag is not UNSET: + field_dict["liquidityFlag"] = liquidity_flag + if locate_id is not UNSET: + field_dict["locateId"] = locate_id + if mpid is not UNSET: + field_dict["mpid"] = mpid + if multi_leg_reportingtype is not UNSET: + field_dict["multiLegReportingtype"] = multi_leg_reportingtype + if ord_type is not UNSET: + field_dict["ordType"] = ord_type + if origination_type is not UNSET: + field_dict["originationType"] = origination_type + if orig_ord_id is not UNSET: + field_dict["origOrdId"] = orig_ord_id + if parent_ord_id is not UNSET: + field_dict["parentOrdId"] = parent_ord_id + if perm_ord_id is not UNSET: + field_dict["permOrdId"] = perm_ord_id + if position_effect is not UNSET: + field_dict["positionEffect"] = position_effect + if price is not UNSET: + field_dict["price"] = price + if price_type is not UNSET: + field_dict["priceType"] = price_type + if put_call is not UNSET: + field_dict["putCall"] = put_call + if qty is not UNSET: + field_dict["qty"] = qty + if req_ord_id is not UNSET: + field_dict["reqOrdId"] = req_ord_id + if root is not UNSET: + field_dict["root"] = root + if route is not UNSET: + field_dict["route"] = route + if routing_session is not UNSET: + field_dict["routingSession"] = routing_session + if security_type is not UNSET: + field_dict["securityType"] = security_type + if settlement_type is not UNSET: + field_dict["settlementType"] = settlement_type + if side is not UNSET: + field_dict["side"] = side + if source is not UNSET: + field_dict["source"] = source + if source_address is not UNSET: + field_dict["sourceAddress"] = source_address + if strategy_id is not UNSET: + field_dict["strategyId"] = strategy_id + if strike is not UNSET: + field_dict["strike"] = strike + if symbol is not UNSET: + field_dict["symbol"] = symbol + if tag is not UNSET: + field_dict["tag"] = tag + if tag1 is not UNSET: + field_dict["tag1"] = tag1 + if target_comp_id is not UNSET: + field_dict["targetCompId"] = target_comp_id + if target_sub_id is not UNSET: + field_dict["targetSubId"] = target_sub_id + if text is not UNSET: + field_dict["text"] = text + if tif is not UNSET: + field_dict["tif"] = tif + if traded_dt is not UNSET: + field_dict["tradedDt"] = traded_dt + if trader_id is not UNSET: + field_dict["traderId"] = trader_id + if trading_firm_id is not UNSET: + field_dict["tradingFirmId"] = trading_firm_id + if transact_ts is not UNSET: + field_dict["transactTs"] = transact_ts + if underlying is not UNSET: + field_dict["underlying"] = underlying + if user_id is not UNSET: + field_dict["userId"] = user_id + if working_qty is not UNSET: + field_dict["workingQty"] = working_qty + if multiplier is not UNSET: + field_dict["multiplier"] = multiplier + if dac_delta is not UNSET: + field_dict["dacDelta"] = dac_delta + if dac_reference_price is not UNSET: + field_dict["dacReferencePrice"] = dac_reference_price + if manual_fill_time is not UNSET: + field_dict["manualFillTime"] = manual_fill_time + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_id = d.pop("accountId", UNSET) + + account_name = d.pop("accountName", UNSET) + + alloc_id = d.pop("allocId", UNSET) + + alloc_qty = d.pop("allocQty", UNSET) + + aux_price = d.pop("auxPrice", UNSET) + + avg_price = d.pop("avgPrice", UNSET) + + billing_code = d.pop("billingCode", UNSET) + + _capacity = d.pop("capacity", UNSET) + capacity: Unset | CapacityCode + if isinstance(_capacity, Unset): + capacity = UNSET + else: + capacity = CapacityCode(_capacity) + + clearing_account = d.pop("clearingAccount", UNSET) + + _clearing_range = d.pop("clearingRange", UNSET) + clearing_range: Unset | ClearingRange + if isinstance(_clearing_range, Unset): + clearing_range = UNSET + else: + clearing_range = ClearingRange(_clearing_range) + + client_id = d.pop("clientId", UNSET) + + cmta = d.pop("cmta", UNSET) + + commission = d.pop("commission", UNSET) + + _cross_side_type = d.pop("crossSideType", UNSET) + cross_side_type: Unset | CrossSideType + if isinstance(_cross_side_type, Unset): + cross_side_type = UNSET + else: + cross_side_type = CrossSideType(_cross_side_type) + + _cross_type = d.pop("crossType", UNSET) + cross_type: Unset | CrossType + if isinstance(_cross_type, Unset): + cross_type = UNSET + else: + cross_type = CrossType(_cross_type) + + cum_qty = d.pop("cumQty", UNSET) + + cur_ord_id = d.pop("curOrdId", UNSET) + + deliver_to_compid = d.pop("deliverToCompid", UNSET) + + deliver_to_subid = d.pop("deliverToSubid", UNSET) + + description = d.pop("description", UNSET) + + drop = d.pop("drop", UNSET) + + efid = d.pop("efid", UNSET) + + exec_broker = d.pop("execBroker", UNSET) + + exec_id = d.pop("execId", UNSET) + + exec_ref_id = d.pop("execRefId", UNSET) + + _exec_type = d.pop("execType", UNSET) + exec_type: Unset | ExecType + if isinstance(_exec_type, Unset): + exec_type = UNSET + else: + exec_type = ExecType(_exec_type) + + _exercise_style = d.pop("exerciseStyle", UNSET) + exercise_style: Unset | OptionExerciseStyle + if isinstance(_exercise_style, Unset): + exercise_style = UNSET + else: + exercise_style = OptionExerciseStyle(_exercise_style) + + _expiration_dt = d.pop("expirationDt", UNSET) + expiration_dt: Unset | Date + if isinstance(_expiration_dt, Unset): + expiration_dt = UNSET + else: + expiration_dt = Date.from_dict(_expiration_dt) + + fee1 = d.pop("fee1", UNSET) + + fee2 = d.pop("fee2", UNSET) + + frequent_trader_id = d.pop("frequentTraderId", UNSET) + + give_up = d.pop("giveUp", UNSET) + + id = d.pop("id", UNSET) + + incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) + + incoming_ord_id = d.pop("incomingOrdId", UNSET) + + incoming_orig_clord_id = d.pop("incomingOrigClordId", UNSET) + + last_market = d.pop("lastMarket", UNSET) + + last_price = d.pop("lastPrice", UNSET) + + last_qty = d.pop("lastQty", UNSET) + + leaves_qty = d.pop("leavesQty", UNSET) + + leg_id = d.pop("legId", UNSET) + + liquidity_flag = d.pop("liquidityFlag", UNSET) + + locate_id = d.pop("locateId", UNSET) + + mpid = d.pop("mpid", UNSET) + + _multi_leg_reportingtype = d.pop("multiLegReportingtype", UNSET) + multi_leg_reportingtype: Unset | MultiLegReportingType + if isinstance(_multi_leg_reportingtype, Unset): + multi_leg_reportingtype = UNSET + else: + multi_leg_reportingtype = MultiLegReportingType(_multi_leg_reportingtype) + + _ord_type = d.pop("ordType", UNSET) + ord_type: Unset | OrdType + if isinstance(_ord_type, Unset): + ord_type = UNSET + else: + ord_type = OrdType(_ord_type) + + _origination_type = d.pop("originationType", UNSET) + origination_type: Unset | OriginationType + if isinstance(_origination_type, Unset): + origination_type = UNSET + else: + origination_type = OriginationType(_origination_type) + + orig_ord_id = d.pop("origOrdId", UNSET) + + parent_ord_id = d.pop("parentOrdId", UNSET) + + perm_ord_id = d.pop("permOrdId", UNSET) + + _position_effect = d.pop("positionEffect", UNSET) + position_effect: Unset | PositionEffect + if isinstance(_position_effect, Unset): + position_effect = UNSET + else: + position_effect = PositionEffect(_position_effect) + + price = d.pop("price", UNSET) + + _price_type = d.pop("priceType", UNSET) + price_type: Unset | PriceType + if isinstance(_price_type, Unset): + price_type = UNSET + else: + price_type = PriceType(_price_type) + + _put_call = d.pop("putCall", UNSET) + put_call: Unset | PutCall + if isinstance(_put_call, Unset): + put_call = UNSET + else: + put_call = PutCall(_put_call) + + qty = d.pop("qty", UNSET) + + req_ord_id = d.pop("reqOrdId", UNSET) + + root = d.pop("root", UNSET) + + route = d.pop("route", UNSET) + + routing_session = d.pop("routingSession", UNSET) + + _security_type = d.pop("securityType", UNSET) + security_type: Unset | SecurityType + if isinstance(_security_type, Unset): + security_type = UNSET + else: + security_type = SecurityType(_security_type) + + _settlement_type = d.pop("settlementType", UNSET) + settlement_type: Unset | OptionSettlementType + if isinstance(_settlement_type, Unset): + settlement_type = UNSET + else: + settlement_type = OptionSettlementType(_settlement_type) + + _side = d.pop("side", UNSET) + side: Unset | Side + if isinstance(_side, Unset): + side = UNSET + else: + side = Side(_side) + + source = d.pop("source", UNSET) + + source_address = d.pop("sourceAddress", UNSET) + + strategy_id = d.pop("strategyId", UNSET) + + strike = d.pop("strike", UNSET) + + symbol = d.pop("symbol", UNSET) + + tag = d.pop("tag", UNSET) + + tag1 = d.pop("tag1", UNSET) + + target_comp_id = d.pop("targetCompId", UNSET) + + target_sub_id = d.pop("targetSubId", UNSET) + + text = d.pop("text", UNSET) + + _tif = d.pop("tif", UNSET) + tif: Unset | Tif + if isinstance(_tif, Unset): + tif = UNSET + else: + tif = Tif(_tif) + + _traded_dt = d.pop("tradedDt", UNSET) + traded_dt: Unset | Date + if isinstance(_traded_dt, Unset): + traded_dt = UNSET + else: + traded_dt = Date.from_dict(_traded_dt) + + trader_id = d.pop("traderId", UNSET) + + trading_firm_id = d.pop("tradingFirmId", UNSET) + + transact_ts = d.pop("transactTs", UNSET) + + underlying = d.pop("underlying", UNSET) + + user_id = d.pop("userId", UNSET) + + working_qty = d.pop("workingQty", UNSET) + + multiplier = d.pop("multiplier", UNSET) + + dac_delta = d.pop("dacDelta", UNSET) + + dac_reference_price = d.pop("dacReferencePrice", UNSET) + + manual_fill_time = d.pop("manualFillTime", UNSET) + + trade_confirm = cls( + account_id=account_id, + account_name=account_name, + alloc_id=alloc_id, + alloc_qty=alloc_qty, + aux_price=aux_price, + avg_price=avg_price, + billing_code=billing_code, + capacity=capacity, + clearing_account=clearing_account, + clearing_range=clearing_range, + client_id=client_id, + cmta=cmta, + commission=commission, + cross_side_type=cross_side_type, + cross_type=cross_type, + cum_qty=cum_qty, + cur_ord_id=cur_ord_id, + deliver_to_compid=deliver_to_compid, + deliver_to_subid=deliver_to_subid, + description=description, + drop=drop, + efid=efid, + exec_broker=exec_broker, + exec_id=exec_id, + exec_ref_id=exec_ref_id, + exec_type=exec_type, + exercise_style=exercise_style, + expiration_dt=expiration_dt, + fee1=fee1, + fee2=fee2, + frequent_trader_id=frequent_trader_id, + give_up=give_up, + id=id, + incoming_cl_ord_id=incoming_cl_ord_id, + incoming_ord_id=incoming_ord_id, + incoming_orig_clord_id=incoming_orig_clord_id, + last_market=last_market, + last_price=last_price, + last_qty=last_qty, + leaves_qty=leaves_qty, + leg_id=leg_id, + liquidity_flag=liquidity_flag, + locate_id=locate_id, + mpid=mpid, + multi_leg_reportingtype=multi_leg_reportingtype, + ord_type=ord_type, + origination_type=origination_type, + orig_ord_id=orig_ord_id, + parent_ord_id=parent_ord_id, + perm_ord_id=perm_ord_id, + position_effect=position_effect, + price=price, + price_type=price_type, + put_call=put_call, + qty=qty, + req_ord_id=req_ord_id, + root=root, + route=route, + routing_session=routing_session, + security_type=security_type, + settlement_type=settlement_type, + side=side, + source=source, + source_address=source_address, + strategy_id=strategy_id, + strike=strike, + symbol=symbol, + tag=tag, + tag1=tag1, + target_comp_id=target_comp_id, + target_sub_id=target_sub_id, + text=text, + tif=tif, + traded_dt=traded_dt, + trader_id=trader_id, + trading_firm_id=trading_firm_id, + transact_ts=transact_ts, + underlying=underlying, + user_id=user_id, + working_qty=working_qty, + multiplier=multiplier, + dac_delta=dac_delta, + dac_reference_price=dac_reference_price, + manual_fill_time=manual_fill_time, + ) + + return trade_confirm diff --git a/openapi_project/openapi_package/models/trading_firm.py b/openapi_project/openapi_package/models/trading_firm.py new file mode 100644 index 000000000..2b9de2c65 --- /dev/null +++ b/openapi_project/openapi_package/models/trading_firm.py @@ -0,0 +1,71 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="TradingFirm") + + +@_attrs_define +class TradingFirm: + """ + Attributes: + id (Unset | int): + eq_mpid (Unset | str): + name (Unset | str): + occ_clearing_number (Unset | str): + """ + + id: Unset | int = UNSET + eq_mpid: Unset | str = UNSET + name: Unset | str = UNSET + occ_clearing_number: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + id = self.id + + eq_mpid = self.eq_mpid + + name = self.name + + occ_clearing_number = self.occ_clearing_number + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if eq_mpid is not UNSET: + field_dict["eqMpid"] = eq_mpid + if name is not UNSET: + field_dict["name"] = name + if occ_clearing_number is not UNSET: + field_dict["occClearingNumber"] = occ_clearing_number + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + eq_mpid = d.pop("eqMpid", UNSET) + + name = d.pop("name", UNSET) + + occ_clearing_number = d.pop("occClearingNumber", UNSET) + + trading_firm = cls( + id=id, + eq_mpid=eq_mpid, + name=name, + occ_clearing_number=occ_clearing_number, + ) + + return trading_firm diff --git a/openapi_project/openapi_package/models/trading_firm_slim.py b/openapi_project/openapi_package/models/trading_firm_slim.py new file mode 100644 index 000000000..1214adb87 --- /dev/null +++ b/openapi_project/openapi_package/models/trading_firm_slim.py @@ -0,0 +1,53 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="TradingFirmSlim") + + +@_attrs_define +class TradingFirmSlim: + """ + Attributes: + id (Unset | int): + name (Unset | str): + """ + + id: Unset | int = UNSET + name: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if name is not UNSET: + field_dict["name"] = name + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + name = d.pop("name", UNSET) + + trading_firm_slim = cls( + id=id, + name=name, + ) + + return trading_firm_slim diff --git a/openapi_project/openapi_package/models/trading_holiday.py b/openapi_project/openapi_package/models/trading_holiday.py new file mode 100644 index 000000000..dd783dc72 --- /dev/null +++ b/openapi_project/openapi_package/models/trading_holiday.py @@ -0,0 +1,99 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.country import Country +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.date import Date + + +T = TypeVar("T", bound="TradingHoliday") + + +@_attrs_define +class TradingHoliday: + """ + Attributes: + id (Unset | int): + country (Unset | Country): + date (Unset | Date): + description (Unset | str): + is_early_close (Unset | bool): + """ + + id: Unset | int = UNSET + country: Unset | Country = UNSET + date: Unset | "Date" = UNSET + description: Unset | str = UNSET + is_early_close: Unset | bool = UNSET + + def to_dict(self) -> dict[str, Any]: + id = self.id + + country: Unset | str = UNSET + if not isinstance(self.country, Unset): + country = self.country.value + + date: Unset | dict[str, Any] = UNSET + if not isinstance(self.date, Unset): + date = self.date.to_dict() + + description = self.description + + is_early_close = self.is_early_close + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if country is not UNSET: + field_dict["country"] = country + if date is not UNSET: + field_dict["date"] = date + if description is not UNSET: + field_dict["description"] = description + if is_early_close is not UNSET: + field_dict["isEarlyClose"] = is_early_close + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + _country = d.pop("country", UNSET) + country: Unset | Country + if isinstance(_country, Unset): + country = UNSET + else: + country = Country(_country) + + _date = d.pop("date", UNSET) + date: Unset | Date + if isinstance(_date, Unset): + date = UNSET + else: + date = Date.from_dict(_date) + + description = d.pop("description", UNSET) + + is_early_close = d.pop("isEarlyClose", UNSET) + + trading_holiday = cls( + id=id, + country=country, + date=date, + description=description, + is_early_close=is_early_close, + ) + + return trading_holiday diff --git a/openapi_project/openapi_package/models/trading_session.py b/openapi_project/openapi_package/models/trading_session.py new file mode 100644 index 000000000..e239fb8f1 --- /dev/null +++ b/openapi_project/openapi_package/models/trading_session.py @@ -0,0 +1,107 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.time_of_day import TimeOfDay + + +T = TypeVar("T", bound="TradingSession") + + +@_attrs_define +class TradingSession: + """ + Attributes: + days_of_the_week (Unset | str): + end_time (Unset | TimeOfDay): + id (Unset | int): + name (Unset | str): + start_time (Unset | TimeOfDay): + trading_session_group_id (Unset | int): + """ + + days_of_the_week: Unset | str = UNSET + end_time: Unset | "TimeOfDay" = UNSET + id: Unset | int = UNSET + name: Unset | str = UNSET + start_time: Unset | "TimeOfDay" = UNSET + trading_session_group_id: Unset | int = UNSET + + def to_dict(self) -> dict[str, Any]: + days_of_the_week = self.days_of_the_week + + end_time: Unset | dict[str, Any] = UNSET + if not isinstance(self.end_time, Unset): + end_time = self.end_time.to_dict() + + id = self.id + + name = self.name + + start_time: Unset | dict[str, Any] = UNSET + if not isinstance(self.start_time, Unset): + start_time = self.start_time.to_dict() + + trading_session_group_id = self.trading_session_group_id + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if days_of_the_week is not UNSET: + field_dict["daysOfTheWeek"] = days_of_the_week + if end_time is not UNSET: + field_dict["endTime"] = end_time + if id is not UNSET: + field_dict["id"] = id + if name is not UNSET: + field_dict["name"] = name + if start_time is not UNSET: + field_dict["startTime"] = start_time + if trading_session_group_id is not UNSET: + field_dict["tradingSessionGroupId"] = trading_session_group_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + days_of_the_week = d.pop("daysOfTheWeek", UNSET) + + _end_time = d.pop("endTime", UNSET) + end_time: Unset | TimeOfDay + if isinstance(_end_time, Unset): + end_time = UNSET + else: + end_time = TimeOfDay.from_dict(_end_time) + + id = d.pop("id", UNSET) + + name = d.pop("name", UNSET) + + _start_time = d.pop("startTime", UNSET) + start_time: Unset | TimeOfDay + if isinstance(_start_time, Unset): + start_time = UNSET + else: + start_time = TimeOfDay.from_dict(_start_time) + + trading_session_group_id = d.pop("tradingSessionGroupId", UNSET) + + trading_session = cls( + days_of_the_week=days_of_the_week, + end_time=end_time, + id=id, + name=name, + start_time=start_time, + trading_session_group_id=trading_session_group_id, + ) + + return trading_session diff --git a/openapi_project/openapi_package/models/trading_session_group.py b/openapi_project/openapi_package/models/trading_session_group.py new file mode 100644 index 000000000..37d983bb5 --- /dev/null +++ b/openapi_project/openapi_package/models/trading_session_group.py @@ -0,0 +1,76 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.trading_session import TradingSession + + +T = TypeVar("T", bound="TradingSessionGroup") + + +@_attrs_define +class TradingSessionGroup: + """ + Attributes: + id (Unset | int): + name (Unset | str): + sessions (Unset | list['TradingSession']): + """ + + id: Unset | int = UNSET + name: Unset | str = UNSET + sessions: Unset | list["TradingSession"] = UNSET + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + sessions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.sessions, Unset): + sessions = [] + for sessions_item_data in self.sessions: + sessions_item = sessions_item_data.to_dict() + sessions.append(sessions_item) + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if name is not UNSET: + field_dict["name"] = name + if sessions is not UNSET: + field_dict["sessions"] = sessions + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id", UNSET) + + name = d.pop("name", UNSET) + + sessions = [] + _sessions = d.pop("sessions", UNSET) + for sessions_item_data in _sessions or []: + sessions_item = TradingSession.from_dict(sessions_item_data) + + sessions.append(sessions_item) + + trading_session_group = cls( + id=id, + name=name, + sessions=sessions, + ) + + return trading_session_group diff --git a/openapi_project/openapi_package/models/user.py b/openapi_project/openapi_package/models/user.py new file mode 100644 index 000000000..1dd17f54d --- /dev/null +++ b/openapi_project/openapi_package/models/user.py @@ -0,0 +1,244 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.user_location import UserLocation +from ..models.user_status import UserStatus +from ..models.user_type import UserType +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.user_permission import UserPermission + + +T = TypeVar("T", bound="User") + + +@_attrs_define +class User: + """ + Attributes: + domain (Unset | str): + email (Unset | str): + first_name (Unset | str): + id (Unset | int): + is_locked_out (Unset | bool): + last_name (Unset | str): + location (Unset | UserLocation): + phone_primary (Unset | str): + phone_secondary (Unset | str): + region (Unset | str): + region_code (Unset | str): + status (Unset | UserStatus): + trading_firm_id (Unset | int): + type_ (Unset | UserType): + user_name (Unset | str): + city (Unset | str): + permissions (Unset | list['UserPermission']): + setup_ticket (Unset | str): + large_trader_id (Unset | str): + """ + + domain: Unset | str = UNSET + email: Unset | str = UNSET + first_name: Unset | str = UNSET + id: Unset | int = UNSET + is_locked_out: Unset | bool = UNSET + last_name: Unset | str = UNSET + location: Unset | UserLocation = UNSET + phone_primary: Unset | str = UNSET + phone_secondary: Unset | str = UNSET + region: Unset | str = UNSET + region_code: Unset | str = UNSET + status: Unset | UserStatus = UNSET + trading_firm_id: Unset | int = UNSET + type_: Unset | UserType = UNSET + user_name: Unset | str = UNSET + city: Unset | str = UNSET + permissions: Unset | list["UserPermission"] = UNSET + setup_ticket: Unset | str = UNSET + large_trader_id: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + domain = self.domain + + email = self.email + + first_name = self.first_name + + id = self.id + + is_locked_out = self.is_locked_out + + last_name = self.last_name + + location: Unset | str = UNSET + if not isinstance(self.location, Unset): + location = self.location.value + + phone_primary = self.phone_primary + + phone_secondary = self.phone_secondary + + region = self.region + + region_code = self.region_code + + status: Unset | str = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + trading_firm_id = self.trading_firm_id + + type_: Unset | str = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + user_name = self.user_name + + city = self.city + + permissions: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.permissions, Unset): + permissions = [] + for permissions_item_data in self.permissions: + permissions_item = permissions_item_data.to_dict() + permissions.append(permissions_item) + + setup_ticket = self.setup_ticket + + large_trader_id = self.large_trader_id + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if domain is not UNSET: + field_dict["domain"] = domain + if email is not UNSET: + field_dict["email"] = email + if first_name is not UNSET: + field_dict["firstName"] = first_name + if id is not UNSET: + field_dict["id"] = id + if is_locked_out is not UNSET: + field_dict["isLockedOut"] = is_locked_out + if last_name is not UNSET: + field_dict["lastName"] = last_name + if location is not UNSET: + field_dict["location"] = location + if phone_primary is not UNSET: + field_dict["phonePrimary"] = phone_primary + if phone_secondary is not UNSET: + field_dict["phoneSecondary"] = phone_secondary + if region is not UNSET: + field_dict["region"] = region + if region_code is not UNSET: + field_dict["regionCode"] = region_code + if status is not UNSET: + field_dict["status"] = status + if trading_firm_id is not UNSET: + field_dict["tradingFirmId"] = trading_firm_id + if type_ is not UNSET: + field_dict["type"] = type_ + if user_name is not UNSET: + field_dict["userName"] = user_name + if city is not UNSET: + field_dict["city"] = city + if permissions is not UNSET: + field_dict["permissions"] = permissions + if setup_ticket is not UNSET: + field_dict["setupTicket"] = setup_ticket + if large_trader_id is not UNSET: + field_dict["largeTraderId"] = large_trader_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + domain = d.pop("domain", UNSET) + + email = d.pop("email", UNSET) + + first_name = d.pop("firstName", UNSET) + + id = d.pop("id", UNSET) + + is_locked_out = d.pop("isLockedOut", UNSET) + + last_name = d.pop("lastName", UNSET) + + _location = d.pop("location", UNSET) + location: Unset | UserLocation + if isinstance(_location, Unset): + location = UNSET + else: + location = UserLocation(_location) + + phone_primary = d.pop("phonePrimary", UNSET) + + phone_secondary = d.pop("phoneSecondary", UNSET) + + region = d.pop("region", UNSET) + + region_code = d.pop("regionCode", UNSET) + + _status = d.pop("status", UNSET) + status: Unset | UserStatus + if isinstance(_status, Unset): + status = UNSET + else: + status = UserStatus(_status) + + trading_firm_id = d.pop("tradingFirmId", UNSET) + + _type_ = d.pop("type", UNSET) + type_: Unset | UserType + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = UserType(_type_) + + user_name = d.pop("userName", UNSET) + + city = d.pop("city", UNSET) + + permissions = [] + _permissions = d.pop("permissions", UNSET) + for permissions_item_data in _permissions or []: + permissions_item = UserPermission.from_dict(permissions_item_data) + + permissions.append(permissions_item) + + setup_ticket = d.pop("setupTicket", UNSET) + + large_trader_id = d.pop("largeTraderId", UNSET) + + user = cls( + domain=domain, + email=email, + first_name=first_name, + id=id, + is_locked_out=is_locked_out, + last_name=last_name, + location=location, + phone_primary=phone_primary, + phone_secondary=phone_secondary, + region=region, + region_code=region_code, + status=status, + trading_firm_id=trading_firm_id, + type_=type_, + user_name=user_name, + city=city, + permissions=permissions, + setup_ticket=setup_ticket, + large_trader_id=large_trader_id, + ) + + return user diff --git a/openapi_project/openapi_package/models/user_location.py b/openapi_project/openapi_package/models/user_location.py new file mode 100644 index 000000000..73fba2ea4 --- /dev/null +++ b/openapi_project/openapi_package/models/user_location.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class UserLocation(str, Enum): + USER_LOCATION_OFF_FLOOR = "USER_LOCATION_OFF_FLOOR" + USER_LOCATION_ON_FLOOR = "USER_LOCATION_ON_FLOOR" + USER_LOCATION_UNKNOWN = "USER_LOCATION_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/user_permission.py b/openapi_project/openapi_package/models/user_permission.py new file mode 100644 index 000000000..e4372fd54 --- /dev/null +++ b/openapi_project/openapi_package/models/user_permission.py @@ -0,0 +1,70 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.claim_type import ClaimType +from ..types import UNSET, Unset + + +T = TypeVar("T", bound="UserPermission") + + +@_attrs_define +class UserPermission: + """ + Attributes: + claim (Unset | str): + claim_type (Unset | ClaimType): + description (Unset | str): + """ + + claim: Unset | str = UNSET + claim_type: Unset | ClaimType = UNSET + description: Unset | str = UNSET + + def to_dict(self) -> dict[str, Any]: + claim = self.claim + + claim_type: Unset | str = UNSET + if not isinstance(self.claim_type, Unset): + claim_type = self.claim_type.value + + description = self.description + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if claim is not UNSET: + field_dict["claim"] = claim + if claim_type is not UNSET: + field_dict["claimType"] = claim_type + if description is not UNSET: + field_dict["description"] = description + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + claim = d.pop("claim", UNSET) + + _claim_type = d.pop("claimType", UNSET) + claim_type: Unset | ClaimType + if isinstance(_claim_type, Unset): + claim_type = UNSET + else: + claim_type = ClaimType(_claim_type) + + description = d.pop("description", UNSET) + + user_permission = cls( + claim=claim, + claim_type=claim_type, + description=description, + ) + + return user_permission diff --git a/openapi_project/openapi_package/models/user_status.py b/openapi_project/openapi_package/models/user_status.py new file mode 100644 index 000000000..88da2b504 --- /dev/null +++ b/openapi_project/openapi_package/models/user_status.py @@ -0,0 +1,12 @@ +from enum import Enum + + +class UserStatus(str, Enum): + USER_STATUS_ACTIVE = "USER_STATUS_ACTIVE" + USER_STATUS_DELETED = "USER_STATUS_DELETED" + USER_STATUS_DISABLED = "USER_STATUS_DISABLED" + USER_STATUS_UNKNOWN = "USER_STATUS_UNKNOWN" + USER_STATUS_VIEW_ONLY = "USER_STATUS_VIEW_ONLY" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/user_type.py b/openapi_project/openapi_package/models/user_type.py new file mode 100644 index 000000000..95a3da9d0 --- /dev/null +++ b/openapi_project/openapi_package/models/user_type.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class UserType(str, Enum): + USER_TYPE_API = "USER_TYPE_API" + USER_TYPE_GUI = "USER_TYPE_GUI" + USER_TYPE_UNKNOWN = "USER_TYPE_UNKNOWN" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/validate_risk_response.py b/openapi_project/openapi_package/models/validate_risk_response.py new file mode 100644 index 000000000..333a1b78e --- /dev/null +++ b/openapi_project/openapi_package/models/validate_risk_response.py @@ -0,0 +1,93 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.status_code import StatusCode +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.risk_reject import RiskReject + + +T = TypeVar("T", bound="ValidateRiskResponse") + + +@_attrs_define +class ValidateRiskResponse: + """ + Attributes: + is_valid (Unset | bool): + risk_rejects (Unset | list['RiskReject']): + error_message (Unset | str): + status_code (Unset | StatusCode): + """ + + is_valid: Unset | bool = UNSET + risk_rejects: Unset | list["RiskReject"] = UNSET + error_message: Unset | str = UNSET + status_code: Unset | StatusCode = UNSET + + def to_dict(self) -> dict[str, Any]: + is_valid = self.is_valid + + risk_rejects: Unset | list[dict[str, Any]] = UNSET + if not isinstance(self.risk_rejects, Unset): + risk_rejects = [] + for risk_rejects_item_data in self.risk_rejects: + risk_rejects_item = risk_rejects_item_data.to_dict() + risk_rejects.append(risk_rejects_item) + + error_message = self.error_message + + status_code: Unset | str = UNSET + if not isinstance(self.status_code, Unset): + status_code = self.status_code.value + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if is_valid is not UNSET: + field_dict["isValid"] = is_valid + if risk_rejects is not UNSET: + field_dict["riskRejects"] = risk_rejects + if error_message is not UNSET: + field_dict["errorMessage"] = error_message + if status_code is not UNSET: + field_dict["statusCode"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + is_valid = d.pop("isValid", UNSET) + + risk_rejects = [] + _risk_rejects = d.pop("riskRejects", UNSET) + for risk_rejects_item_data in _risk_rejects or []: + risk_rejects_item = RiskReject.from_dict(risk_rejects_item_data) + + risk_rejects.append(risk_rejects_item) + + error_message = d.pop("errorMessage", UNSET) + + _status_code = d.pop("statusCode", UNSET) + status_code: Unset | StatusCode + if isinstance(_status_code, Unset): + status_code = UNSET + else: + status_code = StatusCode(_status_code) + + validate_risk_response = cls( + is_valid=is_valid, + risk_rejects=risk_rejects, + error_message=error_message, + status_code=status_code, + ) + + return validate_risk_response diff --git a/openapi_project/openapi_package/models/volatility_shock_skew.py b/openapi_project/openapi_package/models/volatility_shock_skew.py new file mode 100644 index 000000000..ba182d91a --- /dev/null +++ b/openapi_project/openapi_package/models/volatility_shock_skew.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class VolatilityShockSkew(str, Enum): + VOLATILITY_SHOCK_SKEW_STICKY_DELTA = "VOLATILITY_SHOCK_SKEW_STICKY_DELTA" + VOLATILITY_SHOCK_SKEW_STICKY_STRIKE = "VOLATILITY_SHOCK_SKEW_STICKY_STRIKE" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/volatility_shock_type.py b/openapi_project/openapi_package/models/volatility_shock_type.py new file mode 100644 index 000000000..4757c0b0c --- /dev/null +++ b/openapi_project/openapi_package/models/volatility_shock_type.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class VolatilityShockType(str, Enum): + VOLATILITY_SHOCK_TYPE_ABSOLUTE = "VOLATILITY_SHOCK_TYPE_ABSOLUTE" + VOLATILITY_SHOCK_TYPE_RELATIVE = "VOLATILITY_SHOCK_TYPE_RELATIVE" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/py.typed b/openapi_project/openapi_package/py.typed new file mode 100644 index 000000000..1aad32711 --- /dev/null +++ b/openapi_project/openapi_package/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561 \ No newline at end of file diff --git a/openapi_project/openapi_package/types.py b/openapi_project/openapi_package/types.py new file mode 100644 index 000000000..6911ee49e --- /dev/null +++ b/openapi_project/openapi_package/types.py @@ -0,0 +1,55 @@ +"""Contains some shared types for properties""" + +from collections.abc import Mapping, MutableMapping +from http import HTTPStatus +from typing import BinaryIO, Generic, TypeVar, Literal, IO + +from attrs import define + + +class Unset: + def __bool__(self) -> Literal[False]: + return False + + +UNSET: Unset = Unset() + +# The types that `httpx.Client(files=)` can accept, copied from that library. +FileContent = IO[bytes] | bytes | str +FileTypes = ( + # (filename, file (or bytes), content_type) + tuple[str | None, FileContent, str | None] + | + # (filename, file (or bytes), content_type, headers) + tuple[str | None, FileContent, str | None, Mapping[str, str]] +) +RequestFiles = list[tuple[str, FileTypes]] + + +@define +class File: + """Contains information for file uploads""" + + payload: BinaryIO + file_name: str | None = None + mime_type: str | None = None + + def to_tuple(self) -> FileTypes: + """Return a tuple representation that httpx will accept for multipart/form-data""" + return self.file_name, self.payload, self.mime_type + + +T = TypeVar("T") + + +@define +class Response(Generic[T]): + """A response from an endpoint""" + + status_code: HTTPStatus + content: bytes + headers: MutableMapping[str, str] + parsed: T | None + + +__all__ = ["UNSET", "File", "FileTypes", "RequestFiles", "Response", "Unset"] diff --git a/openapi_project/pyproject.toml b/openapi_project/pyproject.toml new file mode 100644 index 000000000..e69de29bb diff --git a/openapi_python_client/__init__.py b/openapi_python_client/__init__.py index a9accab71..610207354 100644 --- a/openapi_python_client/__init__.py +++ b/openapi_python_client/__init__.py @@ -12,7 +12,13 @@ import httpcore import httpx -from jinja2 import BaseLoader, ChoiceLoader, Environment, FileSystemLoader, PackageLoader +from jinja2 import ( + BaseLoader, + ChoiceLoader, + Environment, + FileSystemLoader, + PackageLoader, +) from ruamel.yaml import YAML from ruamel.yaml.error import YAMLError @@ -66,8 +72,13 @@ def __init__( keep_trailing_newline=True, ) - self.project_name: str = config.project_name_override or f"{utils.kebab_case(openapi.title).lower()}-client" - self.package_name: str = config.package_name_override or self.project_name.replace("-", "_") + self.project_name: str = ( + config.project_name_override + or f"{utils.kebab_case(openapi.title).lower()}-client" + ) + self.package_name: str = ( + config.package_name_override or self.project_name.replace("-", "_") + ) self.project_dir: Path # Where the generated code will be placed self.package_dir: Path # Where the generated Python module will be placed (same as project_dir if no meta) @@ -113,7 +124,11 @@ def build(self) -> Sequence[GeneratorError]: self.project_dir.mkdir() except FileExistsError: if not self.config.overwrite: - return [GeneratorError(detail="Directory already exists. Delete it or use the --overwrite option.")] + return [ + GeneratorError( + detail="Directory already exists. Delete it or use the --overwrite option." + ) + ] self._create_package() self._build_metadata() self._build_models() @@ -131,7 +146,9 @@ def _run_command(self, cmd: str) -> None: if not command_exists: self.errors.append( GeneratorError( - level=ErrorLevel.WARNING, header="Skipping Integration", detail=f"{cmd_name} is not in PATH" + level=ErrorLevel.WARNING, + header="Skipping Integration", + detail=f"{cmd_name} is not in PATH", ) ) return @@ -162,15 +179,21 @@ def _create_package(self) -> None: package_init = self.package_dir / "__init__.py" package_init_template = self.env.get_template("package_init.py.jinja") - package_init.write_text(package_init_template.render(), encoding=self.config.file_encoding) + package_init.write_text( + package_init_template.render(), encoding=self.config.file_encoding + ) if self.config.meta_type != MetaType.NONE: pytyped = self.package_dir / "py.typed" - pytyped.write_text("# Marker file for PEP 561", encoding=self.config.file_encoding) + pytyped.write_text( + "# Marker file for PEP 561", encoding=self.config.file_encoding + ) types_template = self.env.get_template("types.py.jinja") types_path = self.package_dir / "types.py" - types_path.write_text(types_template.render(), encoding=self.config.file_encoding) + types_path.write_text( + types_template.render(), encoding=self.config.file_encoding + ) def _build_metadata(self) -> None: if self.config.meta_type == MetaType.NONE: @@ -191,7 +214,9 @@ def _build_metadata(self) -> None: # .gitignore git_ignore_path = self.project_dir / ".gitignore" git_ignore_template = self.env.get_template(".gitignore.jinja") - git_ignore_path.write_text(git_ignore_template.render(), encoding=self.config.file_encoding) + git_ignore_path.write_text( + git_ignore_template.render(), encoding=self.config.file_encoding + ) def _build_pyproject_toml(self) -> None: template = "pyproject.toml.jinja" @@ -222,7 +247,9 @@ def _build_models(self) -> None: model_template = self.env.get_template("model.py.jinja") for model in self.openapi.models: module_path = models_dir / f"{model.class_info.module_name}.py" - module_path.write_text(model_template.render(model=model), encoding=self.config.file_encoding) + module_path.write_text( + model_template.render(model=model), encoding=self.config.file_encoding + ) imports.append(import_string_from_class(model.class_info)) alls.append(model.class_info.name) @@ -233,29 +260,43 @@ def _build_models(self) -> None: for enum in self.openapi.enums: module_path = models_dir / f"{enum.class_info.module_name}.py" if isinstance(enum, LiteralEnumProperty): - module_path.write_text(literal_enum_template.render(enum=enum), encoding=self.config.file_encoding) + module_path.write_text( + literal_enum_template.render(enum=enum), + encoding=self.config.file_encoding, + ) elif enum.value_type is int: - module_path.write_text(int_enum_template.render(enum=enum), encoding=self.config.file_encoding) + module_path.write_text( + int_enum_template.render(enum=enum), + encoding=self.config.file_encoding, + ) else: - module_path.write_text(str_enum_template.render(enum=enum), encoding=self.config.file_encoding) + module_path.write_text( + str_enum_template.render(enum=enum), + encoding=self.config.file_encoding, + ) imports.append(import_string_from_class(enum.class_info)) alls.append(enum.class_info.name) models_init_template = self.env.get_template("models_init.py.jinja") models_init.write_text( - models_init_template.render(imports=imports, alls=alls), encoding=self.config.file_encoding + models_init_template.render(imports=imports, alls=alls), + encoding=self.config.file_encoding, ) def _build_api(self) -> None: # Generate Client client_path = self.package_dir / "client.py" client_template = self.env.get_template("client.py.jinja") - client_path.write_text(client_template.render(), encoding=self.config.file_encoding) + client_path.write_text( + client_template.render(), encoding=self.config.file_encoding + ) # Generate included Errors errors_path = self.package_dir / "errors.py" errors_template = self.env.get_template("errors.py.jinja") - errors_path.write_text(errors_template.render(), encoding=self.config.file_encoding) + errors_path.write_text( + errors_template.render(), encoding=self.config.file_encoding + ) # Generate endpoints api_dir = self.package_dir / "api" @@ -263,11 +304,14 @@ def _build_api(self) -> None: api_dir.mkdir() api_init_path = api_dir / "__init__.py" api_init_template = self.env.get_template("api_init.py.jinja") - api_init_path.write_text(api_init_template.render(), encoding=self.config.file_encoding) + api_init_path.write_text( + api_init_template.render(), encoding=self.config.file_encoding + ) endpoint_collections_by_tag = self.openapi.endpoint_collections_by_tag endpoint_template = self.env.get_template( - "endpoint_module.py.jinja", globals={"isbool": lambda obj: obj.get_base_type_string() == "bool"} + "endpoint_module.py.jinja", + globals={"isbool": lambda obj: obj.get_base_type_string() == "bool"}, ) for tag, collection in endpoint_collections_by_tag.items(): tag_dir = api_dir / tag @@ -281,7 +325,10 @@ def _build_api(self) -> None: ) for endpoint in collection.endpoints: - module_path = tag_dir / f"{utils.PythonIdentifier(endpoint.name, self.config.field_prefix)}.py" + module_path = ( + tag_dir + / f"{utils.PythonIdentifier(endpoint.name, self.config.field_prefix)}.py" + ) module_path.write_text( endpoint_template.render( endpoint=endpoint, @@ -294,7 +341,9 @@ def _get_project_for_url_or_path( config: Config, custom_template_path: Optional[Path] = None, ) -> Union[Project, GeneratorError]: - data_dict = _get_document(source=config.document_source, timeout=config.http_timeout) + data_dict = _get_document( + source=config.document_source, timeout=config.http_timeout + ) if isinstance(data_dict, GeneratorError): return data_dict openapi = GeneratorData.from_dict(data_dict, config=config) @@ -327,7 +376,9 @@ def generate( return project.build() -def _load_yaml_or_json(data: bytes, content_type: Optional[str]) -> Union[dict[str, Any], GeneratorError]: +def _load_yaml_or_json( + data: bytes, content_type: Optional[str] +) -> Union[dict[str, Any], GeneratorError]: if content_type == "application/json": try: return json.loads(data.decode()) @@ -341,7 +392,9 @@ def _load_yaml_or_json(data: bytes, content_type: Optional[str]) -> Union[dict[s return GeneratorError(header=f"Invalid YAML from provided source: {err}") -def _get_document(*, source: Union[str, Path], timeout: int) -> Union[dict[str, Any], GeneratorError]: +def _get_document( + *, source: Union[str, Path], timeout: int +) -> Union[dict[str, Any], GeneratorError]: yaml_bytes: bytes content_type: Optional[str] if isinstance(source, str): @@ -354,7 +407,9 @@ def _get_document(*, source: Union[str, Path], timeout: int) -> Union[dict[str, content_type = mimetypes.guess_type(source, strict=True)[0] except (httpx.HTTPError, httpcore.NetworkError): - return GeneratorError(header="Could not get OpenAPI document from provided URL") + return GeneratorError( + header="Could not get OpenAPI document from provided URL" + ) else: yaml_bytes = source.read_bytes() content_type = mimetypes.guess_type(source.absolute().as_uri(), strict=True)[0] diff --git a/openapi_python_client/cli.py b/openapi_python_client/cli.py index 4b55e4bc9..2af684ae8 100644 --- a/openapi_python_client/cli.py +++ b/openapi_python_client/cli.py @@ -55,7 +55,14 @@ def _process_config( except Exception as err: raise typer.BadParameter("Unable to parse config") from err - return Config.from_sources(config_file, meta_type, source, file_encoding, overwrite, output_path=output_path) + return Config.from_sources( + config_file, + meta_type, + source, + file_encoding, + overwrite, + output_path=output_path, + ) # noinspection PyUnusedLocal @@ -63,7 +70,12 @@ def _process_config( @app.callback() def cli( - version: bool = typer.Option(False, "--version", callback=_version_callback, help="Print the version and exit"), + version: bool = typer.Option( + False, + "--version", + callback=_version_callback, + help="Print the version and exit", + ), ) -> None: """Generate a Python client from an OpenAPI document""" @@ -82,7 +94,9 @@ def _print_parser_error(err: GeneratorError, color: str) -> None: typer.echo() -def handle_errors(errors: Sequence[GeneratorError], fail_on_warning: bool = False) -> None: +def handle_errors( + errors: Sequence[GeneratorError], fail_on_warning: bool = False +) -> None: """Turn custom errors into formatted error messages""" if len(errors) == 0: return @@ -110,7 +124,8 @@ def handle_errors(errors: Sequence[GeneratorError], fail_on_warning: bool = Fals _print_parser_error(err, color) gh_link = typer.style( - "https://github.com/openapi-generators/openapi-python-client/issues/new/choose", fg=typer.colors.BRIGHT_BLUE + "https://github.com/openapi-generators/openapi-python-client/issues/new/choose", + fg=typer.colors.BRIGHT_BLUE, ) typer.secho( f"If you believe this was a mistake or this tool is missing a feature you need, " @@ -125,7 +140,9 @@ def handle_errors(errors: Sequence[GeneratorError], fail_on_warning: bool = Fals @app.command() def generate( - url: Optional[str] = typer.Option(None, help="A URL to read the OpenAPI document from"), + url: Optional[str] = typer.Option( + None, help="A URL to read the OpenAPI document from" + ), path: Optional[Path] = typer.Option(None, help="A path to the OpenAPI document"), custom_template_path: Optional[Path] = typer.Option( None, @@ -139,10 +156,16 @@ def generate( MetaType.POETRY, help="The type of metadata you want to generate.", ), - file_encoding: str = typer.Option("utf-8", help="Encoding used when writing generated"), - config_path: Optional[Path] = typer.Option(None, "--config", help="Path to the config file to use"), + file_encoding: str = typer.Option( + "utf-8", help="Encoding used when writing generated" + ), + config_path: Optional[Path] = typer.Option( + None, "--config", help="Path to the config file to use" + ), fail_on_warning: bool = False, - overwrite: bool = typer.Option(False, help="Overwrite the existing client if it exists"), + overwrite: bool = typer.Option( + False, help="Overwrite the existing client if it exists" + ), output_path: Optional[Path] = typer.Option( None, help="Path to write the generated code to. " diff --git a/openapi_python_client/parser/bodies.py b/openapi_python_client/parser/bodies.py index 7d0b12954..3a57b64df 100644 --- a/openapi_python_client/parser/bodies.py +++ b/openapi_python_client/parser/bodies.py @@ -24,6 +24,7 @@ class BodyType(StrEnum): DATA = "data" FILES = "files" CONTENT = "content" + else: from enum import Enum @@ -87,7 +88,10 @@ def body_from_data( body_type = BodyType.FILES elif simplified_content_type == "application/octet-stream": body_type = BodyType.CONTENT - elif simplified_content_type == "application/json" or simplified_content_type.endswith("+json"): + elif ( + simplified_content_type == "application/json" + or simplified_content_type.endswith("+json") + ): body_type = BodyType.JSON else: bodies.append( @@ -103,7 +107,9 @@ def body_from_data( required=True, data=media_type_schema, schemas=schemas, - parent_name=f"{endpoint_name}_{body_type}" if prefix_type_names else endpoint_name, + parent_name=( + f"{endpoint_name}_{body_type}" if prefix_type_names else endpoint_name + ), config=config, ) if isinstance(prop, ParseError): @@ -132,7 +138,8 @@ def body_from_data( def _resolve_reference( - body: Union[oai.RequestBody, oai.Reference, None], request_bodies: dict[str, Union[oai.RequestBody, oai.Reference]] + body: Union[oai.RequestBody, oai.Reference, None], + request_bodies: dict[str, Union[oai.RequestBody, oai.Reference]], ) -> Union[oai.RequestBody, ParseError, None]: if body is None: return None @@ -143,5 +150,7 @@ def _resolve_reference( if isinstance(body, oai.Reference): return ParseError(detail="Circular $ref in request body", data=body) if body is None and references_seen: - return ParseError(detail=f"Could not resolve $ref {references_seen[-1]} in request body") + return ParseError( + detail=f"Could not resolve $ref {references_seen[-1]} in request body" + ) return body diff --git a/openapi_python_client/parser/errors.py b/openapi_python_client/parser/errors.py index 36322f0cf..1281ac660 100644 --- a/openapi_python_client/parser/errors.py +++ b/openapi_python_client/parser/errors.py @@ -2,7 +2,13 @@ from enum import Enum from typing import Optional -__all__ = ["ErrorLevel", "GeneratorError", "ParameterError", "ParseError", "PropertyError"] +__all__ = [ + "ErrorLevel", + "GeneratorError", + "ParameterError", + "ParseError", + "PropertyError", +] from pydantic import BaseModel diff --git a/openapi_python_client/parser/openapi.py b/openapi_python_client/parser/openapi.py index 0aab5a717..0c2cde99c 100644 --- a/openapi_python_client/parser/openapi.py +++ b/openapi_python_client/parser/openapi.py @@ -65,11 +65,17 @@ def from_data( if operation is None: continue - tags = [utils.PythonIdentifier(value=tag, prefix="tag") for tag in operation.tags or ["default"]] + tags = [ + utils.PythonIdentifier(value=tag, prefix="tag") + for tag in operation.tags or ["default"] + ] if not config.generate_all_tags: tags = tags[:1] - collections = [endpoints_by_tag.setdefault(tag, EndpointCollection(tag=tag)) for tag in tags] + collections = [ + endpoints_by_tag.setdefault(tag, EndpointCollection(tag=tag)) + for tag in tags + ] endpoint, schemas, parameters = Endpoint.from_data( data=operation, @@ -125,7 +131,12 @@ class RequestBodyParser(Protocol): __name__: str = "RequestBodyParser" def __call__( - self, *, body: oai.RequestBody, schemas: Schemas, parent_name: str, config: Config + self, + *, + body: oai.RequestBody, + schemas: Schemas, + parent_name: str, + config: Config, ) -> tuple[Union[Property, PropertyError, None], Schemas]: ... # pragma: no cover @@ -186,7 +197,9 @@ def _add_responses( config=config, ) if isinstance(response, ParseError): - detail_suffix = "" if response.detail is None else f" ({response.detail})" + detail_suffix = ( + "" if response.detail is None else f" ({response.detail})" + ) endpoint.errors.append( ParseError( detail=( @@ -199,8 +212,12 @@ def _add_responses( continue # No reasons to use lazy imports in endpoints, so add lazy imports to relative here. - endpoint.relative_imports |= response.prop.get_lazy_imports(prefix=models_relative_prefix) - endpoint.relative_imports |= response.prop.get_imports(prefix=models_relative_prefix) + endpoint.relative_imports |= response.prop.get_lazy_imports( + prefix=models_relative_prefix + ) + endpoint.relative_imports |= response.prop.get_imports( + prefix=models_relative_prefix + ) endpoint.responses.append(response) return endpoint, schemas @@ -251,7 +268,9 @@ def add_parameters( for param in data.parameters: # Obtain the parameter from the reference or just the parameter itself - param_or_error = parameter_from_reference(param=param, parameters=parameters) + param_or_error = parameter_from_reference( + param=param, parameters=parameters + ) if isinstance(param_or_error, ParseError): return param_or_error, schemas, parameters param = param_or_error # noqa: PLW2901 @@ -277,7 +296,9 @@ def add_parameters( unique_parameters.add(unique_param) if any( - other_param for other_param in parameters_by_location[param.param_in] if other_param.name == param.name + other_param + for other_param in parameters_by_location[param.param_in] + if other_param.name == param.name ): # Defined at the operation level, ignore it here continue @@ -309,17 +330,27 @@ def add_parameters( return location_error, schemas, parameters # No reasons to use lazy imports in endpoints, so add lazy imports to relative here. - endpoint.relative_imports.update(prop.get_lazy_imports(prefix=models_relative_prefix)) - endpoint.relative_imports.update(prop.get_imports(prefix=models_relative_prefix)) + endpoint.relative_imports.update( + prop.get_lazy_imports(prefix=models_relative_prefix) + ) + endpoint.relative_imports.update( + prop.get_imports(prefix=models_relative_prefix) + ) parameters_by_location[param.param_in].append(prop) - return endpoint._check_parameters_for_conflicts(config=config), schemas, parameters + return ( + endpoint._check_parameters_for_conflicts(config=config), + schemas, + parameters, + ) def _check_parameters_for_conflicts( self, *, config: Config, - previously_modified_params: Optional[set[tuple[oai.ParameterLocation, str]]] = None, + previously_modified_params: Optional[ + set[tuple[oai.ParameterLocation, str]] + ] = None, ) -> Union["Endpoint", ParseError]: """Check for conflicting parameters @@ -331,13 +362,17 @@ def _check_parameters_for_conflicts( unique python_name. """ modified_params = previously_modified_params or set() - used_python_names: dict[PythonIdentifier, tuple[oai.ParameterLocation, Property]] = {} + used_python_names: dict[ + PythonIdentifier, tuple[oai.ParameterLocation, Property] + ] = {} reserved_names = ["client", "url"] for parameter in self.iter_all_parameters(): location, prop = parameter if prop.python_name in reserved_names: - prop.set_python_name(new_name=f"{prop.python_name}_{location}", config=config) + prop.set_python_name( + new_name=f"{prop.python_name}_{location}", config=config + ) modified_params.add((location, prop.name)) continue @@ -356,12 +391,19 @@ def _check_parameters_for_conflicts( if location != conflicting_location: conflicting_prop.set_python_name( - new_name=f"{conflicting_prop.python_name}_{conflicting_location}", config=config + new_name=f"{conflicting_prop.python_name}_{conflicting_location}", + config=config, + ) + prop.set_python_name( + new_name=f"{prop.python_name}_{location}", config=config ) - prop.set_python_name(new_name=f"{prop.python_name}_{location}", config=config) elif conflicting_prop.name != prop.name: # Use the name to differentiate - conflicting_prop.set_python_name(new_name=conflicting_prop.name, config=config, skip_snake_case=True) - prop.set_python_name(new_name=prop.name, config=config, skip_snake_case=True) + conflicting_prop.set_python_name( + new_name=conflicting_prop.name, config=config, skip_snake_case=True + ) + prop.set_python_name( + new_name=prop.name, config=config, skip_snake_case=True + ) modified_params.add((location, conflicting_prop.name)) modified_params.add((conflicting_location, conflicting_prop.name)) @@ -369,7 +411,9 @@ def _check_parameters_for_conflicts( used_python_names[conflicting_prop.python_name] = conflicting if len(modified_params) > 0 and modified_params != previously_modified_params: - return self._check_parameters_for_conflicts(config=config, previously_modified_params=modified_params) + return self._check_parameters_for_conflicts( + config=config, previously_modified_params=modified_params + ) return self @staticmethod @@ -398,7 +442,9 @@ def sort_parameters(*, endpoint: "Endpoint") -> Union["Endpoint", ParseError]: detail=f"Incorrect path templating for {endpoint.path} (Path parameters do not match with path)", ) for parameter in endpoint.path_parameters: - endpoint.path = endpoint.path.replace(f"{{{parameter.name}}}", f"{{{parameter.python_name}}}") + endpoint.path = endpoint.path.replace( + f"{{{parameter.name}}}", f"{{{parameter.python_name}}}" + ) return endpoint @staticmethod @@ -425,7 +471,11 @@ def from_data( path=path, method=method, summary=utils.remove_string_escapes(data.summary) if data.summary else "", - description=utils.remove_string_escapes(data.description) if data.description else "", + description=( + utils.remove_string_escapes(data.description) + if data.description + else "" + ), name=name, requires_security=bool(data.security), tags=tags, @@ -450,7 +500,11 @@ def from_data( if isinstance(result, ParseError): return result, schemas, parameters bodies, schemas = body_from_data( - data=data, schemas=schemas, config=config, endpoint_name=result.name, request_bodies=request_bodies + data=data, + schemas=schemas, + config=config, + endpoint_name=result.name, + request_bodies=request_bodies, ) body_errors = [] for body in bodies: @@ -458,8 +512,12 @@ def from_data( body_errors.append(body) continue result.bodies.append(body) - result.relative_imports.update(body.prop.get_imports(prefix=models_relative_prefix)) - result.relative_imports.update(body.prop.get_lazy_imports(prefix=models_relative_prefix)) + result.relative_imports.update( + body.prop.get_imports(prefix=models_relative_prefix) + ) + result.relative_imports.update( + body.prop.get_lazy_imports(prefix=models_relative_prefix) + ) if len(result.bodies) > 0: result.errors.extend(body_errors) elif len(body_errors) > 0: @@ -476,19 +534,29 @@ def from_data( def response_type(self) -> str: """Get the Python type of any response from this endpoint""" - types = sorted({response.prop.get_type_string(quoted=False) for response in self.responses}) + types = sorted( + {response.prop.get_type_string(quoted=False) for response in self.responses} + ) if len(types) == 0: return "Any" if len(types) == 1: return self.responses[0].prop.get_type_string(quoted=False) - return f"Union[{', '.join(types)}]" + return f"{' | '.join(types)}" def iter_all_parameters(self) -> Iterator[tuple[oai.ParameterLocation, Property]]: """Iterate through all the parameters of this endpoint""" - yield from ((oai.ParameterLocation.PATH, param) for param in self.path_parameters) - yield from ((oai.ParameterLocation.QUERY, param) for param in self.query_parameters) - yield from ((oai.ParameterLocation.HEADER, param) for param in self.header_parameters) - yield from ((oai.ParameterLocation.COOKIE, param) for param in self.cookie_parameters) + yield from ( + (oai.ParameterLocation.PATH, param) for param in self.path_parameters + ) + yield from ( + (oai.ParameterLocation.QUERY, param) for param in self.query_parameters + ) + yield from ( + (oai.ParameterLocation.HEADER, param) for param in self.header_parameters + ) + yield from ( + (oai.ParameterLocation.COOKIE, param) for param in self.cookie_parameters + ) def list_all_parameters(self) -> list[Property]: """Return a list of all the parameters of this endpoint""" @@ -514,7 +582,9 @@ class GeneratorData: enums: list[Union[EnumProperty, LiteralEnumProperty]] @staticmethod - def from_dict(data: dict[str, Any], *, config: Config) -> Union["GeneratorData", GeneratorError]: + def from_dict( + data: dict[str, Any], *, config: Config + ) -> Union["GeneratorData", GeneratorError]: """Create an OpenAPI from dict""" try: openapi = oai.OpenAPI.model_validate(data) @@ -522,13 +592,18 @@ def from_dict(data: dict[str, Any], *, config: Config) -> Union["GeneratorData", detail = str(err) if "swagger" in data: detail = ( - "You may be trying to use a Swagger document; this is not supported by this project.\n\n" + detail + "You may be trying to use a Swagger document; this is not supported by this project.\n\n" + + detail ) - return GeneratorError(header="Failed to parse OpenAPI document", detail=detail) + return GeneratorError( + header="Failed to parse OpenAPI document", detail=detail + ) schemas = Schemas() parameters = Parameters() if openapi.components and openapi.components.schemas: - schemas = build_schemas(components=openapi.components.schemas, schemas=schemas, config=config) + schemas = build_schemas( + components=openapi.components.schemas, schemas=schemas, config=config + ) if openapi.components and openapi.components.parameters: parameters = build_parameters( components=openapi.components.parameters, @@ -547,9 +622,15 @@ def from_dict(data: dict[str, Any], *, config: Config) -> Union["GeneratorData", ) enums = [ - prop for prop in schemas.classes_by_name.values() if isinstance(prop, (EnumProperty, LiteralEnumProperty)) + prop + for prop in schemas.classes_by_name.values() + if isinstance(prop, (EnumProperty, LiteralEnumProperty)) + ] + models = [ + prop + for prop in schemas.classes_by_name.values() + if isinstance(prop, ModelProperty) ] - models = [prop for prop in schemas.classes_by_name.values() if isinstance(prop, ModelProperty)] return GeneratorData( title=openapi.info.title, diff --git a/openapi_python_client/parser/properties/__init__.py b/openapi_python_client/parser/properties/__init__.py index ba667347b..c0d9c5727 100644 --- a/openapi_python_client/parser/properties/__init__.py +++ b/openapi_python_client/parser/properties/__init__.py @@ -51,7 +51,14 @@ def _string_based_property( name: str, required: bool, data: oai.Schema, config: Config -) -> StringProperty | DateProperty | DateTimeProperty | FileProperty | UuidProperty | PropertyError: +) -> ( + StringProperty + | DateProperty + | DateTimeProperty + | FileProperty + | UuidProperty + | PropertyError +): """Construct a Property from the type "string" """ string_format = data.schema_format python_name = utils.PythonIdentifier(value=name, prefix=config.field_prefix) @@ -116,7 +123,9 @@ def _property_from_ref( existing = schemas.classes_by_reference.get(ref_path) if not existing: return ( - PropertyError(data=data, detail="Could not find reference in parsed models or enums"), + PropertyError( + data=data, detail="Could not find reference in parsed models or enums" + ), schemas, ) @@ -189,7 +198,9 @@ def property_from_data( # noqa: PLR0911, PLR0912 name=name, required=required, default=data.default, - python_name=utils.PythonIdentifier(value=name, prefix=config.field_prefix), + python_name=utils.PythonIdentifier( + value=name, prefix=config.field_prefix + ), description=data.description, example=data.example, ), @@ -229,14 +240,18 @@ def property_from_data( # noqa: PLR0911, PLR0912 required=required, default=data.default, const=data.const, - python_name=utils.PythonIdentifier(value=name, prefix=config.field_prefix), + python_name=utils.PythonIdentifier( + value=name, prefix=config.field_prefix + ), description=data.description, ), schemas, ) if data.type == oai.DataType.STRING: return ( - _string_based_property(name=name, required=required, data=data, config=config), + _string_based_property( + name=name, required=required, data=data, config=config + ), schemas, ) if data.type == oai.DataType.NUMBER: @@ -245,7 +260,9 @@ def property_from_data( # noqa: PLR0911, PLR0912 name=name, default=data.default, required=required, - python_name=utils.PythonIdentifier(value=name, prefix=config.field_prefix), + python_name=utils.PythonIdentifier( + value=name, prefix=config.field_prefix + ), description=data.description, example=data.example, ), @@ -257,7 +274,9 @@ def property_from_data( # noqa: PLR0911, PLR0912 name=name, default=data.default, required=required, - python_name=utils.PythonIdentifier(value=name, prefix=config.field_prefix), + python_name=utils.PythonIdentifier( + value=name, prefix=config.field_prefix + ), description=data.description, example=data.example, ), @@ -269,7 +288,9 @@ def property_from_data( # noqa: PLR0911, PLR0912 name=name, required=required, default=None, - python_name=utils.PythonIdentifier(value=name, prefix=config.field_prefix), + python_name=utils.PythonIdentifier( + value=name, prefix=config.field_prefix + ), description=data.description, example=data.example, ), @@ -286,7 +307,11 @@ def property_from_data( # noqa: PLR0911, PLR0912 process_properties=process_properties, roots=roots, ) - if data.type == oai.DataType.OBJECT or data.allOf or (data.type is None and data.properties): + if ( + data.type == oai.DataType.OBJECT + or data.allOf + or (data.type is None and data.properties) + ): return ModelProperty.build( data=data, name=name, @@ -328,13 +353,19 @@ def _create_schemas( # Only accumulate errors from the last round, since we might fix some along the way for name, data in to_process: if isinstance(data, oai.Reference): - schemas.errors.append(PropertyError(data=data, detail="Reference schemas are not supported.")) + schemas.errors.append( + PropertyError( + data=data, detail="Reference schemas are not supported." + ) + ) continue ref_path = parse_reference_path(f"#/components/schemas/{name}") if isinstance(ref_path, ParseError): schemas.errors.append(PropertyError(detail=ref_path.detail, data=data)) continue - schemas_or_err = update_schemas_with_data(ref_path=ref_path, data=data, schemas=schemas, config=config) + schemas_or_err = update_schemas_with_data( + ref_path=ref_path, data=data, schemas=schemas, config=config + ) if isinstance(schemas_or_err, PropertyError): next_round.append((name, data)) errors.append(schemas_or_err) @@ -347,7 +378,9 @@ def _create_schemas( return schemas -def _propogate_removal(*, root: ReferencePath | utils.ClassName, schemas: Schemas, error: PropertyError) -> None: +def _propogate_removal( + *, root: ReferencePath | utils.ClassName, schemas: Schemas, error: PropertyError +) -> None: if isinstance(root, utils.ClassName): schemas.classes_by_name.pop(root, None) return @@ -386,7 +419,9 @@ def _process_models(*, schemas: Schemas, config: Config) -> Schemas: schemas_or_err = process_model(model_prop, schemas=schemas, config=config) if isinstance(schemas_or_err, PropertyError): schemas_or_err.header = f"\nUnable to process schema {model_prop.name}:" - if isinstance(schemas_or_err.data, oai.Reference) and schemas_or_err.data.ref.endswith( + if isinstance( + schemas_or_err.data, oai.Reference + ) and schemas_or_err.data.ref.endswith( f"/{model_prop.class_info.name}" ): schemas_or_err.detail = schemas_or_err.detail or "" @@ -402,7 +437,9 @@ def _process_models(*, schemas: Schemas, config: Config) -> Schemas: final_model_errors.extend(latest_model_errors) errors = _process_model_errors(final_model_errors, schemas=schemas) - return evolve(schemas, errors=[*schemas.errors, *errors], models_to_process=to_process) + return evolve( + schemas, errors=[*schemas.errors, *errors], models_to_process=to_process + ) def build_schemas( @@ -438,11 +475,17 @@ def build_parameters( # Only accumulate errors from the last round, since we might fix some along the way for name, data in to_process: if isinstance(data, oai.Reference): - parameters.errors.append(ParameterError(data=data, detail="Reference parameters are not supported.")) + parameters.errors.append( + ParameterError( + data=data, detail="Reference parameters are not supported." + ) + ) continue ref_path = parse_reference_path(f"#/components/parameters/{name}") if isinstance(ref_path, ParseError): - parameters.errors.append(ParameterError(detail=ref_path.detail, data=data)) + parameters.errors.append( + ParameterError(detail=ref_path.detail, data=data) + ) continue parameters_or_err = update_parameters_with_data( ref_path=ref_path, data=data, parameters=parameters, config=config diff --git a/openapi_python_client/parser/properties/date.py b/openapi_python_client/parser/properties/date.py index 7261698ea..df994f410 100644 --- a/openapi_python_client/parser/properties/date.py +++ b/openapi_python_client/parser/properties/date.py @@ -69,5 +69,11 @@ def get_imports(self, *, prefix: str) -> set[str]: back to the root of the generated client. """ imports = super().get_imports(prefix=prefix) - imports.update({"import datetime", "from typing import cast", "from dateutil.parser import isoparse"}) + imports.update( + { + "import datetime", + "from typing import cast", + "from dateutil.parser import isoparse", + } + ) return imports diff --git a/openapi_python_client/parser/properties/datetime.py b/openapi_python_client/parser/properties/datetime.py index 5924d173c..7ef5648ec 100644 --- a/openapi_python_client/parser/properties/datetime.py +++ b/openapi_python_client/parser/properties/datetime.py @@ -71,5 +71,11 @@ def get_imports(self, *, prefix: str) -> set[str]: back to the root of the generated client. """ imports = super().get_imports(prefix=prefix) - imports.update({"import datetime", "from typing import cast", "from dateutil.parser import isoparse"}) + imports.update( + { + "import datetime", + "from typing import cast", + "from dateutil.parser import isoparse", + } + ) return imports diff --git a/openapi_python_client/parser/properties/enum_property.py b/openapi_python_client/parser/properties/enum_property.py index 32389c12b..229e5719b 100644 --- a/openapi_python_client/parser/properties/enum_property.py +++ b/openapi_python_client/parser/properties/enum_property.py @@ -69,7 +69,9 @@ def build( # noqa: PLR0911 A tuple containing either the created property or a PropertyError AND update schemas. """ - enum = data.enum or [] # The outer function checks for this, but mypy doesn't know that + enum = ( + data.enum or [] + ) # The outer function checks for this, but mypy doesn't know that # OpenAPI allows for null as an enum value, but it doesn't make sense with how enums are constructed in Python. # So instead, if null is a possible value, make the property nullable. @@ -83,7 +85,9 @@ def build( # noqa: PLR0911 name=name, required=required, default="None", - python_name=utils.PythonIdentifier(value=name, prefix=config.field_prefix), + python_name=utils.PythonIdentifier( + value=name, prefix=config.field_prefix + ), description=None, example=None, ), @@ -92,17 +96,27 @@ def build( # noqa: PLR0911 value_types = {type(value) for value in unchecked_value_list} if len(value_types) > 1: - return PropertyError( - header="Enum values must all be the same type", detail=f"Got {value_types}", data=data - ), schemas + return ( + PropertyError( + header="Enum values must all be the same type", + detail=f"Got {value_types}", + data=data, + ), + schemas, + ) value_type = next(iter(value_types)) if value_type not in (str, int): - return PropertyError(header=f"Unsupported enum type {value_type}", data=data), schemas + return ( + PropertyError(header=f"Unsupported enum type {value_type}", data=data), + schemas, + ) value_list = cast( Union[list[int], list[str]], unchecked_value_list ) # We checked this with all the value_types stuff - if len(value_list) < len(enum): # Only one of the values was None, that becomes a union + if len(value_list) < len( + enum + ): # Only one of the values was None, that becomes a union data.oneOf = [ oai.Schema(type=DataType.NULL), data.model_copy(update={"enum": value_list, "default": data.default}), @@ -119,9 +133,13 @@ def build( # noqa: PLR0911 class_name = data.title or name if parent_name: - class_name = f"{utils.pascal_case(parent_name)}{utils.pascal_case(class_name)}" + class_name = ( + f"{utils.pascal_case(parent_name)}{utils.pascal_case(class_name)}" + ) class_info = Class.from_string(string=class_name, config=config) - var_names = data.model_extra.get("x-enum-varnames", []) if data.model_extra else [] + var_names = ( + data.model_extra.get("x-enum-varnames", []) if data.model_extra else [] + ) values = EnumProperty.values_from_list(value_list, class_info, var_names) if class_info.name in schemas.classes_by_name: @@ -129,7 +147,8 @@ def build( # noqa: PLR0911 if not isinstance(existing, EnumProperty) or values != existing.values: return ( PropertyError( - detail=f"Found conflicting enums named {class_info.name} with incompatible values.", data=data + detail=f"Found conflicting enums named {class_info.name} with incompatible values.", + data=data, ), schemas, ) @@ -151,7 +170,9 @@ def build( # noqa: PLR0911 return checked_default, schemas prop = evolve(prop, default=checked_default) - schemas = evolve(schemas, classes_by_name={**schemas.classes_by_name, class_info.name: prop}) + schemas = evolve( + schemas, classes_by_name={**schemas.classes_by_name, class_info.name: prop} + ) return prop, schemas def convert_value(self, value: Any) -> Value | PropertyError | None: @@ -160,10 +181,17 @@ def convert_value(self, value: Any) -> Value | PropertyError | None: if isinstance(value, self.value_type): inverse_values = {v: k for k, v in self.values.items()} try: - return Value(python_code=f"{self.class_info.name}.{inverse_values[value]}", raw_value=value) + return Value( + python_code=f"{self.class_info.name}.{inverse_values[value]}", + raw_value=value, + ) except KeyError: - return PropertyError(detail=f"Value {value} is not valid for enum {self.name}") - return PropertyError(detail=f"Cannot convert {value} to enum {self.name} of type {self.value_type}") + return PropertyError( + detail=f"Value {value} is not valid for enum {self.name}" + ) + return PropertyError( + detail=f"Cannot convert {value} to enum {self.name} of type {self.value_type}" + ) def get_base_type_string(self, *, quoted: bool = False) -> str: return self.class_info.name @@ -180,7 +208,9 @@ def get_imports(self, *, prefix: str) -> set[str]: back to the root of the generated client. """ imports = super().get_imports(prefix=prefix) - imports.add(f"from {prefix}models.{self.class_info.module_name} import {self.class_info.name}") + imports.add( + f"from {prefix}models.{self.class_info.module_name} import {self.class_info.name}" + ) return imports @staticmethod diff --git a/openapi_python_client/parser/properties/file.py b/openapi_python_client/parser/properties/file.py index 90bbf6aec..13c153798 100644 --- a/openapi_python_client/parser/properties/file.py +++ b/openapi_python_client/parser/properties/file.py @@ -63,5 +63,7 @@ def get_imports(self, *, prefix: str) -> set[str]: back to the root of the generated client. """ imports = super().get_imports(prefix=prefix) - imports.update({f"from {prefix}types import File, FileTypes", "from io import BytesIO"}) + imports.update( + {f"from {prefix}types import File, FileTypes", "from io import BytesIO"} + ) return imports diff --git a/openapi_python_client/parser/properties/list_property.py b/openapi_python_client/parser/properties/list_property.py index 06d773672..ae174aaaf 100644 --- a/openapi_python_client/parser/properties/list_property.py +++ b/openapi_python_client/parser/properties/list_property.py @@ -95,7 +95,9 @@ def build( required=required, default=None, inner_property=inner_prop, - python_name=utils.PythonIdentifier(value=name, prefix=config.field_prefix), + python_name=utils.PythonIdentifier( + value=name, prefix=config.field_prefix + ), description=data.description, example=data.example, ), @@ -154,4 +156,4 @@ def get_type_string( if no_optional or self.required: return type_string - return f"Union[Unset, {type_string}]" + return f"Unset | {type_string}" diff --git a/openapi_python_client/parser/properties/literal_enum_property.py b/openapi_python_client/parser/properties/literal_enum_property.py index 669b62f58..3f4ce7a44 100644 --- a/openapi_python_client/parser/properties/literal_enum_property.py +++ b/openapi_python_client/parser/properties/literal_enum_property.py @@ -52,7 +52,9 @@ def build( # noqa: PLR0911 schemas: Schemas, parent_name: str, config: Config, - ) -> tuple[LiteralEnumProperty | NoneProperty | UnionProperty | PropertyError, Schemas]: + ) -> tuple[ + LiteralEnumProperty | NoneProperty | UnionProperty | PropertyError, Schemas + ]: """ Create a LiteralEnumProperty from schema data. @@ -68,7 +70,9 @@ def build( # noqa: PLR0911 A tuple containing either the created property or a PropertyError AND update schemas. """ - enum = data.enum or [] # The outer function checks for this, but mypy doesn't know that + enum = ( + data.enum or [] + ) # The outer function checks for this, but mypy doesn't know that # OpenAPI allows for null as an enum value, but it doesn't make sense with how enums are constructed in Python. # So instead, if null is a possible value, make the property nullable. @@ -82,7 +86,9 @@ def build( # noqa: PLR0911 name=name, required=required, default="None", - python_name=utils.PythonIdentifier(value=name, prefix=config.field_prefix), + python_name=utils.PythonIdentifier( + value=name, prefix=config.field_prefix + ), description=None, example=None, ), @@ -91,17 +97,27 @@ def build( # noqa: PLR0911 value_types = {type(value) for value in unchecked_value_list} if len(value_types) > 1: - return PropertyError( - header="Enum values must all be the same type", detail=f"Got {value_types}", data=data - ), schemas + return ( + PropertyError( + header="Enum values must all be the same type", + detail=f"Got {value_types}", + data=data, + ), + schemas, + ) value_type = next(iter(value_types)) if value_type not in (str, int): - return PropertyError(header=f"Unsupported enum type {value_type}", data=data), schemas + return ( + PropertyError(header=f"Unsupported enum type {value_type}", data=data), + schemas, + ) value_list = cast( Union[list[int], list[str]], unchecked_value_list ) # We checked this with all the value_types stuff - if len(value_list) < len(enum): # Only one of the values was None, that becomes a union + if len(value_list) < len( + enum + ): # Only one of the values was None, that becomes a union data.oneOf = [ oai.Schema(type=DataType.NULL), data.model_copy(update={"enum": value_list, "default": data.default}), @@ -118,16 +134,22 @@ def build( # noqa: PLR0911 class_name = data.title or name if parent_name: - class_name = f"{utils.pascal_case(parent_name)}{utils.pascal_case(class_name)}" + class_name = ( + f"{utils.pascal_case(parent_name)}{utils.pascal_case(class_name)}" + ) class_info = Class.from_string(string=class_name, config=config) values: set[str | int] = set(value_list) if class_info.name in schemas.classes_by_name: existing = schemas.classes_by_name[class_info.name] - if not isinstance(existing, LiteralEnumProperty) or values != existing.values: + if ( + not isinstance(existing, LiteralEnumProperty) + or values != existing.values + ): return ( PropertyError( - detail=f"Found conflicting enums named {class_info.name} with incompatible values.", data=data + detail=f"Found conflicting enums named {class_info.name} with incompatible values.", + data=data, ), schemas, ) @@ -149,7 +171,9 @@ def build( # noqa: PLR0911 return checked_default, schemas prop = evolve(prop, default=checked_default) - schemas = evolve(schemas, classes_by_name={**schemas.classes_by_name, class_info.name: prop}) + schemas = evolve( + schemas, classes_by_name={**schemas.classes_by_name, class_info.name: prop} + ) return prop, schemas def convert_value(self, value: Any) -> Value | PropertyError | None: @@ -159,8 +183,12 @@ def convert_value(self, value: Any) -> Value | PropertyError | None: if value in self.values: return Value(python_code=repr(value), raw_value=value) else: - return PropertyError(detail=f"Value {value} is not valid for enum {self.name}") - return PropertyError(detail=f"Cannot convert {value} to enum {self.name} of type {self.value_type}") + return PropertyError( + detail=f"Value {value} is not valid for enum {self.name}" + ) + return PropertyError( + detail=f"Cannot convert {value} to enum {self.name} of type {self.value_type}" + ) def get_base_type_string(self, *, quoted: bool = False) -> str: return self.class_info.name @@ -181,7 +209,9 @@ def get_imports(self, *, prefix: str) -> set[str]: """ imports = super().get_imports(prefix=prefix) imports.add("from typing import cast") - imports.add(f"from {prefix}models.{self.class_info.module_name} import {self.class_info.name}") + imports.add( + f"from {prefix}models.{self.class_info.module_name} import {self.class_info.name}" + ) imports.add( f"from {prefix}models.{self.class_info.module_name} import check_{self.get_class_name_snake_case()}" ) diff --git a/openapi_python_client/parser/properties/merge_properties.py b/openapi_python_client/parser/properties/merge_properties.py index db6424a7c..b88562861 100644 --- a/openapi_python_client/parser/properties/merge_properties.py +++ b/openapi_python_client/parser/properties/merge_properties.py @@ -3,7 +3,9 @@ from openapi_python_client.parser.properties.date import DateProperty from openapi_python_client.parser.properties.datetime import DateTimeProperty from openapi_python_client.parser.properties.file import FileProperty -from openapi_python_client.parser.properties.literal_enum_property import LiteralEnumProperty +from openapi_python_client.parser.properties.literal_enum_property import ( + LiteralEnumProperty, +) __all__ = ["merge_properties"] @@ -27,7 +29,9 @@ STRING_WITH_FORMAT_TYPES = (DateProperty, DateTimeProperty, FileProperty) -def merge_properties(prop1: Property, prop2: Property) -> Property | PropertyError: # noqa: PLR0911 +def merge_properties( + prop1: Property, prop2: Property +) -> Property | PropertyError: # noqa: PLR0911 """Attempt to create a new property that incorporates the behavior of both. This is used when merging schemas with allOf, when two schemas define a property with the same name. @@ -71,7 +75,9 @@ def merge_properties(prop1: Property, prop2: Property) -> Property | PropertyErr ) -def _merge_same_type(prop1: Property, prop2: Property) -> Property | None | PropertyError: +def _merge_same_type( + prop1: Property, prop2: Property +) -> Property | None | PropertyError: if type(prop1) is not type(prop2): return None @@ -82,7 +88,9 @@ def _merge_same_type(prop1: Property, prop2: Property) -> Property | None | Prop if isinstance(prop1, ListProperty) and isinstance(prop2, ListProperty): inner_property = merge_properties(prop1.inner_property, prop2.inner_property) # type: ignore if isinstance(inner_property, PropertyError): - return PropertyError(detail=f"can't merge list properties: {inner_property.detail}") + return PropertyError( + detail=f"can't merge list properties: {inner_property.detail}" + ) prop1.inner_property = inner_property # For all other property types, there aren't any special attributes that affect validation, so just @@ -90,31 +98,45 @@ def _merge_same_type(prop1: Property, prop2: Property) -> Property | None | Prop return _merge_common_attributes(prop1, prop2) -def _merge_string_with_format(prop1: Property, prop2: Property) -> Property | None | PropertyError: +def _merge_string_with_format( + prop1: Property, prop2: Property +) -> Property | None | PropertyError: """Merge a string that has no format with a string that has a format""" # Here we need to use the DateProperty/DateTimeProperty/FileProperty as the base so that we preserve # its class, but keep the correct override order for merging the attributes. - if isinstance(prop1, StringProperty) and isinstance(prop2, STRING_WITH_FORMAT_TYPES): + if isinstance(prop1, StringProperty) and isinstance( + prop2, STRING_WITH_FORMAT_TYPES + ): # Use the more specific class as a base, but keep the correct override order return _merge_common_attributes(prop2, prop1, prop2) - elif isinstance(prop2, StringProperty) and isinstance(prop1, STRING_WITH_FORMAT_TYPES): + elif isinstance(prop2, StringProperty) and isinstance( + prop1, STRING_WITH_FORMAT_TYPES + ): return _merge_common_attributes(prop1, prop2) else: return None -def _merge_numeric(prop1: Property, prop2: Property) -> IntProperty | None | PropertyError: +def _merge_numeric( + prop1: Property, prop2: Property +) -> IntProperty | None | PropertyError: """Merge IntProperty with FloatProperty""" - if isinstance(prop1, IntProperty) and isinstance(prop2, (IntProperty, FloatProperty)): + if isinstance(prop1, IntProperty) and isinstance( + prop2, (IntProperty, FloatProperty) + ): return _merge_common_attributes(prop1, prop2) - elif isinstance(prop2, IntProperty) and isinstance(prop1, (IntProperty, FloatProperty)): + elif isinstance(prop2, IntProperty) and isinstance( + prop1, (IntProperty, FloatProperty) + ): # Use the IntProperty as a base since it's more restrictive, but keep the correct override order return _merge_common_attributes(prop2, prop1, prop2) else: return None -def _merge_with_enum(prop1: PropertyProtocol, prop2: PropertyProtocol) -> EnumProperty | PropertyError: +def _merge_with_enum( + prop1: PropertyProtocol, prop2: PropertyProtocol +) -> EnumProperty | PropertyError: if isinstance(prop1, EnumProperty) and isinstance(prop2, EnumProperty): # We want the narrowest validation rules that fit both, so use whichever values list is a # subset of the other. @@ -125,8 +147,12 @@ def _merge_with_enum(prop1: PropertyProtocol, prop2: PropertyProtocol) -> EnumPr values = prop2.values class_info = prop2.class_info else: - return PropertyError(detail="can't redefine an enum property with incompatible lists of values") - return _merge_common_attributes(evolve(prop1, values=values, class_info=class_info), prop2) + return PropertyError( + detail="can't redefine an enum property with incompatible lists of values" + ) + return _merge_common_attributes( + evolve(prop1, values=values, class_info=class_info), prop2 + ) # If enum values were specified for just one of the properties, use those. enum_prop = prop1 if isinstance(prop1, EnumProperty) else cast(EnumProperty, prop2) @@ -140,8 +166,12 @@ def _merge_with_enum(prop1: PropertyProtocol, prop2: PropertyProtocol) -> EnumPr ) -def _merge_with_literal_enum(prop1: PropertyProtocol, prop2: PropertyProtocol) -> LiteralEnumProperty | PropertyError: - if isinstance(prop1, LiteralEnumProperty) and isinstance(prop2, LiteralEnumProperty): +def _merge_with_literal_enum( + prop1: PropertyProtocol, prop2: PropertyProtocol +) -> LiteralEnumProperty | PropertyError: + if isinstance(prop1, LiteralEnumProperty) and isinstance( + prop2, LiteralEnumProperty + ): # We want the narrowest validation rules that fit both, so use whichever values list is a # subset of the other. if prop1.values <= prop2.values: @@ -151,11 +181,19 @@ def _merge_with_literal_enum(prop1: PropertyProtocol, prop2: PropertyProtocol) - values = prop2.values class_info = prop2.class_info else: - return PropertyError(detail="can't redefine a literal enum property with incompatible lists of values") - return _merge_common_attributes(evolve(prop1, values=values, class_info=class_info), prop2) + return PropertyError( + detail="can't redefine a literal enum property with incompatible lists of values" + ) + return _merge_common_attributes( + evolve(prop1, values=values, class_info=class_info), prop2 + ) # If enum values were specified for just one of the properties, use those. - enum_prop = prop1 if isinstance(prop1, LiteralEnumProperty) else cast(LiteralEnumProperty, prop2) + enum_prop = ( + prop1 + if isinstance(prop1, LiteralEnumProperty) + else cast(LiteralEnumProperty, prop2) + ) non_enum_prop = prop2 if isinstance(prop1, LiteralEnumProperty) else prop1 if (isinstance(non_enum_prop, IntProperty) and enum_prop.value_type is int) or ( isinstance(non_enum_prop, StringProperty) and enum_prop.value_type is str @@ -166,7 +204,9 @@ def _merge_with_literal_enum(prop1: PropertyProtocol, prop2: PropertyProtocol) - ) -def _merge_common_attributes(base: PropertyT, *extend_with: PropertyProtocol) -> PropertyT | PropertyError: +def _merge_common_attributes( + base: PropertyT, *extend_with: PropertyProtocol +) -> PropertyT | PropertyError: """Create a new instance based on base, overriding basic attributes with values from extend_with, in order. For "default", "description", and "example", a non-None value overrides any value from a previously diff --git a/openapi_python_client/parser/properties/model_property.py b/openapi_python_client/parser/properties/model_property.py index 805de1c7b..bf330267e 100644 --- a/openapi_python_client/parser/properties/model_property.py +++ b/openapi_python_client/parser/properties/model_property.py @@ -70,7 +70,9 @@ def build( else: title = data.title or name if parent_name: - class_string = f"{utils.pascal_case(parent_name)}{utils.pascal_case(title)}" + class_string = ( + f"{utils.pascal_case(parent_name)}{utils.pascal_case(title)}" + ) else: class_string = title class_info = Class.from_string(string=class_string, config=config) @@ -82,7 +84,11 @@ def build( additional_properties: Property | None = None if process_properties: data_or_err, schemas = _process_property_data( - data=data, schemas=schemas, class_info=class_info, config=config, roots=model_roots + data=data, + schemas=schemas, + class_info=class_info, + config=config, + roots=model_roots, ) if isinstance(data_or_err, PropertyError): return data_or_err, schemas @@ -114,7 +120,8 @@ def build( ) if class_info.name in schemas.classes_by_name: error = PropertyError( - data=data, detail=f'Attempted to generate duplicate models with name "{class_info.name}"' + data=data, + detail=f'Attempted to generate duplicate models with name "{class_info.name}"', ) return error, schemas @@ -128,7 +135,9 @@ def build( @classmethod def convert_value(cls, value: Any) -> Value | None | PropertyError: if value is not None: - return PropertyError(detail="ModelProperty cannot have a default value") # pragma: no cover + return PropertyError( + detail="ModelProperty cannot have a default value" + ) # pragma: no cover return None def __attrs_post_init__(self) -> None: @@ -174,7 +183,11 @@ def set_relative_imports(self, relative_imports: set[str]) -> None: Args: relative_imports: The set of relative import strings """ - object.__setattr__(self, "relative_imports", {ri for ri in relative_imports if self.self_import not in ri}) + object.__setattr__( + self, + "relative_imports", + {ri for ri in relative_imports if self.self_import not in ri}, + ) def set_lazy_imports(self, lazy_imports: set[str]) -> None: """Set the lazy imports set for this ModelProperty, filtering out self imports @@ -182,7 +195,11 @@ def set_lazy_imports(self, lazy_imports: set[str]) -> None: Args: lazy_imports: The set of lazy import strings """ - object.__setattr__(self, "lazy_imports", {li for li in lazy_imports if self.self_import not in li}) + object.__setattr__( + self, + "lazy_imports", + {li for li in lazy_imports if self.self_import not in li}, + ) def get_type_string( self, @@ -209,13 +226,15 @@ def get_type_string( if no_optional or self.required: return type_string - return f"Union[Unset, {type_string}]" + return f"Unset | {type_string}" from .property import Property # noqa: E402 -def _resolve_naming_conflict(first: Property, second: Property, config: Config) -> PropertyError | None: +def _resolve_naming_conflict( + first: Property, second: Property, config: Config +) -> PropertyError | None: first.set_python_name(first.name, config=config, skip_snake_case=True) second.set_python_name(second.name, config=config, skip_snake_case=True) if first.python_name == second.python_name: @@ -254,7 +273,9 @@ def _add_if_no_conflict(new_prop: Property) -> PropertyError | None: nonlocal properties name_conflict = properties.get(new_prop.name) - merged_prop = merge_properties(name_conflict, new_prop) if name_conflict else new_prop + merged_prop = ( + merge_properties(name_conflict, new_prop) if name_conflict else new_prop + ) if isinstance(merged_prop, PropertyError): merged_prop.header = f"Found conflicting properties named {new_prop.name} when creating {class_name}" return merged_prop @@ -286,16 +307,24 @@ def _add_if_no_conflict(new_prop: Property) -> PropertyError | None: return PropertyError("Cannot take allOf a non-object") # Properties of allOf references first should be processed first if not ( - isinstance(sub_model.required_properties, list) and isinstance(sub_model.optional_properties, list) + isinstance(sub_model.required_properties, list) + and isinstance(sub_model.optional_properties, list) + ): + return PropertyError( + f"Reference {sub_model.name} in allOf was not processed", + data=sub_prop, + ) + for prop in chain( + sub_model.required_properties, sub_model.optional_properties ): - return PropertyError(f"Reference {sub_model.name} in allOf was not processed", data=sub_prop) - for prop in chain(sub_model.required_properties, sub_model.optional_properties): err = _add_if_no_conflict(prop) if err is not None: return err schemas.add_dependencies(ref_path=ref_path, roots=roots) else: - unprocessed_props.extend(sub_prop.properties.items() if sub_prop.properties else []) + unprocessed_props.extend( + sub_prop.properties.items() if sub_prop.properties else [] + ) required_set.update(sub_prop.required or []) for key, value in unprocessed_props: @@ -363,7 +392,9 @@ def _get_additional_properties( return ANY_ADDITIONAL_PROPERTY, schemas return None, schemas - if isinstance(schema_additional, oai.Schema) and not any(schema_additional.model_dump().values()): + if isinstance(schema_additional, oai.Schema) and not any( + schema_additional.model_dump().values() + ): # An empty schema return ANY_ADDITIONAL_PROPERTY, schemas @@ -388,7 +419,11 @@ def _process_property_data( roots: set[ReferencePath | utils.ClassName], ) -> tuple[tuple[_PropertyData, Property | None] | PropertyError, Schemas]: property_data = _process_properties( - data=data, schemas=schemas, class_name=class_info.name, config=config, roots=roots + data=data, + schemas=schemas, + class_name=class_info.name, + config=config, + roots=roots, ) if isinstance(property_data, PropertyError): return property_data, schemas @@ -406,13 +441,19 @@ def _process_property_data( elif additional_properties is None: pass else: - property_data.relative_imports.update(additional_properties.get_imports(prefix="..")) - property_data.lazy_imports.update(additional_properties.get_lazy_imports(prefix="..")) + property_data.relative_imports.update( + additional_properties.get_imports(prefix="..") + ) + property_data.lazy_imports.update( + additional_properties.get_lazy_imports(prefix="..") + ) return (property_data, additional_properties), schemas -def process_model(model_prop: ModelProperty, *, schemas: Schemas, config: Config) -> Schemas | PropertyError: +def process_model( + model_prop: ModelProperty, *, schemas: Schemas, config: Config +) -> Schemas | PropertyError: """Populate a ModelProperty instance's property data Args: model_prop: The ModelProperty to build property data for diff --git a/openapi_python_client/parser/properties/protocol.py b/openapi_python_client/parser/properties/protocol.py index 327ba0a5e..5b399d0c0 100644 --- a/openapi_python_client/parser/properties/protocol.py +++ b/openapi_python_client/parser/properties/protocol.py @@ -48,7 +48,9 @@ class PropertyProtocol(Protocol): name: str required: bool _type_string: ClassVar[str] = "" - _json_type_string: ClassVar[str] = "" # Type of the property after JSON serialization + _json_type_string: ClassVar[str] = ( + "" # Type of the property after JSON serialization + ) _allowed_locations: ClassVar[set[oai.ParameterLocation]] = { oai.ParameterLocation.QUERY, oai.ParameterLocation.PATH, @@ -70,12 +72,16 @@ def convert_value(self, value: Any) -> Value | None | PropertyError: def validate_location(self, location: oai.ParameterLocation) -> ParseError | None: """Returns an error if this type of property is not allowed in the given location""" if location not in self._allowed_locations: - return ParseError(detail=f"{self.get_type_string()} is not allowed in {location}") + return ParseError( + detail=f"{self.get_type_string()} is not allowed in {location}" + ) if location == oai.ParameterLocation.PATH and not self.required: return ParseError(detail="Path parameter must be required") return None - def set_python_name(self, new_name: str, config: Config, skip_snake_case: bool = False) -> None: + def set_python_name( + self, new_name: str, config: Config, skip_snake_case: bool = False + ) -> None: """Mutates this Property to set a new python_name. Required to mutate due to how Properties are stored and the difficulty of updating them in-dict. @@ -85,16 +91,28 @@ def set_python_name(self, new_name: str, config: Config, skip_snake_case: bool = object.__setattr__( self, "python_name", - PythonIdentifier(value=new_name, prefix=config.field_prefix, skip_snake_case=skip_snake_case), + PythonIdentifier( + value=new_name, + prefix=config.field_prefix, + skip_snake_case=skip_snake_case, + ), ) def get_base_type_string(self, *, quoted: bool = False) -> str: """Get the string describing the Python type of this property. Base types no require quoting.""" - return f'"{self._type_string}"' if not self.is_base_type and quoted else self._type_string + return ( + f'"{self._type_string}"' + if not self.is_base_type and quoted + else self._type_string + ) def get_base_json_type_string(self, *, quoted: bool = False) -> str: """Get the string describing the JSON type of this property. Base types no require quoting.""" - return f'"{self._json_type_string}"' if not self.is_base_type and quoted else self._json_type_string + return ( + f'"{self._json_type_string}"' + if not self.is_base_type and quoted + else self._json_type_string + ) def get_type_string( self, @@ -118,7 +136,7 @@ def get_type_string( if no_optional or self.required: return type_string - return f"Union[Unset, {type_string}]" + return f"Unset | {type_string}" def get_instance_type_string(self) -> str: """Get a string representation of runtime type that should be used for `isinstance` checks""" @@ -135,7 +153,6 @@ def get_imports(self, *, prefix: str) -> set[str]: """ imports = set() if not self.required: - imports.add("from typing import Union") imports.add(f"from {prefix}types import UNSET, Unset") return imports @@ -159,7 +176,9 @@ def to_string(self) -> str: default = None if default is not None: - return f"{self.python_name}: {self.get_type_string(quoted=True)} = {default}" + return ( + f"{self.python_name}: {self.get_type_string(quoted=True)} = {default}" + ) return f"{self.python_name}: {self.get_type_string(quoted=True)}" def to_docstring(self) -> str: diff --git a/openapi_python_client/parser/properties/schemas.py b/openapi_python_client/parser/properties/schemas.py index acfb21c8d..4bba23bc8 100644 --- a/openapi_python_client/parser/properties/schemas.py +++ b/openapi_python_client/parser/properties/schemas.py @@ -42,7 +42,9 @@ def parse_reference_path(ref_path_raw: str) -> Union[ReferencePath, ParseError]: """ parsed = urlparse(ref_path_raw) if parsed.scheme or parsed.path: - return ParseError(detail=f"Remote references such as {ref_path_raw} are not supported yet.") + return ParseError( + detail=f"Remote references such as {ref_path_raw} are not supported yet." + ) return cast(ReferencePath, parsed.fragment) @@ -84,12 +86,16 @@ class Schemas: """Structure for containing all defined, shareable, and reusable schemas (attr classes and Enums)""" classes_by_reference: dict[ReferencePath, Property] = field(factory=dict) - dependencies: dict[ReferencePath, set[Union[ReferencePath, ClassName]]] = field(factory=dict) + dependencies: dict[ReferencePath, set[Union[ReferencePath, ClassName]]] = field( + factory=dict + ) classes_by_name: dict[ClassName, Property] = field(factory=dict) models_to_process: list[ModelProperty] = field(factory=list) errors: list[ParseError] = field(factory=list) - def add_dependencies(self, ref_path: ReferencePath, roots: set[Union[ReferencePath, ClassName]]) -> None: + def add_dependencies( + self, ref_path: ReferencePath, roots: set[Union[ReferencePath, ClassName]] + ) -> None: """Record new dependencies on the given ReferencePath Args: @@ -136,13 +142,15 @@ def update_schemas_with_data( if isinstance(prop, PropertyError): prop.detail = f"{prop.header}: {prop.detail}" prop.header = f"Unable to parse schema {ref_path}" - if isinstance(prop.data, oai.Reference) and prop.data.ref.endswith(ref_path): # pragma: nocover - prop.detail += ( - "\n\nRecursive and circular references are not supported directly in an array schema's 'items' section" - ) + if isinstance(prop.data, oai.Reference) and prop.data.ref.endswith( + ref_path + ): # pragma: nocover + prop.detail += "\n\nRecursive and circular references are not supported directly in an array schema's 'items' section" return prop - schemas = evolve(schemas, classes_by_reference={ref_path: prop, **schemas.classes_by_reference}) + schemas = evolve( + schemas, classes_by_reference={ref_path: prop, **schemas.classes_by_reference} + ) return schemas @@ -179,13 +187,21 @@ def parameter_from_data( param_in=data.param_in, ) parameters = evolve( - parameters, classes_by_name={**parameters.classes_by_name, ClassName(name, config.field_prefix): new_param} + parameters, + classes_by_name={ + **parameters.classes_by_name, + ClassName(name, config.field_prefix): new_param, + }, ) return new_param, parameters def update_parameters_with_data( - *, ref_path: ReferencePath, data: oai.Parameter, parameters: Parameters, config: Config + *, + ref_path: ReferencePath, + data: oai.Parameter, + parameters: Parameters, + config: Config, ) -> Union[Parameters, ParameterError]: """ Update a `Parameters` using some new reference. @@ -201,19 +217,26 @@ def update_parameters_with_data( See Also: - https://swagger.io/docs/specification/using-ref/ """ - param, parameters = parameter_from_data(data=data, name=data.name, parameters=parameters, config=config) + param, parameters = parameter_from_data( + data=data, name=data.name, parameters=parameters, config=config + ) if isinstance(param, ParameterError): param.detail = f"{param.header}: {param.detail}" param.header = f"Unable to parse parameter {ref_path}" - if isinstance(param.data, oai.Reference) and param.data.ref.endswith(ref_path): # pragma: nocover + if isinstance(param.data, oai.Reference) and param.data.ref.endswith( + ref_path + ): # pragma: nocover param.detail += ( "\n\nRecursive and circular references are not supported. " "See https://github.com/openapi-generators/openapi-python-client/issues/466" ) return param - parameters = evolve(parameters, classes_by_reference={ref_path: param, **parameters.classes_by_reference}) + parameters = evolve( + parameters, + classes_by_reference={ref_path: param, **parameters.classes_by_reference}, + ) return parameters diff --git a/openapi_python_client/parser/properties/string.py b/openapi_python_client/parser/properties/string.py index e40c1eee6..6774cd3b9 100644 --- a/openapi_python_client/parser/properties/string.py +++ b/openapi_python_client/parser/properties/string.py @@ -65,4 +65,6 @@ def convert_value(cls, value: Any) -> Value | None: return value if not isinstance(value, str): value = str(value) - return Value(python_code=repr(utils.remove_string_escapes(value)), raw_value=value) + return Value( + python_code=repr(utils.remove_string_escapes(value)), raw_value=value + ) diff --git a/openapi_python_client/parser/properties/union.py b/openapi_python_client/parser/properties/union.py index 1e47714ff..c8a342ae0 100644 --- a/openapi_python_client/parser/properties/union.py +++ b/openapi_python_client/parser/properties/union.py @@ -59,9 +59,13 @@ def build( type_list_data = [] if isinstance(data.type, list): for _type in data.type: - type_list_data.append(data.model_copy(update={"type": _type, "default": None})) + type_list_data.append( + data.model_copy(update={"type": _type, "default": None}) + ) - for i, sub_prop_data in enumerate(chain(data.anyOf, data.oneOf, type_list_data)): + for i, sub_prop_data in enumerate( + chain(data.anyOf, data.oneOf, type_list_data) + ): # If a schema has a unique title property, we can use that to carry forward a descriptive name instead of "type_0" subscript: str if ( @@ -83,16 +87,22 @@ def build( ) if isinstance(sub_prop, PropertyError): return ( - PropertyError(detail=f"Invalid property in union {name}", data=sub_prop_data), + PropertyError( + detail=f"Invalid property in union {name}", data=sub_prop_data + ), schemas, ) sub_properties.append(sub_prop) - def flatten_union_properties(sub_properties: list[PropertyProtocol]) -> list[PropertyProtocol]: + def flatten_union_properties( + sub_properties: list[PropertyProtocol], + ) -> list[PropertyProtocol]: flattened = [] for sub_prop in sub_properties: if isinstance(sub_prop, UnionProperty): - flattened.extend(flatten_union_properties(sub_prop.inner_properties)) + flattened.extend( + flatten_union_properties(sub_prop.inner_properties) + ) else: flattened.append(sub_prop) return flattened @@ -144,12 +154,18 @@ def _get_type_string_from_inner_type_strings(inner_types: set[str]) -> str: return f"Union[{', '.join(sorted(inner_types))}]" def get_base_type_string(self, *, quoted: bool = False) -> str: - return self._get_type_string_from_inner_type_strings(self._get_inner_type_strings(json=False)) + return self._get_type_string_from_inner_type_strings( + self._get_inner_type_strings(json=False) + ) def get_base_json_type_string(self, *, quoted: bool = False) -> str: - return self._get_type_string_from_inner_type_strings(self._get_inner_type_strings(json=True)) + return self._get_type_string_from_inner_type_strings( + self._get_inner_type_strings(json=True) + ) - def get_type_strings_in_union(self, *, no_optional: bool = False, json: bool) -> set[str]: + def get_type_strings_in_union( + self, *, no_optional: bool = False, json: bool + ) -> set[str]: """ Get the set of all the types that should appear within the `Union` representing this property. @@ -181,7 +197,9 @@ def get_type_string( This implementation differs slightly from `Property.get_type_string` in order to collapse nested union types. """ - type_strings_in_union = self.get_type_strings_in_union(no_optional=no_optional, json=json) + type_strings_in_union = self.get_type_strings_in_union( + no_optional=no_optional, json=json + ) return self._get_type_string_from_inner_type_strings(type_strings_in_union) def get_imports(self, *, prefix: str) -> set[str]: @@ -209,6 +227,13 @@ def validate_location(self, location: oai.ParameterLocation) -> ParseError | Non from ..properties import Property # noqa: PLC0415 for inner_prop in self.inner_properties: - if evolve(cast(Property, inner_prop), required=self.required).validate_location(location) is not None: - return ParseError(detail=f"{self.get_type_string()} is not allowed in {location}") + if ( + evolve( + cast(Property, inner_prop), required=self.required + ).validate_location(location) + is not None + ): + return ParseError( + detail=f"{self.get_type_string()} is not allowed in {location}" + ) return None diff --git a/openapi_python_client/parser/responses.py b/openapi_python_client/parser/responses.py index ec0f6136b..525ab5ff8 100644 --- a/openapi_python_client/parser/responses.py +++ b/openapi_python_client/parser/responses.py @@ -6,7 +6,10 @@ from attrs import define from openapi_python_client import utils -from openapi_python_client.parser.properties.schemas import get_reference_simple_name, parse_reference_path +from openapi_python_client.parser.properties.schemas import ( + get_reference_simple_name, + parse_reference_path, +) from .. import Config from .. import schema as oai @@ -35,10 +38,14 @@ class Response: status_code: HTTPStatus prop: Property source: _ResponseSource - data: Union[oai.Response, oai.Reference] # Original data which created this response, useful for custom templates + data: Union[ + oai.Response, oai.Reference + ] # Original data which created this response, useful for custom templates -def _source_by_content_type(content_type: str, config: Config) -> Optional[_ResponseSource]: +def _source_by_content_type( + content_type: str, config: Config +) -> Optional[_ResponseSource]: parsed_content_type = utils.get_content_type(content_type, config) if parsed_content_type is None: return None @@ -72,7 +79,9 @@ def empty_response( name=response_name, default=None, required=True, - python_name=PythonIdentifier(value=response_name, prefix=config.field_prefix), + python_name=PythonIdentifier( + value=response_name, prefix=config.field_prefix + ), description=data.description if isinstance(data, oai.Response) else None, example=None, ), @@ -97,12 +106,26 @@ def response_from_data( # noqa: PLR0911 if isinstance(ref_path, ParseError): return ref_path, schemas if not ref_path.startswith("/components/responses/"): - return ParseError(data=data, detail=f"$ref to {data.ref} not allowed in responses"), schemas + return ( + ParseError( + data=data, detail=f"$ref to {data.ref} not allowed in responses" + ), + schemas, + ) resp_data = responses.get(get_reference_simple_name(ref_path), None) if not resp_data: - return ParseError(data=data, detail=f"Could not find reference: {data.ref}"), schemas + return ( + ParseError(data=data, detail=f"Could not find reference: {data.ref}"), + schemas, + ) if not isinstance(resp_data, oai.Response): - return ParseError(data=data, detail="Top-level $ref inside components/responses is not supported"), schemas + return ( + ParseError( + data=data, + detail="Top-level $ref inside components/responses is not supported", + ), + schemas, + ) data = resp_data content = data.content @@ -151,4 +174,7 @@ def response_from_data( # noqa: PLR0911 if isinstance(prop, PropertyError): return prop, schemas - return Response(status_code=status_code, prop=prop, source=source, data=data), schemas + return ( + Response(status_code=status_code, prop=prop, source=source, data=data), + schemas, + ) diff --git a/openapi_python_client/schema/openapi_schema_pydantic/components.py b/openapi_python_client/schema/openapi_schema_pydantic/components.py index ac5e7648d..84bba9e7a 100644 --- a/openapi_python_client/schema/openapi_schema_pydantic/components.py +++ b/openapi_python_client/schema/openapi_schema_pydantic/components.py @@ -51,11 +51,17 @@ class Components(BaseModel): }, "Category": { "type": "object", - "properties": {"id": {"type": "integer", "format": "int64"}, "name": {"type": "string"}}, + "properties": { + "id": {"type": "integer", "format": "int64"}, + "name": {"type": "string"}, + }, }, "Tag": { "type": "object", - "properties": {"id": {"type": "integer", "format": "int64"}, "name": {"type": "string"}}, + "properties": { + "id": {"type": "integer", "format": "int64"}, + "name": {"type": "string"}, + }, }, }, "parameters": { @@ -79,11 +85,21 @@ class Components(BaseModel): "IllegalInput": {"description": "Illegal input for operation."}, "GeneralError": { "description": "General Error", - "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GeneralError"}}}, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralError" + } + } + }, }, }, "securitySchemes": { - "api_key": {"type": "apiKey", "name": "api_key", "in": "header"}, + "api_key": { + "type": "apiKey", + "name": "api_key", + "in": "header", + }, "petstore_auth": { "type": "oauth2", "flows": { diff --git a/openapi_python_client/schema/openapi_schema_pydantic/contact.py b/openapi_python_client/schema/openapi_schema_pydantic/contact.py index c04fdbbe0..bcf87f3fd 100644 --- a/openapi_python_client/schema/openapi_schema_pydantic/contact.py +++ b/openapi_python_client/schema/openapi_schema_pydantic/contact.py @@ -18,7 +18,11 @@ class Contact(BaseModel): extra="allow", json_schema_extra={ "examples": [ - {"name": "API Support", "url": "http://www.example.com/support", "email": "support@example.com"} + { + "name": "API Support", + "url": "http://www.example.com/support", + "email": "support@example.com", + } ] }, ) diff --git a/openapi_python_client/schema/openapi_schema_pydantic/example.py b/openapi_python_client/schema/openapi_schema_pydantic/example.py index 90db2530e..ad2af52ff 100644 --- a/openapi_python_client/schema/openapi_schema_pydantic/example.py +++ b/openapi_python_client/schema/openapi_schema_pydantic/example.py @@ -24,7 +24,10 @@ class Example(BaseModel): "summary": "This is an example in XML", "externalValue": "http://example.org/examples/address-example.xml", }, - {"summary": "This is a text example", "externalValue": "http://foo.bar/examples/address-example.txt"}, + { + "summary": "This is a text example", + "externalValue": "http://foo.bar/examples/address-example.txt", + }, ] }, ) diff --git a/openapi_python_client/schema/openapi_schema_pydantic/external_documentation.py b/openapi_python_client/schema/openapi_schema_pydantic/external_documentation.py index 2c0c39b7c..c12d2a64e 100644 --- a/openapi_python_client/schema/openapi_schema_pydantic/external_documentation.py +++ b/openapi_python_client/schema/openapi_schema_pydantic/external_documentation.py @@ -14,5 +14,9 @@ class ExternalDocumentation(BaseModel): url: str model_config = ConfigDict( extra="allow", - json_schema_extra={"examples": [{"description": "Find more info here", "url": "https://example.com"}]}, + json_schema_extra={ + "examples": [ + {"description": "Find more info here", "url": "https://example.com"} + ] + }, ) diff --git a/openapi_python_client/schema/openapi_schema_pydantic/header.py b/openapi_python_client/schema/openapi_schema_pydantic/header.py index 2deb6f390..08d16248a 100644 --- a/openapi_python_client/schema/openapi_schema_pydantic/header.py +++ b/openapi_python_client/schema/openapi_schema_pydantic/header.py @@ -27,7 +27,10 @@ class Header(Parameter): populate_by_name=True, json_schema_extra={ "examples": [ - {"description": "The number of allowed requests in the current period", "schema": {"type": "integer"}} + { + "description": "The number of allowed requests in the current period", + "schema": {"type": "integer"}, + } ] }, ) diff --git a/openapi_python_client/schema/openapi_schema_pydantic/info.py b/openapi_python_client/schema/openapi_schema_pydantic/info.py index bec1354da..42e3af6f9 100644 --- a/openapi_python_client/schema/openapi_schema_pydantic/info.py +++ b/openapi_python_client/schema/openapi_schema_pydantic/info.py @@ -36,7 +36,10 @@ class Info(BaseModel): "url": "http://www.example.com/support", "email": "support@example.com", }, - "license": {"name": "Apache 2.0", "url": "https://www.apache.org/licenses/LICENSE-2.0.html"}, + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html", + }, "version": "1.0.1", } ] diff --git a/openapi_python_client/schema/openapi_schema_pydantic/license.py b/openapi_python_client/schema/openapi_schema_pydantic/license.py index 185eec1db..1bebc376c 100644 --- a/openapi_python_client/schema/openapi_schema_pydantic/license.py +++ b/openapi_python_client/schema/openapi_schema_pydantic/license.py @@ -16,6 +16,11 @@ class License(BaseModel): model_config = ConfigDict( extra="allow", json_schema_extra={ - "examples": [{"name": "Apache 2.0", "url": "https://www.apache.org/licenses/LICENSE-2.0.html"}] + "examples": [ + { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html", + } + ] }, ) diff --git a/openapi_python_client/schema/openapi_schema_pydantic/link.py b/openapi_python_client/schema/openapi_schema_pydantic/link.py index 69cdf29c0..4c3c56ab0 100644 --- a/openapi_python_client/schema/openapi_schema_pydantic/link.py +++ b/openapi_python_client/schema/openapi_schema_pydantic/link.py @@ -33,7 +33,10 @@ class Link(BaseModel): extra="allow", json_schema_extra={ "examples": [ - {"operationId": "getUserAddressByUUID", "parameters": {"userUuid": "$response.body#/uuid"}}, + { + "operationId": "getUserAddressByUUID", + "parameters": {"userUuid": "$response.body#/uuid"}, + }, { "operationRef": "#/paths/~12.0~1repositories~1{username}/get", "parameters": {"username": "$response.body#/username"}, diff --git a/openapi_python_client/schema/openapi_schema_pydantic/media_type.py b/openapi_python_client/schema/openapi_schema_pydantic/media_type.py index 48cea8b75..ebf0dcf12 100644 --- a/openapi_python_client/schema/openapi_schema_pydantic/media_type.py +++ b/openapi_python_client/schema/openapi_schema_pydantic/media_type.py @@ -16,7 +16,9 @@ class MediaType(BaseModel): - https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#mediaTypeObject """ - media_type_schema: Optional[ReferenceOr[Schema]] = Field(default=None, alias="schema") + media_type_schema: Optional[ReferenceOr[Schema]] = Field( + default=None, alias="schema" + ) example: Optional[Any] = None examples: Optional[dict[str, ReferenceOr[Example]]] = None encoding: Optional[dict[str, Encoding]] = None diff --git a/openapi_python_client/schema/openapi_schema_pydantic/oauth_flow.py b/openapi_python_client/schema/openapi_schema_pydantic/oauth_flow.py index 16e366090..8ed737014 100644 --- a/openapi_python_client/schema/openapi_schema_pydantic/oauth_flow.py +++ b/openapi_python_client/schema/openapi_schema_pydantic/oauth_flow.py @@ -22,12 +22,18 @@ class OAuthFlow(BaseModel): "examples": [ { "authorizationUrl": "https://example.com/api/oauth/dialog", - "scopes": {"write:pets": "modify pets in your account", "read:pets": "read your pets"}, + "scopes": { + "write:pets": "modify pets in your account", + "read:pets": "read your pets", + }, }, { "authorizationUrl": "https://example.com/api/oauth/dialog", "tokenUrl": "https://example.com/api/oauth/token", - "scopes": {"write:pets": "modify pets in your account", "read:pets": "read your pets"}, + "scopes": { + "write:pets": "modify pets in your account", + "read:pets": "read your pets", + }, }, ] }, diff --git a/openapi_python_client/schema/openapi_schema_pydantic/parameter.py b/openapi_python_client/schema/openapi_schema_pydantic/parameter.py index bf4f4cf02..d259efa23 100644 --- a/openapi_python_client/schema/openapi_schema_pydantic/parameter.py +++ b/openapi_python_client/schema/openapi_schema_pydantic/parameter.py @@ -46,7 +46,10 @@ class Parameter(BaseModel): "in": "header", "description": "token to be passed as a header", "required": True, - "schema": {"type": "array", "items": {"type": "integer", "format": "int64"}}, + "schema": { + "type": "array", + "items": {"type": "integer", "format": "int64"}, + }, "style": "simple", }, { @@ -68,7 +71,10 @@ class Parameter(BaseModel): { "in": "query", "name": "freeForm", - "schema": {"type": "object", "additionalProperties": {"type": "integer"}}, + "schema": { + "type": "object", + "additionalProperties": {"type": "integer"}, + }, "style": "form", }, { @@ -79,7 +85,10 @@ class Parameter(BaseModel): "schema": { "type": "object", "required": ["lat", "long"], - "properties": {"lat": {"type": "number"}, "long": {"type": "number"}}, + "properties": { + "lat": {"type": "number"}, + "long": {"type": "number"}, + }, } } }, diff --git a/openapi_python_client/schema/openapi_schema_pydantic/path_item.py b/openapi_python_client/schema/openapi_schema_pydantic/path_item.py index 44beb2acb..681c616ce 100644 --- a/openapi_python_client/schema/openapi_schema_pydantic/path_item.py +++ b/openapi_python_client/schema/openapi_schema_pydantic/path_item.py @@ -51,12 +51,25 @@ class PathItem(BaseModel): "200": { "description": "pet response", "content": { - "*/*": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/Pet"}}} + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + }, + } + } }, }, "default": { "description": "error payload", - "content": {"text/html": {"schema": {"$ref": "#/components/schemas/ErrorModel"}}}, + "content": { + "text/html": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, }, }, }, diff --git a/openapi_python_client/schema/openapi_schema_pydantic/reference.py b/openapi_python_client/schema/openapi_schema_pydantic/reference.py index da913c0ce..bf4283b4c 100644 --- a/openapi_python_client/schema/openapi_schema_pydantic/reference.py +++ b/openapi_python_client/schema/openapi_schema_pydantic/reference.py @@ -24,7 +24,11 @@ class Reference(BaseModel): extra="allow", populate_by_name=True, json_schema_extra={ - "examples": [{"$ref": "#/components/schemas/Pet"}, {"$ref": "Pet.json"}, {"$ref": "definitions.json#/Pet"}] + "examples": [ + {"$ref": "#/components/schemas/Pet"}, + {"$ref": "Pet.json"}, + {"$ref": "definitions.json#/Pet"}, + ] }, ) @@ -39,5 +43,6 @@ def _reference_discriminator(obj: Any) -> Literal["ref", "other"]: ReferenceOr: TypeAlias = Annotated[ - Union[Annotated[Reference, Tag("ref")], Annotated[T, Tag("other")]], Discriminator(_reference_discriminator) + Union[Annotated[Reference, Tag("ref")], Annotated[T, Tag("other")]], + Discriminator(_reference_discriminator), ] diff --git a/openapi_python_client/schema/openapi_schema_pydantic/request_body.py b/openapi_python_client/schema/openapi_schema_pydantic/request_body.py index 8cd9bb527..a57dd7460 100644 --- a/openapi_python_client/schema/openapi_schema_pydantic/request_body.py +++ b/openapi_python_client/schema/openapi_schema_pydantic/request_body.py @@ -63,7 +63,11 @@ class RequestBody(BaseModel): }, { "description": "user to add to the system", - "content": {"text/plain": {"schema": {"type": "array", "items": {"type": "string"}}}}, + "content": { + "text/plain": { + "schema": {"type": "array", "items": {"type": "string"}} + } + }, }, ] }, diff --git a/openapi_python_client/schema/openapi_schema_pydantic/response.py b/openapi_python_client/schema/openapi_schema_pydantic/response.py index b8e7782a7..77c5e63b8 100644 --- a/openapi_python_client/schema/openapi_schema_pydantic/response.py +++ b/openapi_python_client/schema/openapi_schema_pydantic/response.py @@ -32,14 +32,24 @@ class Response(BaseModel): "description": "A complex object array response", "content": { "application/json": { - "schema": {"type": "array", "items": {"$ref": "#/components/schemas/VeryComplexType"}} + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VeryComplexType" + }, + } } }, }, - {"description": "A simple string response", "content": {"text/plain": {"schema": {"type": "string"}}}}, { "description": "A simple string response", - "content": {"text/plain": {"schema": {"type": "string", "example": "whoa!"}}}, + "content": {"text/plain": {"schema": {"type": "string"}}}, + }, + { + "description": "A simple string response", + "content": { + "text/plain": {"schema": {"type": "string", "example": "whoa!"}} + }, "headers": { "X-Rate-Limit-Limit": { "description": "The number of allowed requests in the current period", diff --git a/openapi_python_client/schema/openapi_schema_pydantic/schema.py b/openapi_python_client/schema/openapi_schema_pydantic/schema.py index e1abdeecb..68ef29b6d 100644 --- a/openapi_python_client/schema/openapi_schema_pydantic/schema.py +++ b/openapi_python_client/schema/openapi_schema_pydantic/schema.py @@ -1,6 +1,15 @@ from typing import Any, Optional, Union -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, model_validator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictFloat, + StrictInt, + StrictStr, + model_validator, +) from ..data_type import DataType from .discriminator import Discriminator @@ -75,7 +84,9 @@ class Schema(BaseModel): {"type": "object", "additionalProperties": {"type": "string"}}, { "type": "object", - "additionalProperties": {"$ref": "#/components/schemas/ComplexModel"}, + "additionalProperties": { + "$ref": "#/components/schemas/ComplexModel" + }, }, { "type": "object", diff --git a/openapi_python_client/schema/openapi_schema_pydantic/security_scheme.py b/openapi_python_client/schema/openapi_schema_pydantic/security_scheme.py index df385440c..9b3cb10f8 100644 --- a/openapi_python_client/schema/openapi_schema_pydantic/security_scheme.py +++ b/openapi_python_client/schema/openapi_schema_pydantic/security_scheme.py @@ -40,7 +40,10 @@ class SecurityScheme(BaseModel): "flows": { "implicit": { "authorizationUrl": "https://example.com/api/oauth/dialog", - "scopes": {"write:pets": "modify pets in your account", "read:pets": "read your pets"}, + "scopes": { + "write:pets": "modify pets in your account", + "read:pets": "read your pets", + }, } }, }, diff --git a/openapi_python_client/schema/openapi_schema_pydantic/server.py b/openapi_python_client/schema/openapi_schema_pydantic/server.py index 6bc21766c..449ca6c96 100644 --- a/openapi_python_client/schema/openapi_schema_pydantic/server.py +++ b/openapi_python_client/schema/openapi_schema_pydantic/server.py @@ -20,7 +20,10 @@ class Server(BaseModel): extra="allow", json_schema_extra={ "examples": [ - {"url": "https://development.gigantic-server.com/v1", "description": "Development server"}, + { + "url": "https://development.gigantic-server.com/v1", + "description": "Development server", + }, { "url": "https://{username}.gigantic-server.com:{port}/{basePath}", "description": "The production API server", diff --git a/openapi_python_client/schema/openapi_schema_pydantic/tag.py b/openapi_python_client/schema/openapi_schema_pydantic/tag.py index acb5fdc28..7d2a2ecbe 100644 --- a/openapi_python_client/schema/openapi_schema_pydantic/tag.py +++ b/openapi_python_client/schema/openapi_schema_pydantic/tag.py @@ -19,5 +19,8 @@ class Tag(BaseModel): description: Optional[str] = None externalDocs: Optional[ExternalDocumentation] = None model_config = ConfigDict( - extra="allow", json_schema_extra={"examples": [{"name": "pet", "description": "Pets operations"}]} + extra="allow", + json_schema_extra={ + "examples": [{"name": "pet", "description": "Pets operations"}] + }, ) diff --git a/openapi_python_client/templates/.gitignore.jinja b/openapi_python_client/templates/.gitignore.jinja index 79a2c3d73..f674ed247 100644 --- a/openapi_python_client/templates/.gitignore.jinja +++ b/openapi_python_client/templates/.gitignore.jinja @@ -1,3 +1,5 @@ +{# Skip .gitignore generation for monorepo integration - no file should be created #} +{% if false %} __pycache__/ build/ dist/ @@ -21,3 +23,4 @@ dmypy.json /coverage.xml /.coverage +{% endif %} diff --git a/openapi_python_client/templates/client.py.jinja b/openapi_python_client/templates/client.py.jinja index cf0301a9a..7a166a013 100644 --- a/openapi_python_client/templates/client.py.jinja +++ b/openapi_python_client/templates/client.py.jinja @@ -1,5 +1,5 @@ import ssl -from typing import Any, Union, Optional +from typing import Any from attrs import define, field, evolve import httpx @@ -65,12 +65,12 @@ class Client: _base_url: str = field(alias="base_url") _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") - _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout") - _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl") + _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: str | bool | ssl.SSLContext = field(default=True, kw_only=True, alias="verify_ssl") _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") - _client: Optional[httpx.Client] = field(default=None, init=False) - _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) + _client: httpx.Client | None = field(default=None, init=False) + _async_client: httpx.AsyncClient | None = field(default=None, init=False) {% endmacro %}{{ attributes() }} {% macro builders(self) %} def with_headers(self, headers: dict[str, str]) -> "{{ self }}": diff --git a/openapi_python_client/templates/endpoint_macros.py.jinja b/openapi_python_client/templates/endpoint_macros.py.jinja index 1b53becdd..5fafa0125 100644 --- a/openapi_python_client/templates/endpoint_macros.py.jinja +++ b/openapi_python_client/templates/endpoint_macros.py.jinja @@ -102,18 +102,18 @@ _kwargs["json"] = {{ property.python_name }} {% if endpoint.requires_security %} client: AuthenticatedClient, {% else %} -client: Union[AuthenticatedClient, Client], +client: AuthenticatedClient | Client, {% endif %} {% endif %} {# Any allowed bodies #} {% if endpoint.bodies | length == 1 %} body: {{ endpoint.bodies[0].prop.get_type_string() }}, {% elif endpoint.bodies | length > 1 %} -body: Union[ +body: ( {% for body in endpoint.bodies %} - {{ body.prop.get_type_string() }}, + {{ body.prop.get_type_string() }}{% if not loop.last %} |{% endif %} {% endfor %} -], +), {% endif %} {# query parameters #} {% for parameter in endpoint.query_parameters %} diff --git a/openapi_python_client/templates/endpoint_module.py.jinja b/openapi_python_client/templates/endpoint_module.py.jinja index 802fcc2ea..d08cefab1 100644 --- a/openapi_python_client/templates/endpoint_module.py.jinja +++ b/openapi_python_client/templates/endpoint_module.py.jinja @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union, cast +from typing import Any, cast import httpx @@ -65,7 +65,7 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[{{ return_string }}]: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> {{ return_string }} | None: {% for response in endpoint.responses %} if response.status_code == {{ response.status_code.value }}: {% if parsed_responses %}{% import "property_templates/" + response.prop.template as prop_template %} @@ -87,7 +87,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[{{ return_string }}]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[{{ return_string }}]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -114,7 +114,7 @@ def sync_detailed( {% if parsed_responses %} def sync( {{ arguments(endpoint) | indent(4) }} -) -> Optional[{{ return_string }}]: +) -> {{ return_string }} | None: {{ docstring(endpoint, return_string, is_detailed=false) | indent(4) }} return sync_detailed( @@ -140,7 +140,7 @@ async def asyncio_detailed( {% if parsed_responses %} async def asyncio( {{ arguments(endpoint) | indent(4) }} -) -> Optional[{{ return_string }}]: +) -> {{ return_string }} | None: {{ docstring(endpoint, return_string, is_detailed=false) | indent(4) }} return (await asyncio_detailed( diff --git a/openapi_python_client/templates/model.py.jinja b/openapi_python_client/templates/model.py.jinja index d792797c3..905a0d0bf 100644 --- a/openapi_python_client/templates/model.py.jinja +++ b/openapi_python_client/templates/model.py.jinja @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Optional, BinaryIO, TextIO, TYPE_CHECKING, Generator +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -14,7 +14,11 @@ from ..types import UNSET, Unset {{ relative }} {% endfor %} -{% for lazy_import in model.lazy_imports %} +{% set all_lazy_imports = model.lazy_imports | list %} +{% if model.additional_properties and model.additional_properties.lazy_imports %} +{% set all_lazy_imports = all_lazy_imports + (model.additional_properties.lazy_imports | list) %} +{% endif %} +{% for lazy_import in all_lazy_imports %} {% if loop.first %} if TYPE_CHECKING: {% endif %} @@ -107,8 +111,10 @@ field_dict: dict[str, Any] = {} {% if model.additional_properties %} {% import "property_templates/" + model.additional_properties.template as prop_template %} {% if prop_template.transform %} -for prop_name, prop in self.additional_properties.items(): - {{ prop_template.transform(model.additional_properties, "prop", "field_dict[prop_name]", declare_type=false) | indent(4) }} +field_dict.update({ + prop_name: {{ prop_template.transform(model.additional_properties, "prop", "prop", declare_type=false) }} + for prop_name, prop in self.additional_properties.items() +}) {% else %} field_dict.update(self.additional_properties) {%- endif -%} @@ -142,9 +148,6 @@ return field_dict {% endmacro %} def to_dict(self) -> dict[str, Any]: - {% for lazy_import in model.lazy_imports %} - {{ lazy_import }} - {% endfor %} {{ _to_dict() | indent(8) }} {% if model.is_multipart_body %} @@ -158,8 +161,10 @@ return field_dict {% endfor %} {% if model.additional_properties %} - for prop_name, prop in self.additional_properties.items(): - {{ multipart(model.additional_properties, "prop", "prop_name") | indent(4) }} + files.extend([ + {{ multipart(model.additional_properties, "prop", "prop_name") }} + for prop_name, prop in self.additional_properties.items() + ]) {% endif %} return files @@ -168,9 +173,6 @@ return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - {% for lazy_import in model.lazy_imports %} - {{ lazy_import }} - {% endfor %} {% if (model.required_properties or model.optional_properties or model.additional_properties) %} d = dict(src_dict) {% for property in model.required_properties + model.optional_properties %} @@ -198,11 +200,7 @@ return field_dict {% if model.additional_properties.template %}{# Can be a bool instead of an object #} {% import "property_templates/" + model.additional_properties.template as prop_template %} -{% if model.additional_properties.lazy_imports %} - {% for lazy_import in model.additional_properties.lazy_imports %} - {{ lazy_import }} - {% endfor %} -{% endif %} + {% else %} {% set prop_template = None %} {% endif %} diff --git a/openapi_python_client/templates/pyproject.toml.jinja b/openapi_python_client/templates/pyproject.toml.jinja index 9f21f8043..d607bb694 100644 --- a/openapi_python_client/templates/pyproject.toml.jinja +++ b/openapi_python_client/templates/pyproject.toml.jinja @@ -1,3 +1,5 @@ +{# Skip pyproject.toml generation for monorepo integration - no file should be created #} +{# {% if meta == "poetry" %} {% include "pyproject_poetry.toml.jinja" %} {% elif meta == "pdm" %} @@ -7,3 +9,5 @@ {% endif %} {% include "pyproject_ruff.toml.jinja" %} +{% endif %} +#} diff --git a/openapi_python_client/templates/types.py.jinja b/openapi_python_client/templates/types.py.jinja index 2330892ca..aebf5f11c 100644 --- a/openapi_python_client/templates/types.py.jinja +++ b/openapi_python_client/templates/types.py.jinja @@ -2,7 +2,7 @@ from collections.abc import Mapping, MutableMapping from http import HTTPStatus -from typing import BinaryIO, Generic, Optional, TypeVar, Literal, Union, IO +from typing import BinaryIO, Generic, TypeVar, Literal, IO from attrs import define @@ -15,13 +15,13 @@ class Unset: UNSET: Unset = Unset() # The types that `httpx.Client(files=)` can accept, copied from that library. -FileContent = Union[IO[bytes], bytes, str] -FileTypes = Union[ +FileContent = IO[bytes] | bytes | str +FileTypes = ( # (filename, file (or bytes), content_type) - tuple[Optional[str], FileContent, Optional[str]], + tuple[str | None, FileContent, str | None] | # (filename, file (or bytes), content_type, headers) - tuple[Optional[str], FileContent, Optional[str], Mapping[str, str]], -] + tuple[str | None, FileContent, str | None, Mapping[str, str]] +) RequestFiles = list[tuple[str, FileTypes]] @define @@ -29,8 +29,8 @@ class File: """ Contains information for file uploads """ payload: BinaryIO - file_name: Optional[str] = None - mime_type: Optional[str] = None + file_name: str | None = None + mime_type: str | None = None def to_tuple(self) -> FileTypes: """ Return a tuple representation that httpx will accept for multipart/form-data """ @@ -47,7 +47,7 @@ class Response(Generic[T]): status_code: HTTPStatus content: bytes headers: MutableMapping[str, str] - parsed: Optional[T] + parsed: T | None __all__ = ["UNSET", "File", "FileTypes", "RequestFiles", "Response", "Unset"] diff --git a/openapi_python_client/utils.py b/openapi_python_client/utils.py index 15e8c9eec..cd564b09a 100644 --- a/openapi_python_client/utils.py +++ b/openapi_python_client/utils.py @@ -14,7 +14,9 @@ class PythonIdentifier(str): """A snake_case string which has been validated / transformed into a valid identifier for Python""" - def __new__(cls, value: str, prefix: str, skip_snake_case: bool = False) -> PythonIdentifier: + def __new__( + cls, value: str, prefix: str, skip_snake_case: bool = False + ) -> PythonIdentifier: new_value = sanitize(value) if not skip_snake_case: new_value = snake_case(new_value) @@ -85,7 +87,9 @@ def snake_case(value: str) -> str: def pascal_case(value: str) -> str: """Converts to PascalCase""" words = split_words(sanitize(value)) - capitalized_words = (word.capitalize() if not word.isupper() else word for word in words) + capitalized_words = ( + word.capitalize() if not word.isupper() else word for word in words + ) return "".join(capitalized_words) diff --git a/pyproject.toml b/pyproject.toml index 614cb733d..6513ed65a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,40 +46,131 @@ repository = "https://github.com/openapi-generators/openapi-python-client" [project.scripts] openapi-python-client = "openapi_python_client.cli:app" -[tool.ruff] -line-length = 120 -exclude = [ - ".git", - ".mypy_cache", - ".venv", - "openapi_python_client/templates/*", - "end_to_end_tests/*", - "tests/test_templates/*", -] - -[tool.ruff.lint] -select = ["E", "F", "I", "UP", "B", "PL", "RUF"] -ignore = ["E501", "PLR0913", "PLR2004"] - -[tool.ruff.lint.per-file-ignores] -"openapi_python_client/cli.py" = ["B008"] -"tests/*" = ["PLR2004"] - [tool.coverage.run] omit = ["openapi_python_client/__main__.py", "openapi_python_client/templates/*", "end_to_end_tests/*", "integration_tests/*", "tests/*"] [tool.mypy] -plugins = ["pydantic.mypy"] +python_version = "3.13" # Will break in 3.14 due to protobufs dependency +strict = true +warn_unreachable = true +no_implicit_optional = false disallow_any_generics = true -disallow_untyped_defs = true -warn_redundant_casts = true +warn_return_any = false +explicit_package_bases = true +disable_error_code = "unused-ignore" +mypy_path = "python/protocols" +allow_untyped_globals = false +allow_redefinition = false +local_partial_types = false strict_equality = true +enable_error_code = ["deprecated"] -[[tool.mypy.overrides]] -module = [ - "importlib_metadata", - "typer", +[tool.ruff] +src = ["python"] +lint.select = [ + "SIM102", + "B904", + "B007", + "SIM108", + "B006", + "B904", + "B007", + "B023", + "SIM118", + "A002", + "PERF", + "PL", + "PTH", + "LOG", + "S", + "RUF", + "E", + "W", + # TODO: introduce gradually here and pyproject.toml (mostly copying standard from pandas repo) + # YTT - flake8-2020 + # Q - flake8-quotes + # INT - flake8-gettext + # PT - flake8-pytest-style + # PYI - flake8-pyi + # ISC - implicit string concatenation + # TC - flake8-type-checking + # PGH - pygrep-hooks + # NPY002 - numpy-legacy-random + # G - flake8-logging-format + # FA - flake8-future-annotations + # ICN001 - unconventional-import-alias + # SLOT - flake8-slots + # RSE - flake8-raise + # UP046/7 - clearer generics, seems like type checkers dont understand it yet +] +lint.ignore = [ + "PLR", + # try-except-in-loop, becomes useless in Python 3.11 + "PERF203", + "RUF022", + # Min line lenght, we use black + "E501", + # Blank line contains whitespace, black should clear + "W293", + "S106", + "S101", + "S608", + "S603", + "RUF009", + # getattr is used to side-step mypy + "B010", + # tests use comparisons but not their returned value + "B015", + # Function definition does not bind loop variable + "B023", + # Too many arguments to function call + "B905", + # Too many returns + "PLR0913", + # Too many branches + "PLR0911", + # Too many statements + "PLR0915", + # Redefined loop name + "PLW2901", + # Global statements are discouraged + "PLW0603", + # Use `typing.NamedTuple` instead of `collections.namedtuple` + "PYI024", + # Use of possibly insecure function; consider using ast.literal_eval + "S307", + # while int | float can be shortened to float, the former is more explicit + "PERF102", + # pytest-parametrize-names-wrong-type + "PT006", + # pytest-parametrize-values-wrong-type + "PT007", + # pytest-patch-with-lambda + "PT008", + # pytest-raises-with-multiple-statements + "PT017", + # pytest-assert-in-except + "PT018", + # pytest-composite-assertion + "PT019", + # pytest-fixture-param-without-value + "ISC001", + # if-stmt-min-max + "PLR1730", + # type vs TypeAlias do not have the same runtime behavior + "UP040", + # binding to all interfaces, we do this too much - someone smarter than me will fix this + "S104", + # UP046/7 - clearer generics, seems like type checkers dont understand it yet + "UP046", + "UP047", ] + +[tool.ruff.lint.isort] +known-first-party = ["python"] + +[[tool.mypy.overrides]] +module = "psutil" ignore_missing_imports = true [tool.pytest.ini_options] diff --git a/tests/conftest.py b/tests/conftest.py index 3d2660c49..0d310e315 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -61,7 +61,10 @@ def _factory(**kwargs): kwargs = _common_kwargs(kwargs) kwargs = { "description": "", - "class_info": Class(name=ClassName("MyClass", ""), module_name=PythonIdentifier("my_module", "")), + "class_info": Class( + name=ClassName("MyClass", ""), + module_name=PythonIdentifier("my_module", ""), + ), "data": oai.Schema.model_construct(), "roots": set(), "required_properties": None, @@ -280,7 +283,9 @@ def __call__( @pytest.fixture -def union_property_factory(date_time_property_factory, string_property_factory) -> UnionFactory: +def union_property_factory( + date_time_property_factory, string_property_factory +) -> UnionFactory: """ This fixture surfaces in the test as a function which manufactures UnionProperties with defaults. @@ -288,7 +293,8 @@ def union_property_factory(date_time_property_factory, string_property_factory) """ return _simple_factory( - UnionProperty, {"inner_properties": [date_time_property_factory(), string_property_factory()]} + UnionProperty, + {"inner_properties": [date_time_property_factory(), string_property_factory()]}, ) diff --git a/tests/test___init__.py b/tests/test___init__.py index 34ad3188f..272d0082b 100644 --- a/tests/test___init__.py +++ b/tests/test___init__.py @@ -5,7 +5,9 @@ from openapi_python_client import Config, ErrorLevel, Project from openapi_python_client.config import ConfigFile -default_http_timeout = ConfigFile.model_json_schema()["properties"]["http_timeout"]["default"] +default_http_timeout = ConfigFile.model_json_schema()["properties"]["http_timeout"][ + "default" +] def make_project(config: Config) -> Project: @@ -24,7 +26,9 @@ def project_with_dir(config) -> Project: class TestProject: - def test__run_post_hooks_reports_missing_commands(self, project_with_dir: Project) -> None: + def test__run_post_hooks_reports_missing_commands( + self, project_with_dir: Project + ) -> None: fake_command_name = "blahblahdoesntexist" project_with_dir.config.post_hooks = [fake_command_name] need_to_make_cwd = not project_with_dir.project_dir.exists() @@ -39,7 +43,9 @@ def test__run_post_hooks_reports_missing_commands(self, project_with_dir: Projec assert error.header == "Skipping Integration" assert fake_command_name in error.detail - def test__run_post_hooks_reports_stdout_of_commands_that_error_with_no_stderr(self, project_with_dir): + def test__run_post_hooks_reports_stdout_of_commands_that_error_with_no_stderr( + self, project_with_dir + ): failing_command = "python3 -c \"print('a message'); exit(1)\"" project_with_dir.config.post_hooks = [failing_command] project_with_dir._run_post_hooks() @@ -50,8 +56,12 @@ def test__run_post_hooks_reports_stdout_of_commands_that_error_with_no_stderr(se assert error.header == "python3 failed" assert "a message" in error.detail - def test__run_post_hooks_reports_stderr_of_commands_that_error(self, project_with_dir): - failing_command = "python3 -c \"print('a message'); raise Exception('some exception')\"" + def test__run_post_hooks_reports_stderr_of_commands_that_error( + self, project_with_dir + ): + failing_command = ( + "python3 -c \"print('a message'); raise Exception('some exception')\"" + ) project_with_dir.config.post_hooks = [failing_command] project_with_dir._run_post_hooks() diff --git a/tests/test_cli.py b/tests/test_cli.py index 0775ce5c1..059f3e600 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -16,7 +16,9 @@ def test_bad_config() -> None: config_path = "config/path" path = "cool/path" - result = runner.invoke(app, ["generate", f"--config={config_path}", f"--path={path}"]) + result = runner.invoke( + app, ["generate", f"--config={config_path}", f"--path={path}"] + ) assert result.exit_code == 2 assert "Unable to parse config" in result.stdout @@ -37,7 +39,9 @@ def test_generate_url_and_path(self) -> None: def test_generate_encoding_errors(self) -> None: path = "cool/path" file_encoding = "error-file-encoding" - result = runner.invoke(app, ["generate", f"--path={path}", f"--file-encoding={file_encoding}"]) + result = runner.invoke( + app, ["generate", f"--path={path}", f"--file-encoding={file_encoding}"] + ) assert result.exit_code == 1 assert result.output == f"Unknown encoding : {file_encoding}\n" diff --git a/tests/test_parser/test_bodies.py b/tests/test_parser/test_bodies.py index 0956d11f6..dce6e4abc 100644 --- a/tests/test_parser/test_bodies.py +++ b/tests/test_parser/test_bodies.py @@ -33,7 +33,11 @@ def test_errors(config): ) errs, _ = body_from_data( - data=operation, schemas=Schemas(), config=config, endpoint_name="this will not succeed", request_bodies={} + data=operation, + schemas=Schemas(), + config=config, + endpoint_name="this will not succeed", + request_bodies={}, ) assert len(errs) == len(operation.request_body.content) diff --git a/tests/test_parser/test_openapi.py b/tests/test_parser/test_openapi.py index 3d1391ae2..80c2c5fa3 100644 --- a/tests/test_parser/test_openapi.py +++ b/tests/test_parser/test_openapi.py @@ -5,8 +5,17 @@ import openapi_python_client.schema as oai from openapi_python_client.parser.errors import ParseError -from openapi_python_client.parser.openapi import Endpoint, EndpointCollection, import_string_from_class -from openapi_python_client.parser.properties import Class, IntProperty, Parameters, Schemas +from openapi_python_client.parser.openapi import ( + Endpoint, + EndpointCollection, + import_string_from_class, +) +from openapi_python_client.parser.properties import ( + Class, + IntProperty, + Parameters, + Schemas, +) from openapi_python_client.schema import DataType MODULE_NAME = "openapi_python_client.parser.openapi" @@ -33,7 +42,9 @@ def test__add_responses_status_code_error(self, response_status_code, mocker): } endpoint = self.make_endpoint() parse_error = ParseError(data=mocker.MagicMock()) - response_from_data = mocker.patch(f"{MODULE_NAME}.response_from_data", return_value=(parse_error, schemas)) + response_from_data = mocker.patch( + f"{MODULE_NAME}.response_from_data", return_value=(parse_error, schemas) + ) config = MagicMock() response, schemas = Endpoint._add_responses( @@ -58,7 +69,9 @@ def test__add_responses_error(self, mocker): } endpoint = self.make_endpoint() parse_error = ParseError(data=mocker.MagicMock(), detail="some problem") - response_from_data = mocker.patch(f"{MODULE_NAME}.response_from_data", return_value=(parse_error, schemas)) + response_from_data = mocker.patch( + f"{MODULE_NAME}.response_from_data", return_value=(parse_error, schemas) + ) config = MagicMock() response, schemas = Endpoint._add_responses( @@ -119,9 +132,15 @@ def test_add_parameters_parse_error(self, mocker): initial_parameters = mocker.MagicMock() parse_error = ParseError(data=mocker.MagicMock()) property_schemas = mocker.MagicMock() - mocker.patch(f"{MODULE_NAME}.property_from_data", return_value=(parse_error, property_schemas)) + mocker.patch( + f"{MODULE_NAME}.property_from_data", + return_value=(parse_error, property_schemas), + ) param = oai.Parameter.model_construct( - name="test", required=True, param_schema=mocker.MagicMock(), param_in="cookie" + name="test", + required=True, + param_schema=mocker.MagicMock(), + param_in="cookie", ) config = MagicMock() @@ -157,7 +176,10 @@ def test_add_parameters_header_types(self, data_type, allowed, config): initial_schemas = Schemas() parameters = Parameters() param = oai.Parameter.model_construct( - name="test", required=True, param_schema=oai.Schema(type=data_type), param_in=oai.ParameterLocation.HEADER + name="test", + required=True, + param_schema=oai.Schema(type=data_type), + param_in=oai.ParameterLocation.HEADER, ) result = Endpoint.add_parameters( @@ -190,13 +212,25 @@ def test__add_parameters_parse_error_on_non_required_path_param(self, config): schemas=schemas, config=config, ) - assert result == (ParseError(data=param, detail="Path parameter must be required"), schemas, parameters) + assert result == ( + ParseError(data=param, detail="Path parameter must be required"), + schemas, + parameters, + ) def test_validation_error_when_location_not_supported(self, mocker): parsed_schemas = mocker.MagicMock() - mocker.patch(f"{MODULE_NAME}.property_from_data", return_value=(mocker.MagicMock(), parsed_schemas)) + mocker.patch( + f"{MODULE_NAME}.property_from_data", + return_value=(mocker.MagicMock(), parsed_schemas), + ) with pytest.raises(pydantic.ValidationError): - oai.Parameter(name="test", required=True, param_schema=mocker.MagicMock(), param_in="error_location") + oai.Parameter( + name="test", + required=True, + param_schema=mocker.MagicMock(), + param_in="error_location", + ) def test__add_parameters_handles_invalid_references(self, config): """References are not supported as direct params yet""" @@ -209,7 +243,11 @@ def test__add_parameters_handles_invalid_references(self, config): parameters = Parameters() (error, _, return_parameters) = endpoint.add_parameters( - endpoint=endpoint, data=data, schemas=Schemas(), parameters=parameters, config=config + endpoint=endpoint, + data=data, + schemas=Schemas(), + parameters=parameters, + config=config, ) assert isinstance(error, ParseError) @@ -225,14 +263,20 @@ def test__add_parameters_resolves_references(self, mocker, param_factory, config ) parameters = mocker.MagicMock() - new_param = param_factory(name="blah", schema=oai.Schema.model_construct(type="string")) + new_param = param_factory( + name="blah", schema=oai.Schema.model_construct(type="string") + ) parameters.classes_by_name = { "blah": new_param, } parameters.classes_by_reference = {"components/parameters/blah": new_param} (endpoint, _, return_parameters) = endpoint.add_parameters( - endpoint=endpoint, data=data, schemas=Schemas(), parameters=parameters, config=config + endpoint=endpoint, + data=data, + schemas=Schemas(), + parameters=parameters, + config=config, ) assert isinstance(endpoint, Endpoint) @@ -251,7 +295,11 @@ def test__add_parameters_skips_params_without_schemas(self, config): ) (endpoint, _, _) = endpoint.add_parameters( - endpoint=endpoint, data=data, schemas=Schemas(), parameters=Parameters(), config=config + endpoint=endpoint, + data=data, + schemas=Schemas(), + parameters=Parameters(), + config=config, ) assert isinstance(endpoint, Endpoint) @@ -282,7 +330,11 @@ def test__add_parameters_same_identifier_conflict(self, config): ) (err, _, _) = endpoint.add_parameters( - endpoint=endpoint, data=data, schemas=Schemas(), parameters=Parameters(), config=config + endpoint=endpoint, + data=data, + schemas=Schemas(), + parameters=Parameters(), + config=config, ) assert isinstance(err, ParseError) @@ -308,7 +360,11 @@ def test__add_parameters_query_optionality(self, config): ) (endpoint, _, _) = endpoint.add_parameters( - endpoint=endpoint, data=data, schemas=Schemas(), parameters=Parameters(), config=config + endpoint=endpoint, + data=data, + schemas=Schemas(), + parameters=Parameters(), + config=config, ) assert len(endpoint.query_parameters) == 2, "Not all query params were added" @@ -321,14 +377,21 @@ def test__add_parameters_query_optionality(self, config): def test_add_parameters_duplicate_properties(self, config): endpoint = self.make_endpoint() param = oai.Parameter.model_construct( - name="test", required=True, param_schema=oai.Schema.model_construct(type="string"), param_in="path" + name="test", + required=True, + param_schema=oai.Schema.model_construct(type="string"), + param_in="path", ) data = oai.Operation.model_construct(parameters=[param, param]) schemas = Schemas() parameters = Parameters() result = Endpoint.add_parameters( - endpoint=endpoint, data=data, schemas=schemas, parameters=parameters, config=config + endpoint=endpoint, + data=data, + schemas=schemas, + parameters=parameters, + config=config, ) assert result == ( ParseError( @@ -344,10 +407,16 @@ def test_add_parameters_duplicate_properties(self, config): def test_add_parameters_duplicate_properties_different_location(self, config): endpoint = self.make_endpoint() path_param = oai.Parameter.model_construct( - name="test", required=True, param_schema=oai.Schema.model_construct(type="string"), param_in="path" + name="test", + required=True, + param_schema=oai.Schema.model_construct(type="string"), + param_in="path", ) query_param = oai.Parameter.model_construct( - name="test", required=True, param_schema=oai.Schema.model_construct(type="string"), param_in="query" + name="test", + required=True, + param_schema=oai.Schema.model_construct(type="string"), + param_in="query", ) schemas = Schemas() parameters = Parameters() @@ -407,7 +476,11 @@ def test_from_data_bad_params(self, mocker, config): parse_error = ParseError(data=mocker.MagicMock()) return_schemas = mocker.MagicMock() return_parameters = mocker.MagicMock() - mocker.patch.object(Endpoint, "add_parameters", return_value=(parse_error, return_schemas, return_parameters)) + mocker.patch.object( + Endpoint, + "add_parameters", + return_value=(parse_error, return_schemas, return_parameters), + ) data = oai.Operation.model_construct( description=mocker.MagicMock(), operationId=mocker.MagicMock(), @@ -438,10 +511,14 @@ def test_from_data_bad_responses(self, mocker, config): param_schemas = mocker.MagicMock() return_parameters = mocker.MagicMock() mocker.patch.object( - Endpoint, "add_parameters", return_value=(mocker.MagicMock(), param_schemas, return_parameters) + Endpoint, + "add_parameters", + return_value=(mocker.MagicMock(), param_schemas, return_parameters), ) response_schemas = mocker.MagicMock() - _add_responses = mocker.patch.object(Endpoint, "_add_responses", return_value=(parse_error, response_schemas)) + _add_responses = mocker.patch.object( + Endpoint, "_add_responses", return_value=(parse_error, response_schemas) + ) data = oai.Operation.model_construct( description=mocker.MagicMock(), operationId=mocker.MagicMock(), @@ -472,12 +549,16 @@ def test_from_data_standard(self, mocker, config): param_endpoint = mocker.MagicMock() return_parameters = mocker.MagicMock() add_parameters = mocker.patch.object( - Endpoint, "add_parameters", return_value=(param_endpoint, param_schemas, return_parameters) + Endpoint, + "add_parameters", + return_value=(param_endpoint, param_schemas, return_parameters), ) response_schemas = mocker.MagicMock() response_endpoint = mocker.MagicMock() _add_responses = mocker.patch.object( - Endpoint, "_add_responses", return_value=(response_endpoint, response_schemas) + Endpoint, + "_add_responses", + return_value=(response_endpoint, response_schemas), ) data = oai.Operation.model_construct( description=mocker.MagicMock(), @@ -488,7 +569,10 @@ def test_from_data_standard(self, mocker, config): initial_schemas = mocker.MagicMock() initial_parameters = mocker.MagicMock() - mocker.patch("openapi_python_client.utils.remove_string_escapes", return_value=data.description) + mocker.patch( + "openapi_python_client.utils.remove_string_escapes", + return_value=data.description, + ) Endpoint.from_data( data=data, @@ -518,17 +602,25 @@ def test_from_data_standard(self, mocker, config): config=config, ) _add_responses.assert_called_once_with( - endpoint=param_endpoint, data=data.responses, schemas=param_schemas, responses={}, config=config + endpoint=param_endpoint, + data=data.responses, + schemas=param_schemas, + responses={}, + config=config, ) def test_from_data_no_operation_id(self, mocker, config): path = "/path/with/{param}/" method = "get" add_parameters = mocker.patch.object( - Endpoint, "add_parameters", return_value=(mocker.MagicMock(), mocker.MagicMock(), mocker.MagicMock()) + Endpoint, + "add_parameters", + return_value=(mocker.MagicMock(), mocker.MagicMock(), mocker.MagicMock()), ) _add_responses = mocker.patch.object( - Endpoint, "_add_responses", return_value=(mocker.MagicMock(), mocker.MagicMock()) + Endpoint, + "_add_responses", + return_value=(mocker.MagicMock(), mocker.MagicMock()), ) data = oai.Operation.model_construct( description=mocker.MagicMock(), @@ -537,7 +629,10 @@ def test_from_data_no_operation_id(self, mocker, config): responses=mocker.MagicMock(), ) schemas = mocker.MagicMock() - mocker.patch("openapi_python_client.utils.remove_string_escapes", return_value=data.description) + mocker.patch( + "openapi_python_client.utils.remove_string_escapes", + return_value=data.description, + ) parameters = mocker.MagicMock() endpoint, _, return_params = Endpoint.from_data( @@ -583,14 +678,21 @@ def test_from_data_no_security(self, mocker, config): responses=mocker.MagicMock(), ) add_parameters = mocker.patch.object( - Endpoint, "add_parameters", return_value=(mocker.MagicMock(), mocker.MagicMock(), mocker.MagicMock()) + Endpoint, + "add_parameters", + return_value=(mocker.MagicMock(), mocker.MagicMock(), mocker.MagicMock()), ) _add_responses = mocker.patch.object( - Endpoint, "_add_responses", return_value=(mocker.MagicMock(), mocker.MagicMock()) + Endpoint, + "_add_responses", + return_value=(mocker.MagicMock(), mocker.MagicMock()), ) path = mocker.MagicMock() method = mocker.MagicMock() - mocker.patch("openapi_python_client.utils.remove_string_escapes", return_value=data.description) + mocker.patch( + "openapi_python_client.utils.remove_string_escapes", + return_value=data.description, + ) schemas = mocker.MagicMock() parameters = mocker.MagicMock() @@ -635,8 +737,12 @@ def test_from_data_some_bad_bodies(self, config): responses={}, requestBody=oai.RequestBody( content={ - "application/json": oai.MediaType(media_type_schema=oai.Schema(type=DataType.STRING)), - "not a real media type": oai.MediaType(media_type_schema=oai.Schema(type=DataType.STRING)), + "application/json": oai.MediaType( + media_type_schema=oai.Schema(type=DataType.STRING) + ), + "not a real media type": oai.MediaType( + media_type_schema=oai.Schema(type=DataType.STRING) + ), }, ), ), @@ -660,7 +766,9 @@ def test_from_data_all_bodies_bad(self, config): responses={}, requestBody=oai.RequestBody( content={ - "not a real media type": oai.MediaType(media_type_schema=oai.Schema(type=DataType.STRING)), + "not a real media type": oai.MediaType( + media_type_schema=oai.Schema(type=DataType.STRING) + ), }, ), ), @@ -678,7 +786,11 @@ def test_from_data_all_bodies_bad(self, config): @pytest.mark.parametrize( "response_types, expected", - (([], "Any"), (["Something"], "Something"), (["First", "Second", "Second"], "Union[First, Second]")), + ( + ([], "Any"), + (["Something"], "Something"), + (["First", "Second", "Second"], "Union[First, Second]"), + ), ) def test_response_type(self, response_types, expected): endpoint = self.make_endpoint() @@ -711,13 +823,17 @@ def test_from_data_overrides_path_item_params_with_operation_params(self, config "/": oai.PathItem.model_construct( parameters=[ oai.Parameter.model_construct( - name="param", param_in="query", param_schema=oai.Schema.model_construct(type="string") + name="param", + param_in="query", + param_schema=oai.Schema.model_construct(type="string"), ), ], get=oai.Operation.model_construct( parameters=[ oai.Parameter.model_construct( - name="param", param_in="query", param_schema=oai.Schema.model_construct(type="integer") + name="param", + param_in="query", + param_schema=oai.Schema.model_construct(type="integer"), ) ], responses={"200": oai.Response.model_construct(description="blah")}, diff --git a/tests/test_parser/test_properties/test_init.py b/tests/test_parser/test_properties/test_init.py index 6db5c2752..97c69df74 100644 --- a/tests/test_parser/test_properties/test_init.py +++ b/tests/test_parser/test_properties/test_init.py @@ -52,10 +52,14 @@ def test_get_lazy_import_base_inner(self, union_property_factory): p = union_property_factory() assert p.get_lazy_imports(prefix="..") == set() - def test_get_lazy_import_model_inner(self, union_property_factory, model_property_factory): + def test_get_lazy_import_model_inner( + self, union_property_factory, model_property_factory + ): m = model_property_factory() p = union_property_factory(inner_properties=[m]) - assert p.get_lazy_imports(prefix="..") == {"from ..models.my_module import MyClass"} + assert p.get_lazy_imports(prefix="..") == { + "from ..models.my_module import MyClass" + } @pytest.mark.parametrize( "required,no_optional,json,expected", @@ -90,20 +94,29 @@ def test_get_type_string( assert p.get_type_string(no_optional=no_optional, json=json) == expected def test_get_base_type_string_base_inners( - self, union_property_factory, date_time_property_factory, string_property_factory + self, + union_property_factory, + date_time_property_factory, + string_property_factory, ): - p = union_property_factory(inner_properties=[date_time_property_factory(), string_property_factory()]) + p = union_property_factory( + inner_properties=[date_time_property_factory(), string_property_factory()] + ) assert p.get_base_type_string() == "Union[datetime.datetime, str]" - def test_get_base_type_string_one_base_inner(self, union_property_factory, date_time_property_factory): + def test_get_base_type_string_one_base_inner( + self, union_property_factory, date_time_property_factory + ): p = union_property_factory( inner_properties=[date_time_property_factory()], ) assert p.get_base_type_string() == "datetime.datetime" - def test_get_base_type_string_one_model_inner(self, union_property_factory, model_property_factory): + def test_get_base_type_string_one_model_inner( + self, union_property_factory, model_property_factory + ): p = union_property_factory( inner_properties=[model_property_factory()], ) @@ -113,11 +126,15 @@ def test_get_base_type_string_one_model_inner(self, union_property_factory, mode def test_get_base_type_string_model_inners( self, union_property_factory, date_time_property_factory, model_property_factory ): - p = union_property_factory(inner_properties=[date_time_property_factory(), model_property_factory()]) + p = union_property_factory( + inner_properties=[date_time_property_factory(), model_property_factory()] + ) assert p.get_base_type_string() == "Union['MyClass', datetime.datetime]" - def test_get_base_json_type_string(self, union_property_factory, date_time_property_factory): + def test_get_base_json_type_string( + self, union_property_factory, date_time_property_factory + ): p = union_property_factory( inner_properties=[date_time_property_factory()], ) @@ -125,7 +142,9 @@ def test_get_base_json_type_string(self, union_property_factory, date_time_prope assert p.get_base_json_type_string() == "str" @pytest.mark.parametrize("required", (True, False)) - def test_get_type_imports(self, union_property_factory, date_time_property_factory, required): + def test_get_type_imports( + self, union_property_factory, date_time_property_factory, required + ): p = union_property_factory( inner_properties=[date_time_property_factory()], required=required, @@ -151,16 +170,27 @@ def test_property_from_data_ref_model(self, model_property_factory, config): required = False class_name = ClassName("MyModel", "") data = oai.Reference.model_construct(ref=f"#/components/schemas/{class_name}") - class_info = Class(name=class_name, module_name=PythonIdentifier("my_model", "")) + class_info = Class( + name=class_name, module_name=PythonIdentifier("my_model", "") + ) existing_model = model_property_factory( name="old_name", class_info=class_info, ) - schemas = Schemas(classes_by_reference={ReferencePath(f"/components/schemas/{class_name}"): existing_model}) + schemas = Schemas( + classes_by_reference={ + ReferencePath(f"/components/schemas/{class_name}"): existing_model + } + ) prop, new_schemas = property_from_data( - name=name, required=required, data=data, schemas=schemas, parent_name="", config=config + name=name, + required=required, + data=data, + schemas=schemas, + parent_name="", + config=config, ) assert prop == model_property_factory( @@ -176,16 +206,25 @@ def test_property_from_data_ref_not_found(self, mocker): schemas = Schemas() prop, new_schemas = property_from_data( - name="a_prop", required=False, data=data, schemas=schemas, parent_name="parent", config=mocker.MagicMock() + name="a_prop", + required=False, + data=data, + schemas=schemas, + parent_name="parent", + config=mocker.MagicMock(), ) parse_reference_path.assert_called_once_with(data.ref) - assert prop == PropertyError(data=data, detail="Could not find reference in parsed models or enums") + assert prop == PropertyError( + data=data, detail="Could not find reference in parsed models or enums" + ) assert schemas == new_schemas assert schemas.dependencies == {} @pytest.mark.parametrize("references_exist", (True, False)) - def test_property_from_data_ref(self, any_property_factory, references_exist, config): + def test_property_from_data_ref( + self, any_property_factory, references_exist, config + ): name = "new_name" required = False ref_path = "/components/schemas/RefName" @@ -194,27 +233,43 @@ def test_property_from_data_ref(self, any_property_factory, references_exist, co existing_property = any_property_factory(name="old_name") references = {ref_path: {"old_root"}} if references_exist else {} - schemas = Schemas(classes_by_reference={ref_path: existing_property}, dependencies=references) + schemas = Schemas( + classes_by_reference={ref_path: existing_property}, dependencies=references + ) prop, new_schemas = property_from_data( - name=name, required=required, data=data, schemas=schemas, parent_name="", config=config, roots=roots + name=name, + required=required, + data=data, + schemas=schemas, + parent_name="", + config=config, + roots=roots, ) assert prop == any_property_factory(name=name, required=required) assert schemas == new_schemas - assert schemas.dependencies == {ref_path: {*roots, *references.get(ref_path, set())}} + assert schemas.dependencies == { + ref_path: {*roots, *references.get(ref_path, set())} + } def test_property_from_data_invalid_ref(self, mocker): name = mocker.MagicMock() required = mocker.MagicMock() data = oai.Reference.model_construct(ref=mocker.MagicMock()) parse_reference_path = mocker.patch( - f"{MODULE_NAME}.parse_reference_path", return_value=PropertyError(detail="bad stuff") + f"{MODULE_NAME}.parse_reference_path", + return_value=PropertyError(detail="bad stuff"), ) schemas = Schemas() prop, new_schemas = property_from_data( - name=name, required=required, data=data, schemas=schemas, parent_name="parent", config=mocker.MagicMock() + name=name, + required=required, + data=data, + schemas=schemas, + parent_name="parent", + config=mocker.MagicMock(), ) parse_reference_path.assert_called_once_with(data.ref) @@ -226,18 +281,30 @@ class TestStringBasedProperty: def test__string_based_property_binary_format(self, file_property_factory, config): name = "file_prop" required = True - data = oai.Schema.model_construct(type="string", schema_format="binary", default="a") + data = oai.Schema.model_construct( + type="string", schema_format="binary", default="a" + ) p, _ = property_from_data( - name=name, required=required, data=data, schemas=Schemas(), config=config, parent_name="" + name=name, + required=required, + data=data, + schemas=Schemas(), + config=config, + parent_name="", ) assert p == file_property_factory(name=name, required=required) class TestCreateSchemas: def test_skips_references_and_keeps_going(self, mocker, config): - components = {"a_ref": Reference.model_construct(), "a_schema": Schema.model_construct()} - update_schemas_with_data = mocker.patch(f"{MODULE_NAME}.update_schemas_with_data") + components = { + "a_ref": Reference.model_construct(), + "a_schema": Schema.model_construct(), + } + update_schemas_with_data = mocker.patch( + f"{MODULE_NAME}.update_schemas_with_data" + ) parse_reference_path = mocker.patch(f"{MODULE_NAME}.parse_reference_path") schemas = Schemas() @@ -249,16 +316,27 @@ def test_skips_references_and_keeps_going(self, mocker, config): config=config, data=components["a_schema"], schemas=Schemas( - errors=[PropertyError(detail="Reference schemas are not supported.", data=components["a_ref"])] + errors=[ + PropertyError( + detail="Reference schemas are not supported.", + data=components["a_ref"], + ) + ] ), ) assert result == update_schemas_with_data.return_value def test_records_bad_uris_and_keeps_going(self, mocker, config): - components = {"first": Schema.model_construct(), "second": Schema.model_construct()} - update_schemas_with_data = mocker.patch(f"{MODULE_NAME}.update_schemas_with_data") + components = { + "first": Schema.model_construct(), + "second": Schema.model_construct(), + } + update_schemas_with_data = mocker.patch( + f"{MODULE_NAME}.update_schemas_with_data" + ) parse_reference_path = mocker.patch( - f"{MODULE_NAME}.parse_reference_path", side_effect=[PropertyError(detail="some details"), "a_path"] + f"{MODULE_NAME}.parse_reference_path", + side_effect=[PropertyError(detail="some details"), "a_path"], ) schemas = Schemas() @@ -273,14 +351,20 @@ def test_records_bad_uris_and_keeps_going(self, mocker, config): ref_path="a_path", config=config, data=components["second"], - schemas=Schemas(errors=[PropertyError(detail="some details", data=components["first"])]), + schemas=Schemas( + errors=[PropertyError(detail="some details", data=components["first"])] + ), ) assert result == update_schemas_with_data.return_value def test_retries_failing_properties_while_making_progress(self, mocker, config): - components = {"first": Schema.model_construct(), "second": Schema.model_construct()} + components = { + "first": Schema.model_construct(), + "second": Schema.model_construct(), + } update_schemas_with_data = mocker.patch( - f"{MODULE_NAME}.update_schemas_with_data", side_effect=[PropertyError(), Schemas(), PropertyError()] + f"{MODULE_NAME}.update_schemas_with_data", + side_effect=[PropertyError(), Schemas(), PropertyError()], ) parse_reference_path = mocker.patch(f"{MODULE_NAME}.parse_reference_path") schemas = Schemas() @@ -298,10 +382,14 @@ def test_retries_failing_properties_while_making_progress(self, mocker, config): class TestProcessModels: - def test_detect_recursive_allof_reference_no_retry(self, mocker, model_property_factory, config): + def test_detect_recursive_allof_reference_no_retry( + self, mocker, model_property_factory, config + ): class_name = ClassName("class_name", "") recursive_model = model_property_factory( - class_info=Class(name=class_name, module_name=PythonIdentifier("module_name", "")) + class_info=Class( + name=class_name, module_name=PythonIdentifier("module_name", "") + ) ) second_model = model_property_factory() schemas = Schemas( @@ -311,9 +399,15 @@ def test_detect_recursive_allof_reference_no_retry(self, mocker, model_property_ }, models_to_process=[recursive_model, second_model], ) - recursion_error = PropertyError(data=Reference.model_construct(ref=f"#/{class_name}")) - process_model = mocker.patch(f"{MODULE_NAME}.process_model", side_effect=[recursion_error, schemas]) - process_model_errors = mocker.patch(f"{MODULE_NAME}._process_model_errors", return_value=["error"]) + recursion_error = PropertyError( + data=Reference.model_construct(ref=f"#/{class_name}") + ) + process_model = mocker.patch( + f"{MODULE_NAME}.process_model", side_effect=[recursion_error, schemas] + ) + process_model_errors = mocker.patch( + f"{MODULE_NAME}._process_model_errors", return_value=["error"] + ) result = _process_models(schemas=schemas, config=config) @@ -323,11 +417,17 @@ def test_detect_recursive_allof_reference_no_retry(self, mocker, model_property_ call(schemas.classes_by_name["second"], schemas=schemas, config=config), ] ) - assert process_model_errors.was_called_once_with([(recursive_model, recursion_error)]) - assert all(error in result.errors for error in process_model_errors.return_value) + assert process_model_errors.was_called_once_with( + [(recursive_model, recursion_error)] + ) + assert all( + error in result.errors for error in process_model_errors.return_value + ) assert "\n\nRecursive allOf reference found" in recursion_error.detail - def test_resolve_reference_to_single_allof_reference(self, config, model_property_factory): + def test_resolve_reference_to_single_allof_reference( + self, config, model_property_factory + ): # test for https://github.com/openapi-generators/openapi-python-client/issues/1091 components = { @@ -376,7 +476,9 @@ def test_resolve_reference_to_single_allof_reference(self, config, model_propert ) # Verify that Model3 extended the properties from Model1 - assert [p.name for p in result.classes_by_name["Model3"].optional_properties] == ["prop1", "prop2"] + assert [ + p.name for p in result.classes_by_name["Model3"].optional_properties + ] == ["prop1", "prop2"] class TestPropogateRemoval: @@ -418,7 +520,10 @@ def test_propogate_removal_ref_path_no_refs(self): root = ReferencePath("/root/reference") class_name = ClassName("ClassName", "") ref_path = ReferencePath("/ref/path") - schemas = Schemas(classes_by_name={class_name: None}, classes_by_reference={root: None, ref_path: None}) + schemas = Schemas( + classes_by_name={class_name: None}, + classes_by_reference={root: None, ref_path: None}, + ) error = PropertyError() _propogate_removal(root=root, schemas=schemas, error=error) @@ -448,19 +553,32 @@ def test_propogate_removal_ref_path_already_removed(self): def test_process_model_errors(mocker, model_property_factory): propogate_removal = mocker.patch(f"{MODULE_NAME}._propogate_removal") model_errors = [ - (model_property_factory(roots={"root1", "root2"}), PropertyError(detail="existing detail")), + ( + model_property_factory(roots={"root1", "root2"}), + PropertyError(detail="existing detail"), + ), (model_property_factory(roots=set()), PropertyError()), - (model_property_factory(roots={"root1", "root3"}), PropertyError(detail="other existing detail")), + ( + model_property_factory(roots={"root1", "root3"}), + PropertyError(detail="other existing detail"), + ), ] schemas = Schemas() result = _process_model_errors(model_errors, schemas=schemas) propogate_removal.assert_has_calls( - [call(root=root, schemas=schemas, error=error) for model, error in model_errors for root in model.roots] + [ + call(root=root, schemas=schemas, error=error) + for model, error in model_errors + for root in model.roots + ] ) assert result == [error for _, error in model_errors] - assert all("\n\nFailure to process schema has resulted in the removal of:" in error.detail for error in result) + assert all( + "\n\nFailure to process schema has resulted in the removal of:" in error.detail + for error in result + ) class TestBuildParameters: @@ -477,30 +595,47 @@ def test_skips_references_and_keeps_going(self, mocker, config): ), } - update_parameters_with_data = mocker.patch(f"{MODULE_NAME}.update_parameters_with_data") + update_parameters_with_data = mocker.patch( + f"{MODULE_NAME}.update_parameters_with_data" + ) parse_reference_path = mocker.patch(f"{MODULE_NAME}.parse_reference_path") - result = build_parameters(components=parameters, parameters=Parameters(), config=config) + result = build_parameters( + components=parameters, parameters=Parameters(), config=config + ) # Should not even try to parse a path for the Reference parse_reference_path.assert_called_once_with("#/components/parameters/defined") update_parameters_with_data.assert_called_once_with( ref_path=parse_reference_path.return_value, data=parameters["defined"], parameters=Parameters( - errors=[ParameterError(detail="Reference parameters are not supported.", data=parameters["reference"])] + errors=[ + ParameterError( + detail="Reference parameters are not supported.", + data=parameters["reference"], + ) + ] ), config=config, ) assert result == update_parameters_with_data.return_value def test_records_bad_uris_and_keeps_going(self, mocker, config): - parameters = {"first": Parameter.model_construct(), "second": Parameter.model_construct()} - update_parameters_with_data = mocker.patch(f"{MODULE_NAME}.update_parameters_with_data") + parameters = { + "first": Parameter.model_construct(), + "second": Parameter.model_construct(), + } + update_parameters_with_data = mocker.patch( + f"{MODULE_NAME}.update_parameters_with_data" + ) parse_reference_path = mocker.patch( - f"{MODULE_NAME}.parse_reference_path", side_effect=[ParameterError(detail="some details"), "a_path"] + f"{MODULE_NAME}.parse_reference_path", + side_effect=[ParameterError(detail="some details"), "a_path"], ) - result = build_parameters(components=parameters, parameters=Parameters(), config=config) + result = build_parameters( + components=parameters, parameters=Parameters(), config=config + ) parse_reference_path.assert_has_calls( [ call("#/components/parameters/first"), @@ -510,19 +645,27 @@ def test_records_bad_uris_and_keeps_going(self, mocker, config): update_parameters_with_data.assert_called_once_with( ref_path="a_path", data=parameters["second"], - parameters=Parameters(errors=[ParameterError(detail="some details", data=parameters["first"])]), + parameters=Parameters( + errors=[ParameterError(detail="some details", data=parameters["first"])] + ), config=config, ) assert result == update_parameters_with_data.return_value def test_retries_failing_parameters_while_making_progress(self, mocker, config): - parameters = {"first": Parameter.model_construct(), "second": Parameter.model_construct()} + parameters = { + "first": Parameter.model_construct(), + "second": Parameter.model_construct(), + } update_parameters_with_data = mocker.patch( - f"{MODULE_NAME}.update_parameters_with_data", side_effect=[ParameterError(), Parameters(), ParameterError()] + f"{MODULE_NAME}.update_parameters_with_data", + side_effect=[ParameterError(), Parameters(), ParameterError()], ) parse_reference_path = mocker.patch(f"{MODULE_NAME}.parse_reference_path") - result = build_parameters(components=parameters, parameters=Parameters(), config=config) + result = build_parameters( + components=parameters, parameters=Parameters(), config=config + ) parse_reference_path.assert_has_calls( [ call("#/components/parameters/first"), @@ -538,11 +681,18 @@ def test_build_schemas(mocker, config): create_schemas = mocker.patch(f"{MODULE_NAME}._create_schemas") process_models = mocker.patch(f"{MODULE_NAME}._process_models") - components = {"a_ref": Reference.model_construct(), "a_schema": Schema.model_construct()} + components = { + "a_ref": Reference.model_construct(), + "a_schema": Schema.model_construct(), + } schemas = Schemas() result = build_schemas(components=components, schemas=schemas, config=config) - create_schemas.assert_called_once_with(components=components, schemas=schemas, config=config) - process_models.assert_called_once_with(schemas=create_schemas.return_value, config=config) + create_schemas.assert_called_once_with( + components=components, schemas=schemas, config=config + ) + process_models.assert_called_once_with( + schemas=create_schemas.return_value, config=config + ) assert result == process_models.return_value diff --git a/tests/test_parser/test_properties/test_merge_properties.py b/tests/test_parser/test_properties/test_merge_properties.py index 819f9ec26..9b85c9d00 100644 --- a/tests/test_parser/test_properties/test_merge_properties.py +++ b/tests/test_parser/test_properties/test_merge_properties.py @@ -65,7 +65,9 @@ def test_incompatible_types( if {prop1.__class__, prop2.__class__} == {IntProperty, FloatProperty}: continue # the int+float case is covered in another test error = merge_properties(prop1, prop2) - assert isinstance(error, PropertyError), f"Expected {type(prop1)} and {type(prop2)} to be incompatible" + assert isinstance( + error, PropertyError + ), f"Expected {type(prop1)} and {type(prop2)} to be incompatible" def test_merge_int_with_float(int_property_factory, float_property_factory): @@ -75,7 +77,9 @@ def test_merge_int_with_float(int_property_factory, float_property_factory): assert merge_properties(int_prop, float_prop) == ( evolve(int_prop, default=Value("2", 2), description=float_prop.description) ) - assert merge_properties(float_prop, int_prop) == evolve(int_prop, default=Value("2", 2)) + assert merge_properties(float_prop, int_prop) == evolve( + int_prop, default=Value("2", 2) + ) float_prop_with_non_int_default = evolve(float_prop, default=Value("2.5", 2.5)) error = merge_properties(int_prop, float_prop_with_non_int_default) @@ -93,10 +97,14 @@ def test_merge_with_any( ): original_desc = "description" props = [ - boolean_property_factory(default=Value("True", "True"), description=original_desc), + boolean_property_factory( + default=Value("True", "True"), description=original_desc + ), int_property_factory(default=Value("1", "1"), description=original_desc), float_property_factory(default=Value("1.5", "1.5"), description=original_desc), - string_property_factory(default=StringProperty.convert_value("x"), description=original_desc), + string_property_factory( + default=StringProperty.convert_value("x"), description=original_desc + ), model_property_factory(description=original_desc), ] any_prop = any_property_factory() @@ -106,7 +114,9 @@ def test_merge_with_any( @pytest.mark.parametrize("literal_enums", (False, True)) -def test_merge_enums(literal_enums, enum_property_factory, literal_enum_property_factory, config): +def test_merge_enums( + literal_enums, enum_property_factory, literal_enum_property_factory, config +): if literal_enums: enum_with_fewer_values = literal_enum_property_factory( description="desc1", @@ -132,8 +142,12 @@ def test_merge_enums(literal_enums, enum_property_factory, literal_enum_property # Setting class_info separately because it doesn't get initialized by the constructor - we want # to make sure the right enum class name gets used in the merged property - enum_with_fewer_values.class_info = Class.from_string(string="FewerValuesEnum", config=config) - enum_with_more_values.class_info = Class.from_string(string="MoreValuesEnum", config=config) + enum_with_fewer_values.class_info = Class.from_string( + string="FewerValuesEnum", config=config + ) + enum_with_more_values.class_info = Class.from_string( + string="MoreValuesEnum", config=config + ) assert merge_properties(enum_with_fewer_values, enum_with_more_values) == evolve( enum_with_more_values, @@ -149,9 +163,14 @@ def test_merge_enums(literal_enums, enum_property_factory, literal_enum_property @pytest.mark.parametrize("literal_enums", (False, True)) def test_merge_string_with_string_enum( - literal_enums, string_property_factory, enum_property_factory, literal_enum_property_factory + literal_enums, + string_property_factory, + enum_property_factory, + literal_enum_property_factory, ): - string_prop = string_property_factory(default=Value("A", "A"), description="desc1", example="example1") + string_prop = string_property_factory( + default=Value("A", "A"), description="desc1", example="example1" + ) enum_prop = ( literal_enum_property_factory( default=Value("'B'", "B"), @@ -182,9 +201,14 @@ def test_merge_string_with_string_enum( @pytest.mark.parametrize("literal_enums", (False, True)) def test_merge_int_with_int_enum( - literal_enums, int_property_factory, enum_property_factory, literal_enum_property_factory + literal_enums, + int_property_factory, + enum_property_factory, + literal_enum_property_factory, ): - int_prop = int_property_factory(default=Value("1", 1), description="desc1", example="example1") + int_prop = int_property_factory( + default=Value("1", 1), description="desc1", example="example1" + ) enum_prop = ( literal_enum_property_factory( default=Value("1", 1), @@ -205,7 +229,10 @@ def test_merge_int_with_int_enum( assert merge_properties(int_prop, enum_prop) == evolve(enum_prop, required=True) assert merge_properties(enum_prop, int_prop) == evolve( - enum_prop, required=True, description=int_prop.description, example=int_prop.example + enum_prop, + required=True, + description=int_prop.description, + example=int_prop.example, ) @@ -272,11 +299,19 @@ def test_merge_string_with_formatted_string( assert isinstance(merged2, formatted_prop.__class__) assert merged2.description == string_prop.description - assert isinstance(merge_properties(string_prop_with_invalid_default, formatted_prop), PropertyError) - assert isinstance(merge_properties(formatted_prop, string_prop_with_invalid_default), PropertyError) + assert isinstance( + merge_properties(string_prop_with_invalid_default, formatted_prop), + PropertyError, + ) + assert isinstance( + merge_properties(formatted_prop, string_prop_with_invalid_default), + PropertyError, + ) -def test_merge_lists(int_property_factory, list_property_factory, string_property_factory): +def test_merge_lists( + int_property_factory, list_property_factory, string_property_factory +): string_prop_1 = string_property_factory(description="desc1") string_prop_2 = string_property_factory(example="desc2") int_prop = int_property_factory() diff --git a/tests/test_parser/test_properties/test_model_property.py b/tests/test_parser/test_properties/test_model_property.py index 85ab3389a..0725aa43d 100644 --- a/tests/test_parser/test_properties/test_model_property.py +++ b/tests/test_parser/test_properties/test_model_property.py @@ -5,7 +5,12 @@ import openapi_python_client.schema as oai from openapi_python_client.parser.errors import PropertyError -from openapi_python_client.parser.properties import Class, ModelProperty, Schemas, StringProperty +from openapi_python_client.parser.properties import ( + Class, + ModelProperty, + Schemas, + StringProperty, +) from openapi_python_client.parser.properties.model_property import ( ANY_ADDITIONAL_PROPERTY, _process_properties, @@ -32,12 +37,17 @@ class TestModelProperty: (False, True, True, True, "dict[str, Any]"), ], ) - def test_get_type_string(self, no_optional, required, json, expected, model_property_factory, quoted): + def test_get_type_string( + self, no_optional, required, json, expected, model_property_factory, quoted + ): prop = model_property_factory( required=required, ) - assert prop.get_type_string(no_optional=no_optional, json=json, quoted=quoted) == expected + assert ( + prop.get_type_string(no_optional=no_optional, json=json, quoted=quoted) + == expected + ) def test_get_imports(self, model_property_factory): prop = model_property_factory(required=False) @@ -91,7 +101,9 @@ class TestBuild: ), ], ) - def test_additional_schemas(self, additional_properties_schema, expected_additional_properties, config): + def test_additional_schemas( + self, additional_properties_schema, expected_additional_properties, config + ): data = oai.Schema.model_construct( additionalProperties=additional_properties_schema, ) @@ -109,7 +121,13 @@ def test_additional_schemas(self, additional_properties_schema, expected_additio assert model.additional_properties == expected_additional_properties - def test_happy_path(self, model_property_factory, string_property_factory, date_time_property_factory, config): + def test_happy_path( + self, + model_property_factory, + string_property_factory, + date_time_property_factory, + config, + ): name = "prop" required = True @@ -122,7 +140,10 @@ def test_happy_path(self, model_property_factory, string_property_factory, date_ }, description="A class called MyModel", ) - schemas = Schemas(classes_by_reference={"OtherModel": None}, classes_by_name={"OtherModel": None}) + schemas = Schemas( + classes_by_reference={"OtherModel": None}, + classes_by_name={"OtherModel": None}, + ) class_info = Class(name="ParentMyModel", module_name="parent_my_model") roots = {"root"} @@ -153,7 +174,9 @@ def test_happy_path(self, model_property_factory, string_property_factory, date_ data=data, class_info=class_info, required_properties=[string_property_factory(name="req", required=True)], - optional_properties=[date_time_property_factory(name="opt", required=False)], + optional_properties=[ + date_time_property_factory(name="opt", required=False) + ], description=data.description, relative_imports={ "from dateutil.parser import isoparse", @@ -182,7 +205,10 @@ def test_model_name_conflict(self, config): ) assert new_schemas == schemas - assert err == PropertyError(detail='Attempted to generate duplicate models with name "OtherModel"', data=data) + assert err == PropertyError( + detail='Attempted to generate duplicate models with name "OtherModel"', + data=data, + ) @pytest.mark.parametrize( "name, title, parent_name, use_title_prefixing, expected", @@ -216,7 +242,9 @@ def test_model_naming( title=title, properties={}, ) - config = evolve(config, use_path_prefixes_for_title_model_names=use_title_prefixing) + config = evolve( + config, use_path_prefixes_for_title_model_names=use_title_prefixing + ) result = ModelProperty.build( data=data, name=name, @@ -232,7 +260,9 @@ def test_model_naming( def test_model_bad_properties(self, config): data = oai.Schema( properties={ - "bad": oai.Reference.model_construct(ref="#/components/schema/NotExist"), + "bad": oai.Reference.model_construct( + ref="#/components/schema/NotExist" + ), }, ) result = ModelProperty.build( @@ -280,7 +310,10 @@ def test_process_properties_false(self, model_property_factory, config): }, description="A class called MyModel", ) - schemas = Schemas(classes_by_reference={"OtherModel": None}, classes_by_name={"OtherModel": None}) + schemas = Schemas( + classes_by_reference={"OtherModel": None}, + classes_by_name={"OtherModel": None}, + ) roots = {"root"} class_info = Class(name="ParentMyModel", module_name="parent_my_model") @@ -315,87 +348,134 @@ def test_process_properties_false(self, model_property_factory, config): class TestProcessProperties: def test_conflicting_properties_different_types( - self, model_property_factory, string_property_factory, int_property_factory, config + self, + model_property_factory, + string_property_factory, + int_property_factory, + config, ): data = oai.Schema.model_construct( - allOf=[oai.Reference.model_construct(ref="#/First"), oai.Reference.model_construct(ref="#/Second")] + allOf=[ + oai.Reference.model_construct(ref="#/First"), + oai.Reference.model_construct(ref="#/Second"), + ] ) schemas = Schemas( classes_by_reference={ "/First": model_property_factory( - required_properties=[], optional_properties=[string_property_factory()] + required_properties=[], + optional_properties=[string_property_factory()], + ), + "/Second": model_property_factory( + required_properties=[], optional_properties=[int_property_factory()] ), - "/Second": model_property_factory(required_properties=[], optional_properties=[int_property_factory()]), } ) - result = _process_properties(data=data, schemas=schemas, class_name="", config=config, roots={"root"}) + result = _process_properties( + data=data, schemas=schemas, class_name="", config=config, roots={"root"} + ) assert isinstance(result, PropertyError) def test_process_properties_reference_not_exist(self, config): data = oai.Schema( properties={ - "bad": oai.Reference.model_construct(ref="#/components/schema/NotExist"), + "bad": oai.Reference.model_construct( + ref="#/components/schema/NotExist" + ), }, ) - result = _process_properties(data=data, class_name="", schemas=Schemas(), config=config, roots={"root"}) + result = _process_properties( + data=data, class_name="", schemas=Schemas(), config=config, roots={"root"} + ) assert isinstance(result, PropertyError) def test_process_properties_all_of_reference_not_exist(self, config): - data = oai.Schema.model_construct(allOf=[oai.Reference.model_construct(ref="#/components/schema/NotExist")]) + data = oai.Schema.model_construct( + allOf=[oai.Reference.model_construct(ref="#/components/schema/NotExist")] + ) - result = _process_properties(data=data, class_name="", schemas=Schemas(), config=config, roots={"root"}) + result = _process_properties( + data=data, class_name="", schemas=Schemas(), config=config, roots={"root"} + ) assert isinstance(result, PropertyError) - def test_process_properties_model_property_roots(self, model_property_factory, config): + def test_process_properties_model_property_roots( + self, model_property_factory, config + ): roots = {"root"} - data = oai.Schema(properties={"test_model_property": oai.Schema.model_construct(type="object")}) + data = oai.Schema( + properties={ + "test_model_property": oai.Schema.model_construct(type="object") + } + ) - result = _process_properties(data=data, class_name="", schemas=Schemas(), config=config, roots=roots) + result = _process_properties( + data=data, class_name="", schemas=Schemas(), config=config, roots=roots + ) assert all(root in result.optional_props[0].roots for root in roots) def test_invalid_reference(self, config): - data = oai.Schema.model_construct(allOf=[oai.Reference.model_construct(ref="ThisIsNotGood")]) + data = oai.Schema.model_construct( + allOf=[oai.Reference.model_construct(ref="ThisIsNotGood")] + ) schemas = Schemas() - result = _process_properties(data=data, schemas=schemas, class_name="", config=config, roots={"root"}) + result = _process_properties( + data=data, schemas=schemas, class_name="", config=config, roots={"root"} + ) assert isinstance(result, PropertyError) def test_non_model_reference(self, enum_property_factory, config): - data = oai.Schema.model_construct(allOf=[oai.Reference.model_construct(ref="#/First")]) + data = oai.Schema.model_construct( + allOf=[oai.Reference.model_construct(ref="#/First")] + ) schemas = Schemas( classes_by_reference={ "/First": enum_property_factory(), } ) - result = _process_properties(data=data, schemas=schemas, class_name="", config=config, roots={"root"}) + result = _process_properties( + data=data, schemas=schemas, class_name="", config=config, roots={"root"} + ) assert isinstance(result, PropertyError) def test_reference_not_processed(self, model_property_factory, config): - data = oai.Schema.model_construct(allOf=[oai.Reference.model_construct(ref="#/Unprocessed")]) + data = oai.Schema.model_construct( + allOf=[oai.Reference.model_construct(ref="#/Unprocessed")] + ) schemas = Schemas( classes_by_reference={ "/Unprocessed": model_property_factory(), } ) - result = _process_properties(data=data, schemas=schemas, class_name="", config=config, roots={"root"}) + result = _process_properties( + data=data, schemas=schemas, class_name="", config=config, roots={"root"} + ) assert isinstance(result, PropertyError) def test_allof_string_and_string_enum( - self, model_property_factory, enum_property_factory, string_property_factory, config + self, + model_property_factory, + enum_property_factory, + string_property_factory, + config, ): data = oai.Schema.model_construct( - allOf=[oai.Reference.model_construct(ref="#/First"), oai.Reference.model_construct(ref="#/Second")] + allOf=[ + oai.Reference.model_construct(ref="#/First"), + oai.Reference.model_construct(ref="#/Second"), + ] ) enum_property = enum_property_factory( values={"foo": "foo"}, @@ -406,18 +486,29 @@ def test_allof_string_and_string_enum( required_properties=[], optional_properties=[string_property_factory(required=False)], ), - "/Second": model_property_factory(required_properties=[], optional_properties=[enum_property]), + "/Second": model_property_factory( + required_properties=[], optional_properties=[enum_property] + ), } ) - result = _process_properties(data=data, schemas=schemas, class_name="", config=config, roots={"root"}) + result = _process_properties( + data=data, schemas=schemas, class_name="", config=config, roots={"root"} + ) assert result.required_props[0] == enum_property def test_allof_string_enum_and_string( - self, model_property_factory, enum_property_factory, string_property_factory, config + self, + model_property_factory, + enum_property_factory, + string_property_factory, + config, ): data = oai.Schema.model_construct( - allOf=[oai.Reference.model_construct(ref="#/First"), oai.Reference.model_construct(ref="#/Second")] + allOf=[ + oai.Reference.model_construct(ref="#/First"), + oai.Reference.model_construct(ref="#/Second"), + ] ) enum_property = enum_property_factory( required=False, @@ -425,7 +516,9 @@ def test_allof_string_enum_and_string( ) schemas = Schemas( classes_by_reference={ - "/First": model_property_factory(required_properties=[], optional_properties=[enum_property]), + "/First": model_property_factory( + required_properties=[], optional_properties=[enum_property] + ), "/Second": model_property_factory( required_properties=[], optional_properties=[string_property_factory(required=False)], @@ -433,12 +526,23 @@ def test_allof_string_enum_and_string( } ) - result = _process_properties(data=data, schemas=schemas, class_name="", config=config, roots={"root"}) + result = _process_properties( + data=data, schemas=schemas, class_name="", config=config, roots={"root"} + ) assert result.optional_props[0] == enum_property - def test_allof_int_and_int_enum(self, model_property_factory, enum_property_factory, int_property_factory, config): + def test_allof_int_and_int_enum( + self, + model_property_factory, + enum_property_factory, + int_property_factory, + config, + ): data = oai.Schema.model_construct( - allOf=[oai.Reference.model_construct(ref="#/First"), oai.Reference.model_construct(ref="#/Second")] + allOf=[ + oai.Reference.model_construct(ref="#/First"), + oai.Reference.model_construct(ref="#/Second"), + ] ) enum_property = enum_property_factory( values={"foo": 1}, @@ -446,19 +550,32 @@ def test_allof_int_and_int_enum(self, model_property_factory, enum_property_fact ) schemas = Schemas( classes_by_reference={ - "/First": model_property_factory(required_properties=[], optional_properties=[int_property_factory()]), - "/Second": model_property_factory(required_properties=[], optional_properties=[enum_property]), + "/First": model_property_factory( + required_properties=[], optional_properties=[int_property_factory()] + ), + "/Second": model_property_factory( + required_properties=[], optional_properties=[enum_property] + ), } ) - result = _process_properties(data=data, schemas=schemas, class_name="", config=config, roots={"root"}) + result = _process_properties( + data=data, schemas=schemas, class_name="", config=config, roots={"root"} + ) assert result.required_props[0] == enum_property def test_allof_enum_incompatible_type( - self, model_property_factory, enum_property_factory, int_property_factory, config + self, + model_property_factory, + enum_property_factory, + int_property_factory, + config, ): data = oai.Schema.model_construct( - allOf=[oai.Reference.model_construct(ref="#/First"), oai.Reference.model_construct(ref="#/Second")] + allOf=[ + oai.Reference.model_construct(ref="#/First"), + oai.Reference.model_construct(ref="#/Second"), + ] ) enum_property = enum_property_factory( values={"foo": 1}, @@ -466,17 +583,28 @@ def test_allof_enum_incompatible_type( ) schemas = Schemas( classes_by_reference={ - "/First": model_property_factory(required_properties=[], optional_properties=[int_property_factory()]), - "/Second": model_property_factory(required_properties=[], optional_properties=[enum_property]), + "/First": model_property_factory( + required_properties=[], optional_properties=[int_property_factory()] + ), + "/Second": model_property_factory( + required_properties=[], optional_properties=[enum_property] + ), } ) - result = _process_properties(data=data, schemas=schemas, class_name="", config=config, roots={"root"}) + result = _process_properties( + data=data, schemas=schemas, class_name="", config=config, roots={"root"} + ) assert isinstance(result, PropertyError) - def test_allof_string_enums(self, model_property_factory, enum_property_factory, config): + def test_allof_string_enums( + self, model_property_factory, enum_property_factory, config + ): data = oai.Schema.model_construct( - allOf=[oai.Reference.model_construct(ref="#/First"), oai.Reference.model_construct(ref="#/Second")] + allOf=[ + oai.Reference.model_construct(ref="#/First"), + oai.Reference.model_construct(ref="#/Second"), + ] ) enum_property1 = enum_property_factory( name="an_enum", @@ -490,17 +618,28 @@ def test_allof_string_enums(self, model_property_factory, enum_property_factory, ) schemas = Schemas( classes_by_reference={ - "/First": model_property_factory(required_properties=[], optional_properties=[enum_property1]), - "/Second": model_property_factory(required_properties=[], optional_properties=[enum_property2]), + "/First": model_property_factory( + required_properties=[], optional_properties=[enum_property1] + ), + "/Second": model_property_factory( + required_properties=[], optional_properties=[enum_property2] + ), } ) - result = _process_properties(data=data, schemas=schemas, class_name="", config=config, roots={"root"}) + result = _process_properties( + data=data, schemas=schemas, class_name="", config=config, roots={"root"} + ) assert result.required_props[0] == enum_property1 - def test_allof_int_enums(self, model_property_factory, enum_property_factory, config): + def test_allof_int_enums( + self, model_property_factory, enum_property_factory, config + ): data = oai.Schema.model_construct( - allOf=[oai.Reference.model_construct(ref="#/First"), oai.Reference.model_construct(ref="#/Second")] + allOf=[ + oai.Reference.model_construct(ref="#/First"), + oai.Reference.model_construct(ref="#/Second"), + ] ) enum_property1 = enum_property_factory( name="an_enum", @@ -514,17 +653,28 @@ def test_allof_int_enums(self, model_property_factory, enum_property_factory, co ) schemas = Schemas( classes_by_reference={ - "/First": model_property_factory(required_properties=[], optional_properties=[enum_property1]), - "/Second": model_property_factory(required_properties=[], optional_properties=[enum_property2]), + "/First": model_property_factory( + required_properties=[], optional_properties=[enum_property1] + ), + "/Second": model_property_factory( + required_properties=[], optional_properties=[enum_property2] + ), } ) - result = _process_properties(data=data, schemas=schemas, class_name="", config=config, roots={"root"}) + result = _process_properties( + data=data, schemas=schemas, class_name="", config=config, roots={"root"} + ) assert result.required_props[0] == enum_property2 - def test_allof_enums_are_not_subsets(self, model_property_factory, enum_property_factory, config): + def test_allof_enums_are_not_subsets( + self, model_property_factory, enum_property_factory, config + ): data = oai.Schema.model_construct( - allOf=[oai.Reference.model_construct(ref="#/First"), oai.Reference.model_construct(ref="#/Second")] + allOf=[ + oai.Reference.model_construct(ref="#/First"), + oai.Reference.model_construct(ref="#/Second"), + ] ) enum_property1 = enum_property_factory( name="an_enum", @@ -538,29 +688,48 @@ def test_allof_enums_are_not_subsets(self, model_property_factory, enum_property ) schemas = Schemas( classes_by_reference={ - "/First": model_property_factory(required_properties=[], optional_properties=[enum_property1]), - "/Second": model_property_factory(required_properties=[], optional_properties=[enum_property2]), + "/First": model_property_factory( + required_properties=[], optional_properties=[enum_property1] + ), + "/Second": model_property_factory( + required_properties=[], optional_properties=[enum_property2] + ), } ) - result = _process_properties(data=data, schemas=schemas, class_name="", config=config, roots={"root"}) + result = _process_properties( + data=data, schemas=schemas, class_name="", config=config, roots={"root"} + ) assert isinstance(result, PropertyError) - def test_duplicate_properties(self, model_property_factory, string_property_factory, config): + def test_duplicate_properties( + self, model_property_factory, string_property_factory, config + ): data = oai.Schema.model_construct( - allOf=[oai.Reference.model_construct(ref="#/First"), oai.Reference.model_construct(ref="#/Second")] + allOf=[ + oai.Reference.model_construct(ref="#/First"), + oai.Reference.model_construct(ref="#/Second"), + ] ) prop = string_property_factory(required=False) schemas = Schemas( classes_by_reference={ - "/First": model_property_factory(required_properties=[], optional_properties=[prop]), - "/Second": model_property_factory(required_properties=[], optional_properties=[prop]), + "/First": model_property_factory( + required_properties=[], optional_properties=[prop] + ), + "/Second": model_property_factory( + required_properties=[], optional_properties=[prop] + ), } ) - result = _process_properties(data=data, schemas=schemas, class_name="", config=config, roots={"root"}) + result = _process_properties( + data=data, schemas=schemas, class_name="", config=config, roots={"root"} + ) - assert result.optional_props == [prop], "There should only be one copy of duplicate properties" + assert result.optional_props == [ + prop + ], "There should only be one copy of duplicate properties" @pytest.mark.parametrize("first_required", [True, False]) @pytest.mark.parametrize("second_required", [True, False]) @@ -573,23 +742,32 @@ def test_mixed_requirements( config, ): data = oai.Schema.model_construct( - allOf=[oai.Reference.model_construct(ref="#/First"), oai.Reference.model_construct(ref="#/Second")] + allOf=[ + oai.Reference.model_construct(ref="#/First"), + oai.Reference.model_construct(ref="#/Second"), + ] ) schemas = Schemas( classes_by_reference={ "/First": model_property_factory( required_properties=[], - optional_properties=[string_property_factory(required=first_required)], + optional_properties=[ + string_property_factory(required=first_required) + ], ), "/Second": model_property_factory( required_properties=[], - optional_properties=[string_property_factory(required=second_required)], + optional_properties=[ + string_property_factory(required=second_required) + ], ), } ) roots = {"root"} - result = _process_properties(data=data, schemas=schemas, class_name="", config=config, roots=roots) + result = _process_properties( + data=data, schemas=schemas, class_name="", config=config, roots=roots + ) required = first_required or second_required expected_prop = string_property_factory( @@ -616,10 +794,16 @@ def test_direct_properties_non_ref(self, string_property_factory, config): ) schemas = Schemas() - result = _process_properties(data=data, schemas=schemas, class_name="", config=config, roots={"root"}) + result = _process_properties( + data=data, schemas=schemas, class_name="", config=config, roots={"root"} + ) - assert result.optional_props == [string_property_factory(name="second", required=False)] - assert result.required_props == [string_property_factory(name="first", required=True)] + assert result.optional_props == [ + string_property_factory(name="second", required=False) + ] + assert result.required_props == [ + string_property_factory(name="first", required=True) + ] def test_conflicting_property_names(self, config): data = oai.Schema.model_construct( @@ -629,10 +813,14 @@ def test_conflicting_property_names(self, config): } ) schemas = Schemas() - result = _process_properties(data=data, schemas=schemas, class_name="", config=config, roots={"root"}) + result = _process_properties( + data=data, schemas=schemas, class_name="", config=config, roots={"root"} + ) assert isinstance(result, PropertyError) - def test_merge_inline_objects(self, model_property_factory, enum_property_factory, config): + def test_merge_inline_objects( + self, model_property_factory, enum_property_factory, config + ): data = oai.Schema.model_construct( allOf=[ oai.Schema.model_construct( @@ -644,14 +832,18 @@ def test_merge_inline_objects(self, model_property_factory, enum_property_factor oai.Schema.model_construct( type="object", properties={ - "prop1": oai.Schema.model_construct(type="string", description="desc"), + "prop1": oai.Schema.model_construct( + type="string", description="desc" + ), }, ), ] ) schemas = Schemas() - result = _process_properties(data=data, schemas=schemas, class_name="", config=config, roots={"root"}) + result = _process_properties( + data=data, schemas=schemas, class_name="", config=config, roots={"root"} + ) assert not isinstance(result, PropertyError) assert len(result.optional_props) == 1 prop1 = result.optional_props[0] @@ -687,7 +879,10 @@ def test_process_model(self, mocker, model_property_factory, config): ) additional_properties = True process_property_data = mocker.patch(f"{MODULE_NAME}._process_property_data") - process_property_data.return_value = ((property_data, additional_properties), schemas) + process_property_data.return_value = ( + (property_data, additional_properties), + schemas, + ) result = process_model(model_prop=model_prop, schemas=schemas, config=config) @@ -701,8 +896,12 @@ def test_process_model(self, mocker, model_property_factory, config): def test_set_relative_imports(model_property_factory): class_info = Class("ClassName", module_name="module_name") - relative_imports = {f"from ..models.{class_info.module_name} import {class_info.name}"} + relative_imports = { + f"from ..models.{class_info.module_name} import {class_info.name}" + } - model_property = model_property_factory(class_info=class_info, relative_imports=relative_imports) + model_property = model_property_factory( + class_info=class_info, relative_imports=relative_imports + ) assert model_property.relative_imports == set() diff --git a/tests/test_parser/test_properties/test_protocol.py b/tests/test_parser/test_properties/test_protocol.py index 800aa69e4..5d047bac0 100644 --- a/tests/test_parser/test_properties/test_protocol.py +++ b/tests/test_parser/test_properties/test_protocol.py @@ -23,11 +23,15 @@ def test_is_base_type(any_property_factory): (True, True, True, False, "str"), ], ) -def test_get_type_string(any_property_factory, mocker, required, no_optional, json, expected, quoted): +def test_get_type_string( + any_property_factory, mocker, required, no_optional, json, expected, quoted +): mocker.patch.object(AnyProperty, "_type_string", "TestType") mocker.patch.object(AnyProperty, "_json_type_string", "str") p = any_property_factory(required=required) - assert p.get_type_string(no_optional=no_optional, json=json, quoted=quoted) == expected + assert ( + p.get_type_string(no_optional=no_optional, json=json, quoted=quoted) == expected + ) @pytest.mark.parametrize( @@ -39,10 +43,14 @@ def test_get_type_string(any_property_factory, mocker, required, no_optional, js ("Test", True, "test: Any = Test"), ], ) -def test_to_string(default: str | None, required: bool, expected: str, any_property_factory): +def test_to_string( + default: str | None, required: bool, expected: str, any_property_factory +): name = "test" p = any_property_factory( - name=name, required=required, default=Value(default, default) if default is not None else None + name=name, + required=required, + default=Value(default, default) if default is not None else None, ) assert p.to_string() == expected @@ -53,7 +61,10 @@ def test_get_imports(any_property_factory): assert p.get_imports(prefix="") == set() p = any_property_factory(name="test", required=False, default=None) - assert p.get_imports(prefix="") == {"from types import UNSET, Unset", "from typing import Union"} + assert p.get_imports(prefix="") == { + "from types import UNSET, Unset", + "from typing import Union", + } @pytest.mark.parametrize( diff --git a/tests/test_parser/test_properties/test_schemas.py b/tests/test_parser/test_properties/test_schemas.py index 7e7af8514..f0b2e4e24 100644 --- a/tests/test_parser/test_properties/test_schemas.py +++ b/tests/test_parser/test_properties/test_schemas.py @@ -16,7 +16,9 @@ def test_class_from_string_default_config(config): - class_ = Class.from_string(string="#/components/schemas/PingResponse", config=config) + class_ = Class.from_string( + string="#/components/schemas/PingResponse", config=config + ) assert class_.name == "PingResponse" assert class_.module_name == "ping_response" @@ -31,10 +33,17 @@ def test_class_from_string_default_config(config): (None, "some_module", "MyResponse", "some_module"), ), ) -def test_class_from_string(class_override, module_override, expected_class, expected_module, config): +def test_class_from_string( + class_override, module_override, expected_class, expected_module, config +): ref = "#/components/schemas/MyResponse" config = evolve( - config, class_overrides={"MyResponse": ClassOverride(class_name=class_override, module_name=module_override)} + config, + class_overrides={ + "MyResponse": ClassOverride( + class_name=class_override, module_name=module_override + ) + }, ) result = Class.from_string(string=ref, config=config) @@ -63,14 +72,21 @@ def test_parameters_without_schema_are_ignored(self, config): def test_registers_new_parameters(self, config): param = Parameter.model_construct( - name="a_param", param_in=ParameterLocation.QUERY, param_schema=Schema.model_construct() + name="a_param", + param_in=ParameterLocation.QUERY, + param_schema=Schema.model_construct(), ) parameters = Parameters() param_or_error, new_parameters = parameter_from_data( name=param.name, data=param, parameters=parameters, config=config ) assert param_or_error == param - assert new_parameters.classes_by_name[ClassName(param.name, prefix=config.field_prefix)] == param + assert ( + new_parameters.classes_by_name[ + ClassName(param.name, prefix=config.field_prefix) + ] + == param + ) class TestParameterFromReference: @@ -84,9 +100,12 @@ def test_errors_out_if_reference_not_in_parameters(self): ref = Reference.model_construct(ref="#/components/parameters/a_param") class_info = Class(name="a_param", module_name="module_name") existing_param = Parameter.model_construct(name="a_param") - param_by_ref = Reference.model_construct(ref="#/components/parameters/another_param") + param_by_ref = Reference.model_construct( + ref="#/components/parameters/another_param" + ) params = Parameters( - classes_by_name={class_info.name: existing_param}, classes_by_reference={ref.ref: existing_param} + classes_by_name={class_info.name: existing_param}, + classes_by_reference={ref.ref: existing_param}, ) param_or_error = parameter_from_reference(param=param_by_ref, parameters=params) assert param_or_error == ParameterError( @@ -110,10 +129,13 @@ class TestUpdateParametersFromData: def test_reports_parameters_with_errors(self, mocker, config): parameters = Parameters() param = Parameter.model_construct( - name="a_param", param_in=ParameterLocation.QUERY, param_schema=Schema.model_construct() + name="a_param", + param_in=ParameterLocation.QUERY, + param_schema=Schema.model_construct(), ) parameter_from_data = mocker.patch( - f"{MODULE_NAME}.parameter_from_data", side_effect=[(ParameterError(), parameters)] + f"{MODULE_NAME}.parameter_from_data", + side_effect=[(ParameterError(), parameters)], ) ref_path = Reference.model_construct(ref="#/components/parameters/a_param") new_parameters_or_error = update_parameters_with_data( @@ -129,9 +151,13 @@ def test_reports_parameters_with_errors(self, mocker, config): def test_records_references_to_parameters(self, mocker, config): parameters = Parameters() param = Parameter.model_construct( - name="a_param", param_in=ParameterLocation.QUERY, param_schema=Schema.model_construct() + name="a_param", + param_in=ParameterLocation.QUERY, + param_schema=Schema.model_construct(), + ) + parameter_from_data = mocker.patch( + f"{MODULE_NAME}.parameter_from_data", side_effect=[(param, parameters)] ) - parameter_from_data = mocker.patch(f"{MODULE_NAME}.parameter_from_data", side_effect=[(param, parameters)]) ref_path = "#/components/parameters/a_param" new_parameters = update_parameters_with_data( ref_path=ref_path, data=param, parameters=parameters, config=config diff --git a/tests/test_parser/test_properties/test_union.py b/tests/test_parser/test_properties/test_union.py index a36e14030..d9f3ea0bd 100644 --- a/tests/test_parser/test_properties/test_union.py +++ b/tests/test_parser/test_properties/test_union.py @@ -1,6 +1,10 @@ import openapi_python_client.schema as oai from openapi_python_client.parser.errors import ParseError -from openapi_python_client.parser.properties import Schemas, UnionProperty, property_from_data +from openapi_python_client.parser.properties import ( + Schemas, + UnionProperty, + property_from_data, +) from openapi_python_client.schema import DataType, ParameterLocation @@ -10,7 +14,12 @@ def test_invalid_location(config): ) prop, _ = UnionProperty.build( - data=data, required=True, schemas=Schemas(), parent_name="parent", name="name", config=config + data=data, + required=True, + schemas=Schemas(), + parent_name="parent", + name="name", + config=config, ) err = prop.validate_location(ParameterLocation.PATH) @@ -23,7 +32,12 @@ def test_not_required_in_path(config): ) prop, _ = UnionProperty.build( - data=data, required=False, schemas=Schemas(), parent_name="parent", name="name", config=config + data=data, + required=False, + schemas=Schemas(), + parent_name="parent", + name="name", + config=config, ) err = prop.validate_location(ParameterLocation.PATH) @@ -69,7 +83,12 @@ def test_union_oneOf_descriptive_type_name( ) p, s = property_from_data( - name=name, required=required, data=data, schemas=Schemas(), parent_name="parent", config=config + name=name, + required=required, + data=data, + schemas=Schemas(), + parent_name="parent", + config=config, ) assert p == expected diff --git a/tests/test_parser/test_responses.py b/tests/test_parser/test_responses.py index 8fb04d720..d7783dfe9 100644 --- a/tests/test_parser/test_responses.py +++ b/tests/test_parser/test_responses.py @@ -6,7 +6,12 @@ from openapi_python_client.parser import responses from openapi_python_client.parser.errors import ParseError, PropertyError from openapi_python_client.parser.properties import Schemas -from openapi_python_client.parser.responses import JSON_SOURCE, NONE_SOURCE, Response, response_from_data +from openapi_python_client.parser.responses import ( + JSON_SOURCE, + NONE_SOURCE, + Response, + response_from_data, +) MODULE_NAME = "openapi_python_client.parser.responses" @@ -49,13 +54,17 @@ def test_response_from_data_unsupported_content_type(): config=config, ) - assert response == ParseError(data=data, detail="Unsupported content_type {'blah': None}") + assert response == ParseError( + data=data, detail="Unsupported content_type {'blah': None}" + ) def test_response_from_data_no_content_schema(any_property_factory): data = oai.Response.model_construct( description="", - content={"application/vnd.api+json; version=2.2": oai.MediaType.model_construct()}, + content={ + "application/vnd.api+json; version=2.2": oai.MediaType.model_construct() + }, ) config = MagicMock() config.content_type_overrides = {} @@ -82,10 +91,16 @@ def test_response_from_data_no_content_schema(any_property_factory): def test_response_from_data_property_error(mocker): - property_from_data = mocker.patch.object(responses, "property_from_data", return_value=(PropertyError(), Schemas())) + property_from_data = mocker.patch.object( + responses, "property_from_data", return_value=(PropertyError(), Schemas()) + ) data = oai.Response.model_construct( description="", - content={"application/json": oai.MediaType.model_construct(media_type_schema="something")}, + content={ + "application/json": oai.MediaType.model_construct( + media_type_schema="something" + ) + }, ) config = MagicMock() config.content_type_overrides = {} @@ -112,10 +127,16 @@ def test_response_from_data_property_error(mocker): def test_response_from_data_property(mocker, any_property_factory): prop = any_property_factory() - property_from_data = mocker.patch.object(responses, "property_from_data", return_value=(prop, Schemas())) + property_from_data = mocker.patch.object( + responses, "property_from_data", return_value=(prop, Schemas()) + ) data = oai.Response.model_construct( description="", - content={"application/json": oai.MediaType.model_construct(media_type_schema="something")}, + content={ + "application/json": oai.MediaType.model_construct( + media_type_schema="something" + ) + }, ) config = MagicMock() config.content_type_overrides = {} @@ -150,7 +171,11 @@ def test_response_from_data_reference(mocker, any_property_factory): mocker.patch.object(responses, "property_from_data", return_value=(prop, Schemas())) predefined_response_data = oai.Response.model_construct( description="", - content={"application/json": oai.MediaType.model_construct(media_type_schema="something")}, + content={ + "application/json": oai.MediaType.model_construct( + media_type_schema="something" + ) + }, ) config = MagicMock() config.content_type_overrides = {} @@ -177,15 +202,24 @@ def test_response_from_data_reference(mocker, any_property_factory): [ ("#/components/responses/Nonexistent", "Could not find"), ("https://remote-reference", "Remote references"), - ("#/components/something-that-isnt-responses/ErrorResponse", "not allowed in responses"), + ( + "#/components/something-that-isnt-responses/ErrorResponse", + "not allowed in responses", + ), ], ) -def test_response_from_data_invalid_reference(ref_string, expected_error_string, mocker, any_property_factory): +def test_response_from_data_invalid_reference( + ref_string, expected_error_string, mocker, any_property_factory +): prop = any_property_factory() mocker.patch.object(responses, "property_from_data", return_value=(prop, Schemas())) predefined_response_data = oai.Response.model_construct( description="", - content={"application/json": oai.MediaType.model_construct(media_type_schema="something")}, + content={ + "application/json": oai.MediaType.model_construct( + media_type_schema="something" + ) + }, ) config = MagicMock() config.content_type_overrides = {} @@ -208,7 +242,11 @@ def test_response_from_data_ref_to_response_that_is_a_ref(mocker, any_property_f mocker.patch.object(responses, "property_from_data", return_value=(prop, Schemas())) predefined_response_base_data = oai.Response.model_construct( description="", - content={"application/json": oai.MediaType.model_construct(media_type_schema="something")}, + content={ + "application/json": oai.MediaType.model_construct( + media_type_schema="something" + ) + }, ) predefined_response_data = oai.Reference.model_construct( ref="#/components/references/BaseResponse", diff --git a/tests/test_schema/test_noisy_refs.py b/tests/test_schema/test_noisy_refs.py index 0d1ac1fc2..0bfeee508 100644 --- a/tests/test_schema/test_noisy_refs.py +++ b/tests/test_schema/test_noisy_refs.py @@ -31,7 +31,9 @@ ) try: - from openapi_python_client.schema.openapi_schema_pydantic.reference import ReferenceOr + from openapi_python_client.schema.openapi_schema_pydantic.reference import ( + ReferenceOr, + ) except ImportError: T = TypeVar("T") ReferenceOr = Union[Reference, T] @@ -59,7 +61,10 @@ def deannotate_type(t): @pytest.mark.parametrize( ("ref_or_type", "get_example_fn"), [ - (ReferenceOr[Callback], lambda t: {"test1": get_example(PathItem), "test2": get_example(PathItem)}), + ( + ReferenceOr[Callback], + lambda t: {"test1": get_example(PathItem), "test2": get_example(PathItem)}, + ), (ReferenceOr[Example], get_example), (ReferenceOr[Header], get_example), (ReferenceOr[Link], get_example), diff --git a/tests/test_schema/test_open_api.py b/tests/test_schema/test_open_api.py index bdab19eba..814905e3f 100644 --- a/tests/test_schema/test_open_api.py +++ b/tests/test_schema/test_open_api.py @@ -33,7 +33,15 @@ def test_parse_with_callback(): "/create": { "post": { "responses": {"200": {"description": "Success"}}, - "callbacks": {"event": {"callback": {"post": {"responses": {"200": {"description": "Success"}}}}}}, + "callbacks": { + "event": { + "callback": { + "post": { + "responses": {"200": {"description": "Success"}} + } + } + } + }, } } }, diff --git a/tests/test_schema/test_schema.py b/tests/test_schema/test_schema.py index 0aa892af1..4ffac002a 100644 --- a/tests/test_schema/test_schema.py +++ b/tests/test_schema/test_schema.py @@ -7,28 +7,41 @@ def test_nullable_with_simple_type(): def test_nullable_with_allof(): - schema = Schema.model_validate_json('{"allOf": [{"type": "string"}], "nullable": true}') - assert schema.oneOf == [Schema(type=DataType.NULL), Schema(allOf=[Schema(type=DataType.STRING)])] + schema = Schema.model_validate_json( + '{"allOf": [{"type": "string"}], "nullable": true}' + ) + assert schema.oneOf == [ + Schema(type=DataType.NULL), + Schema(allOf=[Schema(type=DataType.STRING)]), + ] assert schema.allOf == [] def test_constant_bool(): - schema = Schema.model_validate_json('{"type":"boolean", "enum":[true], "const":true, "default":true}') + schema = Schema.model_validate_json( + '{"type":"boolean", "enum":[true], "const":true, "default":true}' + ) assert schema.const is True def test_nullable_with_type_list(): - schema = Schema.model_validate_json('{"type": ["string", "number"], "nullable": true}') + schema = Schema.model_validate_json( + '{"type": ["string", "number"], "nullable": true}' + ) assert schema.type == [DataType.STRING, DataType.NUMBER, DataType.NULL] def test_nullable_with_any_of(): - schema = Schema.model_validate_json('{"anyOf": [{"type": "string"}], "nullable": true}') + schema = Schema.model_validate_json( + '{"anyOf": [{"type": "string"}], "nullable": true}' + ) assert schema.anyOf == [Schema(type=DataType.STRING), Schema(type=DataType.NULL)] def test_nullable_with_one_of(): - schema = Schema.model_validate_json('{"oneOf": [{"type": "string"}], "nullable": true}') + schema = Schema.model_validate_json( + '{"oneOf": [{"type": "string"}], "nullable": true}' + ) assert schema.oneOf == [Schema(type=DataType.STRING), Schema(type=DataType.NULL)] diff --git a/tests/test_templates/conftest.py b/tests/test_templates/conftest.py index 09fd63f6c..77d148d86 100644 --- a/tests/test_templates/conftest.py +++ b/tests/test_templates/conftest.py @@ -7,6 +7,10 @@ def env() -> Environment: from openapi_python_client import utils TEMPLATE_FILTERS = {"snakecase": utils.snake_case, "kebabcase": utils.kebab_case} - env = Environment(loader=PackageLoader("openapi_python_client"), trim_blocks=True, lstrip_blocks=True) + env = Environment( + loader=PackageLoader("openapi_python_client"), + trim_blocks=True, + lstrip_blocks=True, + ) env.filters.update(TEMPLATE_FILTERS) return env diff --git a/tests/test_templates/test_property_templates/test_date_property/required_not_null.py b/tests/test_templates/test_property_templates/test_date_property/required_not_null.py index ad4f380a4..c7342ab44 100644 --- a/tests/test_templates/test_property_templates/test_date_property/required_not_null.py +++ b/tests/test_templates/test_property_templates/test_date_property/required_not_null.py @@ -2,8 +2,7 @@ from typing import cast, Union from dateutil.parser import isoparse + some_source = date(2020, 10, 12) some_destination = some_source.isoformat() a_prop = isoparse(some_destination).date() - - diff --git a/tests/test_templates/test_property_templates/test_date_property/test_date_property.py b/tests/test_templates/test_property_templates/test_date_property/test_date_property.py index 89944994c..72820ab11 100644 --- a/tests/test_templates/test_property_templates/test_date_property/test_date_property.py +++ b/tests/test_templates/test_property_templates/test_date_property/test_date_property.py @@ -19,12 +19,16 @@ def date_property(required=True, default=None) -> DateProperty: def test_required(): prop = date_property() here = Path(__file__).parent - templates_dir = here.parent.parent.parent.parent / "openapi_python_client" / "templates" + templates_dir = ( + here.parent.parent.parent.parent / "openapi_python_client" / "templates" + ) env = jinja2.Environment( - loader=jinja2.ChoiceLoader([jinja2.FileSystemLoader(here), jinja2.FileSystemLoader(templates_dir)]), + loader=jinja2.ChoiceLoader( + [jinja2.FileSystemLoader(here), jinja2.FileSystemLoader(templates_dir)] + ), trim_blocks=True, - lstrip_blocks=True + lstrip_blocks=True, ) template = env.get_template("date_property_template.py.jinja") diff --git a/tests/test_templates/test_property_templates/test_datetime_property/required_not_null.py b/tests/test_templates/test_property_templates/test_datetime_property/required_not_null.py index 8253828e3..672f15247 100644 --- a/tests/test_templates/test_property_templates/test_datetime_property/required_not_null.py +++ b/tests/test_templates/test_property_templates/test_datetime_property/required_not_null.py @@ -2,8 +2,7 @@ from typing import cast, Union from dateutil.parser import isoparse + some_source = date(2020, 10, 12) some_destination = some_source.isoformat() a_prop = isoparse(some_destination) - - diff --git a/tests/test_templates/test_property_templates/test_datetime_property/test_datetime_property.py b/tests/test_templates/test_property_templates/test_datetime_property/test_datetime_property.py index bb9a3bd10..1292553d3 100644 --- a/tests/test_templates/test_property_templates/test_datetime_property/test_datetime_property.py +++ b/tests/test_templates/test_property_templates/test_datetime_property/test_datetime_property.py @@ -19,12 +19,16 @@ def datetime_property(required=True, default=None) -> DateTimeProperty: def test_required(): prop = datetime_property() here = Path(__file__).parent - templates_dir = here.parent.parent.parent.parent / "openapi_python_client" / "templates" + templates_dir = ( + here.parent.parent.parent.parent / "openapi_python_client" / "templates" + ) env = jinja2.Environment( - loader=jinja2.ChoiceLoader([jinja2.FileSystemLoader(here), jinja2.FileSystemLoader(templates_dir)]), + loader=jinja2.ChoiceLoader( + [jinja2.FileSystemLoader(here), jinja2.FileSystemLoader(templates_dir)] + ), trim_blocks=True, - lstrip_blocks=True + lstrip_blocks=True, ) template = env.get_template("datetime_property_template.py.jinja") diff --git a/tests/test_utils.py b/tests/test_utils.py index fafa61805..01d26da86 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -5,7 +5,9 @@ class TestPythonIdentifier: def test_valid_identifier_is_not_changed(self): - assert utils.PythonIdentifier(value="valid_field", prefix="field") == "valid_field" + assert ( + utils.PythonIdentifier(value="valid_field", prefix="field") == "valid_field" + ) def test_numbers_are_prefixed(self): assert utils.PythonIdentifier(value="1", prefix="field") == "field1" @@ -85,7 +87,10 @@ def test_kebab_case(): def test_sanitize(): - assert utils.sanitize("some.thing*~with lots_- of weird things}=") == "some.thingwith lots_- of weird things" + assert ( + utils.sanitize("some.thing*~with lots_- of weird things}=") + == "some.thingwith lots_- of weird things" + ) def test_no_string_escapes(): @@ -129,7 +134,9 @@ def test_pascalcase(before, after): pytest.param("application/json", "application/json"), pytest.param("application/vnd.api+json", "application/vnd.api+json"), pytest.param("application/json;charset=utf-8", "application/json"), - pytest.param("application/vnd.api+json;charset=utf-8", "application/vnd.api+json"), + pytest.param( + "application/vnd.api+json;charset=utf-8", "application/vnd.api+json" + ), ], ) def test_get_content_type(content_type: str, expected: str, config) -> None: From c86dba5967e680f9548550a938d0d13423a7c50e Mon Sep 17 00:00:00 2001 From: Itay Bavly Date: Wed, 20 Aug 2025 13:40:37 -0400 Subject: [PATCH 02/16] gen --- .../openapi_package/models/cancel_order_request.py | 2 +- .../models/cancel_replace_multi_leg_order_request.py | 10 +++++----- .../models/cancel_replace_order_request.py | 10 +++++----- .../create_multi_leg_order_cross_allocation.py | 4 ++-- .../models/create_multi_leg_order_cross_request.py | 10 +++++----- .../models/create_multi_leg_order_leg.py | 2 +- .../models/create_multi_leg_order_request.py | 4 ++-- .../models/create_order_cross_request.py | 4 ++-- .../openapi_package/models/create_order_request.py | 10 +++++----- openapi_project/openapi_package/models/execution.py | 4 ++-- openapi_project/openapi_package/models/future.py | 4 ++-- .../openapi_package/models/future_root.py | 4 ++-- .../openapi_package/models/future_spread.py | 2 +- .../openapi_package/models/generic_order.py | 2 +- .../openapi_package/models/list_routes_response.py | 2 +- .../openapi_package/models/login_response.py | 2 +- .../openapi_package/models/margin_data.py | 2 +- .../openapi_package/models/multi_leg_order.py | 10 +++++----- .../models/multi_leg_order_cancel_replace_request.py | 2 +- .../openapi_package/models/multi_leg_order_cross.py | 12 ++++++------ .../models/multi_leg_order_cross_allocation.py | 4 ++-- openapi_project/openapi_package/models/option.py | 2 +- .../openapi_package/models/option_chain.py | 4 ++-- .../openapi_package/models/option_root.py | 4 ++-- openapi_project/openapi_package/models/order.py | 8 ++++---- .../models/order_cancel_replace_request.py | 4 ++-- .../openapi_package/models/order_cross.py | 4 ++-- .../openapi_package/models/order_cross_allocation.py | 4 ++-- .../openapi_package/models/order_update.py | 6 +++--- .../openapi_package/models/order_update_event.py | 8 ++++---- .../openapi_package/models/risk_radar_class_group.py | 2 +- .../models/risk_radar_product_group.py | 2 +- openapi_project/openapi_package/models/scenario.py | 2 +- openapi_project/openapi_package/models/security.py | 10 +++++----- .../openapi_package/models/tims_margin_data.py | 2 +- 35 files changed, 84 insertions(+), 84 deletions(-) diff --git a/openapi_project/openapi_package/models/cancel_order_request.py b/openapi_project/openapi_package/models/cancel_order_request.py index 538f536aa..aa256db55 100644 --- a/openapi_project/openapi_package/models/cancel_order_request.py +++ b/openapi_project/openapi_package/models/cancel_order_request.py @@ -10,10 +10,10 @@ from typing import cast if TYPE_CHECKING: - from ..models.order_instruction import OrderInstruction from ..models.cancel_order_request_optional_data import ( CancelOrderRequestOptionalData, ) + from ..models.order_instruction import OrderInstruction T = TypeVar("T", bound="CancelOrderRequest") diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py index 274dc2f6c..684177fd7 100644 --- a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py +++ b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py @@ -12,17 +12,17 @@ from typing import cast if TYPE_CHECKING: - from ..models.cancel_replace_multi_leg_order_request_algo import ( - CancelReplaceMultiLegOrderRequestAlgo, + from ..models.cancel_replace_multi_leg_order_request_optional_data import ( + CancelReplaceMultiLegOrderRequestOptionalData, ) from ..models.cancel_replace_multi_leg_order_request_market_condition import ( CancelReplaceMultiLegOrderRequestMarketCondition, ) from ..models.clearing_info import ClearingInfo - from ..models.cancel_replace_multi_leg_order_request_optional_data import ( - CancelReplaceMultiLegOrderRequestOptionalData, - ) from ..models.order_instruction import OrderInstruction + from ..models.cancel_replace_multi_leg_order_request_algo import ( + CancelReplaceMultiLegOrderRequestAlgo, + ) T = TypeVar("T", bound="CancelReplaceMultiLegOrderRequest") diff --git a/openapi_project/openapi_package/models/cancel_replace_order_request.py b/openapi_project/openapi_package/models/cancel_replace_order_request.py index 8daf9594c..b7e7f1bd8 100644 --- a/openapi_project/openapi_package/models/cancel_replace_order_request.py +++ b/openapi_project/openapi_package/models/cancel_replace_order_request.py @@ -12,15 +12,15 @@ from typing import cast if TYPE_CHECKING: - from ..models.cancel_replace_order_request_market_condition import ( - CancelReplaceOrderRequestMarketCondition, - ) from ..models.cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo - from ..models.clearing_info import ClearingInfo - from ..models.order_instruction import OrderInstruction from ..models.cancel_replace_order_request_optional_data import ( CancelReplaceOrderRequestOptionalData, ) + from ..models.clearing_info import ClearingInfo + from ..models.order_instruction import OrderInstruction + from ..models.cancel_replace_order_request_market_condition import ( + CancelReplaceOrderRequestMarketCondition, + ) T = TypeVar("T", bound="CancelReplaceOrderRequest") diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py index cf767e7f2..aaa944165 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py @@ -12,11 +12,11 @@ if TYPE_CHECKING: from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg - from ..models.clearing_info import ClearingInfo - from ..models.order_instruction import OrderInstruction from ..models.create_multi_leg_order_cross_allocation_optional_data import ( CreateMultiLegOrderCrossAllocationOptionalData, ) + from ..models.order_instruction import OrderInstruction + from ..models.clearing_info import ClearingInfo T = TypeVar("T", bound="CreateMultiLegOrderCrossAllocation") diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py index ef57c25b5..caa8f8b9c 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py @@ -14,19 +14,19 @@ from typing import cast if TYPE_CHECKING: - from ..models.create_multi_leg_order_cross_request_market_condition import ( - CreateMultiLegOrderCrossRequestMarketCondition, + from ..models.create_multi_leg_order_cross_request_algo import ( + CreateMultiLegOrderCrossRequestAlgo, ) from ..models.create_multi_leg_order_cross_request_optional_data import ( CreateMultiLegOrderCrossRequestOptionalData, ) - from ..models.create_multi_leg_order_cross_request_algo import ( - CreateMultiLegOrderCrossRequestAlgo, + from ..models.create_multi_leg_order_cross_request_market_condition import ( + CreateMultiLegOrderCrossRequestMarketCondition, ) - from ..models.order_instruction import OrderInstruction from ..models.create_multi_leg_order_cross_allocation import ( CreateMultiLegOrderCrossAllocation, ) + from ..models.order_instruction import OrderInstruction T = TypeVar("T", bound="CreateMultiLegOrderCrossRequest") diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_leg.py b/openapi_project/openapi_package/models/create_multi_leg_order_leg.py index cf7ebbf94..f6b1cbd71 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_leg.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_leg.py @@ -12,10 +12,10 @@ from typing import cast if TYPE_CHECKING: - from ..models.flex_option import FlexOption from ..models.create_multi_leg_order_leg_optional_data import ( CreateMultiLegOrderLegOptionalData, ) + from ..models.flex_option import FlexOption from ..models.create_multi_leg_order_leg_market_condition import ( CreateMultiLegOrderLegMarketCondition, ) diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_request.py b/openapi_project/openapi_package/models/create_multi_leg_order_request.py index 84e4d5467..62b2277b5 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_request.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_request.py @@ -16,15 +16,15 @@ from ..models.create_multi_leg_order_request_algo import ( CreateMultiLegOrderRequestAlgo, ) - from ..models.clearing_info import ClearingInfo from ..models.create_multi_leg_order_request_optional_data import ( CreateMultiLegOrderRequestOptionalData, ) from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg + from ..models.clearing_info import ClearingInfo + from ..models.order_instruction import OrderInstruction from ..models.create_multi_leg_order_request_market_condition import ( CreateMultiLegOrderRequestMarketCondition, ) - from ..models.order_instruction import OrderInstruction T = TypeVar("T", bound="CreateMultiLegOrderRequest") diff --git a/openapi_project/openapi_package/models/create_order_cross_request.py b/openapi_project/openapi_package/models/create_order_cross_request.py index 050cc19aa..b4de250cc 100644 --- a/openapi_project/openapi_package/models/create_order_cross_request.py +++ b/openapi_project/openapi_package/models/create_order_cross_request.py @@ -17,13 +17,13 @@ from ..models.create_order_cross_request_market_condition import ( CreateOrderCrossRequestMarketCondition, ) + from ..models.create_order_cross_request_algo import CreateOrderCrossRequestAlgo from ..models.create_order_cross_allocation import CreateOrderCrossAllocation from ..models.flex_option import FlexOption + from ..models.order_instruction import OrderInstruction from ..models.create_order_cross_request_optional_data import ( CreateOrderCrossRequestOptionalData, ) - from ..models.order_instruction import OrderInstruction - from ..models.create_order_cross_request_algo import CreateOrderCrossRequestAlgo T = TypeVar("T", bound="CreateOrderCrossRequest") diff --git a/openapi_project/openapi_package/models/create_order_request.py b/openapi_project/openapi_package/models/create_order_request.py index 1880b4d6b..146dee242 100644 --- a/openapi_project/openapi_package/models/create_order_request.py +++ b/openapi_project/openapi_package/models/create_order_request.py @@ -15,16 +15,16 @@ from typing import cast if TYPE_CHECKING: - from ..models.create_order_request_market_condition import ( - CreateOrderRequestMarketCondition, - ) - from ..models.clearing_info import ClearingInfo from ..models.create_order_request_optional_data import ( CreateOrderRequestOptionalData, ) - from ..models.flex_option import FlexOption from ..models.create_order_request_algo import CreateOrderRequestAlgo + from ..models.clearing_info import ClearingInfo from ..models.order_instruction import OrderInstruction + from ..models.flex_option import FlexOption + from ..models.create_order_request_market_condition import ( + CreateOrderRequestMarketCondition, + ) T = TypeVar("T", bound="CreateOrderRequest") diff --git a/openapi_project/openapi_package/models/execution.py b/openapi_project/openapi_package/models/execution.py index 614990ad4..3d318fed4 100644 --- a/openapi_project/openapi_package/models/execution.py +++ b/openapi_project/openapi_package/models/execution.py @@ -19,10 +19,10 @@ from typing import cast if TYPE_CHECKING: - from ..models.clearing_info import ClearingInfo + from ..models.security import Security from ..models.header import Header + from ..models.clearing_info import ClearingInfo from ..models.execution_optional_data import ExecutionOptionalData - from ..models.security import Security from ..models.order_instruction import OrderInstruction from ..models.execution_algo import ExecutionAlgo diff --git a/openapi_project/openapi_package/models/future.py b/openapi_project/openapi_package/models/future.py index b491f14b1..98f56019c 100644 --- a/openapi_project/openapi_package/models/future.py +++ b/openapi_project/openapi_package/models/future.py @@ -14,9 +14,9 @@ from typing import cast if TYPE_CHECKING: - from ..models.future_root import FutureRoot - from ..models.date import Date from ..models.future_aliases import FutureAliases + from ..models.date import Date + from ..models.future_root import FutureRoot T = TypeVar("T", bound="Future") diff --git a/openapi_project/openapi_package/models/future_root.py b/openapi_project/openapi_package/models/future_root.py index e0bbf6ffa..2fcb2074c 100644 --- a/openapi_project/openapi_package/models/future_root.py +++ b/openapi_project/openapi_package/models/future_root.py @@ -17,9 +17,9 @@ from typing import cast if TYPE_CHECKING: - from ..models.future_root_aliases import FutureRootAliases - from ..models.date import Date from ..models.trading_session_group import TradingSessionGroup + from ..models.date import Date + from ..models.future_root_aliases import FutureRootAliases T = TypeVar("T", bound="FutureRoot") diff --git a/openapi_project/openapi_package/models/future_spread.py b/openapi_project/openapi_package/models/future_spread.py index ffd9d8d0c..fb511d352 100644 --- a/openapi_project/openapi_package/models/future_spread.py +++ b/openapi_project/openapi_package/models/future_spread.py @@ -15,8 +15,8 @@ if TYPE_CHECKING: from ..models.date import Date - from ..models.future_spread_aliases import FutureSpreadAliases from ..models.future_spread_leg import FutureSpreadLeg + from ..models.future_spread_aliases import FutureSpreadAliases T = TypeVar("T", bound="FutureSpread") diff --git a/openapi_project/openapi_package/models/generic_order.py b/openapi_project/openapi_package/models/generic_order.py index d0f85e0e4..7e03799e8 100644 --- a/openapi_project/openapi_package/models/generic_order.py +++ b/openapi_project/openapi_package/models/generic_order.py @@ -10,10 +10,10 @@ from typing import cast if TYPE_CHECKING: - from ..models.order_cross import OrderCross from ..models.order import Order from ..models.multi_leg_order import MultiLegOrder from ..models.multi_leg_order_cross import MultiLegOrderCross + from ..models.order_cross import OrderCross T = TypeVar("T", bound="GenericOrder") diff --git a/openapi_project/openapi_package/models/list_routes_response.py b/openapi_project/openapi_package/models/list_routes_response.py index 58f7a5565..f7c82457e 100644 --- a/openapi_project/openapi_package/models/list_routes_response.py +++ b/openapi_project/openapi_package/models/list_routes_response.py @@ -11,8 +11,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.route import Route from ..models.route_applicability import RouteApplicability + from ..models.route import Route T = TypeVar("T", bound="ListRoutesResponse") diff --git a/openapi_project/openapi_package/models/login_response.py b/openapi_project/openapi_package/models/login_response.py index 83b23c4fb..5608aa970 100644 --- a/openapi_project/openapi_package/models/login_response.py +++ b/openapi_project/openapi_package/models/login_response.py @@ -12,8 +12,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.login_response_system_settings import LoginResponseSystemSettings from ..models.user import User + from ..models.login_response_system_settings import LoginResponseSystemSettings T = TypeVar("T", bound="LoginResponse") diff --git a/openapi_project/openapi_package/models/margin_data.py b/openapi_project/openapi_package/models/margin_data.py index 0740c965b..a0d0a5cdc 100644 --- a/openapi_project/openapi_package/models/margin_data.py +++ b/openapi_project/openapi_package/models/margin_data.py @@ -10,8 +10,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.tims_margin_data import TimsMarginData from ..models.empty import Empty + from ..models.tims_margin_data import TimsMarginData T = TypeVar("T", bound="MarginData") diff --git a/openapi_project/openapi_package/models/multi_leg_order.py b/openapi_project/openapi_package/models/multi_leg_order.py index 956838941..463f3ef40 100644 --- a/openapi_project/openapi_package/models/multi_leg_order.py +++ b/openapi_project/openapi_package/models/multi_leg_order.py @@ -15,13 +15,13 @@ from typing import cast if TYPE_CHECKING: - from ..models.clearing_info import ClearingInfo - from ..models.multi_leg_order_market_condition import MultiLegOrderMarketCondition - from ..models.multi_leg_order_leg import MultiLegOrderLeg + from ..models.multi_leg_order_optional_data import MultiLegOrderOptionalData from ..models.order_update_event import OrderUpdateEvent - from ..models.multi_leg_order_algo import MultiLegOrderAlgo from ..models.header import Header - from ..models.multi_leg_order_optional_data import MultiLegOrderOptionalData + from ..models.multi_leg_order_algo import MultiLegOrderAlgo + from ..models.multi_leg_order_market_condition import MultiLegOrderMarketCondition + from ..models.clearing_info import ClearingInfo + from ..models.multi_leg_order_leg import MultiLegOrderLeg from ..models.order_instruction import OrderInstruction diff --git a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py index 3cddead1a..8fe519990 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py @@ -18,11 +18,11 @@ from ..models.multi_leg_order_cancel_replace_request_optional_data import ( MultiLegOrderCancelReplaceRequestOptionalData, ) - from ..models.clearing_info import ClearingInfo from ..models.multi_leg_order_cancel_replace_request_algo import ( MultiLegOrderCancelReplaceRequestAlgo, ) from ..models.header import Header + from ..models.clearing_info import ClearingInfo from ..models.order_instruction import OrderInstruction from ..models.multi_leg_order_cancel_replace_request_market_condition import ( MultiLegOrderCancelReplaceRequestMarketCondition, diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross.py b/openapi_project/openapi_package/models/multi_leg_order_cross.py index 9816df389..95160242e 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross.py @@ -16,17 +16,17 @@ from typing import cast if TYPE_CHECKING: - from ..models.multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation - from ..models.multi_leg_order_cross_market_condition import ( - MultiLegOrderCrossMarketCondition, + from ..models.multi_leg_order_cross_optional_data import ( + MultiLegOrderCrossOptionalData, ) from ..models.order_update_event import OrderUpdateEvent from ..models.header import Header + from ..models.multi_leg_order_cross_market_condition import ( + MultiLegOrderCrossMarketCondition, + ) from ..models.multi_leg_order_cross_algo import MultiLegOrderCrossAlgo from ..models.order_instruction import OrderInstruction - from ..models.multi_leg_order_cross_optional_data import ( - MultiLegOrderCrossOptionalData, - ) + from ..models.multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation T = TypeVar("T", bound="MultiLegOrderCross") diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py index 9b25d73dd..525cb4311 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py @@ -12,12 +12,12 @@ from typing import cast if TYPE_CHECKING: - from ..models.clearing_info import ClearingInfo from ..models.order_instruction import OrderInstruction - from ..models.multi_leg_order_leg import MultiLegOrderLeg from ..models.multi_leg_order_cross_allocation_optional_data import ( MultiLegOrderCrossAllocationOptionalData, ) + from ..models.multi_leg_order_leg import MultiLegOrderLeg + from ..models.clearing_info import ClearingInfo T = TypeVar("T", bound="MultiLegOrderCrossAllocation") diff --git a/openapi_project/openapi_package/models/option.py b/openapi_project/openapi_package/models/option.py index 73fdc0ec6..efe175b86 100644 --- a/openapi_project/openapi_package/models/option.py +++ b/openapi_project/openapi_package/models/option.py @@ -16,8 +16,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.option_aliases import OptionAliases from ..models.date import Date + from ..models.option_aliases import OptionAliases from ..models.option_root import OptionRoot diff --git a/openapi_project/openapi_package/models/option_chain.py b/openapi_project/openapi_package/models/option_chain.py index 9dc12f061..b80eaed84 100644 --- a/openapi_project/openapi_package/models/option_chain.py +++ b/openapi_project/openapi_package/models/option_chain.py @@ -10,10 +10,10 @@ from typing import cast if TYPE_CHECKING: - from ..models.option_series import OptionSeries - from ..models.option_chain_roots import OptionChainRoots from ..models.security import Security + from ..models.option_chain_roots import OptionChainRoots from ..models.option_chain_options import OptionChainOptions + from ..models.option_series import OptionSeries T = TypeVar("T", bound="OptionChain") diff --git a/openapi_project/openapi_package/models/option_root.py b/openapi_project/openapi_package/models/option_root.py index 6b837fb8f..ca2778df3 100644 --- a/openapi_project/openapi_package/models/option_root.py +++ b/openapi_project/openapi_package/models/option_root.py @@ -18,10 +18,10 @@ from typing import cast if TYPE_CHECKING: - from ..models.option_root_aliases import OptionRootAliases from ..models.settlement_info import SettlementInfo - from ..models.date import Date from ..models.trading_session_group import TradingSessionGroup + from ..models.date import Date + from ..models.option_root_aliases import OptionRootAliases T = TypeVar("T", bound="OptionRoot") diff --git a/openapi_project/openapi_package/models/order.py b/openapi_project/openapi_package/models/order.py index 4945befa1..e72f017b8 100644 --- a/openapi_project/openapi_package/models/order.py +++ b/openapi_project/openapi_package/models/order.py @@ -17,14 +17,14 @@ from typing import cast if TYPE_CHECKING: + from ..models.order_optional_data import OrderOptionalData from ..models.order_market_condition import OrderMarketCondition - from ..models.order_algo import OrderAlgo - from ..models.clearing_info import ClearingInfo + from ..models.security import Security from ..models.order_update_event import OrderUpdateEvent - from ..models.order_optional_data import OrderOptionalData from ..models.header import Header - from ..models.security import Security + from ..models.clearing_info import ClearingInfo from ..models.order_instruction import OrderInstruction + from ..models.order_algo import OrderAlgo T = TypeVar("T", bound="Order") diff --git a/openapi_project/openapi_package/models/order_cancel_replace_request.py b/openapi_project/openapi_package/models/order_cancel_replace_request.py index 3d3956d10..22f8c9af1 100644 --- a/openapi_project/openapi_package/models/order_cancel_replace_request.py +++ b/openapi_project/openapi_package/models/order_cancel_replace_request.py @@ -15,8 +15,6 @@ from typing import cast if TYPE_CHECKING: - from ..models.order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo - from ..models.clearing_info import ClearingInfo from ..models.order_cancel_replace_request_market_condition import ( OrderCancelReplaceRequestMarketCondition, ) @@ -24,7 +22,9 @@ from ..models.order_cancel_replace_request_optional_data import ( OrderCancelReplaceRequestOptionalData, ) + from ..models.clearing_info import ClearingInfo from ..models.order_instruction import OrderInstruction + from ..models.order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo T = TypeVar("T", bound="OrderCancelReplaceRequest") diff --git a/openapi_project/openapi_package/models/order_cross.py b/openapi_project/openapi_package/models/order_cross.py index 1e1688684..b9ceec3b7 100644 --- a/openapi_project/openapi_package/models/order_cross.py +++ b/openapi_project/openapi_package/models/order_cross.py @@ -16,12 +16,12 @@ from typing import cast if TYPE_CHECKING: + from ..models.order_cross_algo import OrderCrossAlgo + from ..models.security import Security from ..models.order_cross_optional_data import OrderCrossOptionalData from ..models.order_update_event import OrderUpdateEvent from ..models.header import Header from ..models.order_cross_allocation import OrderCrossAllocation - from ..models.order_cross_algo import OrderCrossAlgo - from ..models.security import Security from ..models.order_instruction import OrderInstruction from ..models.order_cross_market_condition import OrderCrossMarketCondition diff --git a/openapi_project/openapi_package/models/order_cross_allocation.py b/openapi_project/openapi_package/models/order_cross_allocation.py index ac9325e30..c302df8a4 100644 --- a/openapi_project/openapi_package/models/order_cross_allocation.py +++ b/openapi_project/openapi_package/models/order_cross_allocation.py @@ -14,11 +14,11 @@ from typing import cast if TYPE_CHECKING: - from ..models.clearing_info import ClearingInfo - from ..models.order_instruction import OrderInstruction from ..models.order_cross_allocation_optional_data import ( OrderCrossAllocationOptionalData, ) + from ..models.clearing_info import ClearingInfo + from ..models.order_instruction import OrderInstruction T = TypeVar("T", bound="OrderCrossAllocation") diff --git a/openapi_project/openapi_package/models/order_update.py b/openapi_project/openapi_package/models/order_update.py index cc64cc700..67175a399 100644 --- a/openapi_project/openapi_package/models/order_update.py +++ b/openapi_project/openapi_package/models/order_update.py @@ -20,10 +20,10 @@ if TYPE_CHECKING: from ..models.order_update_algo import OrderUpdateAlgo - from ..models.clearing_info import ClearingInfo - from ..models.order_update_optional_data import OrderUpdateOptionalData - from ..models.header import Header from ..models.security import Security + from ..models.header import Header + from ..models.order_update_optional_data import OrderUpdateOptionalData + from ..models.clearing_info import ClearingInfo from ..models.order_instruction import OrderInstruction diff --git a/openapi_project/openapi_package/models/order_update_event.py b/openapi_project/openapi_package/models/order_update_event.py index 60fe25fd4..347310905 100644 --- a/openapi_project/openapi_package/models/order_update_event.py +++ b/openapi_project/openapi_package/models/order_update_event.py @@ -10,15 +10,15 @@ from typing import cast if TYPE_CHECKING: - from ..models.order_delete import OrderDelete - from ..models.order_update import OrderUpdate - from ..models.execution import Execution from ..models.multi_leg_order_cancel_replace_request import ( MultiLegOrderCancelReplaceRequest, ) from ..models.order_cancel_replace_request import OrderCancelReplaceRequest - from ..models.order_cancel_request import OrderCancelRequest from ..models.order_cancel_reject import OrderCancelReject + from ..models.order_update import OrderUpdate + from ..models.order_cancel_request import OrderCancelRequest + from ..models.execution import Execution + from ..models.order_delete import OrderDelete T = TypeVar("T", bound="OrderUpdateEvent") diff --git a/openapi_project/openapi_package/models/risk_radar_class_group.py b/openapi_project/openapi_package/models/risk_radar_class_group.py index 19fc1aa09..f012e46d5 100644 --- a/openapi_project/openapi_package/models/risk_radar_class_group.py +++ b/openapi_project/openapi_package/models/risk_radar_class_group.py @@ -10,8 +10,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.shock_value import ShockValue from ..models.risk_radar_position import RiskRadarPosition + from ..models.shock_value import ShockValue T = TypeVar("T", bound="RiskRadarClassGroup") diff --git a/openapi_project/openapi_package/models/risk_radar_product_group.py b/openapi_project/openapi_package/models/risk_radar_product_group.py index 88be9c2b7..61669f769 100644 --- a/openapi_project/openapi_package/models/risk_radar_product_group.py +++ b/openapi_project/openapi_package/models/risk_radar_product_group.py @@ -10,8 +10,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.shock_value import ShockValue from ..models.risk_radar_class_group import RiskRadarClassGroup + from ..models.shock_value import ShockValue T = TypeVar("T", bound="RiskRadarProductGroup") diff --git a/openapi_project/openapi_package/models/scenario.py b/openapi_project/openapi_package/models/scenario.py index a5028c480..115ef1dde 100644 --- a/openapi_project/openapi_package/models/scenario.py +++ b/openapi_project/openapi_package/models/scenario.py @@ -10,8 +10,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.scenario_position import ScenarioPosition from ..models.scenario_leg import ScenarioLeg + from ..models.scenario_position import ScenarioPosition T = TypeVar("T", bound="Scenario") diff --git a/openapi_project/openapi_package/models/security.py b/openapi_project/openapi_package/models/security.py index 1e3e36520..6f0e2ad69 100644 --- a/openapi_project/openapi_package/models/security.py +++ b/openapi_project/openapi_package/models/security.py @@ -11,15 +11,15 @@ if TYPE_CHECKING: from ..models.stock import Stock - from ..models.future_spread import FutureSpread - from ..models.fx import Fx - from ..models.crypto import Crypto from ..models.future_root import FutureRoot + from ..models.option import Option + from ..models.future_spread import FutureSpread from ..models.future import Future + from ..models.index import Index + from ..models.fx import Fx from ..models.flex_option import FlexOption from ..models.option_root import OptionRoot - from ..models.option import Option - from ..models.index import Index + from ..models.crypto import Crypto T = TypeVar("T", bound="Security") diff --git a/openapi_project/openapi_package/models/tims_margin_data.py b/openapi_project/openapi_package/models/tims_margin_data.py index 53167f98e..08391344c 100644 --- a/openapi_project/openapi_package/models/tims_margin_data.py +++ b/openapi_project/openapi_package/models/tims_margin_data.py @@ -11,8 +11,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.tims_class_group import TimsClassGroup from ..models.tims_product_group import TimsProductGroup + from ..models.tims_class_group import TimsClassGroup T = TypeVar("T", bound="TimsMarginData") From d8cd7fbb56d49a43b00648cb40bc681d586dfa38 Mon Sep 17 00:00:00 2001 From: Itay Bavly Date: Wed, 20 Aug 2025 13:46:25 -0400 Subject: [PATCH 03/16] gen --- openapi/class_overrides.yaml | 2 +- openapi/templates/model.py.jinja | 7 +- .../openapi_package/models/account.py | 150 +++++----- .../models/analyze_positions_response.py | 30 +- .../openapi_package/models/any_model.py | 4 +- .../models/calculate_margin_request.py | 46 ++- .../models/calculate_margin_response.py | 14 +- .../models/cancel_order_request.py | 18 +- .../cancel_order_request_optional_data.py | 33 +-- .../models/cancel_order_response.py | 14 +- .../cancel_replace_multi_leg_order_request.py | 108 ++++--- ...el_replace_multi_leg_order_request_algo.py | 37 +-- ...ulti_leg_order_request_market_condition.py | 37 +-- ...e_multi_leg_order_request_optional_data.py | 37 +-- ...cancel_replace_multi_leg_order_response.py | 14 +- .../models/cancel_replace_order_request.py | 108 ++++--- .../cancel_replace_order_request_algo.py | 33 +-- ..._replace_order_request_market_condition.py | 37 +-- ...cel_replace_order_request_optional_data.py | 37 +-- .../models/cancel_replace_order_response.py | 14 +- .../openapi_package/models/clearing_info.py | 50 ++-- .../models/create_flex_option_request.py | 98 ++++--- .../models/create_flex_option_response.py | 30 +- ...create_multi_leg_order_cross_allocation.py | 54 ++-- ...eg_order_cross_allocation_optional_data.py | 37 +-- .../create_multi_leg_order_cross_request.py | 116 ++++---- ...eate_multi_leg_order_cross_request_algo.py | 37 +-- ...eg_order_cross_request_market_condition.py | 37 +-- ...i_leg_order_cross_request_optional_data.py | 37 +-- .../create_multi_leg_order_cross_response.py | 32 +- .../models/create_multi_leg_order_leg.py | 90 +++--- ...te_multi_leg_order_leg_market_condition.py | 37 +-- ...reate_multi_leg_order_leg_optional_data.py | 37 +-- .../models/create_multi_leg_order_request.py | 124 ++++---- .../create_multi_leg_order_request_algo.py | 37 +-- ...ulti_leg_order_request_market_condition.py | 37 +-- ...e_multi_leg_order_request_optional_data.py | 37 +-- .../models/create_multi_leg_order_response.py | 32 +- .../models/create_order_cross_allocation.py | 82 +++--- ...te_order_cross_allocation_optional_data.py | 37 +-- .../models/create_order_cross_request.py | 130 ++++----- .../models/create_order_cross_request_algo.py | 33 +-- ...te_order_cross_request_market_condition.py | 37 +-- ...reate_order_cross_request_optional_data.py | 37 +-- .../models/create_order_cross_response.py | 30 +- .../models/create_order_request.py | 162 +++++----- .../models/create_order_request_algo.py | 33 +-- .../create_order_request_market_condition.py | 37 +-- .../create_order_request_optional_data.py | 33 +-- .../models/create_order_response.py | 28 +- .../openapi_package/models/crypto.py | 128 ++++---- .../openapi_package/models/crypto_aliases.py | 33 +-- .../openapi_package/models/execution.py | 214 +++++++------- .../openapi_package/models/execution_algo.py | 33 +-- .../models/execution_optional_data.py | 33 +-- .../openapi_package/models/flex_option.py | 210 ++++++------- .../models/flex_option_aliases.py | 33 +-- .../openapi_package/models/future.py | 198 +++++++------ .../openapi_package/models/future_aliases.py | 33 +-- .../openapi_package/models/future_root.py | 188 ++++++------ .../models/future_root_aliases.py | 33 +-- .../openapi_package/models/future_spread.py | 184 ++++++------ .../models/future_spread_aliases.py | 33 +-- .../models/future_spread_leg.py | 44 ++- openapi_project/openapi_package/models/fx.py | 126 ++++---- .../openapi_package/models/fx_aliases.py | 33 +-- .../openapi_package/models/generic_order.py | 68 ++--- .../models/get_active_user_response.py | 28 +- .../models/get_server_info_response.py | 34 +-- ...et_server_info_response_system_settings.py | 37 +-- .../models/get_server_time_response.py | 14 +- .../models/get_trading_holidays_response.py | 14 +- .../openapi_package/models/index.py | 112 ++++--- .../openapi_package/models/index_aliases.py | 33 +-- .../models/list_accounts_response.py | 14 +- .../list_affiliated_trading_firms_response.py | 14 +- ...list_easy_to_borrow_securities_response.py | 14 +- .../models/list_exchanges_response.py | 14 +- .../models/list_option_chains_repsonse.py | 14 +- .../models/list_orders_response.py | 14 +- .../models/list_positions_response.py | 14 +- .../models/list_routes_response.py | 16 +- .../models/list_securities_response.py | 14 +- .../models/list_trade_confirms_response.py | 14 +- .../models/list_trading_firms_response.py | 14 +- .../openapi_package/models/login_response.py | 62 ++-- .../models/login_response_system_settings.py | 33 +-- .../openapi_package/models/margin_data.py | 28 +- .../openapi_package/models/multi_leg_order.py | 160 +++++----- .../models/multi_leg_order_algo.py | 33 +-- .../multi_leg_order_cancel_replace_request.py | 168 +++++------ ...i_leg_order_cancel_replace_request_algo.py | 37 +-- ...cancel_replace_request_market_condition.py | 37 +-- ...er_cancel_replace_request_optional_data.py | 37 +-- .../models/multi_leg_order_cross.py | 162 +++++----- .../models/multi_leg_order_cross_algo.py | 33 +-- .../multi_leg_order_cross_allocation.py | 70 +++-- ...eg_order_cross_allocation_optional_data.py | 37 +-- .../multi_leg_order_cross_market_condition.py | 37 +-- .../multi_leg_order_cross_optional_data.py | 37 +-- .../models/multi_leg_order_leg.py | 82 +++--- .../multi_leg_order_leg_market_condition.py | 37 +-- .../multi_leg_order_leg_optional_data.py | 33 +-- .../multi_leg_order_market_condition.py | 33 +-- .../models/multi_leg_order_optional_data.py | 33 +-- .../openapi_package/models/option.py | 212 +++++++------- .../openapi_package/models/option_aliases.py | 33 +-- .../openapi_package/models/option_chain.py | 46 ++- .../models/option_chain_option.py | 96 +++--- .../models/option_chain_option_aliases.py | 33 +-- .../models/option_chain_options.py | 39 +-- .../models/option_chain_roots.py | 39 +-- .../openapi_package/models/option_root.py | 202 ++++++------- .../models/option_root_aliases.py | 33 +-- .../openapi_package/models/option_series.py | 136 +++++---- .../openapi_package/models/order.py | 202 ++++++------- .../openapi_package/models/order_algo.py | 33 +-- .../models/order_cancel_reject.py | 68 +++-- .../order_cancel_reject_optional_data.py | 33 +-- .../models/order_cancel_replace_request.py | 160 +++++----- .../order_cancel_replace_request_algo.py | 33 +-- ...cancel_replace_request_market_condition.py | 37 +-- ...er_cancel_replace_request_optional_data.py | 37 +-- .../models/order_cancel_request.py | 38 +-- .../order_cancel_request_optional_data.py | 33 +-- .../openapi_package/models/order_cross.py | 172 +++++------ .../models/order_cross_algo.py | 33 +-- .../models/order_cross_allocation.py | 92 +++--- .../order_cross_allocation_optional_data.py | 37 +-- .../models/order_cross_market_condition.py | 33 +-- .../models/order_cross_optional_data.py | 33 +-- .../openapi_package/models/order_delete.py | 36 ++- .../models/order_delete_optional_data.py | 33 +-- .../models/order_instruction.py | 14 +- .../models/order_market_condition.py | 33 +-- .../models/order_optional_data.py | 33 +-- .../openapi_package/models/order_update.py | 214 +++++++------- .../models/order_update_algo.py | 33 +-- .../models/order_update_event.py | 142 ++++----- .../models/order_update_optional_data.py | 33 +-- .../models/position_analysis.py | 20 +- .../models/risk_radar_account_group.py | 14 +- .../models/risk_radar_request.py | 82 +++--- .../models/risk_radar_response.py | 28 +- .../openapi_package/models/risk_reject.py | 32 +- .../openapi_package/models/route.py | 56 ++-- .../models/route_applicability.py | 42 ++- .../openapi_package/models/route_property.py | 14 +- .../models/routing_session_group.py | 14 +- .../openapi_package/models/scenario.py | 18 +- .../models/search_order_history_response.py | 14 +- .../openapi_package/models/security.py | 160 +++++----- .../openapi_package/models/settlement_info.py | 18 +- .../openapi_package/models/shock_value.py | 14 +- .../openapi_package/models/stock.py | 110 ++++--- .../openapi_package/models/stock_aliases.py | 33 +-- .../models/tims_margin_data.py | 14 +- .../openapi_package/models/trade_confirm.py | 276 +++++++++--------- .../openapi_package/models/trading_holiday.py | 28 +- .../openapi_package/models/trading_session.py | 30 +- .../openapi_package/models/user.py | 42 ++- .../openapi_package/models/user_permission.py | 14 +- .../models/validate_risk_response.py | 14 +- .../templates/model.py.jinja | 7 +- .../property_templates/date_property.py.jinja | 6 +- .../datetime_property.py.jinja | 6 +- .../property_templates/enum_property.py.jinja | 4 +- .../property_templates/file_property.py.jinja | 4 +- .../literal_enum_property.py.jinja | 4 +- .../model_property.py.jinja | 7 +- .../property_macros.py.jinja | 8 +- .../property_templates/uuid_property.py.jinja | 6 +- 172 files changed, 4041 insertions(+), 5271 deletions(-) diff --git a/openapi/class_overrides.yaml b/openapi/class_overrides.yaml index c484f85e8..d6b228e4a 100644 --- a/openapi/class_overrides.yaml +++ b/openapi/class_overrides.yaml @@ -8,4 +8,4 @@ field_prefix: attr_ use_path_prefixes_for_title_model_names: false post_hooks: - "black ." - - "ruff check . --fix" \ No newline at end of file + - "ruff check . --fix --unsafe-fixes" \ No newline at end of file diff --git a/openapi/templates/model.py.jinja b/openapi/templates/model.py.jinja index 905a0d0bf..94e504004 100644 --- a/openapi/templates/model.py.jinja +++ b/openapi/templates/model.py.jinja @@ -111,12 +111,13 @@ field_dict: dict[str, Any] = {} {% if model.additional_properties %} {% import "property_templates/" + model.additional_properties.template as prop_template %} {% if prop_template.transform %} +for prop_name, prop in self.additional_properties.items(): + {{ prop_template.transform(model.additional_properties, "prop", "field_dict[prop_name]", declare_type=false) | indent(4) }} +{% else %} field_dict.update({ - prop_name: {{ prop_template.transform(model.additional_properties, "prop", "prop", declare_type=false) }} + prop_name: prop for prop_name, prop in self.additional_properties.items() }) -{% else %} -field_dict.update(self.additional_properties) {%- endif -%} {%- endif -%} {% endmacro %} diff --git a/openapi_project/openapi_package/models/account.py b/openapi_project/openapi_package/models/account.py index 9c083390f..b0b1ff207 100644 --- a/openapi_project/openapi_package/models/account.py +++ b/openapi_project/openapi_package/models/account.py @@ -92,13 +92,15 @@ def to_dict(self) -> dict[str, Any]: cti_code = self.cti_code - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value + currency: Unset | str = ( + UNSET if isinstance(self.currency, Unset) else self.currency.value + ) - equities_capacity: Unset | str = UNSET - if not isinstance(self.equities_capacity, Unset): - equities_capacity = self.equities_capacity.value + equities_capacity: Unset | str = ( + UNSET + if isinstance(self.equities_capacity, Unset) + else self.equities_capacity.value + ) equities_give_up = self.equities_give_up @@ -106,9 +108,11 @@ def to_dict(self) -> dict[str, Any]: futures_clearing_account = self.futures_clearing_account - futures_clearing_range: Unset | str = UNSET - if not isinstance(self.futures_clearing_range, Unset): - futures_clearing_range = self.futures_clearing_range.value + futures_clearing_range: Unset | str = ( + UNSET + if isinstance(self.futures_clearing_range, Unset) + else self.futures_clearing_range.value + ) futures_cmta = self.futures_cmta @@ -120,9 +124,11 @@ def to_dict(self) -> dict[str, Any]: options_clearing_account = self.options_clearing_account - options_clearing_range: Unset | str = UNSET - if not isinstance(self.options_clearing_range, Unset): - options_clearing_range = self.options_clearing_range.value + options_clearing_range: Unset | str = ( + UNSET + if isinstance(self.options_clearing_range, Unset) + else self.options_clearing_range.value + ) options_cmta = self.options_cmta @@ -137,33 +143,39 @@ def to_dict(self) -> dict[str, Any]: routing_session_groups_item = routing_session_groups_item_data.to_dict() routing_session_groups.append(routing_session_groups_item) - status: Unset | str = UNSET - if not isinstance(self.status, Unset): - status = self.status.value + status: Unset | str = ( + UNSET if isinstance(self.status, Unset) else self.status.value + ) tag1 = self.tag1 trading_firm_id = self.trading_firm_id - type_: Unset | str = UNSET - if not isinstance(self.type_, Unset): - type_ = self.type_.value + type_: Unset | str = ( + UNSET if isinstance(self.type_, Unset) else self.type_.value + ) created_ts = self.created_ts optional_data = self.optional_data - position_script: Unset | dict[str, Any] = UNSET - if not isinstance(self.position_script, Unset): - position_script = self.position_script.to_dict() + position_script: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.position_script, Unset) + else self.position_script.to_dict() + ) - buying_power_script: Unset | dict[str, Any] = UNSET - if not isinstance(self.buying_power_script, Unset): - buying_power_script = self.buying_power_script.to_dict() + buying_power_script: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.buying_power_script, Unset) + else self.buying_power_script.to_dict() + ) - clearing_script: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_script, Unset): - clearing_script = self.clearing_script.to_dict() + clearing_script: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.clearing_script, Unset) + else self.clearing_script.to_dict() + ) field_dict: dict[str, Any] = {} @@ -237,18 +249,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: cti_code = d.pop("ctiCode", UNSET) _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) + currency: Unset | Currency = ( + UNSET if isinstance(_currency, Unset) else Currency(_currency) + ) _equities_capacity = d.pop("equitiesCapacity", UNSET) - equities_capacity: Unset | CapacityCode - if isinstance(_equities_capacity, Unset): - equities_capacity = UNSET - else: - equities_capacity = CapacityCode(_equities_capacity) + equities_capacity: Unset | CapacityCode = ( + UNSET + if isinstance(_equities_capacity, Unset) + else CapacityCode(_equities_capacity) + ) equities_give_up = d.pop("equitiesGiveUp", UNSET) @@ -257,11 +267,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: futures_clearing_account = d.pop("futuresClearingAccount", UNSET) _futures_clearing_range = d.pop("futuresClearingRange", UNSET) - futures_clearing_range: Unset | ClearingRange - if isinstance(_futures_clearing_range, Unset): - futures_clearing_range = UNSET - else: - futures_clearing_range = ClearingRange(_futures_clearing_range) + futures_clearing_range: Unset | ClearingRange = ( + UNSET + if isinstance(_futures_clearing_range, Unset) + else ClearingRange(_futures_clearing_range) + ) futures_cmta = d.pop("futuresCmta", UNSET) @@ -274,11 +284,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: options_clearing_account = d.pop("optionsClearingAccount", UNSET) _options_clearing_range = d.pop("optionsClearingRange", UNSET) - options_clearing_range: Unset | ClearingRange - if isinstance(_options_clearing_range, Unset): - options_clearing_range = UNSET - else: - options_clearing_range = ClearingRange(_options_clearing_range) + options_clearing_range: Unset | ClearingRange = ( + UNSET + if isinstance(_options_clearing_range, Unset) + else ClearingRange(_options_clearing_range) + ) options_cmta = d.pop("optionsCmta", UNSET) @@ -296,47 +306,43 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: routing_session_groups.append(routing_session_groups_item) _status = d.pop("status", UNSET) - status: Unset | AccountStatus - if isinstance(_status, Unset): - status = UNSET - else: - status = AccountStatus(_status) + status: Unset | AccountStatus = ( + UNSET if isinstance(_status, Unset) else AccountStatus(_status) + ) tag1 = d.pop("tag1", UNSET) trading_firm_id = d.pop("tradingFirmId", UNSET) _type_ = d.pop("type", UNSET) - type_: Unset | AccountType - if isinstance(_type_, Unset): - type_ = UNSET - else: - type_ = AccountType(_type_) + type_: Unset | AccountType = ( + UNSET if isinstance(_type_, Unset) else AccountType(_type_) + ) created_ts = d.pop("createdTs", UNSET) optional_data = d.pop("optionalData", UNSET) _position_script = d.pop("positionScript", UNSET) - position_script: Unset | AccountScript - if isinstance(_position_script, Unset): - position_script = UNSET - else: - position_script = AccountScript.from_dict(_position_script) + position_script: Unset | AccountScript = ( + UNSET + if isinstance(_position_script, Unset) + else AccountScript.from_dict(_position_script) + ) _buying_power_script = d.pop("buyingPowerScript", UNSET) - buying_power_script: Unset | AccountScript - if isinstance(_buying_power_script, Unset): - buying_power_script = UNSET - else: - buying_power_script = AccountScript.from_dict(_buying_power_script) + buying_power_script: Unset | AccountScript = ( + UNSET + if isinstance(_buying_power_script, Unset) + else AccountScript.from_dict(_buying_power_script) + ) _clearing_script = d.pop("clearingScript", UNSET) - clearing_script: Unset | AccountScript - if isinstance(_clearing_script, Unset): - clearing_script = UNSET - else: - clearing_script = AccountScript.from_dict(_clearing_script) + clearing_script: Unset | AccountScript = ( + UNSET + if isinstance(_clearing_script, Unset) + else AccountScript.from_dict(_clearing_script) + ) account = cls( id=id, diff --git a/openapi_project/openapi_package/models/analyze_positions_response.py b/openapi_project/openapi_package/models/analyze_positions_response.py index 48f11201e..84e614307 100644 --- a/openapi_project/openapi_package/models/analyze_positions_response.py +++ b/openapi_project/openapi_package/models/analyze_positions_response.py @@ -31,15 +31,15 @@ class AnalyzePositionsResponse: status_code: Unset | StatusCode = UNSET def to_dict(self) -> dict[str, Any]: - analysis: Unset | dict[str, Any] = UNSET - if not isinstance(self.analysis, Unset): - analysis = self.analysis.to_dict() + analysis: Unset | dict[str, Any] = ( + UNSET if isinstance(self.analysis, Unset) else self.analysis.to_dict() + ) error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -57,20 +57,18 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _analysis = d.pop("analysis", UNSET) - analysis: Unset | PositionAnalysis - if isinstance(_analysis, Unset): - analysis = UNSET - else: - analysis = PositionAnalysis.from_dict(_analysis) + analysis: Unset | PositionAnalysis = ( + UNSET + if isinstance(_analysis, Unset) + else PositionAnalysis.from_dict(_analysis) + ) error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) analyze_positions_response = cls( analysis=analysis, diff --git a/openapi_project/openapi_package/models/any_model.py b/openapi_project/openapi_package/models/any_model.py index 1d6e8fcbe..a2b504f21 100644 --- a/openapi_project/openapi_package/models/any_model.py +++ b/openapi_project/openapi_package/models/any_model.py @@ -24,7 +24,9 @@ def to_dict(self) -> dict[str, Any]: type_ = self.type_ field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) field_dict.update( { "@type": type_, diff --git a/openapi_project/openapi_package/models/calculate_margin_request.py b/openapi_project/openapi_package/models/calculate_margin_request.py index 7385d21ec..f7c8e6100 100644 --- a/openapi_project/openapi_package/models/calculate_margin_request.py +++ b/openapi_project/openapi_package/models/calculate_margin_request.py @@ -43,9 +43,11 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.account_ids, Unset): account_ids = self.account_ids - margin_data_type: Unset | str = UNSET - if not isinstance(self.margin_data_type, Unset): - margin_data_type = self.margin_data_type.value + margin_data_type: Unset | str = ( + UNSET + if isinstance(self.margin_data_type, Unset) + else self.margin_data_type.value + ) positions_by_account_id: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.positions_by_account_id, Unset): @@ -56,13 +58,13 @@ def to_dict(self) -> dict[str, Any]: ) positions_by_account_id.append(positions_by_account_id_item) - eval_mode: Unset | str = UNSET - if not isinstance(self.eval_mode, Unset): - eval_mode = self.eval_mode.value + eval_mode: Unset | str = ( + UNSET if isinstance(self.eval_mode, Unset) else self.eval_mode.value + ) - source: Unset | str = UNSET - if not isinstance(self.source, Unset): - source = self.source.value + source: Unset | str = ( + UNSET if isinstance(self.source, Unset) else self.source.value + ) field_dict: dict[str, Any] = {} @@ -86,11 +88,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: account_ids = cast(list[int], d.pop("accountIds", UNSET)) _margin_data_type = d.pop("marginDataType", UNSET) - margin_data_type: Unset | MarginDataType - if isinstance(_margin_data_type, Unset): - margin_data_type = UNSET - else: - margin_data_type = MarginDataType(_margin_data_type) + margin_data_type: Unset | MarginDataType = ( + UNSET + if isinstance(_margin_data_type, Unset) + else MarginDataType(_margin_data_type) + ) positions_by_account_id = [] _positions_by_account_id = d.pop("positionsByAccountId", UNSET) @@ -102,18 +104,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: positions_by_account_id.append(positions_by_account_id_item) _eval_mode = d.pop("evalMode", UNSET) - eval_mode: Unset | RiskEvalMode - if isinstance(_eval_mode, Unset): - eval_mode = UNSET - else: - eval_mode = RiskEvalMode(_eval_mode) + eval_mode: Unset | RiskEvalMode = ( + UNSET if isinstance(_eval_mode, Unset) else RiskEvalMode(_eval_mode) + ) _source = d.pop("source", UNSET) - source: Unset | PositionSource - if isinstance(_source, Unset): - source = UNSET - else: - source = PositionSource(_source) + source: Unset | PositionSource = ( + UNSET if isinstance(_source, Unset) else PositionSource(_source) + ) calculate_margin_request = cls( account_ids=account_ids, diff --git a/openapi_project/openapi_package/models/calculate_margin_response.py b/openapi_project/openapi_package/models/calculate_margin_response.py index 243e0b9b4..ba64d05df 100644 --- a/openapi_project/openapi_package/models/calculate_margin_response.py +++ b/openapi_project/openapi_package/models/calculate_margin_response.py @@ -40,9 +40,9 @@ def to_dict(self) -> dict[str, Any]: error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -69,11 +69,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) calculate_margin_response = cls( margin_data=margin_data, diff --git a/openapi_project/openapi_package/models/cancel_order_request.py b/openapi_project/openapi_package/models/cancel_order_request.py index aa256db55..dbd0ebba2 100644 --- a/openapi_project/openapi_package/models/cancel_order_request.py +++ b/openapi_project/openapi_package/models/cancel_order_request.py @@ -46,9 +46,11 @@ def to_dict(self) -> dict[str, Any]: perm_ord_id = self.perm_ord_id - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() + optional_data: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.optional_data, Unset) + else self.optional_data.to_dict() + ) field_dict: dict[str, Any] = {} @@ -79,11 +81,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: perm_ord_id = d.pop("permOrdId", UNSET) _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CancelOrderRequestOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = CancelOrderRequestOptionalData.from_dict(_optional_data) + optional_data: Unset | CancelOrderRequestOptionalData = ( + UNSET + if isinstance(_optional_data, Unset) + else CancelOrderRequestOptionalData.from_dict(_optional_data) + ) cancel_order_request = cls( cur_ord_id=cur_ord_id, diff --git a/openapi_project/openapi_package/models/cancel_order_request_optional_data.py b/openapi_project/openapi_package/models/cancel_order_request_optional_data.py index bf9506da1..76146be2b 100644 --- a/openapi_project/openapi_package/models/cancel_order_request_optional_data.py +++ b/openapi_project/openapi_package/models/cancel_order_request_optional_data.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="CancelOrderRequestOptionalData") - @_attrs_define class CancelOrderRequestOptionalData: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - cancel_order_request_optional_data = cls( - ) - - + cancel_order_request_optional_data = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/cancel_order_response.py b/openapi_project/openapi_package/models/cancel_order_response.py index 5f3530369..5c7913a16 100644 --- a/openapi_project/openapi_package/models/cancel_order_response.py +++ b/openapi_project/openapi_package/models/cancel_order_response.py @@ -35,9 +35,9 @@ def to_dict(self) -> dict[str, Any]: error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -63,11 +63,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) cancel_order_response = cls( submit_ts=submit_ts, diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py index 684177fd7..89a399fed 100644 --- a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py +++ b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py @@ -12,17 +12,17 @@ from typing import cast if TYPE_CHECKING: - from ..models.cancel_replace_multi_leg_order_request_optional_data import ( - CancelReplaceMultiLegOrderRequestOptionalData, - ) from ..models.cancel_replace_multi_leg_order_request_market_condition import ( CancelReplaceMultiLegOrderRequestMarketCondition, ) from ..models.clearing_info import ClearingInfo - from ..models.order_instruction import OrderInstruction + from ..models.cancel_replace_multi_leg_order_request_optional_data import ( + CancelReplaceMultiLegOrderRequestOptionalData, + ) from ..models.cancel_replace_multi_leg_order_request_algo import ( CancelReplaceMultiLegOrderRequestAlgo, ) + from ..models.order_instruction import OrderInstruction T = TypeVar("T", bound="CancelReplaceMultiLegOrderRequest") @@ -66,9 +66,11 @@ class CancelReplaceMultiLegOrderRequest: def to_dict(self) -> dict[str, Any]: aux_price = self.aux_price - clearing_info: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_info, Unset): - clearing_info = self.clearing_info.to_dict() + clearing_info: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.clearing_info, Unset) + else self.clearing_info.to_dict() + ) cur_ord_id = self.cur_ord_id @@ -79,9 +81,9 @@ def to_dict(self) -> dict[str, Any]: instructions_item = instructions_item_data.to_dict() instructions.append(instructions_item) - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value + ord_type: Unset | str = ( + UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value + ) perm_ord_id = self.perm_ord_id @@ -93,21 +95,23 @@ def to_dict(self) -> dict[str, Any]: text = self.text - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value + tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value - algo: Unset | dict[str, Any] = UNSET - if not isinstance(self.algo, Unset): - algo = self.algo.to_dict() + algo: Unset | dict[str, Any] = ( + UNSET if isinstance(self.algo, Unset) else self.algo.to_dict() + ) - market_condition: Unset | dict[str, Any] = UNSET - if not isinstance(self.market_condition, Unset): - market_condition = self.market_condition.to_dict() + market_condition: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.market_condition, Unset) + else self.market_condition.to_dict() + ) - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() + optional_data: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.optional_data, Unset) + else self.optional_data.to_dict() + ) field_dict: dict[str, Any] = {} @@ -149,11 +153,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: aux_price = d.pop("auxPrice", UNSET) _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo - if isinstance(_clearing_info, Unset): - clearing_info = UNSET - else: - clearing_info = ClearingInfo.from_dict(_clearing_info) + clearing_info: Unset | ClearingInfo = ( + UNSET + if isinstance(_clearing_info, Unset) + else ClearingInfo.from_dict(_clearing_info) + ) cur_ord_id = d.pop("curOrdId", UNSET) @@ -165,11 +169,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: instructions.append(instructions_item) _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) + ord_type: Unset | OrdType = ( + UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) + ) perm_ord_id = d.pop("permOrdId", UNSET) @@ -182,38 +184,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: text = d.pop("text", UNSET) _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) + tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) _algo = d.pop("algo", UNSET) - algo: Unset | CancelReplaceMultiLegOrderRequestAlgo - if isinstance(_algo, Unset): - algo = UNSET - else: - algo = CancelReplaceMultiLegOrderRequestAlgo.from_dict(_algo) + algo: Unset | CancelReplaceMultiLegOrderRequestAlgo = ( + UNSET + if isinstance(_algo, Unset) + else CancelReplaceMultiLegOrderRequestAlgo.from_dict(_algo) + ) _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | CancelReplaceMultiLegOrderRequestMarketCondition - if isinstance(_market_condition, Unset): - market_condition = UNSET - else: - market_condition = ( - CancelReplaceMultiLegOrderRequestMarketCondition.from_dict( - _market_condition - ) + market_condition: Unset | CancelReplaceMultiLegOrderRequestMarketCondition = ( + UNSET + if isinstance(_market_condition, Unset) + else CancelReplaceMultiLegOrderRequestMarketCondition.from_dict( + _market_condition ) + ) _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CancelReplaceMultiLegOrderRequestOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = CancelReplaceMultiLegOrderRequestOptionalData.from_dict( - _optional_data - ) + optional_data: Unset | CancelReplaceMultiLegOrderRequestOptionalData = ( + UNSET + if isinstance(_optional_data, Unset) + else CancelReplaceMultiLegOrderRequestOptionalData.from_dict(_optional_data) + ) cancel_replace_multi_leg_order_request = cls( aux_price=aux_price, diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py index 0772e27de..89499f435 100644 --- a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py +++ b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="CancelReplaceMultiLegOrderRequestAlgo") - @_attrs_define class CancelReplaceMultiLegOrderRequestAlgo: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - cancel_replace_multi_leg_order_request_algo = cls( - ) - - + cancel_replace_multi_leg_order_request_algo = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - cancel_replace_multi_leg_order_request_algo.additional_properties = additional_properties + cancel_replace_multi_leg_order_request_algo.additional_properties = ( + additional_properties + ) return cancel_replace_multi_leg_order_request_algo @property diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py index 427fe102b..7149d8ebb 100644 --- a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py +++ b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="CancelReplaceMultiLegOrderRequestMarketCondition") - @_attrs_define class CancelReplaceMultiLegOrderRequestMarketCondition: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - cancel_replace_multi_leg_order_request_market_condition = cls( - ) - - + cancel_replace_multi_leg_order_request_market_condition = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - cancel_replace_multi_leg_order_request_market_condition.additional_properties = additional_properties + cancel_replace_multi_leg_order_request_market_condition.additional_properties = ( + additional_properties + ) return cancel_replace_multi_leg_order_request_market_condition @property diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py index 72cdd8514..72978ff80 100644 --- a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py +++ b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="CancelReplaceMultiLegOrderRequestOptionalData") - @_attrs_define class CancelReplaceMultiLegOrderRequestOptionalData: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - cancel_replace_multi_leg_order_request_optional_data = cls( - ) - - + cancel_replace_multi_leg_order_request_optional_data = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - cancel_replace_multi_leg_order_request_optional_data.additional_properties = additional_properties + cancel_replace_multi_leg_order_request_optional_data.additional_properties = ( + additional_properties + ) return cancel_replace_multi_leg_order_request_optional_data @property diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py index 8c1b20d53..b3a82aae5 100644 --- a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py +++ b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py @@ -35,9 +35,9 @@ def to_dict(self) -> dict[str, Any]: error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -63,11 +63,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) cancel_replace_multi_leg_order_response = cls( submit_ts=submit_ts, diff --git a/openapi_project/openapi_package/models/cancel_replace_order_request.py b/openapi_project/openapi_package/models/cancel_replace_order_request.py index b7e7f1bd8..033da208b 100644 --- a/openapi_project/openapi_package/models/cancel_replace_order_request.py +++ b/openapi_project/openapi_package/models/cancel_replace_order_request.py @@ -12,15 +12,15 @@ from typing import cast if TYPE_CHECKING: - from ..models.cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo + from ..models.cancel_replace_order_request_market_condition import ( + CancelReplaceOrderRequestMarketCondition, + ) + from ..models.clearing_info import ClearingInfo from ..models.cancel_replace_order_request_optional_data import ( CancelReplaceOrderRequestOptionalData, ) - from ..models.clearing_info import ClearingInfo + from ..models.cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo from ..models.order_instruction import OrderInstruction - from ..models.cancel_replace_order_request_market_condition import ( - CancelReplaceOrderRequestMarketCondition, - ) T = TypeVar("T", bound="CancelReplaceOrderRequest") @@ -60,9 +60,11 @@ class CancelReplaceOrderRequest: def to_dict(self) -> dict[str, Any]: aux_price = self.aux_price - clearing_info: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_info, Unset): - clearing_info = self.clearing_info.to_dict() + clearing_info: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.clearing_info, Unset) + else self.clearing_info.to_dict() + ) cur_ord_id = self.cur_ord_id @@ -73,9 +75,9 @@ def to_dict(self) -> dict[str, Any]: instructions_item = instructions_item_data.to_dict() instructions.append(instructions_item) - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value + ord_type: Unset | str = ( + UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value + ) perm_ord_id = self.perm_ord_id @@ -83,21 +85,23 @@ def to_dict(self) -> dict[str, Any]: qty = self.qty - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value + tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value - algo: Unset | dict[str, Any] = UNSET - if not isinstance(self.algo, Unset): - algo = self.algo.to_dict() + algo: Unset | dict[str, Any] = ( + UNSET if isinstance(self.algo, Unset) else self.algo.to_dict() + ) - market_condition: Unset | dict[str, Any] = UNSET - if not isinstance(self.market_condition, Unset): - market_condition = self.market_condition.to_dict() + market_condition: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.market_condition, Unset) + else self.market_condition.to_dict() + ) - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() + optional_data: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.optional_data, Unset) + else self.optional_data.to_dict() + ) field_dict: dict[str, Any] = {} @@ -135,11 +139,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: aux_price = d.pop("auxPrice", UNSET) _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo - if isinstance(_clearing_info, Unset): - clearing_info = UNSET - else: - clearing_info = ClearingInfo.from_dict(_clearing_info) + clearing_info: Unset | ClearingInfo = ( + UNSET + if isinstance(_clearing_info, Unset) + else ClearingInfo.from_dict(_clearing_info) + ) cur_ord_id = d.pop("curOrdId", UNSET) @@ -151,11 +155,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: instructions.append(instructions_item) _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) + ord_type: Unset | OrdType = ( + UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) + ) perm_ord_id = d.pop("permOrdId", UNSET) @@ -164,36 +166,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: qty = d.pop("qty", UNSET) _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) + tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) _algo = d.pop("algo", UNSET) - algo: Unset | CancelReplaceOrderRequestAlgo - if isinstance(_algo, Unset): - algo = UNSET - else: - algo = CancelReplaceOrderRequestAlgo.from_dict(_algo) + algo: Unset | CancelReplaceOrderRequestAlgo = ( + UNSET + if isinstance(_algo, Unset) + else CancelReplaceOrderRequestAlgo.from_dict(_algo) + ) _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | CancelReplaceOrderRequestMarketCondition - if isinstance(_market_condition, Unset): - market_condition = UNSET - else: - market_condition = CancelReplaceOrderRequestMarketCondition.from_dict( - _market_condition - ) + market_condition: Unset | CancelReplaceOrderRequestMarketCondition = ( + UNSET + if isinstance(_market_condition, Unset) + else CancelReplaceOrderRequestMarketCondition.from_dict(_market_condition) + ) _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CancelReplaceOrderRequestOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = CancelReplaceOrderRequestOptionalData.from_dict( - _optional_data - ) + optional_data: Unset | CancelReplaceOrderRequestOptionalData = ( + UNSET + if isinstance(_optional_data, Unset) + else CancelReplaceOrderRequestOptionalData.from_dict(_optional_data) + ) cancel_replace_order_request = cls( aux_price=aux_price, diff --git a/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py b/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py index a8b354b68..904301af0 100644 --- a/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py +++ b/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="CancelReplaceOrderRequestAlgo") - @_attrs_define class CancelReplaceOrderRequestAlgo: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - cancel_replace_order_request_algo = cls( - ) - - + cancel_replace_order_request_algo = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py b/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py index 07413494e..0be4b7916 100644 --- a/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py +++ b/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="CancelReplaceOrderRequestMarketCondition") - @_attrs_define class CancelReplaceOrderRequestMarketCondition: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - cancel_replace_order_request_market_condition = cls( - ) - - + cancel_replace_order_request_market_condition = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - cancel_replace_order_request_market_condition.additional_properties = additional_properties + cancel_replace_order_request_market_condition.additional_properties = ( + additional_properties + ) return cancel_replace_order_request_market_condition @property diff --git a/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py b/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py index 83f274703..ceddb6b08 100644 --- a/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py +++ b/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="CancelReplaceOrderRequestOptionalData") - @_attrs_define class CancelReplaceOrderRequestOptionalData: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - cancel_replace_order_request_optional_data = cls( - ) - - + cancel_replace_order_request_optional_data = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - cancel_replace_order_request_optional_data.additional_properties = additional_properties + cancel_replace_order_request_optional_data.additional_properties = ( + additional_properties + ) return cancel_replace_order_request_optional_data @property diff --git a/openapi_project/openapi_package/models/cancel_replace_order_response.py b/openapi_project/openapi_package/models/cancel_replace_order_response.py index 3770d87b5..4120cc943 100644 --- a/openapi_project/openapi_package/models/cancel_replace_order_response.py +++ b/openapi_project/openapi_package/models/cancel_replace_order_response.py @@ -35,9 +35,9 @@ def to_dict(self) -> dict[str, Any]: error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -63,11 +63,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) cancel_replace_order_response = cls( submit_ts=submit_ts, diff --git a/openapi_project/openapi_package/models/clearing_info.py b/openapi_project/openapi_package/models/clearing_info.py index b084174fe..efaf6a4c8 100644 --- a/openapi_project/openapi_package/models/clearing_info.py +++ b/openapi_project/openapi_package/models/clearing_info.py @@ -64,9 +64,9 @@ def to_dict(self) -> dict[str, Any]: efid = self.efid - eq_capacity: Unset | str = UNSET - if not isinstance(self.eq_capacity, Unset): - eq_capacity = self.eq_capacity.value + eq_capacity: Unset | str = ( + UNSET if isinstance(self.eq_capacity, Unset) else self.eq_capacity.value + ) eq_clearing_account = self.eq_clearing_account @@ -76,9 +76,11 @@ def to_dict(self) -> dict[str, Any]: fut_clearing_account = self.fut_clearing_account - fut_clearing_range: Unset | str = UNSET - if not isinstance(self.fut_clearing_range, Unset): - fut_clearing_range = self.fut_clearing_range.value + fut_clearing_range: Unset | str = ( + UNSET + if isinstance(self.fut_clearing_range, Unset) + else self.fut_clearing_range.value + ) fut_cmta = self.fut_cmta @@ -88,9 +90,11 @@ def to_dict(self) -> dict[str, Any]: opt_clearing_account = self.opt_clearing_account - opt_clearing_range: Unset | str = UNSET - if not isinstance(self.opt_clearing_range, Unset): - opt_clearing_range = self.opt_clearing_range.value + opt_clearing_range: Unset | str = ( + UNSET + if isinstance(self.opt_clearing_range, Unset) + else self.opt_clearing_range.value + ) opt_cmta = self.opt_cmta @@ -152,11 +156,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: efid = d.pop("efid", UNSET) _eq_capacity = d.pop("eqCapacity", UNSET) - eq_capacity: Unset | CapacityCode - if isinstance(_eq_capacity, Unset): - eq_capacity = UNSET - else: - eq_capacity = CapacityCode(_eq_capacity) + eq_capacity: Unset | CapacityCode = ( + UNSET if isinstance(_eq_capacity, Unset) else CapacityCode(_eq_capacity) + ) eq_clearing_account = d.pop("eqClearingAccount", UNSET) @@ -167,11 +169,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: fut_clearing_account = d.pop("futClearingAccount", UNSET) _fut_clearing_range = d.pop("futClearingRange", UNSET) - fut_clearing_range: Unset | ClearingRange - if isinstance(_fut_clearing_range, Unset): - fut_clearing_range = UNSET - else: - fut_clearing_range = ClearingRange(_fut_clearing_range) + fut_clearing_range: Unset | ClearingRange = ( + UNSET + if isinstance(_fut_clearing_range, Unset) + else ClearingRange(_fut_clearing_range) + ) fut_cmta = d.pop("futCmta", UNSET) @@ -182,11 +184,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: opt_clearing_account = d.pop("optClearingAccount", UNSET) _opt_clearing_range = d.pop("optClearingRange", UNSET) - opt_clearing_range: Unset | ClearingRange - if isinstance(_opt_clearing_range, Unset): - opt_clearing_range = UNSET - else: - opt_clearing_range = ClearingRange(_opt_clearing_range) + opt_clearing_range: Unset | ClearingRange = ( + UNSET + if isinstance(_opt_clearing_range, Unset) + else ClearingRange(_opt_clearing_range) + ) opt_cmta = d.pop("optCmta", UNSET) diff --git a/openapi_project/openapi_package/models/create_flex_option_request.py b/openapi_project/openapi_package/models/create_flex_option_request.py index 71b35e8d9..8e167e25d 100644 --- a/openapi_project/openapi_package/models/create_flex_option_request.py +++ b/openapi_project/openapi_package/models/create_flex_option_request.py @@ -52,31 +52,37 @@ class CreateFlexOptionRequest: def to_dict(self) -> dict[str, Any]: root_symbol = self.root_symbol - settlement_type: Unset | str = UNSET - if not isinstance(self.settlement_type, Unset): - settlement_type = self.settlement_type.value + settlement_type: Unset | str = ( + UNSET + if isinstance(self.settlement_type, Unset) + else self.settlement_type.value + ) - expiration_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.expiration_dt, Unset): - expiration_dt = self.expiration_dt.to_dict() + expiration_dt: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.expiration_dt, Unset) + else self.expiration_dt.to_dict() + ) strike = self.strike - put_call: Unset | str = UNSET - if not isinstance(self.put_call, Unset): - put_call = self.put_call.value + put_call: Unset | str = ( + UNSET if isinstance(self.put_call, Unset) else self.put_call.value + ) - product_type: Unset | str = UNSET - if not isinstance(self.product_type, Unset): - product_type = self.product_type.value + product_type: Unset | str = ( + UNSET if isinstance(self.product_type, Unset) else self.product_type.value + ) - exercise_style: Unset | str = UNSET - if not isinstance(self.exercise_style, Unset): - exercise_style = self.exercise_style.value + exercise_style: Unset | str = ( + UNSET + if isinstance(self.exercise_style, Unset) + else self.exercise_style.value + ) - creation_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.creation_dt, Unset): - creation_dt = self.creation_dt.to_dict() + creation_dt: Unset | dict[str, Any] = ( + UNSET if isinstance(self.creation_dt, Unset) else self.creation_dt.to_dict() + ) observation_day = self.observation_day @@ -118,48 +124,44 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: root_symbol = d.pop("rootSymbol", UNSET) _settlement_type = d.pop("settlementType", UNSET) - settlement_type: Unset | FlexSettlementType - if isinstance(_settlement_type, Unset): - settlement_type = UNSET - else: - settlement_type = FlexSettlementType(_settlement_type) + settlement_type: Unset | FlexSettlementType = ( + UNSET + if isinstance(_settlement_type, Unset) + else FlexSettlementType(_settlement_type) + ) _expiration_dt = d.pop("expirationDt", UNSET) - expiration_dt: Unset | Date - if isinstance(_expiration_dt, Unset): - expiration_dt = UNSET - else: - expiration_dt = Date.from_dict(_expiration_dt) + expiration_dt: Unset | Date = ( + UNSET + if isinstance(_expiration_dt, Unset) + else Date.from_dict(_expiration_dt) + ) strike = d.pop("strike", UNSET) _put_call = d.pop("putCall", UNSET) - put_call: Unset | PutCall - if isinstance(_put_call, Unset): - put_call = UNSET - else: - put_call = PutCall(_put_call) + put_call: Unset | PutCall = ( + UNSET if isinstance(_put_call, Unset) else PutCall(_put_call) + ) _product_type = d.pop("productType", UNSET) - product_type: Unset | OptionSeriesProductType - if isinstance(_product_type, Unset): - product_type = UNSET - else: - product_type = OptionSeriesProductType(_product_type) + product_type: Unset | OptionSeriesProductType = ( + UNSET + if isinstance(_product_type, Unset) + else OptionSeriesProductType(_product_type) + ) _exercise_style = d.pop("exerciseStyle", UNSET) - exercise_style: Unset | OptionExerciseStyle - if isinstance(_exercise_style, Unset): - exercise_style = UNSET - else: - exercise_style = OptionExerciseStyle(_exercise_style) + exercise_style: Unset | OptionExerciseStyle = ( + UNSET + if isinstance(_exercise_style, Unset) + else OptionExerciseStyle(_exercise_style) + ) _creation_dt = d.pop("creationDt", UNSET) - creation_dt: Unset | Date - if isinstance(_creation_dt, Unset): - creation_dt = UNSET - else: - creation_dt = Date.from_dict(_creation_dt) + creation_dt: Unset | Date = ( + UNSET if isinstance(_creation_dt, Unset) else Date.from_dict(_creation_dt) + ) observation_day = d.pop("observationDay", UNSET) diff --git a/openapi_project/openapi_package/models/create_flex_option_response.py b/openapi_project/openapi_package/models/create_flex_option_response.py index 4ac0360ba..a5a6264c8 100644 --- a/openapi_project/openapi_package/models/create_flex_option_response.py +++ b/openapi_project/openapi_package/models/create_flex_option_response.py @@ -31,15 +31,15 @@ class CreateFlexOptionResponse: status_code: Unset | StatusCode = UNSET def to_dict(self) -> dict[str, Any]: - flex_option: Unset | dict[str, Any] = UNSET - if not isinstance(self.flex_option, Unset): - flex_option = self.flex_option.to_dict() + flex_option: Unset | dict[str, Any] = ( + UNSET if isinstance(self.flex_option, Unset) else self.flex_option.to_dict() + ) error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -57,20 +57,18 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _flex_option = d.pop("flexOption", UNSET) - flex_option: Unset | FlexOption - if isinstance(_flex_option, Unset): - flex_option = UNSET - else: - flex_option = FlexOption.from_dict(_flex_option) + flex_option: Unset | FlexOption = ( + UNSET + if isinstance(_flex_option, Unset) + else FlexOption.from_dict(_flex_option) + ) error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) create_flex_option_response = cls( flex_option=flex_option, diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py index aaa944165..ab079dd36 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py @@ -11,12 +11,12 @@ from typing import cast if TYPE_CHECKING: - from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg from ..models.create_multi_leg_order_cross_allocation_optional_data import ( CreateMultiLegOrderCrossAllocationOptionalData, ) - from ..models.order_instruction import OrderInstruction + from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg from ..models.clearing_info import ClearingInfo + from ..models.order_instruction import OrderInstruction T = TypeVar("T", bound="CreateMultiLegOrderCrossAllocation") @@ -46,9 +46,11 @@ class CreateMultiLegOrderCrossAllocation: def to_dict(self) -> dict[str, Any]: account_id = self.account_id - clearing_info: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_info, Unset): - clearing_info = self.clearing_info.to_dict() + clearing_info: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.clearing_info, Unset) + else self.clearing_info.to_dict() + ) instructions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.instructions, Unset): @@ -64,15 +66,17 @@ def to_dict(self) -> dict[str, Any]: legs_item = legs_item_data.to_dict() legs.append(legs_item) - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() + optional_data: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.optional_data, Unset) + else self.optional_data.to_dict() + ) qty = self.qty - side_type: Unset | str = UNSET - if not isinstance(self.side_type, Unset): - side_type = self.side_type.value + side_type: Unset | str = ( + UNSET if isinstance(self.side_type, Unset) else self.side_type.value + ) field_dict: dict[str, Any] = {} @@ -100,11 +104,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: account_id = d.pop("accountId", UNSET) _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo - if isinstance(_clearing_info, Unset): - clearing_info = UNSET - else: - clearing_info = ClearingInfo.from_dict(_clearing_info) + clearing_info: Unset | ClearingInfo = ( + UNSET + if isinstance(_clearing_info, Unset) + else ClearingInfo.from_dict(_clearing_info) + ) instructions = [] _instructions = d.pop("instructions", UNSET) @@ -121,22 +125,20 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: legs.append(legs_item) _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CreateMultiLegOrderCrossAllocationOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = CreateMultiLegOrderCrossAllocationOptionalData.from_dict( + optional_data: Unset | CreateMultiLegOrderCrossAllocationOptionalData = ( + UNSET + if isinstance(_optional_data, Unset) + else CreateMultiLegOrderCrossAllocationOptionalData.from_dict( _optional_data ) + ) qty = d.pop("qty", UNSET) _side_type = d.pop("sideType", UNSET) - side_type: Unset | CrossSideType - if isinstance(_side_type, Unset): - side_type = UNSET - else: - side_type = CrossSideType(_side_type) + side_type: Unset | CrossSideType = ( + UNSET if isinstance(_side_type, Unset) else CrossSideType(_side_type) + ) create_multi_leg_order_cross_allocation = cls( account_id=account_id, diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py index 823613875..13ff43297 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="CreateMultiLegOrderCrossAllocationOptionalData") - @_attrs_define class CreateMultiLegOrderCrossAllocationOptionalData: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - create_multi_leg_order_cross_allocation_optional_data = cls( - ) - - + create_multi_leg_order_cross_allocation_optional_data = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - create_multi_leg_order_cross_allocation_optional_data.additional_properties = additional_properties + create_multi_leg_order_cross_allocation_optional_data.additional_properties = ( + additional_properties + ) return create_multi_leg_order_cross_allocation_optional_data @property diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py index caa8f8b9c..11ceeb085 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py @@ -14,17 +14,17 @@ from typing import cast if TYPE_CHECKING: - from ..models.create_multi_leg_order_cross_request_algo import ( - CreateMultiLegOrderCrossRequestAlgo, - ) from ..models.create_multi_leg_order_cross_request_optional_data import ( CreateMultiLegOrderCrossRequestOptionalData, ) + from ..models.create_multi_leg_order_cross_allocation import ( + CreateMultiLegOrderCrossAllocation, + ) from ..models.create_multi_leg_order_cross_request_market_condition import ( CreateMultiLegOrderCrossRequestMarketCondition, ) - from ..models.create_multi_leg_order_cross_allocation import ( - CreateMultiLegOrderCrossAllocation, + from ..models.create_multi_leg_order_cross_request_algo import ( + CreateMultiLegOrderCrossRequestAlgo, ) from ..models.order_instruction import OrderInstruction @@ -83,9 +83,9 @@ def to_dict(self) -> dict[str, Any]: allocations_item = allocations_item_data.to_dict() allocations.append(allocations_item) - cross_type: Unset | str = UNSET - if not isinstance(self.cross_type, Unset): - cross_type = self.cross_type.value + cross_type: Unset | str = ( + UNSET if isinstance(self.cross_type, Unset) else self.cross_type.value + ) instructions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.instructions, Unset): @@ -94,9 +94,9 @@ def to_dict(self) -> dict[str, Any]: instructions_item = instructions_item_data.to_dict() instructions.append(instructions_item) - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value + ord_type: Unset | str = ( + UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value + ) order_flags = self.order_flags @@ -104,9 +104,9 @@ def to_dict(self) -> dict[str, Any]: price = self.price - price_type: Unset | str = UNSET - if not isinstance(self.price_type, Unset): - price_type = self.price_type.value + price_type: Unset | str = ( + UNSET if isinstance(self.price_type, Unset) else self.price_type.value + ) qty = self.qty @@ -116,21 +116,23 @@ def to_dict(self) -> dict[str, Any]: text = self.text - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value + tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value - algo: Unset | dict[str, Any] = UNSET - if not isinstance(self.algo, Unset): - algo = self.algo.to_dict() + algo: Unset | dict[str, Any] = ( + UNSET if isinstance(self.algo, Unset) else self.algo.to_dict() + ) - market_condition: Unset | dict[str, Any] = UNSET - if not isinstance(self.market_condition, Unset): - market_condition = self.market_condition.to_dict() + market_condition: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.market_condition, Unset) + else self.market_condition.to_dict() + ) - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() + optional_data: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.optional_data, Unset) + else self.optional_data.to_dict() + ) field_dict: dict[str, Any] = {} @@ -187,11 +189,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: allocations.append(allocations_item) _cross_type = d.pop("crossType", UNSET) - cross_type: Unset | CrossType - if isinstance(_cross_type, Unset): - cross_type = UNSET - else: - cross_type = CrossType(_cross_type) + cross_type: Unset | CrossType = ( + UNSET if isinstance(_cross_type, Unset) else CrossType(_cross_type) + ) instructions = [] _instructions = d.pop("instructions", UNSET) @@ -201,11 +201,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: instructions.append(instructions_item) _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) + ord_type: Unset | OrdType = ( + UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) + ) order_flags = d.pop("orderFlags", UNSET) @@ -214,11 +212,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: price = d.pop("price", UNSET) _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType - if isinstance(_price_type, Unset): - price_type = UNSET - else: - price_type = PriceType(_price_type) + price_type: Unset | PriceType = ( + UNSET if isinstance(_price_type, Unset) else PriceType(_price_type) + ) qty = d.pop("qty", UNSET) @@ -229,36 +225,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: text = d.pop("text", UNSET) _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) + tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) _algo = d.pop("algo", UNSET) - algo: Unset | CreateMultiLegOrderCrossRequestAlgo - if isinstance(_algo, Unset): - algo = UNSET - else: - algo = CreateMultiLegOrderCrossRequestAlgo.from_dict(_algo) + algo: Unset | CreateMultiLegOrderCrossRequestAlgo = ( + UNSET + if isinstance(_algo, Unset) + else CreateMultiLegOrderCrossRequestAlgo.from_dict(_algo) + ) _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | CreateMultiLegOrderCrossRequestMarketCondition - if isinstance(_market_condition, Unset): - market_condition = UNSET - else: - market_condition = CreateMultiLegOrderCrossRequestMarketCondition.from_dict( + market_condition: Unset | CreateMultiLegOrderCrossRequestMarketCondition = ( + UNSET + if isinstance(_market_condition, Unset) + else CreateMultiLegOrderCrossRequestMarketCondition.from_dict( _market_condition ) + ) _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CreateMultiLegOrderCrossRequestOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = CreateMultiLegOrderCrossRequestOptionalData.from_dict( - _optional_data - ) + optional_data: Unset | CreateMultiLegOrderCrossRequestOptionalData = ( + UNSET + if isinstance(_optional_data, Unset) + else CreateMultiLegOrderCrossRequestOptionalData.from_dict(_optional_data) + ) create_multi_leg_order_cross_request = cls( account_id=account_id, diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py index 6da95252a..120285451 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="CreateMultiLegOrderCrossRequestAlgo") - @_attrs_define class CreateMultiLegOrderCrossRequestAlgo: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - create_multi_leg_order_cross_request_algo = cls( - ) - - + create_multi_leg_order_cross_request_algo = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - create_multi_leg_order_cross_request_algo.additional_properties = additional_properties + create_multi_leg_order_cross_request_algo.additional_properties = ( + additional_properties + ) return create_multi_leg_order_cross_request_algo @property diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py index 20c15d2b6..238736536 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="CreateMultiLegOrderCrossRequestMarketCondition") - @_attrs_define class CreateMultiLegOrderCrossRequestMarketCondition: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - create_multi_leg_order_cross_request_market_condition = cls( - ) - - + create_multi_leg_order_cross_request_market_condition = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - create_multi_leg_order_cross_request_market_condition.additional_properties = additional_properties + create_multi_leg_order_cross_request_market_condition.additional_properties = ( + additional_properties + ) return create_multi_leg_order_cross_request_market_condition @property diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py index f438de801..642690184 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="CreateMultiLegOrderCrossRequestOptionalData") - @_attrs_define class CreateMultiLegOrderCrossRequestOptionalData: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - create_multi_leg_order_cross_request_optional_data = cls( - ) - - + create_multi_leg_order_cross_request_optional_data = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - create_multi_leg_order_cross_request_optional_data.additional_properties = additional_properties + create_multi_leg_order_cross_request_optional_data.additional_properties = ( + additional_properties + ) return create_multi_leg_order_cross_request_optional_data @property diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py index 95470cb1e..25e734b1d 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py @@ -31,15 +31,17 @@ class CreateMultiLegOrderCrossResponse: status_code: Unset | StatusCode = UNSET def to_dict(self) -> dict[str, Any]: - multi_leg_order_cross: Unset | dict[str, Any] = UNSET - if not isinstance(self.multi_leg_order_cross, Unset): - multi_leg_order_cross = self.multi_leg_order_cross.to_dict() + multi_leg_order_cross: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.multi_leg_order_cross, Unset) + else self.multi_leg_order_cross.to_dict() + ) error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -57,20 +59,18 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _multi_leg_order_cross = d.pop("multiLegOrderCross", UNSET) - multi_leg_order_cross: Unset | MultiLegOrderCross - if isinstance(_multi_leg_order_cross, Unset): - multi_leg_order_cross = UNSET - else: - multi_leg_order_cross = MultiLegOrderCross.from_dict(_multi_leg_order_cross) + multi_leg_order_cross: Unset | MultiLegOrderCross = ( + UNSET + if isinstance(_multi_leg_order_cross, Unset) + else MultiLegOrderCross.from_dict(_multi_leg_order_cross) + ) error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) create_multi_leg_order_cross_response = cls( multi_leg_order_cross=multi_leg_order_cross, diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_leg.py b/openapi_project/openapi_package/models/create_multi_leg_order_leg.py index f6b1cbd71..0a9beba3e 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_leg.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_leg.py @@ -12,13 +12,13 @@ from typing import cast if TYPE_CHECKING: - from ..models.create_multi_leg_order_leg_optional_data import ( - CreateMultiLegOrderLegOptionalData, - ) - from ..models.flex_option import FlexOption from ..models.create_multi_leg_order_leg_market_condition import ( CreateMultiLegOrderLegMarketCondition, ) + from ..models.flex_option import FlexOption + from ..models.create_multi_leg_order_leg_optional_data import ( + CreateMultiLegOrderLegOptionalData, + ) T = TypeVar("T", bound="CreateMultiLegOrderLeg") @@ -48,31 +48,35 @@ class CreateMultiLegOrderLeg: flex_option: Unset | "FlexOption" = UNSET def to_dict(self) -> dict[str, Any]: - position_effect: Unset | str = UNSET - if not isinstance(self.position_effect, Unset): - position_effect = self.position_effect.value + position_effect: Unset | str = ( + UNSET + if isinstance(self.position_effect, Unset) + else self.position_effect.value + ) price = self.price ratio = self.ratio - side: Unset | str = UNSET - if not isinstance(self.side, Unset): - side = self.side.value + side: Unset | str = UNSET if isinstance(self.side, Unset) else self.side.value symbol = self.symbol - market_condition: Unset | dict[str, Any] = UNSET - if not isinstance(self.market_condition, Unset): - market_condition = self.market_condition.to_dict() + market_condition: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.market_condition, Unset) + else self.market_condition.to_dict() + ) - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() + optional_data: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.optional_data, Unset) + else self.optional_data.to_dict() + ) - flex_option: Unset | dict[str, Any] = UNSET - if not isinstance(self.flex_option, Unset): - flex_option = self.flex_option.to_dict() + flex_option: Unset | dict[str, Any] = ( + UNSET if isinstance(self.flex_option, Unset) else self.flex_option.to_dict() + ) field_dict: dict[str, Any] = {} @@ -100,47 +104,41 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _position_effect = d.pop("positionEffect", UNSET) - position_effect: Unset | PositionEffect - if isinstance(_position_effect, Unset): - position_effect = UNSET - else: - position_effect = PositionEffect(_position_effect) + position_effect: Unset | PositionEffect = ( + UNSET + if isinstance(_position_effect, Unset) + else PositionEffect(_position_effect) + ) price = d.pop("price", UNSET) ratio = d.pop("ratio", UNSET) _side = d.pop("side", UNSET) - side: Unset | Side - if isinstance(_side, Unset): - side = UNSET - else: - side = Side(_side) + side: Unset | Side = UNSET if isinstance(_side, Unset) else Side(_side) symbol = d.pop("symbol", UNSET) _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | CreateMultiLegOrderLegMarketCondition - if isinstance(_market_condition, Unset): - market_condition = UNSET - else: - market_condition = CreateMultiLegOrderLegMarketCondition.from_dict( - _market_condition - ) + market_condition: Unset | CreateMultiLegOrderLegMarketCondition = ( + UNSET + if isinstance(_market_condition, Unset) + else CreateMultiLegOrderLegMarketCondition.from_dict(_market_condition) + ) _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CreateMultiLegOrderLegOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = CreateMultiLegOrderLegOptionalData.from_dict(_optional_data) + optional_data: Unset | CreateMultiLegOrderLegOptionalData = ( + UNSET + if isinstance(_optional_data, Unset) + else CreateMultiLegOrderLegOptionalData.from_dict(_optional_data) + ) _flex_option = d.pop("flexOption", UNSET) - flex_option: Unset | FlexOption - if isinstance(_flex_option, Unset): - flex_option = UNSET - else: - flex_option = FlexOption.from_dict(_flex_option) + flex_option: Unset | FlexOption = ( + UNSET + if isinstance(_flex_option, Unset) + else FlexOption.from_dict(_flex_option) + ) create_multi_leg_order_leg = cls( position_effect=position_effect, diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py b/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py index d3be82cf0..477f5ecf8 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="CreateMultiLegOrderLegMarketCondition") - @_attrs_define class CreateMultiLegOrderLegMarketCondition: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - create_multi_leg_order_leg_market_condition = cls( - ) - - + create_multi_leg_order_leg_market_condition = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - create_multi_leg_order_leg_market_condition.additional_properties = additional_properties + create_multi_leg_order_leg_market_condition.additional_properties = ( + additional_properties + ) return create_multi_leg_order_leg_market_condition @property diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py b/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py index d95403b37..beaca4ed0 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="CreateMultiLegOrderLegOptionalData") - @_attrs_define class CreateMultiLegOrderLegOptionalData: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - create_multi_leg_order_leg_optional_data = cls( - ) - - + create_multi_leg_order_leg_optional_data = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - create_multi_leg_order_leg_optional_data.additional_properties = additional_properties + create_multi_leg_order_leg_optional_data.additional_properties = ( + additional_properties + ) return create_multi_leg_order_leg_optional_data @property diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_request.py b/openapi_project/openapi_package/models/create_multi_leg_order_request.py index 62b2277b5..95eee7cb4 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_request.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_request.py @@ -13,18 +13,18 @@ from typing import cast if TYPE_CHECKING: - from ..models.create_multi_leg_order_request_algo import ( - CreateMultiLegOrderRequestAlgo, - ) + from ..models.clearing_info import ClearingInfo from ..models.create_multi_leg_order_request_optional_data import ( CreateMultiLegOrderRequestOptionalData, ) - from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg - from ..models.clearing_info import ClearingInfo - from ..models.order_instruction import OrderInstruction from ..models.create_multi_leg_order_request_market_condition import ( CreateMultiLegOrderRequestMarketCondition, ) + from ..models.create_multi_leg_order_request_algo import ( + CreateMultiLegOrderRequestAlgo, + ) + from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg + from ..models.order_instruction import OrderInstruction T = TypeVar("T", bound="CreateMultiLegOrderRequest") @@ -78,9 +78,11 @@ def to_dict(self) -> dict[str, Any]: aux_price = self.aux_price - clearing_info: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_info, Unset): - clearing_info = self.clearing_info.to_dict() + clearing_info: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.clearing_info, Unset) + else self.clearing_info.to_dict() + ) instructions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.instructions, Unset): @@ -96,9 +98,9 @@ def to_dict(self) -> dict[str, Any]: legs_item = legs_item_data.to_dict() legs.append(legs_item) - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value + ord_type: Unset | str = ( + UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value + ) order_flags = self.order_flags @@ -106,9 +108,9 @@ def to_dict(self) -> dict[str, Any]: price = self.price - price_type: Unset | str = UNSET - if not isinstance(self.price_type, Unset): - price_type = self.price_type.value + price_type: Unset | str = ( + UNSET if isinstance(self.price_type, Unset) else self.price_type.value + ) qty = self.qty @@ -118,21 +120,23 @@ def to_dict(self) -> dict[str, Any]: text = self.text - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value + tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value - algo: Unset | dict[str, Any] = UNSET - if not isinstance(self.algo, Unset): - algo = self.algo.to_dict() + algo: Unset | dict[str, Any] = ( + UNSET if isinstance(self.algo, Unset) else self.algo.to_dict() + ) - market_condition: Unset | dict[str, Any] = UNSET - if not isinstance(self.market_condition, Unset): - market_condition = self.market_condition.to_dict() + market_condition: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.market_condition, Unset) + else self.market_condition.to_dict() + ) - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() + optional_data: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.optional_data, Unset) + else self.optional_data.to_dict() + ) field_dict: dict[str, Any] = {} @@ -184,11 +188,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: aux_price = d.pop("auxPrice", UNSET) _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo - if isinstance(_clearing_info, Unset): - clearing_info = UNSET - else: - clearing_info = ClearingInfo.from_dict(_clearing_info) + clearing_info: Unset | ClearingInfo = ( + UNSET + if isinstance(_clearing_info, Unset) + else ClearingInfo.from_dict(_clearing_info) + ) instructions = [] _instructions = d.pop("instructions", UNSET) @@ -205,11 +209,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: legs.append(legs_item) _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) + ord_type: Unset | OrdType = ( + UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) + ) order_flags = d.pop("orderFlags", UNSET) @@ -218,11 +220,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: price = d.pop("price", UNSET) _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType - if isinstance(_price_type, Unset): - price_type = UNSET - else: - price_type = PriceType(_price_type) + price_type: Unset | PriceType = ( + UNSET if isinstance(_price_type, Unset) else PriceType(_price_type) + ) qty = d.pop("qty", UNSET) @@ -233,36 +233,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: text = d.pop("text", UNSET) _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) + tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) _algo = d.pop("algo", UNSET) - algo: Unset | CreateMultiLegOrderRequestAlgo - if isinstance(_algo, Unset): - algo = UNSET - else: - algo = CreateMultiLegOrderRequestAlgo.from_dict(_algo) + algo: Unset | CreateMultiLegOrderRequestAlgo = ( + UNSET + if isinstance(_algo, Unset) + else CreateMultiLegOrderRequestAlgo.from_dict(_algo) + ) _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | CreateMultiLegOrderRequestMarketCondition - if isinstance(_market_condition, Unset): - market_condition = UNSET - else: - market_condition = CreateMultiLegOrderRequestMarketCondition.from_dict( - _market_condition - ) + market_condition: Unset | CreateMultiLegOrderRequestMarketCondition = ( + UNSET + if isinstance(_market_condition, Unset) + else CreateMultiLegOrderRequestMarketCondition.from_dict(_market_condition) + ) _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CreateMultiLegOrderRequestOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = CreateMultiLegOrderRequestOptionalData.from_dict( - _optional_data - ) + optional_data: Unset | CreateMultiLegOrderRequestOptionalData = ( + UNSET + if isinstance(_optional_data, Unset) + else CreateMultiLegOrderRequestOptionalData.from_dict(_optional_data) + ) create_multi_leg_order_request = cls( account_id=account_id, diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py b/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py index a660746d6..3b63d1a6b 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="CreateMultiLegOrderRequestAlgo") - @_attrs_define class CreateMultiLegOrderRequestAlgo: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - create_multi_leg_order_request_algo = cls( - ) - - + create_multi_leg_order_request_algo = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - create_multi_leg_order_request_algo.additional_properties = additional_properties + create_multi_leg_order_request_algo.additional_properties = ( + additional_properties + ) return create_multi_leg_order_request_algo @property diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py b/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py index 0ab061469..139409e77 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="CreateMultiLegOrderRequestMarketCondition") - @_attrs_define class CreateMultiLegOrderRequestMarketCondition: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - create_multi_leg_order_request_market_condition = cls( - ) - - + create_multi_leg_order_request_market_condition = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - create_multi_leg_order_request_market_condition.additional_properties = additional_properties + create_multi_leg_order_request_market_condition.additional_properties = ( + additional_properties + ) return create_multi_leg_order_request_market_condition @property diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py b/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py index 8e8a005bf..a692b2757 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="CreateMultiLegOrderRequestOptionalData") - @_attrs_define class CreateMultiLegOrderRequestOptionalData: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - create_multi_leg_order_request_optional_data = cls( - ) - - + create_multi_leg_order_request_optional_data = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - create_multi_leg_order_request_optional_data.additional_properties = additional_properties + create_multi_leg_order_request_optional_data.additional_properties = ( + additional_properties + ) return create_multi_leg_order_request_optional_data @property diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_response.py b/openapi_project/openapi_package/models/create_multi_leg_order_response.py index 979d62671..26f382afb 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_response.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_response.py @@ -31,15 +31,17 @@ class CreateMultiLegOrderResponse: status_code: Unset | StatusCode = UNSET def to_dict(self) -> dict[str, Any]: - multi_leg_order: Unset | dict[str, Any] = UNSET - if not isinstance(self.multi_leg_order, Unset): - multi_leg_order = self.multi_leg_order.to_dict() + multi_leg_order: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.multi_leg_order, Unset) + else self.multi_leg_order.to_dict() + ) error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -57,20 +59,18 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _multi_leg_order = d.pop("multiLegOrder", UNSET) - multi_leg_order: Unset | MultiLegOrder - if isinstance(_multi_leg_order, Unset): - multi_leg_order = UNSET - else: - multi_leg_order = MultiLegOrder.from_dict(_multi_leg_order) + multi_leg_order: Unset | MultiLegOrder = ( + UNSET + if isinstance(_multi_leg_order, Unset) + else MultiLegOrder.from_dict(_multi_leg_order) + ) error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) create_multi_leg_order_response = cls( multi_leg_order=multi_leg_order, diff --git a/openapi_project/openapi_package/models/create_order_cross_allocation.py b/openapi_project/openapi_package/models/create_order_cross_allocation.py index c4a16af6c..172eb616e 100644 --- a/openapi_project/openapi_package/models/create_order_cross_allocation.py +++ b/openapi_project/openapi_package/models/create_order_cross_allocation.py @@ -14,10 +14,10 @@ if TYPE_CHECKING: from ..models.clearing_info import ClearingInfo - from ..models.order_instruction import OrderInstruction from ..models.create_order_cross_allocation_optional_data import ( CreateOrderCrossAllocationOptionalData, ) + from ..models.order_instruction import OrderInstruction T = TypeVar("T", bound="CreateOrderCrossAllocation") @@ -49,9 +49,11 @@ class CreateOrderCrossAllocation: def to_dict(self) -> dict[str, Any]: account_id = self.account_id - clearing_info: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_info, Unset): - clearing_info = self.clearing_info.to_dict() + clearing_info: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.clearing_info, Unset) + else self.clearing_info.to_dict() + ) instructions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.instructions, Unset): @@ -60,23 +62,25 @@ def to_dict(self) -> dict[str, Any]: instructions_item = instructions_item_data.to_dict() instructions.append(instructions_item) - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() + optional_data: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.optional_data, Unset) + else self.optional_data.to_dict() + ) - position_effect: Unset | str = UNSET - if not isinstance(self.position_effect, Unset): - position_effect = self.position_effect.value + position_effect: Unset | str = ( + UNSET + if isinstance(self.position_effect, Unset) + else self.position_effect.value + ) qty = self.qty - side: Unset | str = UNSET - if not isinstance(self.side, Unset): - side = self.side.value + side: Unset | str = UNSET if isinstance(self.side, Unset) else self.side.value - side_type: Unset | str = UNSET - if not isinstance(self.side_type, Unset): - side_type = self.side_type.value + side_type: Unset | str = ( + UNSET if isinstance(self.side_type, Unset) else self.side_type.value + ) field_dict: dict[str, Any] = {} @@ -106,11 +110,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: account_id = d.pop("accountId", UNSET) _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo - if isinstance(_clearing_info, Unset): - clearing_info = UNSET - else: - clearing_info = ClearingInfo.from_dict(_clearing_info) + clearing_info: Unset | ClearingInfo = ( + UNSET + if isinstance(_clearing_info, Unset) + else ClearingInfo.from_dict(_clearing_info) + ) instructions = [] _instructions = d.pop("instructions", UNSET) @@ -120,36 +124,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: instructions.append(instructions_item) _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CreateOrderCrossAllocationOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = CreateOrderCrossAllocationOptionalData.from_dict( - _optional_data - ) + optional_data: Unset | CreateOrderCrossAllocationOptionalData = ( + UNSET + if isinstance(_optional_data, Unset) + else CreateOrderCrossAllocationOptionalData.from_dict(_optional_data) + ) _position_effect = d.pop("positionEffect", UNSET) - position_effect: Unset | PositionEffect - if isinstance(_position_effect, Unset): - position_effect = UNSET - else: - position_effect = PositionEffect(_position_effect) + position_effect: Unset | PositionEffect = ( + UNSET + if isinstance(_position_effect, Unset) + else PositionEffect(_position_effect) + ) qty = d.pop("qty", UNSET) _side = d.pop("side", UNSET) - side: Unset | Side - if isinstance(_side, Unset): - side = UNSET - else: - side = Side(_side) + side: Unset | Side = UNSET if isinstance(_side, Unset) else Side(_side) _side_type = d.pop("sideType", UNSET) - side_type: Unset | CrossSideType - if isinstance(_side_type, Unset): - side_type = UNSET - else: - side_type = CrossSideType(_side_type) + side_type: Unset | CrossSideType = ( + UNSET if isinstance(_side_type, Unset) else CrossSideType(_side_type) + ) create_order_cross_allocation = cls( account_id=account_id, diff --git a/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py b/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py index 9abdd3ee9..bcc35e30e 100644 --- a/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py +++ b/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="CreateOrderCrossAllocationOptionalData") - @_attrs_define class CreateOrderCrossAllocationOptionalData: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - create_order_cross_allocation_optional_data = cls( - ) - - + create_order_cross_allocation_optional_data = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - create_order_cross_allocation_optional_data.additional_properties = additional_properties + create_order_cross_allocation_optional_data.additional_properties = ( + additional_properties + ) return create_order_cross_allocation_optional_data @property diff --git a/openapi_project/openapi_package/models/create_order_cross_request.py b/openapi_project/openapi_package/models/create_order_cross_request.py index b4de250cc..870f67c02 100644 --- a/openapi_project/openapi_package/models/create_order_cross_request.py +++ b/openapi_project/openapi_package/models/create_order_cross_request.py @@ -14,16 +14,16 @@ from typing import cast if TYPE_CHECKING: + from ..models.create_order_cross_allocation import CreateOrderCrossAllocation + from ..models.flex_option import FlexOption from ..models.create_order_cross_request_market_condition import ( CreateOrderCrossRequestMarketCondition, ) from ..models.create_order_cross_request_algo import CreateOrderCrossRequestAlgo - from ..models.create_order_cross_allocation import CreateOrderCrossAllocation - from ..models.flex_option import FlexOption - from ..models.order_instruction import OrderInstruction from ..models.create_order_cross_request_optional_data import ( CreateOrderCrossRequestOptionalData, ) + from ..models.order_instruction import OrderInstruction T = TypeVar("T", bound="CreateOrderCrossRequest") @@ -84,9 +84,9 @@ def to_dict(self) -> dict[str, Any]: allocations_item = allocations_item_data.to_dict() allocations.append(allocations_item) - cross_type: Unset | str = UNSET - if not isinstance(self.cross_type, Unset): - cross_type = self.cross_type.value + cross_type: Unset | str = ( + UNSET if isinstance(self.cross_type, Unset) else self.cross_type.value + ) instructions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.instructions, Unset): @@ -95,9 +95,9 @@ def to_dict(self) -> dict[str, Any]: instructions_item = instructions_item_data.to_dict() instructions.append(instructions_item) - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value + ord_type: Unset | str = ( + UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value + ) order_flags = self.order_flags @@ -105,9 +105,9 @@ def to_dict(self) -> dict[str, Any]: price = self.price - price_type: Unset | str = UNSET - if not isinstance(self.price_type, Unset): - price_type = self.price_type.value + price_type: Unset | str = ( + UNSET if isinstance(self.price_type, Unset) else self.price_type.value + ) qty = self.qty @@ -119,25 +119,27 @@ def to_dict(self) -> dict[str, Any]: text = self.text - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value + tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value - algo: Unset | dict[str, Any] = UNSET - if not isinstance(self.algo, Unset): - algo = self.algo.to_dict() + algo: Unset | dict[str, Any] = ( + UNSET if isinstance(self.algo, Unset) else self.algo.to_dict() + ) - market_condition: Unset | dict[str, Any] = UNSET - if not isinstance(self.market_condition, Unset): - market_condition = self.market_condition.to_dict() + market_condition: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.market_condition, Unset) + else self.market_condition.to_dict() + ) - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() + optional_data: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.optional_data, Unset) + else self.optional_data.to_dict() + ) - flex_option: Unset | dict[str, Any] = UNSET - if not isinstance(self.flex_option, Unset): - flex_option = self.flex_option.to_dict() + flex_option: Unset | dict[str, Any] = ( + UNSET if isinstance(self.flex_option, Unset) else self.flex_option.to_dict() + ) field_dict: dict[str, Any] = {} @@ -198,11 +200,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: allocations.append(allocations_item) _cross_type = d.pop("crossType", UNSET) - cross_type: Unset | CrossType - if isinstance(_cross_type, Unset): - cross_type = UNSET - else: - cross_type = CrossType(_cross_type) + cross_type: Unset | CrossType = ( + UNSET if isinstance(_cross_type, Unset) else CrossType(_cross_type) + ) instructions = [] _instructions = d.pop("instructions", UNSET) @@ -212,11 +212,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: instructions.append(instructions_item) _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) + ord_type: Unset | OrdType = ( + UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) + ) order_flags = d.pop("orderFlags", UNSET) @@ -225,11 +223,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: price = d.pop("price", UNSET) _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType - if isinstance(_price_type, Unset): - price_type = UNSET - else: - price_type = PriceType(_price_type) + price_type: Unset | PriceType = ( + UNSET if isinstance(_price_type, Unset) else PriceType(_price_type) + ) qty = d.pop("qty", UNSET) @@ -242,43 +238,35 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: text = d.pop("text", UNSET) _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) + tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) _algo = d.pop("algo", UNSET) - algo: Unset | CreateOrderCrossRequestAlgo - if isinstance(_algo, Unset): - algo = UNSET - else: - algo = CreateOrderCrossRequestAlgo.from_dict(_algo) + algo: Unset | CreateOrderCrossRequestAlgo = ( + UNSET + if isinstance(_algo, Unset) + else CreateOrderCrossRequestAlgo.from_dict(_algo) + ) _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | CreateOrderCrossRequestMarketCondition - if isinstance(_market_condition, Unset): - market_condition = UNSET - else: - market_condition = CreateOrderCrossRequestMarketCondition.from_dict( - _market_condition - ) + market_condition: Unset | CreateOrderCrossRequestMarketCondition = ( + UNSET + if isinstance(_market_condition, Unset) + else CreateOrderCrossRequestMarketCondition.from_dict(_market_condition) + ) _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CreateOrderCrossRequestOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = CreateOrderCrossRequestOptionalData.from_dict( - _optional_data - ) + optional_data: Unset | CreateOrderCrossRequestOptionalData = ( + UNSET + if isinstance(_optional_data, Unset) + else CreateOrderCrossRequestOptionalData.from_dict(_optional_data) + ) _flex_option = d.pop("flexOption", UNSET) - flex_option: Unset | FlexOption - if isinstance(_flex_option, Unset): - flex_option = UNSET - else: - flex_option = FlexOption.from_dict(_flex_option) + flex_option: Unset | FlexOption = ( + UNSET + if isinstance(_flex_option, Unset) + else FlexOption.from_dict(_flex_option) + ) create_order_cross_request = cls( account_id=account_id, diff --git a/openapi_project/openapi_package/models/create_order_cross_request_algo.py b/openapi_project/openapi_package/models/create_order_cross_request_algo.py index 1cf349b68..b33fe4e72 100644 --- a/openapi_project/openapi_package/models/create_order_cross_request_algo.py +++ b/openapi_project/openapi_package/models/create_order_cross_request_algo.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="CreateOrderCrossRequestAlgo") - @_attrs_define class CreateOrderCrossRequestAlgo: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - create_order_cross_request_algo = cls( - ) - - + create_order_cross_request_algo = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py b/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py index a444023b9..a68cf8059 100644 --- a/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py +++ b/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="CreateOrderCrossRequestMarketCondition") - @_attrs_define class CreateOrderCrossRequestMarketCondition: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - create_order_cross_request_market_condition = cls( - ) - - + create_order_cross_request_market_condition = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - create_order_cross_request_market_condition.additional_properties = additional_properties + create_order_cross_request_market_condition.additional_properties = ( + additional_properties + ) return create_order_cross_request_market_condition @property diff --git a/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py b/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py index f51f8a5c7..12c51b2b2 100644 --- a/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py +++ b/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="CreateOrderCrossRequestOptionalData") - @_attrs_define class CreateOrderCrossRequestOptionalData: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - create_order_cross_request_optional_data = cls( - ) - - + create_order_cross_request_optional_data = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - create_order_cross_request_optional_data.additional_properties = additional_properties + create_order_cross_request_optional_data.additional_properties = ( + additional_properties + ) return create_order_cross_request_optional_data @property diff --git a/openapi_project/openapi_package/models/create_order_cross_response.py b/openapi_project/openapi_package/models/create_order_cross_response.py index 2c1bd9bdc..4d089c0bb 100644 --- a/openapi_project/openapi_package/models/create_order_cross_response.py +++ b/openapi_project/openapi_package/models/create_order_cross_response.py @@ -31,15 +31,15 @@ class CreateOrderCrossResponse: status_code: Unset | StatusCode = UNSET def to_dict(self) -> dict[str, Any]: - order_cross: Unset | dict[str, Any] = UNSET - if not isinstance(self.order_cross, Unset): - order_cross = self.order_cross.to_dict() + order_cross: Unset | dict[str, Any] = ( + UNSET if isinstance(self.order_cross, Unset) else self.order_cross.to_dict() + ) error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -57,20 +57,18 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _order_cross = d.pop("orderCross", UNSET) - order_cross: Unset | OrderCross - if isinstance(_order_cross, Unset): - order_cross = UNSET - else: - order_cross = OrderCross.from_dict(_order_cross) + order_cross: Unset | OrderCross = ( + UNSET + if isinstance(_order_cross, Unset) + else OrderCross.from_dict(_order_cross) + ) error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) create_order_cross_response = cls( order_cross=order_cross, diff --git a/openapi_project/openapi_package/models/create_order_request.py b/openapi_project/openapi_package/models/create_order_request.py index 146dee242..0b2294207 100644 --- a/openapi_project/openapi_package/models/create_order_request.py +++ b/openapi_project/openapi_package/models/create_order_request.py @@ -15,16 +15,16 @@ from typing import cast if TYPE_CHECKING: + from ..models.clearing_info import ClearingInfo + from ..models.flex_option import FlexOption + from ..models.create_order_request_algo import CreateOrderRequestAlgo from ..models.create_order_request_optional_data import ( CreateOrderRequestOptionalData, ) - from ..models.create_order_request_algo import CreateOrderRequestAlgo - from ..models.clearing_info import ClearingInfo - from ..models.order_instruction import OrderInstruction - from ..models.flex_option import FlexOption from ..models.create_order_request_market_condition import ( CreateOrderRequestMarketCondition, ) + from ..models.order_instruction import OrderInstruction T = TypeVar("T", bound="CreateOrderRequest") @@ -84,9 +84,11 @@ def to_dict(self) -> dict[str, Any]: aux_price = self.aux_price - clearing_info: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_info, Unset): - clearing_info = self.clearing_info.to_dict() + clearing_info: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.clearing_info, Unset) + else self.clearing_info.to_dict() + ) instructions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.instructions, Unset): @@ -95,31 +97,31 @@ def to_dict(self) -> dict[str, Any]: instructions_item = instructions_item_data.to_dict() instructions.append(instructions_item) - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value + ord_type: Unset | str = ( + UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value + ) order_flags = self.order_flags parent_ord_id = self.parent_ord_id - position_effect: Unset | str = UNSET - if not isinstance(self.position_effect, Unset): - position_effect = self.position_effect.value + position_effect: Unset | str = ( + UNSET + if isinstance(self.position_effect, Unset) + else self.position_effect.value + ) price = self.price - price_type: Unset | str = UNSET - if not isinstance(self.price_type, Unset): - price_type = self.price_type.value + price_type: Unset | str = ( + UNSET if isinstance(self.price_type, Unset) else self.price_type.value + ) qty = self.qty route = self.route - side: Unset | str = UNSET - if not isinstance(self.side, Unset): - side = self.side.value + side: Unset | str = UNSET if isinstance(self.side, Unset) else self.side.value symbol = self.symbol @@ -127,25 +129,27 @@ def to_dict(self) -> dict[str, Any]: text = self.text - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value + tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value - algo: Unset | dict[str, Any] = UNSET - if not isinstance(self.algo, Unset): - algo = self.algo.to_dict() + algo: Unset | dict[str, Any] = ( + UNSET if isinstance(self.algo, Unset) else self.algo.to_dict() + ) - market_condition: Unset | dict[str, Any] = UNSET - if not isinstance(self.market_condition, Unset): - market_condition = self.market_condition.to_dict() + market_condition: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.market_condition, Unset) + else self.market_condition.to_dict() + ) - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() + optional_data: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.optional_data, Unset) + else self.optional_data.to_dict() + ) - flex_option: Unset | dict[str, Any] = UNSET - if not isinstance(self.flex_option, Unset): - flex_option = self.flex_option.to_dict() + flex_option: Unset | dict[str, Any] = ( + UNSET if isinstance(self.flex_option, Unset) else self.flex_option.to_dict() + ) field_dict: dict[str, Any] = {} @@ -203,11 +207,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: aux_price = d.pop("auxPrice", UNSET) _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo - if isinstance(_clearing_info, Unset): - clearing_info = UNSET - else: - clearing_info = ClearingInfo.from_dict(_clearing_info) + clearing_info: Unset | ClearingInfo = ( + UNSET + if isinstance(_clearing_info, Unset) + else ClearingInfo.from_dict(_clearing_info) + ) instructions = [] _instructions = d.pop("instructions", UNSET) @@ -217,42 +221,34 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: instructions.append(instructions_item) _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) + ord_type: Unset | OrdType = ( + UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) + ) order_flags = d.pop("orderFlags", UNSET) parent_ord_id = d.pop("parentOrdId", UNSET) _position_effect = d.pop("positionEffect", UNSET) - position_effect: Unset | PositionEffect - if isinstance(_position_effect, Unset): - position_effect = UNSET - else: - position_effect = PositionEffect(_position_effect) + position_effect: Unset | PositionEffect = ( + UNSET + if isinstance(_position_effect, Unset) + else PositionEffect(_position_effect) + ) price = d.pop("price", UNSET) _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType - if isinstance(_price_type, Unset): - price_type = UNSET - else: - price_type = PriceType(_price_type) + price_type: Unset | PriceType = ( + UNSET if isinstance(_price_type, Unset) else PriceType(_price_type) + ) qty = d.pop("qty", UNSET) route = d.pop("route", UNSET) _side = d.pop("side", UNSET) - side: Unset | Side - if isinstance(_side, Unset): - side = UNSET - else: - side = Side(_side) + side: Unset | Side = UNSET if isinstance(_side, Unset) else Side(_side) symbol = d.pop("symbol", UNSET) @@ -261,41 +257,35 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: text = d.pop("text", UNSET) _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) + tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) _algo = d.pop("algo", UNSET) - algo: Unset | CreateOrderRequestAlgo - if isinstance(_algo, Unset): - algo = UNSET - else: - algo = CreateOrderRequestAlgo.from_dict(_algo) + algo: Unset | CreateOrderRequestAlgo = ( + UNSET + if isinstance(_algo, Unset) + else CreateOrderRequestAlgo.from_dict(_algo) + ) _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | CreateOrderRequestMarketCondition - if isinstance(_market_condition, Unset): - market_condition = UNSET - else: - market_condition = CreateOrderRequestMarketCondition.from_dict( - _market_condition - ) + market_condition: Unset | CreateOrderRequestMarketCondition = ( + UNSET + if isinstance(_market_condition, Unset) + else CreateOrderRequestMarketCondition.from_dict(_market_condition) + ) _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CreateOrderRequestOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = CreateOrderRequestOptionalData.from_dict(_optional_data) + optional_data: Unset | CreateOrderRequestOptionalData = ( + UNSET + if isinstance(_optional_data, Unset) + else CreateOrderRequestOptionalData.from_dict(_optional_data) + ) _flex_option = d.pop("flexOption", UNSET) - flex_option: Unset | FlexOption - if isinstance(_flex_option, Unset): - flex_option = UNSET - else: - flex_option = FlexOption.from_dict(_flex_option) + flex_option: Unset | FlexOption = ( + UNSET + if isinstance(_flex_option, Unset) + else FlexOption.from_dict(_flex_option) + ) create_order_request = cls( account_id=account_id, diff --git a/openapi_project/openapi_package/models/create_order_request_algo.py b/openapi_project/openapi_package/models/create_order_request_algo.py index d102577cf..215cf9f41 100644 --- a/openapi_project/openapi_package/models/create_order_request_algo.py +++ b/openapi_project/openapi_package/models/create_order_request_algo.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="CreateOrderRequestAlgo") - @_attrs_define class CreateOrderRequestAlgo: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - create_order_request_algo = cls( - ) - - + create_order_request_algo = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/create_order_request_market_condition.py b/openapi_project/openapi_package/models/create_order_request_market_condition.py index a4c1a5a14..474a9e066 100644 --- a/openapi_project/openapi_package/models/create_order_request_market_condition.py +++ b/openapi_project/openapi_package/models/create_order_request_market_condition.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="CreateOrderRequestMarketCondition") - @_attrs_define class CreateOrderRequestMarketCondition: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - create_order_request_market_condition = cls( - ) - - + create_order_request_market_condition = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - create_order_request_market_condition.additional_properties = additional_properties + create_order_request_market_condition.additional_properties = ( + additional_properties + ) return create_order_request_market_condition @property diff --git a/openapi_project/openapi_package/models/create_order_request_optional_data.py b/openapi_project/openapi_package/models/create_order_request_optional_data.py index 374bc49db..68330d7a6 100644 --- a/openapi_project/openapi_package/models/create_order_request_optional_data.py +++ b/openapi_project/openapi_package/models/create_order_request_optional_data.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="CreateOrderRequestOptionalData") - @_attrs_define class CreateOrderRequestOptionalData: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - create_order_request_optional_data = cls( - ) - - + create_order_request_optional_data = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/create_order_response.py b/openapi_project/openapi_package/models/create_order_response.py index db99fc9ef..70f7a9a22 100644 --- a/openapi_project/openapi_package/models/create_order_response.py +++ b/openapi_project/openapi_package/models/create_order_response.py @@ -31,15 +31,15 @@ class CreateOrderResponse: status_code: Unset | StatusCode = UNSET def to_dict(self) -> dict[str, Any]: - order: Unset | dict[str, Any] = UNSET - if not isinstance(self.order, Unset): - order = self.order.to_dict() + order: Unset | dict[str, Any] = ( + UNSET if isinstance(self.order, Unset) else self.order.to_dict() + ) error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -57,20 +57,16 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _order = d.pop("order", UNSET) - order: Unset | Order - if isinstance(_order, Unset): - order = UNSET - else: - order = Order.from_dict(_order) + order: Unset | Order = ( + UNSET if isinstance(_order, Unset) else Order.from_dict(_order) + ) error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) create_order_response = cls( order=order, diff --git a/openapi_project/openapi_package/models/crypto.py b/openapi_project/openapi_package/models/crypto.py index efb310a57..2e51b9491 100644 --- a/openapi_project/openapi_package/models/crypto.py +++ b/openapi_project/openapi_package/models/crypto.py @@ -14,8 +14,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.date import Date from ..models.crypto_aliases import CryptoAliases + from ..models.date import Date T = TypeVar("T", bound="Crypto") @@ -69,21 +69,21 @@ class Crypto: quote_currency: Unset | Currency = UNSET def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = UNSET - if not isinstance(self.aliases, Unset): - aliases = self.aliases.to_dict() + aliases: Unset | dict[str, Any] = ( + UNSET if isinstance(self.aliases, Unset) else self.aliases.to_dict() + ) - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value + currency: Unset | str = ( + UNSET if isinstance(self.currency, Unset) else self.currency.value + ) - listed_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.listed_dt, Unset): - listed_dt = self.listed_dt.to_dict() + listed_dt: Unset | dict[str, Any] = ( + UNSET if isinstance(self.listed_dt, Unset) else self.listed_dt.to_dict() + ) - delisted_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.delisted_dt, Unset): - delisted_dt = self.delisted_dt.to_dict() + delisted_dt: Unset | dict[str, Any] = ( + UNSET if isinstance(self.delisted_dt, Unset) else self.delisted_dt.to_dict() + ) description = self.description @@ -97,19 +97,25 @@ def to_dict(self) -> dict[str, Any]: price_display_factor = self.price_display_factor - price_display_format: Unset | str = UNSET - if not isinstance(self.price_display_format, Unset): - price_display_format = self.price_display_format.value + price_display_format: Unset | str = ( + UNSET + if isinstance(self.price_display_format, Unset) + else self.price_display_format.value + ) qty_display_factor = self.qty_display_factor - qty_display_format: Unset | str = UNSET - if not isinstance(self.qty_display_format, Unset): - qty_display_format = self.qty_display_format.value + qty_display_format: Unset | str = ( + UNSET + if isinstance(self.qty_display_format, Unset) + else self.qty_display_format.value + ) - security_category: Unset | str = UNSET - if not isinstance(self.security_category, Unset): - security_category = self.security_category.value + security_category: Unset | str = ( + UNSET + if isinstance(self.security_category, Unset) + else self.security_category.value + ) symbol = self.symbol @@ -126,9 +132,11 @@ def to_dict(self) -> dict[str, Any]: traded_exchanges_item = traded_exchanges_item_data.value traded_exchanges.append(traded_exchanges_item) - quote_currency: Unset | str = UNSET - if not isinstance(self.quote_currency, Unset): - quote_currency = self.quote_currency.value + quote_currency: Unset | str = ( + UNSET + if isinstance(self.quote_currency, Unset) + else self.quote_currency.value + ) field_dict: dict[str, Any] = {} @@ -180,32 +188,24 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _aliases = d.pop("aliases", UNSET) - aliases: Unset | CryptoAliases - if isinstance(_aliases, Unset): - aliases = UNSET - else: - aliases = CryptoAliases.from_dict(_aliases) + aliases: Unset | CryptoAliases = ( + UNSET if isinstance(_aliases, Unset) else CryptoAliases.from_dict(_aliases) + ) _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) + currency: Unset | Currency = ( + UNSET if isinstance(_currency, Unset) else Currency(_currency) + ) _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date - if isinstance(_listed_dt, Unset): - listed_dt = UNSET - else: - listed_dt = Date.from_dict(_listed_dt) + listed_dt: Unset | Date = ( + UNSET if isinstance(_listed_dt, Unset) else Date.from_dict(_listed_dt) + ) _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date - if isinstance(_delisted_dt, Unset): - delisted_dt = UNSET - else: - delisted_dt = Date.from_dict(_delisted_dt) + delisted_dt: Unset | Date = ( + UNSET if isinstance(_delisted_dt, Unset) else Date.from_dict(_delisted_dt) + ) description = d.pop("description", UNSET) @@ -220,27 +220,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: price_display_factor = d.pop("priceDisplayFactor", UNSET) _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat - if isinstance(_price_display_format, Unset): - price_display_format = UNSET - else: - price_display_format = NumericDisplayFormat(_price_display_format) + price_display_format: Unset | NumericDisplayFormat = ( + UNSET + if isinstance(_price_display_format, Unset) + else NumericDisplayFormat(_price_display_format) + ) qty_display_factor = d.pop("qtyDisplayFactor", UNSET) _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat - if isinstance(_qty_display_format, Unset): - qty_display_format = UNSET - else: - qty_display_format = NumericDisplayFormat(_qty_display_format) + qty_display_format: Unset | NumericDisplayFormat = ( + UNSET + if isinstance(_qty_display_format, Unset) + else NumericDisplayFormat(_qty_display_format) + ) _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory - if isinstance(_security_category, Unset): - security_category = UNSET - else: - security_category = SecurityCategory(_security_category) + security_category: Unset | SecurityCategory = ( + UNSET + if isinstance(_security_category, Unset) + else SecurityCategory(_security_category) + ) symbol = d.pop("symbol", UNSET) @@ -258,11 +258,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: traded_exchanges.append(traded_exchanges_item) _quote_currency = d.pop("quoteCurrency", UNSET) - quote_currency: Unset | Currency - if isinstance(_quote_currency, Unset): - quote_currency = UNSET - else: - quote_currency = Currency(_quote_currency) + quote_currency: Unset | Currency = ( + UNSET if isinstance(_quote_currency, Unset) else Currency(_quote_currency) + ) crypto = cls( aliases=aliases, diff --git a/openapi_project/openapi_package/models/crypto_aliases.py b/openapi_project/openapi_package/models/crypto_aliases.py index 1a1c2960c..d2aba7275 100644 --- a/openapi_project/openapi_package/models/crypto_aliases.py +++ b/openapi_project/openapi_package/models/crypto_aliases.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="CryptoAliases") - @_attrs_define class CryptoAliases: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - crypto_aliases = cls( - ) - - + crypto_aliases = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/execution.py b/openapi_project/openapi_package/models/execution.py index 3d318fed4..115ed7db7 100644 --- a/openapi_project/openapi_package/models/execution.py +++ b/openapi_project/openapi_package/models/execution.py @@ -19,12 +19,12 @@ from typing import cast if TYPE_CHECKING: - from ..models.security import Security - from ..models.header import Header from ..models.clearing_info import ClearingInfo + from ..models.header import Header + from ..models.security import Security + from ..models.execution_algo import ExecutionAlgo from ..models.execution_optional_data import ExecutionOptionalData from ..models.order_instruction import OrderInstruction - from ..models.execution_algo import ExecutionAlgo T = TypeVar("T", bound="Execution") @@ -146,9 +146,9 @@ class Execution: def to_dict(self) -> dict[str, Any]: account_id = self.account_id - algo: Unset | dict[str, Any] = UNSET - if not isinstance(self.algo, Unset): - algo = self.algo.to_dict() + algo: Unset | dict[str, Any] = ( + UNSET if isinstance(self.algo, Unset) else self.algo.to_dict() + ) alloc_id = self.alloc_id @@ -158,9 +158,11 @@ def to_dict(self) -> dict[str, Any]: claimed_by = self.claimed_by - clearing_info: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_info, Unset): - clearing_info = self.clearing_info.to_dict() + clearing_info: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.clearing_info, Unset) + else self.clearing_info.to_dict() + ) commission = self.commission @@ -174,17 +176,17 @@ def to_dict(self) -> dict[str, Any]: exec_ref_id = self.exec_ref_id - exec_type: Unset | str = UNSET - if not isinstance(self.exec_type, Unset): - exec_type = self.exec_type.value + exec_type: Unset | str = ( + UNSET if isinstance(self.exec_type, Unset) else self.exec_type.value + ) fee1 = self.fee1 fee2 = self.fee2 - header: Unset | dict[str, Any] = UNSET - if not isinstance(self.header, Unset): - header = self.header.to_dict() + header: Unset | dict[str, Any] = ( + UNSET if isinstance(self.header, Unset) else self.header.to_dict() + ) incoming_cl_ord_id = self.incoming_cl_ord_id @@ -211,27 +213,33 @@ def to_dict(self) -> dict[str, Any]: liquidity_flag = self.liquidity_flag - multi_leg_reporting_type: Unset | str = UNSET - if not isinstance(self.multi_leg_reporting_type, Unset): - multi_leg_reporting_type = self.multi_leg_reporting_type.value + multi_leg_reporting_type: Unset | str = ( + UNSET + if isinstance(self.multi_leg_reporting_type, Unset) + else self.multi_leg_reporting_type.value + ) - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() + optional_data: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.optional_data, Unset) + else self.optional_data.to_dict() + ) order_flags = self.order_flags - ord_status: Unset | str = UNSET - if not isinstance(self.ord_status, Unset): - ord_status = self.ord_status.value + ord_status: Unset | str = ( + UNSET if isinstance(self.ord_status, Unset) else self.ord_status.value + ) - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value + ord_type: Unset | str = ( + UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value + ) - origination_type: Unset | str = UNSET - if not isinstance(self.origination_type, Unset): - origination_type = self.origination_type.value + origination_type: Unset | str = ( + UNSET + if isinstance(self.origination_type, Unset) + else self.origination_type.value + ) orig_ord_id = self.orig_ord_id @@ -239,15 +247,17 @@ def to_dict(self) -> dict[str, Any]: perm_ord_id = self.perm_ord_id - position_effect: Unset | str = UNSET - if not isinstance(self.position_effect, Unset): - position_effect = self.position_effect.value + position_effect: Unset | str = ( + UNSET + if isinstance(self.position_effect, Unset) + else self.position_effect.value + ) price = self.price - price_type: Unset | str = UNSET - if not isinstance(self.price_type, Unset): - price_type = self.price_type.value + price_type: Unset | str = ( + UNSET if isinstance(self.price_type, Unset) else self.price_type.value + ) qty = self.qty @@ -255,13 +265,11 @@ def to_dict(self) -> dict[str, Any]: routing_session = self.routing_session - security: Unset | dict[str, Any] = UNSET - if not isinstance(self.security, Unset): - security = self.security.to_dict() + security: Unset | dict[str, Any] = ( + UNSET if isinstance(self.security, Unset) else self.security.to_dict() + ) - side: Unset | str = UNSET - if not isinstance(self.side, Unset): - side = self.side.value + side: Unset | str = UNSET if isinstance(self.side, Unset) else self.side.value source = self.source @@ -271,9 +279,7 @@ def to_dict(self) -> dict[str, Any]: text = self.text - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value + tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value trader_id = self.trader_id @@ -401,11 +407,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: account_id = d.pop("accountId", UNSET) _algo = d.pop("algo", UNSET) - algo: Unset | ExecutionAlgo - if isinstance(_algo, Unset): - algo = UNSET - else: - algo = ExecutionAlgo.from_dict(_algo) + algo: Unset | ExecutionAlgo = ( + UNSET if isinstance(_algo, Unset) else ExecutionAlgo.from_dict(_algo) + ) alloc_id = d.pop("allocId", UNSET) @@ -416,11 +420,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: claimed_by = d.pop("claimedBy", UNSET) _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo - if isinstance(_clearing_info, Unset): - clearing_info = UNSET - else: - clearing_info = ClearingInfo.from_dict(_clearing_info) + clearing_info: Unset | ClearingInfo = ( + UNSET + if isinstance(_clearing_info, Unset) + else ClearingInfo.from_dict(_clearing_info) + ) commission = d.pop("commission", UNSET) @@ -435,22 +439,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: exec_ref_id = d.pop("execRefId", UNSET) _exec_type = d.pop("execType", UNSET) - exec_type: Unset | ExecType - if isinstance(_exec_type, Unset): - exec_type = UNSET - else: - exec_type = ExecType(_exec_type) + exec_type: Unset | ExecType = ( + UNSET if isinstance(_exec_type, Unset) else ExecType(_exec_type) + ) fee1 = d.pop("fee1", UNSET) fee2 = d.pop("fee2", UNSET) _header = d.pop("header", UNSET) - header: Unset | Header - if isinstance(_header, Unset): - header = UNSET - else: - header = Header.from_dict(_header) + header: Unset | Header = ( + UNSET if isinstance(_header, Unset) else Header.from_dict(_header) + ) incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) @@ -478,41 +478,37 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: liquidity_flag = d.pop("liquidityFlag", UNSET) _multi_leg_reporting_type = d.pop("multiLegReportingType", UNSET) - multi_leg_reporting_type: Unset | MultiLegReportingType - if isinstance(_multi_leg_reporting_type, Unset): - multi_leg_reporting_type = UNSET - else: - multi_leg_reporting_type = MultiLegReportingType(_multi_leg_reporting_type) + multi_leg_reporting_type: Unset | MultiLegReportingType = ( + UNSET + if isinstance(_multi_leg_reporting_type, Unset) + else MultiLegReportingType(_multi_leg_reporting_type) + ) _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | ExecutionOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = ExecutionOptionalData.from_dict(_optional_data) + optional_data: Unset | ExecutionOptionalData = ( + UNSET + if isinstance(_optional_data, Unset) + else ExecutionOptionalData.from_dict(_optional_data) + ) order_flags = d.pop("orderFlags", UNSET) _ord_status = d.pop("ordStatus", UNSET) - ord_status: Unset | OrdStatus - if isinstance(_ord_status, Unset): - ord_status = UNSET - else: - ord_status = OrdStatus(_ord_status) + ord_status: Unset | OrdStatus = ( + UNSET if isinstance(_ord_status, Unset) else OrdStatus(_ord_status) + ) _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) + ord_type: Unset | OrdType = ( + UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) + ) _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType - if isinstance(_origination_type, Unset): - origination_type = UNSET - else: - origination_type = OriginationType(_origination_type) + origination_type: Unset | OriginationType = ( + UNSET + if isinstance(_origination_type, Unset) + else OriginationType(_origination_type) + ) orig_ord_id = d.pop("origOrdId", UNSET) @@ -521,20 +517,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: perm_ord_id = d.pop("permOrdId", UNSET) _position_effect = d.pop("positionEffect", UNSET) - position_effect: Unset | PositionEffect - if isinstance(_position_effect, Unset): - position_effect = UNSET - else: - position_effect = PositionEffect(_position_effect) + position_effect: Unset | PositionEffect = ( + UNSET + if isinstance(_position_effect, Unset) + else PositionEffect(_position_effect) + ) price = d.pop("price", UNSET) _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType - if isinstance(_price_type, Unset): - price_type = UNSET - else: - price_type = PriceType(_price_type) + price_type: Unset | PriceType = ( + UNSET if isinstance(_price_type, Unset) else PriceType(_price_type) + ) qty = d.pop("qty", UNSET) @@ -543,18 +537,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: routing_session = d.pop("routingSession", UNSET) _security = d.pop("security", UNSET) - security: Unset | Security - if isinstance(_security, Unset): - security = UNSET - else: - security = Security.from_dict(_security) + security: Unset | Security = ( + UNSET if isinstance(_security, Unset) else Security.from_dict(_security) + ) _side = d.pop("side", UNSET) - side: Unset | Side - if isinstance(_side, Unset): - side = UNSET - else: - side = Side(_side) + side: Unset | Side = UNSET if isinstance(_side, Unset) else Side(_side) source = d.pop("source", UNSET) @@ -565,11 +553,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: text = d.pop("text", UNSET) _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) + tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) trader_id = d.pop("traderId", UNSET) diff --git a/openapi_project/openapi_package/models/execution_algo.py b/openapi_project/openapi_package/models/execution_algo.py index 7d067b654..e47d18405 100644 --- a/openapi_project/openapi_package/models/execution_algo.py +++ b/openapi_project/openapi_package/models/execution_algo.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="ExecutionAlgo") - @_attrs_define class ExecutionAlgo: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - execution_algo = cls( - ) - - + execution_algo = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/execution_optional_data.py b/openapi_project/openapi_package/models/execution_optional_data.py index 6214e0765..f954d3bf7 100644 --- a/openapi_project/openapi_package/models/execution_optional_data.py +++ b/openapi_project/openapi_package/models/execution_optional_data.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="ExecutionOptionalData") - @_attrs_define class ExecutionOptionalData: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - execution_optional_data = cls( - ) - - + execution_optional_data = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/flex_option.py b/openapi_project/openapi_package/models/flex_option.py index 32f581fb7..2c4244a57 100644 --- a/openapi_project/openapi_package/models/flex_option.py +++ b/openapi_project/openapi_package/models/flex_option.py @@ -99,21 +99,21 @@ class FlexOption: underlying: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = UNSET - if not isinstance(self.aliases, Unset): - aliases = self.aliases.to_dict() + aliases: Unset | dict[str, Any] = ( + UNSET if isinstance(self.aliases, Unset) else self.aliases.to_dict() + ) - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value + currency: Unset | str = ( + UNSET if isinstance(self.currency, Unset) else self.currency.value + ) - listed_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.listed_dt, Unset): - listed_dt = self.listed_dt.to_dict() + listed_dt: Unset | dict[str, Any] = ( + UNSET if isinstance(self.listed_dt, Unset) else self.listed_dt.to_dict() + ) - delisted_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.delisted_dt, Unset): - delisted_dt = self.delisted_dt.to_dict() + delisted_dt: Unset | dict[str, Any] = ( + UNSET if isinstance(self.delisted_dt, Unset) else self.delisted_dt.to_dict() + ) description = self.description @@ -127,19 +127,25 @@ def to_dict(self) -> dict[str, Any]: price_display_factor = self.price_display_factor - price_display_format: Unset | str = UNSET - if not isinstance(self.price_display_format, Unset): - price_display_format = self.price_display_format.value + price_display_format: Unset | str = ( + UNSET + if isinstance(self.price_display_format, Unset) + else self.price_display_format.value + ) qty_display_factor = self.qty_display_factor - qty_display_format: Unset | str = UNSET - if not isinstance(self.qty_display_format, Unset): - qty_display_format = self.qty_display_format.value + qty_display_format: Unset | str = ( + UNSET + if isinstance(self.qty_display_format, Unset) + else self.qty_display_format.value + ) - security_category: Unset | str = UNSET - if not isinstance(self.security_category, Unset): - security_category = self.security_category.value + security_category: Unset | str = ( + UNSET + if isinstance(self.security_category, Unset) + else self.security_category.value + ) symbol = self.symbol @@ -158,39 +164,45 @@ def to_dict(self) -> dict[str, Any]: cap_percentage = self.cap_percentage - creation_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.creation_dt, Unset): - creation_dt = self.creation_dt.to_dict() + creation_dt: Unset | dict[str, Any] = ( + UNSET if isinstance(self.creation_dt, Unset) else self.creation_dt.to_dict() + ) deliverable_per_contract = self.deliverable_per_contract - exercise_style: Unset | str = UNSET - if not isinstance(self.exercise_style, Unset): - exercise_style = self.exercise_style.value + exercise_style: Unset | str = ( + UNSET + if isinstance(self.exercise_style, Unset) + else self.exercise_style.value + ) - expiration_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.expiration_dt, Unset): - expiration_dt = self.expiration_dt.to_dict() + expiration_dt: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.expiration_dt, Unset) + else self.expiration_dt.to_dict() + ) observation_day = self.observation_day percentage_pricing = self.percentage_pricing - product_type: Unset | str = UNSET - if not isinstance(self.product_type, Unset): - product_type = self.product_type.value + product_type: Unset | str = ( + UNSET if isinstance(self.product_type, Unset) else self.product_type.value + ) - put_call: Unset | str = UNSET - if not isinstance(self.put_call, Unset): - put_call = self.put_call.value + put_call: Unset | str = ( + UNSET if isinstance(self.put_call, Unset) else self.put_call.value + ) root = self.root root_base = self.root_base - settlement_type: Unset | str = UNSET - if not isinstance(self.settlement_type, Unset): - settlement_type = self.settlement_type.value + settlement_type: Unset | str = ( + UNSET + if isinstance(self.settlement_type, Unset) + else self.settlement_type.value + ) strike = self.strike @@ -272,32 +284,26 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _aliases = d.pop("aliases", UNSET) - aliases: Unset | FlexOptionAliases - if isinstance(_aliases, Unset): - aliases = UNSET - else: - aliases = FlexOptionAliases.from_dict(_aliases) + aliases: Unset | FlexOptionAliases = ( + UNSET + if isinstance(_aliases, Unset) + else FlexOptionAliases.from_dict(_aliases) + ) _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) + currency: Unset | Currency = ( + UNSET if isinstance(_currency, Unset) else Currency(_currency) + ) _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date - if isinstance(_listed_dt, Unset): - listed_dt = UNSET - else: - listed_dt = Date.from_dict(_listed_dt) + listed_dt: Unset | Date = ( + UNSET if isinstance(_listed_dt, Unset) else Date.from_dict(_listed_dt) + ) _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date - if isinstance(_delisted_dt, Unset): - delisted_dt = UNSET - else: - delisted_dt = Date.from_dict(_delisted_dt) + delisted_dt: Unset | Date = ( + UNSET if isinstance(_delisted_dt, Unset) else Date.from_dict(_delisted_dt) + ) description = d.pop("description", UNSET) @@ -312,27 +318,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: price_display_factor = d.pop("priceDisplayFactor", UNSET) _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat - if isinstance(_price_display_format, Unset): - price_display_format = UNSET - else: - price_display_format = NumericDisplayFormat(_price_display_format) + price_display_format: Unset | NumericDisplayFormat = ( + UNSET + if isinstance(_price_display_format, Unset) + else NumericDisplayFormat(_price_display_format) + ) qty_display_factor = d.pop("qtyDisplayFactor", UNSET) _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat - if isinstance(_qty_display_format, Unset): - qty_display_format = UNSET - else: - qty_display_format = NumericDisplayFormat(_qty_display_format) + qty_display_format: Unset | NumericDisplayFormat = ( + UNSET + if isinstance(_qty_display_format, Unset) + else NumericDisplayFormat(_qty_display_format) + ) _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory - if isinstance(_security_category, Unset): - security_category = UNSET - else: - security_category = SecurityCategory(_security_category) + security_category: Unset | SecurityCategory = ( + UNSET + if isinstance(_security_category, Unset) + else SecurityCategory(_security_category) + ) symbol = d.pop("symbol", UNSET) @@ -352,56 +358,52 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: cap_percentage = d.pop("capPercentage", UNSET) _creation_dt = d.pop("creationDt", UNSET) - creation_dt: Unset | Date - if isinstance(_creation_dt, Unset): - creation_dt = UNSET - else: - creation_dt = Date.from_dict(_creation_dt) + creation_dt: Unset | Date = ( + UNSET if isinstance(_creation_dt, Unset) else Date.from_dict(_creation_dt) + ) deliverable_per_contract = d.pop("deliverablePerContract", UNSET) _exercise_style = d.pop("exerciseStyle", UNSET) - exercise_style: Unset | OptionExerciseStyle - if isinstance(_exercise_style, Unset): - exercise_style = UNSET - else: - exercise_style = OptionExerciseStyle(_exercise_style) + exercise_style: Unset | OptionExerciseStyle = ( + UNSET + if isinstance(_exercise_style, Unset) + else OptionExerciseStyle(_exercise_style) + ) _expiration_dt = d.pop("expirationDt", UNSET) - expiration_dt: Unset | Date - if isinstance(_expiration_dt, Unset): - expiration_dt = UNSET - else: - expiration_dt = Date.from_dict(_expiration_dt) + expiration_dt: Unset | Date = ( + UNSET + if isinstance(_expiration_dt, Unset) + else Date.from_dict(_expiration_dt) + ) observation_day = d.pop("observationDay", UNSET) percentage_pricing = d.pop("percentagePricing", UNSET) _product_type = d.pop("productType", UNSET) - product_type: Unset | OptionSeriesProductType - if isinstance(_product_type, Unset): - product_type = UNSET - else: - product_type = OptionSeriesProductType(_product_type) + product_type: Unset | OptionSeriesProductType = ( + UNSET + if isinstance(_product_type, Unset) + else OptionSeriesProductType(_product_type) + ) _put_call = d.pop("putCall", UNSET) - put_call: Unset | PutCall - if isinstance(_put_call, Unset): - put_call = UNSET - else: - put_call = PutCall(_put_call) + put_call: Unset | PutCall = ( + UNSET if isinstance(_put_call, Unset) else PutCall(_put_call) + ) root = d.pop("root", UNSET) root_base = d.pop("rootBase", UNSET) _settlement_type = d.pop("settlementType", UNSET) - settlement_type: Unset | OptionSettlementType - if isinstance(_settlement_type, Unset): - settlement_type = UNSET - else: - settlement_type = OptionSettlementType(_settlement_type) + settlement_type: Unset | OptionSettlementType = ( + UNSET + if isinstance(_settlement_type, Unset) + else OptionSettlementType(_settlement_type) + ) strike = d.pop("strike", UNSET) diff --git a/openapi_project/openapi_package/models/flex_option_aliases.py b/openapi_project/openapi_package/models/flex_option_aliases.py index b181a7352..ab36bfa8f 100644 --- a/openapi_project/openapi_package/models/flex_option_aliases.py +++ b/openapi_project/openapi_package/models/flex_option_aliases.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="FlexOptionAliases") - @_attrs_define class FlexOptionAliases: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - flex_option_aliases = cls( - ) - - + flex_option_aliases = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/future.py b/openapi_project/openapi_package/models/future.py index 98f56019c..fbebf83a3 100644 --- a/openapi_project/openapi_package/models/future.py +++ b/openapi_project/openapi_package/models/future.py @@ -14,9 +14,9 @@ from typing import cast if TYPE_CHECKING: + from ..models.future_root import FutureRoot from ..models.future_aliases import FutureAliases from ..models.date import Date - from ..models.future_root import FutureRoot T = TypeVar("T", bound="Future") @@ -80,21 +80,21 @@ class Future: root: Unset | "FutureRoot" = UNSET def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = UNSET - if not isinstance(self.aliases, Unset): - aliases = self.aliases.to_dict() + aliases: Unset | dict[str, Any] = ( + UNSET if isinstance(self.aliases, Unset) else self.aliases.to_dict() + ) - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value + currency: Unset | str = ( + UNSET if isinstance(self.currency, Unset) else self.currency.value + ) - listed_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.listed_dt, Unset): - listed_dt = self.listed_dt.to_dict() + listed_dt: Unset | dict[str, Any] = ( + UNSET if isinstance(self.listed_dt, Unset) else self.listed_dt.to_dict() + ) - delisted_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.delisted_dt, Unset): - delisted_dt = self.delisted_dt.to_dict() + delisted_dt: Unset | dict[str, Any] = ( + UNSET if isinstance(self.delisted_dt, Unset) else self.delisted_dt.to_dict() + ) description = self.description @@ -108,19 +108,25 @@ def to_dict(self) -> dict[str, Any]: price_display_factor = self.price_display_factor - price_display_format: Unset | str = UNSET - if not isinstance(self.price_display_format, Unset): - price_display_format = self.price_display_format.value + price_display_format: Unset | str = ( + UNSET + if isinstance(self.price_display_format, Unset) + else self.price_display_format.value + ) qty_display_factor = self.qty_display_factor - qty_display_format: Unset | str = UNSET - if not isinstance(self.qty_display_format, Unset): - qty_display_format = self.qty_display_format.value + qty_display_format: Unset | str = ( + UNSET + if isinstance(self.qty_display_format, Unset) + else self.qty_display_format.value + ) - security_category: Unset | str = UNSET - if not isinstance(self.security_category, Unset): - security_category = self.security_category.value + security_category: Unset | str = ( + UNSET + if isinstance(self.security_category, Unset) + else self.security_category.value + ) symbol = self.symbol @@ -139,25 +145,33 @@ def to_dict(self) -> dict[str, Any]: contract_myy = self.contract_myy - first_notice_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.first_notice_dt, Unset): - first_notice_dt = self.first_notice_dt.to_dict() + first_notice_dt: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.first_notice_dt, Unset) + else self.first_notice_dt.to_dict() + ) - first_trade_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.first_trade_dt, Unset): - first_trade_dt = self.first_trade_dt.to_dict() + first_trade_dt: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.first_trade_dt, Unset) + else self.first_trade_dt.to_dict() + ) - last_notice_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.last_notice_dt, Unset): - last_notice_dt = self.last_notice_dt.to_dict() + last_notice_dt: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.last_notice_dt, Unset) + else self.last_notice_dt.to_dict() + ) - last_trade_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.last_trade_dt, Unset): - last_trade_dt = self.last_trade_dt.to_dict() + last_trade_dt: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.last_trade_dt, Unset) + else self.last_trade_dt.to_dict() + ) - root: Unset | dict[str, Any] = UNSET - if not isinstance(self.root, Unset): - root = self.root.to_dict() + root: Unset | dict[str, Any] = ( + UNSET if isinstance(self.root, Unset) else self.root.to_dict() + ) field_dict: dict[str, Any] = {} @@ -219,32 +233,24 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _aliases = d.pop("aliases", UNSET) - aliases: Unset | FutureAliases - if isinstance(_aliases, Unset): - aliases = UNSET - else: - aliases = FutureAliases.from_dict(_aliases) + aliases: Unset | FutureAliases = ( + UNSET if isinstance(_aliases, Unset) else FutureAliases.from_dict(_aliases) + ) _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) + currency: Unset | Currency = ( + UNSET if isinstance(_currency, Unset) else Currency(_currency) + ) _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date - if isinstance(_listed_dt, Unset): - listed_dt = UNSET - else: - listed_dt = Date.from_dict(_listed_dt) + listed_dt: Unset | Date = ( + UNSET if isinstance(_listed_dt, Unset) else Date.from_dict(_listed_dt) + ) _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date - if isinstance(_delisted_dt, Unset): - delisted_dt = UNSET - else: - delisted_dt = Date.from_dict(_delisted_dt) + delisted_dt: Unset | Date = ( + UNSET if isinstance(_delisted_dt, Unset) else Date.from_dict(_delisted_dt) + ) description = d.pop("description", UNSET) @@ -259,27 +265,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: price_display_factor = d.pop("priceDisplayFactor", UNSET) _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat - if isinstance(_price_display_format, Unset): - price_display_format = UNSET - else: - price_display_format = NumericDisplayFormat(_price_display_format) + price_display_format: Unset | NumericDisplayFormat = ( + UNSET + if isinstance(_price_display_format, Unset) + else NumericDisplayFormat(_price_display_format) + ) qty_display_factor = d.pop("qtyDisplayFactor", UNSET) _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat - if isinstance(_qty_display_format, Unset): - qty_display_format = UNSET - else: - qty_display_format = NumericDisplayFormat(_qty_display_format) + qty_display_format: Unset | NumericDisplayFormat = ( + UNSET + if isinstance(_qty_display_format, Unset) + else NumericDisplayFormat(_qty_display_format) + ) _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory - if isinstance(_security_category, Unset): - security_category = UNSET - else: - security_category = SecurityCategory(_security_category) + security_category: Unset | SecurityCategory = ( + UNSET + if isinstance(_security_category, Unset) + else SecurityCategory(_security_category) + ) symbol = d.pop("symbol", UNSET) @@ -299,39 +305,37 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: contract_myy = d.pop("contractMYY", UNSET) _first_notice_dt = d.pop("firstNoticeDt", UNSET) - first_notice_dt: Unset | Date - if isinstance(_first_notice_dt, Unset): - first_notice_dt = UNSET - else: - first_notice_dt = Date.from_dict(_first_notice_dt) + first_notice_dt: Unset | Date = ( + UNSET + if isinstance(_first_notice_dt, Unset) + else Date.from_dict(_first_notice_dt) + ) _first_trade_dt = d.pop("firstTradeDt", UNSET) - first_trade_dt: Unset | Date - if isinstance(_first_trade_dt, Unset): - first_trade_dt = UNSET - else: - first_trade_dt = Date.from_dict(_first_trade_dt) + first_trade_dt: Unset | Date = ( + UNSET + if isinstance(_first_trade_dt, Unset) + else Date.from_dict(_first_trade_dt) + ) _last_notice_dt = d.pop("lastNoticeDt", UNSET) - last_notice_dt: Unset | Date - if isinstance(_last_notice_dt, Unset): - last_notice_dt = UNSET - else: - last_notice_dt = Date.from_dict(_last_notice_dt) + last_notice_dt: Unset | Date = ( + UNSET + if isinstance(_last_notice_dt, Unset) + else Date.from_dict(_last_notice_dt) + ) _last_trade_dt = d.pop("lastTradeDt", UNSET) - last_trade_dt: Unset | Date - if isinstance(_last_trade_dt, Unset): - last_trade_dt = UNSET - else: - last_trade_dt = Date.from_dict(_last_trade_dt) + last_trade_dt: Unset | Date = ( + UNSET + if isinstance(_last_trade_dt, Unset) + else Date.from_dict(_last_trade_dt) + ) _root = d.pop("root", UNSET) - root: Unset | FutureRoot - if isinstance(_root, Unset): - root = UNSET - else: - root = FutureRoot.from_dict(_root) + root: Unset | FutureRoot = ( + UNSET if isinstance(_root, Unset) else FutureRoot.from_dict(_root) + ) future = cls( aliases=aliases, diff --git a/openapi_project/openapi_package/models/future_aliases.py b/openapi_project/openapi_package/models/future_aliases.py index e387c648b..861c6eae2 100644 --- a/openapi_project/openapi_package/models/future_aliases.py +++ b/openapi_project/openapi_package/models/future_aliases.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="FutureAliases") - @_attrs_define class FutureAliases: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - future_aliases = cls( - ) - - + future_aliases = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/future_root.py b/openapi_project/openapi_package/models/future_root.py index 2fcb2074c..48e974e29 100644 --- a/openapi_project/openapi_package/models/future_root.py +++ b/openapi_project/openapi_package/models/future_root.py @@ -17,9 +17,9 @@ from typing import cast if TYPE_CHECKING: - from ..models.trading_session_group import TradingSessionGroup - from ..models.date import Date from ..models.future_root_aliases import FutureRootAliases + from ..models.date import Date + from ..models.trading_session_group import TradingSessionGroup T = TypeVar("T", bound="FutureRoot") @@ -83,21 +83,21 @@ class FutureRoot: trading_session_group: Unset | "TradingSessionGroup" = UNSET def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = UNSET - if not isinstance(self.aliases, Unset): - aliases = self.aliases.to_dict() + aliases: Unset | dict[str, Any] = ( + UNSET if isinstance(self.aliases, Unset) else self.aliases.to_dict() + ) - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value + currency: Unset | str = ( + UNSET if isinstance(self.currency, Unset) else self.currency.value + ) - listed_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.listed_dt, Unset): - listed_dt = self.listed_dt.to_dict() + listed_dt: Unset | dict[str, Any] = ( + UNSET if isinstance(self.listed_dt, Unset) else self.listed_dt.to_dict() + ) - delisted_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.delisted_dt, Unset): - delisted_dt = self.delisted_dt.to_dict() + delisted_dt: Unset | dict[str, Any] = ( + UNSET if isinstance(self.delisted_dt, Unset) else self.delisted_dt.to_dict() + ) description = self.description @@ -111,19 +111,25 @@ def to_dict(self) -> dict[str, Any]: price_display_factor = self.price_display_factor - price_display_format: Unset | str = UNSET - if not isinstance(self.price_display_format, Unset): - price_display_format = self.price_display_format.value + price_display_format: Unset | str = ( + UNSET + if isinstance(self.price_display_format, Unset) + else self.price_display_format.value + ) qty_display_factor = self.qty_display_factor - qty_display_format: Unset | str = UNSET - if not isinstance(self.qty_display_format, Unset): - qty_display_format = self.qty_display_format.value + qty_display_format: Unset | str = ( + UNSET + if isinstance(self.qty_display_format, Unset) + else self.qty_display_format.value + ) - security_category: Unset | str = UNSET - if not isinstance(self.security_category, Unset): - security_category = self.security_category.value + security_category: Unset | str = ( + UNSET + if isinstance(self.security_category, Unset) + else self.security_category.value + ) symbol = self.symbol @@ -140,25 +146,31 @@ def to_dict(self) -> dict[str, Any]: traded_exchanges_item = traded_exchanges_item_data.value traded_exchanges.append(traded_exchanges_item) - product_group: Unset | str = UNSET - if not isinstance(self.product_group, Unset): - product_group = self.product_group.value + product_group: Unset | str = ( + UNSET if isinstance(self.product_group, Unset) else self.product_group.value + ) - product_sub_group: Unset | str = UNSET - if not isinstance(self.product_sub_group, Unset): - product_sub_group = self.product_sub_group.value + product_sub_group: Unset | str = ( + UNSET + if isinstance(self.product_sub_group, Unset) + else self.product_sub_group.value + ) - settlement_deliverable_type: Unset | str = UNSET - if not isinstance(self.settlement_deliverable_type, Unset): - settlement_deliverable_type = self.settlement_deliverable_type.value + settlement_deliverable_type: Unset | str = ( + UNSET + if isinstance(self.settlement_deliverable_type, Unset) + else self.settlement_deliverable_type.value + ) unit_of_measure = self.unit_of_measure unit_of_measure_qty = self.unit_of_measure_qty - trading_session_group: Unset | dict[str, Any] = UNSET - if not isinstance(self.trading_session_group, Unset): - trading_session_group = self.trading_session_group.to_dict() + trading_session_group: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.trading_session_group, Unset) + else self.trading_session_group.to_dict() + ) field_dict: dict[str, Any] = {} @@ -220,32 +232,26 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _aliases = d.pop("aliases", UNSET) - aliases: Unset | FutureRootAliases - if isinstance(_aliases, Unset): - aliases = UNSET - else: - aliases = FutureRootAliases.from_dict(_aliases) + aliases: Unset | FutureRootAliases = ( + UNSET + if isinstance(_aliases, Unset) + else FutureRootAliases.from_dict(_aliases) + ) _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) + currency: Unset | Currency = ( + UNSET if isinstance(_currency, Unset) else Currency(_currency) + ) _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date - if isinstance(_listed_dt, Unset): - listed_dt = UNSET - else: - listed_dt = Date.from_dict(_listed_dt) + listed_dt: Unset | Date = ( + UNSET if isinstance(_listed_dt, Unset) else Date.from_dict(_listed_dt) + ) _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date - if isinstance(_delisted_dt, Unset): - delisted_dt = UNSET - else: - delisted_dt = Date.from_dict(_delisted_dt) + delisted_dt: Unset | Date = ( + UNSET if isinstance(_delisted_dt, Unset) else Date.from_dict(_delisted_dt) + ) description = d.pop("description", UNSET) @@ -260,27 +266,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: price_display_factor = d.pop("priceDisplayFactor", UNSET) _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat - if isinstance(_price_display_format, Unset): - price_display_format = UNSET - else: - price_display_format = NumericDisplayFormat(_price_display_format) + price_display_format: Unset | NumericDisplayFormat = ( + UNSET + if isinstance(_price_display_format, Unset) + else NumericDisplayFormat(_price_display_format) + ) qty_display_factor = d.pop("qtyDisplayFactor", UNSET) _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat - if isinstance(_qty_display_format, Unset): - qty_display_format = UNSET - else: - qty_display_format = NumericDisplayFormat(_qty_display_format) + qty_display_format: Unset | NumericDisplayFormat = ( + UNSET + if isinstance(_qty_display_format, Unset) + else NumericDisplayFormat(_qty_display_format) + ) _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory - if isinstance(_security_category, Unset): - security_category = UNSET - else: - security_category = SecurityCategory(_security_category) + security_category: Unset | SecurityCategory = ( + UNSET + if isinstance(_security_category, Unset) + else SecurityCategory(_security_category) + ) symbol = d.pop("symbol", UNSET) @@ -298,40 +304,34 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: traded_exchanges.append(traded_exchanges_item) _product_group = d.pop("productGroup", UNSET) - product_group: Unset | ProductGroup - if isinstance(_product_group, Unset): - product_group = UNSET - else: - product_group = ProductGroup(_product_group) + product_group: Unset | ProductGroup = ( + UNSET if isinstance(_product_group, Unset) else ProductGroup(_product_group) + ) _product_sub_group = d.pop("productSubGroup", UNSET) - product_sub_group: Unset | ProductSubGroup - if isinstance(_product_sub_group, Unset): - product_sub_group = UNSET - else: - product_sub_group = ProductSubGroup(_product_sub_group) + product_sub_group: Unset | ProductSubGroup = ( + UNSET + if isinstance(_product_sub_group, Unset) + else ProductSubGroup(_product_sub_group) + ) _settlement_deliverable_type = d.pop("settlementDeliverableType", UNSET) - settlement_deliverable_type: Unset | SettlementDeliverableType - if isinstance(_settlement_deliverable_type, Unset): - settlement_deliverable_type = UNSET - else: - settlement_deliverable_type = SettlementDeliverableType( - _settlement_deliverable_type - ) + settlement_deliverable_type: Unset | SettlementDeliverableType = ( + UNSET + if isinstance(_settlement_deliverable_type, Unset) + else SettlementDeliverableType(_settlement_deliverable_type) + ) unit_of_measure = d.pop("unitOfMeasure", UNSET) unit_of_measure_qty = d.pop("unitOfMeasureQty", UNSET) _trading_session_group = d.pop("tradingSessionGroup", UNSET) - trading_session_group: Unset | TradingSessionGroup - if isinstance(_trading_session_group, Unset): - trading_session_group = UNSET - else: - trading_session_group = TradingSessionGroup.from_dict( - _trading_session_group - ) + trading_session_group: Unset | TradingSessionGroup = ( + UNSET + if isinstance(_trading_session_group, Unset) + else TradingSessionGroup.from_dict(_trading_session_group) + ) future_root = cls( aliases=aliases, diff --git a/openapi_project/openapi_package/models/future_root_aliases.py b/openapi_project/openapi_package/models/future_root_aliases.py index 1bc59fe59..1c2a74e37 100644 --- a/openapi_project/openapi_package/models/future_root_aliases.py +++ b/openapi_project/openapi_package/models/future_root_aliases.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="FutureRootAliases") - @_attrs_define class FutureRootAliases: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - future_root_aliases = cls( - ) - - + future_root_aliases = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/future_spread.py b/openapi_project/openapi_package/models/future_spread.py index fb511d352..b7dcf7a14 100644 --- a/openapi_project/openapi_package/models/future_spread.py +++ b/openapi_project/openapi_package/models/future_spread.py @@ -84,21 +84,21 @@ class FutureSpread: spread_code: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = UNSET - if not isinstance(self.aliases, Unset): - aliases = self.aliases.to_dict() + aliases: Unset | dict[str, Any] = ( + UNSET if isinstance(self.aliases, Unset) else self.aliases.to_dict() + ) - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value + currency: Unset | str = ( + UNSET if isinstance(self.currency, Unset) else self.currency.value + ) - listed_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.listed_dt, Unset): - listed_dt = self.listed_dt.to_dict() + listed_dt: Unset | dict[str, Any] = ( + UNSET if isinstance(self.listed_dt, Unset) else self.listed_dt.to_dict() + ) - delisted_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.delisted_dt, Unset): - delisted_dt = self.delisted_dt.to_dict() + delisted_dt: Unset | dict[str, Any] = ( + UNSET if isinstance(self.delisted_dt, Unset) else self.delisted_dt.to_dict() + ) description = self.description @@ -112,19 +112,25 @@ def to_dict(self) -> dict[str, Any]: price_display_factor = self.price_display_factor - price_display_format: Unset | str = UNSET - if not isinstance(self.price_display_format, Unset): - price_display_format = self.price_display_format.value + price_display_format: Unset | str = ( + UNSET + if isinstance(self.price_display_format, Unset) + else self.price_display_format.value + ) qty_display_factor = self.qty_display_factor - qty_display_format: Unset | str = UNSET - if not isinstance(self.qty_display_format, Unset): - qty_display_format = self.qty_display_format.value + qty_display_format: Unset | str = ( + UNSET + if isinstance(self.qty_display_format, Unset) + else self.qty_display_format.value + ) - security_category: Unset | str = UNSET - if not isinstance(self.security_category, Unset): - security_category = self.security_category.value + security_category: Unset | str = ( + UNSET + if isinstance(self.security_category, Unset) + else self.security_category.value + ) symbol = self.symbol @@ -145,21 +151,29 @@ def to_dict(self) -> dict[str, Any]: display_factor = self.display_factor - first_notice_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.first_notice_dt, Unset): - first_notice_dt = self.first_notice_dt.to_dict() + first_notice_dt: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.first_notice_dt, Unset) + else self.first_notice_dt.to_dict() + ) - first_trade_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.first_trade_dt, Unset): - first_trade_dt = self.first_trade_dt.to_dict() + first_trade_dt: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.first_trade_dt, Unset) + else self.first_trade_dt.to_dict() + ) - last_notice_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.last_notice_dt, Unset): - last_notice_dt = self.last_notice_dt.to_dict() + last_notice_dt: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.last_notice_dt, Unset) + else self.last_notice_dt.to_dict() + ) - last_trade_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.last_trade_dt, Unset): - last_trade_dt = self.last_trade_dt.to_dict() + last_trade_dt: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.last_trade_dt, Unset) + else self.last_trade_dt.to_dict() + ) legs: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.legs, Unset): @@ -234,32 +248,26 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _aliases = d.pop("aliases", UNSET) - aliases: Unset | FutureSpreadAliases - if isinstance(_aliases, Unset): - aliases = UNSET - else: - aliases = FutureSpreadAliases.from_dict(_aliases) + aliases: Unset | FutureSpreadAliases = ( + UNSET + if isinstance(_aliases, Unset) + else FutureSpreadAliases.from_dict(_aliases) + ) _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) + currency: Unset | Currency = ( + UNSET if isinstance(_currency, Unset) else Currency(_currency) + ) _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date - if isinstance(_listed_dt, Unset): - listed_dt = UNSET - else: - listed_dt = Date.from_dict(_listed_dt) + listed_dt: Unset | Date = ( + UNSET if isinstance(_listed_dt, Unset) else Date.from_dict(_listed_dt) + ) _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date - if isinstance(_delisted_dt, Unset): - delisted_dt = UNSET - else: - delisted_dt = Date.from_dict(_delisted_dt) + delisted_dt: Unset | Date = ( + UNSET if isinstance(_delisted_dt, Unset) else Date.from_dict(_delisted_dt) + ) description = d.pop("description", UNSET) @@ -274,27 +282,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: price_display_factor = d.pop("priceDisplayFactor", UNSET) _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat - if isinstance(_price_display_format, Unset): - price_display_format = UNSET - else: - price_display_format = NumericDisplayFormat(_price_display_format) + price_display_format: Unset | NumericDisplayFormat = ( + UNSET + if isinstance(_price_display_format, Unset) + else NumericDisplayFormat(_price_display_format) + ) qty_display_factor = d.pop("qtyDisplayFactor", UNSET) _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat - if isinstance(_qty_display_format, Unset): - qty_display_format = UNSET - else: - qty_display_format = NumericDisplayFormat(_qty_display_format) + qty_display_format: Unset | NumericDisplayFormat = ( + UNSET + if isinstance(_qty_display_format, Unset) + else NumericDisplayFormat(_qty_display_format) + ) _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory - if isinstance(_security_category, Unset): - security_category = UNSET - else: - security_category = SecurityCategory(_security_category) + security_category: Unset | SecurityCategory = ( + UNSET + if isinstance(_security_category, Unset) + else SecurityCategory(_security_category) + ) symbol = d.pop("symbol", UNSET) @@ -316,32 +324,32 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: display_factor = d.pop("displayFactor", UNSET) _first_notice_dt = d.pop("firstNoticeDt", UNSET) - first_notice_dt: Unset | Date - if isinstance(_first_notice_dt, Unset): - first_notice_dt = UNSET - else: - first_notice_dt = Date.from_dict(_first_notice_dt) + first_notice_dt: Unset | Date = ( + UNSET + if isinstance(_first_notice_dt, Unset) + else Date.from_dict(_first_notice_dt) + ) _first_trade_dt = d.pop("firstTradeDt", UNSET) - first_trade_dt: Unset | Date - if isinstance(_first_trade_dt, Unset): - first_trade_dt = UNSET - else: - first_trade_dt = Date.from_dict(_first_trade_dt) + first_trade_dt: Unset | Date = ( + UNSET + if isinstance(_first_trade_dt, Unset) + else Date.from_dict(_first_trade_dt) + ) _last_notice_dt = d.pop("lastNoticeDt", UNSET) - last_notice_dt: Unset | Date - if isinstance(_last_notice_dt, Unset): - last_notice_dt = UNSET - else: - last_notice_dt = Date.from_dict(_last_notice_dt) + last_notice_dt: Unset | Date = ( + UNSET + if isinstance(_last_notice_dt, Unset) + else Date.from_dict(_last_notice_dt) + ) _last_trade_dt = d.pop("lastTradeDt", UNSET) - last_trade_dt: Unset | Date - if isinstance(_last_trade_dt, Unset): - last_trade_dt = UNSET - else: - last_trade_dt = Date.from_dict(_last_trade_dt) + last_trade_dt: Unset | Date = ( + UNSET + if isinstance(_last_trade_dt, Unset) + else Date.from_dict(_last_trade_dt) + ) legs = [] _legs = d.pop("legs", UNSET) diff --git a/openapi_project/openapi_package/models/future_spread_aliases.py b/openapi_project/openapi_package/models/future_spread_aliases.py index 411d5f2c9..65cbcf023 100644 --- a/openapi_project/openapi_package/models/future_spread_aliases.py +++ b/openapi_project/openapi_package/models/future_spread_aliases.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="FutureSpreadAliases") - @_attrs_define class FutureSpreadAliases: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - future_spread_aliases = cls( - ) - - + future_spread_aliases = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/future_spread_leg.py b/openapi_project/openapi_package/models/future_spread_leg.py index d7fadd883..34ed49002 100644 --- a/openapi_project/openapi_package/models/future_spread_leg.py +++ b/openapi_project/openapi_package/models/future_spread_leg.py @@ -44,17 +44,17 @@ def to_dict(self) -> dict[str, Any]: ratio = self.ratio - future: Unset | dict[str, Any] = UNSET - if not isinstance(self.future, Unset): - future = self.future.to_dict() + future: Unset | dict[str, Any] = ( + UNSET if isinstance(self.future, Unset) else self.future.to_dict() + ) - side: Unset | str = UNSET - if not isinstance(self.side, Unset): - side = self.side.value + side: Unset | str = UNSET if isinstance(self.side, Unset) else self.side.value - spread_leg_type: Unset | str = UNSET - if not isinstance(self.spread_leg_type, Unset): - spread_leg_type = self.spread_leg_type.value + spread_leg_type: Unset | str = ( + UNSET + if isinstance(self.spread_leg_type, Unset) + else self.spread_leg_type.value + ) field_dict: dict[str, Any] = {} @@ -84,25 +84,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ratio = d.pop("ratio", UNSET) _future = d.pop("future", UNSET) - future: Unset | Future - if isinstance(_future, Unset): - future = UNSET - else: - future = Future.from_dict(_future) + future: Unset | Future = ( + UNSET if isinstance(_future, Unset) else Future.from_dict(_future) + ) _side = d.pop("side", UNSET) - side: Unset | SpreadLegSide - if isinstance(_side, Unset): - side = UNSET - else: - side = SpreadLegSide(_side) + side: Unset | SpreadLegSide = ( + UNSET if isinstance(_side, Unset) else SpreadLegSide(_side) + ) _spread_leg_type = d.pop("spreadLegType", UNSET) - spread_leg_type: Unset | SpreadLegType - if isinstance(_spread_leg_type, Unset): - spread_leg_type = UNSET - else: - spread_leg_type = SpreadLegType(_spread_leg_type) + spread_leg_type: Unset | SpreadLegType = ( + UNSET + if isinstance(_spread_leg_type, Unset) + else SpreadLegType(_spread_leg_type) + ) future_spread_leg = cls( delta=delta, diff --git a/openapi_project/openapi_package/models/fx.py b/openapi_project/openapi_package/models/fx.py index 8b321568b..4519db7c8 100644 --- a/openapi_project/openapi_package/models/fx.py +++ b/openapi_project/openapi_package/models/fx.py @@ -69,21 +69,21 @@ class Fx: quote_currency: Unset | Currency = UNSET def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = UNSET - if not isinstance(self.aliases, Unset): - aliases = self.aliases.to_dict() + aliases: Unset | dict[str, Any] = ( + UNSET if isinstance(self.aliases, Unset) else self.aliases.to_dict() + ) - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value + currency: Unset | str = ( + UNSET if isinstance(self.currency, Unset) else self.currency.value + ) - listed_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.listed_dt, Unset): - listed_dt = self.listed_dt.to_dict() + listed_dt: Unset | dict[str, Any] = ( + UNSET if isinstance(self.listed_dt, Unset) else self.listed_dt.to_dict() + ) - delisted_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.delisted_dt, Unset): - delisted_dt = self.delisted_dt.to_dict() + delisted_dt: Unset | dict[str, Any] = ( + UNSET if isinstance(self.delisted_dt, Unset) else self.delisted_dt.to_dict() + ) description = self.description @@ -97,19 +97,25 @@ def to_dict(self) -> dict[str, Any]: price_display_factor = self.price_display_factor - price_display_format: Unset | str = UNSET - if not isinstance(self.price_display_format, Unset): - price_display_format = self.price_display_format.value + price_display_format: Unset | str = ( + UNSET + if isinstance(self.price_display_format, Unset) + else self.price_display_format.value + ) qty_display_factor = self.qty_display_factor - qty_display_format: Unset | str = UNSET - if not isinstance(self.qty_display_format, Unset): - qty_display_format = self.qty_display_format.value + qty_display_format: Unset | str = ( + UNSET + if isinstance(self.qty_display_format, Unset) + else self.qty_display_format.value + ) - security_category: Unset | str = UNSET - if not isinstance(self.security_category, Unset): - security_category = self.security_category.value + security_category: Unset | str = ( + UNSET + if isinstance(self.security_category, Unset) + else self.security_category.value + ) symbol = self.symbol @@ -126,9 +132,11 @@ def to_dict(self) -> dict[str, Any]: traded_exchanges_item = traded_exchanges_item_data.value traded_exchanges.append(traded_exchanges_item) - quote_currency: Unset | str = UNSET - if not isinstance(self.quote_currency, Unset): - quote_currency = self.quote_currency.value + quote_currency: Unset | str = ( + UNSET + if isinstance(self.quote_currency, Unset) + else self.quote_currency.value + ) field_dict: dict[str, Any] = {} @@ -180,32 +188,24 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _aliases = d.pop("aliases", UNSET) - aliases: Unset | FxAliases - if isinstance(_aliases, Unset): - aliases = UNSET - else: - aliases = FxAliases.from_dict(_aliases) + aliases: Unset | FxAliases = ( + UNSET if isinstance(_aliases, Unset) else FxAliases.from_dict(_aliases) + ) _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) + currency: Unset | Currency = ( + UNSET if isinstance(_currency, Unset) else Currency(_currency) + ) _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date - if isinstance(_listed_dt, Unset): - listed_dt = UNSET - else: - listed_dt = Date.from_dict(_listed_dt) + listed_dt: Unset | Date = ( + UNSET if isinstance(_listed_dt, Unset) else Date.from_dict(_listed_dt) + ) _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date - if isinstance(_delisted_dt, Unset): - delisted_dt = UNSET - else: - delisted_dt = Date.from_dict(_delisted_dt) + delisted_dt: Unset | Date = ( + UNSET if isinstance(_delisted_dt, Unset) else Date.from_dict(_delisted_dt) + ) description = d.pop("description", UNSET) @@ -220,27 +220,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: price_display_factor = d.pop("priceDisplayFactor", UNSET) _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat - if isinstance(_price_display_format, Unset): - price_display_format = UNSET - else: - price_display_format = NumericDisplayFormat(_price_display_format) + price_display_format: Unset | NumericDisplayFormat = ( + UNSET + if isinstance(_price_display_format, Unset) + else NumericDisplayFormat(_price_display_format) + ) qty_display_factor = d.pop("qtyDisplayFactor", UNSET) _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat - if isinstance(_qty_display_format, Unset): - qty_display_format = UNSET - else: - qty_display_format = NumericDisplayFormat(_qty_display_format) + qty_display_format: Unset | NumericDisplayFormat = ( + UNSET + if isinstance(_qty_display_format, Unset) + else NumericDisplayFormat(_qty_display_format) + ) _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory - if isinstance(_security_category, Unset): - security_category = UNSET - else: - security_category = SecurityCategory(_security_category) + security_category: Unset | SecurityCategory = ( + UNSET + if isinstance(_security_category, Unset) + else SecurityCategory(_security_category) + ) symbol = d.pop("symbol", UNSET) @@ -258,11 +258,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: traded_exchanges.append(traded_exchanges_item) _quote_currency = d.pop("quoteCurrency", UNSET) - quote_currency: Unset | Currency - if isinstance(_quote_currency, Unset): - quote_currency = UNSET - else: - quote_currency = Currency(_quote_currency) + quote_currency: Unset | Currency = ( + UNSET if isinstance(_quote_currency, Unset) else Currency(_quote_currency) + ) fx = cls( aliases=aliases, diff --git a/openapi_project/openapi_package/models/fx_aliases.py b/openapi_project/openapi_package/models/fx_aliases.py index 98f318abc..1452e16d8 100644 --- a/openapi_project/openapi_package/models/fx_aliases.py +++ b/openapi_project/openapi_package/models/fx_aliases.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="FxAliases") - @_attrs_define class FxAliases: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - fx_aliases = cls( - ) - - + fx_aliases = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/generic_order.py b/openapi_project/openapi_package/models/generic_order.py index 7e03799e8..c443c983a 100644 --- a/openapi_project/openapi_package/models/generic_order.py +++ b/openapi_project/openapi_package/models/generic_order.py @@ -11,8 +11,8 @@ if TYPE_CHECKING: from ..models.order import Order - from ..models.multi_leg_order import MultiLegOrder from ..models.multi_leg_order_cross import MultiLegOrderCross + from ..models.multi_leg_order import MultiLegOrder from ..models.order_cross import OrderCross @@ -35,21 +35,25 @@ class GenericOrder: multi_leg_order_cross: Unset | "MultiLegOrderCross" = UNSET def to_dict(self) -> dict[str, Any]: - order: Unset | dict[str, Any] = UNSET - if not isinstance(self.order, Unset): - order = self.order.to_dict() + order: Unset | dict[str, Any] = ( + UNSET if isinstance(self.order, Unset) else self.order.to_dict() + ) - order_cross: Unset | dict[str, Any] = UNSET - if not isinstance(self.order_cross, Unset): - order_cross = self.order_cross.to_dict() + order_cross: Unset | dict[str, Any] = ( + UNSET if isinstance(self.order_cross, Unset) else self.order_cross.to_dict() + ) - multi_leg_order: Unset | dict[str, Any] = UNSET - if not isinstance(self.multi_leg_order, Unset): - multi_leg_order = self.multi_leg_order.to_dict() + multi_leg_order: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.multi_leg_order, Unset) + else self.multi_leg_order.to_dict() + ) - multi_leg_order_cross: Unset | dict[str, Any] = UNSET - if not isinstance(self.multi_leg_order_cross, Unset): - multi_leg_order_cross = self.multi_leg_order_cross.to_dict() + multi_leg_order_cross: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.multi_leg_order_cross, Unset) + else self.multi_leg_order_cross.to_dict() + ) field_dict: dict[str, Any] = {} @@ -69,32 +73,30 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _order = d.pop("order", UNSET) - order: Unset | Order - if isinstance(_order, Unset): - order = UNSET - else: - order = Order.from_dict(_order) + order: Unset | Order = ( + UNSET if isinstance(_order, Unset) else Order.from_dict(_order) + ) _order_cross = d.pop("orderCross", UNSET) - order_cross: Unset | OrderCross - if isinstance(_order_cross, Unset): - order_cross = UNSET - else: - order_cross = OrderCross.from_dict(_order_cross) + order_cross: Unset | OrderCross = ( + UNSET + if isinstance(_order_cross, Unset) + else OrderCross.from_dict(_order_cross) + ) _multi_leg_order = d.pop("multiLegOrder", UNSET) - multi_leg_order: Unset | MultiLegOrder - if isinstance(_multi_leg_order, Unset): - multi_leg_order = UNSET - else: - multi_leg_order = MultiLegOrder.from_dict(_multi_leg_order) + multi_leg_order: Unset | MultiLegOrder = ( + UNSET + if isinstance(_multi_leg_order, Unset) + else MultiLegOrder.from_dict(_multi_leg_order) + ) _multi_leg_order_cross = d.pop("multiLegOrderCross", UNSET) - multi_leg_order_cross: Unset | MultiLegOrderCross - if isinstance(_multi_leg_order_cross, Unset): - multi_leg_order_cross = UNSET - else: - multi_leg_order_cross = MultiLegOrderCross.from_dict(_multi_leg_order_cross) + multi_leg_order_cross: Unset | MultiLegOrderCross = ( + UNSET + if isinstance(_multi_leg_order_cross, Unset) + else MultiLegOrderCross.from_dict(_multi_leg_order_cross) + ) generic_order = cls( order=order, diff --git a/openapi_project/openapi_package/models/get_active_user_response.py b/openapi_project/openapi_package/models/get_active_user_response.py index 85db97409..1ff439427 100644 --- a/openapi_project/openapi_package/models/get_active_user_response.py +++ b/openapi_project/openapi_package/models/get_active_user_response.py @@ -31,15 +31,15 @@ class GetActiveUserResponse: status_code: Unset | StatusCode = UNSET def to_dict(self) -> dict[str, Any]: - user: Unset | dict[str, Any] = UNSET - if not isinstance(self.user, Unset): - user = self.user.to_dict() + user: Unset | dict[str, Any] = ( + UNSET if isinstance(self.user, Unset) else self.user.to_dict() + ) error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -57,20 +57,16 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _user = d.pop("user", UNSET) - user: Unset | User - if isinstance(_user, Unset): - user = UNSET - else: - user = User.from_dict(_user) + user: Unset | User = ( + UNSET if isinstance(_user, Unset) else User.from_dict(_user) + ) error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) get_active_user_response = cls( user=user, diff --git a/openapi_project/openapi_package/models/get_server_info_response.py b/openapi_project/openapi_package/models/get_server_info_response.py index 4b2760c0b..7877e28ff 100644 --- a/openapi_project/openapi_package/models/get_server_info_response.py +++ b/openapi_project/openapi_package/models/get_server_info_response.py @@ -57,15 +57,17 @@ def to_dict(self) -> dict[str, Any]: site = self.site - system_settings: Unset | dict[str, Any] = UNSET - if not isinstance(self.system_settings, Unset): - system_settings = self.system_settings.to_dict() + system_settings: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.system_settings, Unset) + else self.system_settings.to_dict() + ) error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -107,22 +109,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: site = d.pop("site", UNSET) _system_settings = d.pop("systemSettings", UNSET) - system_settings: Unset | GetServerInfoResponseSystemSettings - if isinstance(_system_settings, Unset): - system_settings = UNSET - else: - system_settings = GetServerInfoResponseSystemSettings.from_dict( - _system_settings - ) + system_settings: Unset | GetServerInfoResponseSystemSettings = ( + UNSET + if isinstance(_system_settings, Unset) + else GetServerInfoResponseSystemSettings.from_dict(_system_settings) + ) error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) get_server_info_response = cls( environment=environment, diff --git a/openapi_project/openapi_package/models/get_server_info_response_system_settings.py b/openapi_project/openapi_package/models/get_server_info_response_system_settings.py index f05016b8c..717b00d91 100644 --- a/openapi_project/openapi_package/models/get_server_info_response_system_settings.py +++ b/openapi_project/openapi_package/models/get_server_info_response_system_settings.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="GetServerInfoResponseSystemSettings") - @_attrs_define class GetServerInfoResponseSystemSettings: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - get_server_info_response_system_settings = cls( - ) - - + get_server_info_response_system_settings = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - get_server_info_response_system_settings.additional_properties = additional_properties + get_server_info_response_system_settings.additional_properties = ( + additional_properties + ) return get_server_info_response_system_settings @property diff --git a/openapi_project/openapi_package/models/get_server_time_response.py b/openapi_project/openapi_package/models/get_server_time_response.py index 55f425c51..53adc55ba 100644 --- a/openapi_project/openapi_package/models/get_server_time_response.py +++ b/openapi_project/openapi_package/models/get_server_time_response.py @@ -31,9 +31,9 @@ def to_dict(self) -> dict[str, Any]: error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -55,11 +55,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) get_server_time_response = cls( server_time_utc=server_time_utc, diff --git a/openapi_project/openapi_package/models/get_trading_holidays_response.py b/openapi_project/openapi_package/models/get_trading_holidays_response.py index 3eb203b70..a1bd1dadf 100644 --- a/openapi_project/openapi_package/models/get_trading_holidays_response.py +++ b/openapi_project/openapi_package/models/get_trading_holidays_response.py @@ -40,9 +40,9 @@ def to_dict(self) -> dict[str, Any]: error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -69,11 +69,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) get_trading_holidays_response = cls( trading_holidays=trading_holidays, diff --git a/openapi_project/openapi_package/models/index.py b/openapi_project/openapi_package/models/index.py index 890c2f656..0c40dd5fa 100644 --- a/openapi_project/openapi_package/models/index.py +++ b/openapi_project/openapi_package/models/index.py @@ -14,8 +14,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.date import Date from ..models.index_aliases import IndexAliases + from ..models.date import Date T = TypeVar("T", bound="Index") @@ -67,21 +67,21 @@ class Index: traded_exchanges: Unset | list[ExchangeCode] = UNSET def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = UNSET - if not isinstance(self.aliases, Unset): - aliases = self.aliases.to_dict() + aliases: Unset | dict[str, Any] = ( + UNSET if isinstance(self.aliases, Unset) else self.aliases.to_dict() + ) - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value + currency: Unset | str = ( + UNSET if isinstance(self.currency, Unset) else self.currency.value + ) - listed_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.listed_dt, Unset): - listed_dt = self.listed_dt.to_dict() + listed_dt: Unset | dict[str, Any] = ( + UNSET if isinstance(self.listed_dt, Unset) else self.listed_dt.to_dict() + ) - delisted_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.delisted_dt, Unset): - delisted_dt = self.delisted_dt.to_dict() + delisted_dt: Unset | dict[str, Any] = ( + UNSET if isinstance(self.delisted_dt, Unset) else self.delisted_dt.to_dict() + ) description = self.description @@ -95,19 +95,25 @@ def to_dict(self) -> dict[str, Any]: price_display_factor = self.price_display_factor - price_display_format: Unset | str = UNSET - if not isinstance(self.price_display_format, Unset): - price_display_format = self.price_display_format.value + price_display_format: Unset | str = ( + UNSET + if isinstance(self.price_display_format, Unset) + else self.price_display_format.value + ) qty_display_factor = self.qty_display_factor - qty_display_format: Unset | str = UNSET - if not isinstance(self.qty_display_format, Unset): - qty_display_format = self.qty_display_format.value + qty_display_format: Unset | str = ( + UNSET + if isinstance(self.qty_display_format, Unset) + else self.qty_display_format.value + ) - security_category: Unset | str = UNSET - if not isinstance(self.security_category, Unset): - security_category = self.security_category.value + security_category: Unset | str = ( + UNSET + if isinstance(self.security_category, Unset) + else self.security_category.value + ) symbol = self.symbol @@ -172,32 +178,24 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _aliases = d.pop("aliases", UNSET) - aliases: Unset | IndexAliases - if isinstance(_aliases, Unset): - aliases = UNSET - else: - aliases = IndexAliases.from_dict(_aliases) + aliases: Unset | IndexAliases = ( + UNSET if isinstance(_aliases, Unset) else IndexAliases.from_dict(_aliases) + ) _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) + currency: Unset | Currency = ( + UNSET if isinstance(_currency, Unset) else Currency(_currency) + ) _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date - if isinstance(_listed_dt, Unset): - listed_dt = UNSET - else: - listed_dt = Date.from_dict(_listed_dt) + listed_dt: Unset | Date = ( + UNSET if isinstance(_listed_dt, Unset) else Date.from_dict(_listed_dt) + ) _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date - if isinstance(_delisted_dt, Unset): - delisted_dt = UNSET - else: - delisted_dt = Date.from_dict(_delisted_dt) + delisted_dt: Unset | Date = ( + UNSET if isinstance(_delisted_dt, Unset) else Date.from_dict(_delisted_dt) + ) description = d.pop("description", UNSET) @@ -212,27 +210,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: price_display_factor = d.pop("priceDisplayFactor", UNSET) _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat - if isinstance(_price_display_format, Unset): - price_display_format = UNSET - else: - price_display_format = NumericDisplayFormat(_price_display_format) + price_display_format: Unset | NumericDisplayFormat = ( + UNSET + if isinstance(_price_display_format, Unset) + else NumericDisplayFormat(_price_display_format) + ) qty_display_factor = d.pop("qtyDisplayFactor", UNSET) _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat - if isinstance(_qty_display_format, Unset): - qty_display_format = UNSET - else: - qty_display_format = NumericDisplayFormat(_qty_display_format) + qty_display_format: Unset | NumericDisplayFormat = ( + UNSET + if isinstance(_qty_display_format, Unset) + else NumericDisplayFormat(_qty_display_format) + ) _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory - if isinstance(_security_category, Unset): - security_category = UNSET - else: - security_category = SecurityCategory(_security_category) + security_category: Unset | SecurityCategory = ( + UNSET + if isinstance(_security_category, Unset) + else SecurityCategory(_security_category) + ) symbol = d.pop("symbol", UNSET) diff --git a/openapi_project/openapi_package/models/index_aliases.py b/openapi_project/openapi_package/models/index_aliases.py index e77914b97..d8d60d2d6 100644 --- a/openapi_project/openapi_package/models/index_aliases.py +++ b/openapi_project/openapi_package/models/index_aliases.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="IndexAliases") - @_attrs_define class IndexAliases: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - index_aliases = cls( - ) - - + index_aliases = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/list_accounts_response.py b/openapi_project/openapi_package/models/list_accounts_response.py index 65c7b55dd..6f03d479a 100644 --- a/openapi_project/openapi_package/models/list_accounts_response.py +++ b/openapi_project/openapi_package/models/list_accounts_response.py @@ -40,9 +40,9 @@ def to_dict(self) -> dict[str, Any]: error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -69,11 +69,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) list_accounts_response = cls( accounts=accounts, diff --git a/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py b/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py index 5ad1cc69a..4fd221f02 100644 --- a/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py +++ b/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py @@ -40,9 +40,9 @@ def to_dict(self) -> dict[str, Any]: error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -71,11 +71,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) list_affiliated_trading_firms_response = cls( affiliated_firms=affiliated_firms, diff --git a/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py b/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py index 7e06170a3..f8ab79c6f 100644 --- a/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py +++ b/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py @@ -40,9 +40,9 @@ def to_dict(self) -> dict[str, Any]: error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -69,11 +69,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) list_easy_to_borrow_securities_response = cls( securities=securities, diff --git a/openapi_project/openapi_package/models/list_exchanges_response.py b/openapi_project/openapi_package/models/list_exchanges_response.py index 7783340b3..9cd6c0cde 100644 --- a/openapi_project/openapi_package/models/list_exchanges_response.py +++ b/openapi_project/openapi_package/models/list_exchanges_response.py @@ -40,9 +40,9 @@ def to_dict(self) -> dict[str, Any]: error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -69,11 +69,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) list_exchanges_response = cls( exchanges=exchanges, diff --git a/openapi_project/openapi_package/models/list_option_chains_repsonse.py b/openapi_project/openapi_package/models/list_option_chains_repsonse.py index 89755d630..679ad1b2c 100644 --- a/openapi_project/openapi_package/models/list_option_chains_repsonse.py +++ b/openapi_project/openapi_package/models/list_option_chains_repsonse.py @@ -40,9 +40,9 @@ def to_dict(self) -> dict[str, Any]: error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -69,11 +69,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) list_option_chains_repsonse = cls( option_chains=option_chains, diff --git a/openapi_project/openapi_package/models/list_orders_response.py b/openapi_project/openapi_package/models/list_orders_response.py index b7078e18a..12d302248 100644 --- a/openapi_project/openapi_package/models/list_orders_response.py +++ b/openapi_project/openapi_package/models/list_orders_response.py @@ -40,9 +40,9 @@ def to_dict(self) -> dict[str, Any]: error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -69,11 +69,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) list_orders_response = cls( orders=orders, diff --git a/openapi_project/openapi_package/models/list_positions_response.py b/openapi_project/openapi_package/models/list_positions_response.py index 2c23bd577..c04b4c0cf 100644 --- a/openapi_project/openapi_package/models/list_positions_response.py +++ b/openapi_project/openapi_package/models/list_positions_response.py @@ -40,9 +40,9 @@ def to_dict(self) -> dict[str, Any]: error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -69,11 +69,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) list_positions_response = cls( positions=positions, diff --git a/openapi_project/openapi_package/models/list_routes_response.py b/openapi_project/openapi_package/models/list_routes_response.py index f7c82457e..4c47fbcb5 100644 --- a/openapi_project/openapi_package/models/list_routes_response.py +++ b/openapi_project/openapi_package/models/list_routes_response.py @@ -11,8 +11,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.route_applicability import RouteApplicability from ..models.route import Route + from ..models.route_applicability import RouteApplicability T = TypeVar("T", bound="ListRoutesResponse") @@ -50,9 +50,9 @@ def to_dict(self) -> dict[str, Any]: error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -90,11 +90,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) list_routes_response = cls( routes=routes, diff --git a/openapi_project/openapi_package/models/list_securities_response.py b/openapi_project/openapi_package/models/list_securities_response.py index 8ff2fbd9c..d0ee036a8 100644 --- a/openapi_project/openapi_package/models/list_securities_response.py +++ b/openapi_project/openapi_package/models/list_securities_response.py @@ -40,9 +40,9 @@ def to_dict(self) -> dict[str, Any]: error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -69,11 +69,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) list_securities_response = cls( securities=securities, diff --git a/openapi_project/openapi_package/models/list_trade_confirms_response.py b/openapi_project/openapi_package/models/list_trade_confirms_response.py index 1a0fbf23e..21d3d368d 100644 --- a/openapi_project/openapi_package/models/list_trade_confirms_response.py +++ b/openapi_project/openapi_package/models/list_trade_confirms_response.py @@ -40,9 +40,9 @@ def to_dict(self) -> dict[str, Any]: error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -69,11 +69,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) list_trade_confirms_response = cls( trade_confirms=trade_confirms, diff --git a/openapi_project/openapi_package/models/list_trading_firms_response.py b/openapi_project/openapi_package/models/list_trading_firms_response.py index a65bac9a9..41e98eb19 100644 --- a/openapi_project/openapi_package/models/list_trading_firms_response.py +++ b/openapi_project/openapi_package/models/list_trading_firms_response.py @@ -40,9 +40,9 @@ def to_dict(self) -> dict[str, Any]: error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -69,11 +69,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) list_trading_firms_response = cls( trading_firms=trading_firms, diff --git a/openapi_project/openapi_package/models/login_response.py b/openapi_project/openapi_package/models/login_response.py index 5608aa970..cbd7c52c5 100644 --- a/openapi_project/openapi_package/models/login_response.py +++ b/openapi_project/openapi_package/models/login_response.py @@ -12,8 +12,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.user import User from ..models.login_response_system_settings import LoginResponseSystemSettings + from ..models.user import User T = TypeVar("T", bound="LoginResponse") @@ -63,9 +63,9 @@ def to_dict(self) -> dict[str, Any]: login_attempts_remaining = self.login_attempts_remaining - login_status: Unset | str = UNSET - if not isinstance(self.login_status, Unset): - login_status = self.login_status.value + login_status: Unset | str = ( + UNSET if isinstance(self.login_status, Unset) else self.login_status.value + ) server_build_ts = self.server_build_ts @@ -81,19 +81,21 @@ def to_dict(self) -> dict[str, Any]: text = self.text - user: Unset | dict[str, Any] = UNSET - if not isinstance(self.user, Unset): - user = self.user.to_dict() + user: Unset | dict[str, Any] = ( + UNSET if isinstance(self.user, Unset) else self.user.to_dict() + ) - system_settings: Unset | dict[str, Any] = UNSET - if not isinstance(self.system_settings, Unset): - system_settings = self.system_settings.to_dict() + system_settings: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.system_settings, Unset) + else self.system_settings.to_dict() + ) error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -141,11 +143,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: login_attempts_remaining = d.pop("loginAttemptsRemaining", UNSET) _login_status = d.pop("loginStatus", UNSET) - login_status: Unset | LoginStatus - if isinstance(_login_status, Unset): - login_status = UNSET - else: - login_status = LoginStatus(_login_status) + login_status: Unset | LoginStatus = ( + UNSET if isinstance(_login_status, Unset) else LoginStatus(_login_status) + ) server_build_ts = d.pop("serverBuildTs", UNSET) @@ -162,27 +162,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: text = d.pop("text", UNSET) _user = d.pop("user", UNSET) - user: Unset | User - if isinstance(_user, Unset): - user = UNSET - else: - user = User.from_dict(_user) + user: Unset | User = ( + UNSET if isinstance(_user, Unset) else User.from_dict(_user) + ) _system_settings = d.pop("systemSettings", UNSET) - system_settings: Unset | LoginResponseSystemSettings - if isinstance(_system_settings, Unset): - system_settings = UNSET - else: - system_settings = LoginResponseSystemSettings.from_dict(_system_settings) + system_settings: Unset | LoginResponseSystemSettings = ( + UNSET + if isinstance(_system_settings, Unset) + else LoginResponseSystemSettings.from_dict(_system_settings) + ) error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) login_response = cls( token=token, diff --git a/openapi_project/openapi_package/models/login_response_system_settings.py b/openapi_project/openapi_package/models/login_response_system_settings.py index 743cb498d..3f9eae216 100644 --- a/openapi_project/openapi_package/models/login_response_system_settings.py +++ b/openapi_project/openapi_package/models/login_response_system_settings.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="LoginResponseSystemSettings") - @_attrs_define class LoginResponseSystemSettings: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - login_response_system_settings = cls( - ) - - + login_response_system_settings = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/margin_data.py b/openapi_project/openapi_package/models/margin_data.py index a0d0a5cdc..1e4f9c468 100644 --- a/openapi_project/openapi_package/models/margin_data.py +++ b/openapi_project/openapi_package/models/margin_data.py @@ -33,13 +33,13 @@ class MarginData: def to_dict(self) -> dict[str, Any]: account_id = self.account_id - tims: Unset | dict[str, Any] = UNSET - if not isinstance(self.tims, Unset): - tims = self.tims.to_dict() + tims: Unset | dict[str, Any] = ( + UNSET if isinstance(self.tims, Unset) else self.tims.to_dict() + ) - span: Unset | dict[str, Any] = UNSET - if not isinstance(self.span, Unset): - span = self.span.to_dict() + span: Unset | dict[str, Any] = ( + UNSET if isinstance(self.span, Unset) else self.span.to_dict() + ) field_dict: dict[str, Any] = {} @@ -59,18 +59,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: account_id = d.pop("accountId", UNSET) _tims = d.pop("tims", UNSET) - tims: Unset | TimsMarginData - if isinstance(_tims, Unset): - tims = UNSET - else: - tims = TimsMarginData.from_dict(_tims) + tims: Unset | TimsMarginData = ( + UNSET if isinstance(_tims, Unset) else TimsMarginData.from_dict(_tims) + ) _span = d.pop("span", UNSET) - span: Unset | Empty - if isinstance(_span, Unset): - span = UNSET - else: - span = Empty.from_dict(_span) + span: Unset | Empty = ( + UNSET if isinstance(_span, Unset) else Empty.from_dict(_span) + ) margin_data = cls( account_id=account_id, diff --git a/openapi_project/openapi_package/models/multi_leg_order.py b/openapi_project/openapi_package/models/multi_leg_order.py index 463f3ef40..848fc025f 100644 --- a/openapi_project/openapi_package/models/multi_leg_order.py +++ b/openapi_project/openapi_package/models/multi_leg_order.py @@ -15,13 +15,13 @@ from typing import cast if TYPE_CHECKING: - from ..models.multi_leg_order_optional_data import MultiLegOrderOptionalData + from ..models.clearing_info import ClearingInfo + from ..models.multi_leg_order_leg import MultiLegOrderLeg from ..models.order_update_event import OrderUpdateEvent + from ..models.multi_leg_order_market_condition import MultiLegOrderMarketCondition + from ..models.multi_leg_order_optional_data import MultiLegOrderOptionalData from ..models.header import Header from ..models.multi_leg_order_algo import MultiLegOrderAlgo - from ..models.multi_leg_order_market_condition import MultiLegOrderMarketCondition - from ..models.clearing_info import ClearingInfo - from ..models.multi_leg_order_leg import MultiLegOrderLeg from ..models.order_instruction import OrderInstruction @@ -124,21 +124,23 @@ class MultiLegOrder: def to_dict(self) -> dict[str, Any]: account_id = self.account_id - algo: Unset | dict[str, Any] = UNSET - if not isinstance(self.algo, Unset): - algo = self.algo.to_dict() + algo: Unset | dict[str, Any] = ( + UNSET if isinstance(self.algo, Unset) else self.algo.to_dict() + ) aux_price = self.aux_price - clearing_info: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_info, Unset): - clearing_info = self.clearing_info.to_dict() + clearing_info: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.clearing_info, Unset) + else self.clearing_info.to_dict() + ) cur_ord_id = self.cur_ord_id - header: Unset | dict[str, Any] = UNSET - if not isinstance(self.header, Unset): - header = self.header.to_dict() + header: Unset | dict[str, Any] = ( + UNSET if isinstance(self.header, Unset) else self.header.to_dict() + ) id = self.id @@ -160,13 +162,17 @@ def to_dict(self) -> dict[str, Any]: legs_item = legs_item_data.to_dict() legs.append(legs_item) - market_condition: Unset | dict[str, Any] = UNSET - if not isinstance(self.market_condition, Unset): - market_condition = self.market_condition.to_dict() + market_condition: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.market_condition, Unset) + else self.market_condition.to_dict() + ) - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() + optional_data: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.optional_data, Unset) + else self.optional_data.to_dict() + ) order_flags = self.order_flags @@ -177,21 +183,23 @@ def to_dict(self) -> dict[str, Any]: order_updates_item = order_updates_item_data.to_dict() order_updates.append(order_updates_item) - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value + ord_type: Unset | str = ( + UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value + ) - origination_type: Unset | str = UNSET - if not isinstance(self.origination_type, Unset): - origination_type = self.origination_type.value + origination_type: Unset | str = ( + UNSET + if isinstance(self.origination_type, Unset) + else self.origination_type.value + ) parent_ord_id = self.parent_ord_id price = self.price - price_type: Unset | str = UNSET - if not isinstance(self.price_type, Unset): - price_type = self.price_type.value + price_type: Unset | str = ( + UNSET if isinstance(self.price_type, Unset) else self.price_type.value + ) qty = self.qty @@ -207,17 +215,15 @@ def to_dict(self) -> dict[str, Any]: text = self.text - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value + tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value user_id = self.user_id trader_id = self.trader_id - ord_status: Unset | str = UNSET - if not isinstance(self.ord_status, Unset): - ord_status = self.ord_status.value + ord_status: Unset | str = ( + UNSET if isinstance(self.ord_status, Unset) else self.ord_status.value + ) avg_price = self.avg_price @@ -341,29 +347,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: account_id = d.pop("accountId", UNSET) _algo = d.pop("algo", UNSET) - algo: Unset | MultiLegOrderAlgo - if isinstance(_algo, Unset): - algo = UNSET - else: - algo = MultiLegOrderAlgo.from_dict(_algo) + algo: Unset | MultiLegOrderAlgo = ( + UNSET if isinstance(_algo, Unset) else MultiLegOrderAlgo.from_dict(_algo) + ) aux_price = d.pop("auxPrice", UNSET) _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo - if isinstance(_clearing_info, Unset): - clearing_info = UNSET - else: - clearing_info = ClearingInfo.from_dict(_clearing_info) + clearing_info: Unset | ClearingInfo = ( + UNSET + if isinstance(_clearing_info, Unset) + else ClearingInfo.from_dict(_clearing_info) + ) cur_ord_id = d.pop("curOrdId", UNSET) _header = d.pop("header", UNSET) - header: Unset | Header - if isinstance(_header, Unset): - header = UNSET - else: - header = Header.from_dict(_header) + header: Unset | Header = ( + UNSET if isinstance(_header, Unset) else Header.from_dict(_header) + ) id = d.pop("id", UNSET) @@ -386,18 +388,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: legs.append(legs_item) _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | MultiLegOrderMarketCondition - if isinstance(_market_condition, Unset): - market_condition = UNSET - else: - market_condition = MultiLegOrderMarketCondition.from_dict(_market_condition) + market_condition: Unset | MultiLegOrderMarketCondition = ( + UNSET + if isinstance(_market_condition, Unset) + else MultiLegOrderMarketCondition.from_dict(_market_condition) + ) _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | MultiLegOrderOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = MultiLegOrderOptionalData.from_dict(_optional_data) + optional_data: Unset | MultiLegOrderOptionalData = ( + UNSET + if isinstance(_optional_data, Unset) + else MultiLegOrderOptionalData.from_dict(_optional_data) + ) order_flags = d.pop("orderFlags", UNSET) @@ -409,29 +411,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: order_updates.append(order_updates_item) _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) + ord_type: Unset | OrdType = ( + UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) + ) _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType - if isinstance(_origination_type, Unset): - origination_type = UNSET - else: - origination_type = OriginationType(_origination_type) + origination_type: Unset | OriginationType = ( + UNSET + if isinstance(_origination_type, Unset) + else OriginationType(_origination_type) + ) parent_ord_id = d.pop("parentOrdId", UNSET) price = d.pop("price", UNSET) _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType - if isinstance(_price_type, Unset): - price_type = UNSET - else: - price_type = PriceType(_price_type) + price_type: Unset | PriceType = ( + UNSET if isinstance(_price_type, Unset) else PriceType(_price_type) + ) qty = d.pop("qty", UNSET) @@ -448,22 +446,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: text = d.pop("text", UNSET) _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) + tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) user_id = d.pop("userId", UNSET) trader_id = d.pop("traderId", UNSET) _ord_status = d.pop("ordStatus", UNSET) - ord_status: Unset | OrdStatus - if isinstance(_ord_status, Unset): - ord_status = UNSET - else: - ord_status = OrdStatus(_ord_status) + ord_status: Unset | OrdStatus = ( + UNSET if isinstance(_ord_status, Unset) else OrdStatus(_ord_status) + ) avg_price = d.pop("avgPrice", UNSET) diff --git a/openapi_project/openapi_package/models/multi_leg_order_algo.py b/openapi_project/openapi_package/models/multi_leg_order_algo.py index 17d1f9558..a6eff4f2c 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_algo.py +++ b/openapi_project/openapi_package/models/multi_leg_order_algo.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="MultiLegOrderAlgo") - @_attrs_define class MultiLegOrderAlgo: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - multi_leg_order_algo = cls( - ) - - + multi_leg_order_algo = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py index 8fe519990..a82a8c73a 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py @@ -15,18 +15,18 @@ from typing import cast if TYPE_CHECKING: - from ..models.multi_leg_order_cancel_replace_request_optional_data import ( - MultiLegOrderCancelReplaceRequestOptionalData, + from ..models.clearing_info import ClearingInfo + from ..models.multi_leg_order_cancel_replace_request_market_condition import ( + MultiLegOrderCancelReplaceRequestMarketCondition, ) from ..models.multi_leg_order_cancel_replace_request_algo import ( MultiLegOrderCancelReplaceRequestAlgo, ) from ..models.header import Header - from ..models.clearing_info import ClearingInfo - from ..models.order_instruction import OrderInstruction - from ..models.multi_leg_order_cancel_replace_request_market_condition import ( - MultiLegOrderCancelReplaceRequestMarketCondition, + from ..models.multi_leg_order_cancel_replace_request_optional_data import ( + MultiLegOrderCancelReplaceRequestOptionalData, ) + from ..models.order_instruction import OrderInstruction T = TypeVar("T", bound="MultiLegOrderCancelReplaceRequest") @@ -90,21 +90,23 @@ class MultiLegOrderCancelReplaceRequest: user_id: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: - algo: Unset | dict[str, Any] = UNSET - if not isinstance(self.algo, Unset): - algo = self.algo.to_dict() + algo: Unset | dict[str, Any] = ( + UNSET if isinstance(self.algo, Unset) else self.algo.to_dict() + ) aux_price = self.aux_price - clearing_info: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_info, Unset): - clearing_info = self.clearing_info.to_dict() + clearing_info: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.clearing_info, Unset) + else self.clearing_info.to_dict() + ) cur_ord_id = self.cur_ord_id - header: Unset | dict[str, Any] = UNSET - if not isinstance(self.header, Unset): - header = self.header.to_dict() + header: Unset | dict[str, Any] = ( + UNSET if isinstance(self.header, Unset) else self.header.to_dict() + ) incoming_cl_ord_id = self.incoming_cl_ord_id @@ -117,37 +119,41 @@ def to_dict(self) -> dict[str, Any]: instructions_item = instructions_item_data.to_dict() instructions.append(instructions_item) - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() + optional_data: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.optional_data, Unset) + else self.optional_data.to_dict() + ) - market_condition: Unset | dict[str, Any] = UNSET - if not isinstance(self.market_condition, Unset): - market_condition = self.market_condition.to_dict() + market_condition: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.market_condition, Unset) + else self.market_condition.to_dict() + ) - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value + ord_type: Unset | str = ( + UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value + ) - origination_type: Unset | str = UNSET - if not isinstance(self.origination_type, Unset): - origination_type = self.origination_type.value + origination_type: Unset | str = ( + UNSET + if isinstance(self.origination_type, Unset) + else self.origination_type.value + ) perm_ord_id = self.perm_ord_id price = self.price - price_type: Unset | str = UNSET - if not isinstance(self.price_type, Unset): - price_type = self.price_type.value + price_type: Unset | str = ( + UNSET if isinstance(self.price_type, Unset) else self.price_type.value + ) qty = self.qty req_ord_id = self.req_ord_id - side: Unset | str = UNSET - if not isinstance(self.side, Unset): - side = self.side.value + side: Unset | str = UNSET if isinstance(self.side, Unset) else self.side.value source = self.source @@ -157,9 +163,7 @@ def to_dict(self) -> dict[str, Any]: text = self.text - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value + tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value trader_id = self.trader_id @@ -225,29 +229,27 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _algo = d.pop("algo", UNSET) - algo: Unset | MultiLegOrderCancelReplaceRequestAlgo - if isinstance(_algo, Unset): - algo = UNSET - else: - algo = MultiLegOrderCancelReplaceRequestAlgo.from_dict(_algo) + algo: Unset | MultiLegOrderCancelReplaceRequestAlgo = ( + UNSET + if isinstance(_algo, Unset) + else MultiLegOrderCancelReplaceRequestAlgo.from_dict(_algo) + ) aux_price = d.pop("auxPrice", UNSET) _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo - if isinstance(_clearing_info, Unset): - clearing_info = UNSET - else: - clearing_info = ClearingInfo.from_dict(_clearing_info) + clearing_info: Unset | ClearingInfo = ( + UNSET + if isinstance(_clearing_info, Unset) + else ClearingInfo.from_dict(_clearing_info) + ) cur_ord_id = d.pop("curOrdId", UNSET) _header = d.pop("header", UNSET) - header: Unset | Header - if isinstance(_header, Unset): - header = UNSET - else: - header = Header.from_dict(_header) + header: Unset | Header = ( + UNSET if isinstance(_header, Unset) else Header.from_dict(_header) + ) incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) @@ -261,60 +263,48 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: instructions.append(instructions_item) _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | MultiLegOrderCancelReplaceRequestOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = MultiLegOrderCancelReplaceRequestOptionalData.from_dict( - _optional_data - ) + optional_data: Unset | MultiLegOrderCancelReplaceRequestOptionalData = ( + UNSET + if isinstance(_optional_data, Unset) + else MultiLegOrderCancelReplaceRequestOptionalData.from_dict(_optional_data) + ) _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | MultiLegOrderCancelReplaceRequestMarketCondition - if isinstance(_market_condition, Unset): - market_condition = UNSET - else: - market_condition = ( - MultiLegOrderCancelReplaceRequestMarketCondition.from_dict( - _market_condition - ) + market_condition: Unset | MultiLegOrderCancelReplaceRequestMarketCondition = ( + UNSET + if isinstance(_market_condition, Unset) + else MultiLegOrderCancelReplaceRequestMarketCondition.from_dict( + _market_condition ) + ) _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) + ord_type: Unset | OrdType = ( + UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) + ) _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType - if isinstance(_origination_type, Unset): - origination_type = UNSET - else: - origination_type = OriginationType(_origination_type) + origination_type: Unset | OriginationType = ( + UNSET + if isinstance(_origination_type, Unset) + else OriginationType(_origination_type) + ) perm_ord_id = d.pop("permOrdId", UNSET) price = d.pop("price", UNSET) _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType - if isinstance(_price_type, Unset): - price_type = UNSET - else: - price_type = PriceType(_price_type) + price_type: Unset | PriceType = ( + UNSET if isinstance(_price_type, Unset) else PriceType(_price_type) + ) qty = d.pop("qty", UNSET) req_ord_id = d.pop("reqOrdId", UNSET) _side = d.pop("side", UNSET) - side: Unset | Side - if isinstance(_side, Unset): - side = UNSET - else: - side = Side(_side) + side: Unset | Side = UNSET if isinstance(_side, Unset) else Side(_side) source = d.pop("source", UNSET) @@ -325,11 +315,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: text = d.pop("text", UNSET) _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) + tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) trader_id = d.pop("traderId", UNSET) diff --git a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py index 82b711b32..8c62b2f19 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="MultiLegOrderCancelReplaceRequestAlgo") - @_attrs_define class MultiLegOrderCancelReplaceRequestAlgo: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - multi_leg_order_cancel_replace_request_algo = cls( - ) - - + multi_leg_order_cancel_replace_request_algo = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - multi_leg_order_cancel_replace_request_algo.additional_properties = additional_properties + multi_leg_order_cancel_replace_request_algo.additional_properties = ( + additional_properties + ) return multi_leg_order_cancel_replace_request_algo @property diff --git a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py index 3a3e22417..c5672350b 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="MultiLegOrderCancelReplaceRequestMarketCondition") - @_attrs_define class MultiLegOrderCancelReplaceRequestMarketCondition: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - multi_leg_order_cancel_replace_request_market_condition = cls( - ) - - + multi_leg_order_cancel_replace_request_market_condition = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - multi_leg_order_cancel_replace_request_market_condition.additional_properties = additional_properties + multi_leg_order_cancel_replace_request_market_condition.additional_properties = ( + additional_properties + ) return multi_leg_order_cancel_replace_request_market_condition @property diff --git a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py index f3b56983f..de72ce105 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="MultiLegOrderCancelReplaceRequestOptionalData") - @_attrs_define class MultiLegOrderCancelReplaceRequestOptionalData: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - multi_leg_order_cancel_replace_request_optional_data = cls( - ) - - + multi_leg_order_cancel_replace_request_optional_data = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - multi_leg_order_cancel_replace_request_optional_data.additional_properties = additional_properties + multi_leg_order_cancel_replace_request_optional_data.additional_properties = ( + additional_properties + ) return multi_leg_order_cancel_replace_request_optional_data @property diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross.py b/openapi_project/openapi_package/models/multi_leg_order_cross.py index 95160242e..95d9e2269 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross.py @@ -16,17 +16,17 @@ from typing import cast if TYPE_CHECKING: + from ..models.multi_leg_order_cross_market_condition import ( + MultiLegOrderCrossMarketCondition, + ) from ..models.multi_leg_order_cross_optional_data import ( MultiLegOrderCrossOptionalData, ) from ..models.order_update_event import OrderUpdateEvent - from ..models.header import Header - from ..models.multi_leg_order_cross_market_condition import ( - MultiLegOrderCrossMarketCondition, - ) from ..models.multi_leg_order_cross_algo import MultiLegOrderCrossAlgo - from ..models.order_instruction import OrderInstruction from ..models.multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation + from ..models.header import Header + from ..models.order_instruction import OrderInstruction T = TypeVar("T", bound="MultiLegOrderCross") @@ -112,9 +112,9 @@ class MultiLegOrderCross: def to_dict(self) -> dict[str, Any]: account_id = self.account_id - algo: Unset | dict[str, Any] = UNSET - if not isinstance(self.algo, Unset): - algo = self.algo.to_dict() + algo: Unset | dict[str, Any] = ( + UNSET if isinstance(self.algo, Unset) else self.algo.to_dict() + ) allocations: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.allocations, Unset): @@ -123,15 +123,15 @@ def to_dict(self) -> dict[str, Any]: allocations_item = allocations_item_data.to_dict() allocations.append(allocations_item) - cross_type: Unset | str = UNSET - if not isinstance(self.cross_type, Unset): - cross_type = self.cross_type.value + cross_type: Unset | str = ( + UNSET if isinstance(self.cross_type, Unset) else self.cross_type.value + ) cur_ord_id = self.cur_ord_id - header: Unset | dict[str, Any] = UNSET - if not isinstance(self.header, Unset): - header = self.header.to_dict() + header: Unset | dict[str, Any] = ( + UNSET if isinstance(self.header, Unset) else self.header.to_dict() + ) id = self.id @@ -146,13 +146,17 @@ def to_dict(self) -> dict[str, Any]: instructions_item = instructions_item_data.to_dict() instructions.append(instructions_item) - market_condition: Unset | dict[str, Any] = UNSET - if not isinstance(self.market_condition, Unset): - market_condition = self.market_condition.to_dict() + market_condition: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.market_condition, Unset) + else self.market_condition.to_dict() + ) - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() + optional_data: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.optional_data, Unset) + else self.optional_data.to_dict() + ) order_flags = self.order_flags @@ -163,21 +167,23 @@ def to_dict(self) -> dict[str, Any]: order_updates_item = order_updates_item_data.to_dict() order_updates.append(order_updates_item) - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value + ord_type: Unset | str = ( + UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value + ) - origination_type: Unset | str = UNSET - if not isinstance(self.origination_type, Unset): - origination_type = self.origination_type.value + origination_type: Unset | str = ( + UNSET + if isinstance(self.origination_type, Unset) + else self.origination_type.value + ) parent_ord_id = self.parent_ord_id price = self.price - price_type: Unset | str = UNSET - if not isinstance(self.price_type, Unset): - price_type = self.price_type.value + price_type: Unset | str = ( + UNSET if isinstance(self.price_type, Unset) else self.price_type.value + ) qty = self.qty @@ -193,9 +199,7 @@ def to_dict(self) -> dict[str, Any]: text = self.text - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value + tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value user_id = self.user_id @@ -203,9 +207,9 @@ def to_dict(self) -> dict[str, Any]: claimed_by = self.claimed_by - ord_status: Unset | str = UNSET - if not isinstance(self.ord_status, Unset): - ord_status = self.ord_status.value + ord_status: Unset | str = ( + UNSET if isinstance(self.ord_status, Unset) else self.ord_status.value + ) transact_ts = self.transact_ts @@ -297,11 +301,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: account_id = d.pop("accountId", UNSET) _algo = d.pop("algo", UNSET) - algo: Unset | MultiLegOrderCrossAlgo - if isinstance(_algo, Unset): - algo = UNSET - else: - algo = MultiLegOrderCrossAlgo.from_dict(_algo) + algo: Unset | MultiLegOrderCrossAlgo = ( + UNSET + if isinstance(_algo, Unset) + else MultiLegOrderCrossAlgo.from_dict(_algo) + ) allocations = [] _allocations = d.pop("allocations", UNSET) @@ -313,20 +317,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: allocations.append(allocations_item) _cross_type = d.pop("crossType", UNSET) - cross_type: Unset | CrossType - if isinstance(_cross_type, Unset): - cross_type = UNSET - else: - cross_type = CrossType(_cross_type) + cross_type: Unset | CrossType = ( + UNSET if isinstance(_cross_type, Unset) else CrossType(_cross_type) + ) cur_ord_id = d.pop("curOrdId", UNSET) _header = d.pop("header", UNSET) - header: Unset | Header - if isinstance(_header, Unset): - header = UNSET - else: - header = Header.from_dict(_header) + header: Unset | Header = ( + UNSET if isinstance(_header, Unset) else Header.from_dict(_header) + ) id = d.pop("id", UNSET) @@ -342,20 +342,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: instructions.append(instructions_item) _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | MultiLegOrderCrossMarketCondition - if isinstance(_market_condition, Unset): - market_condition = UNSET - else: - market_condition = MultiLegOrderCrossMarketCondition.from_dict( - _market_condition - ) + market_condition: Unset | MultiLegOrderCrossMarketCondition = ( + UNSET + if isinstance(_market_condition, Unset) + else MultiLegOrderCrossMarketCondition.from_dict(_market_condition) + ) _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | MultiLegOrderCrossOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = MultiLegOrderCrossOptionalData.from_dict(_optional_data) + optional_data: Unset | MultiLegOrderCrossOptionalData = ( + UNSET + if isinstance(_optional_data, Unset) + else MultiLegOrderCrossOptionalData.from_dict(_optional_data) + ) order_flags = d.pop("orderFlags", UNSET) @@ -367,29 +365,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: order_updates.append(order_updates_item) _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) + ord_type: Unset | OrdType = ( + UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) + ) _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType - if isinstance(_origination_type, Unset): - origination_type = UNSET - else: - origination_type = OriginationType(_origination_type) + origination_type: Unset | OriginationType = ( + UNSET + if isinstance(_origination_type, Unset) + else OriginationType(_origination_type) + ) parent_ord_id = d.pop("parentOrdId", UNSET) price = d.pop("price", UNSET) _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType - if isinstance(_price_type, Unset): - price_type = UNSET - else: - price_type = PriceType(_price_type) + price_type: Unset | PriceType = ( + UNSET if isinstance(_price_type, Unset) else PriceType(_price_type) + ) qty = d.pop("qty", UNSET) @@ -406,11 +400,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: text = d.pop("text", UNSET) _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) + tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) user_id = d.pop("userId", UNSET) @@ -419,11 +409,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: claimed_by = d.pop("claimedBy", UNSET) _ord_status = d.pop("ordStatus", UNSET) - ord_status: Unset | OrdStatus - if isinstance(_ord_status, Unset): - ord_status = UNSET - else: - ord_status = OrdStatus(_ord_status) + ord_status: Unset | OrdStatus = ( + UNSET if isinstance(_ord_status, Unset) else OrdStatus(_ord_status) + ) transact_ts = d.pop("transactTs", UNSET) diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py b/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py index 64c1511ad..5d58a0d35 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="MultiLegOrderCrossAlgo") - @_attrs_define class MultiLegOrderCrossAlgo: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - multi_leg_order_cross_algo = cls( - ) - - + multi_leg_order_cross_algo = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py index 525cb4311..3e8e83d7f 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py @@ -12,12 +12,12 @@ from typing import cast if TYPE_CHECKING: - from ..models.order_instruction import OrderInstruction + from ..models.clearing_info import ClearingInfo from ..models.multi_leg_order_cross_allocation_optional_data import ( MultiLegOrderCrossAllocationOptionalData, ) from ..models.multi_leg_order_leg import MultiLegOrderLeg - from ..models.clearing_info import ClearingInfo + from ..models.order_instruction import OrderInstruction T = TypeVar("T", bound="MultiLegOrderCrossAllocation") @@ -69,9 +69,11 @@ class MultiLegOrderCrossAllocation: def to_dict(self) -> dict[str, Any]: account_id = self.account_id - clearing_info: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_info, Unset): - clearing_info = self.clearing_info.to_dict() + clearing_info: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.clearing_info, Unset) + else self.clearing_info.to_dict() + ) id = self.id @@ -89,15 +91,17 @@ def to_dict(self) -> dict[str, Any]: legs_item = legs_item_data.to_dict() legs.append(legs_item) - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() + optional_data: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.optional_data, Unset) + else self.optional_data.to_dict() + ) qty = self.qty - side_type: Unset | str = UNSET - if not isinstance(self.side_type, Unset): - side_type = self.side_type.value + side_type: Unset | str = ( + UNSET if isinstance(self.side_type, Unset) else self.side_type.value + ) avg_price = self.avg_price @@ -113,9 +117,9 @@ def to_dict(self) -> dict[str, Any]: transact_ts = self.transact_ts - ord_status: Unset | str = UNSET - if not isinstance(self.ord_status, Unset): - ord_status = self.ord_status.value + ord_status: Unset | str = ( + UNSET if isinstance(self.ord_status, Unset) else self.ord_status.value + ) incoming_cl_ord_id = self.incoming_cl_ord_id @@ -169,11 +173,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: account_id = d.pop("accountId", UNSET) _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo - if isinstance(_clearing_info, Unset): - clearing_info = UNSET - else: - clearing_info = ClearingInfo.from_dict(_clearing_info) + clearing_info: Unset | ClearingInfo = ( + UNSET + if isinstance(_clearing_info, Unset) + else ClearingInfo.from_dict(_clearing_info) + ) id = d.pop("id", UNSET) @@ -192,22 +196,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: legs.append(legs_item) _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | MultiLegOrderCrossAllocationOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = MultiLegOrderCrossAllocationOptionalData.from_dict( - _optional_data - ) + optional_data: Unset | MultiLegOrderCrossAllocationOptionalData = ( + UNSET + if isinstance(_optional_data, Unset) + else MultiLegOrderCrossAllocationOptionalData.from_dict(_optional_data) + ) qty = d.pop("qty", UNSET) _side_type = d.pop("sideType", UNSET) - side_type: Unset | CrossSideType - if isinstance(_side_type, Unset): - side_type = UNSET - else: - side_type = CrossSideType(_side_type) + side_type: Unset | CrossSideType = ( + UNSET if isinstance(_side_type, Unset) else CrossSideType(_side_type) + ) avg_price = d.pop("avgPrice", UNSET) @@ -224,11 +224,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: transact_ts = d.pop("transactTs", UNSET) _ord_status = d.pop("ordStatus", UNSET) - ord_status: Unset | OrdStatus - if isinstance(_ord_status, Unset): - ord_status = UNSET - else: - ord_status = OrdStatus(_ord_status) + ord_status: Unset | OrdStatus = ( + UNSET if isinstance(_ord_status, Unset) else OrdStatus(_ord_status) + ) incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py index 0bbc1c65d..f499944d6 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="MultiLegOrderCrossAllocationOptionalData") - @_attrs_define class MultiLegOrderCrossAllocationOptionalData: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - multi_leg_order_cross_allocation_optional_data = cls( - ) - - + multi_leg_order_cross_allocation_optional_data = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - multi_leg_order_cross_allocation_optional_data.additional_properties = additional_properties + multi_leg_order_cross_allocation_optional_data.additional_properties = ( + additional_properties + ) return multi_leg_order_cross_allocation_optional_data @property diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py b/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py index d981f3e27..c32c4c564 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="MultiLegOrderCrossMarketCondition") - @_attrs_define class MultiLegOrderCrossMarketCondition: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - multi_leg_order_cross_market_condition = cls( - ) - - + multi_leg_order_cross_market_condition = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - multi_leg_order_cross_market_condition.additional_properties = additional_properties + multi_leg_order_cross_market_condition.additional_properties = ( + additional_properties + ) return multi_leg_order_cross_market_condition @property diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py index 8cfddc219..d5da6fa0f 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="MultiLegOrderCrossOptionalData") - @_attrs_define class MultiLegOrderCrossOptionalData: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - multi_leg_order_cross_optional_data = cls( - ) - - + multi_leg_order_cross_optional_data = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - multi_leg_order_cross_optional_data.additional_properties = additional_properties + multi_leg_order_cross_optional_data.additional_properties = ( + additional_properties + ) return multi_leg_order_cross_optional_data @property diff --git a/openapi_project/openapi_package/models/multi_leg_order_leg.py b/openapi_project/openapi_package/models/multi_leg_order_leg.py index 483ecb7a6..6efc95c2c 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_leg.py +++ b/openapi_project/openapi_package/models/multi_leg_order_leg.py @@ -15,9 +15,9 @@ from ..models.multi_leg_order_leg_market_condition import ( MultiLegOrderLegMarketCondition, ) + from ..models.multi_leg_order_leg_optional_data import MultiLegOrderLegOptionalData from ..models.security import Security from ..models.order_update_event import OrderUpdateEvent - from ..models.multi_leg_order_leg_optional_data import MultiLegOrderLegOptionalData T = TypeVar("T", bound="MultiLegOrderLeg") @@ -69,13 +69,17 @@ class MultiLegOrderLeg: def to_dict(self) -> dict[str, Any]: id = self.id - market_condition: Unset | dict[str, Any] = UNSET - if not isinstance(self.market_condition, Unset): - market_condition = self.market_condition.to_dict() + market_condition: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.market_condition, Unset) + else self.market_condition.to_dict() + ) - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() + optional_data: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.optional_data, Unset) + else self.optional_data.to_dict() + ) order_updates: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.order_updates, Unset): @@ -84,9 +88,11 @@ def to_dict(self) -> dict[str, Any]: order_updates_item = order_updates_item_data.to_dict() order_updates.append(order_updates_item) - position_effect: Unset | str = UNSET - if not isinstance(self.position_effect, Unset): - position_effect = self.position_effect.value + position_effect: Unset | str = ( + UNSET + if isinstance(self.position_effect, Unset) + else self.position_effect.value + ) price = self.price @@ -94,13 +100,11 @@ def to_dict(self) -> dict[str, Any]: ratio = self.ratio - security: Unset | dict[str, Any] = UNSET - if not isinstance(self.security, Unset): - security = self.security.to_dict() + security: Unset | dict[str, Any] = ( + UNSET if isinstance(self.security, Unset) else self.security.to_dict() + ) - side: Unset | str = UNSET - if not isinstance(self.side, Unset): - side = self.side.value + side: Unset | str = UNSET if isinstance(self.side, Unset) else self.side.value symbol = self.symbol @@ -166,20 +170,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | MultiLegOrderLegMarketCondition - if isinstance(_market_condition, Unset): - market_condition = UNSET - else: - market_condition = MultiLegOrderLegMarketCondition.from_dict( - _market_condition - ) + market_condition: Unset | MultiLegOrderLegMarketCondition = ( + UNSET + if isinstance(_market_condition, Unset) + else MultiLegOrderLegMarketCondition.from_dict(_market_condition) + ) _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | MultiLegOrderLegOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = MultiLegOrderLegOptionalData.from_dict(_optional_data) + optional_data: Unset | MultiLegOrderLegOptionalData = ( + UNSET + if isinstance(_optional_data, Unset) + else MultiLegOrderLegOptionalData.from_dict(_optional_data) + ) order_updates = [] _order_updates = d.pop("orderUpdates", UNSET) @@ -189,11 +191,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: order_updates.append(order_updates_item) _position_effect = d.pop("positionEffect", UNSET) - position_effect: Unset | PositionEffect - if isinstance(_position_effect, Unset): - position_effect = UNSET - else: - position_effect = PositionEffect(_position_effect) + position_effect: Unset | PositionEffect = ( + UNSET + if isinstance(_position_effect, Unset) + else PositionEffect(_position_effect) + ) price = d.pop("price", UNSET) @@ -202,18 +204,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ratio = d.pop("ratio", UNSET) _security = d.pop("security", UNSET) - security: Unset | Security - if isinstance(_security, Unset): - security = UNSET - else: - security = Security.from_dict(_security) + security: Unset | Security = ( + UNSET if isinstance(_security, Unset) else Security.from_dict(_security) + ) _side = d.pop("side", UNSET) - side: Unset | Side - if isinstance(_side, Unset): - side = UNSET - else: - side = Side(_side) + side: Unset | Side = UNSET if isinstance(_side, Unset) else Side(_side) symbol = d.pop("symbol", UNSET) diff --git a/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py b/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py index 521d7b5be..e5b8afd10 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py +++ b/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="MultiLegOrderLegMarketCondition") - @_attrs_define class MultiLegOrderLegMarketCondition: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - multi_leg_order_leg_market_condition = cls( - ) - - + multi_leg_order_leg_market_condition = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - multi_leg_order_leg_market_condition.additional_properties = additional_properties + multi_leg_order_leg_market_condition.additional_properties = ( + additional_properties + ) return multi_leg_order_leg_market_condition @property diff --git a/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py index b35659d55..285f0763e 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py +++ b/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="MultiLegOrderLegOptionalData") - @_attrs_define class MultiLegOrderLegOptionalData: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - multi_leg_order_leg_optional_data = cls( - ) - - + multi_leg_order_leg_optional_data = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/multi_leg_order_market_condition.py b/openapi_project/openapi_package/models/multi_leg_order_market_condition.py index 2772291ec..3278813cd 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_market_condition.py +++ b/openapi_project/openapi_package/models/multi_leg_order_market_condition.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="MultiLegOrderMarketCondition") - @_attrs_define class MultiLegOrderMarketCondition: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - multi_leg_order_market_condition = cls( - ) - - + multi_leg_order_market_condition = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/multi_leg_order_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_optional_data.py index dc153acba..755b9d3c4 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_optional_data.py +++ b/openapi_project/openapi_package/models/multi_leg_order_optional_data.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="MultiLegOrderOptionalData") - @_attrs_define class MultiLegOrderOptionalData: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - multi_leg_order_optional_data = cls( - ) - - + multi_leg_order_optional_data = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/option.py b/openapi_project/openapi_package/models/option.py index efe175b86..29d78ca25 100644 --- a/openapi_project/openapi_package/models/option.py +++ b/openapi_project/openapi_package/models/option.py @@ -16,9 +16,9 @@ from typing import cast if TYPE_CHECKING: - from ..models.date import Date from ..models.option_aliases import OptionAliases from ..models.option_root import OptionRoot + from ..models.date import Date T = TypeVar("T", bound="Option") @@ -86,21 +86,21 @@ class Option: underlying: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = UNSET - if not isinstance(self.aliases, Unset): - aliases = self.aliases.to_dict() + aliases: Unset | dict[str, Any] = ( + UNSET if isinstance(self.aliases, Unset) else self.aliases.to_dict() + ) - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value + currency: Unset | str = ( + UNSET if isinstance(self.currency, Unset) else self.currency.value + ) - listed_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.listed_dt, Unset): - listed_dt = self.listed_dt.to_dict() + listed_dt: Unset | dict[str, Any] = ( + UNSET if isinstance(self.listed_dt, Unset) else self.listed_dt.to_dict() + ) - delisted_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.delisted_dt, Unset): - delisted_dt = self.delisted_dt.to_dict() + delisted_dt: Unset | dict[str, Any] = ( + UNSET if isinstance(self.delisted_dt, Unset) else self.delisted_dt.to_dict() + ) description = self.description @@ -114,19 +114,25 @@ def to_dict(self) -> dict[str, Any]: price_display_factor = self.price_display_factor - price_display_format: Unset | str = UNSET - if not isinstance(self.price_display_format, Unset): - price_display_format = self.price_display_format.value + price_display_format: Unset | str = ( + UNSET + if isinstance(self.price_display_format, Unset) + else self.price_display_format.value + ) qty_display_factor = self.qty_display_factor - qty_display_format: Unset | str = UNSET - if not isinstance(self.qty_display_format, Unset): - qty_display_format = self.qty_display_format.value + qty_display_format: Unset | str = ( + UNSET + if isinstance(self.qty_display_format, Unset) + else self.qty_display_format.value + ) - security_category: Unset | str = UNSET - if not isinstance(self.security_category, Unset): - security_category = self.security_category.value + security_category: Unset | str = ( + UNSET + if isinstance(self.security_category, Unset) + else self.security_category.value + ) symbol = self.symbol @@ -143,29 +149,37 @@ def to_dict(self) -> dict[str, Any]: traded_exchanges_item = traded_exchanges_item_data.value traded_exchanges.append(traded_exchanges_item) - expiration_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.expiration_dt, Unset): - expiration_dt = self.expiration_dt.to_dict() + expiration_dt: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.expiration_dt, Unset) + else self.expiration_dt.to_dict() + ) - expiration_style: Unset | str = UNSET - if not isinstance(self.expiration_style, Unset): - expiration_style = self.expiration_style.value + expiration_style: Unset | str = ( + UNSET + if isinstance(self.expiration_style, Unset) + else self.expiration_style.value + ) - first_trade_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.first_trade_dt, Unset): - first_trade_dt = self.first_trade_dt.to_dict() + first_trade_dt: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.first_trade_dt, Unset) + else self.first_trade_dt.to_dict() + ) - last_trade_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.last_trade_dt, Unset): - last_trade_dt = self.last_trade_dt.to_dict() + last_trade_dt: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.last_trade_dt, Unset) + else self.last_trade_dt.to_dict() + ) - put_call: Unset | str = UNSET - if not isinstance(self.put_call, Unset): - put_call = self.put_call.value + put_call: Unset | str = ( + UNSET if isinstance(self.put_call, Unset) else self.put_call.value + ) - root: Unset | dict[str, Any] = UNSET - if not isinstance(self.root, Unset): - root = self.root.to_dict() + root: Unset | dict[str, Any] = ( + UNSET if isinstance(self.root, Unset) else self.root.to_dict() + ) strike = self.strike @@ -235,32 +249,24 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _aliases = d.pop("aliases", UNSET) - aliases: Unset | OptionAliases - if isinstance(_aliases, Unset): - aliases = UNSET - else: - aliases = OptionAliases.from_dict(_aliases) + aliases: Unset | OptionAliases = ( + UNSET if isinstance(_aliases, Unset) else OptionAliases.from_dict(_aliases) + ) _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) + currency: Unset | Currency = ( + UNSET if isinstance(_currency, Unset) else Currency(_currency) + ) _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date - if isinstance(_listed_dt, Unset): - listed_dt = UNSET - else: - listed_dt = Date.from_dict(_listed_dt) + listed_dt: Unset | Date = ( + UNSET if isinstance(_listed_dt, Unset) else Date.from_dict(_listed_dt) + ) _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date - if isinstance(_delisted_dt, Unset): - delisted_dt = UNSET - else: - delisted_dt = Date.from_dict(_delisted_dt) + delisted_dt: Unset | Date = ( + UNSET if isinstance(_delisted_dt, Unset) else Date.from_dict(_delisted_dt) + ) description = d.pop("description", UNSET) @@ -275,27 +281,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: price_display_factor = d.pop("priceDisplayFactor", UNSET) _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat - if isinstance(_price_display_format, Unset): - price_display_format = UNSET - else: - price_display_format = NumericDisplayFormat(_price_display_format) + price_display_format: Unset | NumericDisplayFormat = ( + UNSET + if isinstance(_price_display_format, Unset) + else NumericDisplayFormat(_price_display_format) + ) qty_display_factor = d.pop("qtyDisplayFactor", UNSET) _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat - if isinstance(_qty_display_format, Unset): - qty_display_format = UNSET - else: - qty_display_format = NumericDisplayFormat(_qty_display_format) + qty_display_format: Unset | NumericDisplayFormat = ( + UNSET + if isinstance(_qty_display_format, Unset) + else NumericDisplayFormat(_qty_display_format) + ) _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory - if isinstance(_security_category, Unset): - security_category = UNSET - else: - security_category = SecurityCategory(_security_category) + security_category: Unset | SecurityCategory = ( + UNSET + if isinstance(_security_category, Unset) + else SecurityCategory(_security_category) + ) symbol = d.pop("symbol", UNSET) @@ -313,46 +319,42 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: traded_exchanges.append(traded_exchanges_item) _expiration_dt = d.pop("expirationDt", UNSET) - expiration_dt: Unset | Date - if isinstance(_expiration_dt, Unset): - expiration_dt = UNSET - else: - expiration_dt = Date.from_dict(_expiration_dt) + expiration_dt: Unset | Date = ( + UNSET + if isinstance(_expiration_dt, Unset) + else Date.from_dict(_expiration_dt) + ) _expiration_style = d.pop("expirationStyle", UNSET) - expiration_style: Unset | OptionExpirationStyle - if isinstance(_expiration_style, Unset): - expiration_style = UNSET - else: - expiration_style = OptionExpirationStyle(_expiration_style) + expiration_style: Unset | OptionExpirationStyle = ( + UNSET + if isinstance(_expiration_style, Unset) + else OptionExpirationStyle(_expiration_style) + ) _first_trade_dt = d.pop("firstTradeDt", UNSET) - first_trade_dt: Unset | Date - if isinstance(_first_trade_dt, Unset): - first_trade_dt = UNSET - else: - first_trade_dt = Date.from_dict(_first_trade_dt) + first_trade_dt: Unset | Date = ( + UNSET + if isinstance(_first_trade_dt, Unset) + else Date.from_dict(_first_trade_dt) + ) _last_trade_dt = d.pop("lastTradeDt", UNSET) - last_trade_dt: Unset | Date - if isinstance(_last_trade_dt, Unset): - last_trade_dt = UNSET - else: - last_trade_dt = Date.from_dict(_last_trade_dt) + last_trade_dt: Unset | Date = ( + UNSET + if isinstance(_last_trade_dt, Unset) + else Date.from_dict(_last_trade_dt) + ) _put_call = d.pop("putCall", UNSET) - put_call: Unset | PutCall - if isinstance(_put_call, Unset): - put_call = UNSET - else: - put_call = PutCall(_put_call) + put_call: Unset | PutCall = ( + UNSET if isinstance(_put_call, Unset) else PutCall(_put_call) + ) _root = d.pop("root", UNSET) - root: Unset | OptionRoot - if isinstance(_root, Unset): - root = UNSET - else: - root = OptionRoot.from_dict(_root) + root: Unset | OptionRoot = ( + UNSET if isinstance(_root, Unset) else OptionRoot.from_dict(_root) + ) strike = d.pop("strike", UNSET) diff --git a/openapi_project/openapi_package/models/option_aliases.py b/openapi_project/openapi_package/models/option_aliases.py index ac9bba3fe..973d0bde5 100644 --- a/openapi_project/openapi_package/models/option_aliases.py +++ b/openapi_project/openapi_package/models/option_aliases.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="OptionAliases") - @_attrs_define class OptionAliases: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - option_aliases = cls( - ) - - + option_aliases = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/option_chain.py b/openapi_project/openapi_package/models/option_chain.py index b80eaed84..0c84f911a 100644 --- a/openapi_project/openapi_package/models/option_chain.py +++ b/openapi_project/openapi_package/models/option_chain.py @@ -10,8 +10,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.security import Security from ..models.option_chain_roots import OptionChainRoots + from ..models.security import Security from ..models.option_chain_options import OptionChainOptions from ..models.option_series import OptionSeries @@ -39,17 +39,17 @@ class OptionChain: station: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - underlying: Unset | dict[str, Any] = UNSET - if not isinstance(self.underlying, Unset): - underlying = self.underlying.to_dict() + underlying: Unset | dict[str, Any] = ( + UNSET if isinstance(self.underlying, Unset) else self.underlying.to_dict() + ) - roots: Unset | dict[str, Any] = UNSET - if not isinstance(self.roots, Unset): - roots = self.roots.to_dict() + roots: Unset | dict[str, Any] = ( + UNSET if isinstance(self.roots, Unset) else self.roots.to_dict() + ) - options: Unset | dict[str, Any] = UNSET - if not isinstance(self.options, Unset): - options = self.options.to_dict() + options: Unset | dict[str, Any] = ( + UNSET if isinstance(self.options, Unset) else self.options.to_dict() + ) option_series: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.option_series, Unset): @@ -84,25 +84,21 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _underlying = d.pop("underlying", UNSET) - underlying: Unset | Security - if isinstance(_underlying, Unset): - underlying = UNSET - else: - underlying = Security.from_dict(_underlying) + underlying: Unset | Security = ( + UNSET if isinstance(_underlying, Unset) else Security.from_dict(_underlying) + ) _roots = d.pop("roots", UNSET) - roots: Unset | OptionChainRoots - if isinstance(_roots, Unset): - roots = UNSET - else: - roots = OptionChainRoots.from_dict(_roots) + roots: Unset | OptionChainRoots = ( + UNSET if isinstance(_roots, Unset) else OptionChainRoots.from_dict(_roots) + ) _options = d.pop("options", UNSET) - options: Unset | OptionChainOptions - if isinstance(_options, Unset): - options = UNSET - else: - options = OptionChainOptions.from_dict(_options) + options: Unset | OptionChainOptions = ( + UNSET + if isinstance(_options, Unset) + else OptionChainOptions.from_dict(_options) + ) option_series = [] _option_series = d.pop("optionSeries", UNSET) diff --git a/openapi_project/openapi_package/models/option_chain_option.py b/openapi_project/openapi_package/models/option_chain_option.py index 0d2afca00..276ec00f4 100644 --- a/openapi_project/openapi_package/models/option_chain_option.py +++ b/openapi_project/openapi_package/models/option_chain_option.py @@ -12,8 +12,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.option_chain_option_aliases import OptionChainOptionAliases from ..models.date import Date + from ..models.option_chain_option_aliases import OptionChainOptionAliases T = TypeVar("T", bound="OptionChainOption") @@ -55,17 +55,17 @@ class OptionChainOption: strike: Unset | float = UNSET def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = UNSET - if not isinstance(self.aliases, Unset): - aliases = self.aliases.to_dict() + aliases: Unset | dict[str, Any] = ( + UNSET if isinstance(self.aliases, Unset) else self.aliases.to_dict() + ) - listed_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.listed_dt, Unset): - listed_dt = self.listed_dt.to_dict() + listed_dt: Unset | dict[str, Any] = ( + UNSET if isinstance(self.listed_dt, Unset) else self.listed_dt.to_dict() + ) - delisted_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.delisted_dt, Unset): - delisted_dt = self.delisted_dt.to_dict() + delisted_dt: Unset | dict[str, Any] = ( + UNSET if isinstance(self.delisted_dt, Unset) else self.delisted_dt.to_dict() + ) description = self.description @@ -86,17 +86,21 @@ def to_dict(self) -> dict[str, Any]: traded_exchanges_item = traded_exchanges_item_data.value traded_exchanges.append(traded_exchanges_item) - first_trade_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.first_trade_dt, Unset): - first_trade_dt = self.first_trade_dt.to_dict() + first_trade_dt: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.first_trade_dt, Unset) + else self.first_trade_dt.to_dict() + ) - last_trade_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.last_trade_dt, Unset): - last_trade_dt = self.last_trade_dt.to_dict() + last_trade_dt: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.last_trade_dt, Unset) + else self.last_trade_dt.to_dict() + ) - put_call: Unset | str = UNSET - if not isinstance(self.put_call, Unset): - put_call = self.put_call.value + put_call: Unset | str = ( + UNSET if isinstance(self.put_call, Unset) else self.put_call.value + ) strike = self.strike @@ -138,25 +142,21 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _aliases = d.pop("aliases", UNSET) - aliases: Unset | OptionChainOptionAliases - if isinstance(_aliases, Unset): - aliases = UNSET - else: - aliases = OptionChainOptionAliases.from_dict(_aliases) + aliases: Unset | OptionChainOptionAliases = ( + UNSET + if isinstance(_aliases, Unset) + else OptionChainOptionAliases.from_dict(_aliases) + ) _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date - if isinstance(_listed_dt, Unset): - listed_dt = UNSET - else: - listed_dt = Date.from_dict(_listed_dt) + listed_dt: Unset | Date = ( + UNSET if isinstance(_listed_dt, Unset) else Date.from_dict(_listed_dt) + ) _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date - if isinstance(_delisted_dt, Unset): - delisted_dt = UNSET - else: - delisted_dt = Date.from_dict(_delisted_dt) + delisted_dt: Unset | Date = ( + UNSET if isinstance(_delisted_dt, Unset) else Date.from_dict(_delisted_dt) + ) description = d.pop("description", UNSET) @@ -178,25 +178,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: traded_exchanges.append(traded_exchanges_item) _first_trade_dt = d.pop("firstTradeDt", UNSET) - first_trade_dt: Unset | Date - if isinstance(_first_trade_dt, Unset): - first_trade_dt = UNSET - else: - first_trade_dt = Date.from_dict(_first_trade_dt) + first_trade_dt: Unset | Date = ( + UNSET + if isinstance(_first_trade_dt, Unset) + else Date.from_dict(_first_trade_dt) + ) _last_trade_dt = d.pop("lastTradeDt", UNSET) - last_trade_dt: Unset | Date - if isinstance(_last_trade_dt, Unset): - last_trade_dt = UNSET - else: - last_trade_dt = Date.from_dict(_last_trade_dt) + last_trade_dt: Unset | Date = ( + UNSET + if isinstance(_last_trade_dt, Unset) + else Date.from_dict(_last_trade_dt) + ) _put_call = d.pop("putCall", UNSET) - put_call: Unset | PutCall - if isinstance(_put_call, Unset): - put_call = UNSET - else: - put_call = PutCall(_put_call) + put_call: Unset | PutCall = ( + UNSET if isinstance(_put_call, Unset) else PutCall(_put_call) + ) strike = d.pop("strike", UNSET) diff --git a/openapi_project/openapi_package/models/option_chain_option_aliases.py b/openapi_project/openapi_package/models/option_chain_option_aliases.py index 5160afee2..70e59c791 100644 --- a/openapi_project/openapi_package/models/option_chain_option_aliases.py +++ b/openapi_project/openapi_package/models/option_chain_option_aliases.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="OptionChainOptionAliases") - @_attrs_define class OptionChainOptionAliases: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - option_chain_option_aliases = cls( - ) - - + option_chain_option_aliases = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/option_chain_options.py b/openapi_project/openapi_package/models/option_chain_options.py index ff87cf6e9..7b9cc3d97 100644 --- a/openapi_project/openapi_package/models/option_chain_options.py +++ b/openapi_project/openapi_package/models/option_chain_options.py @@ -9,54 +9,37 @@ from typing import cast if TYPE_CHECKING: - from ..models.option_chain_option import OptionChainOption - - - + from ..models.option_chain_option import OptionChainOption T = TypeVar("T", bound="OptionChainOptions") - @_attrs_define class OptionChainOptions: - """ - """ - - additional_properties: dict[str, 'OptionChainOption'] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, "OptionChainOption"] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: prop = prop.to_dict() - for prop_name, prop in self.additional_properties.items() - }) + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop.to_dict() return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - option_chain_options = cls( - ) - - + option_chain_options = cls() additional_properties = {} for prop_name, prop_dict in d.items(): additional_property = OptionChainOption.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property option_chain_options.additional_properties = additional_properties @@ -66,10 +49,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) - def __getitem__(self, key: str) -> 'OptionChainOption': + def __getitem__(self, key: str) -> "OptionChainOption": return self.additional_properties[key] - def __setitem__(self, key: str, value: 'OptionChainOption') -> None: + def __setitem__(self, key: str, value: "OptionChainOption") -> None: self.additional_properties[key] = value def __delitem__(self, key: str) -> None: diff --git a/openapi_project/openapi_package/models/option_chain_roots.py b/openapi_project/openapi_package/models/option_chain_roots.py index 3bbb14f53..d0631a3ad 100644 --- a/openapi_project/openapi_package/models/option_chain_roots.py +++ b/openapi_project/openapi_package/models/option_chain_roots.py @@ -9,54 +9,37 @@ from typing import cast if TYPE_CHECKING: - from ..models.option_root import OptionRoot - - - + from ..models.option_root import OptionRoot T = TypeVar("T", bound="OptionChainRoots") - @_attrs_define class OptionChainRoots: - """ - """ - - additional_properties: dict[str, 'OptionRoot'] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, "OptionRoot"] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: prop = prop.to_dict() - for prop_name, prop in self.additional_properties.items() - }) + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop.to_dict() return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - option_chain_roots = cls( - ) - - + option_chain_roots = cls() additional_properties = {} for prop_name, prop_dict in d.items(): additional_property = OptionRoot.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property option_chain_roots.additional_properties = additional_properties @@ -66,10 +49,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) - def __getitem__(self, key: str) -> 'OptionRoot': + def __getitem__(self, key: str) -> "OptionRoot": return self.additional_properties[key] - def __setitem__(self, key: str, value: 'OptionRoot') -> None: + def __setitem__(self, key: str, value: "OptionRoot") -> None: self.additional_properties[key] = value def __delitem__(self, key: str) -> None: diff --git a/openapi_project/openapi_package/models/option_root.py b/openapi_project/openapi_package/models/option_root.py index ca2778df3..ed10f5510 100644 --- a/openapi_project/openapi_package/models/option_root.py +++ b/openapi_project/openapi_package/models/option_root.py @@ -18,10 +18,10 @@ from typing import cast if TYPE_CHECKING: + from ..models.option_root_aliases import OptionRootAliases from ..models.settlement_info import SettlementInfo - from ..models.trading_session_group import TradingSessionGroup from ..models.date import Date - from ..models.option_root_aliases import OptionRootAliases + from ..models.trading_session_group import TradingSessionGroup T = TypeVar("T", bound="OptionRoot") @@ -93,21 +93,21 @@ class OptionRoot: underlying: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = UNSET - if not isinstance(self.aliases, Unset): - aliases = self.aliases.to_dict() + aliases: Unset | dict[str, Any] = ( + UNSET if isinstance(self.aliases, Unset) else self.aliases.to_dict() + ) - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value + currency: Unset | str = ( + UNSET if isinstance(self.currency, Unset) else self.currency.value + ) - listed_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.listed_dt, Unset): - listed_dt = self.listed_dt.to_dict() + listed_dt: Unset | dict[str, Any] = ( + UNSET if isinstance(self.listed_dt, Unset) else self.listed_dt.to_dict() + ) - delisted_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.delisted_dt, Unset): - delisted_dt = self.delisted_dt.to_dict() + delisted_dt: Unset | dict[str, Any] = ( + UNSET if isinstance(self.delisted_dt, Unset) else self.delisted_dt.to_dict() + ) description = self.description @@ -121,19 +121,25 @@ def to_dict(self) -> dict[str, Any]: price_display_factor = self.price_display_factor - price_display_format: Unset | str = UNSET - if not isinstance(self.price_display_format, Unset): - price_display_format = self.price_display_format.value + price_display_format: Unset | str = ( + UNSET + if isinstance(self.price_display_format, Unset) + else self.price_display_format.value + ) qty_display_factor = self.qty_display_factor - qty_display_format: Unset | str = UNSET - if not isinstance(self.qty_display_format, Unset): - qty_display_format = self.qty_display_format.value + qty_display_format: Unset | str = ( + UNSET + if isinstance(self.qty_display_format, Unset) + else self.qty_display_format.value + ) - security_category: Unset | str = UNSET - if not isinstance(self.security_category, Unset): - security_category = self.security_category.value + security_category: Unset | str = ( + UNSET + if isinstance(self.security_category, Unset) + else self.security_category.value + ) symbol = self.symbol @@ -152,17 +158,19 @@ def to_dict(self) -> dict[str, Any]: deliverable_per_contract = self.deliverable_per_contract - exercise_style: Unset | str = UNSET - if not isinstance(self.exercise_style, Unset): - exercise_style = self.exercise_style.value + exercise_style: Unset | str = ( + UNSET + if isinstance(self.exercise_style, Unset) + else self.exercise_style.value + ) - product_type: Unset | str = UNSET - if not isinstance(self.product_type, Unset): - product_type = self.product_type.value + product_type: Unset | str = ( + UNSET if isinstance(self.product_type, Unset) else self.product_type.value + ) - series_type: Unset | str = UNSET - if not isinstance(self.series_type, Unset): - series_type = self.series_type.value + series_type: Unset | str = ( + UNSET if isinstance(self.series_type, Unset) else self.series_type.value + ) settlement_infos: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.settlement_infos, Unset): @@ -171,17 +179,21 @@ def to_dict(self) -> dict[str, Any]: settlement_infos_item = settlement_infos_item_data.to_dict() settlement_infos.append(settlement_infos_item) - settlement_type: Unset | str = UNSET - if not isinstance(self.settlement_type, Unset): - settlement_type = self.settlement_type.value + settlement_type: Unset | str = ( + UNSET + if isinstance(self.settlement_type, Unset) + else self.settlement_type.value + ) strike_multiplier = self.strike_multiplier strike_value = self.strike_value - trading_session_group: Unset | dict[str, Any] = UNSET - if not isinstance(self.trading_session_group, Unset): - trading_session_group = self.trading_session_group.to_dict() + trading_session_group: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.trading_session_group, Unset) + else self.trading_session_group.to_dict() + ) underlying = self.underlying @@ -253,32 +265,26 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _aliases = d.pop("aliases", UNSET) - aliases: Unset | OptionRootAliases - if isinstance(_aliases, Unset): - aliases = UNSET - else: - aliases = OptionRootAliases.from_dict(_aliases) + aliases: Unset | OptionRootAliases = ( + UNSET + if isinstance(_aliases, Unset) + else OptionRootAliases.from_dict(_aliases) + ) _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) + currency: Unset | Currency = ( + UNSET if isinstance(_currency, Unset) else Currency(_currency) + ) _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date - if isinstance(_listed_dt, Unset): - listed_dt = UNSET - else: - listed_dt = Date.from_dict(_listed_dt) + listed_dt: Unset | Date = ( + UNSET if isinstance(_listed_dt, Unset) else Date.from_dict(_listed_dt) + ) _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date - if isinstance(_delisted_dt, Unset): - delisted_dt = UNSET - else: - delisted_dt = Date.from_dict(_delisted_dt) + delisted_dt: Unset | Date = ( + UNSET if isinstance(_delisted_dt, Unset) else Date.from_dict(_delisted_dt) + ) description = d.pop("description", UNSET) @@ -293,27 +299,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: price_display_factor = d.pop("priceDisplayFactor", UNSET) _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat - if isinstance(_price_display_format, Unset): - price_display_format = UNSET - else: - price_display_format = NumericDisplayFormat(_price_display_format) + price_display_format: Unset | NumericDisplayFormat = ( + UNSET + if isinstance(_price_display_format, Unset) + else NumericDisplayFormat(_price_display_format) + ) qty_display_factor = d.pop("qtyDisplayFactor", UNSET) _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat - if isinstance(_qty_display_format, Unset): - qty_display_format = UNSET - else: - qty_display_format = NumericDisplayFormat(_qty_display_format) + qty_display_format: Unset | NumericDisplayFormat = ( + UNSET + if isinstance(_qty_display_format, Unset) + else NumericDisplayFormat(_qty_display_format) + ) _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory - if isinstance(_security_category, Unset): - security_category = UNSET - else: - security_category = SecurityCategory(_security_category) + security_category: Unset | SecurityCategory = ( + UNSET + if isinstance(_security_category, Unset) + else SecurityCategory(_security_category) + ) symbol = d.pop("symbol", UNSET) @@ -333,25 +339,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: deliverable_per_contract = d.pop("deliverablePerContract", UNSET) _exercise_style = d.pop("exerciseStyle", UNSET) - exercise_style: Unset | OptionExerciseStyle - if isinstance(_exercise_style, Unset): - exercise_style = UNSET - else: - exercise_style = OptionExerciseStyle(_exercise_style) + exercise_style: Unset | OptionExerciseStyle = ( + UNSET + if isinstance(_exercise_style, Unset) + else OptionExerciseStyle(_exercise_style) + ) _product_type = d.pop("productType", UNSET) - product_type: Unset | OptionSeriesProductType - if isinstance(_product_type, Unset): - product_type = UNSET - else: - product_type = OptionSeriesProductType(_product_type) + product_type: Unset | OptionSeriesProductType = ( + UNSET + if isinstance(_product_type, Unset) + else OptionSeriesProductType(_product_type) + ) _series_type = d.pop("seriesType", UNSET) - series_type: Unset | OptionSeriesType - if isinstance(_series_type, Unset): - series_type = UNSET - else: - series_type = OptionSeriesType(_series_type) + series_type: Unset | OptionSeriesType = ( + UNSET if isinstance(_series_type, Unset) else OptionSeriesType(_series_type) + ) settlement_infos = [] _settlement_infos = d.pop("settlementInfos", UNSET) @@ -361,24 +365,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: settlement_infos.append(settlement_infos_item) _settlement_type = d.pop("settlementType", UNSET) - settlement_type: Unset | OptionSettlementType - if isinstance(_settlement_type, Unset): - settlement_type = UNSET - else: - settlement_type = OptionSettlementType(_settlement_type) + settlement_type: Unset | OptionSettlementType = ( + UNSET + if isinstance(_settlement_type, Unset) + else OptionSettlementType(_settlement_type) + ) strike_multiplier = d.pop("strikeMultiplier", UNSET) strike_value = d.pop("strikeValue", UNSET) _trading_session_group = d.pop("tradingSessionGroup", UNSET) - trading_session_group: Unset | TradingSessionGroup - if isinstance(_trading_session_group, Unset): - trading_session_group = UNSET - else: - trading_session_group = TradingSessionGroup.from_dict( - _trading_session_group - ) + trading_session_group: Unset | TradingSessionGroup = ( + UNSET + if isinstance(_trading_session_group, Unset) + else TradingSessionGroup.from_dict(_trading_session_group) + ) underlying = d.pop("underlying", UNSET) diff --git a/openapi_project/openapi_package/models/option_root_aliases.py b/openapi_project/openapi_package/models/option_root_aliases.py index 71b236120..e87429cce 100644 --- a/openapi_project/openapi_package/models/option_root_aliases.py +++ b/openapi_project/openapi_package/models/option_root_aliases.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="OptionRootAliases") - @_attrs_define class OptionRootAliases: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - option_root_aliases = cls( - ) - - + option_root_aliases = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/option_series.py b/openapi_project/openapi_package/models/option_series.py index 702de8b65..313e215f5 100644 --- a/openapi_project/openapi_package/models/option_series.py +++ b/openapi_project/openapi_package/models/option_series.py @@ -58,31 +58,37 @@ class OptionSeries: security_category: Unset | SecurityCategory = UNSET def to_dict(self) -> dict[str, Any]: - expiration_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.expiration_dt, Unset): - expiration_dt = self.expiration_dt.to_dict() + expiration_dt: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.expiration_dt, Unset) + else self.expiration_dt.to_dict() + ) - expiration_style: Unset | str = UNSET - if not isinstance(self.expiration_style, Unset): - expiration_style = self.expiration_style.value + expiration_style: Unset | str = ( + UNSET + if isinstance(self.expiration_style, Unset) + else self.expiration_style.value + ) root_symbol = self.root_symbol - series_type: Unset | str = UNSET - if not isinstance(self.series_type, Unset): - series_type = self.series_type.value + series_type: Unset | str = ( + UNSET if isinstance(self.series_type, Unset) else self.series_type.value + ) - settlement_type: Unset | str = UNSET - if not isinstance(self.settlement_type, Unset): - settlement_type = self.settlement_type.value + settlement_type: Unset | str = ( + UNSET + if isinstance(self.settlement_type, Unset) + else self.settlement_type.value + ) option_symbols: Unset | list[str] = UNSET if not isinstance(self.option_symbols, Unset): option_symbols = self.option_symbols - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value + currency: Unset | str = ( + UNSET if isinstance(self.currency, Unset) else self.currency.value + ) multiplier = self.multiplier @@ -90,19 +96,25 @@ def to_dict(self) -> dict[str, Any]: price_display_factor = self.price_display_factor - price_display_format: Unset | str = UNSET - if not isinstance(self.price_display_format, Unset): - price_display_format = self.price_display_format.value + price_display_format: Unset | str = ( + UNSET + if isinstance(self.price_display_format, Unset) + else self.price_display_format.value + ) qty_display_factor = self.qty_display_factor - qty_display_format: Unset | str = UNSET - if not isinstance(self.qty_display_format, Unset): - qty_display_format = self.qty_display_format.value + qty_display_format: Unset | str = ( + UNSET + if isinstance(self.qty_display_format, Unset) + else self.qty_display_format.value + ) - security_category: Unset | str = UNSET - if not isinstance(self.security_category, Unset): - security_category = self.security_category.value + security_category: Unset | str = ( + UNSET + if isinstance(self.security_category, Unset) + else self.security_category.value + ) field_dict: dict[str, Any] = {} @@ -142,43 +154,39 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _expiration_dt = d.pop("expirationDt", UNSET) - expiration_dt: Unset | Date - if isinstance(_expiration_dt, Unset): - expiration_dt = UNSET - else: - expiration_dt = Date.from_dict(_expiration_dt) + expiration_dt: Unset | Date = ( + UNSET + if isinstance(_expiration_dt, Unset) + else Date.from_dict(_expiration_dt) + ) _expiration_style = d.pop("expirationStyle", UNSET) - expiration_style: Unset | OptionExpirationStyle - if isinstance(_expiration_style, Unset): - expiration_style = UNSET - else: - expiration_style = OptionExpirationStyle(_expiration_style) + expiration_style: Unset | OptionExpirationStyle = ( + UNSET + if isinstance(_expiration_style, Unset) + else OptionExpirationStyle(_expiration_style) + ) root_symbol = d.pop("rootSymbol", UNSET) _series_type = d.pop("seriesType", UNSET) - series_type: Unset | OptionSeriesType - if isinstance(_series_type, Unset): - series_type = UNSET - else: - series_type = OptionSeriesType(_series_type) + series_type: Unset | OptionSeriesType = ( + UNSET if isinstance(_series_type, Unset) else OptionSeriesType(_series_type) + ) _settlement_type = d.pop("settlementType", UNSET) - settlement_type: Unset | OptionSettlementType - if isinstance(_settlement_type, Unset): - settlement_type = UNSET - else: - settlement_type = OptionSettlementType(_settlement_type) + settlement_type: Unset | OptionSettlementType = ( + UNSET + if isinstance(_settlement_type, Unset) + else OptionSettlementType(_settlement_type) + ) option_symbols = cast(list[str], d.pop("optionSymbols", UNSET)) _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) + currency: Unset | Currency = ( + UNSET if isinstance(_currency, Unset) else Currency(_currency) + ) multiplier = d.pop("multiplier", UNSET) @@ -187,27 +195,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: price_display_factor = d.pop("priceDisplayFactor", UNSET) _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat - if isinstance(_price_display_format, Unset): - price_display_format = UNSET - else: - price_display_format = NumericDisplayFormat(_price_display_format) + price_display_format: Unset | NumericDisplayFormat = ( + UNSET + if isinstance(_price_display_format, Unset) + else NumericDisplayFormat(_price_display_format) + ) qty_display_factor = d.pop("qtyDisplayFactor", UNSET) _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat - if isinstance(_qty_display_format, Unset): - qty_display_format = UNSET - else: - qty_display_format = NumericDisplayFormat(_qty_display_format) + qty_display_format: Unset | NumericDisplayFormat = ( + UNSET + if isinstance(_qty_display_format, Unset) + else NumericDisplayFormat(_qty_display_format) + ) _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory - if isinstance(_security_category, Unset): - security_category = UNSET - else: - security_category = SecurityCategory(_security_category) + security_category: Unset | SecurityCategory = ( + UNSET + if isinstance(_security_category, Unset) + else SecurityCategory(_security_category) + ) option_series = cls( expiration_dt=expiration_dt, diff --git a/openapi_project/openapi_package/models/order.py b/openapi_project/openapi_package/models/order.py index e72f017b8..db8734e5b 100644 --- a/openapi_project/openapi_package/models/order.py +++ b/openapi_project/openapi_package/models/order.py @@ -17,14 +17,14 @@ from typing import cast if TYPE_CHECKING: + from ..models.clearing_info import ClearingInfo from ..models.order_optional_data import OrderOptionalData - from ..models.order_market_condition import OrderMarketCondition - from ..models.security import Security from ..models.order_update_event import OrderUpdateEvent + from ..models.order_algo import OrderAlgo from ..models.header import Header - from ..models.clearing_info import ClearingInfo + from ..models.security import Security + from ..models.order_market_condition import OrderMarketCondition from ..models.order_instruction import OrderInstruction - from ..models.order_algo import OrderAlgo T = TypeVar("T", bound="Order") @@ -132,21 +132,23 @@ class Order: def to_dict(self) -> dict[str, Any]: account_id = self.account_id - algo: Unset | dict[str, Any] = UNSET - if not isinstance(self.algo, Unset): - algo = self.algo.to_dict() + algo: Unset | dict[str, Any] = ( + UNSET if isinstance(self.algo, Unset) else self.algo.to_dict() + ) aux_price = self.aux_price - clearing_info: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_info, Unset): - clearing_info = self.clearing_info.to_dict() + clearing_info: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.clearing_info, Unset) + else self.clearing_info.to_dict() + ) cur_ord_id = self.cur_ord_id - header: Unset | dict[str, Any] = UNSET - if not isinstance(self.header, Unset): - header = self.header.to_dict() + header: Unset | dict[str, Any] = ( + UNSET if isinstance(self.header, Unset) else self.header.to_dict() + ) id = self.id @@ -161,13 +163,17 @@ def to_dict(self) -> dict[str, Any]: instructions_item = instructions_item_data.to_dict() instructions.append(instructions_item) - market_condition: Unset | dict[str, Any] = UNSET - if not isinstance(self.market_condition, Unset): - market_condition = self.market_condition.to_dict() + market_condition: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.market_condition, Unset) + else self.market_condition.to_dict() + ) - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() + optional_data: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.optional_data, Unset) + else self.optional_data.to_dict() + ) order_flags = self.order_flags @@ -178,37 +184,39 @@ def to_dict(self) -> dict[str, Any]: order_updates_item = order_updates_item_data.to_dict() order_updates.append(order_updates_item) - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value + ord_type: Unset | str = ( + UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value + ) - origination_type: Unset | str = UNSET - if not isinstance(self.origination_type, Unset): - origination_type = self.origination_type.value + origination_type: Unset | str = ( + UNSET + if isinstance(self.origination_type, Unset) + else self.origination_type.value + ) parent_ord_id = self.parent_ord_id - position_effect: Unset | str = UNSET - if not isinstance(self.position_effect, Unset): - position_effect = self.position_effect.value + position_effect: Unset | str = ( + UNSET + if isinstance(self.position_effect, Unset) + else self.position_effect.value + ) price = self.price - price_type: Unset | str = UNSET - if not isinstance(self.price_type, Unset): - price_type = self.price_type.value + price_type: Unset | str = ( + UNSET if isinstance(self.price_type, Unset) else self.price_type.value + ) qty = self.qty route = self.route - security: Unset | dict[str, Any] = UNSET - if not isinstance(self.security, Unset): - security = self.security.to_dict() + security: Unset | dict[str, Any] = ( + UNSET if isinstance(self.security, Unset) else self.security.to_dict() + ) - side: Unset | str = UNSET - if not isinstance(self.side, Unset): - side = self.side.value + side: Unset | str = UNSET if isinstance(self.side, Unset) else self.side.value source = self.source @@ -222,17 +230,15 @@ def to_dict(self) -> dict[str, Any]: text = self.text - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value + tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value trader_id = self.trader_id user_id = self.user_id - ord_status: Unset | str = UNSET - if not isinstance(self.ord_status, Unset): - ord_status = self.ord_status.value + ord_status: Unset | str = ( + UNSET if isinstance(self.ord_status, Unset) else self.ord_status.value + ) avg_price = self.avg_price @@ -362,29 +368,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: account_id = d.pop("accountId", UNSET) _algo = d.pop("algo", UNSET) - algo: Unset | OrderAlgo - if isinstance(_algo, Unset): - algo = UNSET - else: - algo = OrderAlgo.from_dict(_algo) + algo: Unset | OrderAlgo = ( + UNSET if isinstance(_algo, Unset) else OrderAlgo.from_dict(_algo) + ) aux_price = d.pop("auxPrice", UNSET) _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo - if isinstance(_clearing_info, Unset): - clearing_info = UNSET - else: - clearing_info = ClearingInfo.from_dict(_clearing_info) + clearing_info: Unset | ClearingInfo = ( + UNSET + if isinstance(_clearing_info, Unset) + else ClearingInfo.from_dict(_clearing_info) + ) cur_ord_id = d.pop("curOrdId", UNSET) _header = d.pop("header", UNSET) - header: Unset | Header - if isinstance(_header, Unset): - header = UNSET - else: - header = Header.from_dict(_header) + header: Unset | Header = ( + UNSET if isinstance(_header, Unset) else Header.from_dict(_header) + ) id = d.pop("id", UNSET) @@ -400,18 +402,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: instructions.append(instructions_item) _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | OrderMarketCondition - if isinstance(_market_condition, Unset): - market_condition = UNSET - else: - market_condition = OrderMarketCondition.from_dict(_market_condition) + market_condition: Unset | OrderMarketCondition = ( + UNSET + if isinstance(_market_condition, Unset) + else OrderMarketCondition.from_dict(_market_condition) + ) _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | OrderOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = OrderOptionalData.from_dict(_optional_data) + optional_data: Unset | OrderOptionalData = ( + UNSET + if isinstance(_optional_data, Unset) + else OrderOptionalData.from_dict(_optional_data) + ) order_flags = d.pop("orderFlags", UNSET) @@ -423,54 +425,44 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: order_updates.append(order_updates_item) _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) + ord_type: Unset | OrdType = ( + UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) + ) _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType - if isinstance(_origination_type, Unset): - origination_type = UNSET - else: - origination_type = OriginationType(_origination_type) + origination_type: Unset | OriginationType = ( + UNSET + if isinstance(_origination_type, Unset) + else OriginationType(_origination_type) + ) parent_ord_id = d.pop("parentOrdId", UNSET) _position_effect = d.pop("positionEffect", UNSET) - position_effect: Unset | PositionEffect - if isinstance(_position_effect, Unset): - position_effect = UNSET - else: - position_effect = PositionEffect(_position_effect) + position_effect: Unset | PositionEffect = ( + UNSET + if isinstance(_position_effect, Unset) + else PositionEffect(_position_effect) + ) price = d.pop("price", UNSET) _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType - if isinstance(_price_type, Unset): - price_type = UNSET - else: - price_type = PriceType(_price_type) + price_type: Unset | PriceType = ( + UNSET if isinstance(_price_type, Unset) else PriceType(_price_type) + ) qty = d.pop("qty", UNSET) route = d.pop("route", UNSET) _security = d.pop("security", UNSET) - security: Unset | Security - if isinstance(_security, Unset): - security = UNSET - else: - security = Security.from_dict(_security) + security: Unset | Security = ( + UNSET if isinstance(_security, Unset) else Security.from_dict(_security) + ) _side = d.pop("side", UNSET) - side: Unset | Side - if isinstance(_side, Unset): - side = UNSET - else: - side = Side(_side) + side: Unset | Side = UNSET if isinstance(_side, Unset) else Side(_side) source = d.pop("source", UNSET) @@ -485,22 +477,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: text = d.pop("text", UNSET) _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) + tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) trader_id = d.pop("traderId", UNSET) user_id = d.pop("userId", UNSET) _ord_status = d.pop("ordStatus", UNSET) - ord_status: Unset | OrdStatus - if isinstance(_ord_status, Unset): - ord_status = UNSET - else: - ord_status = OrdStatus(_ord_status) + ord_status: Unset | OrdStatus = ( + UNSET if isinstance(_ord_status, Unset) else OrdStatus(_ord_status) + ) avg_price = d.pop("avgPrice", UNSET) diff --git a/openapi_project/openapi_package/models/order_algo.py b/openapi_project/openapi_package/models/order_algo.py index 048c3434b..9458a992f 100644 --- a/openapi_project/openapi_package/models/order_algo.py +++ b/openapi_project/openapi_package/models/order_algo.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="OrderAlgo") - @_attrs_define class OrderAlgo: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - order_algo = cls( - ) - - + order_algo = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/order_cancel_reject.py b/openapi_project/openapi_package/models/order_cancel_reject.py index c367d449b..dc0487238 100644 --- a/openapi_project/openapi_package/models/order_cancel_reject.py +++ b/openapi_project/openapi_package/models/order_cancel_reject.py @@ -59,17 +59,21 @@ def to_dict(self) -> dict[str, Any]: incoming_orig_cl_ord_id = self.incoming_orig_cl_ord_id - ord_status: Unset | str = UNSET - if not isinstance(self.ord_status, Unset): - ord_status = self.ord_status.value + ord_status: Unset | str = ( + UNSET if isinstance(self.ord_status, Unset) else self.ord_status.value + ) - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() + optional_data: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.optional_data, Unset) + else self.optional_data.to_dict() + ) - origination_type: Unset | str = UNSET - if not isinstance(self.origination_type, Unset): - origination_type = self.origination_type.value + origination_type: Unset | str = ( + UNSET + if isinstance(self.origination_type, Unset) + else self.origination_type.value + ) perm_ord_id = self.perm_ord_id @@ -83,9 +87,11 @@ def to_dict(self) -> dict[str, Any]: transact_ts = self.transact_ts - cxl_rej_response_to: Unset | str = UNSET - if not isinstance(self.cxl_rej_response_to, Unset): - cxl_rej_response_to = self.cxl_rej_response_to.value + cxl_rej_response_to: Unset | str = ( + UNSET + if isinstance(self.cxl_rej_response_to, Unset) + else self.cxl_rej_response_to.value + ) field_dict: dict[str, Any] = {} @@ -129,25 +135,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: incoming_orig_cl_ord_id = d.pop("incomingOrigClOrdId", UNSET) _ord_status = d.pop("ordStatus", UNSET) - ord_status: Unset | OrdStatus - if isinstance(_ord_status, Unset): - ord_status = UNSET - else: - ord_status = OrdStatus(_ord_status) + ord_status: Unset | OrdStatus = ( + UNSET if isinstance(_ord_status, Unset) else OrdStatus(_ord_status) + ) _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | OrderCancelRejectOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = OrderCancelRejectOptionalData.from_dict(_optional_data) + optional_data: Unset | OrderCancelRejectOptionalData = ( + UNSET + if isinstance(_optional_data, Unset) + else OrderCancelRejectOptionalData.from_dict(_optional_data) + ) _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType - if isinstance(_origination_type, Unset): - origination_type = UNSET - else: - origination_type = OriginationType(_origination_type) + origination_type: Unset | OriginationType = ( + UNSET + if isinstance(_origination_type, Unset) + else OriginationType(_origination_type) + ) perm_ord_id = d.pop("permOrdId", UNSET) @@ -162,11 +166,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: transact_ts = d.pop("transactTs", UNSET) _cxl_rej_response_to = d.pop("cxlRejResponseTo", UNSET) - cxl_rej_response_to: Unset | CxlRejResponseTo - if isinstance(_cxl_rej_response_to, Unset): - cxl_rej_response_to = UNSET - else: - cxl_rej_response_to = CxlRejResponseTo(_cxl_rej_response_to) + cxl_rej_response_to: Unset | CxlRejResponseTo = ( + UNSET + if isinstance(_cxl_rej_response_to, Unset) + else CxlRejResponseTo(_cxl_rej_response_to) + ) order_cancel_reject = cls( cur_ord_id=cur_ord_id, diff --git a/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py b/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py index 9e4b4615c..fb270c29c 100644 --- a/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py +++ b/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="OrderCancelRejectOptionalData") - @_attrs_define class OrderCancelRejectOptionalData: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - order_cancel_reject_optional_data = cls( - ) - - + order_cancel_reject_optional_data = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/order_cancel_replace_request.py b/openapi_project/openapi_package/models/order_cancel_replace_request.py index 22f8c9af1..5407ee7ef 100644 --- a/openapi_project/openapi_package/models/order_cancel_replace_request.py +++ b/openapi_project/openapi_package/models/order_cancel_replace_request.py @@ -15,16 +15,16 @@ from typing import cast if TYPE_CHECKING: + from ..models.clearing_info import ClearingInfo + from ..models.header import Header from ..models.order_cancel_replace_request_market_condition import ( OrderCancelReplaceRequestMarketCondition, ) - from ..models.header import Header + from ..models.order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo from ..models.order_cancel_replace_request_optional_data import ( OrderCancelReplaceRequestOptionalData, ) - from ..models.clearing_info import ClearingInfo from ..models.order_instruction import OrderInstruction - from ..models.order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo T = TypeVar("T", bound="OrderCancelReplaceRequest") @@ -84,21 +84,23 @@ class OrderCancelReplaceRequest: user_id: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: - algo: Unset | dict[str, Any] = UNSET - if not isinstance(self.algo, Unset): - algo = self.algo.to_dict() + algo: Unset | dict[str, Any] = ( + UNSET if isinstance(self.algo, Unset) else self.algo.to_dict() + ) aux_price = self.aux_price - clearing_info: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_info, Unset): - clearing_info = self.clearing_info.to_dict() + clearing_info: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.clearing_info, Unset) + else self.clearing_info.to_dict() + ) cur_ord_id = self.cur_ord_id - header: Unset | dict[str, Any] = UNSET - if not isinstance(self.header, Unset): - header = self.header.to_dict() + header: Unset | dict[str, Any] = ( + UNSET if isinstance(self.header, Unset) else self.header.to_dict() + ) incoming_cl_ord_id = self.incoming_cl_ord_id @@ -111,45 +113,47 @@ def to_dict(self) -> dict[str, Any]: instructions_item = instructions_item_data.to_dict() instructions.append(instructions_item) - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() + optional_data: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.optional_data, Unset) + else self.optional_data.to_dict() + ) - market_condition: Unset | dict[str, Any] = UNSET - if not isinstance(self.market_condition, Unset): - market_condition = self.market_condition.to_dict() + market_condition: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.market_condition, Unset) + else self.market_condition.to_dict() + ) - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value + ord_type: Unset | str = ( + UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value + ) - origination_type: Unset | str = UNSET - if not isinstance(self.origination_type, Unset): - origination_type = self.origination_type.value + origination_type: Unset | str = ( + UNSET + if isinstance(self.origination_type, Unset) + else self.origination_type.value + ) perm_ord_id = self.perm_ord_id price = self.price - price_type: Unset | str = UNSET - if not isinstance(self.price_type, Unset): - price_type = self.price_type.value + price_type: Unset | str = ( + UNSET if isinstance(self.price_type, Unset) else self.price_type.value + ) qty = self.qty req_ord_id = self.req_ord_id - side: Unset | str = UNSET - if not isinstance(self.side, Unset): - side = self.side.value + side: Unset | str = UNSET if isinstance(self.side, Unset) else self.side.value source = self.source submit_ts = self.submit_ts - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value + tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value trader_id = self.trader_id @@ -211,29 +215,27 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _algo = d.pop("algo", UNSET) - algo: Unset | OrderCancelReplaceRequestAlgo - if isinstance(_algo, Unset): - algo = UNSET - else: - algo = OrderCancelReplaceRequestAlgo.from_dict(_algo) + algo: Unset | OrderCancelReplaceRequestAlgo = ( + UNSET + if isinstance(_algo, Unset) + else OrderCancelReplaceRequestAlgo.from_dict(_algo) + ) aux_price = d.pop("auxPrice", UNSET) _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo - if isinstance(_clearing_info, Unset): - clearing_info = UNSET - else: - clearing_info = ClearingInfo.from_dict(_clearing_info) + clearing_info: Unset | ClearingInfo = ( + UNSET + if isinstance(_clearing_info, Unset) + else ClearingInfo.from_dict(_clearing_info) + ) cur_ord_id = d.pop("curOrdId", UNSET) _header = d.pop("header", UNSET) - header: Unset | Header - if isinstance(_header, Unset): - header = UNSET - else: - header = Header.from_dict(_header) + header: Unset | Header = ( + UNSET if isinstance(_header, Unset) else Header.from_dict(_header) + ) incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) @@ -247,69 +249,53 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: instructions.append(instructions_item) _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | OrderCancelReplaceRequestOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = OrderCancelReplaceRequestOptionalData.from_dict( - _optional_data - ) + optional_data: Unset | OrderCancelReplaceRequestOptionalData = ( + UNSET + if isinstance(_optional_data, Unset) + else OrderCancelReplaceRequestOptionalData.from_dict(_optional_data) + ) _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | OrderCancelReplaceRequestMarketCondition - if isinstance(_market_condition, Unset): - market_condition = UNSET - else: - market_condition = OrderCancelReplaceRequestMarketCondition.from_dict( - _market_condition - ) + market_condition: Unset | OrderCancelReplaceRequestMarketCondition = ( + UNSET + if isinstance(_market_condition, Unset) + else OrderCancelReplaceRequestMarketCondition.from_dict(_market_condition) + ) _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) + ord_type: Unset | OrdType = ( + UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) + ) _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType - if isinstance(_origination_type, Unset): - origination_type = UNSET - else: - origination_type = OriginationType(_origination_type) + origination_type: Unset | OriginationType = ( + UNSET + if isinstance(_origination_type, Unset) + else OriginationType(_origination_type) + ) perm_ord_id = d.pop("permOrdId", UNSET) price = d.pop("price", UNSET) _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType - if isinstance(_price_type, Unset): - price_type = UNSET - else: - price_type = PriceType(_price_type) + price_type: Unset | PriceType = ( + UNSET if isinstance(_price_type, Unset) else PriceType(_price_type) + ) qty = d.pop("qty", UNSET) req_ord_id = d.pop("reqOrdId", UNSET) _side = d.pop("side", UNSET) - side: Unset | Side - if isinstance(_side, Unset): - side = UNSET - else: - side = Side(_side) + side: Unset | Side = UNSET if isinstance(_side, Unset) else Side(_side) source = d.pop("source", UNSET) submit_ts = d.pop("submitTs", UNSET) _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) + tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) trader_id = d.pop("traderId", UNSET) diff --git a/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py b/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py index 4b8859063..76c8e05e7 100644 --- a/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py +++ b/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="OrderCancelReplaceRequestAlgo") - @_attrs_define class OrderCancelReplaceRequestAlgo: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - order_cancel_replace_request_algo = cls( - ) - - + order_cancel_replace_request_algo = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py b/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py index 103028a69..885283c8d 100644 --- a/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py +++ b/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="OrderCancelReplaceRequestMarketCondition") - @_attrs_define class OrderCancelReplaceRequestMarketCondition: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - order_cancel_replace_request_market_condition = cls( - ) - - + order_cancel_replace_request_market_condition = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - order_cancel_replace_request_market_condition.additional_properties = additional_properties + order_cancel_replace_request_market_condition.additional_properties = ( + additional_properties + ) return order_cancel_replace_request_market_condition @property diff --git a/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py b/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py index 7e1a08d27..6e5db2c4d 100644 --- a/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py +++ b/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="OrderCancelReplaceRequestOptionalData") - @_attrs_define class OrderCancelReplaceRequestOptionalData: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - order_cancel_replace_request_optional_data = cls( - ) - - + order_cancel_replace_request_optional_data = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - order_cancel_replace_request_optional_data.additional_properties = additional_properties + order_cancel_replace_request_optional_data.additional_properties = ( + additional_properties + ) return order_cancel_replace_request_optional_data @property diff --git a/openapi_project/openapi_package/models/order_cancel_request.py b/openapi_project/openapi_package/models/order_cancel_request.py index 312dd22d8..f5c9b0f6a 100644 --- a/openapi_project/openapi_package/models/order_cancel_request.py +++ b/openapi_project/openapi_package/models/order_cancel_request.py @@ -11,10 +11,10 @@ from typing import cast if TYPE_CHECKING: + from ..models.order_instruction import OrderInstruction from ..models.order_cancel_request_optional_data import ( OrderCancelRequestOptionalData, ) - from ..models.order_instruction import OrderInstruction T = TypeVar("T", bound="OrderCancelRequest") @@ -65,13 +65,17 @@ def to_dict(self) -> dict[str, Any]: instructions_item = instructions_item_data.to_dict() instructions.append(instructions_item) - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() + optional_data: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.optional_data, Unset) + else self.optional_data.to_dict() + ) - origination_type: Unset | str = UNSET - if not isinstance(self.origination_type, Unset): - origination_type = self.origination_type.value + origination_type: Unset | str = ( + UNSET + if isinstance(self.origination_type, Unset) + else self.origination_type.value + ) perm_ord_id = self.perm_ord_id @@ -132,18 +136,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: instructions.append(instructions_item) _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | OrderCancelRequestOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = OrderCancelRequestOptionalData.from_dict(_optional_data) + optional_data: Unset | OrderCancelRequestOptionalData = ( + UNSET + if isinstance(_optional_data, Unset) + else OrderCancelRequestOptionalData.from_dict(_optional_data) + ) _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType - if isinstance(_origination_type, Unset): - origination_type = UNSET - else: - origination_type = OriginationType(_origination_type) + origination_type: Unset | OriginationType = ( + UNSET + if isinstance(_origination_type, Unset) + else OriginationType(_origination_type) + ) perm_ord_id = d.pop("permOrdId", UNSET) diff --git a/openapi_project/openapi_package/models/order_cancel_request_optional_data.py b/openapi_project/openapi_package/models/order_cancel_request_optional_data.py index ea1c809f3..3bb9ef289 100644 --- a/openapi_project/openapi_package/models/order_cancel_request_optional_data.py +++ b/openapi_project/openapi_package/models/order_cancel_request_optional_data.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="OrderCancelRequestOptionalData") - @_attrs_define class OrderCancelRequestOptionalData: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - order_cancel_request_optional_data = cls( - ) - - + order_cancel_request_optional_data = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/order_cross.py b/openapi_project/openapi_package/models/order_cross.py index b9ceec3b7..d4b0f59e2 100644 --- a/openapi_project/openapi_package/models/order_cross.py +++ b/openapi_project/openapi_package/models/order_cross.py @@ -16,14 +16,14 @@ from typing import cast if TYPE_CHECKING: - from ..models.order_cross_algo import OrderCrossAlgo - from ..models.security import Security - from ..models.order_cross_optional_data import OrderCrossOptionalData + from ..models.order_cross_market_condition import OrderCrossMarketCondition from ..models.order_update_event import OrderUpdateEvent - from ..models.header import Header from ..models.order_cross_allocation import OrderCrossAllocation + from ..models.header import Header + from ..models.security import Security + from ..models.order_cross_optional_data import OrderCrossOptionalData + from ..models.order_cross_algo import OrderCrossAlgo from ..models.order_instruction import OrderInstruction - from ..models.order_cross_market_condition import OrderCrossMarketCondition T = TypeVar("T", bound="OrderCross") @@ -113,9 +113,9 @@ class OrderCross: def to_dict(self) -> dict[str, Any]: account_id = self.account_id - algo: Unset | dict[str, Any] = UNSET - if not isinstance(self.algo, Unset): - algo = self.algo.to_dict() + algo: Unset | dict[str, Any] = ( + UNSET if isinstance(self.algo, Unset) else self.algo.to_dict() + ) allocations: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.allocations, Unset): @@ -124,15 +124,15 @@ def to_dict(self) -> dict[str, Any]: allocations_item = allocations_item_data.to_dict() allocations.append(allocations_item) - cross_type: Unset | str = UNSET - if not isinstance(self.cross_type, Unset): - cross_type = self.cross_type.value + cross_type: Unset | str = ( + UNSET if isinstance(self.cross_type, Unset) else self.cross_type.value + ) cur_ord_id = self.cur_ord_id - header: Unset | dict[str, Any] = UNSET - if not isinstance(self.header, Unset): - header = self.header.to_dict() + header: Unset | dict[str, Any] = ( + UNSET if isinstance(self.header, Unset) else self.header.to_dict() + ) id = self.id @@ -147,13 +147,17 @@ def to_dict(self) -> dict[str, Any]: instructions_item = instructions_item_data.to_dict() instructions.append(instructions_item) - market_condition: Unset | dict[str, Any] = UNSET - if not isinstance(self.market_condition, Unset): - market_condition = self.market_condition.to_dict() + market_condition: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.market_condition, Unset) + else self.market_condition.to_dict() + ) - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() + optional_data: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.optional_data, Unset) + else self.optional_data.to_dict() + ) order_flags = self.order_flags @@ -164,29 +168,31 @@ def to_dict(self) -> dict[str, Any]: order_updates_item = order_updates_item_data.to_dict() order_updates.append(order_updates_item) - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value + ord_type: Unset | str = ( + UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value + ) - origination_type: Unset | str = UNSET - if not isinstance(self.origination_type, Unset): - origination_type = self.origination_type.value + origination_type: Unset | str = ( + UNSET + if isinstance(self.origination_type, Unset) + else self.origination_type.value + ) parent_ord_id = self.parent_ord_id price = self.price - price_type: Unset | str = UNSET - if not isinstance(self.price_type, Unset): - price_type = self.price_type.value + price_type: Unset | str = ( + UNSET if isinstance(self.price_type, Unset) else self.price_type.value + ) qty = self.qty route = self.route - security: Unset | dict[str, Any] = UNSET - if not isinstance(self.security, Unset): - security = self.security.to_dict() + security: Unset | dict[str, Any] = ( + UNSET if isinstance(self.security, Unset) else self.security.to_dict() + ) source = self.source @@ -200,17 +206,15 @@ def to_dict(self) -> dict[str, Any]: text = self.text - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value + tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value user_id = self.user_id trader_id = self.trader_id - ord_status: Unset | str = UNSET - if not isinstance(self.ord_status, Unset): - ord_status = self.ord_status.value + ord_status: Unset | str = ( + UNSET if isinstance(self.ord_status, Unset) else self.ord_status.value + ) claimed_by = self.claimed_by @@ -308,11 +312,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: account_id = d.pop("accountId", UNSET) _algo = d.pop("algo", UNSET) - algo: Unset | OrderCrossAlgo - if isinstance(_algo, Unset): - algo = UNSET - else: - algo = OrderCrossAlgo.from_dict(_algo) + algo: Unset | OrderCrossAlgo = ( + UNSET if isinstance(_algo, Unset) else OrderCrossAlgo.from_dict(_algo) + ) allocations = [] _allocations = d.pop("allocations", UNSET) @@ -322,20 +324,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: allocations.append(allocations_item) _cross_type = d.pop("crossType", UNSET) - cross_type: Unset | CrossType - if isinstance(_cross_type, Unset): - cross_type = UNSET - else: - cross_type = CrossType(_cross_type) + cross_type: Unset | CrossType = ( + UNSET if isinstance(_cross_type, Unset) else CrossType(_cross_type) + ) cur_ord_id = d.pop("curOrdId", UNSET) _header = d.pop("header", UNSET) - header: Unset | Header - if isinstance(_header, Unset): - header = UNSET - else: - header = Header.from_dict(_header) + header: Unset | Header = ( + UNSET if isinstance(_header, Unset) else Header.from_dict(_header) + ) id = d.pop("id", UNSET) @@ -351,18 +349,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: instructions.append(instructions_item) _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | OrderCrossMarketCondition - if isinstance(_market_condition, Unset): - market_condition = UNSET - else: - market_condition = OrderCrossMarketCondition.from_dict(_market_condition) + market_condition: Unset | OrderCrossMarketCondition = ( + UNSET + if isinstance(_market_condition, Unset) + else OrderCrossMarketCondition.from_dict(_market_condition) + ) _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | OrderCrossOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = OrderCrossOptionalData.from_dict(_optional_data) + optional_data: Unset | OrderCrossOptionalData = ( + UNSET + if isinstance(_optional_data, Unset) + else OrderCrossOptionalData.from_dict(_optional_data) + ) order_flags = d.pop("orderFlags", UNSET) @@ -374,40 +372,34 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: order_updates.append(order_updates_item) _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) + ord_type: Unset | OrdType = ( + UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) + ) _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType - if isinstance(_origination_type, Unset): - origination_type = UNSET - else: - origination_type = OriginationType(_origination_type) + origination_type: Unset | OriginationType = ( + UNSET + if isinstance(_origination_type, Unset) + else OriginationType(_origination_type) + ) parent_ord_id = d.pop("parentOrdId", UNSET) price = d.pop("price", UNSET) _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType - if isinstance(_price_type, Unset): - price_type = UNSET - else: - price_type = PriceType(_price_type) + price_type: Unset | PriceType = ( + UNSET if isinstance(_price_type, Unset) else PriceType(_price_type) + ) qty = d.pop("qty", UNSET) route = d.pop("route", UNSET) _security = d.pop("security", UNSET) - security: Unset | Security - if isinstance(_security, Unset): - security = UNSET - else: - security = Security.from_dict(_security) + security: Unset | Security = ( + UNSET if isinstance(_security, Unset) else Security.from_dict(_security) + ) source = d.pop("source", UNSET) @@ -422,22 +414,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: text = d.pop("text", UNSET) _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) + tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) user_id = d.pop("userId", UNSET) trader_id = d.pop("traderId", UNSET) _ord_status = d.pop("ordStatus", UNSET) - ord_status: Unset | OrdStatus - if isinstance(_ord_status, Unset): - ord_status = UNSET - else: - ord_status = OrdStatus(_ord_status) + ord_status: Unset | OrdStatus = ( + UNSET if isinstance(_ord_status, Unset) else OrdStatus(_ord_status) + ) claimed_by = d.pop("claimedBy", UNSET) diff --git a/openapi_project/openapi_package/models/order_cross_algo.py b/openapi_project/openapi_package/models/order_cross_algo.py index 36a69f06e..599a072f2 100644 --- a/openapi_project/openapi_package/models/order_cross_algo.py +++ b/openapi_project/openapi_package/models/order_cross_algo.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="OrderCrossAlgo") - @_attrs_define class OrderCrossAlgo: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - order_cross_algo = cls( - ) - - + order_cross_algo = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/order_cross_allocation.py b/openapi_project/openapi_package/models/order_cross_allocation.py index c302df8a4..59a75c12c 100644 --- a/openapi_project/openapi_package/models/order_cross_allocation.py +++ b/openapi_project/openapi_package/models/order_cross_allocation.py @@ -70,9 +70,11 @@ class OrderCrossAllocation: def to_dict(self) -> dict[str, Any]: account_id = self.account_id - clearing_info: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_info, Unset): - clearing_info = self.clearing_info.to_dict() + clearing_info: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.clearing_info, Unset) + else self.clearing_info.to_dict() + ) id = self.id @@ -85,23 +87,25 @@ def to_dict(self) -> dict[str, Any]: instructions_item = instructions_item_data.to_dict() instructions.append(instructions_item) - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() + optional_data: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.optional_data, Unset) + else self.optional_data.to_dict() + ) - position_effect: Unset | str = UNSET - if not isinstance(self.position_effect, Unset): - position_effect = self.position_effect.value + position_effect: Unset | str = ( + UNSET + if isinstance(self.position_effect, Unset) + else self.position_effect.value + ) qty = self.qty - side: Unset | str = UNSET - if not isinstance(self.side, Unset): - side = self.side.value + side: Unset | str = UNSET if isinstance(self.side, Unset) else self.side.value - side_type: Unset | str = UNSET - if not isinstance(self.side_type, Unset): - side_type = self.side_type.value + side_type: Unset | str = ( + UNSET if isinstance(self.side_type, Unset) else self.side_type.value + ) avg_price = self.avg_price @@ -117,9 +121,9 @@ def to_dict(self) -> dict[str, Any]: transact_ts = self.transact_ts - ord_status: Unset | str = UNSET - if not isinstance(self.ord_status, Unset): - ord_status = self.ord_status.value + ord_status: Unset | str = ( + UNSET if isinstance(self.ord_status, Unset) else self.ord_status.value + ) field_dict: dict[str, Any] = {} @@ -169,11 +173,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: account_id = d.pop("accountId", UNSET) _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo - if isinstance(_clearing_info, Unset): - clearing_info = UNSET - else: - clearing_info = ClearingInfo.from_dict(_clearing_info) + clearing_info: Unset | ClearingInfo = ( + UNSET + if isinstance(_clearing_info, Unset) + else ClearingInfo.from_dict(_clearing_info) + ) id = d.pop("id", UNSET) @@ -187,34 +191,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: instructions.append(instructions_item) _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | OrderCrossAllocationOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = OrderCrossAllocationOptionalData.from_dict(_optional_data) + optional_data: Unset | OrderCrossAllocationOptionalData = ( + UNSET + if isinstance(_optional_data, Unset) + else OrderCrossAllocationOptionalData.from_dict(_optional_data) + ) _position_effect = d.pop("positionEffect", UNSET) - position_effect: Unset | PositionEffect - if isinstance(_position_effect, Unset): - position_effect = UNSET - else: - position_effect = PositionEffect(_position_effect) + position_effect: Unset | PositionEffect = ( + UNSET + if isinstance(_position_effect, Unset) + else PositionEffect(_position_effect) + ) qty = d.pop("qty", UNSET) _side = d.pop("side", UNSET) - side: Unset | Side - if isinstance(_side, Unset): - side = UNSET - else: - side = Side(_side) + side: Unset | Side = UNSET if isinstance(_side, Unset) else Side(_side) _side_type = d.pop("sideType", UNSET) - side_type: Unset | CrossSideType - if isinstance(_side_type, Unset): - side_type = UNSET - else: - side_type = CrossSideType(_side_type) + side_type: Unset | CrossSideType = ( + UNSET if isinstance(_side_type, Unset) else CrossSideType(_side_type) + ) avg_price = d.pop("avgPrice", UNSET) @@ -231,11 +229,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: transact_ts = d.pop("transactTs", UNSET) _ord_status = d.pop("ordStatus", UNSET) - ord_status: Unset | OrdStatus - if isinstance(_ord_status, Unset): - ord_status = UNSET - else: - ord_status = OrdStatus(_ord_status) + ord_status: Unset | OrdStatus = ( + UNSET if isinstance(_ord_status, Unset) else OrdStatus(_ord_status) + ) order_cross_allocation = cls( account_id=account_id, diff --git a/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py b/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py index 9d802155a..39b73a07b 100644 --- a/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py +++ b/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="OrderCrossAllocationOptionalData") - @_attrs_define class OrderCrossAllocationOptionalData: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - order_cross_allocation_optional_data = cls( - ) - - + order_cross_allocation_optional_data = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data @@ -61,7 +46,9 @@ def _parse_additional_property(data: object) -> Union[None, str]: additional_properties[prop_name] = additional_property - order_cross_allocation_optional_data.additional_properties = additional_properties + order_cross_allocation_optional_data.additional_properties = ( + additional_properties + ) return order_cross_allocation_optional_data @property diff --git a/openapi_project/openapi_package/models/order_cross_market_condition.py b/openapi_project/openapi_package/models/order_cross_market_condition.py index 5d10c9e2a..6db3bd8d2 100644 --- a/openapi_project/openapi_package/models/order_cross_market_condition.py +++ b/openapi_project/openapi_package/models/order_cross_market_condition.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="OrderCrossMarketCondition") - @_attrs_define class OrderCrossMarketCondition: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - order_cross_market_condition = cls( - ) - - + order_cross_market_condition = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/order_cross_optional_data.py b/openapi_project/openapi_package/models/order_cross_optional_data.py index f583fa115..6508ef6d5 100644 --- a/openapi_project/openapi_package/models/order_cross_optional_data.py +++ b/openapi_project/openapi_package/models/order_cross_optional_data.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="OrderCrossOptionalData") - @_attrs_define class OrderCrossOptionalData: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - order_cross_optional_data = cls( - ) - - + order_cross_optional_data = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/order_delete.py b/openapi_project/openapi_package/models/order_delete.py index 79e6dedba..ba3fc1aa1 100644 --- a/openapi_project/openapi_package/models/order_delete.py +++ b/openapi_project/openapi_package/models/order_delete.py @@ -39,13 +39,17 @@ class OrderDelete: def to_dict(self) -> dict[str, Any]: cur_ord_id = self.cur_ord_id - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() + optional_data: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.optional_data, Unset) + else self.optional_data.to_dict() + ) - origination_type: Unset | str = UNSET - if not isinstance(self.origination_type, Unset): - origination_type = self.origination_type.value + origination_type: Unset | str = ( + UNSET + if isinstance(self.origination_type, Unset) + else self.origination_type.value + ) perm_ord_id = self.perm_ord_id @@ -77,18 +81,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: cur_ord_id = d.pop("curOrdId", UNSET) _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | OrderDeleteOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = OrderDeleteOptionalData.from_dict(_optional_data) + optional_data: Unset | OrderDeleteOptionalData = ( + UNSET + if isinstance(_optional_data, Unset) + else OrderDeleteOptionalData.from_dict(_optional_data) + ) _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType - if isinstance(_origination_type, Unset): - origination_type = UNSET - else: - origination_type = OriginationType(_origination_type) + origination_type: Unset | OriginationType = ( + UNSET + if isinstance(_origination_type, Unset) + else OriginationType(_origination_type) + ) perm_ord_id = d.pop("permOrdId", UNSET) diff --git a/openapi_project/openapi_package/models/order_delete_optional_data.py b/openapi_project/openapi_package/models/order_delete_optional_data.py index 400004ae6..9f508b88f 100644 --- a/openapi_project/openapi_package/models/order_delete_optional_data.py +++ b/openapi_project/openapi_package/models/order_delete_optional_data.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="OrderDeleteOptionalData") - @_attrs_define class OrderDeleteOptionalData: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - order_delete_optional_data = cls( - ) - - + order_delete_optional_data = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/order_instruction.py b/openapi_project/openapi_package/models/order_instruction.py index f29115e45..ba9003d02 100644 --- a/openapi_project/openapi_package/models/order_instruction.py +++ b/openapi_project/openapi_package/models/order_instruction.py @@ -25,9 +25,9 @@ class OrderInstruction: value: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - type_: Unset | str = UNSET - if not isinstance(self.type_, Unset): - type_ = self.type_.value + type_: Unset | str = ( + UNSET if isinstance(self.type_, Unset) else self.type_.value + ) value = self.value @@ -45,11 +45,9 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _type_ = d.pop("type", UNSET) - type_: Unset | OrderInstructionType - if isinstance(_type_, Unset): - type_ = UNSET - else: - type_ = OrderInstructionType(_type_) + type_: Unset | OrderInstructionType = ( + UNSET if isinstance(_type_, Unset) else OrderInstructionType(_type_) + ) value = d.pop("value", UNSET) diff --git a/openapi_project/openapi_package/models/order_market_condition.py b/openapi_project/openapi_package/models/order_market_condition.py index 5e8731251..0d7bcb58d 100644 --- a/openapi_project/openapi_package/models/order_market_condition.py +++ b/openapi_project/openapi_package/models/order_market_condition.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="OrderMarketCondition") - @_attrs_define class OrderMarketCondition: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - order_market_condition = cls( - ) - - + order_market_condition = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/order_optional_data.py b/openapi_project/openapi_package/models/order_optional_data.py index aee3cef71..a10ac96a1 100644 --- a/openapi_project/openapi_package/models/order_optional_data.py +++ b/openapi_project/openapi_package/models/order_optional_data.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="OrderOptionalData") - @_attrs_define class OrderOptionalData: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - order_optional_data = cls( - ) - - + order_optional_data = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/order_update.py b/openapi_project/openapi_package/models/order_update.py index 67175a399..9fa33b3a6 100644 --- a/openapi_project/openapi_package/models/order_update.py +++ b/openapi_project/openapi_package/models/order_update.py @@ -19,11 +19,11 @@ from typing import cast if TYPE_CHECKING: - from ..models.order_update_algo import OrderUpdateAlgo - from ..models.security import Security + from ..models.clearing_info import ClearingInfo from ..models.header import Header from ..models.order_update_optional_data import OrderUpdateOptionalData - from ..models.clearing_info import ClearingInfo + from ..models.security import Security + from ..models.order_update_algo import OrderUpdateAlgo from ..models.order_instruction import OrderInstruction @@ -142,9 +142,9 @@ class OrderUpdate: def to_dict(self) -> dict[str, Any]: account_id = self.account_id - algo: Unset | dict[str, Any] = UNSET - if not isinstance(self.algo, Unset): - algo = self.algo.to_dict() + algo: Unset | dict[str, Any] = ( + UNSET if isinstance(self.algo, Unset) else self.algo.to_dict() + ) alloc_id = self.alloc_id @@ -152,9 +152,11 @@ def to_dict(self) -> dict[str, Any]: avg_price = self.avg_price - clearing_info: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_info, Unset): - clearing_info = self.clearing_info.to_dict() + clearing_info: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.clearing_info, Unset) + else self.clearing_info.to_dict() + ) commission = self.commission @@ -168,17 +170,17 @@ def to_dict(self) -> dict[str, Any]: exec_ref_id = self.exec_ref_id - exec_type: Unset | str = UNSET - if not isinstance(self.exec_type, Unset): - exec_type = self.exec_type.value + exec_type: Unset | str = ( + UNSET if isinstance(self.exec_type, Unset) else self.exec_type.value + ) fee1 = self.fee1 fee2 = self.fee2 - header: Unset | dict[str, Any] = UNSET - if not isinstance(self.header, Unset): - header = self.header.to_dict() + header: Unset | dict[str, Any] = ( + UNSET if isinstance(self.header, Unset) else self.header.to_dict() + ) incoming_cl_ord_id = self.incoming_cl_ord_id @@ -205,29 +207,35 @@ def to_dict(self) -> dict[str, Any]: liquidity_flag = self.liquidity_flag - multi_leg_reporting_type: Unset | str = UNSET - if not isinstance(self.multi_leg_reporting_type, Unset): - multi_leg_reporting_type = self.multi_leg_reporting_type.value + multi_leg_reporting_type: Unset | str = ( + UNSET + if isinstance(self.multi_leg_reporting_type, Unset) + else self.multi_leg_reporting_type.value + ) notes = self.notes - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() + optional_data: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.optional_data, Unset) + else self.optional_data.to_dict() + ) order_flags = self.order_flags - ord_status: Unset | str = UNSET - if not isinstance(self.ord_status, Unset): - ord_status = self.ord_status.value + ord_status: Unset | str = ( + UNSET if isinstance(self.ord_status, Unset) else self.ord_status.value + ) - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value + ord_type: Unset | str = ( + UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value + ) - origination_type: Unset | str = UNSET - if not isinstance(self.origination_type, Unset): - origination_type = self.origination_type.value + origination_type: Unset | str = ( + UNSET + if isinstance(self.origination_type, Unset) + else self.origination_type.value + ) orig_ord_id = self.orig_ord_id @@ -235,27 +243,27 @@ def to_dict(self) -> dict[str, Any]: perm_ord_id = self.perm_ord_id - position_effect: Unset | str = UNSET - if not isinstance(self.position_effect, Unset): - position_effect = self.position_effect.value + position_effect: Unset | str = ( + UNSET + if isinstance(self.position_effect, Unset) + else self.position_effect.value + ) price = self.price - price_type: Unset | str = UNSET - if not isinstance(self.price_type, Unset): - price_type = self.price_type.value + price_type: Unset | str = ( + UNSET if isinstance(self.price_type, Unset) else self.price_type.value + ) qty = self.qty route = self.route - security: Unset | dict[str, Any] = UNSET - if not isinstance(self.security, Unset): - security = self.security.to_dict() + security: Unset | dict[str, Any] = ( + UNSET if isinstance(self.security, Unset) else self.security.to_dict() + ) - side: Unset | str = UNSET - if not isinstance(self.side, Unset): - side = self.side.value + side: Unset | str = UNSET if isinstance(self.side, Unset) else self.side.value source = self.source @@ -265,9 +273,7 @@ def to_dict(self) -> dict[str, Any]: text = self.text - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value + tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value trader_id = self.trader_id @@ -389,11 +395,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: account_id = d.pop("accountId", UNSET) _algo = d.pop("Algo", UNSET) - algo: Unset | OrderUpdateAlgo - if isinstance(_algo, Unset): - algo = UNSET - else: - algo = OrderUpdateAlgo.from_dict(_algo) + algo: Unset | OrderUpdateAlgo = ( + UNSET if isinstance(_algo, Unset) else OrderUpdateAlgo.from_dict(_algo) + ) alloc_id = d.pop("allocId", UNSET) @@ -402,11 +406,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: avg_price = d.pop("avgPrice", UNSET) _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo - if isinstance(_clearing_info, Unset): - clearing_info = UNSET - else: - clearing_info = ClearingInfo.from_dict(_clearing_info) + clearing_info: Unset | ClearingInfo = ( + UNSET + if isinstance(_clearing_info, Unset) + else ClearingInfo.from_dict(_clearing_info) + ) commission = d.pop("commission", UNSET) @@ -421,22 +425,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: exec_ref_id = d.pop("execRefId", UNSET) _exec_type = d.pop("execType", UNSET) - exec_type: Unset | ExecType - if isinstance(_exec_type, Unset): - exec_type = UNSET - else: - exec_type = ExecType(_exec_type) + exec_type: Unset | ExecType = ( + UNSET if isinstance(_exec_type, Unset) else ExecType(_exec_type) + ) fee1 = d.pop("fee1", UNSET) fee2 = d.pop("fee2", UNSET) _header = d.pop("header", UNSET) - header: Unset | Header - if isinstance(_header, Unset): - header = UNSET - else: - header = Header.from_dict(_header) + header: Unset | Header = ( + UNSET if isinstance(_header, Unset) else Header.from_dict(_header) + ) incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) @@ -464,43 +464,39 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: liquidity_flag = d.pop("liquidityFlag", UNSET) _multi_leg_reporting_type = d.pop("multiLegReportingType", UNSET) - multi_leg_reporting_type: Unset | MultiLegReportingType - if isinstance(_multi_leg_reporting_type, Unset): - multi_leg_reporting_type = UNSET - else: - multi_leg_reporting_type = MultiLegReportingType(_multi_leg_reporting_type) + multi_leg_reporting_type: Unset | MultiLegReportingType = ( + UNSET + if isinstance(_multi_leg_reporting_type, Unset) + else MultiLegReportingType(_multi_leg_reporting_type) + ) notes = d.pop("Notes", UNSET) _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | OrderUpdateOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = OrderUpdateOptionalData.from_dict(_optional_data) + optional_data: Unset | OrderUpdateOptionalData = ( + UNSET + if isinstance(_optional_data, Unset) + else OrderUpdateOptionalData.from_dict(_optional_data) + ) order_flags = d.pop("orderFlags", UNSET) _ord_status = d.pop("ordStatus", UNSET) - ord_status: Unset | OrdStatus - if isinstance(_ord_status, Unset): - ord_status = UNSET - else: - ord_status = OrdStatus(_ord_status) + ord_status: Unset | OrdStatus = ( + UNSET if isinstance(_ord_status, Unset) else OrdStatus(_ord_status) + ) _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) + ord_type: Unset | OrdType = ( + UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) + ) _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType - if isinstance(_origination_type, Unset): - origination_type = UNSET - else: - origination_type = OriginationType(_origination_type) + origination_type: Unset | OriginationType = ( + UNSET + if isinstance(_origination_type, Unset) + else OriginationType(_origination_type) + ) orig_ord_id = d.pop("origOrdId", UNSET) @@ -509,38 +505,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: perm_ord_id = d.pop("permOrdId", UNSET) _position_effect = d.pop("positionEffect", UNSET) - position_effect: Unset | PositionEffect - if isinstance(_position_effect, Unset): - position_effect = UNSET - else: - position_effect = PositionEffect(_position_effect) + position_effect: Unset | PositionEffect = ( + UNSET + if isinstance(_position_effect, Unset) + else PositionEffect(_position_effect) + ) price = d.pop("price", UNSET) _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType - if isinstance(_price_type, Unset): - price_type = UNSET - else: - price_type = PriceType(_price_type) + price_type: Unset | PriceType = ( + UNSET if isinstance(_price_type, Unset) else PriceType(_price_type) + ) qty = d.pop("qty", UNSET) route = d.pop("route", UNSET) _security = d.pop("security", UNSET) - security: Unset | Security - if isinstance(_security, Unset): - security = UNSET - else: - security = Security.from_dict(_security) + security: Unset | Security = ( + UNSET if isinstance(_security, Unset) else Security.from_dict(_security) + ) _side = d.pop("side", UNSET) - side: Unset | Side - if isinstance(_side, Unset): - side = UNSET - else: - side = Side(_side) + side: Unset | Side = UNSET if isinstance(_side, Unset) else Side(_side) source = d.pop("source", UNSET) @@ -551,11 +539,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: text = d.pop("text", UNSET) _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) + tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) trader_id = d.pop("traderId", UNSET) diff --git a/openapi_project/openapi_package/models/order_update_algo.py b/openapi_project/openapi_package/models/order_update_algo.py index eb02c03ab..c24c4055c 100644 --- a/openapi_project/openapi_package/models/order_update_algo.py +++ b/openapi_project/openapi_package/models/order_update_algo.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="OrderUpdateAlgo") - @_attrs_define class OrderUpdateAlgo: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - order_update_algo = cls( - ) - - + order_update_algo = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/order_update_event.py b/openapi_project/openapi_package/models/order_update_event.py index 347310905..353f1455b 100644 --- a/openapi_project/openapi_package/models/order_update_event.py +++ b/openapi_project/openapi_package/models/order_update_event.py @@ -10,15 +10,15 @@ from typing import cast if TYPE_CHECKING: + from ..models.order_update import OrderUpdate from ..models.multi_leg_order_cancel_replace_request import ( MultiLegOrderCancelReplaceRequest, ) - from ..models.order_cancel_replace_request import OrderCancelReplaceRequest - from ..models.order_cancel_reject import OrderCancelReject - from ..models.order_update import OrderUpdate + from ..models.order_delete import OrderDelete from ..models.order_cancel_request import OrderCancelRequest + from ..models.order_cancel_reject import OrderCancelReject from ..models.execution import Execution - from ..models.order_delete import OrderDelete + from ..models.order_cancel_replace_request import OrderCancelReplaceRequest T = TypeVar("T", bound="OrderUpdateEvent") @@ -48,35 +48,45 @@ class OrderUpdateEvent: order_cancel_reject: Unset | "OrderCancelReject" = UNSET def to_dict(self) -> dict[str, Any]: - order_cancel_request: Unset | dict[str, Any] = UNSET - if not isinstance(self.order_cancel_request, Unset): - order_cancel_request = self.order_cancel_request.to_dict() - - order_cancel_replace_request: Unset | dict[str, Any] = UNSET - if not isinstance(self.order_cancel_replace_request, Unset): - order_cancel_replace_request = self.order_cancel_replace_request.to_dict() - - multi_leg_order_cancel_replace_request: Unset | dict[str, Any] = UNSET - if not isinstance(self.multi_leg_order_cancel_replace_request, Unset): - multi_leg_order_cancel_replace_request = ( - self.multi_leg_order_cancel_replace_request.to_dict() - ) + order_cancel_request: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.order_cancel_request, Unset) + else self.order_cancel_request.to_dict() + ) - execution: Unset | dict[str, Any] = UNSET - if not isinstance(self.execution, Unset): - execution = self.execution.to_dict() + order_cancel_replace_request: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.order_cancel_replace_request, Unset) + else self.order_cancel_replace_request.to_dict() + ) - order_update: Unset | dict[str, Any] = UNSET - if not isinstance(self.order_update, Unset): - order_update = self.order_update.to_dict() + multi_leg_order_cancel_replace_request: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.multi_leg_order_cancel_replace_request, Unset) + else self.multi_leg_order_cancel_replace_request.to_dict() + ) - order_delete: Unset | dict[str, Any] = UNSET - if not isinstance(self.order_delete, Unset): - order_delete = self.order_delete.to_dict() + execution: Unset | dict[str, Any] = ( + UNSET if isinstance(self.execution, Unset) else self.execution.to_dict() + ) - order_cancel_reject: Unset | dict[str, Any] = UNSET - if not isinstance(self.order_cancel_reject, Unset): - order_cancel_reject = self.order_cancel_reject.to_dict() + order_update: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.order_update, Unset) + else self.order_update.to_dict() + ) + + order_delete: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.order_delete, Unset) + else self.order_delete.to_dict() + ) + + order_cancel_reject: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.order_cancel_reject, Unset) + else self.order_cancel_reject.to_dict() + ) field_dict: dict[str, Any] = {} @@ -104,63 +114,57 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _order_cancel_request = d.pop("orderCancelRequest", UNSET) - order_cancel_request: Unset | OrderCancelRequest - if isinstance(_order_cancel_request, Unset): - order_cancel_request = UNSET - else: - order_cancel_request = OrderCancelRequest.from_dict(_order_cancel_request) + order_cancel_request: Unset | OrderCancelRequest = ( + UNSET + if isinstance(_order_cancel_request, Unset) + else OrderCancelRequest.from_dict(_order_cancel_request) + ) _order_cancel_replace_request = d.pop("orderCancelReplaceRequest", UNSET) - order_cancel_replace_request: Unset | OrderCancelReplaceRequest - if isinstance(_order_cancel_replace_request, Unset): - order_cancel_replace_request = UNSET - else: - order_cancel_replace_request = OrderCancelReplaceRequest.from_dict( - _order_cancel_replace_request - ) + order_cancel_replace_request: Unset | OrderCancelReplaceRequest = ( + UNSET + if isinstance(_order_cancel_replace_request, Unset) + else OrderCancelReplaceRequest.from_dict(_order_cancel_replace_request) + ) _multi_leg_order_cancel_replace_request = d.pop( "multiLegOrderCancelReplaceRequest", UNSET ) multi_leg_order_cancel_replace_request: ( Unset | MultiLegOrderCancelReplaceRequest - ) - if isinstance(_multi_leg_order_cancel_replace_request, Unset): - multi_leg_order_cancel_replace_request = UNSET - else: - multi_leg_order_cancel_replace_request = ( - MultiLegOrderCancelReplaceRequest.from_dict( - _multi_leg_order_cancel_replace_request - ) + ) = ( + UNSET + if isinstance(_multi_leg_order_cancel_replace_request, Unset) + else MultiLegOrderCancelReplaceRequest.from_dict( + _multi_leg_order_cancel_replace_request ) + ) _execution = d.pop("execution", UNSET) - execution: Unset | Execution - if isinstance(_execution, Unset): - execution = UNSET - else: - execution = Execution.from_dict(_execution) + execution: Unset | Execution = ( + UNSET if isinstance(_execution, Unset) else Execution.from_dict(_execution) + ) _order_update = d.pop("orderUpdate", UNSET) - order_update: Unset | OrderUpdate - if isinstance(_order_update, Unset): - order_update = UNSET - else: - order_update = OrderUpdate.from_dict(_order_update) + order_update: Unset | OrderUpdate = ( + UNSET + if isinstance(_order_update, Unset) + else OrderUpdate.from_dict(_order_update) + ) _order_delete = d.pop("orderDelete", UNSET) - order_delete: Unset | OrderDelete - if isinstance(_order_delete, Unset): - order_delete = UNSET - else: - order_delete = OrderDelete.from_dict(_order_delete) + order_delete: Unset | OrderDelete = ( + UNSET + if isinstance(_order_delete, Unset) + else OrderDelete.from_dict(_order_delete) + ) _order_cancel_reject = d.pop("orderCancelReject", UNSET) - order_cancel_reject: Unset | OrderCancelReject - if isinstance(_order_cancel_reject, Unset): - order_cancel_reject = UNSET - else: - order_cancel_reject = OrderCancelReject.from_dict(_order_cancel_reject) + order_cancel_reject: Unset | OrderCancelReject = ( + UNSET + if isinstance(_order_cancel_reject, Unset) + else OrderCancelReject.from_dict(_order_cancel_reject) + ) order_update_event = cls( order_cancel_request=order_cancel_request, diff --git a/openapi_project/openapi_package/models/order_update_optional_data.py b/openapi_project/openapi_package/models/order_update_optional_data.py index 6de822e5e..46ae93506 100644 --- a/openapi_project/openapi_package/models/order_update_optional_data.py +++ b/openapi_project/openapi_package/models/order_update_optional_data.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="OrderUpdateOptionalData") - @_attrs_define class OrderUpdateOptionalData: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - order_update_optional_data = cls( - ) - - + order_update_optional_data = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/position_analysis.py b/openapi_project/openapi_package/models/position_analysis.py index 45038504d..f8d4f05d8 100644 --- a/openapi_project/openapi_package/models/position_analysis.py +++ b/openapi_project/openapi_package/models/position_analysis.py @@ -10,8 +10,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.scenario_theo import ScenarioTheo from ..models.position_theo import PositionTheo + from ..models.scenario_theo import ScenarioTheo T = TypeVar("T", bound="PositionAnalysis") @@ -29,9 +29,11 @@ class PositionAnalysis: scenario_theos: Unset | list["ScenarioTheo"] = UNSET def to_dict(self) -> dict[str, Any]: - position_theo: Unset | dict[str, Any] = UNSET - if not isinstance(self.position_theo, Unset): - position_theo = self.position_theo.to_dict() + position_theo: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.position_theo, Unset) + else self.position_theo.to_dict() + ) scenario_theos: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.scenario_theos, Unset): @@ -54,11 +56,11 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _position_theo = d.pop("positionTheo", UNSET) - position_theo: Unset | PositionTheo - if isinstance(_position_theo, Unset): - position_theo = UNSET - else: - position_theo = PositionTheo.from_dict(_position_theo) + position_theo: Unset | PositionTheo = ( + UNSET + if isinstance(_position_theo, Unset) + else PositionTheo.from_dict(_position_theo) + ) scenario_theos = [] _scenario_theos = d.pop("scenarioTheos", UNSET) diff --git a/openapi_project/openapi_package/models/risk_radar_account_group.py b/openapi_project/openapi_package/models/risk_radar_account_group.py index a794fb36a..bc3b115ee 100644 --- a/openapi_project/openapi_package/models/risk_radar_account_group.py +++ b/openapi_project/openapi_package/models/risk_radar_account_group.py @@ -38,9 +38,9 @@ class RiskRadarAccountGroup: def to_dict(self) -> dict[str, Any]: account_id = self.account_id - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value + currency: Unset | str = ( + UNSET if isinstance(self.currency, Unset) else self.currency.value + ) nav = self.nav @@ -80,11 +80,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: account_id = d.pop("accountId", UNSET) _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) + currency: Unset | Currency = ( + UNSET if isinstance(_currency, Unset) else Currency(_currency) + ) nav = d.pop("nav", UNSET) diff --git a/openapi_project/openapi_package/models/risk_radar_request.py b/openapi_project/openapi_package/models/risk_radar_request.py index e441751be..0d65cce66 100644 --- a/openapi_project/openapi_package/models/risk_radar_request.py +++ b/openapi_project/openapi_package/models/risk_radar_request.py @@ -64,31 +64,37 @@ def to_dict(self) -> dict[str, Any]: ) positions_by_account_id.append(positions_by_account_id_item) - source: Unset | str = UNSET - if not isinstance(self.source, Unset): - source = self.source.value + source: Unset | str = ( + UNSET if isinstance(self.source, Unset) else self.source.value + ) range_ = self.range_ timestep = self.timestep - scenario_order: Unset | str = UNSET - if not isinstance(self.scenario_order, Unset): - scenario_order = self.scenario_order.value + scenario_order: Unset | str = ( + UNSET + if isinstance(self.scenario_order, Unset) + else self.scenario_order.value + ) - eval_mode: Unset | str = UNSET - if not isinstance(self.eval_mode, Unset): - eval_mode = self.eval_mode.value + eval_mode: Unset | str = ( + UNSET if isinstance(self.eval_mode, Unset) else self.eval_mode.value + ) implied_volatility = self.implied_volatility - volatility_shock_skew: Unset | str = UNSET - if not isinstance(self.volatility_shock_skew, Unset): - volatility_shock_skew = self.volatility_shock_skew.value + volatility_shock_skew: Unset | str = ( + UNSET + if isinstance(self.volatility_shock_skew, Unset) + else self.volatility_shock_skew.value + ) - volatility_shock_type: Unset | str = UNSET - if not isinstance(self.volatility_shock_type, Unset): - volatility_shock_type = self.volatility_shock_type.value + volatility_shock_type: Unset | str = ( + UNSET + if isinstance(self.volatility_shock_type, Unset) + else self.volatility_shock_type.value + ) exclude_expired_contracts = self.exclude_expired_contracts @@ -135,45 +141,41 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: positions_by_account_id.append(positions_by_account_id_item) _source = d.pop("source", UNSET) - source: Unset | PositionSource - if isinstance(_source, Unset): - source = UNSET - else: - source = PositionSource(_source) + source: Unset | PositionSource = ( + UNSET if isinstance(_source, Unset) else PositionSource(_source) + ) range_ = d.pop("range", UNSET) timestep = d.pop("timestep", UNSET) _scenario_order = d.pop("scenarioOrder", UNSET) - scenario_order: Unset | RiskRadarScenarioOrder - if isinstance(_scenario_order, Unset): - scenario_order = UNSET - else: - scenario_order = RiskRadarScenarioOrder(_scenario_order) + scenario_order: Unset | RiskRadarScenarioOrder = ( + UNSET + if isinstance(_scenario_order, Unset) + else RiskRadarScenarioOrder(_scenario_order) + ) _eval_mode = d.pop("evalMode", UNSET) - eval_mode: Unset | RiskEvalMode - if isinstance(_eval_mode, Unset): - eval_mode = UNSET - else: - eval_mode = RiskEvalMode(_eval_mode) + eval_mode: Unset | RiskEvalMode = ( + UNSET if isinstance(_eval_mode, Unset) else RiskEvalMode(_eval_mode) + ) implied_volatility = d.pop("impliedVolatility", UNSET) _volatility_shock_skew = d.pop("volatilityShockSkew", UNSET) - volatility_shock_skew: Unset | VolatilityShockSkew - if isinstance(_volatility_shock_skew, Unset): - volatility_shock_skew = UNSET - else: - volatility_shock_skew = VolatilityShockSkew(_volatility_shock_skew) + volatility_shock_skew: Unset | VolatilityShockSkew = ( + UNSET + if isinstance(_volatility_shock_skew, Unset) + else VolatilityShockSkew(_volatility_shock_skew) + ) _volatility_shock_type = d.pop("volatilityShockType", UNSET) - volatility_shock_type: Unset | VolatilityShockType - if isinstance(_volatility_shock_type, Unset): - volatility_shock_type = UNSET - else: - volatility_shock_type = VolatilityShockType(_volatility_shock_type) + volatility_shock_type: Unset | VolatilityShockType = ( + UNSET + if isinstance(_volatility_shock_type, Unset) + else VolatilityShockType(_volatility_shock_type) + ) exclude_expired_contracts = d.pop("excludeExpiredContracts", UNSET) diff --git a/openapi_project/openapi_package/models/risk_radar_response.py b/openapi_project/openapi_package/models/risk_radar_response.py index e3f7e8629..e24c05e20 100644 --- a/openapi_project/openapi_package/models/risk_radar_response.py +++ b/openapi_project/openapi_package/models/risk_radar_response.py @@ -31,15 +31,15 @@ class RiskRadarResponse: status_code: Unset | StatusCode = UNSET def to_dict(self) -> dict[str, Any]: - result: Unset | dict[str, Any] = UNSET - if not isinstance(self.result, Unset): - result = self.result.to_dict() + result: Unset | dict[str, Any] = ( + UNSET if isinstance(self.result, Unset) else self.result.to_dict() + ) error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -57,20 +57,16 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _result = d.pop("result", UNSET) - result: Unset | RiskRadarData - if isinstance(_result, Unset): - result = UNSET - else: - result = RiskRadarData.from_dict(_result) + result: Unset | RiskRadarData = ( + UNSET if isinstance(_result, Unset) else RiskRadarData.from_dict(_result) + ) error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) risk_radar_response = cls( result=result, diff --git a/openapi_project/openapi_package/models/risk_reject.py b/openapi_project/openapi_package/models/risk_reject.py index 23feb71b8..346a887e9 100644 --- a/openapi_project/openapi_package/models/risk_reject.py +++ b/openapi_project/openapi_package/models/risk_reject.py @@ -56,13 +56,15 @@ def to_dict(self) -> dict[str, Any]: transact_ts = self.transact_ts - calculation_type: Unset | str = UNSET - if not isinstance(self.calculation_type, Unset): - calculation_type = self.calculation_type.value + calculation_type: Unset | str = ( + UNSET + if isinstance(self.calculation_type, Unset) + else self.calculation_type.value + ) - reject_type: Unset | str = UNSET - if not isinstance(self.reject_type, Unset): - reject_type = self.reject_type.value + reject_type: Unset | str = ( + UNSET if isinstance(self.reject_type, Unset) else self.reject_type.value + ) user_id = self.user_id @@ -110,18 +112,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: transact_ts = d.pop("transactTs", UNSET) _calculation_type = d.pop("calculationType", UNSET) - calculation_type: Unset | RiskCalculationType - if isinstance(_calculation_type, Unset): - calculation_type = UNSET - else: - calculation_type = RiskCalculationType(_calculation_type) + calculation_type: Unset | RiskCalculationType = ( + UNSET + if isinstance(_calculation_type, Unset) + else RiskCalculationType(_calculation_type) + ) _reject_type = d.pop("rejectType", UNSET) - reject_type: Unset | RiskRejectType - if isinstance(_reject_type, Unset): - reject_type = UNSET - else: - reject_type = RiskRejectType(_reject_type) + reject_type: Unset | RiskRejectType = ( + UNSET if isinstance(_reject_type, Unset) else RiskRejectType(_reject_type) + ) user_id = d.pop("userId", UNSET) diff --git a/openapi_project/openapi_package/models/route.py b/openapi_project/openapi_package/models/route.py index ebb6735f6..3939fd63d 100644 --- a/openapi_project/openapi_package/models/route.py +++ b/openapi_project/openapi_package/models/route.py @@ -54,17 +54,17 @@ def to_dict(self) -> dict[str, Any]: algo_schema = self.algo_schema - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value + currency: Unset | str = ( + UNSET if isinstance(self.currency, Unset) else self.currency.value + ) is_enabled = self.is_enabled name = self.name - order_type: Unset | str = UNSET - if not isinstance(self.order_type, Unset): - order_type = self.order_type.value + order_type: Unset | str = ( + UNSET if isinstance(self.order_type, Unset) else self.order_type.value + ) route_properties: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.route_properties, Unset): @@ -73,13 +73,13 @@ def to_dict(self) -> dict[str, Any]: route_properties_item = route_properties_item_data.to_dict() route_properties.append(route_properties_item) - security_type: Unset | str = UNSET - if not isinstance(self.security_type, Unset): - security_type = self.security_type.value + security_type: Unset | str = ( + UNSET if isinstance(self.security_type, Unset) else self.security_type.value + ) - type_: Unset | str = UNSET - if not isinstance(self.type_, Unset): - type_ = self.type_.value + type_: Unset | str = ( + UNSET if isinstance(self.type_, Unset) else self.type_.value + ) ui_schema = self.ui_schema @@ -121,22 +121,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: algo_schema = d.pop("algoSchema", UNSET) _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) + currency: Unset | Currency = ( + UNSET if isinstance(_currency, Unset) else Currency(_currency) + ) is_enabled = d.pop("isEnabled", UNSET) name = d.pop("name", UNSET) _order_type = d.pop("orderType", UNSET) - order_type: Unset | OrderType - if isinstance(_order_type, Unset): - order_type = UNSET - else: - order_type = OrderType(_order_type) + order_type: Unset | OrderType = ( + UNSET if isinstance(_order_type, Unset) else OrderType(_order_type) + ) route_properties = [] _route_properties = d.pop("routeProperties", UNSET) @@ -146,18 +142,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: route_properties.append(route_properties_item) _security_type = d.pop("securityType", UNSET) - security_type: Unset | SecurityType - if isinstance(_security_type, Unset): - security_type = UNSET - else: - security_type = SecurityType(_security_type) + security_type: Unset | SecurityType = ( + UNSET if isinstance(_security_type, Unset) else SecurityType(_security_type) + ) _type_ = d.pop("type", UNSET) - type_: Unset | RouteType - if isinstance(_type_, Unset): - type_ = UNSET - else: - type_ = RouteType(_type_) + type_: Unset | RouteType = ( + UNSET if isinstance(_type_, Unset) else RouteType(_type_) + ) ui_schema = d.pop("uiSchema", UNSET) diff --git a/openapi_project/openapi_package/models/route_applicability.py b/openapi_project/openapi_package/models/route_applicability.py index 6d5493001..d7335559c 100644 --- a/openapi_project/openapi_package/models/route_applicability.py +++ b/openapi_project/openapi_package/models/route_applicability.py @@ -42,19 +42,19 @@ def to_dict(self) -> dict[str, Any]: account_id = self.account_id - security_type: Unset | str = UNSET - if not isinstance(self.security_type, Unset): - security_type = self.security_type.value + security_type: Unset | str = ( + UNSET if isinstance(self.security_type, Unset) else self.security_type.value + ) - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value + currency: Unset | str = ( + UNSET if isinstance(self.currency, Unset) else self.currency.value + ) exchange_id = self.exchange_id - order_type: Unset | str = UNSET - if not isinstance(self.order_type, Unset): - order_type = self.order_type.value + order_type: Unset | str = ( + UNSET if isinstance(self.order_type, Unset) else self.order_type.value + ) route_ids: Unset | list[int] = UNSET if not isinstance(self.route_ids, Unset): @@ -88,27 +88,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: account_id = d.pop("accountId", UNSET) _security_type = d.pop("securityType", UNSET) - security_type: Unset | SecurityType - if isinstance(_security_type, Unset): - security_type = UNSET - else: - security_type = SecurityType(_security_type) + security_type: Unset | SecurityType = ( + UNSET if isinstance(_security_type, Unset) else SecurityType(_security_type) + ) _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) + currency: Unset | Currency = ( + UNSET if isinstance(_currency, Unset) else Currency(_currency) + ) exchange_id = d.pop("exchangeId", UNSET) _order_type = d.pop("orderType", UNSET) - order_type: Unset | OrderType - if isinstance(_order_type, Unset): - order_type = UNSET - else: - order_type = OrderType(_order_type) + order_type: Unset | OrderType = ( + UNSET if isinstance(_order_type, Unset) else OrderType(_order_type) + ) route_ids = cast(list[int], d.pop("routeIds", UNSET)) diff --git a/openapi_project/openapi_package/models/route_property.py b/openapi_project/openapi_package/models/route_property.py index 701143133..ef0a474ab 100644 --- a/openapi_project/openapi_package/models/route_property.py +++ b/openapi_project/openapi_package/models/route_property.py @@ -29,9 +29,9 @@ class RouteProperty: def to_dict(self) -> dict[str, Any]: id = self.id - type_: Unset | str = UNSET - if not isinstance(self.type_, Unset): - type_ = self.type_.value + type_: Unset | str = ( + UNSET if isinstance(self.type_, Unset) else self.type_.value + ) value = self.value @@ -53,11 +53,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Unset | RoutePropertyType - if isinstance(_type_, Unset): - type_ = UNSET - else: - type_ = RoutePropertyType(_type_) + type_: Unset | RoutePropertyType = ( + UNSET if isinstance(_type_, Unset) else RoutePropertyType(_type_) + ) value = d.pop("value", UNSET) diff --git a/openapi_project/openapi_package/models/routing_session_group.py b/openapi_project/openapi_package/models/routing_session_group.py index 230e88d02..0df2e8376 100644 --- a/openapi_project/openapi_package/models/routing_session_group.py +++ b/openapi_project/openapi_package/models/routing_session_group.py @@ -31,9 +31,9 @@ def to_dict(self) -> dict[str, Any]: name = self.name - type_: Unset | str = UNSET - if not isinstance(self.type_, Unset): - type_ = self.type_.value + type_: Unset | str = ( + UNSET if isinstance(self.type_, Unset) else self.type_.value + ) field_dict: dict[str, Any] = {} @@ -55,11 +55,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) _type_ = d.pop("type", UNSET) - type_: Unset | RoutingSessionGroupType - if isinstance(_type_, Unset): - type_ = UNSET - else: - type_ = RoutingSessionGroupType(_type_) + type_: Unset | RoutingSessionGroupType = ( + UNSET if isinstance(_type_, Unset) else RoutingSessionGroupType(_type_) + ) routing_session_group = cls( id=id, diff --git a/openapi_project/openapi_package/models/scenario.py b/openapi_project/openapi_package/models/scenario.py index 115ef1dde..1dc034372 100644 --- a/openapi_project/openapi_package/models/scenario.py +++ b/openapi_project/openapi_package/models/scenario.py @@ -10,8 +10,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.scenario_leg import ScenarioLeg from ..models.scenario_position import ScenarioPosition + from ..models.scenario_leg import ScenarioLeg T = TypeVar("T", bound="Scenario") @@ -40,9 +40,9 @@ def to_dict(self) -> dict[str, Any]: legs_item = legs_item_data.to_dict() legs.append(legs_item) - position: Unset | dict[str, Any] = UNSET - if not isinstance(self.position, Unset): - position = self.position.to_dict() + position: Unset | dict[str, Any] = ( + UNSET if isinstance(self.position, Unset) else self.position.to_dict() + ) field_dict: dict[str, Any] = {} @@ -69,11 +69,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: legs.append(legs_item) _position = d.pop("position", UNSET) - position: Unset | ScenarioPosition - if isinstance(_position, Unset): - position = UNSET - else: - position = ScenarioPosition.from_dict(_position) + position: Unset | ScenarioPosition = ( + UNSET + if isinstance(_position, Unset) + else ScenarioPosition.from_dict(_position) + ) scenario = cls( price=price, diff --git a/openapi_project/openapi_package/models/search_order_history_response.py b/openapi_project/openapi_package/models/search_order_history_response.py index 7aebe6e45..81d042dc6 100644 --- a/openapi_project/openapi_package/models/search_order_history_response.py +++ b/openapi_project/openapi_package/models/search_order_history_response.py @@ -40,9 +40,9 @@ def to_dict(self) -> dict[str, Any]: error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -69,11 +69,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) search_order_history_response = cls( orders=orders, diff --git a/openapi_project/openapi_package/models/security.py b/openapi_project/openapi_package/models/security.py index 6f0e2ad69..caf58e588 100644 --- a/openapi_project/openapi_package/models/security.py +++ b/openapi_project/openapi_package/models/security.py @@ -10,16 +10,16 @@ from typing import cast if TYPE_CHECKING: - from ..models.stock import Stock - from ..models.future_root import FutureRoot - from ..models.option import Option - from ..models.future_spread import FutureSpread - from ..models.future import Future - from ..models.index import Index from ..models.fx import Fx + from ..models.future_spread import FutureSpread from ..models.flex_option import FlexOption + from ..models.stock import Stock from ..models.option_root import OptionRoot from ..models.crypto import Crypto + from ..models.future import Future + from ..models.index import Index + from ..models.future_root import FutureRoot + from ..models.option import Option T = TypeVar("T", bound="Security") @@ -53,45 +53,47 @@ class Security: flex_option: Unset | "FlexOption" = UNSET def to_dict(self) -> dict[str, Any]: - stock: Unset | dict[str, Any] = UNSET - if not isinstance(self.stock, Unset): - stock = self.stock.to_dict() + stock: Unset | dict[str, Any] = ( + UNSET if isinstance(self.stock, Unset) else self.stock.to_dict() + ) - option: Unset | dict[str, Any] = UNSET - if not isinstance(self.option, Unset): - option = self.option.to_dict() + option: Unset | dict[str, Any] = ( + UNSET if isinstance(self.option, Unset) else self.option.to_dict() + ) - option_root: Unset | dict[str, Any] = UNSET - if not isinstance(self.option_root, Unset): - option_root = self.option_root.to_dict() + option_root: Unset | dict[str, Any] = ( + UNSET if isinstance(self.option_root, Unset) else self.option_root.to_dict() + ) - future: Unset | dict[str, Any] = UNSET - if not isinstance(self.future, Unset): - future = self.future.to_dict() + future: Unset | dict[str, Any] = ( + UNSET if isinstance(self.future, Unset) else self.future.to_dict() + ) - future_root: Unset | dict[str, Any] = UNSET - if not isinstance(self.future_root, Unset): - future_root = self.future_root.to_dict() + future_root: Unset | dict[str, Any] = ( + UNSET if isinstance(self.future_root, Unset) else self.future_root.to_dict() + ) - index: Unset | dict[str, Any] = UNSET - if not isinstance(self.index, Unset): - index = self.index.to_dict() + index: Unset | dict[str, Any] = ( + UNSET if isinstance(self.index, Unset) else self.index.to_dict() + ) - future_spread: Unset | dict[str, Any] = UNSET - if not isinstance(self.future_spread, Unset): - future_spread = self.future_spread.to_dict() + future_spread: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.future_spread, Unset) + else self.future_spread.to_dict() + ) - fx: Unset | dict[str, Any] = UNSET - if not isinstance(self.fx, Unset): - fx = self.fx.to_dict() + fx: Unset | dict[str, Any] = ( + UNSET if isinstance(self.fx, Unset) else self.fx.to_dict() + ) - crypto: Unset | dict[str, Any] = UNSET - if not isinstance(self.crypto, Unset): - crypto = self.crypto.to_dict() + crypto: Unset | dict[str, Any] = ( + UNSET if isinstance(self.crypto, Unset) else self.crypto.to_dict() + ) - flex_option: Unset | dict[str, Any] = UNSET - if not isinstance(self.flex_option, Unset): - flex_option = self.flex_option.to_dict() + flex_option: Unset | dict[str, Any] = ( + UNSET if isinstance(self.flex_option, Unset) else self.flex_option.to_dict() + ) field_dict: dict[str, Any] = {} @@ -123,74 +125,60 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _stock = d.pop("stock", UNSET) - stock: Unset | Stock - if isinstance(_stock, Unset): - stock = UNSET - else: - stock = Stock.from_dict(_stock) + stock: Unset | Stock = ( + UNSET if isinstance(_stock, Unset) else Stock.from_dict(_stock) + ) _option = d.pop("option", UNSET) - option: Unset | Option - if isinstance(_option, Unset): - option = UNSET - else: - option = Option.from_dict(_option) + option: Unset | Option = ( + UNSET if isinstance(_option, Unset) else Option.from_dict(_option) + ) _option_root = d.pop("optionRoot", UNSET) - option_root: Unset | OptionRoot - if isinstance(_option_root, Unset): - option_root = UNSET - else: - option_root = OptionRoot.from_dict(_option_root) + option_root: Unset | OptionRoot = ( + UNSET + if isinstance(_option_root, Unset) + else OptionRoot.from_dict(_option_root) + ) _future = d.pop("future", UNSET) - future: Unset | Future - if isinstance(_future, Unset): - future = UNSET - else: - future = Future.from_dict(_future) + future: Unset | Future = ( + UNSET if isinstance(_future, Unset) else Future.from_dict(_future) + ) _future_root = d.pop("futureRoot", UNSET) - future_root: Unset | FutureRoot - if isinstance(_future_root, Unset): - future_root = UNSET - else: - future_root = FutureRoot.from_dict(_future_root) + future_root: Unset | FutureRoot = ( + UNSET + if isinstance(_future_root, Unset) + else FutureRoot.from_dict(_future_root) + ) _index = d.pop("index", UNSET) - index: Unset | Index - if isinstance(_index, Unset): - index = UNSET - else: - index = Index.from_dict(_index) + index: Unset | Index = ( + UNSET if isinstance(_index, Unset) else Index.from_dict(_index) + ) _future_spread = d.pop("futureSpread", UNSET) - future_spread: Unset | FutureSpread - if isinstance(_future_spread, Unset): - future_spread = UNSET - else: - future_spread = FutureSpread.from_dict(_future_spread) + future_spread: Unset | FutureSpread = ( + UNSET + if isinstance(_future_spread, Unset) + else FutureSpread.from_dict(_future_spread) + ) _fx = d.pop("fx", UNSET) - fx: Unset | Fx - if isinstance(_fx, Unset): - fx = UNSET - else: - fx = Fx.from_dict(_fx) + fx: Unset | Fx = UNSET if isinstance(_fx, Unset) else Fx.from_dict(_fx) _crypto = d.pop("crypto", UNSET) - crypto: Unset | Crypto - if isinstance(_crypto, Unset): - crypto = UNSET - else: - crypto = Crypto.from_dict(_crypto) + crypto: Unset | Crypto = ( + UNSET if isinstance(_crypto, Unset) else Crypto.from_dict(_crypto) + ) _flex_option = d.pop("flexOption", UNSET) - flex_option: Unset | FlexOption - if isinstance(_flex_option, Unset): - flex_option = UNSET - else: - flex_option = FlexOption.from_dict(_flex_option) + flex_option: Unset | FlexOption = ( + UNSET + if isinstance(_flex_option, Unset) + else FlexOption.from_dict(_flex_option) + ) security = cls( stock=stock, diff --git a/openapi_project/openapi_package/models/settlement_info.py b/openapi_project/openapi_package/models/settlement_info.py index 668565580..9da35f41b 100644 --- a/openapi_project/openapi_package/models/settlement_info.py +++ b/openapi_project/openapi_package/models/settlement_info.py @@ -31,9 +31,11 @@ def to_dict(self) -> dict[str, Any]: symbol = self.symbol - deliverable_type: Unset | str = UNSET - if not isinstance(self.deliverable_type, Unset): - deliverable_type = self.deliverable_type.value + deliverable_type: Unset | str = ( + UNSET + if isinstance(self.deliverable_type, Unset) + else self.deliverable_type.value + ) field_dict: dict[str, Any] = {} @@ -55,11 +57,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: symbol = d.pop("symbol", UNSET) _deliverable_type = d.pop("deliverableType", UNSET) - deliverable_type: Unset | SettlementDeliverableType - if isinstance(_deliverable_type, Unset): - deliverable_type = UNSET - else: - deliverable_type = SettlementDeliverableType(_deliverable_type) + deliverable_type: Unset | SettlementDeliverableType = ( + UNSET + if isinstance(_deliverable_type, Unset) + else SettlementDeliverableType(_deliverable_type) + ) settlement_info = cls( amount=amount, diff --git a/openapi_project/openapi_package/models/shock_value.py b/openapi_project/openapi_package/models/shock_value.py index 11318a613..a4db8a779 100644 --- a/openapi_project/openapi_package/models/shock_value.py +++ b/openapi_project/openapi_package/models/shock_value.py @@ -46,9 +46,9 @@ def to_dict(self) -> dict[str, Any]: volatility = self.volatility - flags: Unset | dict[str, Any] = UNSET - if not isinstance(self.flags, Unset): - flags = self.flags.to_dict() + flags: Unset | dict[str, Any] = ( + UNSET if isinstance(self.flags, Unset) else self.flags.to_dict() + ) field_dict: dict[str, Any] = {} @@ -82,11 +82,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: volatility = d.pop("volatility", UNSET) _flags = d.pop("flags", UNSET) - flags: Unset | ShockValueFlags - if isinstance(_flags, Unset): - flags = UNSET - else: - flags = ShockValueFlags.from_dict(_flags) + flags: Unset | ShockValueFlags = ( + UNSET if isinstance(_flags, Unset) else ShockValueFlags.from_dict(_flags) + ) shock_value = cls( delta=delta, diff --git a/openapi_project/openapi_package/models/stock.py b/openapi_project/openapi_package/models/stock.py index 23e03b0d1..3c2c82d0c 100644 --- a/openapi_project/openapi_package/models/stock.py +++ b/openapi_project/openapi_package/models/stock.py @@ -75,21 +75,21 @@ class Stock: sector: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = UNSET - if not isinstance(self.aliases, Unset): - aliases = self.aliases.to_dict() + aliases: Unset | dict[str, Any] = ( + UNSET if isinstance(self.aliases, Unset) else self.aliases.to_dict() + ) - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value + currency: Unset | str = ( + UNSET if isinstance(self.currency, Unset) else self.currency.value + ) - listed_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.listed_dt, Unset): - listed_dt = self.listed_dt.to_dict() + listed_dt: Unset | dict[str, Any] = ( + UNSET if isinstance(self.listed_dt, Unset) else self.listed_dt.to_dict() + ) - delisted_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.delisted_dt, Unset): - delisted_dt = self.delisted_dt.to_dict() + delisted_dt: Unset | dict[str, Any] = ( + UNSET if isinstance(self.delisted_dt, Unset) else self.delisted_dt.to_dict() + ) description = self.description @@ -103,19 +103,25 @@ def to_dict(self) -> dict[str, Any]: price_display_factor = self.price_display_factor - price_display_format: Unset | str = UNSET - if not isinstance(self.price_display_format, Unset): - price_display_format = self.price_display_format.value + price_display_format: Unset | str = ( + UNSET + if isinstance(self.price_display_format, Unset) + else self.price_display_format.value + ) qty_display_factor = self.qty_display_factor - qty_display_format: Unset | str = UNSET - if not isinstance(self.qty_display_format, Unset): - qty_display_format = self.qty_display_format.value + qty_display_format: Unset | str = ( + UNSET + if isinstance(self.qty_display_format, Unset) + else self.qty_display_format.value + ) - security_category: Unset | str = UNSET - if not isinstance(self.security_category, Unset): - security_category = self.security_category.value + security_category: Unset | str = ( + UNSET + if isinstance(self.security_category, Unset) + else self.security_category.value + ) symbol = self.symbol @@ -196,32 +202,24 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _aliases = d.pop("aliases", UNSET) - aliases: Unset | StockAliases - if isinstance(_aliases, Unset): - aliases = UNSET - else: - aliases = StockAliases.from_dict(_aliases) + aliases: Unset | StockAliases = ( + UNSET if isinstance(_aliases, Unset) else StockAliases.from_dict(_aliases) + ) _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) + currency: Unset | Currency = ( + UNSET if isinstance(_currency, Unset) else Currency(_currency) + ) _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date - if isinstance(_listed_dt, Unset): - listed_dt = UNSET - else: - listed_dt = Date.from_dict(_listed_dt) + listed_dt: Unset | Date = ( + UNSET if isinstance(_listed_dt, Unset) else Date.from_dict(_listed_dt) + ) _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date - if isinstance(_delisted_dt, Unset): - delisted_dt = UNSET - else: - delisted_dt = Date.from_dict(_delisted_dt) + delisted_dt: Unset | Date = ( + UNSET if isinstance(_delisted_dt, Unset) else Date.from_dict(_delisted_dt) + ) description = d.pop("description", UNSET) @@ -236,27 +234,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: price_display_factor = d.pop("priceDisplayFactor", UNSET) _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat - if isinstance(_price_display_format, Unset): - price_display_format = UNSET - else: - price_display_format = NumericDisplayFormat(_price_display_format) + price_display_format: Unset | NumericDisplayFormat = ( + UNSET + if isinstance(_price_display_format, Unset) + else NumericDisplayFormat(_price_display_format) + ) qty_display_factor = d.pop("qtyDisplayFactor", UNSET) _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat - if isinstance(_qty_display_format, Unset): - qty_display_format = UNSET - else: - qty_display_format = NumericDisplayFormat(_qty_display_format) + qty_display_format: Unset | NumericDisplayFormat = ( + UNSET + if isinstance(_qty_display_format, Unset) + else NumericDisplayFormat(_qty_display_format) + ) _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory - if isinstance(_security_category, Unset): - security_category = UNSET - else: - security_category = SecurityCategory(_security_category) + security_category: Unset | SecurityCategory = ( + UNSET + if isinstance(_security_category, Unset) + else SecurityCategory(_security_category) + ) symbol = d.pop("symbol", UNSET) diff --git a/openapi_project/openapi_package/models/stock_aliases.py b/openapi_project/openapi_package/models/stock_aliases.py index da9585b50..dbe6fd7fa 100644 --- a/openapi_project/openapi_package/models/stock_aliases.py +++ b/openapi_project/openapi_package/models/stock_aliases.py @@ -9,49 +9,34 @@ from typing import cast, Union - - - - T = TypeVar("T", bound="StockAliases") - @_attrs_define class StockAliases: - """ - """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field(init=False, factory=dict) - - - + """ """ + additional_properties: dict[str, Union[None, str]] = _attrs_field( + init=False, factory=dict + ) def to_dict(self) -> dict[str, Any]: - + field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: - prop = prop - for prop_name, prop in self.additional_properties.items() - }) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - stock_aliases = cls( - ) - - + stock_aliases = cls() additional_properties = {} for prop_name, prop_dict in d.items(): + def _parse_additional_property(data: object) -> Union[None, str]: if data is None: return data diff --git a/openapi_project/openapi_package/models/tims_margin_data.py b/openapi_project/openapi_package/models/tims_margin_data.py index 08391344c..c7a7cb51d 100644 --- a/openapi_project/openapi_package/models/tims_margin_data.py +++ b/openapi_project/openapi_package/models/tims_margin_data.py @@ -71,9 +71,9 @@ def to_dict(self) -> dict[str, Any]: class_groups_item = class_groups_item_data.to_dict() class_groups.append(class_groups_item) - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value + currency: Unset | str = ( + UNSET if isinstance(self.currency, Unset) else self.currency.value + ) dollar_delta = self.dollar_delta @@ -161,11 +161,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: class_groups.append(class_groups_item) _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) + currency: Unset | Currency = ( + UNSET if isinstance(_currency, Unset) else Currency(_currency) + ) dollar_delta = d.pop("dollarDelta", UNSET) diff --git a/openapi_project/openapi_package/models/trade_confirm.py b/openapi_project/openapi_package/models/trade_confirm.py index 5db1e1b5b..65b773920 100644 --- a/openapi_project/openapi_package/models/trade_confirm.py +++ b/openapi_project/openapi_package/models/trade_confirm.py @@ -222,15 +222,17 @@ def to_dict(self) -> dict[str, Any]: billing_code = self.billing_code - capacity: Unset | str = UNSET - if not isinstance(self.capacity, Unset): - capacity = self.capacity.value + capacity: Unset | str = ( + UNSET if isinstance(self.capacity, Unset) else self.capacity.value + ) clearing_account = self.clearing_account - clearing_range: Unset | str = UNSET - if not isinstance(self.clearing_range, Unset): - clearing_range = self.clearing_range.value + clearing_range: Unset | str = ( + UNSET + if isinstance(self.clearing_range, Unset) + else self.clearing_range.value + ) client_id = self.client_id @@ -238,13 +240,15 @@ def to_dict(self) -> dict[str, Any]: commission = self.commission - cross_side_type: Unset | str = UNSET - if not isinstance(self.cross_side_type, Unset): - cross_side_type = self.cross_side_type.value + cross_side_type: Unset | str = ( + UNSET + if isinstance(self.cross_side_type, Unset) + else self.cross_side_type.value + ) - cross_type: Unset | str = UNSET - if not isinstance(self.cross_type, Unset): - cross_type = self.cross_type.value + cross_type: Unset | str = ( + UNSET if isinstance(self.cross_type, Unset) else self.cross_type.value + ) cum_qty = self.cum_qty @@ -266,17 +270,21 @@ def to_dict(self) -> dict[str, Any]: exec_ref_id = self.exec_ref_id - exec_type: Unset | str = UNSET - if not isinstance(self.exec_type, Unset): - exec_type = self.exec_type.value + exec_type: Unset | str = ( + UNSET if isinstance(self.exec_type, Unset) else self.exec_type.value + ) - exercise_style: Unset | str = UNSET - if not isinstance(self.exercise_style, Unset): - exercise_style = self.exercise_style.value + exercise_style: Unset | str = ( + UNSET + if isinstance(self.exercise_style, Unset) + else self.exercise_style.value + ) - expiration_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.expiration_dt, Unset): - expiration_dt = self.expiration_dt.to_dict() + expiration_dt: Unset | dict[str, Any] = ( + UNSET + if isinstance(self.expiration_dt, Unset) + else self.expiration_dt.to_dict() + ) fee1 = self.fee1 @@ -310,17 +318,21 @@ def to_dict(self) -> dict[str, Any]: mpid = self.mpid - multi_leg_reportingtype: Unset | str = UNSET - if not isinstance(self.multi_leg_reportingtype, Unset): - multi_leg_reportingtype = self.multi_leg_reportingtype.value + multi_leg_reportingtype: Unset | str = ( + UNSET + if isinstance(self.multi_leg_reportingtype, Unset) + else self.multi_leg_reportingtype.value + ) - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value + ord_type: Unset | str = ( + UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value + ) - origination_type: Unset | str = UNSET - if not isinstance(self.origination_type, Unset): - origination_type = self.origination_type.value + origination_type: Unset | str = ( + UNSET + if isinstance(self.origination_type, Unset) + else self.origination_type.value + ) orig_ord_id = self.orig_ord_id @@ -328,19 +340,21 @@ def to_dict(self) -> dict[str, Any]: perm_ord_id = self.perm_ord_id - position_effect: Unset | str = UNSET - if not isinstance(self.position_effect, Unset): - position_effect = self.position_effect.value + position_effect: Unset | str = ( + UNSET + if isinstance(self.position_effect, Unset) + else self.position_effect.value + ) price = self.price - price_type: Unset | str = UNSET - if not isinstance(self.price_type, Unset): - price_type = self.price_type.value + price_type: Unset | str = ( + UNSET if isinstance(self.price_type, Unset) else self.price_type.value + ) - put_call: Unset | str = UNSET - if not isinstance(self.put_call, Unset): - put_call = self.put_call.value + put_call: Unset | str = ( + UNSET if isinstance(self.put_call, Unset) else self.put_call.value + ) qty = self.qty @@ -352,17 +366,17 @@ def to_dict(self) -> dict[str, Any]: routing_session = self.routing_session - security_type: Unset | str = UNSET - if not isinstance(self.security_type, Unset): - security_type = self.security_type.value + security_type: Unset | str = ( + UNSET if isinstance(self.security_type, Unset) else self.security_type.value + ) - settlement_type: Unset | str = UNSET - if not isinstance(self.settlement_type, Unset): - settlement_type = self.settlement_type.value + settlement_type: Unset | str = ( + UNSET + if isinstance(self.settlement_type, Unset) + else self.settlement_type.value + ) - side: Unset | str = UNSET - if not isinstance(self.side, Unset): - side = self.side.value + side: Unset | str = UNSET if isinstance(self.side, Unset) else self.side.value source = self.source @@ -384,13 +398,11 @@ def to_dict(self) -> dict[str, Any]: text = self.text - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value + tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value - traded_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.traded_dt, Unset): - traded_dt = self.traded_dt.to_dict() + traded_dt: Unset | dict[str, Any] = ( + UNSET if isinstance(self.traded_dt, Unset) else self.traded_dt.to_dict() + ) trader_id = self.trader_id @@ -604,20 +616,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: billing_code = d.pop("billingCode", UNSET) _capacity = d.pop("capacity", UNSET) - capacity: Unset | CapacityCode - if isinstance(_capacity, Unset): - capacity = UNSET - else: - capacity = CapacityCode(_capacity) + capacity: Unset | CapacityCode = ( + UNSET if isinstance(_capacity, Unset) else CapacityCode(_capacity) + ) clearing_account = d.pop("clearingAccount", UNSET) _clearing_range = d.pop("clearingRange", UNSET) - clearing_range: Unset | ClearingRange - if isinstance(_clearing_range, Unset): - clearing_range = UNSET - else: - clearing_range = ClearingRange(_clearing_range) + clearing_range: Unset | ClearingRange = ( + UNSET + if isinstance(_clearing_range, Unset) + else ClearingRange(_clearing_range) + ) client_id = d.pop("clientId", UNSET) @@ -626,18 +636,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: commission = d.pop("commission", UNSET) _cross_side_type = d.pop("crossSideType", UNSET) - cross_side_type: Unset | CrossSideType - if isinstance(_cross_side_type, Unset): - cross_side_type = UNSET - else: - cross_side_type = CrossSideType(_cross_side_type) + cross_side_type: Unset | CrossSideType = ( + UNSET + if isinstance(_cross_side_type, Unset) + else CrossSideType(_cross_side_type) + ) _cross_type = d.pop("crossType", UNSET) - cross_type: Unset | CrossType - if isinstance(_cross_type, Unset): - cross_type = UNSET - else: - cross_type = CrossType(_cross_type) + cross_type: Unset | CrossType = ( + UNSET if isinstance(_cross_type, Unset) else CrossType(_cross_type) + ) cum_qty = d.pop("cumQty", UNSET) @@ -660,25 +668,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: exec_ref_id = d.pop("execRefId", UNSET) _exec_type = d.pop("execType", UNSET) - exec_type: Unset | ExecType - if isinstance(_exec_type, Unset): - exec_type = UNSET - else: - exec_type = ExecType(_exec_type) + exec_type: Unset | ExecType = ( + UNSET if isinstance(_exec_type, Unset) else ExecType(_exec_type) + ) _exercise_style = d.pop("exerciseStyle", UNSET) - exercise_style: Unset | OptionExerciseStyle - if isinstance(_exercise_style, Unset): - exercise_style = UNSET - else: - exercise_style = OptionExerciseStyle(_exercise_style) + exercise_style: Unset | OptionExerciseStyle = ( + UNSET + if isinstance(_exercise_style, Unset) + else OptionExerciseStyle(_exercise_style) + ) _expiration_dt = d.pop("expirationDt", UNSET) - expiration_dt: Unset | Date - if isinstance(_expiration_dt, Unset): - expiration_dt = UNSET - else: - expiration_dt = Date.from_dict(_expiration_dt) + expiration_dt: Unset | Date = ( + UNSET + if isinstance(_expiration_dt, Unset) + else Date.from_dict(_expiration_dt) + ) fee1 = d.pop("fee1", UNSET) @@ -713,25 +719,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: mpid = d.pop("mpid", UNSET) _multi_leg_reportingtype = d.pop("multiLegReportingtype", UNSET) - multi_leg_reportingtype: Unset | MultiLegReportingType - if isinstance(_multi_leg_reportingtype, Unset): - multi_leg_reportingtype = UNSET - else: - multi_leg_reportingtype = MultiLegReportingType(_multi_leg_reportingtype) + multi_leg_reportingtype: Unset | MultiLegReportingType = ( + UNSET + if isinstance(_multi_leg_reportingtype, Unset) + else MultiLegReportingType(_multi_leg_reportingtype) + ) _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) + ord_type: Unset | OrdType = ( + UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) + ) _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType - if isinstance(_origination_type, Unset): - origination_type = UNSET - else: - origination_type = OriginationType(_origination_type) + origination_type: Unset | OriginationType = ( + UNSET + if isinstance(_origination_type, Unset) + else OriginationType(_origination_type) + ) orig_ord_id = d.pop("origOrdId", UNSET) @@ -740,27 +744,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: perm_ord_id = d.pop("permOrdId", UNSET) _position_effect = d.pop("positionEffect", UNSET) - position_effect: Unset | PositionEffect - if isinstance(_position_effect, Unset): - position_effect = UNSET - else: - position_effect = PositionEffect(_position_effect) + position_effect: Unset | PositionEffect = ( + UNSET + if isinstance(_position_effect, Unset) + else PositionEffect(_position_effect) + ) price = d.pop("price", UNSET) _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType - if isinstance(_price_type, Unset): - price_type = UNSET - else: - price_type = PriceType(_price_type) + price_type: Unset | PriceType = ( + UNSET if isinstance(_price_type, Unset) else PriceType(_price_type) + ) _put_call = d.pop("putCall", UNSET) - put_call: Unset | PutCall - if isinstance(_put_call, Unset): - put_call = UNSET - else: - put_call = PutCall(_put_call) + put_call: Unset | PutCall = ( + UNSET if isinstance(_put_call, Unset) else PutCall(_put_call) + ) qty = d.pop("qty", UNSET) @@ -773,25 +773,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: routing_session = d.pop("routingSession", UNSET) _security_type = d.pop("securityType", UNSET) - security_type: Unset | SecurityType - if isinstance(_security_type, Unset): - security_type = UNSET - else: - security_type = SecurityType(_security_type) + security_type: Unset | SecurityType = ( + UNSET if isinstance(_security_type, Unset) else SecurityType(_security_type) + ) _settlement_type = d.pop("settlementType", UNSET) - settlement_type: Unset | OptionSettlementType - if isinstance(_settlement_type, Unset): - settlement_type = UNSET - else: - settlement_type = OptionSettlementType(_settlement_type) + settlement_type: Unset | OptionSettlementType = ( + UNSET + if isinstance(_settlement_type, Unset) + else OptionSettlementType(_settlement_type) + ) _side = d.pop("side", UNSET) - side: Unset | Side - if isinstance(_side, Unset): - side = UNSET - else: - side = Side(_side) + side: Unset | Side = UNSET if isinstance(_side, Unset) else Side(_side) source = d.pop("source", UNSET) @@ -814,18 +808,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: text = d.pop("text", UNSET) _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) + tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) _traded_dt = d.pop("tradedDt", UNSET) - traded_dt: Unset | Date - if isinstance(_traded_dt, Unset): - traded_dt = UNSET - else: - traded_dt = Date.from_dict(_traded_dt) + traded_dt: Unset | Date = ( + UNSET if isinstance(_traded_dt, Unset) else Date.from_dict(_traded_dt) + ) trader_id = d.pop("traderId", UNSET) diff --git a/openapi_project/openapi_package/models/trading_holiday.py b/openapi_project/openapi_package/models/trading_holiday.py index dd783dc72..5e3a08561 100644 --- a/openapi_project/openapi_package/models/trading_holiday.py +++ b/openapi_project/openapi_package/models/trading_holiday.py @@ -37,13 +37,13 @@ class TradingHoliday: def to_dict(self) -> dict[str, Any]: id = self.id - country: Unset | str = UNSET - if not isinstance(self.country, Unset): - country = self.country.value + country: Unset | str = ( + UNSET if isinstance(self.country, Unset) else self.country.value + ) - date: Unset | dict[str, Any] = UNSET - if not isinstance(self.date, Unset): - date = self.date.to_dict() + date: Unset | dict[str, Any] = ( + UNSET if isinstance(self.date, Unset) else self.date.to_dict() + ) description = self.description @@ -71,18 +71,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _country = d.pop("country", UNSET) - country: Unset | Country - if isinstance(_country, Unset): - country = UNSET - else: - country = Country(_country) + country: Unset | Country = ( + UNSET if isinstance(_country, Unset) else Country(_country) + ) _date = d.pop("date", UNSET) - date: Unset | Date - if isinstance(_date, Unset): - date = UNSET - else: - date = Date.from_dict(_date) + date: Unset | Date = ( + UNSET if isinstance(_date, Unset) else Date.from_dict(_date) + ) description = d.pop("description", UNSET) diff --git a/openapi_project/openapi_package/models/trading_session.py b/openapi_project/openapi_package/models/trading_session.py index e239fb8f1..5c84e69ab 100644 --- a/openapi_project/openapi_package/models/trading_session.py +++ b/openapi_project/openapi_package/models/trading_session.py @@ -38,17 +38,17 @@ class TradingSession: def to_dict(self) -> dict[str, Any]: days_of_the_week = self.days_of_the_week - end_time: Unset | dict[str, Any] = UNSET - if not isinstance(self.end_time, Unset): - end_time = self.end_time.to_dict() + end_time: Unset | dict[str, Any] = ( + UNSET if isinstance(self.end_time, Unset) else self.end_time.to_dict() + ) id = self.id name = self.name - start_time: Unset | dict[str, Any] = UNSET - if not isinstance(self.start_time, Unset): - start_time = self.start_time.to_dict() + start_time: Unset | dict[str, Any] = ( + UNSET if isinstance(self.start_time, Unset) else self.start_time.to_dict() + ) trading_session_group_id = self.trading_session_group_id @@ -76,22 +76,20 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: days_of_the_week = d.pop("daysOfTheWeek", UNSET) _end_time = d.pop("endTime", UNSET) - end_time: Unset | TimeOfDay - if isinstance(_end_time, Unset): - end_time = UNSET - else: - end_time = TimeOfDay.from_dict(_end_time) + end_time: Unset | TimeOfDay = ( + UNSET if isinstance(_end_time, Unset) else TimeOfDay.from_dict(_end_time) + ) id = d.pop("id", UNSET) name = d.pop("name", UNSET) _start_time = d.pop("startTime", UNSET) - start_time: Unset | TimeOfDay - if isinstance(_start_time, Unset): - start_time = UNSET - else: - start_time = TimeOfDay.from_dict(_start_time) + start_time: Unset | TimeOfDay = ( + UNSET + if isinstance(_start_time, Unset) + else TimeOfDay.from_dict(_start_time) + ) trading_session_group_id = d.pop("tradingSessionGroupId", UNSET) diff --git a/openapi_project/openapi_package/models/user.py b/openapi_project/openapi_package/models/user.py index 1dd17f54d..7fc483d38 100644 --- a/openapi_project/openapi_package/models/user.py +++ b/openapi_project/openapi_package/models/user.py @@ -77,9 +77,9 @@ def to_dict(self) -> dict[str, Any]: last_name = self.last_name - location: Unset | str = UNSET - if not isinstance(self.location, Unset): - location = self.location.value + location: Unset | str = ( + UNSET if isinstance(self.location, Unset) else self.location.value + ) phone_primary = self.phone_primary @@ -89,15 +89,15 @@ def to_dict(self) -> dict[str, Any]: region_code = self.region_code - status: Unset | str = UNSET - if not isinstance(self.status, Unset): - status = self.status.value + status: Unset | str = ( + UNSET if isinstance(self.status, Unset) else self.status.value + ) trading_firm_id = self.trading_firm_id - type_: Unset | str = UNSET - if not isinstance(self.type_, Unset): - type_ = self.type_.value + type_: Unset | str = ( + UNSET if isinstance(self.type_, Unset) else self.type_.value + ) user_name = self.user_name @@ -174,11 +174,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: last_name = d.pop("lastName", UNSET) _location = d.pop("location", UNSET) - location: Unset | UserLocation - if isinstance(_location, Unset): - location = UNSET - else: - location = UserLocation(_location) + location: Unset | UserLocation = ( + UNSET if isinstance(_location, Unset) else UserLocation(_location) + ) phone_primary = d.pop("phonePrimary", UNSET) @@ -189,20 +187,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: region_code = d.pop("regionCode", UNSET) _status = d.pop("status", UNSET) - status: Unset | UserStatus - if isinstance(_status, Unset): - status = UNSET - else: - status = UserStatus(_status) + status: Unset | UserStatus = ( + UNSET if isinstance(_status, Unset) else UserStatus(_status) + ) trading_firm_id = d.pop("tradingFirmId", UNSET) _type_ = d.pop("type", UNSET) - type_: Unset | UserType - if isinstance(_type_, Unset): - type_ = UNSET - else: - type_ = UserType(_type_) + type_: Unset | UserType = ( + UNSET if isinstance(_type_, Unset) else UserType(_type_) + ) user_name = d.pop("userName", UNSET) diff --git a/openapi_project/openapi_package/models/user_permission.py b/openapi_project/openapi_package/models/user_permission.py index e4372fd54..10f777507 100644 --- a/openapi_project/openapi_package/models/user_permission.py +++ b/openapi_project/openapi_package/models/user_permission.py @@ -29,9 +29,9 @@ class UserPermission: def to_dict(self) -> dict[str, Any]: claim = self.claim - claim_type: Unset | str = UNSET - if not isinstance(self.claim_type, Unset): - claim_type = self.claim_type.value + claim_type: Unset | str = ( + UNSET if isinstance(self.claim_type, Unset) else self.claim_type.value + ) description = self.description @@ -53,11 +53,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: claim = d.pop("claim", UNSET) _claim_type = d.pop("claimType", UNSET) - claim_type: Unset | ClaimType - if isinstance(_claim_type, Unset): - claim_type = UNSET - else: - claim_type = ClaimType(_claim_type) + claim_type: Unset | ClaimType = ( + UNSET if isinstance(_claim_type, Unset) else ClaimType(_claim_type) + ) description = d.pop("description", UNSET) diff --git a/openapi_project/openapi_package/models/validate_risk_response.py b/openapi_project/openapi_package/models/validate_risk_response.py index 333a1b78e..b09edaa82 100644 --- a/openapi_project/openapi_package/models/validate_risk_response.py +++ b/openapi_project/openapi_package/models/validate_risk_response.py @@ -44,9 +44,9 @@ def to_dict(self) -> dict[str, Any]: error_message = self.error_message - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value + status_code: Unset | str = ( + UNSET if isinstance(self.status_code, Unset) else self.status_code.value + ) field_dict: dict[str, Any] = {} @@ -77,11 +77,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: error_message = d.pop("errorMessage", UNSET) _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) + status_code: Unset | StatusCode = ( + UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) + ) validate_risk_response = cls( is_valid=is_valid, diff --git a/openapi_python_client/templates/model.py.jinja b/openapi_python_client/templates/model.py.jinja index 905a0d0bf..94e504004 100644 --- a/openapi_python_client/templates/model.py.jinja +++ b/openapi_python_client/templates/model.py.jinja @@ -111,12 +111,13 @@ field_dict: dict[str, Any] = {} {% if model.additional_properties %} {% import "property_templates/" + model.additional_properties.template as prop_template %} {% if prop_template.transform %} +for prop_name, prop in self.additional_properties.items(): + {{ prop_template.transform(model.additional_properties, "prop", "field_dict[prop_name]", declare_type=false) | indent(4) }} +{% else %} field_dict.update({ - prop_name: {{ prop_template.transform(model.additional_properties, "prop", "prop", declare_type=false) }} + prop_name: prop for prop_name, prop in self.additional_properties.items() }) -{% else %} -field_dict.update(self.additional_properties) {%- endif -%} {%- endif -%} {% endmacro %} diff --git a/openapi_python_client/templates/property_templates/date_property.py.jinja b/openapi_python_client/templates/property_templates/date_property.py.jinja index 3ca8faee9..726cbe604 100644 --- a/openapi_python_client/templates/property_templates/date_property.py.jinja +++ b/openapi_python_client/templates/property_templates/date_property.py.jinja @@ -17,12 +17,10 @@ isoparse({{ source }}).date() {%- else %} {% if declare_type %} {% set type_annotation = property.get_type_string(json=True) %} -{{ destination }}: {{ type_annotation }} = UNSET +{{ destination }}: {{ type_annotation }} = UNSET if isinstance({{ source }}, Unset) else {{ transformed }} {% else %} -{{ destination }} = UNSET +{{ destination }} = UNSET if isinstance({{ source }}, Unset) else {{ transformed }} {% endif %} -if not isinstance({{ source }}, Unset): - {{ destination }} = {{ transformed }} {%- endif %} {% endmacro %} diff --git a/openapi_python_client/templates/property_templates/datetime_property.py.jinja b/openapi_python_client/templates/property_templates/datetime_property.py.jinja index bf7e601d1..795fe388d 100644 --- a/openapi_python_client/templates/property_templates/datetime_property.py.jinja +++ b/openapi_python_client/templates/property_templates/datetime_property.py.jinja @@ -17,12 +17,10 @@ isoparse({{ source }}) {%- else %} {% if declare_type %} {% set type_annotation = property.get_type_string(json=True) %} -{{ destination }}: {{ type_annotation }} = UNSET +{{ destination }}: {{ type_annotation }} = UNSET if isinstance({{ source }}, Unset) else {{ transformed }} {% else %} -{{ destination }} = UNSET +{{ destination }} = UNSET if isinstance({{ source }}, Unset) else {{ transformed }} {% endif %} -if not isinstance({{ source }}, Unset): - {{ destination }} = {{ transformed }} {%- endif %} {% endmacro %} diff --git a/openapi_python_client/templates/property_templates/enum_property.py.jinja b/openapi_python_client/templates/property_templates/enum_property.py.jinja index af8ca6eff..ecc2271af 100644 --- a/openapi_python_client/templates/property_templates/enum_property.py.jinja +++ b/openapi_python_client/templates/property_templates/enum_property.py.jinja @@ -16,9 +16,7 @@ {% if property.required %} {{ destination }} = {{ transformed }} {%- else %} -{{ destination }}{% if declare_type %}: {{ type_string }}{% endif %} = UNSET -if not isinstance({{ source }}, Unset): - {{ destination }} = {{ transformed }} +{{ destination }}{% if declare_type %}: {{ type_string }}{% endif %} = UNSET if isinstance({{ source }}, Unset) else {{ transformed }} {% endif %} {% endmacro %} diff --git a/openapi_python_client/templates/property_templates/file_property.py.jinja b/openapi_python_client/templates/property_templates/file_property.py.jinja index b08a13b46..ba3b6f358 100644 --- a/openapi_python_client/templates/property_templates/file_property.py.jinja +++ b/openapi_python_client/templates/property_templates/file_property.py.jinja @@ -16,9 +16,7 @@ File( {% if property.required %} {{ destination }} = {{ source }}.to_tuple() {% else %} -{{ destination }}{% if declare_type %}: {{ property.get_type_string(json=True) }}{% endif %} = UNSET -if not isinstance({{ source }}, Unset): - {{ destination }} = {{ source }}.to_tuple() +{{ destination }}{% if declare_type %}: {{ property.get_type_string(json=True) }}{% endif %} = UNSET if isinstance({{ source }}, Unset) else {{ source }}.to_tuple() {% endif %} {% endmacro %} diff --git a/openapi_python_client/templates/property_templates/literal_enum_property.py.jinja b/openapi_python_client/templates/property_templates/literal_enum_property.py.jinja index 2cc4558c6..3e4b2101d 100644 --- a/openapi_python_client/templates/property_templates/literal_enum_property.py.jinja +++ b/openapi_python_client/templates/property_templates/literal_enum_property.py.jinja @@ -15,9 +15,7 @@ check_{{ property.get_class_name_snake_case() }}({{ source }}) {% if property.required %} {{ destination }}{% if declare_type %}: {{ type_string }}{% endif %} = {{ source }} {%- else %} -{{ destination }}{% if declare_type %}: {{ type_string }}{% endif %} = UNSET -if not isinstance({{ source }}, Unset): - {{ destination }} = {{ source }} +{{ destination }}{% if declare_type %}: {{ type_string }}{% endif %} = UNSET if isinstance({{ source }}, Unset) else {{ source }} {% endif %} {% endmacro %} diff --git a/openapi_python_client/templates/property_templates/model_property.py.jinja b/openapi_python_client/templates/property_templates/model_property.py.jinja index d1a4b5d34..827435abd 100644 --- a/openapi_python_client/templates/property_templates/model_property.py.jinja +++ b/openapi_python_client/templates/property_templates/model_property.py.jinja @@ -16,9 +16,7 @@ {% if property.required %} {{ destination }} = {{ transformed }} {%- else %} -{{ destination }}{% if declare_type %}: {{ type_string }}{% endif %} = UNSET -if not isinstance({{ source }}, Unset): - {{ destination }} = {{ transformed }} +{{ destination }}{% if declare_type %}: {{ type_string }}{% endif %} = UNSET if isinstance({{ source }}, Unset) else {{ transformed }} {%- endif %} {% endmacro %} @@ -27,8 +25,7 @@ if not isinstance({{ source }}, Unset): {% if property.required %} _kwargs["files"] = {{ transformed }} {%- else %} -if not isinstance({{ property.python_name }}, Unset): - _kwargs["files"] = {{ transformed }} +_kwargs["files"] = {{ transformed }} if not isinstance({{ property.python_name }}, Unset) else None {%- endif %} {% endmacro %} diff --git a/openapi_python_client/templates/property_templates/property_macros.py.jinja b/openapi_python_client/templates/property_templates/property_macros.py.jinja index 52e1d41bc..b95870d40 100644 --- a/openapi_python_client/templates/property_templates/property_macros.py.jinja +++ b/openapi_python_client/templates/property_templates/property_macros.py.jinja @@ -3,12 +3,6 @@ {{ property.python_name }} = {{ construct_function(property, source) }} {% else %}{# Must be non-required #} _{{ property.python_name }} = {{ source }} -{{ property.python_name }}: {{ property.get_type_string() }} - {% if not property.required %} -if isinstance(_{{ property.python_name }}, Unset): - {{ property.python_name }} = UNSET - {% endif %} -else: - {{ property.python_name }} = {{ construct_function(property, "_" + property.python_name) }} +{{ property.python_name }}: {{ property.get_type_string() }} = UNSET if isinstance(_{{ property.python_name }}, Unset) else {{ construct_function(property, "_" + property.python_name) }} {% endif %} {% endmacro %} diff --git a/openapi_python_client/templates/property_templates/uuid_property.py.jinja b/openapi_python_client/templates/property_templates/uuid_property.py.jinja index 3a6ce46bb..7d58d8492 100644 --- a/openapi_python_client/templates/property_templates/uuid_property.py.jinja +++ b/openapi_python_client/templates/property_templates/uuid_property.py.jinja @@ -17,12 +17,10 @@ UUID({{ source }}) {%- else %} {% if declare_type %} {% set type_annotation = property.get_type_string(json=True) %} -{{ destination }}: {{ type_annotation }} = UNSET +{{ destination }}: {{ type_annotation }} = UNSET if isinstance({{ source }}, Unset) else {{ transformed }} {% else %} -{{ destination }} = UNSET +{{ destination }} = UNSET if isinstance({{ source }}, Unset) else {{ transformed }} {% endif %} -if not isinstance({{ source }}, Unset): - {{ destination }} = {{ transformed }} {%- endif %} {% endmacro %} From 0ca86c47dcab6323d9328ef7faf1d9ffea0fafb0 Mon Sep 17 00:00:00 2001 From: Itay Bavly Date: Wed, 20 Aug 2025 13:51:14 -0400 Subject: [PATCH 04/16] fix dicts --- openapi/templates/model.py.jinja | 6 ++++-- openapi_project/openapi_package/models/account.py | 2 +- .../models/cancel_order_request_optional_data.py | 6 +++--- .../cancel_replace_multi_leg_order_request.py | 4 ++-- .../cancel_replace_multi_leg_order_request_algo.py | 6 +++--- ...lace_multi_leg_order_request_market_condition.py | 6 +++--- ...replace_multi_leg_order_request_optional_data.py | 6 +++--- .../models/cancel_replace_order_request.py | 2 +- .../models/cancel_replace_order_request_algo.py | 6 +++--- ...cancel_replace_order_request_market_condition.py | 6 +++--- .../cancel_replace_order_request_optional_data.py | 6 +++--- .../create_multi_leg_order_cross_allocation.py | 2 +- ...ulti_leg_order_cross_allocation_optional_data.py | 6 +++--- .../models/create_multi_leg_order_cross_request.py | 10 +++++----- .../create_multi_leg_order_cross_request_algo.py | 6 +++--- ...ulti_leg_order_cross_request_market_condition.py | 6 +++--- ...e_multi_leg_order_cross_request_optional_data.py | 6 +++--- .../models/create_multi_leg_order_leg.py | 8 ++++---- .../create_multi_leg_order_leg_market_condition.py | 6 +++--- .../create_multi_leg_order_leg_optional_data.py | 6 +++--- .../models/create_multi_leg_order_request.py | 10 +++++----- .../models/create_multi_leg_order_request_algo.py | 6 +++--- ...eate_multi_leg_order_request_market_condition.py | 6 +++--- .../create_multi_leg_order_request_optional_data.py | 6 +++--- .../models/create_order_cross_allocation.py | 2 +- .../create_order_cross_allocation_optional_data.py | 6 +++--- .../models/create_order_cross_request.py | 6 +++--- .../models/create_order_cross_request_algo.py | 6 +++--- .../create_order_cross_request_market_condition.py | 6 +++--- .../create_order_cross_request_optional_data.py | 6 +++--- .../openapi_package/models/create_order_request.py | 4 ++-- .../models/create_order_request_algo.py | 6 +++--- .../models/create_order_request_market_condition.py | 6 +++--- .../models/create_order_request_optional_data.py | 6 +++--- openapi_project/openapi_package/models/crypto.py | 2 +- .../openapi_package/models/crypto_aliases.py | 6 +++--- openapi_project/openapi_package/models/execution.py | 6 +++--- .../openapi_package/models/execution_algo.py | 6 +++--- .../models/execution_optional_data.py | 6 +++--- .../openapi_package/models/flex_option.py | 2 +- .../openapi_package/models/flex_option_aliases.py | 6 +++--- openapi_project/openapi_package/models/future.py | 4 ++-- .../openapi_package/models/future_aliases.py | 6 +++--- .../openapi_package/models/future_root.py | 2 +- .../openapi_package/models/future_root_aliases.py | 6 +++--- .../openapi_package/models/future_spread.py | 2 +- .../openapi_package/models/future_spread_aliases.py | 6 +++--- openapi_project/openapi_package/models/fx.py | 2 +- .../openapi_package/models/fx_aliases.py | 6 +++--- .../openapi_package/models/generic_order.py | 2 +- .../get_server_info_response_system_settings.py | 6 +++--- openapi_project/openapi_package/models/index.py | 2 +- .../openapi_package/models/index_aliases.py | 6 +++--- .../models/login_response_system_settings.py | 6 +++--- .../openapi_package/models/multi_leg_order.py | 8 ++++---- .../openapi_package/models/multi_leg_order_algo.py | 6 +++--- .../multi_leg_order_cancel_replace_request.py | 10 +++++----- .../multi_leg_order_cancel_replace_request_algo.py | 6 +++--- ...order_cancel_replace_request_market_condition.py | 6 +++--- ...eg_order_cancel_replace_request_optional_data.py | 6 +++--- .../openapi_package/models/multi_leg_order_cross.py | 6 +++--- .../models/multi_leg_order_cross_algo.py | 6 +++--- .../models/multi_leg_order_cross_allocation.py | 4 ++-- ...ulti_leg_order_cross_allocation_optional_data.py | 6 +++--- .../multi_leg_order_cross_market_condition.py | 6 +++--- .../models/multi_leg_order_cross_optional_data.py | 6 +++--- .../openapi_package/models/multi_leg_order_leg.py | 2 +- .../models/multi_leg_order_leg_market_condition.py | 6 +++--- .../models/multi_leg_order_leg_optional_data.py | 6 +++--- .../models/multi_leg_order_market_condition.py | 6 +++--- .../models/multi_leg_order_optional_data.py | 6 +++--- openapi_project/openapi_package/models/option.py | 2 +- .../openapi_package/models/option_aliases.py | 6 +++--- .../openapi_package/models/option_chain.py | 4 ++-- .../openapi_package/models/option_chain_option.py | 2 +- .../models/option_chain_option_aliases.py | 6 +++--- .../openapi_package/models/option_chain_options.py | 8 ++++++-- .../openapi_package/models/option_chain_roots.py | 8 ++++++-- .../openapi_package/models/option_root.py | 4 ++-- .../openapi_package/models/option_root_aliases.py | 6 +++--- openapi_project/openapi_package/models/order.py | 8 ++++---- .../openapi_package/models/order_algo.py | 6 +++--- .../models/order_cancel_reject_optional_data.py | 6 +++--- .../models/order_cancel_replace_request.py | 6 +++--- .../models/order_cancel_replace_request_algo.py | 6 +++--- ...order_cancel_replace_request_market_condition.py | 6 +++--- .../order_cancel_replace_request_optional_data.py | 6 +++--- .../models/order_cancel_request_optional_data.py | 6 +++--- .../openapi_package/models/order_cross.py | 8 ++++---- .../openapi_package/models/order_cross_algo.py | 6 +++--- .../models/order_cross_allocation.py | 4 ++-- .../models/order_cross_allocation_optional_data.py | 6 +++--- .../models/order_cross_market_condition.py | 6 +++--- .../models/order_cross_optional_data.py | 6 +++--- .../models/order_delete_optional_data.py | 6 +++--- .../models/order_market_condition.py | 6 +++--- .../openapi_package/models/order_optional_data.py | 6 +++--- .../openapi_package/models/order_update.py | 4 ++-- .../openapi_package/models/order_update_algo.py | 6 +++--- .../openapi_package/models/order_update_event.py | 6 +++--- .../models/order_update_optional_data.py | 6 +++--- .../models/risk_radar_account_group.py | 2 +- openapi_project/openapi_package/models/scenario.py | 2 +- openapi_project/openapi_package/models/security.py | 12 ++++++------ .../openapi_package/models/stock_aliases.py | 6 +++--- .../openapi_package/models/tims_margin_data.py | 2 +- openapi_python_client/templates/model.py.jinja | 6 ++++-- .../property_templates/date_property.py.jinja | 4 ++++ .../property_templates/datetime_property.py.jinja | 4 ++++ .../property_templates/enum_property.py.jinja | 4 ++++ .../property_templates/file_property.py.jinja | 4 ++++ .../property_templates/list_property.py.jinja | 13 +++++++++++++ .../literal_enum_property.py.jinja | 4 ++++ .../property_templates/model_property.py.jinja | 4 ++++ .../property_templates/union_property.py.jinja | 4 ++++ .../property_templates/uuid_property.py.jinja | 4 ++++ 116 files changed, 345 insertions(+), 288 deletions(-) diff --git a/openapi/templates/model.py.jinja b/openapi/templates/model.py.jinja index 94e504004..cc4179ade 100644 --- a/openapi/templates/model.py.jinja +++ b/openapi/templates/model.py.jinja @@ -111,8 +111,10 @@ field_dict: dict[str, Any] = {} {% if model.additional_properties %} {% import "property_templates/" + model.additional_properties.template as prop_template %} {% if prop_template.transform %} -for prop_name, prop in self.additional_properties.items(): - {{ prop_template.transform(model.additional_properties, "prop", "field_dict[prop_name]", declare_type=false) | indent(4) }} +field_dict.update({ + prop_name: {{ prop_template.transform_expression(model.additional_properties, "prop") if prop_template.transform_expression else "prop" }} + for prop_name, prop in self.additional_properties.items() +}) {% else %} field_dict.update({ prop_name: prop diff --git a/openapi_project/openapi_package/models/account.py b/openapi_project/openapi_package/models/account.py index b0b1ff207..d0ea0d034 100644 --- a/openapi_project/openapi_package/models/account.py +++ b/openapi_project/openapi_package/models/account.py @@ -15,8 +15,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.routing_session_group import RoutingSessionGroup from ..models.account_script import AccountScript + from ..models.routing_session_group import RoutingSessionGroup T = TypeVar("T", bound="Account") diff --git a/openapi_project/openapi_package/models/cancel_order_request_optional_data.py b/openapi_project/openapi_package/models/cancel_order_request_optional_data.py index 76146be2b..43551a478 100644 --- a/openapi_project/openapi_package/models/cancel_order_request_optional_data.py +++ b/openapi_project/openapi_package/models/cancel_order_request_optional_data.py @@ -23,9 +23,9 @@ class CancelOrderRequestOptionalData: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py index 89a399fed..8237130fd 100644 --- a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py +++ b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py @@ -12,17 +12,17 @@ from typing import cast if TYPE_CHECKING: + from ..models.clearing_info import ClearingInfo + from ..models.order_instruction import OrderInstruction from ..models.cancel_replace_multi_leg_order_request_market_condition import ( CancelReplaceMultiLegOrderRequestMarketCondition, ) - from ..models.clearing_info import ClearingInfo from ..models.cancel_replace_multi_leg_order_request_optional_data import ( CancelReplaceMultiLegOrderRequestOptionalData, ) from ..models.cancel_replace_multi_leg_order_request_algo import ( CancelReplaceMultiLegOrderRequestAlgo, ) - from ..models.order_instruction import OrderInstruction T = TypeVar("T", bound="CancelReplaceMultiLegOrderRequest") diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py index 89499f435..9458940b9 100644 --- a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py +++ b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py @@ -23,9 +23,9 @@ class CancelReplaceMultiLegOrderRequestAlgo: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py index 7149d8ebb..2b3f33d64 100644 --- a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py +++ b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py @@ -23,9 +23,9 @@ class CancelReplaceMultiLegOrderRequestMarketCondition: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py index 72978ff80..df37f0a09 100644 --- a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py +++ b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py @@ -23,9 +23,9 @@ class CancelReplaceMultiLegOrderRequestOptionalData: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/cancel_replace_order_request.py b/openapi_project/openapi_package/models/cancel_replace_order_request.py index 033da208b..b39947429 100644 --- a/openapi_project/openapi_package/models/cancel_replace_order_request.py +++ b/openapi_project/openapi_package/models/cancel_replace_order_request.py @@ -15,11 +15,11 @@ from ..models.cancel_replace_order_request_market_condition import ( CancelReplaceOrderRequestMarketCondition, ) + from ..models.cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo from ..models.clearing_info import ClearingInfo from ..models.cancel_replace_order_request_optional_data import ( CancelReplaceOrderRequestOptionalData, ) - from ..models.cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo from ..models.order_instruction import OrderInstruction diff --git a/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py b/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py index 904301af0..100a71540 100644 --- a/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py +++ b/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py @@ -23,9 +23,9 @@ class CancelReplaceOrderRequestAlgo: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py b/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py index 0be4b7916..fd672c2dd 100644 --- a/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py +++ b/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py @@ -23,9 +23,9 @@ class CancelReplaceOrderRequestMarketCondition: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py b/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py index ceddb6b08..b3e858010 100644 --- a/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py +++ b/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py @@ -23,9 +23,9 @@ class CancelReplaceOrderRequestOptionalData: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py index ab079dd36..c997b6f4b 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py @@ -14,9 +14,9 @@ from ..models.create_multi_leg_order_cross_allocation_optional_data import ( CreateMultiLegOrderCrossAllocationOptionalData, ) - from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg from ..models.clearing_info import ClearingInfo from ..models.order_instruction import OrderInstruction + from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg T = TypeVar("T", bound="CreateMultiLegOrderCrossAllocation") diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py index 13ff43297..a2ee6c734 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py @@ -23,9 +23,9 @@ class CreateMultiLegOrderCrossAllocationOptionalData: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py index 11ceeb085..8b8bc8e94 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py @@ -14,18 +14,18 @@ from typing import cast if TYPE_CHECKING: - from ..models.create_multi_leg_order_cross_request_optional_data import ( - CreateMultiLegOrderCrossRequestOptionalData, + from ..models.create_multi_leg_order_cross_request_algo import ( + CreateMultiLegOrderCrossRequestAlgo, ) from ..models.create_multi_leg_order_cross_allocation import ( CreateMultiLegOrderCrossAllocation, ) + from ..models.create_multi_leg_order_cross_request_optional_data import ( + CreateMultiLegOrderCrossRequestOptionalData, + ) from ..models.create_multi_leg_order_cross_request_market_condition import ( CreateMultiLegOrderCrossRequestMarketCondition, ) - from ..models.create_multi_leg_order_cross_request_algo import ( - CreateMultiLegOrderCrossRequestAlgo, - ) from ..models.order_instruction import OrderInstruction diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py index 120285451..41cab1809 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py @@ -23,9 +23,9 @@ class CreateMultiLegOrderCrossRequestAlgo: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py index 238736536..26b2fc127 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py @@ -23,9 +23,9 @@ class CreateMultiLegOrderCrossRequestMarketCondition: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py index 642690184..2c06fbd78 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py @@ -23,9 +23,9 @@ class CreateMultiLegOrderCrossRequestOptionalData: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_leg.py b/openapi_project/openapi_package/models/create_multi_leg_order_leg.py index 0a9beba3e..078c0c2f0 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_leg.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_leg.py @@ -12,13 +12,13 @@ from typing import cast if TYPE_CHECKING: - from ..models.create_multi_leg_order_leg_market_condition import ( - CreateMultiLegOrderLegMarketCondition, - ) - from ..models.flex_option import FlexOption from ..models.create_multi_leg_order_leg_optional_data import ( CreateMultiLegOrderLegOptionalData, ) + from ..models.flex_option import FlexOption + from ..models.create_multi_leg_order_leg_market_condition import ( + CreateMultiLegOrderLegMarketCondition, + ) T = TypeVar("T", bound="CreateMultiLegOrderLeg") diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py b/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py index 477f5ecf8..ec2db45ca 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py @@ -23,9 +23,9 @@ class CreateMultiLegOrderLegMarketCondition: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py b/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py index beaca4ed0..2244c7f50 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py @@ -23,9 +23,9 @@ class CreateMultiLegOrderLegOptionalData: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_request.py b/openapi_project/openapi_package/models/create_multi_leg_order_request.py index 95eee7cb4..228f3bdd3 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_request.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_request.py @@ -13,18 +13,18 @@ from typing import cast if TYPE_CHECKING: + from ..models.create_multi_leg_order_request_algo import ( + CreateMultiLegOrderRequestAlgo, + ) + from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg from ..models.clearing_info import ClearingInfo + from ..models.order_instruction import OrderInstruction from ..models.create_multi_leg_order_request_optional_data import ( CreateMultiLegOrderRequestOptionalData, ) from ..models.create_multi_leg_order_request_market_condition import ( CreateMultiLegOrderRequestMarketCondition, ) - from ..models.create_multi_leg_order_request_algo import ( - CreateMultiLegOrderRequestAlgo, - ) - from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg - from ..models.order_instruction import OrderInstruction T = TypeVar("T", bound="CreateMultiLegOrderRequest") diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py b/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py index 3b63d1a6b..6a0ce121e 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py @@ -23,9 +23,9 @@ class CreateMultiLegOrderRequestAlgo: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py b/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py index 139409e77..6e09d847c 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py @@ -23,9 +23,9 @@ class CreateMultiLegOrderRequestMarketCondition: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py b/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py index a692b2757..4fd71eee3 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py @@ -23,9 +23,9 @@ class CreateMultiLegOrderRequestOptionalData: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/create_order_cross_allocation.py b/openapi_project/openapi_package/models/create_order_cross_allocation.py index 172eb616e..0ef805111 100644 --- a/openapi_project/openapi_package/models/create_order_cross_allocation.py +++ b/openapi_project/openapi_package/models/create_order_cross_allocation.py @@ -13,10 +13,10 @@ from typing import cast if TYPE_CHECKING: - from ..models.clearing_info import ClearingInfo from ..models.create_order_cross_allocation_optional_data import ( CreateOrderCrossAllocationOptionalData, ) + from ..models.clearing_info import ClearingInfo from ..models.order_instruction import OrderInstruction diff --git a/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py b/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py index bcc35e30e..9bbdb5155 100644 --- a/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py +++ b/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py @@ -23,9 +23,9 @@ class CreateOrderCrossAllocationOptionalData: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/create_order_cross_request.py b/openapi_project/openapi_package/models/create_order_cross_request.py index 870f67c02..68b9e7bcb 100644 --- a/openapi_project/openapi_package/models/create_order_cross_request.py +++ b/openapi_project/openapi_package/models/create_order_cross_request.py @@ -14,16 +14,16 @@ from typing import cast if TYPE_CHECKING: - from ..models.create_order_cross_allocation import CreateOrderCrossAllocation - from ..models.flex_option import FlexOption from ..models.create_order_cross_request_market_condition import ( CreateOrderCrossRequestMarketCondition, ) from ..models.create_order_cross_request_algo import CreateOrderCrossRequestAlgo + from ..models.flex_option import FlexOption + from ..models.order_instruction import OrderInstruction from ..models.create_order_cross_request_optional_data import ( CreateOrderCrossRequestOptionalData, ) - from ..models.order_instruction import OrderInstruction + from ..models.create_order_cross_allocation import CreateOrderCrossAllocation T = TypeVar("T", bound="CreateOrderCrossRequest") diff --git a/openapi_project/openapi_package/models/create_order_cross_request_algo.py b/openapi_project/openapi_package/models/create_order_cross_request_algo.py index b33fe4e72..61c390236 100644 --- a/openapi_project/openapi_package/models/create_order_cross_request_algo.py +++ b/openapi_project/openapi_package/models/create_order_cross_request_algo.py @@ -23,9 +23,9 @@ class CreateOrderCrossRequestAlgo: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py b/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py index a68cf8059..f6ea9a14b 100644 --- a/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py +++ b/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py @@ -23,9 +23,9 @@ class CreateOrderCrossRequestMarketCondition: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py b/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py index 12c51b2b2..b30719717 100644 --- a/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py +++ b/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py @@ -23,9 +23,9 @@ class CreateOrderCrossRequestOptionalData: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/create_order_request.py b/openapi_project/openapi_package/models/create_order_request.py index 0b2294207..4ff614140 100644 --- a/openapi_project/openapi_package/models/create_order_request.py +++ b/openapi_project/openapi_package/models/create_order_request.py @@ -15,16 +15,16 @@ from typing import cast if TYPE_CHECKING: + from ..models.create_order_request_algo import CreateOrderRequestAlgo from ..models.clearing_info import ClearingInfo from ..models.flex_option import FlexOption - from ..models.create_order_request_algo import CreateOrderRequestAlgo + from ..models.order_instruction import OrderInstruction from ..models.create_order_request_optional_data import ( CreateOrderRequestOptionalData, ) from ..models.create_order_request_market_condition import ( CreateOrderRequestMarketCondition, ) - from ..models.order_instruction import OrderInstruction T = TypeVar("T", bound="CreateOrderRequest") diff --git a/openapi_project/openapi_package/models/create_order_request_algo.py b/openapi_project/openapi_package/models/create_order_request_algo.py index 215cf9f41..d25c1f546 100644 --- a/openapi_project/openapi_package/models/create_order_request_algo.py +++ b/openapi_project/openapi_package/models/create_order_request_algo.py @@ -23,9 +23,9 @@ class CreateOrderRequestAlgo: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/create_order_request_market_condition.py b/openapi_project/openapi_package/models/create_order_request_market_condition.py index 474a9e066..78c5cd1c9 100644 --- a/openapi_project/openapi_package/models/create_order_request_market_condition.py +++ b/openapi_project/openapi_package/models/create_order_request_market_condition.py @@ -23,9 +23,9 @@ class CreateOrderRequestMarketCondition: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/create_order_request_optional_data.py b/openapi_project/openapi_package/models/create_order_request_optional_data.py index 68330d7a6..1b5817f2d 100644 --- a/openapi_project/openapi_package/models/create_order_request_optional_data.py +++ b/openapi_project/openapi_package/models/create_order_request_optional_data.py @@ -23,9 +23,9 @@ class CreateOrderRequestOptionalData: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/crypto.py b/openapi_project/openapi_package/models/crypto.py index 2e51b9491..fe6b66913 100644 --- a/openapi_project/openapi_package/models/crypto.py +++ b/openapi_project/openapi_package/models/crypto.py @@ -14,8 +14,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.crypto_aliases import CryptoAliases from ..models.date import Date + from ..models.crypto_aliases import CryptoAliases T = TypeVar("T", bound="Crypto") diff --git a/openapi_project/openapi_package/models/crypto_aliases.py b/openapi_project/openapi_package/models/crypto_aliases.py index d2aba7275..be0d36c33 100644 --- a/openapi_project/openapi_package/models/crypto_aliases.py +++ b/openapi_project/openapi_package/models/crypto_aliases.py @@ -23,9 +23,9 @@ class CryptoAliases: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/execution.py b/openapi_project/openapi_package/models/execution.py index 115ed7db7..6996d077c 100644 --- a/openapi_project/openapi_package/models/execution.py +++ b/openapi_project/openapi_package/models/execution.py @@ -19,12 +19,12 @@ from typing import cast if TYPE_CHECKING: - from ..models.clearing_info import ClearingInfo - from ..models.header import Header from ..models.security import Security from ..models.execution_algo import ExecutionAlgo - from ..models.execution_optional_data import ExecutionOptionalData + from ..models.clearing_info import ClearingInfo from ..models.order_instruction import OrderInstruction + from ..models.execution_optional_data import ExecutionOptionalData + from ..models.header import Header T = TypeVar("T", bound="Execution") diff --git a/openapi_project/openapi_package/models/execution_algo.py b/openapi_project/openapi_package/models/execution_algo.py index e47d18405..7b2807aea 100644 --- a/openapi_project/openapi_package/models/execution_algo.py +++ b/openapi_project/openapi_package/models/execution_algo.py @@ -23,9 +23,9 @@ class ExecutionAlgo: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/execution_optional_data.py b/openapi_project/openapi_package/models/execution_optional_data.py index f954d3bf7..e4ef064a1 100644 --- a/openapi_project/openapi_package/models/execution_optional_data.py +++ b/openapi_project/openapi_package/models/execution_optional_data.py @@ -23,9 +23,9 @@ class ExecutionOptionalData: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/flex_option.py b/openapi_project/openapi_package/models/flex_option.py index 2c4244a57..6ebfcca3b 100644 --- a/openapi_project/openapi_package/models/flex_option.py +++ b/openapi_project/openapi_package/models/flex_option.py @@ -18,8 +18,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.flex_option_aliases import FlexOptionAliases from ..models.date import Date + from ..models.flex_option_aliases import FlexOptionAliases T = TypeVar("T", bound="FlexOption") diff --git a/openapi_project/openapi_package/models/flex_option_aliases.py b/openapi_project/openapi_package/models/flex_option_aliases.py index ab36bfa8f..c7010e3da 100644 --- a/openapi_project/openapi_package/models/flex_option_aliases.py +++ b/openapi_project/openapi_package/models/flex_option_aliases.py @@ -23,9 +23,9 @@ class FlexOptionAliases: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/future.py b/openapi_project/openapi_package/models/future.py index fbebf83a3..aeb0bfe6e 100644 --- a/openapi_project/openapi_package/models/future.py +++ b/openapi_project/openapi_package/models/future.py @@ -14,9 +14,9 @@ from typing import cast if TYPE_CHECKING: - from ..models.future_root import FutureRoot - from ..models.future_aliases import FutureAliases from ..models.date import Date + from ..models.future_aliases import FutureAliases + from ..models.future_root import FutureRoot T = TypeVar("T", bound="Future") diff --git a/openapi_project/openapi_package/models/future_aliases.py b/openapi_project/openapi_package/models/future_aliases.py index 861c6eae2..a72d370cd 100644 --- a/openapi_project/openapi_package/models/future_aliases.py +++ b/openapi_project/openapi_package/models/future_aliases.py @@ -23,9 +23,9 @@ class FutureAliases: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/future_root.py b/openapi_project/openapi_package/models/future_root.py index 48e974e29..aea2587fe 100644 --- a/openapi_project/openapi_package/models/future_root.py +++ b/openapi_project/openapi_package/models/future_root.py @@ -18,8 +18,8 @@ if TYPE_CHECKING: from ..models.future_root_aliases import FutureRootAliases - from ..models.date import Date from ..models.trading_session_group import TradingSessionGroup + from ..models.date import Date T = TypeVar("T", bound="FutureRoot") diff --git a/openapi_project/openapi_package/models/future_root_aliases.py b/openapi_project/openapi_package/models/future_root_aliases.py index 1c2a74e37..7ef172152 100644 --- a/openapi_project/openapi_package/models/future_root_aliases.py +++ b/openapi_project/openapi_package/models/future_root_aliases.py @@ -23,9 +23,9 @@ class FutureRootAliases: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/future_spread.py b/openapi_project/openapi_package/models/future_spread.py index b7dcf7a14..9410ff1e7 100644 --- a/openapi_project/openapi_package/models/future_spread.py +++ b/openapi_project/openapi_package/models/future_spread.py @@ -14,9 +14,9 @@ from typing import cast if TYPE_CHECKING: + from ..models.future_spread_aliases import FutureSpreadAliases from ..models.date import Date from ..models.future_spread_leg import FutureSpreadLeg - from ..models.future_spread_aliases import FutureSpreadAliases T = TypeVar("T", bound="FutureSpread") diff --git a/openapi_project/openapi_package/models/future_spread_aliases.py b/openapi_project/openapi_package/models/future_spread_aliases.py index 65cbcf023..c62532657 100644 --- a/openapi_project/openapi_package/models/future_spread_aliases.py +++ b/openapi_project/openapi_package/models/future_spread_aliases.py @@ -23,9 +23,9 @@ class FutureSpreadAliases: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/fx.py b/openapi_project/openapi_package/models/fx.py index 4519db7c8..2cd8d52bc 100644 --- a/openapi_project/openapi_package/models/fx.py +++ b/openapi_project/openapi_package/models/fx.py @@ -14,8 +14,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.date import Date from ..models.fx_aliases import FxAliases + from ..models.date import Date T = TypeVar("T", bound="Fx") diff --git a/openapi_project/openapi_package/models/fx_aliases.py b/openapi_project/openapi_package/models/fx_aliases.py index 1452e16d8..5e2e7fb7d 100644 --- a/openapi_project/openapi_package/models/fx_aliases.py +++ b/openapi_project/openapi_package/models/fx_aliases.py @@ -23,9 +23,9 @@ class FxAliases: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/generic_order.py b/openapi_project/openapi_package/models/generic_order.py index c443c983a..9c69e5c12 100644 --- a/openapi_project/openapi_package/models/generic_order.py +++ b/openapi_project/openapi_package/models/generic_order.py @@ -10,8 +10,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.order import Order from ..models.multi_leg_order_cross import MultiLegOrderCross + from ..models.order import Order from ..models.multi_leg_order import MultiLegOrder from ..models.order_cross import OrderCross diff --git a/openapi_project/openapi_package/models/get_server_info_response_system_settings.py b/openapi_project/openapi_package/models/get_server_info_response_system_settings.py index 717b00d91..a7c52b744 100644 --- a/openapi_project/openapi_package/models/get_server_info_response_system_settings.py +++ b/openapi_project/openapi_package/models/get_server_info_response_system_settings.py @@ -23,9 +23,9 @@ class GetServerInfoResponseSystemSettings: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/index.py b/openapi_project/openapi_package/models/index.py index 0c40dd5fa..7d0b313bc 100644 --- a/openapi_project/openapi_package/models/index.py +++ b/openapi_project/openapi_package/models/index.py @@ -14,8 +14,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.index_aliases import IndexAliases from ..models.date import Date + from ..models.index_aliases import IndexAliases T = TypeVar("T", bound="Index") diff --git a/openapi_project/openapi_package/models/index_aliases.py b/openapi_project/openapi_package/models/index_aliases.py index d8d60d2d6..c65141cbe 100644 --- a/openapi_project/openapi_package/models/index_aliases.py +++ b/openapi_project/openapi_package/models/index_aliases.py @@ -23,9 +23,9 @@ class IndexAliases: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/login_response_system_settings.py b/openapi_project/openapi_package/models/login_response_system_settings.py index 3f9eae216..b9c026dc6 100644 --- a/openapi_project/openapi_package/models/login_response_system_settings.py +++ b/openapi_project/openapi_package/models/login_response_system_settings.py @@ -23,9 +23,9 @@ class LoginResponseSystemSettings: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/multi_leg_order.py b/openapi_project/openapi_package/models/multi_leg_order.py index 848fc025f..843bd4458 100644 --- a/openapi_project/openapi_package/models/multi_leg_order.py +++ b/openapi_project/openapi_package/models/multi_leg_order.py @@ -16,13 +16,13 @@ if TYPE_CHECKING: from ..models.clearing_info import ClearingInfo - from ..models.multi_leg_order_leg import MultiLegOrderLeg - from ..models.order_update_event import OrderUpdateEvent from ..models.multi_leg_order_market_condition import MultiLegOrderMarketCondition - from ..models.multi_leg_order_optional_data import MultiLegOrderOptionalData - from ..models.header import Header from ..models.multi_leg_order_algo import MultiLegOrderAlgo from ..models.order_instruction import OrderInstruction + from ..models.order_update_event import OrderUpdateEvent + from ..models.multi_leg_order_leg import MultiLegOrderLeg + from ..models.multi_leg_order_optional_data import MultiLegOrderOptionalData + from ..models.header import Header T = TypeVar("T", bound="MultiLegOrder") diff --git a/openapi_project/openapi_package/models/multi_leg_order_algo.py b/openapi_project/openapi_package/models/multi_leg_order_algo.py index a6eff4f2c..4a1e0201f 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_algo.py +++ b/openapi_project/openapi_package/models/multi_leg_order_algo.py @@ -23,9 +23,9 @@ class MultiLegOrderAlgo: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py index a82a8c73a..2e2330e5e 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py @@ -15,18 +15,18 @@ from typing import cast if TYPE_CHECKING: + from ..models.multi_leg_order_cancel_replace_request_algo import ( + MultiLegOrderCancelReplaceRequestAlgo, + ) from ..models.clearing_info import ClearingInfo from ..models.multi_leg_order_cancel_replace_request_market_condition import ( MultiLegOrderCancelReplaceRequestMarketCondition, ) - from ..models.multi_leg_order_cancel_replace_request_algo import ( - MultiLegOrderCancelReplaceRequestAlgo, - ) - from ..models.header import Header + from ..models.order_instruction import OrderInstruction from ..models.multi_leg_order_cancel_replace_request_optional_data import ( MultiLegOrderCancelReplaceRequestOptionalData, ) - from ..models.order_instruction import OrderInstruction + from ..models.header import Header T = TypeVar("T", bound="MultiLegOrderCancelReplaceRequest") diff --git a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py index 8c62b2f19..05993cc3e 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py @@ -23,9 +23,9 @@ class MultiLegOrderCancelReplaceRequestAlgo: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py index c5672350b..60af45151 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py @@ -23,9 +23,9 @@ class MultiLegOrderCancelReplaceRequestMarketCondition: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py index de72ce105..9d8849f57 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py @@ -23,9 +23,9 @@ class MultiLegOrderCancelReplaceRequestOptionalData: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross.py b/openapi_project/openapi_package/models/multi_leg_order_cross.py index 95d9e2269..54c3cf78a 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross.py @@ -22,11 +22,11 @@ from ..models.multi_leg_order_cross_optional_data import ( MultiLegOrderCrossOptionalData, ) - from ..models.order_update_event import OrderUpdateEvent from ..models.multi_leg_order_cross_algo import MultiLegOrderCrossAlgo - from ..models.multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation - from ..models.header import Header from ..models.order_instruction import OrderInstruction + from ..models.order_update_event import OrderUpdateEvent + from ..models.header import Header + from ..models.multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation T = TypeVar("T", bound="MultiLegOrderCross") diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py b/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py index 5d58a0d35..babb4a6e0 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py @@ -23,9 +23,9 @@ class MultiLegOrderCrossAlgo: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py index 3e8e83d7f..5cdd0c622 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py @@ -12,11 +12,11 @@ from typing import cast if TYPE_CHECKING: - from ..models.clearing_info import ClearingInfo + from ..models.multi_leg_order_leg import MultiLegOrderLeg from ..models.multi_leg_order_cross_allocation_optional_data import ( MultiLegOrderCrossAllocationOptionalData, ) - from ..models.multi_leg_order_leg import MultiLegOrderLeg + from ..models.clearing_info import ClearingInfo from ..models.order_instruction import OrderInstruction diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py index f499944d6..01a1b17f9 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py @@ -23,9 +23,9 @@ class MultiLegOrderCrossAllocationOptionalData: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py b/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py index c32c4c564..e025b2919 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py @@ -23,9 +23,9 @@ class MultiLegOrderCrossMarketCondition: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py index d5da6fa0f..1e04e1d0a 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py @@ -23,9 +23,9 @@ class MultiLegOrderCrossOptionalData: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/multi_leg_order_leg.py b/openapi_project/openapi_package/models/multi_leg_order_leg.py index 6efc95c2c..408d4a4cf 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_leg.py +++ b/openapi_project/openapi_package/models/multi_leg_order_leg.py @@ -12,11 +12,11 @@ from typing import cast if TYPE_CHECKING: + from ..models.security import Security from ..models.multi_leg_order_leg_market_condition import ( MultiLegOrderLegMarketCondition, ) from ..models.multi_leg_order_leg_optional_data import MultiLegOrderLegOptionalData - from ..models.security import Security from ..models.order_update_event import OrderUpdateEvent diff --git a/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py b/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py index e5b8afd10..7ab294fce 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py +++ b/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py @@ -23,9 +23,9 @@ class MultiLegOrderLegMarketCondition: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py index 285f0763e..d7637cd21 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py +++ b/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py @@ -23,9 +23,9 @@ class MultiLegOrderLegOptionalData: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/multi_leg_order_market_condition.py b/openapi_project/openapi_package/models/multi_leg_order_market_condition.py index 3278813cd..e201bcf2b 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_market_condition.py +++ b/openapi_project/openapi_package/models/multi_leg_order_market_condition.py @@ -23,9 +23,9 @@ class MultiLegOrderMarketCondition: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/multi_leg_order_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_optional_data.py index 755b9d3c4..d62a58844 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_optional_data.py +++ b/openapi_project/openapi_package/models/multi_leg_order_optional_data.py @@ -23,9 +23,9 @@ class MultiLegOrderOptionalData: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/option.py b/openapi_project/openapi_package/models/option.py index 29d78ca25..d5624e70a 100644 --- a/openapi_project/openapi_package/models/option.py +++ b/openapi_project/openapi_package/models/option.py @@ -16,9 +16,9 @@ from typing import cast if TYPE_CHECKING: - from ..models.option_aliases import OptionAliases from ..models.option_root import OptionRoot from ..models.date import Date + from ..models.option_aliases import OptionAliases T = TypeVar("T", bound="Option") diff --git a/openapi_project/openapi_package/models/option_aliases.py b/openapi_project/openapi_package/models/option_aliases.py index 973d0bde5..382c8f834 100644 --- a/openapi_project/openapi_package/models/option_aliases.py +++ b/openapi_project/openapi_package/models/option_aliases.py @@ -23,9 +23,9 @@ class OptionAliases: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/option_chain.py b/openapi_project/openapi_package/models/option_chain.py index 0c84f911a..4c043ec3a 100644 --- a/openapi_project/openapi_package/models/option_chain.py +++ b/openapi_project/openapi_package/models/option_chain.py @@ -10,10 +10,10 @@ from typing import cast if TYPE_CHECKING: - from ..models.option_chain_roots import OptionChainRoots from ..models.security import Security - from ..models.option_chain_options import OptionChainOptions from ..models.option_series import OptionSeries + from ..models.option_chain_options import OptionChainOptions + from ..models.option_chain_roots import OptionChainRoots T = TypeVar("T", bound="OptionChain") diff --git a/openapi_project/openapi_package/models/option_chain_option.py b/openapi_project/openapi_package/models/option_chain_option.py index 276ec00f4..123a4579d 100644 --- a/openapi_project/openapi_package/models/option_chain_option.py +++ b/openapi_project/openapi_package/models/option_chain_option.py @@ -12,8 +12,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.date import Date from ..models.option_chain_option_aliases import OptionChainOptionAliases + from ..models.date import Date T = TypeVar("T", bound="OptionChainOption") diff --git a/openapi_project/openapi_package/models/option_chain_option_aliases.py b/openapi_project/openapi_package/models/option_chain_option_aliases.py index 70e59c791..b2f44e5ec 100644 --- a/openapi_project/openapi_package/models/option_chain_option_aliases.py +++ b/openapi_project/openapi_package/models/option_chain_option_aliases.py @@ -23,9 +23,9 @@ class OptionChainOptionAliases: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/option_chain_options.py b/openapi_project/openapi_package/models/option_chain_options.py index 7b9cc3d97..3a8c0e4a2 100644 --- a/openapi_project/openapi_package/models/option_chain_options.py +++ b/openapi_project/openapi_package/models/option_chain_options.py @@ -26,8 +26,12 @@ class OptionChainOptions: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() + field_dict.update( + { + prop_name: prop.to_dict() + for prop_name, prop in self.additional_properties.items() + } + ) return field_dict diff --git a/openapi_project/openapi_package/models/option_chain_roots.py b/openapi_project/openapi_package/models/option_chain_roots.py index d0631a3ad..a5c411850 100644 --- a/openapi_project/openapi_package/models/option_chain_roots.py +++ b/openapi_project/openapi_package/models/option_chain_roots.py @@ -26,8 +26,12 @@ class OptionChainRoots: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() + field_dict.update( + { + prop_name: prop.to_dict() + for prop_name, prop in self.additional_properties.items() + } + ) return field_dict diff --git a/openapi_project/openapi_package/models/option_root.py b/openapi_project/openapi_package/models/option_root.py index ed10f5510..3e746f81f 100644 --- a/openapi_project/openapi_package/models/option_root.py +++ b/openapi_project/openapi_package/models/option_root.py @@ -18,10 +18,10 @@ from typing import cast if TYPE_CHECKING: - from ..models.option_root_aliases import OptionRootAliases from ..models.settlement_info import SettlementInfo - from ..models.date import Date from ..models.trading_session_group import TradingSessionGroup + from ..models.date import Date + from ..models.option_root_aliases import OptionRootAliases T = TypeVar("T", bound="OptionRoot") diff --git a/openapi_project/openapi_package/models/option_root_aliases.py b/openapi_project/openapi_package/models/option_root_aliases.py index e87429cce..ef07f77e6 100644 --- a/openapi_project/openapi_package/models/option_root_aliases.py +++ b/openapi_project/openapi_package/models/option_root_aliases.py @@ -23,9 +23,9 @@ class OptionRootAliases: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/order.py b/openapi_project/openapi_package/models/order.py index db8734e5b..0b12d7a2b 100644 --- a/openapi_project/openapi_package/models/order.py +++ b/openapi_project/openapi_package/models/order.py @@ -17,14 +17,14 @@ from typing import cast if TYPE_CHECKING: + from ..models.security import Security from ..models.clearing_info import ClearingInfo + from ..models.order_algo import OrderAlgo + from ..models.order_instruction import OrderInstruction from ..models.order_optional_data import OrderOptionalData from ..models.order_update_event import OrderUpdateEvent - from ..models.order_algo import OrderAlgo - from ..models.header import Header - from ..models.security import Security from ..models.order_market_condition import OrderMarketCondition - from ..models.order_instruction import OrderInstruction + from ..models.header import Header T = TypeVar("T", bound="Order") diff --git a/openapi_project/openapi_package/models/order_algo.py b/openapi_project/openapi_package/models/order_algo.py index 9458a992f..3b6cfe7aa 100644 --- a/openapi_project/openapi_package/models/order_algo.py +++ b/openapi_project/openapi_package/models/order_algo.py @@ -23,9 +23,9 @@ class OrderAlgo: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py b/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py index fb270c29c..19fafac5c 100644 --- a/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py +++ b/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py @@ -23,9 +23,9 @@ class OrderCancelRejectOptionalData: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/order_cancel_replace_request.py b/openapi_project/openapi_package/models/order_cancel_replace_request.py index 5407ee7ef..57be5c08b 100644 --- a/openapi_project/openapi_package/models/order_cancel_replace_request.py +++ b/openapi_project/openapi_package/models/order_cancel_replace_request.py @@ -15,16 +15,16 @@ from typing import cast if TYPE_CHECKING: - from ..models.clearing_info import ClearingInfo - from ..models.header import Header + from ..models.order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo from ..models.order_cancel_replace_request_market_condition import ( OrderCancelReplaceRequestMarketCondition, ) - from ..models.order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo + from ..models.clearing_info import ClearingInfo from ..models.order_cancel_replace_request_optional_data import ( OrderCancelReplaceRequestOptionalData, ) from ..models.order_instruction import OrderInstruction + from ..models.header import Header T = TypeVar("T", bound="OrderCancelReplaceRequest") diff --git a/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py b/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py index 76c8e05e7..6907076e1 100644 --- a/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py +++ b/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py @@ -23,9 +23,9 @@ class OrderCancelReplaceRequestAlgo: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py b/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py index 885283c8d..92e2ca361 100644 --- a/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py +++ b/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py @@ -23,9 +23,9 @@ class OrderCancelReplaceRequestMarketCondition: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py b/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py index 6e5db2c4d..6b0ecbb05 100644 --- a/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py +++ b/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py @@ -23,9 +23,9 @@ class OrderCancelReplaceRequestOptionalData: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/order_cancel_request_optional_data.py b/openapi_project/openapi_package/models/order_cancel_request_optional_data.py index 3bb9ef289..0fe708dfe 100644 --- a/openapi_project/openapi_package/models/order_cancel_request_optional_data.py +++ b/openapi_project/openapi_package/models/order_cancel_request_optional_data.py @@ -23,9 +23,9 @@ class OrderCancelRequestOptionalData: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/order_cross.py b/openapi_project/openapi_package/models/order_cross.py index d4b0f59e2..45d4c625f 100644 --- a/openapi_project/openapi_package/models/order_cross.py +++ b/openapi_project/openapi_package/models/order_cross.py @@ -17,13 +17,13 @@ if TYPE_CHECKING: from ..models.order_cross_market_condition import OrderCrossMarketCondition - from ..models.order_update_event import OrderUpdateEvent - from ..models.order_cross_allocation import OrderCrossAllocation - from ..models.header import Header from ..models.security import Security - from ..models.order_cross_optional_data import OrderCrossOptionalData + from ..models.order_cross_allocation import OrderCrossAllocation from ..models.order_cross_algo import OrderCrossAlgo + from ..models.order_cross_optional_data import OrderCrossOptionalData from ..models.order_instruction import OrderInstruction + from ..models.order_update_event import OrderUpdateEvent + from ..models.header import Header T = TypeVar("T", bound="OrderCross") diff --git a/openapi_project/openapi_package/models/order_cross_algo.py b/openapi_project/openapi_package/models/order_cross_algo.py index 599a072f2..1edab61d7 100644 --- a/openapi_project/openapi_package/models/order_cross_algo.py +++ b/openapi_project/openapi_package/models/order_cross_algo.py @@ -23,9 +23,9 @@ class OrderCrossAlgo: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/order_cross_allocation.py b/openapi_project/openapi_package/models/order_cross_allocation.py index 59a75c12c..a98907bfa 100644 --- a/openapi_project/openapi_package/models/order_cross_allocation.py +++ b/openapi_project/openapi_package/models/order_cross_allocation.py @@ -14,11 +14,11 @@ from typing import cast if TYPE_CHECKING: + from ..models.clearing_info import ClearingInfo + from ..models.order_instruction import OrderInstruction from ..models.order_cross_allocation_optional_data import ( OrderCrossAllocationOptionalData, ) - from ..models.clearing_info import ClearingInfo - from ..models.order_instruction import OrderInstruction T = TypeVar("T", bound="OrderCrossAllocation") diff --git a/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py b/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py index 39b73a07b..bb5994689 100644 --- a/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py +++ b/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py @@ -23,9 +23,9 @@ class OrderCrossAllocationOptionalData: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/order_cross_market_condition.py b/openapi_project/openapi_package/models/order_cross_market_condition.py index 6db3bd8d2..a01b551fd 100644 --- a/openapi_project/openapi_package/models/order_cross_market_condition.py +++ b/openapi_project/openapi_package/models/order_cross_market_condition.py @@ -23,9 +23,9 @@ class OrderCrossMarketCondition: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/order_cross_optional_data.py b/openapi_project/openapi_package/models/order_cross_optional_data.py index 6508ef6d5..f6d455aa5 100644 --- a/openapi_project/openapi_package/models/order_cross_optional_data.py +++ b/openapi_project/openapi_package/models/order_cross_optional_data.py @@ -23,9 +23,9 @@ class OrderCrossOptionalData: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/order_delete_optional_data.py b/openapi_project/openapi_package/models/order_delete_optional_data.py index 9f508b88f..e39e4ba67 100644 --- a/openapi_project/openapi_package/models/order_delete_optional_data.py +++ b/openapi_project/openapi_package/models/order_delete_optional_data.py @@ -23,9 +23,9 @@ class OrderDeleteOptionalData: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/order_market_condition.py b/openapi_project/openapi_package/models/order_market_condition.py index 0d7bcb58d..bae0ee338 100644 --- a/openapi_project/openapi_package/models/order_market_condition.py +++ b/openapi_project/openapi_package/models/order_market_condition.py @@ -23,9 +23,9 @@ class OrderMarketCondition: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/order_optional_data.py b/openapi_project/openapi_package/models/order_optional_data.py index a10ac96a1..79b9dd6bf 100644 --- a/openapi_project/openapi_package/models/order_optional_data.py +++ b/openapi_project/openapi_package/models/order_optional_data.py @@ -23,9 +23,9 @@ class OrderOptionalData: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/order_update.py b/openapi_project/openapi_package/models/order_update.py index 9fa33b3a6..dcd7db713 100644 --- a/openapi_project/openapi_package/models/order_update.py +++ b/openapi_project/openapi_package/models/order_update.py @@ -19,12 +19,12 @@ from typing import cast if TYPE_CHECKING: - from ..models.clearing_info import ClearingInfo - from ..models.header import Header from ..models.order_update_optional_data import OrderUpdateOptionalData from ..models.security import Security from ..models.order_update_algo import OrderUpdateAlgo + from ..models.clearing_info import ClearingInfo from ..models.order_instruction import OrderInstruction + from ..models.header import Header T = TypeVar("T", bound="OrderUpdate") diff --git a/openapi_project/openapi_package/models/order_update_algo.py b/openapi_project/openapi_package/models/order_update_algo.py index c24c4055c..09d906f34 100644 --- a/openapi_project/openapi_package/models/order_update_algo.py +++ b/openapi_project/openapi_package/models/order_update_algo.py @@ -23,9 +23,9 @@ class OrderUpdateAlgo: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/order_update_event.py b/openapi_project/openapi_package/models/order_update_event.py index 353f1455b..40464be70 100644 --- a/openapi_project/openapi_package/models/order_update_event.py +++ b/openapi_project/openapi_package/models/order_update_event.py @@ -10,14 +10,14 @@ from typing import cast if TYPE_CHECKING: - from ..models.order_update import OrderUpdate from ..models.multi_leg_order_cancel_replace_request import ( MultiLegOrderCancelReplaceRequest, ) - from ..models.order_delete import OrderDelete - from ..models.order_cancel_request import OrderCancelRequest from ..models.order_cancel_reject import OrderCancelReject + from ..models.order_delete import OrderDelete + from ..models.order_update import OrderUpdate from ..models.execution import Execution + from ..models.order_cancel_request import OrderCancelRequest from ..models.order_cancel_replace_request import OrderCancelReplaceRequest diff --git a/openapi_project/openapi_package/models/order_update_optional_data.py b/openapi_project/openapi_package/models/order_update_optional_data.py index 46ae93506..da6282409 100644 --- a/openapi_project/openapi_package/models/order_update_optional_data.py +++ b/openapi_project/openapi_package/models/order_update_optional_data.py @@ -23,9 +23,9 @@ class OrderUpdateOptionalData: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/risk_radar_account_group.py b/openapi_project/openapi_package/models/risk_radar_account_group.py index bc3b115ee..29f1582ea 100644 --- a/openapi_project/openapi_package/models/risk_radar_account_group.py +++ b/openapi_project/openapi_package/models/risk_radar_account_group.py @@ -11,8 +11,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.shock_value import ShockValue from ..models.risk_radar_product_group import RiskRadarProductGroup + from ..models.shock_value import ShockValue T = TypeVar("T", bound="RiskRadarAccountGroup") diff --git a/openapi_project/openapi_package/models/scenario.py b/openapi_project/openapi_package/models/scenario.py index 1dc034372..a4c9758ef 100644 --- a/openapi_project/openapi_package/models/scenario.py +++ b/openapi_project/openapi_package/models/scenario.py @@ -10,8 +10,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.scenario_position import ScenarioPosition from ..models.scenario_leg import ScenarioLeg + from ..models.scenario_position import ScenarioPosition T = TypeVar("T", bound="Scenario") diff --git a/openapi_project/openapi_package/models/security.py b/openapi_project/openapi_package/models/security.py index caf58e588..1333fbfef 100644 --- a/openapi_project/openapi_package/models/security.py +++ b/openapi_project/openapi_package/models/security.py @@ -10,16 +10,16 @@ from typing import cast if TYPE_CHECKING: - from ..models.fx import Fx - from ..models.future_spread import FutureSpread - from ..models.flex_option import FlexOption - from ..models.stock import Stock + from ..models.future import Future from ..models.option_root import OptionRoot from ..models.crypto import Crypto - from ..models.future import Future + from ..models.fx import Fx + from ..models.stock import Stock + from ..models.flex_option import FlexOption + from ..models.future_spread import FutureSpread + from ..models.option import Option from ..models.index import Index from ..models.future_root import FutureRoot - from ..models.option import Option T = TypeVar("T", bound="Security") diff --git a/openapi_project/openapi_package/models/stock_aliases.py b/openapi_project/openapi_package/models/stock_aliases.py index dbe6fd7fa..47650fde3 100644 --- a/openapi_project/openapi_package/models/stock_aliases.py +++ b/openapi_project/openapi_package/models/stock_aliases.py @@ -23,9 +23,9 @@ class StockAliases: def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - - field_dict[prop_name] = prop + field_dict.update( + {prop_name: prop for prop_name, prop in self.additional_properties.items()} + ) return field_dict diff --git a/openapi_project/openapi_package/models/tims_margin_data.py b/openapi_project/openapi_package/models/tims_margin_data.py index c7a7cb51d..6f647d205 100644 --- a/openapi_project/openapi_package/models/tims_margin_data.py +++ b/openapi_project/openapi_package/models/tims_margin_data.py @@ -11,8 +11,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.tims_product_group import TimsProductGroup from ..models.tims_class_group import TimsClassGroup + from ..models.tims_product_group import TimsProductGroup T = TypeVar("T", bound="TimsMarginData") diff --git a/openapi_python_client/templates/model.py.jinja b/openapi_python_client/templates/model.py.jinja index 94e504004..cc4179ade 100644 --- a/openapi_python_client/templates/model.py.jinja +++ b/openapi_python_client/templates/model.py.jinja @@ -111,8 +111,10 @@ field_dict: dict[str, Any] = {} {% if model.additional_properties %} {% import "property_templates/" + model.additional_properties.template as prop_template %} {% if prop_template.transform %} -for prop_name, prop in self.additional_properties.items(): - {{ prop_template.transform(model.additional_properties, "prop", "field_dict[prop_name]", declare_type=false) | indent(4) }} +field_dict.update({ + prop_name: {{ prop_template.transform_expression(model.additional_properties, "prop") if prop_template.transform_expression else "prop" }} + for prop_name, prop in self.additional_properties.items() +}) {% else %} field_dict.update({ prop_name: prop diff --git a/openapi_python_client/templates/property_templates/date_property.py.jinja b/openapi_python_client/templates/property_templates/date_property.py.jinja index 726cbe604..d683629a1 100644 --- a/openapi_python_client/templates/property_templates/date_property.py.jinja +++ b/openapi_python_client/templates/property_templates/date_property.py.jinja @@ -24,6 +24,10 @@ isoparse({{ source }}).date() {%- endif %} {% endmacro %} +{% macro transform_expression(property, source) %} +{{ source }}.isoformat() +{% endmacro %} + {% macro multipart(property, source, name) %} files.append(({{ name }}, (None, {{ source }}.isoformat().encode(), "text/plain"))) {% endmacro %} diff --git a/openapi_python_client/templates/property_templates/datetime_property.py.jinja b/openapi_python_client/templates/property_templates/datetime_property.py.jinja index 795fe388d..7bc34448e 100644 --- a/openapi_python_client/templates/property_templates/datetime_property.py.jinja +++ b/openapi_python_client/templates/property_templates/datetime_property.py.jinja @@ -24,6 +24,10 @@ isoparse({{ source }}) {%- endif %} {% endmacro %} +{% macro transform_expression(property, source) %} +{{ source }}.isoformat() +{% endmacro %} + {% macro multipart(property, source, name) %} files.append(({{ name }}, (None, {{ source }}.isoformat().encode(), "text/plain"))) {% endmacro %} diff --git a/openapi_python_client/templates/property_templates/enum_property.py.jinja b/openapi_python_client/templates/property_templates/enum_property.py.jinja index ecc2271af..58d9fe77b 100644 --- a/openapi_python_client/templates/property_templates/enum_property.py.jinja +++ b/openapi_python_client/templates/property_templates/enum_property.py.jinja @@ -20,6 +20,10 @@ {% endif %} {% endmacro %} +{% macro transform_expression(property, source) %} +{{ source }}.value +{% endmacro %} + {% macro multipart(property, source, name) %} files.append(({{ name }}, (None, str({{ source }}.value).encode(), "text/plain"))) {% endmacro %} diff --git a/openapi_python_client/templates/property_templates/file_property.py.jinja b/openapi_python_client/templates/property_templates/file_property.py.jinja index ba3b6f358..8856dcdf1 100644 --- a/openapi_python_client/templates/property_templates/file_property.py.jinja +++ b/openapi_python_client/templates/property_templates/file_property.py.jinja @@ -20,6 +20,10 @@ File( {% endif %} {% endmacro %} +{% macro transform_expression(property, source) %} +{{ source }}.to_tuple() +{% endmacro %} + {% macro multipart(property, source, name) %} files.append(({{ name }}, {{ source }}.to_tuple())) {% endmacro %} diff --git a/openapi_python_client/templates/property_templates/list_property.py.jinja b/openapi_python_client/templates/property_templates/list_property.py.jinja index 785d0b675..f583b2db4 100644 --- a/openapi_python_client/templates/property_templates/list_property.py.jinja +++ b/openapi_python_client/templates/property_templates/list_property.py.jinja @@ -45,6 +45,19 @@ if not isinstance({{ source }}, Unset): {% endif %} {% endmacro %} +{% macro transform_expression(property, source) %} +{% set inner_property = property.inner_property %} +{% import "property_templates/" + inner_property.template as inner_template %} +{% if inner_template.transform_expression %} +[ + {{ inner_template.transform_expression(inner_property, inner_property.python_name + "_item") }} + for {{ inner_property.python_name }}_item in {{ source }} +] +{% else %} +{{ source }} +{% endif %} +{% endmacro %} + {% macro multipart(property, source, destination) %} {% set inner_property = property.inner_property %} {% import "property_templates/" + inner_property.template as inner_template %} diff --git a/openapi_python_client/templates/property_templates/literal_enum_property.py.jinja b/openapi_python_client/templates/property_templates/literal_enum_property.py.jinja index 3e4b2101d..50ccfe13b 100644 --- a/openapi_python_client/templates/property_templates/literal_enum_property.py.jinja +++ b/openapi_python_client/templates/property_templates/literal_enum_property.py.jinja @@ -19,6 +19,10 @@ check_{{ property.get_class_name_snake_case() }}({{ source }}) {% endif %} {% endmacro %} +{% macro transform_expression(property, source) %} +{{ source }} +{% endmacro %} + {% macro multipart(property, source, name) %} files.append(({{ name }}, (None, str({{ source }}).encode(), "text/plain"))) {% endmacro %} diff --git a/openapi_python_client/templates/property_templates/model_property.py.jinja b/openapi_python_client/templates/property_templates/model_property.py.jinja index 827435abd..a2c845352 100644 --- a/openapi_python_client/templates/property_templates/model_property.py.jinja +++ b/openapi_python_client/templates/property_templates/model_property.py.jinja @@ -20,6 +20,10 @@ {%- endif %} {% endmacro %} +{% macro transform_expression(property, source) %} +{{ source }}.to_dict() +{% endmacro %} + {% macro transform_multipart_body(property) %} {% set transformed = property.python_name + ".to_multipart()" %} {% if property.required %} diff --git a/openapi_python_client/templates/property_templates/union_property.py.jinja b/openapi_python_client/templates/property_templates/union_property.py.jinja index 09b6e6e09..9c897a95f 100644 --- a/openapi_python_client/templates/property_templates/union_property.py.jinja +++ b/openapi_python_client/templates/property_templates/union_property.py.jinja @@ -100,3 +100,7 @@ else: {{ inner_template.multipart(inner_property, source, destination) | indent(4) | trim }} {%- endfor -%} {% endmacro %} + +{% macro transform_expression(property, source) %} +{{ source }} +{% endmacro %} diff --git a/openapi_python_client/templates/property_templates/uuid_property.py.jinja b/openapi_python_client/templates/property_templates/uuid_property.py.jinja index 7d58d8492..2cc35f98d 100644 --- a/openapi_python_client/templates/property_templates/uuid_property.py.jinja +++ b/openapi_python_client/templates/property_templates/uuid_property.py.jinja @@ -24,6 +24,10 @@ UUID({{ source }}) {%- endif %} {% endmacro %} +{% macro transform_expression(property, source) %} +str({{ source }}) +{% endmacro %} + {% macro multipart(property, source, name) %} files.append(({{ name }}, (None, str({{ source }}), "text/plain")) {% endmacro %} From 9fc84982704c4dc54f09a9ce8b92b50c064f3051 Mon Sep 17 00:00:00 2001 From: Itay Bavly Date: Wed, 20 Aug 2025 13:53:58 -0400 Subject: [PATCH 05/16] gen --- openapi/templates/model.py.jinja | 4 ++-- .../openapi_package/models/cancel_order_request.py | 2 +- .../models/cancel_replace_multi_leg_order_request.py | 8 ++++---- .../models/cancel_replace_order_request.py | 10 +++++----- .../create_multi_leg_order_cross_allocation.py | 2 +- .../models/create_multi_leg_order_cross_request.py | 6 +++--- .../models/create_multi_leg_order_leg.py | 6 +++--- .../models/create_multi_leg_order_request.py | 8 ++++---- .../models/create_order_cross_allocation.py | 2 +- .../models/create_order_cross_request.py | 6 +++--- .../openapi_package/models/create_order_request.py | 8 ++++---- openapi_project/openapi_package/models/execution.py | 6 +++--- .../openapi_package/models/future_root.py | 2 +- .../openapi_package/models/future_spread.py | 4 ++-- .../openapi_package/models/generic_order.py | 4 ++-- .../openapi_package/models/multi_leg_order.py | 8 ++++---- .../models/multi_leg_order_cancel_replace_request.py | 12 ++++++------ .../openapi_package/models/multi_leg_order_cross.py | 10 +++++----- .../models/multi_leg_order_cross_allocation.py | 2 +- .../openapi_package/models/multi_leg_order_leg.py | 2 +- .../openapi_package/models/option_chain.py | 2 +- .../openapi_package/models/option_root.py | 4 ++-- openapi_project/openapi_package/models/order.py | 8 ++++---- .../models/order_cancel_replace_request.py | 6 +++--- .../openapi_package/models/order_cancel_request.py | 2 +- .../openapi_package/models/order_cross.py | 10 +++++----- .../openapi_package/models/order_cross_allocation.py | 4 ++-- .../openapi_package/models/order_update.py | 6 +++--- .../openapi_package/models/order_update_event.py | 8 ++++---- openapi_project/openapi_package/models/security.py | 12 ++++++------ openapi_python_client/templates/model.py.jinja | 4 ++-- 31 files changed, 89 insertions(+), 89 deletions(-) diff --git a/openapi/templates/model.py.jinja b/openapi/templates/model.py.jinja index cc4179ade..4292e6204 100644 --- a/openapi/templates/model.py.jinja +++ b/openapi/templates/model.py.jinja @@ -114,12 +114,12 @@ field_dict: dict[str, Any] = {} field_dict.update({ prop_name: {{ prop_template.transform_expression(model.additional_properties, "prop") if prop_template.transform_expression else "prop" }} for prop_name, prop in self.additional_properties.items() -}) +}) # noqa: PERF403 {% else %} field_dict.update({ prop_name: prop for prop_name, prop in self.additional_properties.items() -}) +}) # noqa: PERF403 {%- endif -%} {%- endif -%} {% endmacro %} diff --git a/openapi_project/openapi_package/models/cancel_order_request.py b/openapi_project/openapi_package/models/cancel_order_request.py index dbd0ebba2..bc6f59b05 100644 --- a/openapi_project/openapi_package/models/cancel_order_request.py +++ b/openapi_project/openapi_package/models/cancel_order_request.py @@ -10,10 +10,10 @@ from typing import cast if TYPE_CHECKING: + from ..models.order_instruction import OrderInstruction from ..models.cancel_order_request_optional_data import ( CancelOrderRequestOptionalData, ) - from ..models.order_instruction import OrderInstruction T = TypeVar("T", bound="CancelOrderRequest") diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py index 8237130fd..d93fa3096 100644 --- a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py +++ b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py @@ -12,17 +12,17 @@ from typing import cast if TYPE_CHECKING: - from ..models.clearing_info import ClearingInfo from ..models.order_instruction import OrderInstruction from ..models.cancel_replace_multi_leg_order_request_market_condition import ( CancelReplaceMultiLegOrderRequestMarketCondition, ) - from ..models.cancel_replace_multi_leg_order_request_optional_data import ( - CancelReplaceMultiLegOrderRequestOptionalData, - ) + from ..models.clearing_info import ClearingInfo from ..models.cancel_replace_multi_leg_order_request_algo import ( CancelReplaceMultiLegOrderRequestAlgo, ) + from ..models.cancel_replace_multi_leg_order_request_optional_data import ( + CancelReplaceMultiLegOrderRequestOptionalData, + ) T = TypeVar("T", bound="CancelReplaceMultiLegOrderRequest") diff --git a/openapi_project/openapi_package/models/cancel_replace_order_request.py b/openapi_project/openapi_package/models/cancel_replace_order_request.py index b39947429..e51b1ed5f 100644 --- a/openapi_project/openapi_package/models/cancel_replace_order_request.py +++ b/openapi_project/openapi_package/models/cancel_replace_order_request.py @@ -12,15 +12,15 @@ from typing import cast if TYPE_CHECKING: - from ..models.cancel_replace_order_request_market_condition import ( - CancelReplaceOrderRequestMarketCondition, - ) - from ..models.cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo - from ..models.clearing_info import ClearingInfo from ..models.cancel_replace_order_request_optional_data import ( CancelReplaceOrderRequestOptionalData, ) from ..models.order_instruction import OrderInstruction + from ..models.cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo + from ..models.clearing_info import ClearingInfo + from ..models.cancel_replace_order_request_market_condition import ( + CancelReplaceOrderRequestMarketCondition, + ) T = TypeVar("T", bound="CancelReplaceOrderRequest") diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py index c997b6f4b..62d8ca633 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py @@ -11,12 +11,12 @@ from typing import cast if TYPE_CHECKING: + from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg from ..models.create_multi_leg_order_cross_allocation_optional_data import ( CreateMultiLegOrderCrossAllocationOptionalData, ) from ..models.clearing_info import ClearingInfo from ..models.order_instruction import OrderInstruction - from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg T = TypeVar("T", bound="CreateMultiLegOrderCrossAllocation") diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py index 8b8bc8e94..f896a1e1a 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py @@ -14,9 +14,6 @@ from typing import cast if TYPE_CHECKING: - from ..models.create_multi_leg_order_cross_request_algo import ( - CreateMultiLegOrderCrossRequestAlgo, - ) from ..models.create_multi_leg_order_cross_allocation import ( CreateMultiLegOrderCrossAllocation, ) @@ -27,6 +24,9 @@ CreateMultiLegOrderCrossRequestMarketCondition, ) from ..models.order_instruction import OrderInstruction + from ..models.create_multi_leg_order_cross_request_algo import ( + CreateMultiLegOrderCrossRequestAlgo, + ) T = TypeVar("T", bound="CreateMultiLegOrderCrossRequest") diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_leg.py b/openapi_project/openapi_package/models/create_multi_leg_order_leg.py index 078c0c2f0..9ca67ae71 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_leg.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_leg.py @@ -12,13 +12,13 @@ from typing import cast if TYPE_CHECKING: + from ..models.create_multi_leg_order_leg_market_condition import ( + CreateMultiLegOrderLegMarketCondition, + ) from ..models.create_multi_leg_order_leg_optional_data import ( CreateMultiLegOrderLegOptionalData, ) from ..models.flex_option import FlexOption - from ..models.create_multi_leg_order_leg_market_condition import ( - CreateMultiLegOrderLegMarketCondition, - ) T = TypeVar("T", bound="CreateMultiLegOrderLeg") diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_request.py b/openapi_project/openapi_package/models/create_multi_leg_order_request.py index 228f3bdd3..aeee536d9 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_request.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_request.py @@ -16,15 +16,15 @@ from ..models.create_multi_leg_order_request_algo import ( CreateMultiLegOrderRequestAlgo, ) + from ..models.order_instruction import OrderInstruction from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg from ..models.clearing_info import ClearingInfo - from ..models.order_instruction import OrderInstruction - from ..models.create_multi_leg_order_request_optional_data import ( - CreateMultiLegOrderRequestOptionalData, - ) from ..models.create_multi_leg_order_request_market_condition import ( CreateMultiLegOrderRequestMarketCondition, ) + from ..models.create_multi_leg_order_request_optional_data import ( + CreateMultiLegOrderRequestOptionalData, + ) T = TypeVar("T", bound="CreateMultiLegOrderRequest") diff --git a/openapi_project/openapi_package/models/create_order_cross_allocation.py b/openapi_project/openapi_package/models/create_order_cross_allocation.py index 0ef805111..172eb616e 100644 --- a/openapi_project/openapi_package/models/create_order_cross_allocation.py +++ b/openapi_project/openapi_package/models/create_order_cross_allocation.py @@ -13,10 +13,10 @@ from typing import cast if TYPE_CHECKING: + from ..models.clearing_info import ClearingInfo from ..models.create_order_cross_allocation_optional_data import ( CreateOrderCrossAllocationOptionalData, ) - from ..models.clearing_info import ClearingInfo from ..models.order_instruction import OrderInstruction diff --git a/openapi_project/openapi_package/models/create_order_cross_request.py b/openapi_project/openapi_package/models/create_order_cross_request.py index 68b9e7bcb..38ed6d441 100644 --- a/openapi_project/openapi_package/models/create_order_cross_request.py +++ b/openapi_project/openapi_package/models/create_order_cross_request.py @@ -14,16 +14,16 @@ from typing import cast if TYPE_CHECKING: + from ..models.create_order_cross_request_algo import CreateOrderCrossRequestAlgo from ..models.create_order_cross_request_market_condition import ( CreateOrderCrossRequestMarketCondition, ) - from ..models.create_order_cross_request_algo import CreateOrderCrossRequestAlgo - from ..models.flex_option import FlexOption from ..models.order_instruction import OrderInstruction + from ..models.flex_option import FlexOption + from ..models.create_order_cross_allocation import CreateOrderCrossAllocation from ..models.create_order_cross_request_optional_data import ( CreateOrderCrossRequestOptionalData, ) - from ..models.create_order_cross_allocation import CreateOrderCrossAllocation T = TypeVar("T", bound="CreateOrderCrossRequest") diff --git a/openapi_project/openapi_package/models/create_order_request.py b/openapi_project/openapi_package/models/create_order_request.py index 4ff614140..8efcca784 100644 --- a/openapi_project/openapi_package/models/create_order_request.py +++ b/openapi_project/openapi_package/models/create_order_request.py @@ -15,13 +15,13 @@ from typing import cast if TYPE_CHECKING: - from ..models.create_order_request_algo import CreateOrderRequestAlgo - from ..models.clearing_info import ClearingInfo - from ..models.flex_option import FlexOption - from ..models.order_instruction import OrderInstruction from ..models.create_order_request_optional_data import ( CreateOrderRequestOptionalData, ) + from ..models.create_order_request_algo import CreateOrderRequestAlgo + from ..models.order_instruction import OrderInstruction + from ..models.clearing_info import ClearingInfo + from ..models.flex_option import FlexOption from ..models.create_order_request_market_condition import ( CreateOrderRequestMarketCondition, ) diff --git a/openapi_project/openapi_package/models/execution.py b/openapi_project/openapi_package/models/execution.py index 6996d077c..87d7defc5 100644 --- a/openapi_project/openapi_package/models/execution.py +++ b/openapi_project/openapi_package/models/execution.py @@ -19,12 +19,12 @@ from typing import cast if TYPE_CHECKING: + from ..models.order_instruction import OrderInstruction from ..models.security import Security - from ..models.execution_algo import ExecutionAlgo from ..models.clearing_info import ClearingInfo - from ..models.order_instruction import OrderInstruction - from ..models.execution_optional_data import ExecutionOptionalData from ..models.header import Header + from ..models.execution_optional_data import ExecutionOptionalData + from ..models.execution_algo import ExecutionAlgo T = TypeVar("T", bound="Execution") diff --git a/openapi_project/openapi_package/models/future_root.py b/openapi_project/openapi_package/models/future_root.py index aea2587fe..6f1672c9a 100644 --- a/openapi_project/openapi_package/models/future_root.py +++ b/openapi_project/openapi_package/models/future_root.py @@ -17,8 +17,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.future_root_aliases import FutureRootAliases from ..models.trading_session_group import TradingSessionGroup + from ..models.future_root_aliases import FutureRootAliases from ..models.date import Date diff --git a/openapi_project/openapi_package/models/future_spread.py b/openapi_project/openapi_package/models/future_spread.py index 9410ff1e7..411db953d 100644 --- a/openapi_project/openapi_package/models/future_spread.py +++ b/openapi_project/openapi_package/models/future_spread.py @@ -14,9 +14,9 @@ from typing import cast if TYPE_CHECKING: - from ..models.future_spread_aliases import FutureSpreadAliases - from ..models.date import Date from ..models.future_spread_leg import FutureSpreadLeg + from ..models.date import Date + from ..models.future_spread_aliases import FutureSpreadAliases T = TypeVar("T", bound="FutureSpread") diff --git a/openapi_project/openapi_package/models/generic_order.py b/openapi_project/openapi_package/models/generic_order.py index 9c69e5c12..555bec6f6 100644 --- a/openapi_project/openapi_package/models/generic_order.py +++ b/openapi_project/openapi_package/models/generic_order.py @@ -10,10 +10,10 @@ from typing import cast if TYPE_CHECKING: + from ..models.order_cross import OrderCross + from ..models.multi_leg_order import MultiLegOrder from ..models.multi_leg_order_cross import MultiLegOrderCross from ..models.order import Order - from ..models.multi_leg_order import MultiLegOrder - from ..models.order_cross import OrderCross T = TypeVar("T", bound="GenericOrder") diff --git a/openapi_project/openapi_package/models/multi_leg_order.py b/openapi_project/openapi_package/models/multi_leg_order.py index 843bd4458..71fd5ef2e 100644 --- a/openapi_project/openapi_package/models/multi_leg_order.py +++ b/openapi_project/openapi_package/models/multi_leg_order.py @@ -15,14 +15,14 @@ from typing import cast if TYPE_CHECKING: - from ..models.clearing_info import ClearingInfo - from ..models.multi_leg_order_market_condition import MultiLegOrderMarketCondition + from ..models.multi_leg_order_leg import MultiLegOrderLeg from ..models.multi_leg_order_algo import MultiLegOrderAlgo from ..models.order_instruction import OrderInstruction from ..models.order_update_event import OrderUpdateEvent - from ..models.multi_leg_order_leg import MultiLegOrderLeg - from ..models.multi_leg_order_optional_data import MultiLegOrderOptionalData + from ..models.clearing_info import ClearingInfo from ..models.header import Header + from ..models.multi_leg_order_market_condition import MultiLegOrderMarketCondition + from ..models.multi_leg_order_optional_data import MultiLegOrderOptionalData T = TypeVar("T", bound="MultiLegOrder") diff --git a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py index 2e2330e5e..f2d12bc85 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py @@ -15,18 +15,18 @@ from typing import cast if TYPE_CHECKING: - from ..models.multi_leg_order_cancel_replace_request_algo import ( - MultiLegOrderCancelReplaceRequestAlgo, + from ..models.multi_leg_order_cancel_replace_request_optional_data import ( + MultiLegOrderCancelReplaceRequestOptionalData, ) - from ..models.clearing_info import ClearingInfo from ..models.multi_leg_order_cancel_replace_request_market_condition import ( MultiLegOrderCancelReplaceRequestMarketCondition, ) from ..models.order_instruction import OrderInstruction - from ..models.multi_leg_order_cancel_replace_request_optional_data import ( - MultiLegOrderCancelReplaceRequestOptionalData, - ) + from ..models.clearing_info import ClearingInfo from ..models.header import Header + from ..models.multi_leg_order_cancel_replace_request_algo import ( + MultiLegOrderCancelReplaceRequestAlgo, + ) T = TypeVar("T", bound="MultiLegOrderCancelReplaceRequest") diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross.py b/openapi_project/openapi_package/models/multi_leg_order_cross.py index 54c3cf78a..1b0b3663e 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross.py @@ -16,17 +16,17 @@ from typing import cast if TYPE_CHECKING: - from ..models.multi_leg_order_cross_market_condition import ( - MultiLegOrderCrossMarketCondition, - ) from ..models.multi_leg_order_cross_optional_data import ( MultiLegOrderCrossOptionalData, ) - from ..models.multi_leg_order_cross_algo import MultiLegOrderCrossAlgo from ..models.order_instruction import OrderInstruction from ..models.order_update_event import OrderUpdateEvent - from ..models.header import Header from ..models.multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation + from ..models.multi_leg_order_cross_algo import MultiLegOrderCrossAlgo + from ..models.header import Header + from ..models.multi_leg_order_cross_market_condition import ( + MultiLegOrderCrossMarketCondition, + ) T = TypeVar("T", bound="MultiLegOrderCross") diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py index 5cdd0c622..d1659822e 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py @@ -13,10 +13,10 @@ if TYPE_CHECKING: from ..models.multi_leg_order_leg import MultiLegOrderLeg + from ..models.clearing_info import ClearingInfo from ..models.multi_leg_order_cross_allocation_optional_data import ( MultiLegOrderCrossAllocationOptionalData, ) - from ..models.clearing_info import ClearingInfo from ..models.order_instruction import OrderInstruction diff --git a/openapi_project/openapi_package/models/multi_leg_order_leg.py b/openapi_project/openapi_package/models/multi_leg_order_leg.py index 408d4a4cf..1d15729c1 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_leg.py +++ b/openapi_project/openapi_package/models/multi_leg_order_leg.py @@ -12,12 +12,12 @@ from typing import cast if TYPE_CHECKING: + from ..models.order_update_event import OrderUpdateEvent from ..models.security import Security from ..models.multi_leg_order_leg_market_condition import ( MultiLegOrderLegMarketCondition, ) from ..models.multi_leg_order_leg_optional_data import MultiLegOrderLegOptionalData - from ..models.order_update_event import OrderUpdateEvent T = TypeVar("T", bound="MultiLegOrderLeg") diff --git a/openapi_project/openapi_package/models/option_chain.py b/openapi_project/openapi_package/models/option_chain.py index 4c043ec3a..588d5835b 100644 --- a/openapi_project/openapi_package/models/option_chain.py +++ b/openapi_project/openapi_package/models/option_chain.py @@ -12,8 +12,8 @@ if TYPE_CHECKING: from ..models.security import Security from ..models.option_series import OptionSeries - from ..models.option_chain_options import OptionChainOptions from ..models.option_chain_roots import OptionChainRoots + from ..models.option_chain_options import OptionChainOptions T = TypeVar("T", bound="OptionChain") diff --git a/openapi_project/openapi_package/models/option_root.py b/openapi_project/openapi_package/models/option_root.py index 3e746f81f..ed10f5510 100644 --- a/openapi_project/openapi_package/models/option_root.py +++ b/openapi_project/openapi_package/models/option_root.py @@ -18,10 +18,10 @@ from typing import cast if TYPE_CHECKING: + from ..models.option_root_aliases import OptionRootAliases from ..models.settlement_info import SettlementInfo - from ..models.trading_session_group import TradingSessionGroup from ..models.date import Date - from ..models.option_root_aliases import OptionRootAliases + from ..models.trading_session_group import TradingSessionGroup T = TypeVar("T", bound="OptionRoot") diff --git a/openapi_project/openapi_package/models/order.py b/openapi_project/openapi_package/models/order.py index 0b12d7a2b..aa65af58c 100644 --- a/openapi_project/openapi_package/models/order.py +++ b/openapi_project/openapi_package/models/order.py @@ -17,14 +17,14 @@ from typing import cast if TYPE_CHECKING: + from ..models.order_instruction import OrderInstruction from ..models.security import Security - from ..models.clearing_info import ClearingInfo from ..models.order_algo import OrderAlgo - from ..models.order_instruction import OrderInstruction - from ..models.order_optional_data import OrderOptionalData from ..models.order_update_event import OrderUpdateEvent - from ..models.order_market_condition import OrderMarketCondition + from ..models.order_optional_data import OrderOptionalData + from ..models.clearing_info import ClearingInfo from ..models.header import Header + from ..models.order_market_condition import OrderMarketCondition T = TypeVar("T", bound="Order") diff --git a/openapi_project/openapi_package/models/order_cancel_replace_request.py b/openapi_project/openapi_package/models/order_cancel_replace_request.py index 57be5c08b..29a212da2 100644 --- a/openapi_project/openapi_package/models/order_cancel_replace_request.py +++ b/openapi_project/openapi_package/models/order_cancel_replace_request.py @@ -15,16 +15,16 @@ from typing import cast if TYPE_CHECKING: - from ..models.order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo + from ..models.order_instruction import OrderInstruction from ..models.order_cancel_replace_request_market_condition import ( OrderCancelReplaceRequestMarketCondition, ) from ..models.clearing_info import ClearingInfo + from ..models.header import Header + from ..models.order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo from ..models.order_cancel_replace_request_optional_data import ( OrderCancelReplaceRequestOptionalData, ) - from ..models.order_instruction import OrderInstruction - from ..models.header import Header T = TypeVar("T", bound="OrderCancelReplaceRequest") diff --git a/openapi_project/openapi_package/models/order_cancel_request.py b/openapi_project/openapi_package/models/order_cancel_request.py index f5c9b0f6a..9bb9d7c3c 100644 --- a/openapi_project/openapi_package/models/order_cancel_request.py +++ b/openapi_project/openapi_package/models/order_cancel_request.py @@ -11,10 +11,10 @@ from typing import cast if TYPE_CHECKING: - from ..models.order_instruction import OrderInstruction from ..models.order_cancel_request_optional_data import ( OrderCancelRequestOptionalData, ) + from ..models.order_instruction import OrderInstruction T = TypeVar("T", bound="OrderCancelRequest") diff --git a/openapi_project/openapi_package/models/order_cross.py b/openapi_project/openapi_package/models/order_cross.py index 45d4c625f..ae268502c 100644 --- a/openapi_project/openapi_package/models/order_cross.py +++ b/openapi_project/openapi_package/models/order_cross.py @@ -16,14 +16,14 @@ from typing import cast if TYPE_CHECKING: - from ..models.order_cross_market_condition import OrderCrossMarketCondition - from ..models.security import Security - from ..models.order_cross_allocation import OrderCrossAllocation - from ..models.order_cross_algo import OrderCrossAlgo - from ..models.order_cross_optional_data import OrderCrossOptionalData from ..models.order_instruction import OrderInstruction + from ..models.security import Security from ..models.order_update_event import OrderUpdateEvent + from ..models.order_cross_optional_data import OrderCrossOptionalData from ..models.header import Header + from ..models.order_cross_algo import OrderCrossAlgo + from ..models.order_cross_market_condition import OrderCrossMarketCondition + from ..models.order_cross_allocation import OrderCrossAllocation T = TypeVar("T", bound="OrderCross") diff --git a/openapi_project/openapi_package/models/order_cross_allocation.py b/openapi_project/openapi_package/models/order_cross_allocation.py index a98907bfa..59a75c12c 100644 --- a/openapi_project/openapi_package/models/order_cross_allocation.py +++ b/openapi_project/openapi_package/models/order_cross_allocation.py @@ -14,11 +14,11 @@ from typing import cast if TYPE_CHECKING: - from ..models.clearing_info import ClearingInfo - from ..models.order_instruction import OrderInstruction from ..models.order_cross_allocation_optional_data import ( OrderCrossAllocationOptionalData, ) + from ..models.clearing_info import ClearingInfo + from ..models.order_instruction import OrderInstruction T = TypeVar("T", bound="OrderCrossAllocation") diff --git a/openapi_project/openapi_package/models/order_update.py b/openapi_project/openapi_package/models/order_update.py index dcd7db713..89a4e1ad4 100644 --- a/openapi_project/openapi_package/models/order_update.py +++ b/openapi_project/openapi_package/models/order_update.py @@ -19,12 +19,12 @@ from typing import cast if TYPE_CHECKING: - from ..models.order_update_optional_data import OrderUpdateOptionalData + from ..models.order_instruction import OrderInstruction from ..models.security import Security - from ..models.order_update_algo import OrderUpdateAlgo from ..models.clearing_info import ClearingInfo - from ..models.order_instruction import OrderInstruction from ..models.header import Header + from ..models.order_update_optional_data import OrderUpdateOptionalData + from ..models.order_update_algo import OrderUpdateAlgo T = TypeVar("T", bound="OrderUpdate") diff --git a/openapi_project/openapi_package/models/order_update_event.py b/openapi_project/openapi_package/models/order_update_event.py index 40464be70..deca2ae77 100644 --- a/openapi_project/openapi_package/models/order_update_event.py +++ b/openapi_project/openapi_package/models/order_update_event.py @@ -10,15 +10,15 @@ from typing import cast if TYPE_CHECKING: + from ..models.order_cancel_reject import OrderCancelReject + from ..models.order_cancel_request import OrderCancelRequest + from ..models.order_cancel_replace_request import OrderCancelReplaceRequest from ..models.multi_leg_order_cancel_replace_request import ( MultiLegOrderCancelReplaceRequest, ) - from ..models.order_cancel_reject import OrderCancelReject - from ..models.order_delete import OrderDelete from ..models.order_update import OrderUpdate + from ..models.order_delete import OrderDelete from ..models.execution import Execution - from ..models.order_cancel_request import OrderCancelRequest - from ..models.order_cancel_replace_request import OrderCancelReplaceRequest T = TypeVar("T", bound="OrderUpdateEvent") diff --git a/openapi_project/openapi_package/models/security.py b/openapi_project/openapi_package/models/security.py index 1333fbfef..926924d02 100644 --- a/openapi_project/openapi_package/models/security.py +++ b/openapi_project/openapi_package/models/security.py @@ -11,15 +11,15 @@ if TYPE_CHECKING: from ..models.future import Future - from ..models.option_root import OptionRoot - from ..models.crypto import Crypto - from ..models.fx import Fx - from ..models.stock import Stock - from ..models.flex_option import FlexOption + from ..models.future_root import FutureRoot from ..models.future_spread import FutureSpread from ..models.option import Option + from ..models.stock import Stock + from ..models.fx import Fx + from ..models.flex_option import FlexOption + from ..models.crypto import Crypto + from ..models.option_root import OptionRoot from ..models.index import Index - from ..models.future_root import FutureRoot T = TypeVar("T", bound="Security") diff --git a/openapi_python_client/templates/model.py.jinja b/openapi_python_client/templates/model.py.jinja index cc4179ade..4292e6204 100644 --- a/openapi_python_client/templates/model.py.jinja +++ b/openapi_python_client/templates/model.py.jinja @@ -114,12 +114,12 @@ field_dict: dict[str, Any] = {} field_dict.update({ prop_name: {{ prop_template.transform_expression(model.additional_properties, "prop") if prop_template.transform_expression else "prop" }} for prop_name, prop in self.additional_properties.items() -}) +}) # noqa: PERF403 {% else %} field_dict.update({ prop_name: prop for prop_name, prop in self.additional_properties.items() -}) +}) # noqa: PERF403 {%- endif -%} {%- endif -%} {% endmacro %} From 760f38d2d1cb666091433e053a67b6fae80482ec Mon Sep 17 00:00:00 2001 From: Itay Bavly Date: Wed, 20 Aug 2025 14:08:30 -0400 Subject: [PATCH 06/16] future annotations --- openapi/templates/model.py.jinja | 4 ++- openapi_project/openapi_package/errors.py | 2 ++ .../openapi_package/models/account.py | 14 ++++---- .../openapi_package/models/account_script.py | 2 ++ .../models/analyze_position_item.py | 2 ++ .../models/analyze_positions_request.py | 6 ++-- .../models/analyze_positions_response.py | 4 ++- .../openapi_package/models/any_model.py | 2 ++ .../models/calculate_margin_request.py | 6 ++-- .../calculate_margin_request_position.py | 2 ++ .../calculate_margin_request_position_list.py | 6 ++-- .../models/calculate_margin_response.py | 6 ++-- .../models/cancel_order_request.py | 8 +++-- .../cancel_order_request_optional_data.py | 2 ++ .../models/cancel_order_response.py | 2 ++ .../cancel_replace_multi_leg_order_request.py | 14 ++++---- ...el_replace_multi_leg_order_request_algo.py | 2 ++ ...ulti_leg_order_request_market_condition.py | 2 ++ ...e_multi_leg_order_request_optional_data.py | 2 ++ ...cancel_replace_multi_leg_order_response.py | 2 ++ .../models/cancel_replace_order_request.py | 16 +++++---- .../cancel_replace_order_request_algo.py | 2 ++ ..._replace_order_request_market_condition.py | 2 ++ ...cel_replace_order_request_optional_data.py | 2 ++ .../models/cancel_replace_order_response.py | 2 ++ .../openapi_package/models/clearing_info.py | 2 ++ .../models/create_flex_option_request.py | 6 ++-- .../models/create_flex_option_response.py | 4 ++- ...create_multi_leg_order_cross_allocation.py | 20 ++++++----- ...eg_order_cross_allocation_optional_data.py | 2 ++ .../create_multi_leg_order_cross_request.py | 24 +++++++------ ...eate_multi_leg_order_cross_request_algo.py | 2 ++ ...eg_order_cross_request_market_condition.py | 2 ++ ...i_leg_order_cross_request_optional_data.py | 2 ++ .../create_multi_leg_order_cross_response.py | 4 ++- .../models/create_multi_leg_order_leg.py | 14 ++++---- ...te_multi_leg_order_leg_market_condition.py | 2 ++ ...reate_multi_leg_order_leg_optional_data.py | 2 ++ .../models/create_multi_leg_order_request.py | 28 ++++++++------- .../create_multi_leg_order_request_algo.py | 2 ++ ...ulti_leg_order_request_market_condition.py | 2 ++ ...e_multi_leg_order_request_optional_data.py | 2 ++ .../models/create_multi_leg_order_response.py | 4 ++- .../models/create_order_cross_allocation.py | 12 ++++--- ...te_order_cross_allocation_optional_data.py | 2 ++ .../models/create_order_cross_request.py | 28 ++++++++------- .../models/create_order_cross_request_algo.py | 2 ++ ...te_order_cross_request_market_condition.py | 2 ++ ...reate_order_cross_request_optional_data.py | 2 ++ .../models/create_order_cross_response.py | 4 ++- .../models/create_order_request.py | 24 +++++++------ .../models/create_order_request_algo.py | 2 ++ .../create_order_request_market_condition.py | 2 ++ .../create_order_request_optional_data.py | 2 ++ .../models/create_order_response.py | 4 ++- .../openapi_package/models/crypto.py | 10 +++--- .../openapi_package/models/crypto_aliases.py | 2 ++ .../openapi_package/models/date.py | 2 ++ .../models/easy_to_borrow_security.py | 2 ++ .../openapi_package/models/empty.py | 2 ++ .../openapi_package/models/exchange.py | 2 ++ .../openapi_package/models/execution.py | 22 ++++++------ .../openapi_package/models/execution_algo.py | 2 ++ .../models/execution_optional_data.py | 2 ++ .../openapi_package/models/flex_option.py | 14 ++++---- .../models/flex_option_aliases.py | 2 ++ .../openapi_package/models/future.py | 20 ++++++----- .../openapi_package/models/future_aliases.py | 2 ++ .../openapi_package/models/future_root.py | 12 ++++--- .../models/future_root_aliases.py | 2 ++ .../openapi_package/models/future_spread.py | 22 ++++++------ .../models/future_spread_aliases.py | 2 ++ .../models/future_spread_leg.py | 4 ++- openapi_project/openapi_package/models/fx.py | 8 +++-- .../openapi_package/models/fx_aliases.py | 2 ++ .../openapi_package/models/generic_order.py | 12 ++++--- .../models/get_active_user_response.py | 4 ++- .../models/get_server_info_response.py | 4 ++- ...et_server_info_response_system_settings.py | 2 ++ .../models/get_server_time_response.py | 2 ++ .../models/get_trading_holidays_response.py | 6 ++-- .../openapi_package/models/header.py | 2 ++ .../openapi_package/models/index.py | 10 +++--- .../openapi_package/models/index_aliases.py | 2 ++ .../models/list_accounts_response.py | 6 ++-- .../list_affiliated_trading_firms_response.py | 6 ++-- .../list_easy_to_borrow_securities_request.py | 2 ++ ...list_easy_to_borrow_securities_response.py | 6 ++-- .../models/list_exchanges_response.py | 6 ++-- .../models/list_option_chains_repsonse.py | 6 ++-- .../models/list_option_chains_request.py | 2 ++ .../models/list_orders_response.py | 6 ++-- .../models/list_positions_response.py | 6 ++-- .../models/list_routes_response.py | 10 +++--- .../models/list_securities_request.py | 2 ++ .../models/list_securities_response.py | 6 ++-- .../models/list_trade_confirms_response.py | 6 ++-- .../models/list_trading_firms_response.py | 6 ++-- .../openapi_package/models/login_request.py | 2 ++ .../openapi_package/models/login_response.py | 6 ++-- .../models/login_response_system_settings.py | 2 ++ .../openapi_package/models/margin_data.py | 8 +++-- .../openapi_package/models/multi_leg_order.py | 32 +++++++++-------- .../models/multi_leg_order_algo.py | 2 ++ .../multi_leg_order_cancel_replace_request.py | 26 +++++++------- ...i_leg_order_cancel_replace_request_algo.py | 2 ++ ...cancel_replace_request_market_condition.py | 2 ++ ...er_cancel_replace_request_optional_data.py | 2 ++ .../models/multi_leg_order_cross.py | 34 ++++++++++--------- .../models/multi_leg_order_cross_algo.py | 2 ++ .../multi_leg_order_cross_allocation.py | 18 +++++----- ...eg_order_cross_allocation_optional_data.py | 2 ++ .../multi_leg_order_cross_market_condition.py | 2 ++ .../multi_leg_order_cross_optional_data.py | 2 ++ .../models/multi_leg_order_leg.py | 18 +++++----- .../multi_leg_order_leg_market_condition.py | 2 ++ .../multi_leg_order_leg_optional_data.py | 2 ++ .../multi_leg_order_market_condition.py | 2 ++ .../models/multi_leg_order_optional_data.py | 2 ++ .../openapi_package/models/option.py | 20 ++++++----- .../openapi_package/models/option_aliases.py | 2 ++ .../openapi_package/models/option_chain.py | 16 +++++---- .../models/option_chain_option.py | 12 ++++--- .../models/option_chain_option_aliases.py | 2 ++ .../models/option_chain_options.py | 8 +++-- .../models/option_chain_roots.py | 8 +++-- .../openapi_package/models/option_root.py | 18 +++++----- .../models/option_root_aliases.py | 2 ++ .../openapi_package/models/option_series.py | 4 ++- .../openapi_package/models/order.py | 30 ++++++++-------- .../openapi_package/models/order_algo.py | 2 ++ .../models/order_cancel_reject.py | 4 ++- .../order_cancel_reject_optional_data.py | 2 ++ .../models/order_cancel_replace_request.py | 24 +++++++------ .../order_cancel_replace_request_algo.py | 2 ++ ...cancel_replace_request_market_condition.py | 2 ++ ...er_cancel_replace_request_optional_data.py | 2 ++ .../models/order_cancel_request.py | 10 +++--- .../order_cancel_request_optional_data.py | 2 ++ .../openapi_package/models/order_cross.py | 34 ++++++++++--------- .../models/order_cross_algo.py | 2 ++ .../models/order_cross_allocation.py | 12 ++++--- .../order_cross_allocation_optional_data.py | 2 ++ .../models/order_cross_market_condition.py | 2 ++ .../models/order_cross_optional_data.py | 2 ++ .../openapi_package/models/order_delete.py | 4 ++- .../models/order_delete_optional_data.py | 2 ++ .../models/order_instruction.py | 2 ++ .../models/order_market_condition.py | 2 ++ .../models/order_optional_data.py | 2 ++ .../openapi_package/models/order_update.py | 22 ++++++------ .../models/order_update_algo.py | 2 ++ .../models/order_update_event.py | 26 +++++++------- .../models/order_update_optional_data.py | 2 ++ .../openapi_package/models/position.py | 2 ++ .../models/position_analysis.py | 8 +++-- .../openapi_package/models/position_theo.py | 6 ++-- .../models/position_theo_leg.py | 2 ++ .../models/risk_radar_account_group.py | 12 ++++--- .../models/risk_radar_class_group.py | 12 ++++--- .../openapi_package/models/risk_radar_data.py | 6 ++-- .../models/risk_radar_position.py | 6 ++-- .../models/risk_radar_product_group.py | 12 ++++--- .../models/risk_radar_request.py | 6 ++-- .../models/risk_radar_request_position.py | 2 ++ .../risk_radar_request_position_list.py | 6 ++-- .../models/risk_radar_response.py | 4 ++- .../openapi_package/models/risk_reject.py | 2 ++ .../openapi_package/models/route.py | 6 ++-- .../models/route_applicability.py | 2 ++ .../openapi_package/models/route_property.py | 2 ++ .../models/routing_session_group.py | 2 ++ .../openapi_package/models/scenario.py | 10 +++--- .../openapi_package/models/scenario_leg.py | 2 ++ .../models/scenario_position.py | 2 ++ .../openapi_package/models/scenario_theo.py | 6 ++-- .../models/search_order_history_response.py | 6 ++-- .../openapi_package/models/security.py | 30 ++++++++-------- .../openapi_package/models/settlement_info.py | 2 ++ .../openapi_package/models/shock_value.py | 4 ++- .../models/shock_value_flags.py | 2 ++ .../openapi_package/models/status.py | 6 ++-- .../openapi_package/models/stock.py | 8 +++-- .../openapi_package/models/stock_aliases.py | 2 ++ .../openapi_package/models/time_of_day.py | 2 ++ .../models/tims_class_group.py | 6 ++-- .../models/tims_margin_data.py | 10 +++--- .../models/tims_position_group.py | 2 ++ .../models/tims_product_group.py | 2 ++ .../openapi_package/models/trade_confirm.py | 6 ++-- .../openapi_package/models/trading_firm.py | 2 ++ .../models/trading_firm_slim.py | 2 ++ .../openapi_package/models/trading_holiday.py | 4 ++- .../openapi_package/models/trading_session.py | 6 ++-- .../models/trading_session_group.py | 6 ++-- .../openapi_package/models/user.py | 6 ++-- .../openapi_package/models/user_permission.py | 2 ++ .../models/validate_risk_response.py | 6 ++-- .../parser/properties/list_property.py | 4 +-- .../parser/properties/model_property.py | 6 +--- .../parser/properties/union.py | 2 +- .../templates/client.py.jinja | 2 ++ .../templates/endpoint_module.py.jinja | 2 ++ .../templates/errors.py.jinja | 2 ++ .../templates/literal_enum.py.jinja | 2 ++ .../templates/model.py.jinja | 4 ++- .../templates/types.py.jinja | 2 ++ 207 files changed, 855 insertions(+), 451 deletions(-) diff --git a/openapi/templates/model.py.jinja b/openapi/templates/model.py.jinja index 4292e6204..abce0acf9 100644 --- a/openapi/templates/model.py.jinja +++ b/openapi/templates/model.py.jinja @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -27,7 +29,7 @@ if TYPE_CHECKING: {% if model.additional_properties %} -{% set additional_property_type = 'Any' if model.additional_properties == True else model.additional_properties.get_type_string(quoted=not model.additional_properties.is_base_type) %} +{% set additional_property_type = 'Any' if model.additional_properties == True else model.additional_properties.get_type_string() %} {% endif %} {% set class_name = model.class_info.name %} diff --git a/openapi_project/openapi_package/errors.py b/openapi_project/openapi_package/errors.py index 9bf275435..75f9c2a55 100644 --- a/openapi_project/openapi_package/errors.py +++ b/openapi_project/openapi_package/errors.py @@ -1,5 +1,7 @@ """Contains shared errors types that can be raised from API functions""" +from __future__ import annotations + class UnexpectedStatus(Exception): """Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True""" diff --git a/openapi_project/openapi_package/models/account.py b/openapi_project/openapi_package/models/account.py index d0ea0d034..a291bd379 100644 --- a/openapi_project/openapi_package/models/account.py +++ b/openapi_project/openapi_package/models/account.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -15,8 +17,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.account_script import AccountScript from ..models.routing_session_group import RoutingSessionGroup + from ..models.account_script import AccountScript T = TypeVar("T", bound="Account") @@ -44,7 +46,7 @@ class Account: options_cmta (Unset | str): options_efid (Unset | str): options_give_up (Unset | str): - routing_session_groups (Unset | list['RoutingSessionGroup']): + routing_session_groups (Unset | list[RoutingSessionGroup]): status (Unset | AccountStatus): tag1 (Unset | str): trading_firm_id (Unset | int): @@ -74,16 +76,16 @@ class Account: options_cmta: Unset | str = UNSET options_efid: Unset | str = UNSET options_give_up: Unset | str = UNSET - routing_session_groups: Unset | list["RoutingSessionGroup"] = UNSET + routing_session_groups: Unset | list[RoutingSessionGroup] = UNSET status: Unset | AccountStatus = UNSET tag1: Unset | str = UNSET trading_firm_id: Unset | int = UNSET type_: Unset | AccountType = UNSET created_ts: Unset | str = UNSET optional_data: Unset | str = UNSET - position_script: Unset | "AccountScript" = UNSET - buying_power_script: Unset | "AccountScript" = UNSET - clearing_script: Unset | "AccountScript" = UNSET + position_script: Unset | AccountScript = UNSET + buying_power_script: Unset | AccountScript = UNSET + clearing_script: Unset | AccountScript = UNSET def to_dict(self) -> dict[str, Any]: id = self.id diff --git a/openapi_project/openapi_package/models/account_script.py b/openapi_project/openapi_package/models/account_script.py index 1dc214c93..2ef3e2c43 100644 --- a/openapi_project/openapi_package/models/account_script.py +++ b/openapi_project/openapi_package/models/account_script.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/analyze_position_item.py b/openapi_project/openapi_package/models/analyze_position_item.py index 23ba27c6b..8e719cd42 100644 --- a/openapi_project/openapi_package/models/analyze_position_item.py +++ b/openapi_project/openapi_package/models/analyze_position_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/analyze_positions_request.py b/openapi_project/openapi_package/models/analyze_positions_request.py index b9e103093..fa19c9f8c 100644 --- a/openapi_project/openapi_package/models/analyze_positions_request.py +++ b/openapi_project/openapi_package/models/analyze_positions_request.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -24,7 +26,7 @@ class AnalyzePositionsRequest: evaluate_at_expiry (Unset | bool): evaluate_at_strike (Unset | bool): evaluation_as_of (Unset | list[str]): - positions (Unset | list['AnalyzePositionItem']): + positions (Unset | list[AnalyzePositionItem]): price (Unset | float): underlying_volatility (Unset | list[float]): historical_volatility_days (Unset | list[int]): @@ -35,7 +37,7 @@ class AnalyzePositionsRequest: evaluate_at_expiry: Unset | bool = UNSET evaluate_at_strike: Unset | bool = UNSET evaluation_as_of: Unset | list[str] = UNSET - positions: Unset | list["AnalyzePositionItem"] = UNSET + positions: Unset | list[AnalyzePositionItem] = UNSET price: Unset | float = UNSET underlying_volatility: Unset | list[float] = UNSET historical_volatility_days: Unset | list[int] = UNSET diff --git a/openapi_project/openapi_package/models/analyze_positions_response.py b/openapi_project/openapi_package/models/analyze_positions_response.py index 84e614307..364e442b1 100644 --- a/openapi_project/openapi_package/models/analyze_positions_response.py +++ b/openapi_project/openapi_package/models/analyze_positions_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -26,7 +28,7 @@ class AnalyzePositionsResponse: status_code (Unset | StatusCode): """ - analysis: Unset | "PositionAnalysis" = UNSET + analysis: Unset | PositionAnalysis = UNSET error_message: Unset | str = UNSET status_code: Unset | StatusCode = UNSET diff --git a/openapi_project/openapi_package/models/any_model.py b/openapi_project/openapi_package/models/any_model.py index a2b504f21..55378f366 100644 --- a/openapi_project/openapi_package/models/any_model.py +++ b/openapi_project/openapi_package/models/any_model.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/calculate_margin_request.py b/openapi_project/openapi_package/models/calculate_margin_request.py index f7c8e6100..454186870 100644 --- a/openapi_project/openapi_package/models/calculate_margin_request.py +++ b/openapi_project/openapi_package/models/calculate_margin_request.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -27,14 +29,14 @@ class CalculateMarginRequest: Attributes: account_ids (Unset | list[int]): margin_data_type (Unset | MarginDataType): - positions_by_account_id (Unset | list['CalculateMarginRequestPositionList']): + positions_by_account_id (Unset | list[CalculateMarginRequestPositionList]): eval_mode (Unset | RiskEvalMode): source (Unset | PositionSource): """ account_ids: Unset | list[int] = UNSET margin_data_type: Unset | MarginDataType = UNSET - positions_by_account_id: Unset | list["CalculateMarginRequestPositionList"] = UNSET + positions_by_account_id: Unset | list[CalculateMarginRequestPositionList] = UNSET eval_mode: Unset | RiskEvalMode = UNSET source: Unset | PositionSource = UNSET diff --git a/openapi_project/openapi_package/models/calculate_margin_request_position.py b/openapi_project/openapi_package/models/calculate_margin_request_position.py index e798b620c..9775ea66a 100644 --- a/openapi_project/openapi_package/models/calculate_margin_request_position.py +++ b/openapi_project/openapi_package/models/calculate_margin_request_position.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/calculate_margin_request_position_list.py b/openapi_project/openapi_package/models/calculate_margin_request_position_list.py index 4f454929b..582b68f99 100644 --- a/openapi_project/openapi_package/models/calculate_margin_request_position_list.py +++ b/openapi_project/openapi_package/models/calculate_margin_request_position_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -23,11 +25,11 @@ class CalculateMarginRequestPositionList: """ Attributes: account_id (Unset | int): - positions (Unset | list['CalculateMarginRequestPosition']): + positions (Unset | list[CalculateMarginRequestPosition]): """ account_id: Unset | int = UNSET - positions: Unset | list["CalculateMarginRequestPosition"] = UNSET + positions: Unset | list[CalculateMarginRequestPosition] = UNSET def to_dict(self) -> dict[str, Any]: account_id = self.account_id diff --git a/openapi_project/openapi_package/models/calculate_margin_response.py b/openapi_project/openapi_package/models/calculate_margin_response.py index ba64d05df..0294e95b8 100644 --- a/openapi_project/openapi_package/models/calculate_margin_response.py +++ b/openapi_project/openapi_package/models/calculate_margin_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -21,12 +23,12 @@ class CalculateMarginResponse: """ Attributes: - margin_data (Unset | list['MarginData']): + margin_data (Unset | list[MarginData]): error_message (Unset | str): status_code (Unset | StatusCode): """ - margin_data: Unset | list["MarginData"] = UNSET + margin_data: Unset | list[MarginData] = UNSET error_message: Unset | str = UNSET status_code: Unset | StatusCode = UNSET diff --git a/openapi_project/openapi_package/models/cancel_order_request.py b/openapi_project/openapi_package/models/cancel_order_request.py index bc6f59b05..71fffa5f2 100644 --- a/openapi_project/openapi_package/models/cancel_order_request.py +++ b/openapi_project/openapi_package/models/cancel_order_request.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -24,15 +26,15 @@ class CancelOrderRequest: """ Attributes: cur_ord_id (Unset | str): - instructions (Unset | list['OrderInstruction']): + instructions (Unset | list[OrderInstruction]): perm_ord_id (Unset | str): optional_data (Unset | CancelOrderRequestOptionalData): """ cur_ord_id: Unset | str = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET + instructions: Unset | list[OrderInstruction] = UNSET perm_ord_id: Unset | str = UNSET - optional_data: Unset | "CancelOrderRequestOptionalData" = UNSET + optional_data: Unset | CancelOrderRequestOptionalData = UNSET def to_dict(self) -> dict[str, Any]: cur_ord_id = self.cur_ord_id diff --git a/openapi_project/openapi_package/models/cancel_order_request_optional_data.py b/openapi_project/openapi_package/models/cancel_order_request_optional_data.py index 43551a478..917018703 100644 --- a/openapi_project/openapi_package/models/cancel_order_request_optional_data.py +++ b/openapi_project/openapi_package/models/cancel_order_request_optional_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/cancel_order_response.py b/openapi_project/openapi_package/models/cancel_order_response.py index 5c7913a16..bc5b18a66 100644 --- a/openapi_project/openapi_package/models/cancel_order_response.py +++ b/openapi_project/openapi_package/models/cancel_order_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py index d93fa3096..94d5411de 100644 --- a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py +++ b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -35,7 +37,7 @@ class CancelReplaceMultiLegOrderRequest: aux_price (Unset | float): clearing_info (Unset | ClearingInfo): cur_ord_id (Unset | str): - instructions (Unset | list['OrderInstruction']): + instructions (Unset | list[OrderInstruction]): ord_type (Unset | OrdType): perm_ord_id (Unset | str): price (Unset | float): @@ -49,9 +51,9 @@ class CancelReplaceMultiLegOrderRequest: """ aux_price: Unset | float = UNSET - clearing_info: Unset | "ClearingInfo" = UNSET + clearing_info: Unset | ClearingInfo = UNSET cur_ord_id: Unset | str = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET + instructions: Unset | list[OrderInstruction] = UNSET ord_type: Unset | OrdType = UNSET perm_ord_id: Unset | str = UNSET price: Unset | float = UNSET @@ -59,9 +61,9 @@ class CancelReplaceMultiLegOrderRequest: tag: Unset | str = UNSET text: Unset | str = UNSET tif: Unset | Tif = UNSET - algo: Unset | "CancelReplaceMultiLegOrderRequestAlgo" = UNSET - market_condition: Unset | "CancelReplaceMultiLegOrderRequestMarketCondition" = UNSET - optional_data: Unset | "CancelReplaceMultiLegOrderRequestOptionalData" = UNSET + algo: Unset | CancelReplaceMultiLegOrderRequestAlgo = UNSET + market_condition: Unset | CancelReplaceMultiLegOrderRequestMarketCondition = UNSET + optional_data: Unset | CancelReplaceMultiLegOrderRequestOptionalData = UNSET def to_dict(self) -> dict[str, Any]: aux_price = self.aux_price diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py index 9458940b9..4d4943c55 100644 --- a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py +++ b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py index 2b3f33d64..2939090e9 100644 --- a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py +++ b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py index df37f0a09..19d18b172 100644 --- a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py +++ b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py index b3a82aae5..ddb2293dc 100644 --- a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py +++ b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/cancel_replace_order_request.py b/openapi_project/openapi_package/models/cancel_replace_order_request.py index e51b1ed5f..927a42067 100644 --- a/openapi_project/openapi_package/models/cancel_replace_order_request.py +++ b/openapi_project/openapi_package/models/cancel_replace_order_request.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -17,10 +19,10 @@ ) from ..models.order_instruction import OrderInstruction from ..models.cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo - from ..models.clearing_info import ClearingInfo from ..models.cancel_replace_order_request_market_condition import ( CancelReplaceOrderRequestMarketCondition, ) + from ..models.clearing_info import ClearingInfo T = TypeVar("T", bound="CancelReplaceOrderRequest") @@ -33,7 +35,7 @@ class CancelReplaceOrderRequest: aux_price (Unset | float): clearing_info (Unset | ClearingInfo): cur_ord_id (Unset | str): - instructions (Unset | list['OrderInstruction']): + instructions (Unset | list[OrderInstruction]): ord_type (Unset | OrdType): perm_ord_id (Unset | str): price (Unset | float): @@ -45,17 +47,17 @@ class CancelReplaceOrderRequest: """ aux_price: Unset | float = UNSET - clearing_info: Unset | "ClearingInfo" = UNSET + clearing_info: Unset | ClearingInfo = UNSET cur_ord_id: Unset | str = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET + instructions: Unset | list[OrderInstruction] = UNSET ord_type: Unset | OrdType = UNSET perm_ord_id: Unset | str = UNSET price: Unset | float = UNSET qty: Unset | float = UNSET tif: Unset | Tif = UNSET - algo: Unset | "CancelReplaceOrderRequestAlgo" = UNSET - market_condition: Unset | "CancelReplaceOrderRequestMarketCondition" = UNSET - optional_data: Unset | "CancelReplaceOrderRequestOptionalData" = UNSET + algo: Unset | CancelReplaceOrderRequestAlgo = UNSET + market_condition: Unset | CancelReplaceOrderRequestMarketCondition = UNSET + optional_data: Unset | CancelReplaceOrderRequestOptionalData = UNSET def to_dict(self) -> dict[str, Any]: aux_price = self.aux_price diff --git a/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py b/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py index 100a71540..4817846e4 100644 --- a/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py +++ b/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py b/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py index fd672c2dd..269e08944 100644 --- a/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py +++ b/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py b/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py index b3e858010..4119e4910 100644 --- a/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py +++ b/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/cancel_replace_order_response.py b/openapi_project/openapi_package/models/cancel_replace_order_response.py index 4120cc943..837bdcec4 100644 --- a/openapi_project/openapi_package/models/cancel_replace_order_response.py +++ b/openapi_project/openapi_package/models/cancel_replace_order_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/clearing_info.py b/openapi_project/openapi_package/models/clearing_info.py index efaf6a4c8..d558dd6d8 100644 --- a/openapi_project/openapi_package/models/clearing_info.py +++ b/openapi_project/openapi_package/models/clearing_info.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/create_flex_option_request.py b/openapi_project/openapi_package/models/create_flex_option_request.py index 8e167e25d..248f280bd 100644 --- a/openapi_project/openapi_package/models/create_flex_option_request.py +++ b/openapi_project/openapi_package/models/create_flex_option_request.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -39,12 +41,12 @@ class CreateFlexOptionRequest: root_symbol: Unset | str = UNSET settlement_type: Unset | FlexSettlementType = UNSET - expiration_dt: Unset | "Date" = UNSET + expiration_dt: Unset | Date = UNSET strike: Unset | float = UNSET put_call: Unset | PutCall = UNSET product_type: Unset | OptionSeriesProductType = UNSET exercise_style: Unset | OptionExerciseStyle = UNSET - creation_dt: Unset | "Date" = UNSET + creation_dt: Unset | Date = UNSET observation_day: Unset | int = UNSET is_percentage_priced: Unset | bool = UNSET cap_percentage: Unset | float = UNSET diff --git a/openapi_project/openapi_package/models/create_flex_option_response.py b/openapi_project/openapi_package/models/create_flex_option_response.py index a5a6264c8..35ed80630 100644 --- a/openapi_project/openapi_package/models/create_flex_option_response.py +++ b/openapi_project/openapi_package/models/create_flex_option_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -26,7 +28,7 @@ class CreateFlexOptionResponse: status_code (Unset | StatusCode): """ - flex_option: Unset | "FlexOption" = UNSET + flex_option: Unset | FlexOption = UNSET error_message: Unset | str = UNSET status_code: Unset | StatusCode = UNSET diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py index 62d8ca633..c3bbacc69 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -11,12 +13,12 @@ from typing import cast if TYPE_CHECKING: - from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg + from ..models.order_instruction import OrderInstruction + from ..models.clearing_info import ClearingInfo from ..models.create_multi_leg_order_cross_allocation_optional_data import ( CreateMultiLegOrderCrossAllocationOptionalData, ) - from ..models.clearing_info import ClearingInfo - from ..models.order_instruction import OrderInstruction + from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg T = TypeVar("T", bound="CreateMultiLegOrderCrossAllocation") @@ -28,18 +30,18 @@ class CreateMultiLegOrderCrossAllocation: Attributes: account_id (Unset | int): clearing_info (Unset | ClearingInfo): - instructions (Unset | list['OrderInstruction']): - legs (Unset | list['CreateMultiLegOrderLeg']): + instructions (Unset | list[OrderInstruction]): + legs (Unset | list[CreateMultiLegOrderLeg]): optional_data (Unset | CreateMultiLegOrderCrossAllocationOptionalData): qty (Unset | float): side_type (Unset | CrossSideType): """ account_id: Unset | int = UNSET - clearing_info: Unset | "ClearingInfo" = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - legs: Unset | list["CreateMultiLegOrderLeg"] = UNSET - optional_data: Unset | "CreateMultiLegOrderCrossAllocationOptionalData" = UNSET + clearing_info: Unset | ClearingInfo = UNSET + instructions: Unset | list[OrderInstruction] = UNSET + legs: Unset | list[CreateMultiLegOrderLeg] = UNSET + optional_data: Unset | CreateMultiLegOrderCrossAllocationOptionalData = UNSET qty: Unset | float = UNSET side_type: Unset | CrossSideType = UNSET diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py index a2ee6c734..20160789e 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py index f896a1e1a..64f5ecab2 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -14,16 +16,16 @@ from typing import cast if TYPE_CHECKING: - from ..models.create_multi_leg_order_cross_allocation import ( - CreateMultiLegOrderCrossAllocation, - ) from ..models.create_multi_leg_order_cross_request_optional_data import ( CreateMultiLegOrderCrossRequestOptionalData, ) + from ..models.order_instruction import OrderInstruction + from ..models.create_multi_leg_order_cross_allocation import ( + CreateMultiLegOrderCrossAllocation, + ) from ..models.create_multi_leg_order_cross_request_market_condition import ( CreateMultiLegOrderCrossRequestMarketCondition, ) - from ..models.order_instruction import OrderInstruction from ..models.create_multi_leg_order_cross_request_algo import ( CreateMultiLegOrderCrossRequestAlgo, ) @@ -37,9 +39,9 @@ class CreateMultiLegOrderCrossRequest: """ Attributes: account_id (Unset | int): - allocations (Unset | list['CreateMultiLegOrderCrossAllocation']): + allocations (Unset | list[CreateMultiLegOrderCrossAllocation]): cross_type (Unset | CrossType): - instructions (Unset | list['OrderInstruction']): + instructions (Unset | list[OrderInstruction]): ord_type (Unset | OrdType): order_flags (Unset | int): parent_ord_id (Unset | str): @@ -56,9 +58,9 @@ class CreateMultiLegOrderCrossRequest: """ account_id: Unset | int = UNSET - allocations: Unset | list["CreateMultiLegOrderCrossAllocation"] = UNSET + allocations: Unset | list[CreateMultiLegOrderCrossAllocation] = UNSET cross_type: Unset | CrossType = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET + instructions: Unset | list[OrderInstruction] = UNSET ord_type: Unset | OrdType = UNSET order_flags: Unset | int = UNSET parent_ord_id: Unset | str = UNSET @@ -69,9 +71,9 @@ class CreateMultiLegOrderCrossRequest: tag: Unset | str = UNSET text: Unset | str = UNSET tif: Unset | Tif = UNSET - algo: Unset | "CreateMultiLegOrderCrossRequestAlgo" = UNSET - market_condition: Unset | "CreateMultiLegOrderCrossRequestMarketCondition" = UNSET - optional_data: Unset | "CreateMultiLegOrderCrossRequestOptionalData" = UNSET + algo: Unset | CreateMultiLegOrderCrossRequestAlgo = UNSET + market_condition: Unset | CreateMultiLegOrderCrossRequestMarketCondition = UNSET + optional_data: Unset | CreateMultiLegOrderCrossRequestOptionalData = UNSET def to_dict(self) -> dict[str, Any]: account_id = self.account_id diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py index 41cab1809..df5deae47 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py index 26b2fc127..9895427a1 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py index 2c06fbd78..95e7353d3 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py index 25e734b1d..70c212953 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -26,7 +28,7 @@ class CreateMultiLegOrderCrossResponse: status_code (Unset | StatusCode): """ - multi_leg_order_cross: Unset | "MultiLegOrderCross" = UNSET + multi_leg_order_cross: Unset | MultiLegOrderCross = UNSET error_message: Unset | str = UNSET status_code: Unset | StatusCode = UNSET diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_leg.py b/openapi_project/openapi_package/models/create_multi_leg_order_leg.py index 9ca67ae71..07eed36a9 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_leg.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_leg.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -12,12 +14,12 @@ from typing import cast if TYPE_CHECKING: - from ..models.create_multi_leg_order_leg_market_condition import ( - CreateMultiLegOrderLegMarketCondition, - ) from ..models.create_multi_leg_order_leg_optional_data import ( CreateMultiLegOrderLegOptionalData, ) + from ..models.create_multi_leg_order_leg_market_condition import ( + CreateMultiLegOrderLegMarketCondition, + ) from ..models.flex_option import FlexOption @@ -43,9 +45,9 @@ class CreateMultiLegOrderLeg: ratio: Unset | int = UNSET side: Unset | Side = UNSET symbol: Unset | str = UNSET - market_condition: Unset | "CreateMultiLegOrderLegMarketCondition" = UNSET - optional_data: Unset | "CreateMultiLegOrderLegOptionalData" = UNSET - flex_option: Unset | "FlexOption" = UNSET + market_condition: Unset | CreateMultiLegOrderLegMarketCondition = UNSET + optional_data: Unset | CreateMultiLegOrderLegOptionalData = UNSET + flex_option: Unset | FlexOption = UNSET def to_dict(self) -> dict[str, Any]: position_effect: Unset | str = ( diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py b/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py index ec2db45ca..5bb6d177a 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py b/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py index 2244c7f50..bb108e37e 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_request.py b/openapi_project/openapi_package/models/create_multi_leg_order_request.py index aeee536d9..72cc496d3 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_request.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_request.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -13,18 +15,18 @@ from typing import cast if TYPE_CHECKING: + from ..models.create_multi_leg_order_request_optional_data import ( + CreateMultiLegOrderRequestOptionalData, + ) + from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg from ..models.create_multi_leg_order_request_algo import ( CreateMultiLegOrderRequestAlgo, ) from ..models.order_instruction import OrderInstruction - from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg - from ..models.clearing_info import ClearingInfo from ..models.create_multi_leg_order_request_market_condition import ( CreateMultiLegOrderRequestMarketCondition, ) - from ..models.create_multi_leg_order_request_optional_data import ( - CreateMultiLegOrderRequestOptionalData, - ) + from ..models.clearing_info import ClearingInfo T = TypeVar("T", bound="CreateMultiLegOrderRequest") @@ -37,8 +39,8 @@ class CreateMultiLegOrderRequest: account_id (Unset | int): aux_price (Unset | float): clearing_info (Unset | ClearingInfo): - instructions (Unset | list['OrderInstruction']): - legs (Unset | list['CreateMultiLegOrderLeg']): + instructions (Unset | list[OrderInstruction]): + legs (Unset | list[CreateMultiLegOrderLeg]): ord_type (Unset | OrdType): order_flags (Unset | int): parent_ord_id (Unset | str): @@ -56,9 +58,9 @@ class CreateMultiLegOrderRequest: account_id: Unset | int = UNSET aux_price: Unset | float = UNSET - clearing_info: Unset | "ClearingInfo" = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - legs: Unset | list["CreateMultiLegOrderLeg"] = UNSET + clearing_info: Unset | ClearingInfo = UNSET + instructions: Unset | list[OrderInstruction] = UNSET + legs: Unset | list[CreateMultiLegOrderLeg] = UNSET ord_type: Unset | OrdType = UNSET order_flags: Unset | int = UNSET parent_ord_id: Unset | str = UNSET @@ -69,9 +71,9 @@ class CreateMultiLegOrderRequest: tag: Unset | str = UNSET text: Unset | str = UNSET tif: Unset | Tif = UNSET - algo: Unset | "CreateMultiLegOrderRequestAlgo" = UNSET - market_condition: Unset | "CreateMultiLegOrderRequestMarketCondition" = UNSET - optional_data: Unset | "CreateMultiLegOrderRequestOptionalData" = UNSET + algo: Unset | CreateMultiLegOrderRequestAlgo = UNSET + market_condition: Unset | CreateMultiLegOrderRequestMarketCondition = UNSET + optional_data: Unset | CreateMultiLegOrderRequestOptionalData = UNSET def to_dict(self) -> dict[str, Any]: account_id = self.account_id diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py b/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py index 6a0ce121e..9461085e9 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py b/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py index 6e09d847c..6e6ee2f42 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py b/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py index 4fd71eee3..500a545fe 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_response.py b/openapi_project/openapi_package/models/create_multi_leg_order_response.py index 26f382afb..eb5f4939b 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_response.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -26,7 +28,7 @@ class CreateMultiLegOrderResponse: status_code (Unset | StatusCode): """ - multi_leg_order: Unset | "MultiLegOrder" = UNSET + multi_leg_order: Unset | MultiLegOrder = UNSET error_message: Unset | str = UNSET status_code: Unset | StatusCode = UNSET diff --git a/openapi_project/openapi_package/models/create_order_cross_allocation.py b/openapi_project/openapi_package/models/create_order_cross_allocation.py index 172eb616e..3774d4727 100644 --- a/openapi_project/openapi_package/models/create_order_cross_allocation.py +++ b/openapi_project/openapi_package/models/create_order_cross_allocation.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -13,11 +15,11 @@ from typing import cast if TYPE_CHECKING: + from ..models.order_instruction import OrderInstruction from ..models.clearing_info import ClearingInfo from ..models.create_order_cross_allocation_optional_data import ( CreateOrderCrossAllocationOptionalData, ) - from ..models.order_instruction import OrderInstruction T = TypeVar("T", bound="CreateOrderCrossAllocation") @@ -29,7 +31,7 @@ class CreateOrderCrossAllocation: Attributes: account_id (Unset | int): clearing_info (Unset | ClearingInfo): - instructions (Unset | list['OrderInstruction']): + instructions (Unset | list[OrderInstruction]): optional_data (Unset | CreateOrderCrossAllocationOptionalData): position_effect (Unset | PositionEffect): qty (Unset | float): @@ -38,9 +40,9 @@ class CreateOrderCrossAllocation: """ account_id: Unset | int = UNSET - clearing_info: Unset | "ClearingInfo" = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - optional_data: Unset | "CreateOrderCrossAllocationOptionalData" = UNSET + clearing_info: Unset | ClearingInfo = UNSET + instructions: Unset | list[OrderInstruction] = UNSET + optional_data: Unset | CreateOrderCrossAllocationOptionalData = UNSET position_effect: Unset | PositionEffect = UNSET qty: Unset | float = UNSET side: Unset | Side = UNSET diff --git a/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py b/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py index 9bbdb5155..651c10e1e 100644 --- a/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py +++ b/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/create_order_cross_request.py b/openapi_project/openapi_package/models/create_order_cross_request.py index 38ed6d441..788da0c23 100644 --- a/openapi_project/openapi_package/models/create_order_cross_request.py +++ b/openapi_project/openapi_package/models/create_order_cross_request.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -14,16 +16,16 @@ from typing import cast if TYPE_CHECKING: + from ..models.create_order_cross_allocation import CreateOrderCrossAllocation from ..models.create_order_cross_request_algo import CreateOrderCrossRequestAlgo - from ..models.create_order_cross_request_market_condition import ( - CreateOrderCrossRequestMarketCondition, - ) from ..models.order_instruction import OrderInstruction - from ..models.flex_option import FlexOption - from ..models.create_order_cross_allocation import CreateOrderCrossAllocation from ..models.create_order_cross_request_optional_data import ( CreateOrderCrossRequestOptionalData, ) + from ..models.create_order_cross_request_market_condition import ( + CreateOrderCrossRequestMarketCondition, + ) + from ..models.flex_option import FlexOption T = TypeVar("T", bound="CreateOrderCrossRequest") @@ -34,9 +36,9 @@ class CreateOrderCrossRequest: """ Attributes: account_id (Unset | int): - allocations (Unset | list['CreateOrderCrossAllocation']): + allocations (Unset | list[CreateOrderCrossAllocation]): cross_type (Unset | CrossType): - instructions (Unset | list['OrderInstruction']): + instructions (Unset | list[OrderInstruction]): ord_type (Unset | OrdType): order_flags (Unset | int): parent_ord_id (Unset | str): @@ -55,9 +57,9 @@ class CreateOrderCrossRequest: """ account_id: Unset | int = UNSET - allocations: Unset | list["CreateOrderCrossAllocation"] = UNSET + allocations: Unset | list[CreateOrderCrossAllocation] = UNSET cross_type: Unset | CrossType = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET + instructions: Unset | list[OrderInstruction] = UNSET ord_type: Unset | OrdType = UNSET order_flags: Unset | int = UNSET parent_ord_id: Unset | str = UNSET @@ -69,10 +71,10 @@ class CreateOrderCrossRequest: tag: Unset | str = UNSET text: Unset | str = UNSET tif: Unset | Tif = UNSET - algo: Unset | "CreateOrderCrossRequestAlgo" = UNSET - market_condition: Unset | "CreateOrderCrossRequestMarketCondition" = UNSET - optional_data: Unset | "CreateOrderCrossRequestOptionalData" = UNSET - flex_option: Unset | "FlexOption" = UNSET + algo: Unset | CreateOrderCrossRequestAlgo = UNSET + market_condition: Unset | CreateOrderCrossRequestMarketCondition = UNSET + optional_data: Unset | CreateOrderCrossRequestOptionalData = UNSET + flex_option: Unset | FlexOption = UNSET def to_dict(self) -> dict[str, Any]: account_id = self.account_id diff --git a/openapi_project/openapi_package/models/create_order_cross_request_algo.py b/openapi_project/openapi_package/models/create_order_cross_request_algo.py index 61c390236..98e5aaf36 100644 --- a/openapi_project/openapi_package/models/create_order_cross_request_algo.py +++ b/openapi_project/openapi_package/models/create_order_cross_request_algo.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py b/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py index f6ea9a14b..62e0bb6bd 100644 --- a/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py +++ b/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py b/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py index b30719717..bf15703ed 100644 --- a/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py +++ b/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/create_order_cross_response.py b/openapi_project/openapi_package/models/create_order_cross_response.py index 4d089c0bb..fb9fdfcd0 100644 --- a/openapi_project/openapi_package/models/create_order_cross_response.py +++ b/openapi_project/openapi_package/models/create_order_cross_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -26,7 +28,7 @@ class CreateOrderCrossResponse: status_code (Unset | StatusCode): """ - order_cross: Unset | "OrderCross" = UNSET + order_cross: Unset | OrderCross = UNSET error_message: Unset | str = UNSET status_code: Unset | StatusCode = UNSET diff --git a/openapi_project/openapi_package/models/create_order_request.py b/openapi_project/openapi_package/models/create_order_request.py index 8efcca784..72aba571d 100644 --- a/openapi_project/openapi_package/models/create_order_request.py +++ b/openapi_project/openapi_package/models/create_order_request.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -15,16 +17,16 @@ from typing import cast if TYPE_CHECKING: + from ..models.order_instruction import OrderInstruction from ..models.create_order_request_optional_data import ( CreateOrderRequestOptionalData, ) - from ..models.create_order_request_algo import CreateOrderRequestAlgo - from ..models.order_instruction import OrderInstruction - from ..models.clearing_info import ClearingInfo - from ..models.flex_option import FlexOption from ..models.create_order_request_market_condition import ( CreateOrderRequestMarketCondition, ) + from ..models.create_order_request_algo import CreateOrderRequestAlgo + from ..models.clearing_info import ClearingInfo + from ..models.flex_option import FlexOption T = TypeVar("T", bound="CreateOrderRequest") @@ -37,7 +39,7 @@ class CreateOrderRequest: account_id (Unset | int): aux_price (Unset | float): clearing_info (Unset | ClearingInfo): - instructions (Unset | list['OrderInstruction']): + instructions (Unset | list[OrderInstruction]): ord_type (Unset | OrdType): order_flags (Unset | int): parent_ord_id (Unset | str): @@ -59,8 +61,8 @@ class CreateOrderRequest: account_id: Unset | int = UNSET aux_price: Unset | float = UNSET - clearing_info: Unset | "ClearingInfo" = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET + clearing_info: Unset | ClearingInfo = UNSET + instructions: Unset | list[OrderInstruction] = UNSET ord_type: Unset | OrdType = UNSET order_flags: Unset | int = UNSET parent_ord_id: Unset | str = UNSET @@ -74,10 +76,10 @@ class CreateOrderRequest: tag: Unset | str = UNSET text: Unset | str = UNSET tif: Unset | Tif = UNSET - algo: Unset | "CreateOrderRequestAlgo" = UNSET - market_condition: Unset | "CreateOrderRequestMarketCondition" = UNSET - optional_data: Unset | "CreateOrderRequestOptionalData" = UNSET - flex_option: Unset | "FlexOption" = UNSET + algo: Unset | CreateOrderRequestAlgo = UNSET + market_condition: Unset | CreateOrderRequestMarketCondition = UNSET + optional_data: Unset | CreateOrderRequestOptionalData = UNSET + flex_option: Unset | FlexOption = UNSET def to_dict(self) -> dict[str, Any]: account_id = self.account_id diff --git a/openapi_project/openapi_package/models/create_order_request_algo.py b/openapi_project/openapi_package/models/create_order_request_algo.py index d25c1f546..759f19df0 100644 --- a/openapi_project/openapi_package/models/create_order_request_algo.py +++ b/openapi_project/openapi_package/models/create_order_request_algo.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/create_order_request_market_condition.py b/openapi_project/openapi_package/models/create_order_request_market_condition.py index 78c5cd1c9..7abbe4728 100644 --- a/openapi_project/openapi_package/models/create_order_request_market_condition.py +++ b/openapi_project/openapi_package/models/create_order_request_market_condition.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/create_order_request_optional_data.py b/openapi_project/openapi_package/models/create_order_request_optional_data.py index 1b5817f2d..5905107a6 100644 --- a/openapi_project/openapi_package/models/create_order_request_optional_data.py +++ b/openapi_project/openapi_package/models/create_order_request_optional_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/create_order_response.py b/openapi_project/openapi_package/models/create_order_response.py index 70f7a9a22..f81573737 100644 --- a/openapi_project/openapi_package/models/create_order_response.py +++ b/openapi_project/openapi_package/models/create_order_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -26,7 +28,7 @@ class CreateOrderResponse: status_code (Unset | StatusCode): """ - order: Unset | "Order" = UNSET + order: Unset | Order = UNSET error_message: Unset | str = UNSET status_code: Unset | StatusCode = UNSET diff --git a/openapi_project/openapi_package/models/crypto.py b/openapi_project/openapi_package/models/crypto.py index fe6b66913..e41b10b80 100644 --- a/openapi_project/openapi_package/models/crypto.py +++ b/openapi_project/openapi_package/models/crypto.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -14,8 +16,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.date import Date from ..models.crypto_aliases import CryptoAliases + from ..models.date import Date T = TypeVar("T", bound="Crypto") @@ -47,10 +49,10 @@ class Crypto: quote_currency (Unset | Currency): """ - aliases: Unset | "CryptoAliases" = UNSET + aliases: Unset | CryptoAliases = UNSET currency: Unset | Currency = UNSET - listed_dt: Unset | "Date" = UNSET - delisted_dt: Unset | "Date" = UNSET + listed_dt: Unset | Date = UNSET + delisted_dt: Unset | Date = UNSET description: Unset | str = UNSET exchange_id: Unset | int = UNSET id: Unset | int = UNSET diff --git a/openapi_project/openapi_package/models/crypto_aliases.py b/openapi_project/openapi_package/models/crypto_aliases.py index be0d36c33..4d0e3443b 100644 --- a/openapi_project/openapi_package/models/crypto_aliases.py +++ b/openapi_project/openapi_package/models/crypto_aliases.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/date.py b/openapi_project/openapi_package/models/date.py index 978a5aea5..88e3416d8 100644 --- a/openapi_project/openapi_package/models/date.py +++ b/openapi_project/openapi_package/models/date.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/easy_to_borrow_security.py b/openapi_project/openapi_package/models/easy_to_borrow_security.py index c7a4fd78d..23854d471 100644 --- a/openapi_project/openapi_package/models/easy_to_borrow_security.py +++ b/openapi_project/openapi_package/models/easy_to_borrow_security.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/empty.py b/openapi_project/openapi_package/models/empty.py index 2eafd5b31..793114dcf 100644 --- a/openapi_project/openapi_package/models/empty.py +++ b/openapi_project/openapi_package/models/empty.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/exchange.py b/openapi_project/openapi_package/models/exchange.py index 55fd9372a..e0c39e522 100644 --- a/openapi_project/openapi_package/models/exchange.py +++ b/openapi_project/openapi_package/models/exchange.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/execution.py b/openapi_project/openapi_package/models/execution.py index 87d7defc5..9796f99c8 100644 --- a/openapi_project/openapi_package/models/execution.py +++ b/openapi_project/openapi_package/models/execution.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -19,12 +21,12 @@ from typing import cast if TYPE_CHECKING: + from ..models.execution_optional_data import ExecutionOptionalData from ..models.order_instruction import OrderInstruction from ..models.security import Security - from ..models.clearing_info import ClearingInfo - from ..models.header import Header - from ..models.execution_optional_data import ExecutionOptionalData from ..models.execution_algo import ExecutionAlgo + from ..models.header import Header + from ..models.clearing_info import ClearingInfo T = TypeVar("T", bound="Execution") @@ -54,7 +56,7 @@ class Execution: incoming_cl_ord_id (Unset | str): incoming_ord_id (Unset | str): incoming_orig_cl_ord_id (Unset | str): - instructions (Unset | list['OrderInstruction']): + instructions (Unset | list[OrderInstruction]): last_market (Unset | str): last_price (Unset | float): last_qty (Unset | float): @@ -90,12 +92,12 @@ class Execution: """ account_id: Unset | int = UNSET - algo: Unset | "ExecutionAlgo" = UNSET + algo: Unset | ExecutionAlgo = UNSET alloc_id: Unset | str = UNSET aux_price: Unset | float = UNSET avg_price: Unset | float = UNSET claimed_by: Unset | str = UNSET - clearing_info: Unset | "ClearingInfo" = UNSET + clearing_info: Unset | ClearingInfo = UNSET commission: Unset | float = UNSET cum_qty: Unset | float = UNSET cur_ord_id: Unset | str = UNSET @@ -105,11 +107,11 @@ class Execution: exec_type: Unset | ExecType = UNSET fee1: Unset | float = UNSET fee2: Unset | float = UNSET - header: Unset | "Header" = UNSET + header: Unset | Header = UNSET incoming_cl_ord_id: Unset | str = UNSET incoming_ord_id: Unset | str = UNSET incoming_orig_cl_ord_id: Unset | str = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET + instructions: Unset | list[OrderInstruction] = UNSET last_market: Unset | str = UNSET last_price: Unset | float = UNSET last_qty: Unset | float = UNSET @@ -117,7 +119,7 @@ class Execution: leg_id: Unset | str = UNSET liquidity_flag: Unset | str = UNSET multi_leg_reporting_type: Unset | MultiLegReportingType = UNSET - optional_data: Unset | "ExecutionOptionalData" = UNSET + optional_data: Unset | ExecutionOptionalData = UNSET order_flags: Unset | int = UNSET ord_status: Unset | OrdStatus = UNSET ord_type: Unset | OrdType = UNSET @@ -131,7 +133,7 @@ class Execution: qty: Unset | float = UNSET route: Unset | str = UNSET routing_session: Unset | str = UNSET - security: Unset | "Security" = UNSET + security: Unset | Security = UNSET side: Unset | Side = UNSET source: Unset | str = UNSET symbol: Unset | str = UNSET diff --git a/openapi_project/openapi_package/models/execution_algo.py b/openapi_project/openapi_package/models/execution_algo.py index 7b2807aea..4ef607baa 100644 --- a/openapi_project/openapi_package/models/execution_algo.py +++ b/openapi_project/openapi_package/models/execution_algo.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/execution_optional_data.py b/openapi_project/openapi_package/models/execution_optional_data.py index e4ef064a1..e0de3f038 100644 --- a/openapi_project/openapi_package/models/execution_optional_data.py +++ b/openapi_project/openapi_package/models/execution_optional_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/flex_option.py b/openapi_project/openapi_package/models/flex_option.py index 6ebfcca3b..a416a63bc 100644 --- a/openapi_project/openapi_package/models/flex_option.py +++ b/openapi_project/openapi_package/models/flex_option.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -18,8 +20,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.date import Date from ..models.flex_option_aliases import FlexOptionAliases + from ..models.date import Date T = TypeVar("T", bound="FlexOption") @@ -64,10 +66,10 @@ class FlexOption: underlying (Unset | str): """ - aliases: Unset | "FlexOptionAliases" = UNSET + aliases: Unset | FlexOptionAliases = UNSET currency: Unset | Currency = UNSET - listed_dt: Unset | "Date" = UNSET - delisted_dt: Unset | "Date" = UNSET + listed_dt: Unset | Date = UNSET + delisted_dt: Unset | Date = UNSET description: Unset | str = UNSET exchange_id: Unset | int = UNSET id: Unset | int = UNSET @@ -84,10 +86,10 @@ class FlexOption: tick_value: Unset | float = UNSET traded_exchanges: Unset | list[ExchangeCode] = UNSET cap_percentage: Unset | float = UNSET - creation_dt: Unset | "Date" = UNSET + creation_dt: Unset | Date = UNSET deliverable_per_contract: Unset | float = UNSET exercise_style: Unset | OptionExerciseStyle = UNSET - expiration_dt: Unset | "Date" = UNSET + expiration_dt: Unset | Date = UNSET observation_day: Unset | int = UNSET percentage_pricing: Unset | bool = UNSET product_type: Unset | OptionSeriesProductType = UNSET diff --git a/openapi_project/openapi_package/models/flex_option_aliases.py b/openapi_project/openapi_package/models/flex_option_aliases.py index c7010e3da..20ad39503 100644 --- a/openapi_project/openapi_package/models/flex_option_aliases.py +++ b/openapi_project/openapi_package/models/flex_option_aliases.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/future.py b/openapi_project/openapi_package/models/future.py index aeb0bfe6e..c27e20f56 100644 --- a/openapi_project/openapi_package/models/future.py +++ b/openapi_project/openapi_package/models/future.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -14,9 +16,9 @@ from typing import cast if TYPE_CHECKING: - from ..models.date import Date from ..models.future_aliases import FutureAliases from ..models.future_root import FutureRoot + from ..models.date import Date T = TypeVar("T", bound="Future") @@ -53,10 +55,10 @@ class Future: root (Unset | FutureRoot): """ - aliases: Unset | "FutureAliases" = UNSET + aliases: Unset | FutureAliases = UNSET currency: Unset | Currency = UNSET - listed_dt: Unset | "Date" = UNSET - delisted_dt: Unset | "Date" = UNSET + listed_dt: Unset | Date = UNSET + delisted_dt: Unset | Date = UNSET description: Unset | str = UNSET exchange_id: Unset | int = UNSET id: Unset | int = UNSET @@ -73,11 +75,11 @@ class Future: tick_value: Unset | float = UNSET traded_exchanges: Unset | list[ExchangeCode] = UNSET contract_myy: Unset | str = UNSET - first_notice_dt: Unset | "Date" = UNSET - first_trade_dt: Unset | "Date" = UNSET - last_notice_dt: Unset | "Date" = UNSET - last_trade_dt: Unset | "Date" = UNSET - root: Unset | "FutureRoot" = UNSET + first_notice_dt: Unset | Date = UNSET + first_trade_dt: Unset | Date = UNSET + last_notice_dt: Unset | Date = UNSET + last_trade_dt: Unset | Date = UNSET + root: Unset | FutureRoot = UNSET def to_dict(self) -> dict[str, Any]: aliases: Unset | dict[str, Any] = ( diff --git a/openapi_project/openapi_package/models/future_aliases.py b/openapi_project/openapi_package/models/future_aliases.py index a72d370cd..e2c4b3fe9 100644 --- a/openapi_project/openapi_package/models/future_aliases.py +++ b/openapi_project/openapi_package/models/future_aliases.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/future_root.py b/openapi_project/openapi_package/models/future_root.py index 6f1672c9a..d4b9c381a 100644 --- a/openapi_project/openapi_package/models/future_root.py +++ b/openapi_project/openapi_package/models/future_root.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -17,9 +19,9 @@ from typing import cast if TYPE_CHECKING: - from ..models.trading_session_group import TradingSessionGroup from ..models.future_root_aliases import FutureRootAliases from ..models.date import Date + from ..models.trading_session_group import TradingSessionGroup T = TypeVar("T", bound="FutureRoot") @@ -56,10 +58,10 @@ class FutureRoot: trading_session_group (Unset | TradingSessionGroup): """ - aliases: Unset | "FutureRootAliases" = UNSET + aliases: Unset | FutureRootAliases = UNSET currency: Unset | Currency = UNSET - listed_dt: Unset | "Date" = UNSET - delisted_dt: Unset | "Date" = UNSET + listed_dt: Unset | Date = UNSET + delisted_dt: Unset | Date = UNSET description: Unset | str = UNSET exchange_id: Unset | int = UNSET id: Unset | int = UNSET @@ -80,7 +82,7 @@ class FutureRoot: settlement_deliverable_type: Unset | SettlementDeliverableType = UNSET unit_of_measure: Unset | str = UNSET unit_of_measure_qty: Unset | float = UNSET - trading_session_group: Unset | "TradingSessionGroup" = UNSET + trading_session_group: Unset | TradingSessionGroup = UNSET def to_dict(self) -> dict[str, Any]: aliases: Unset | dict[str, Any] = ( diff --git a/openapi_project/openapi_package/models/future_root_aliases.py b/openapi_project/openapi_package/models/future_root_aliases.py index 7ef172152..150995a10 100644 --- a/openapi_project/openapi_package/models/future_root_aliases.py +++ b/openapi_project/openapi_package/models/future_root_aliases.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/future_spread.py b/openapi_project/openapi_package/models/future_spread.py index 411db953d..7932e8712 100644 --- a/openapi_project/openapi_package/models/future_spread.py +++ b/openapi_project/openapi_package/models/future_spread.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -14,9 +16,9 @@ from typing import cast if TYPE_CHECKING: + from ..models.future_spread_aliases import FutureSpreadAliases from ..models.future_spread_leg import FutureSpreadLeg from ..models.date import Date - from ..models.future_spread_aliases import FutureSpreadAliases T = TypeVar("T", bound="FutureSpread") @@ -51,14 +53,14 @@ class FutureSpread: first_trade_dt (Unset | Date): last_notice_dt (Unset | Date): last_trade_dt (Unset | Date): - legs (Unset | list['FutureSpreadLeg']): + legs (Unset | list[FutureSpreadLeg]): spread_code (Unset | str): """ - aliases: Unset | "FutureSpreadAliases" = UNSET + aliases: Unset | FutureSpreadAliases = UNSET currency: Unset | Currency = UNSET - listed_dt: Unset | "Date" = UNSET - delisted_dt: Unset | "Date" = UNSET + listed_dt: Unset | Date = UNSET + delisted_dt: Unset | Date = UNSET description: Unset | str = UNSET exchange_id: Unset | int = UNSET id: Unset | int = UNSET @@ -76,11 +78,11 @@ class FutureSpread: traded_exchanges: Unset | list[ExchangeCode] = UNSET contract_myy: Unset | str = UNSET display_factor: Unset | float = UNSET - first_notice_dt: Unset | "Date" = UNSET - first_trade_dt: Unset | "Date" = UNSET - last_notice_dt: Unset | "Date" = UNSET - last_trade_dt: Unset | "Date" = UNSET - legs: Unset | list["FutureSpreadLeg"] = UNSET + first_notice_dt: Unset | Date = UNSET + first_trade_dt: Unset | Date = UNSET + last_notice_dt: Unset | Date = UNSET + last_trade_dt: Unset | Date = UNSET + legs: Unset | list[FutureSpreadLeg] = UNSET spread_code: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: diff --git a/openapi_project/openapi_package/models/future_spread_aliases.py b/openapi_project/openapi_package/models/future_spread_aliases.py index c62532657..fe87693b8 100644 --- a/openapi_project/openapi_package/models/future_spread_aliases.py +++ b/openapi_project/openapi_package/models/future_spread_aliases.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/future_spread_leg.py b/openapi_project/openapi_package/models/future_spread_leg.py index 34ed49002..866dfd12b 100644 --- a/openapi_project/openapi_package/models/future_spread_leg.py +++ b/openapi_project/openapi_package/models/future_spread_leg.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -33,7 +35,7 @@ class FutureSpreadLeg: delta: Unset | float = UNSET price: Unset | float = UNSET ratio: Unset | int = UNSET - future: Unset | "Future" = UNSET + future: Unset | Future = UNSET side: Unset | SpreadLegSide = UNSET spread_leg_type: Unset | SpreadLegType = UNSET diff --git a/openapi_project/openapi_package/models/fx.py b/openapi_project/openapi_package/models/fx.py index 2cd8d52bc..84029a087 100644 --- a/openapi_project/openapi_package/models/fx.py +++ b/openapi_project/openapi_package/models/fx.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -47,10 +49,10 @@ class Fx: quote_currency (Unset | Currency): """ - aliases: Unset | "FxAliases" = UNSET + aliases: Unset | FxAliases = UNSET currency: Unset | Currency = UNSET - listed_dt: Unset | "Date" = UNSET - delisted_dt: Unset | "Date" = UNSET + listed_dt: Unset | Date = UNSET + delisted_dt: Unset | Date = UNSET description: Unset | str = UNSET exchange_id: Unset | int = UNSET id: Unset | int = UNSET diff --git a/openapi_project/openapi_package/models/fx_aliases.py b/openapi_project/openapi_package/models/fx_aliases.py index 5e2e7fb7d..c22853ee0 100644 --- a/openapi_project/openapi_package/models/fx_aliases.py +++ b/openapi_project/openapi_package/models/fx_aliases.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/generic_order.py b/openapi_project/openapi_package/models/generic_order.py index 555bec6f6..1fc1fd48b 100644 --- a/openapi_project/openapi_package/models/generic_order.py +++ b/openapi_project/openapi_package/models/generic_order.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -11,9 +13,9 @@ if TYPE_CHECKING: from ..models.order_cross import OrderCross - from ..models.multi_leg_order import MultiLegOrder from ..models.multi_leg_order_cross import MultiLegOrderCross from ..models.order import Order + from ..models.multi_leg_order import MultiLegOrder T = TypeVar("T", bound="GenericOrder") @@ -29,10 +31,10 @@ class GenericOrder: multi_leg_order_cross (Unset | MultiLegOrderCross): """ - order: Unset | "Order" = UNSET - order_cross: Unset | "OrderCross" = UNSET - multi_leg_order: Unset | "MultiLegOrder" = UNSET - multi_leg_order_cross: Unset | "MultiLegOrderCross" = UNSET + order: Unset | Order = UNSET + order_cross: Unset | OrderCross = UNSET + multi_leg_order: Unset | MultiLegOrder = UNSET + multi_leg_order_cross: Unset | MultiLegOrderCross = UNSET def to_dict(self) -> dict[str, Any]: order: Unset | dict[str, Any] = ( diff --git a/openapi_project/openapi_package/models/get_active_user_response.py b/openapi_project/openapi_package/models/get_active_user_response.py index 1ff439427..4e7a49362 100644 --- a/openapi_project/openapi_package/models/get_active_user_response.py +++ b/openapi_project/openapi_package/models/get_active_user_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -26,7 +28,7 @@ class GetActiveUserResponse: status_code (Unset | StatusCode): """ - user: Unset | "User" = UNSET + user: Unset | User = UNSET error_message: Unset | str = UNSET status_code: Unset | StatusCode = UNSET diff --git a/openapi_project/openapi_package/models/get_server_info_response.py b/openapi_project/openapi_package/models/get_server_info_response.py index 7877e28ff..f0f106359 100644 --- a/openapi_project/openapi_package/models/get_server_info_response.py +++ b/openapi_project/openapi_package/models/get_server_info_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -40,7 +42,7 @@ class GetServerInfoResponse: server_name: Unset | str = UNSET server_version: Unset | str = UNSET site: Unset | str = UNSET - system_settings: Unset | "GetServerInfoResponseSystemSettings" = UNSET + system_settings: Unset | GetServerInfoResponseSystemSettings = UNSET error_message: Unset | str = UNSET status_code: Unset | StatusCode = UNSET diff --git a/openapi_project/openapi_package/models/get_server_info_response_system_settings.py b/openapi_project/openapi_package/models/get_server_info_response_system_settings.py index a7c52b744..b6011e23a 100644 --- a/openapi_project/openapi_package/models/get_server_info_response_system_settings.py +++ b/openapi_project/openapi_package/models/get_server_info_response_system_settings.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/get_server_time_response.py b/openapi_project/openapi_package/models/get_server_time_response.py index 53adc55ba..5852d6dff 100644 --- a/openapi_project/openapi_package/models/get_server_time_response.py +++ b/openapi_project/openapi_package/models/get_server_time_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/get_trading_holidays_response.py b/openapi_project/openapi_package/models/get_trading_holidays_response.py index a1bd1dadf..0d8d46b63 100644 --- a/openapi_project/openapi_package/models/get_trading_holidays_response.py +++ b/openapi_project/openapi_package/models/get_trading_holidays_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -21,12 +23,12 @@ class GetTradingHolidaysResponse: """ Attributes: - trading_holidays (Unset | list['TradingHoliday']): + trading_holidays (Unset | list[TradingHoliday]): error_message (Unset | str): status_code (Unset | StatusCode): """ - trading_holidays: Unset | list["TradingHoliday"] = UNSET + trading_holidays: Unset | list[TradingHoliday] = UNSET error_message: Unset | str = UNSET status_code: Unset | StatusCode = UNSET diff --git a/openapi_project/openapi_package/models/header.py b/openapi_project/openapi_package/models/header.py index 6ef8db824..fc700def2 100644 --- a/openapi_project/openapi_package/models/header.py +++ b/openapi_project/openapi_package/models/header.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/index.py b/openapi_project/openapi_package/models/index.py index 7d0b313bc..c7f983e9c 100644 --- a/openapi_project/openapi_package/models/index.py +++ b/openapi_project/openapi_package/models/index.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -14,8 +16,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.date import Date from ..models.index_aliases import IndexAliases + from ..models.date import Date T = TypeVar("T", bound="Index") @@ -46,10 +48,10 @@ class Index: traded_exchanges (Unset | list[ExchangeCode]): """ - aliases: Unset | "IndexAliases" = UNSET + aliases: Unset | IndexAliases = UNSET currency: Unset | Currency = UNSET - listed_dt: Unset | "Date" = UNSET - delisted_dt: Unset | "Date" = UNSET + listed_dt: Unset | Date = UNSET + delisted_dt: Unset | Date = UNSET description: Unset | str = UNSET exchange_id: Unset | int = UNSET id: Unset | int = UNSET diff --git a/openapi_project/openapi_package/models/index_aliases.py b/openapi_project/openapi_package/models/index_aliases.py index c65141cbe..7ffb287b9 100644 --- a/openapi_project/openapi_package/models/index_aliases.py +++ b/openapi_project/openapi_package/models/index_aliases.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/list_accounts_response.py b/openapi_project/openapi_package/models/list_accounts_response.py index 6f03d479a..f9a4d9b12 100644 --- a/openapi_project/openapi_package/models/list_accounts_response.py +++ b/openapi_project/openapi_package/models/list_accounts_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -21,12 +23,12 @@ class ListAccountsResponse: """ Attributes: - accounts (Unset | list['Account']): + accounts (Unset | list[Account]): error_message (Unset | str): status_code (Unset | StatusCode): """ - accounts: Unset | list["Account"] = UNSET + accounts: Unset | list[Account] = UNSET error_message: Unset | str = UNSET status_code: Unset | StatusCode = UNSET diff --git a/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py b/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py index 4fd221f02..e49e07844 100644 --- a/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py +++ b/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -21,12 +23,12 @@ class ListAffiliatedTradingFirmsResponse: """ Attributes: - affiliated_firms (Unset | list['TradingFirmSlim']): + affiliated_firms (Unset | list[TradingFirmSlim]): error_message (Unset | str): status_code (Unset | StatusCode): """ - affiliated_firms: Unset | list["TradingFirmSlim"] = UNSET + affiliated_firms: Unset | list[TradingFirmSlim] = UNSET error_message: Unset | str = UNSET status_code: Unset | StatusCode = UNSET diff --git a/openapi_project/openapi_package/models/list_easy_to_borrow_securities_request.py b/openapi_project/openapi_package/models/list_easy_to_borrow_securities_request.py index 7ecce79fe..17392ee91 100644 --- a/openapi_project/openapi_package/models/list_easy_to_borrow_securities_request.py +++ b/openapi_project/openapi_package/models/list_easy_to_borrow_securities_request.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py b/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py index f8ab79c6f..e4f90ad6f 100644 --- a/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py +++ b/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -21,12 +23,12 @@ class ListEasyToBorrowSecuritiesResponse: """ Attributes: - securities (Unset | list['EasyToBorrowSecurity']): + securities (Unset | list[EasyToBorrowSecurity]): error_message (Unset | str): status_code (Unset | StatusCode): """ - securities: Unset | list["EasyToBorrowSecurity"] = UNSET + securities: Unset | list[EasyToBorrowSecurity] = UNSET error_message: Unset | str = UNSET status_code: Unset | StatusCode = UNSET diff --git a/openapi_project/openapi_package/models/list_exchanges_response.py b/openapi_project/openapi_package/models/list_exchanges_response.py index 9cd6c0cde..bfe656757 100644 --- a/openapi_project/openapi_package/models/list_exchanges_response.py +++ b/openapi_project/openapi_package/models/list_exchanges_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -21,12 +23,12 @@ class ListExchangesResponse: """ Attributes: - exchanges (Unset | list['Exchange']): + exchanges (Unset | list[Exchange]): error_message (Unset | str): status_code (Unset | StatusCode): """ - exchanges: Unset | list["Exchange"] = UNSET + exchanges: Unset | list[Exchange] = UNSET error_message: Unset | str = UNSET status_code: Unset | StatusCode = UNSET diff --git a/openapi_project/openapi_package/models/list_option_chains_repsonse.py b/openapi_project/openapi_package/models/list_option_chains_repsonse.py index 679ad1b2c..e209c038a 100644 --- a/openapi_project/openapi_package/models/list_option_chains_repsonse.py +++ b/openapi_project/openapi_package/models/list_option_chains_repsonse.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -21,12 +23,12 @@ class ListOptionChainsRepsonse: """ Attributes: - option_chains (Unset | list['OptionChain']): + option_chains (Unset | list[OptionChain]): error_message (Unset | str): status_code (Unset | StatusCode): """ - option_chains: Unset | list["OptionChain"] = UNSET + option_chains: Unset | list[OptionChain] = UNSET error_message: Unset | str = UNSET status_code: Unset | StatusCode = UNSET diff --git a/openapi_project/openapi_package/models/list_option_chains_request.py b/openapi_project/openapi_package/models/list_option_chains_request.py index 78f1e7a62..0e8e285a1 100644 --- a/openapi_project/openapi_package/models/list_option_chains_request.py +++ b/openapi_project/openapi_package/models/list_option_chains_request.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/list_orders_response.py b/openapi_project/openapi_package/models/list_orders_response.py index 12d302248..bec55729f 100644 --- a/openapi_project/openapi_package/models/list_orders_response.py +++ b/openapi_project/openapi_package/models/list_orders_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -21,12 +23,12 @@ class ListOrdersResponse: """ Attributes: - orders (Unset | list['GenericOrder']): + orders (Unset | list[GenericOrder]): error_message (Unset | str): status_code (Unset | StatusCode): """ - orders: Unset | list["GenericOrder"] = UNSET + orders: Unset | list[GenericOrder] = UNSET error_message: Unset | str = UNSET status_code: Unset | StatusCode = UNSET diff --git a/openapi_project/openapi_package/models/list_positions_response.py b/openapi_project/openapi_package/models/list_positions_response.py index c04b4c0cf..a5fe88197 100644 --- a/openapi_project/openapi_package/models/list_positions_response.py +++ b/openapi_project/openapi_package/models/list_positions_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -21,12 +23,12 @@ class ListPositionsResponse: """ Attributes: - positions (Unset | list['Position']): + positions (Unset | list[Position]): error_message (Unset | str): status_code (Unset | StatusCode): """ - positions: Unset | list["Position"] = UNSET + positions: Unset | list[Position] = UNSET error_message: Unset | str = UNSET status_code: Unset | StatusCode = UNSET diff --git a/openapi_project/openapi_package/models/list_routes_response.py b/openapi_project/openapi_package/models/list_routes_response.py index 4c47fbcb5..c5789d0b8 100644 --- a/openapi_project/openapi_package/models/list_routes_response.py +++ b/openapi_project/openapi_package/models/list_routes_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -22,14 +24,14 @@ class ListRoutesResponse: """ Attributes: - routes (Unset | list['Route']): - route_applicabilities (Unset | list['RouteApplicability']): + routes (Unset | list[Route]): + route_applicabilities (Unset | list[RouteApplicability]): error_message (Unset | str): status_code (Unset | StatusCode): """ - routes: Unset | list["Route"] = UNSET - route_applicabilities: Unset | list["RouteApplicability"] = UNSET + routes: Unset | list[Route] = UNSET + route_applicabilities: Unset | list[RouteApplicability] = UNSET error_message: Unset | str = UNSET status_code: Unset | StatusCode = UNSET diff --git a/openapi_project/openapi_package/models/list_securities_request.py b/openapi_project/openapi_package/models/list_securities_request.py index 6469e7d52..39f9d21c3 100644 --- a/openapi_project/openapi_package/models/list_securities_request.py +++ b/openapi_project/openapi_package/models/list_securities_request.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/list_securities_response.py b/openapi_project/openapi_package/models/list_securities_response.py index d0ee036a8..46a6bbb11 100644 --- a/openapi_project/openapi_package/models/list_securities_response.py +++ b/openapi_project/openapi_package/models/list_securities_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -21,12 +23,12 @@ class ListSecuritiesResponse: """ Attributes: - securities (Unset | list['Security']): + securities (Unset | list[Security]): error_message (Unset | str): status_code (Unset | StatusCode): """ - securities: Unset | list["Security"] = UNSET + securities: Unset | list[Security] = UNSET error_message: Unset | str = UNSET status_code: Unset | StatusCode = UNSET diff --git a/openapi_project/openapi_package/models/list_trade_confirms_response.py b/openapi_project/openapi_package/models/list_trade_confirms_response.py index 21d3d368d..e81edf387 100644 --- a/openapi_project/openapi_package/models/list_trade_confirms_response.py +++ b/openapi_project/openapi_package/models/list_trade_confirms_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -21,12 +23,12 @@ class ListTradeConfirmsResponse: """ Attributes: - trade_confirms (Unset | list['TradeConfirm']): + trade_confirms (Unset | list[TradeConfirm]): error_message (Unset | str): status_code (Unset | StatusCode): """ - trade_confirms: Unset | list["TradeConfirm"] = UNSET + trade_confirms: Unset | list[TradeConfirm] = UNSET error_message: Unset | str = UNSET status_code: Unset | StatusCode = UNSET diff --git a/openapi_project/openapi_package/models/list_trading_firms_response.py b/openapi_project/openapi_package/models/list_trading_firms_response.py index 41e98eb19..642593708 100644 --- a/openapi_project/openapi_package/models/list_trading_firms_response.py +++ b/openapi_project/openapi_package/models/list_trading_firms_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -21,12 +23,12 @@ class ListTradingFirmsResponse: """ Attributes: - trading_firms (Unset | list['TradingFirm']): + trading_firms (Unset | list[TradingFirm]): error_message (Unset | str): status_code (Unset | StatusCode): """ - trading_firms: Unset | list["TradingFirm"] = UNSET + trading_firms: Unset | list[TradingFirm] = UNSET error_message: Unset | str = UNSET status_code: Unset | StatusCode = UNSET diff --git a/openapi_project/openapi_package/models/login_request.py b/openapi_project/openapi_package/models/login_request.py index 149a07954..9ce26061c 100644 --- a/openapi_project/openapi_package/models/login_request.py +++ b/openapi_project/openapi_package/models/login_request.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/login_response.py b/openapi_project/openapi_package/models/login_response.py index cbd7c52c5..a97b07c32 100644 --- a/openapi_project/openapi_package/models/login_response.py +++ b/openapi_project/openapi_package/models/login_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -51,8 +53,8 @@ class LoginResponse: server_version: Unset | str = UNSET site: Unset | str = UNSET text: Unset | str = UNSET - user: Unset | "User" = UNSET - system_settings: Unset | "LoginResponseSystemSettings" = UNSET + user: Unset | User = UNSET + system_settings: Unset | LoginResponseSystemSettings = UNSET error_message: Unset | str = UNSET status_code: Unset | StatusCode = UNSET diff --git a/openapi_project/openapi_package/models/login_response_system_settings.py b/openapi_project/openapi_package/models/login_response_system_settings.py index b9c026dc6..3b807559a 100644 --- a/openapi_project/openapi_package/models/login_response_system_settings.py +++ b/openapi_project/openapi_package/models/login_response_system_settings.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/margin_data.py b/openapi_project/openapi_package/models/margin_data.py index 1e4f9c468..6c9f61c77 100644 --- a/openapi_project/openapi_package/models/margin_data.py +++ b/openapi_project/openapi_package/models/margin_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -10,8 +12,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.empty import Empty from ..models.tims_margin_data import TimsMarginData + from ..models.empty import Empty T = TypeVar("T", bound="MarginData") @@ -27,8 +29,8 @@ class MarginData: """ account_id: Unset | int = UNSET - tims: Unset | "TimsMarginData" = UNSET - span: Unset | "Empty" = UNSET + tims: Unset | TimsMarginData = UNSET + span: Unset | Empty = UNSET def to_dict(self) -> dict[str, Any]: account_id = self.account_id diff --git a/openapi_project/openapi_package/models/multi_leg_order.py b/openapi_project/openapi_package/models/multi_leg_order.py index 71fd5ef2e..7c2a8620b 100644 --- a/openapi_project/openapi_package/models/multi_leg_order.py +++ b/openapi_project/openapi_package/models/multi_leg_order.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -15,14 +17,14 @@ from typing import cast if TYPE_CHECKING: - from ..models.multi_leg_order_leg import MultiLegOrderLeg from ..models.multi_leg_order_algo import MultiLegOrderAlgo - from ..models.order_instruction import OrderInstruction + from ..models.multi_leg_order_optional_data import MultiLegOrderOptionalData from ..models.order_update_event import OrderUpdateEvent - from ..models.clearing_info import ClearingInfo + from ..models.order_instruction import OrderInstruction + from ..models.multi_leg_order_leg import MultiLegOrderLeg from ..models.header import Header from ..models.multi_leg_order_market_condition import MultiLegOrderMarketCondition - from ..models.multi_leg_order_optional_data import MultiLegOrderOptionalData + from ..models.clearing_info import ClearingInfo T = TypeVar("T", bound="MultiLegOrder") @@ -41,12 +43,12 @@ class MultiLegOrder: id (Unset | str): incoming_cl_ord_id (Unset | str): incoming_ord_id (Unset | str): - instructions (Unset | list['OrderInstruction']): - legs (Unset | list['MultiLegOrderLeg']): + instructions (Unset | list[OrderInstruction]): + legs (Unset | list[MultiLegOrderLeg]): market_condition (Unset | MultiLegOrderMarketCondition): optional_data (Unset | MultiLegOrderOptionalData): order_flags (Unset | int): - order_updates (Unset | list['OrderUpdateEvent']): + order_updates (Unset | list[OrderUpdateEvent]): ord_type (Unset | OrdType): origination_type (Unset | OriginationType): parent_ord_id (Unset | str): @@ -78,20 +80,20 @@ class MultiLegOrder: """ account_id: Unset | int = UNSET - algo: Unset | "MultiLegOrderAlgo" = UNSET + algo: Unset | MultiLegOrderAlgo = UNSET aux_price: Unset | float = UNSET - clearing_info: Unset | "ClearingInfo" = UNSET + clearing_info: Unset | ClearingInfo = UNSET cur_ord_id: Unset | str = UNSET - header: Unset | "Header" = UNSET + header: Unset | Header = UNSET id: Unset | str = UNSET incoming_cl_ord_id: Unset | str = UNSET incoming_ord_id: Unset | str = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - legs: Unset | list["MultiLegOrderLeg"] = UNSET - market_condition: Unset | "MultiLegOrderMarketCondition" = UNSET - optional_data: Unset | "MultiLegOrderOptionalData" = UNSET + instructions: Unset | list[OrderInstruction] = UNSET + legs: Unset | list[MultiLegOrderLeg] = UNSET + market_condition: Unset | MultiLegOrderMarketCondition = UNSET + optional_data: Unset | MultiLegOrderOptionalData = UNSET order_flags: Unset | int = UNSET - order_updates: Unset | list["OrderUpdateEvent"] = UNSET + order_updates: Unset | list[OrderUpdateEvent] = UNSET ord_type: Unset | OrdType = UNSET origination_type: Unset | OriginationType = UNSET parent_ord_id: Unset | str = UNSET diff --git a/openapi_project/openapi_package/models/multi_leg_order_algo.py b/openapi_project/openapi_package/models/multi_leg_order_algo.py index 4a1e0201f..ad5cc6979 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_algo.py +++ b/openapi_project/openapi_package/models/multi_leg_order_algo.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py index f2d12bc85..cacfca3ea 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -15,18 +17,18 @@ from typing import cast if TYPE_CHECKING: - from ..models.multi_leg_order_cancel_replace_request_optional_data import ( - MultiLegOrderCancelReplaceRequestOptionalData, - ) from ..models.multi_leg_order_cancel_replace_request_market_condition import ( MultiLegOrderCancelReplaceRequestMarketCondition, ) from ..models.order_instruction import OrderInstruction - from ..models.clearing_info import ClearingInfo - from ..models.header import Header from ..models.multi_leg_order_cancel_replace_request_algo import ( MultiLegOrderCancelReplaceRequestAlgo, ) + from ..models.header import Header + from ..models.clearing_info import ClearingInfo + from ..models.multi_leg_order_cancel_replace_request_optional_data import ( + MultiLegOrderCancelReplaceRequestOptionalData, + ) T = TypeVar("T", bound="MultiLegOrderCancelReplaceRequest") @@ -43,7 +45,7 @@ class MultiLegOrderCancelReplaceRequest: header (Unset | Header): incoming_cl_ord_id (Unset | str): incoming_orig_cl_ord_id (Unset | str): - instructions (Unset | list['OrderInstruction']): + instructions (Unset | list[OrderInstruction]): optional_data (Unset | MultiLegOrderCancelReplaceRequestOptionalData): market_condition (Unset | MultiLegOrderCancelReplaceRequestMarketCondition): ord_type (Unset | OrdType): @@ -63,16 +65,16 @@ class MultiLegOrderCancelReplaceRequest: user_id (Unset | int): """ - algo: Unset | "MultiLegOrderCancelReplaceRequestAlgo" = UNSET + algo: Unset | MultiLegOrderCancelReplaceRequestAlgo = UNSET aux_price: Unset | float = UNSET - clearing_info: Unset | "ClearingInfo" = UNSET + clearing_info: Unset | ClearingInfo = UNSET cur_ord_id: Unset | str = UNSET - header: Unset | "Header" = UNSET + header: Unset | Header = UNSET incoming_cl_ord_id: Unset | str = UNSET incoming_orig_cl_ord_id: Unset | str = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - optional_data: Unset | "MultiLegOrderCancelReplaceRequestOptionalData" = UNSET - market_condition: Unset | "MultiLegOrderCancelReplaceRequestMarketCondition" = UNSET + instructions: Unset | list[OrderInstruction] = UNSET + optional_data: Unset | MultiLegOrderCancelReplaceRequestOptionalData = UNSET + market_condition: Unset | MultiLegOrderCancelReplaceRequestMarketCondition = UNSET ord_type: Unset | OrdType = UNSET origination_type: Unset | OriginationType = UNSET perm_ord_id: Unset | str = UNSET diff --git a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py index 05993cc3e..d8c58d78f 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py index 60af45151..6f1689301 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py index 9d8849f57..3b3d7f894 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross.py b/openapi_project/openapi_package/models/multi_leg_order_cross.py index 1b0b3663e..e3406a8ea 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -16,17 +18,17 @@ from typing import cast if TYPE_CHECKING: - from ..models.multi_leg_order_cross_optional_data import ( - MultiLegOrderCrossOptionalData, - ) - from ..models.order_instruction import OrderInstruction from ..models.order_update_event import OrderUpdateEvent - from ..models.multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation + from ..models.order_instruction import OrderInstruction from ..models.multi_leg_order_cross_algo import MultiLegOrderCrossAlgo - from ..models.header import Header from ..models.multi_leg_order_cross_market_condition import ( MultiLegOrderCrossMarketCondition, ) + from ..models.multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation + from ..models.header import Header + from ..models.multi_leg_order_cross_optional_data import ( + MultiLegOrderCrossOptionalData, + ) T = TypeVar("T", bound="MultiLegOrderCross") @@ -38,18 +40,18 @@ class MultiLegOrderCross: Attributes: account_id (Unset | int): algo (Unset | MultiLegOrderCrossAlgo): - allocations (Unset | list['MultiLegOrderCrossAllocation']): + allocations (Unset | list[MultiLegOrderCrossAllocation]): cross_type (Unset | CrossType): cur_ord_id (Unset | str): header (Unset | Header): id (Unset | str): incoming_cl_ord_id (Unset | str): incoming_ord_id (Unset | str): - instructions (Unset | list['OrderInstruction']): + instructions (Unset | list[OrderInstruction]): market_condition (Unset | MultiLegOrderCrossMarketCondition): optional_data (Unset | MultiLegOrderCrossOptionalData): order_flags (Unset | int): - order_updates (Unset | list['OrderUpdateEvent']): + order_updates (Unset | list[OrderUpdateEvent]): ord_type (Unset | OrdType): origination_type (Unset | OriginationType): parent_ord_id (Unset | str): @@ -74,19 +76,19 @@ class MultiLegOrderCross: """ account_id: Unset | int = UNSET - algo: Unset | "MultiLegOrderCrossAlgo" = UNSET - allocations: Unset | list["MultiLegOrderCrossAllocation"] = UNSET + algo: Unset | MultiLegOrderCrossAlgo = UNSET + allocations: Unset | list[MultiLegOrderCrossAllocation] = UNSET cross_type: Unset | CrossType = UNSET cur_ord_id: Unset | str = UNSET - header: Unset | "Header" = UNSET + header: Unset | Header = UNSET id: Unset | str = UNSET incoming_cl_ord_id: Unset | str = UNSET incoming_ord_id: Unset | str = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - market_condition: Unset | "MultiLegOrderCrossMarketCondition" = UNSET - optional_data: Unset | "MultiLegOrderCrossOptionalData" = UNSET + instructions: Unset | list[OrderInstruction] = UNSET + market_condition: Unset | MultiLegOrderCrossMarketCondition = UNSET + optional_data: Unset | MultiLegOrderCrossOptionalData = UNSET order_flags: Unset | int = UNSET - order_updates: Unset | list["OrderUpdateEvent"] = UNSET + order_updates: Unset | list[OrderUpdateEvent] = UNSET ord_type: Unset | OrdType = UNSET origination_type: Unset | OriginationType = UNSET parent_ord_id: Unset | str = UNSET diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py b/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py index babb4a6e0..4802c7f97 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py index d1659822e..caf827a0d 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -12,12 +14,12 @@ from typing import cast if TYPE_CHECKING: - from ..models.multi_leg_order_leg import MultiLegOrderLeg + from ..models.order_instruction import OrderInstruction from ..models.clearing_info import ClearingInfo from ..models.multi_leg_order_cross_allocation_optional_data import ( MultiLegOrderCrossAllocationOptionalData, ) - from ..models.order_instruction import OrderInstruction + from ..models.multi_leg_order_leg import MultiLegOrderLeg T = TypeVar("T", bound="MultiLegOrderCrossAllocation") @@ -30,8 +32,8 @@ class MultiLegOrderCrossAllocation: account_id (Unset | int): clearing_info (Unset | ClearingInfo): id (Unset | str): - instructions (Unset | list['OrderInstruction']): - legs (Unset | list['MultiLegOrderLeg']): + instructions (Unset | list[OrderInstruction]): + legs (Unset | list[MultiLegOrderLeg]): optional_data (Unset | MultiLegOrderCrossAllocationOptionalData): qty (Unset | float): side_type (Unset | CrossSideType): @@ -48,11 +50,11 @@ class MultiLegOrderCrossAllocation: """ account_id: Unset | int = UNSET - clearing_info: Unset | "ClearingInfo" = UNSET + clearing_info: Unset | ClearingInfo = UNSET id: Unset | str = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - legs: Unset | list["MultiLegOrderLeg"] = UNSET - optional_data: Unset | "MultiLegOrderCrossAllocationOptionalData" = UNSET + instructions: Unset | list[OrderInstruction] = UNSET + legs: Unset | list[MultiLegOrderLeg] = UNSET + optional_data: Unset | MultiLegOrderCrossAllocationOptionalData = UNSET qty: Unset | float = UNSET side_type: Unset | CrossSideType = UNSET avg_price: Unset | float = UNSET diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py index 01a1b17f9..5e3f075d3 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py b/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py index e025b2919..24f82a634 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py index 1e04e1d0a..063ad738a 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/multi_leg_order_leg.py b/openapi_project/openapi_package/models/multi_leg_order_leg.py index 1d15729c1..514892ebe 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_leg.py +++ b/openapi_project/openapi_package/models/multi_leg_order_leg.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -12,12 +14,12 @@ from typing import cast if TYPE_CHECKING: - from ..models.order_update_event import OrderUpdateEvent - from ..models.security import Security + from ..models.multi_leg_order_leg_optional_data import MultiLegOrderLegOptionalData from ..models.multi_leg_order_leg_market_condition import ( MultiLegOrderLegMarketCondition, ) - from ..models.multi_leg_order_leg_optional_data import MultiLegOrderLegOptionalData + from ..models.security import Security + from ..models.order_update_event import OrderUpdateEvent T = TypeVar("T", bound="MultiLegOrderLeg") @@ -30,7 +32,7 @@ class MultiLegOrderLeg: id (Unset | str): market_condition (Unset | MultiLegOrderLegMarketCondition): optional_data (Unset | MultiLegOrderLegOptionalData): - order_updates (Unset | list['OrderUpdateEvent']): + order_updates (Unset | list[OrderUpdateEvent]): position_effect (Unset | PositionEffect): price (Unset | float): qty (Unset | float): @@ -48,14 +50,14 @@ class MultiLegOrderLeg: """ id: Unset | str = UNSET - market_condition: Unset | "MultiLegOrderLegMarketCondition" = UNSET - optional_data: Unset | "MultiLegOrderLegOptionalData" = UNSET - order_updates: Unset | list["OrderUpdateEvent"] = UNSET + market_condition: Unset | MultiLegOrderLegMarketCondition = UNSET + optional_data: Unset | MultiLegOrderLegOptionalData = UNSET + order_updates: Unset | list[OrderUpdateEvent] = UNSET position_effect: Unset | PositionEffect = UNSET price: Unset | float = UNSET qty: Unset | float = UNSET ratio: Unset | int = UNSET - security: Unset | "Security" = UNSET + security: Unset | Security = UNSET side: Unset | Side = UNSET symbol: Unset | str = UNSET avg_price: Unset | float = UNSET diff --git a/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py b/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py index 7ab294fce..e93e2e535 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py +++ b/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py index d7637cd21..b2d6bb249 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py +++ b/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/multi_leg_order_market_condition.py b/openapi_project/openapi_package/models/multi_leg_order_market_condition.py index e201bcf2b..833ee0c78 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_market_condition.py +++ b/openapi_project/openapi_package/models/multi_leg_order_market_condition.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/multi_leg_order_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_optional_data.py index d62a58844..2b59e05f3 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_optional_data.py +++ b/openapi_project/openapi_package/models/multi_leg_order_optional_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/option.py b/openapi_project/openapi_package/models/option.py index d5624e70a..94ee344fe 100644 --- a/openapi_project/openapi_package/models/option.py +++ b/openapi_project/openapi_package/models/option.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -16,9 +18,9 @@ from typing import cast if TYPE_CHECKING: - from ..models.option_root import OptionRoot - from ..models.date import Date from ..models.option_aliases import OptionAliases + from ..models.date import Date + from ..models.option_root import OptionRoot T = TypeVar("T", bound="Option") @@ -57,10 +59,10 @@ class Option: underlying (Unset | str): """ - aliases: Unset | "OptionAliases" = UNSET + aliases: Unset | OptionAliases = UNSET currency: Unset | Currency = UNSET - listed_dt: Unset | "Date" = UNSET - delisted_dt: Unset | "Date" = UNSET + listed_dt: Unset | Date = UNSET + delisted_dt: Unset | Date = UNSET description: Unset | str = UNSET exchange_id: Unset | int = UNSET id: Unset | int = UNSET @@ -76,12 +78,12 @@ class Option: tick_size: Unset | float = UNSET tick_value: Unset | float = UNSET traded_exchanges: Unset | list[ExchangeCode] = UNSET - expiration_dt: Unset | "Date" = UNSET + expiration_dt: Unset | Date = UNSET expiration_style: Unset | OptionExpirationStyle = UNSET - first_trade_dt: Unset | "Date" = UNSET - last_trade_dt: Unset | "Date" = UNSET + first_trade_dt: Unset | Date = UNSET + last_trade_dt: Unset | Date = UNSET put_call: Unset | PutCall = UNSET - root: Unset | "OptionRoot" = UNSET + root: Unset | OptionRoot = UNSET strike: Unset | float = UNSET underlying: Unset | str = UNSET diff --git a/openapi_project/openapi_package/models/option_aliases.py b/openapi_project/openapi_package/models/option_aliases.py index 382c8f834..f075feb74 100644 --- a/openapi_project/openapi_package/models/option_aliases.py +++ b/openapi_project/openapi_package/models/option_aliases.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/option_chain.py b/openapi_project/openapi_package/models/option_chain.py index 588d5835b..9d0e0c6ea 100644 --- a/openapi_project/openapi_package/models/option_chain.py +++ b/openapi_project/openapi_package/models/option_chain.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -10,10 +12,10 @@ from typing import cast if TYPE_CHECKING: - from ..models.security import Security - from ..models.option_series import OptionSeries from ..models.option_chain_roots import OptionChainRoots + from ..models.security import Security from ..models.option_chain_options import OptionChainOptions + from ..models.option_series import OptionSeries T = TypeVar("T", bound="OptionChain") @@ -26,15 +28,15 @@ class OptionChain: underlying (Unset | Security): roots (Unset | OptionChainRoots): options (Unset | OptionChainOptions): - option_series (Unset | list['OptionSeries']): + option_series (Unset | list[OptionSeries]): post (Unset | str): station (Unset | str): """ - underlying: Unset | "Security" = UNSET - roots: Unset | "OptionChainRoots" = UNSET - options: Unset | "OptionChainOptions" = UNSET - option_series: Unset | list["OptionSeries"] = UNSET + underlying: Unset | Security = UNSET + roots: Unset | OptionChainRoots = UNSET + options: Unset | OptionChainOptions = UNSET + option_series: Unset | list[OptionSeries] = UNSET post: Unset | str = UNSET station: Unset | str = UNSET diff --git a/openapi_project/openapi_package/models/option_chain_option.py b/openapi_project/openapi_package/models/option_chain_option.py index 123a4579d..986f5741d 100644 --- a/openapi_project/openapi_package/models/option_chain_option.py +++ b/openapi_project/openapi_package/models/option_chain_option.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -39,9 +41,9 @@ class OptionChainOption: strike (Unset | float): """ - aliases: Unset | "OptionChainOptionAliases" = UNSET - listed_dt: Unset | "Date" = UNSET - delisted_dt: Unset | "Date" = UNSET + aliases: Unset | OptionChainOptionAliases = UNSET + listed_dt: Unset | Date = UNSET + delisted_dt: Unset | Date = UNSET description: Unset | str = UNSET exchange_id: Unset | int = UNSET id: Unset | int = UNSET @@ -49,8 +51,8 @@ class OptionChainOption: tick_size: Unset | float = UNSET tick_value: Unset | float = UNSET traded_exchanges: Unset | list[ExchangeCode] = UNSET - first_trade_dt: Unset | "Date" = UNSET - last_trade_dt: Unset | "Date" = UNSET + first_trade_dt: Unset | Date = UNSET + last_trade_dt: Unset | Date = UNSET put_call: Unset | PutCall = UNSET strike: Unset | float = UNSET diff --git a/openapi_project/openapi_package/models/option_chain_option_aliases.py b/openapi_project/openapi_package/models/option_chain_option_aliases.py index b2f44e5ec..5b49d38ab 100644 --- a/openapi_project/openapi_package/models/option_chain_option_aliases.py +++ b/openapi_project/openapi_package/models/option_chain_option_aliases.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/option_chain_options.py b/openapi_project/openapi_package/models/option_chain_options.py index 3a8c0e4a2..cb22fc1a8 100644 --- a/openapi_project/openapi_package/models/option_chain_options.py +++ b/openapi_project/openapi_package/models/option_chain_options.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -19,7 +21,7 @@ class OptionChainOptions: """ """ - additional_properties: dict[str, "OptionChainOption"] = _attrs_field( + additional_properties: dict[str, OptionChainOption] = _attrs_field( init=False, factory=dict ) @@ -53,10 +55,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) - def __getitem__(self, key: str) -> "OptionChainOption": + def __getitem__(self, key: str) -> OptionChainOption: return self.additional_properties[key] - def __setitem__(self, key: str, value: "OptionChainOption") -> None: + def __setitem__(self, key: str, value: OptionChainOption) -> None: self.additional_properties[key] = value def __delitem__(self, key: str) -> None: diff --git a/openapi_project/openapi_package/models/option_chain_roots.py b/openapi_project/openapi_package/models/option_chain_roots.py index a5c411850..49893e3f2 100644 --- a/openapi_project/openapi_package/models/option_chain_roots.py +++ b/openapi_project/openapi_package/models/option_chain_roots.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -19,7 +21,7 @@ class OptionChainRoots: """ """ - additional_properties: dict[str, "OptionRoot"] = _attrs_field( + additional_properties: dict[str, OptionRoot] = _attrs_field( init=False, factory=dict ) @@ -53,10 +55,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) - def __getitem__(self, key: str) -> "OptionRoot": + def __getitem__(self, key: str) -> OptionRoot: return self.additional_properties[key] - def __setitem__(self, key: str, value: "OptionRoot") -> None: + def __setitem__(self, key: str, value: OptionRoot) -> None: self.additional_properties[key] = value def __delitem__(self, key: str) -> None: diff --git a/openapi_project/openapi_package/models/option_root.py b/openapi_project/openapi_package/models/option_root.py index ed10f5510..08926d486 100644 --- a/openapi_project/openapi_package/models/option_root.py +++ b/openapi_project/openapi_package/models/option_root.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -18,10 +20,10 @@ from typing import cast if TYPE_CHECKING: - from ..models.option_root_aliases import OptionRootAliases - from ..models.settlement_info import SettlementInfo from ..models.date import Date + from ..models.settlement_info import SettlementInfo from ..models.trading_session_group import TradingSessionGroup + from ..models.option_root_aliases import OptionRootAliases T = TypeVar("T", bound="OptionRoot") @@ -54,7 +56,7 @@ class OptionRoot: exercise_style (Unset | OptionExerciseStyle): product_type (Unset | OptionSeriesProductType): series_type (Unset | OptionSeriesType): - settlement_infos (Unset | list['SettlementInfo']): + settlement_infos (Unset | list[SettlementInfo]): settlement_type (Unset | OptionSettlementType): strike_multiplier (Unset | float): strike_value (Unset | float): @@ -62,10 +64,10 @@ class OptionRoot: underlying (Unset | str): """ - aliases: Unset | "OptionRootAliases" = UNSET + aliases: Unset | OptionRootAliases = UNSET currency: Unset | Currency = UNSET - listed_dt: Unset | "Date" = UNSET - delisted_dt: Unset | "Date" = UNSET + listed_dt: Unset | Date = UNSET + delisted_dt: Unset | Date = UNSET description: Unset | str = UNSET exchange_id: Unset | int = UNSET id: Unset | int = UNSET @@ -85,11 +87,11 @@ class OptionRoot: exercise_style: Unset | OptionExerciseStyle = UNSET product_type: Unset | OptionSeriesProductType = UNSET series_type: Unset | OptionSeriesType = UNSET - settlement_infos: Unset | list["SettlementInfo"] = UNSET + settlement_infos: Unset | list[SettlementInfo] = UNSET settlement_type: Unset | OptionSettlementType = UNSET strike_multiplier: Unset | float = UNSET strike_value: Unset | float = UNSET - trading_session_group: Unset | "TradingSessionGroup" = UNSET + trading_session_group: Unset | TradingSessionGroup = UNSET underlying: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: diff --git a/openapi_project/openapi_package/models/option_root_aliases.py b/openapi_project/openapi_package/models/option_root_aliases.py index ef07f77e6..54f21378d 100644 --- a/openapi_project/openapi_package/models/option_root_aliases.py +++ b/openapi_project/openapi_package/models/option_root_aliases.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/option_series.py b/openapi_project/openapi_package/models/option_series.py index 313e215f5..c2be2e350 100644 --- a/openapi_project/openapi_package/models/option_series.py +++ b/openapi_project/openapi_package/models/option_series.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -42,7 +44,7 @@ class OptionSeries: security_category (Unset | SecurityCategory): """ - expiration_dt: Unset | "Date" = UNSET + expiration_dt: Unset | Date = UNSET expiration_style: Unset | OptionExpirationStyle = UNSET root_symbol: Unset | str = UNSET series_type: Unset | OptionSeriesType = UNSET diff --git a/openapi_project/openapi_package/models/order.py b/openapi_project/openapi_package/models/order.py index aa65af58c..292da356f 100644 --- a/openapi_project/openapi_package/models/order.py +++ b/openapi_project/openapi_package/models/order.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -17,14 +19,14 @@ from typing import cast if TYPE_CHECKING: + from ..models.order_optional_data import OrderOptionalData + from ..models.order_update_event import OrderUpdateEvent from ..models.order_instruction import OrderInstruction + from ..models.order_market_condition import OrderMarketCondition from ..models.security import Security from ..models.order_algo import OrderAlgo - from ..models.order_update_event import OrderUpdateEvent - from ..models.order_optional_data import OrderOptionalData - from ..models.clearing_info import ClearingInfo from ..models.header import Header - from ..models.order_market_condition import OrderMarketCondition + from ..models.clearing_info import ClearingInfo T = TypeVar("T", bound="Order") @@ -43,11 +45,11 @@ class Order: id (Unset | str): incoming_cl_ord_id (Unset | str): incoming_ord_id (Unset | str): - instructions (Unset | list['OrderInstruction']): + instructions (Unset | list[OrderInstruction]): market_condition (Unset | OrderMarketCondition): optional_data (Unset | OrderOptionalData): order_flags (Unset | int): - order_updates (Unset | list['OrderUpdateEvent']): + order_updates (Unset | list[OrderUpdateEvent]): ord_type (Unset | OrdType): origination_type (Unset | OriginationType): parent_ord_id (Unset | str): @@ -83,19 +85,19 @@ class Order: """ account_id: Unset | int = UNSET - algo: Unset | "OrderAlgo" = UNSET + algo: Unset | OrderAlgo = UNSET aux_price: Unset | float = UNSET - clearing_info: Unset | "ClearingInfo" = UNSET + clearing_info: Unset | ClearingInfo = UNSET cur_ord_id: Unset | str = UNSET - header: Unset | "Header" = UNSET + header: Unset | Header = UNSET id: Unset | str = UNSET incoming_cl_ord_id: Unset | str = UNSET incoming_ord_id: Unset | str = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - market_condition: Unset | "OrderMarketCondition" = UNSET - optional_data: Unset | "OrderOptionalData" = UNSET + instructions: Unset | list[OrderInstruction] = UNSET + market_condition: Unset | OrderMarketCondition = UNSET + optional_data: Unset | OrderOptionalData = UNSET order_flags: Unset | int = UNSET - order_updates: Unset | list["OrderUpdateEvent"] = UNSET + order_updates: Unset | list[OrderUpdateEvent] = UNSET ord_type: Unset | OrdType = UNSET origination_type: Unset | OriginationType = UNSET parent_ord_id: Unset | str = UNSET @@ -104,7 +106,7 @@ class Order: price_type: Unset | PriceType = UNSET qty: Unset | float = UNSET route: Unset | str = UNSET - security: Unset | "Security" = UNSET + security: Unset | Security = UNSET side: Unset | Side = UNSET source: Unset | str = UNSET source_address: Unset | str = UNSET diff --git a/openapi_project/openapi_package/models/order_algo.py b/openapi_project/openapi_package/models/order_algo.py index 3b6cfe7aa..69af1fda6 100644 --- a/openapi_project/openapi_package/models/order_algo.py +++ b/openapi_project/openapi_package/models/order_algo.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/order_cancel_reject.py b/openapi_project/openapi_package/models/order_cancel_reject.py index dc0487238..8e2e2900a 100644 --- a/openapi_project/openapi_package/models/order_cancel_reject.py +++ b/openapi_project/openapi_package/models/order_cancel_reject.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -42,7 +44,7 @@ class OrderCancelReject: incoming_cl_ord_id: Unset | str = UNSET incoming_orig_cl_ord_id: Unset | str = UNSET ord_status: Unset | OrdStatus = UNSET - optional_data: Unset | "OrderCancelRejectOptionalData" = UNSET + optional_data: Unset | OrderCancelRejectOptionalData = UNSET origination_type: Unset | OriginationType = UNSET perm_ord_id: Unset | str = UNSET req_ord_id: Unset | str = UNSET diff --git a/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py b/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py index 19fafac5c..ec1e21b05 100644 --- a/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py +++ b/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/order_cancel_replace_request.py b/openapi_project/openapi_package/models/order_cancel_replace_request.py index 29a212da2..163bc484d 100644 --- a/openapi_project/openapi_package/models/order_cancel_replace_request.py +++ b/openapi_project/openapi_package/models/order_cancel_replace_request.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -16,15 +18,15 @@ if TYPE_CHECKING: from ..models.order_instruction import OrderInstruction + from ..models.order_cancel_replace_request_optional_data import ( + OrderCancelReplaceRequestOptionalData, + ) from ..models.order_cancel_replace_request_market_condition import ( OrderCancelReplaceRequestMarketCondition, ) - from ..models.clearing_info import ClearingInfo from ..models.header import Header + from ..models.clearing_info import ClearingInfo from ..models.order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo - from ..models.order_cancel_replace_request_optional_data import ( - OrderCancelReplaceRequestOptionalData, - ) T = TypeVar("T", bound="OrderCancelReplaceRequest") @@ -41,7 +43,7 @@ class OrderCancelReplaceRequest: header (Unset | Header): incoming_cl_ord_id (Unset | str): incoming_orig_cl_ord_id (Unset | str): - instructions (Unset | list['OrderInstruction']): + instructions (Unset | list[OrderInstruction]): optional_data (Unset | OrderCancelReplaceRequestOptionalData): market_condition (Unset | OrderCancelReplaceRequestMarketCondition): ord_type (Unset | OrdType): @@ -59,16 +61,16 @@ class OrderCancelReplaceRequest: user_id (Unset | int): """ - algo: Unset | "OrderCancelReplaceRequestAlgo" = UNSET + algo: Unset | OrderCancelReplaceRequestAlgo = UNSET aux_price: Unset | float = UNSET - clearing_info: Unset | "ClearingInfo" = UNSET + clearing_info: Unset | ClearingInfo = UNSET cur_ord_id: Unset | str = UNSET - header: Unset | "Header" = UNSET + header: Unset | Header = UNSET incoming_cl_ord_id: Unset | str = UNSET incoming_orig_cl_ord_id: Unset | str = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - optional_data: Unset | "OrderCancelReplaceRequestOptionalData" = UNSET - market_condition: Unset | "OrderCancelReplaceRequestMarketCondition" = UNSET + instructions: Unset | list[OrderInstruction] = UNSET + optional_data: Unset | OrderCancelReplaceRequestOptionalData = UNSET + market_condition: Unset | OrderCancelReplaceRequestMarketCondition = UNSET ord_type: Unset | OrdType = UNSET origination_type: Unset | OriginationType = UNSET perm_ord_id: Unset | str = UNSET diff --git a/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py b/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py index 6907076e1..a686ec89c 100644 --- a/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py +++ b/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py b/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py index 92e2ca361..2dbdcd57d 100644 --- a/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py +++ b/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py b/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py index 6b0ecbb05..02238ee23 100644 --- a/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py +++ b/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/order_cancel_request.py b/openapi_project/openapi_package/models/order_cancel_request.py index 9bb9d7c3c..480172412 100644 --- a/openapi_project/openapi_package/models/order_cancel_request.py +++ b/openapi_project/openapi_package/models/order_cancel_request.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -11,10 +13,10 @@ from typing import cast if TYPE_CHECKING: + from ..models.order_instruction import OrderInstruction from ..models.order_cancel_request_optional_data import ( OrderCancelRequestOptionalData, ) - from ..models.order_instruction import OrderInstruction T = TypeVar("T", bound="OrderCancelRequest") @@ -27,7 +29,7 @@ class OrderCancelRequest: cur_ord_id (Unset | str): incoming_cl_ord_id (Unset | str): incoming_orig_cl_ord_id (Unset | str): - instructions (Unset | list['OrderInstruction']): + instructions (Unset | list[OrderInstruction]): optional_data (Unset | OrderCancelRequestOptionalData): origination_type (Unset | OriginationType): perm_ord_id (Unset | str): @@ -41,8 +43,8 @@ class OrderCancelRequest: cur_ord_id: Unset | str = UNSET incoming_cl_ord_id: Unset | str = UNSET incoming_orig_cl_ord_id: Unset | str = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - optional_data: Unset | "OrderCancelRequestOptionalData" = UNSET + instructions: Unset | list[OrderInstruction] = UNSET + optional_data: Unset | OrderCancelRequestOptionalData = UNSET origination_type: Unset | OriginationType = UNSET perm_ord_id: Unset | str = UNSET req_ord_id: Unset | str = UNSET diff --git a/openapi_project/openapi_package/models/order_cancel_request_optional_data.py b/openapi_project/openapi_package/models/order_cancel_request_optional_data.py index 0fe708dfe..99bdfde4f 100644 --- a/openapi_project/openapi_package/models/order_cancel_request_optional_data.py +++ b/openapi_project/openapi_package/models/order_cancel_request_optional_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/order_cross.py b/openapi_project/openapi_package/models/order_cross.py index ae268502c..45e4392a8 100644 --- a/openapi_project/openapi_package/models/order_cross.py +++ b/openapi_project/openapi_package/models/order_cross.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -16,14 +18,14 @@ from typing import cast if TYPE_CHECKING: - from ..models.order_instruction import OrderInstruction - from ..models.security import Security - from ..models.order_update_event import OrderUpdateEvent from ..models.order_cross_optional_data import OrderCrossOptionalData + from ..models.order_update_event import OrderUpdateEvent + from ..models.order_instruction import OrderInstruction + from ..models.order_cross_allocation import OrderCrossAllocation from ..models.header import Header - from ..models.order_cross_algo import OrderCrossAlgo + from ..models.security import Security from ..models.order_cross_market_condition import OrderCrossMarketCondition - from ..models.order_cross_allocation import OrderCrossAllocation + from ..models.order_cross_algo import OrderCrossAlgo T = TypeVar("T", bound="OrderCross") @@ -35,18 +37,18 @@ class OrderCross: Attributes: account_id (Unset | int): algo (Unset | OrderCrossAlgo): - allocations (Unset | list['OrderCrossAllocation']): + allocations (Unset | list[OrderCrossAllocation]): cross_type (Unset | CrossType): cur_ord_id (Unset | str): header (Unset | Header): id (Unset | str): incoming_cl_ord_id (Unset | str): incoming_ord_id (Unset | str): - instructions (Unset | list['OrderInstruction']): + instructions (Unset | list[OrderInstruction]): market_condition (Unset | OrderCrossMarketCondition): optional_data (Unset | OrderCrossOptionalData): order_flags (Unset | int): - order_updates (Unset | list['OrderUpdateEvent']): + order_updates (Unset | list[OrderUpdateEvent]): ord_type (Unset | OrdType): origination_type (Unset | OriginationType): parent_ord_id (Unset | str): @@ -73,19 +75,19 @@ class OrderCross: """ account_id: Unset | int = UNSET - algo: Unset | "OrderCrossAlgo" = UNSET - allocations: Unset | list["OrderCrossAllocation"] = UNSET + algo: Unset | OrderCrossAlgo = UNSET + allocations: Unset | list[OrderCrossAllocation] = UNSET cross_type: Unset | CrossType = UNSET cur_ord_id: Unset | str = UNSET - header: Unset | "Header" = UNSET + header: Unset | Header = UNSET id: Unset | str = UNSET incoming_cl_ord_id: Unset | str = UNSET incoming_ord_id: Unset | str = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - market_condition: Unset | "OrderCrossMarketCondition" = UNSET - optional_data: Unset | "OrderCrossOptionalData" = UNSET + instructions: Unset | list[OrderInstruction] = UNSET + market_condition: Unset | OrderCrossMarketCondition = UNSET + optional_data: Unset | OrderCrossOptionalData = UNSET order_flags: Unset | int = UNSET - order_updates: Unset | list["OrderUpdateEvent"] = UNSET + order_updates: Unset | list[OrderUpdateEvent] = UNSET ord_type: Unset | OrdType = UNSET origination_type: Unset | OriginationType = UNSET parent_ord_id: Unset | str = UNSET @@ -93,7 +95,7 @@ class OrderCross: price_type: Unset | PriceType = UNSET qty: Unset | float = UNSET route: Unset | str = UNSET - security: Unset | "Security" = UNSET + security: Unset | Security = UNSET source: Unset | str = UNSET source_address: Unset | str = UNSET submit_ts: Unset | str = UNSET diff --git a/openapi_project/openapi_package/models/order_cross_algo.py b/openapi_project/openapi_package/models/order_cross_algo.py index 1edab61d7..292407d5b 100644 --- a/openapi_project/openapi_package/models/order_cross_algo.py +++ b/openapi_project/openapi_package/models/order_cross_algo.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/order_cross_allocation.py b/openapi_project/openapi_package/models/order_cross_allocation.py index 59a75c12c..e28a43d20 100644 --- a/openapi_project/openapi_package/models/order_cross_allocation.py +++ b/openapi_project/openapi_package/models/order_cross_allocation.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -14,11 +16,11 @@ from typing import cast if TYPE_CHECKING: + from ..models.order_instruction import OrderInstruction from ..models.order_cross_allocation_optional_data import ( OrderCrossAllocationOptionalData, ) from ..models.clearing_info import ClearingInfo - from ..models.order_instruction import OrderInstruction T = TypeVar("T", bound="OrderCrossAllocation") @@ -32,7 +34,7 @@ class OrderCrossAllocation: clearing_info (Unset | ClearingInfo): id (Unset | str): incoming_ord_id (Unset | str): - instructions (Unset | list['OrderInstruction']): + instructions (Unset | list[OrderInstruction]): optional_data (Unset | OrderCrossAllocationOptionalData): position_effect (Unset | PositionEffect): qty (Unset | float): @@ -49,11 +51,11 @@ class OrderCrossAllocation: """ account_id: Unset | int = UNSET - clearing_info: Unset | "ClearingInfo" = UNSET + clearing_info: Unset | ClearingInfo = UNSET id: Unset | str = UNSET incoming_ord_id: Unset | str = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - optional_data: Unset | "OrderCrossAllocationOptionalData" = UNSET + instructions: Unset | list[OrderInstruction] = UNSET + optional_data: Unset | OrderCrossAllocationOptionalData = UNSET position_effect: Unset | PositionEffect = UNSET qty: Unset | float = UNSET side: Unset | Side = UNSET diff --git a/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py b/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py index bb5994689..295135915 100644 --- a/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py +++ b/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/order_cross_market_condition.py b/openapi_project/openapi_package/models/order_cross_market_condition.py index a01b551fd..3553187c3 100644 --- a/openapi_project/openapi_package/models/order_cross_market_condition.py +++ b/openapi_project/openapi_package/models/order_cross_market_condition.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/order_cross_optional_data.py b/openapi_project/openapi_package/models/order_cross_optional_data.py index f6d455aa5..ca3e15e75 100644 --- a/openapi_project/openapi_package/models/order_cross_optional_data.py +++ b/openapi_project/openapi_package/models/order_cross_optional_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/order_delete.py b/openapi_project/openapi_package/models/order_delete.py index ba3fc1aa1..17bc9d681 100644 --- a/openapi_project/openapi_package/models/order_delete.py +++ b/openapi_project/openapi_package/models/order_delete.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -30,7 +32,7 @@ class OrderDelete: """ cur_ord_id: Unset | str = UNSET - optional_data: Unset | "OrderDeleteOptionalData" = UNSET + optional_data: Unset | OrderDeleteOptionalData = UNSET origination_type: Unset | OriginationType = UNSET perm_ord_id: Unset | str = UNSET trader_id: Unset | str = UNSET diff --git a/openapi_project/openapi_package/models/order_delete_optional_data.py b/openapi_project/openapi_package/models/order_delete_optional_data.py index e39e4ba67..8b9bbd37d 100644 --- a/openapi_project/openapi_package/models/order_delete_optional_data.py +++ b/openapi_project/openapi_package/models/order_delete_optional_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/order_instruction.py b/openapi_project/openapi_package/models/order_instruction.py index ba9003d02..3d872a7cf 100644 --- a/openapi_project/openapi_package/models/order_instruction.py +++ b/openapi_project/openapi_package/models/order_instruction.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/order_market_condition.py b/openapi_project/openapi_package/models/order_market_condition.py index bae0ee338..e804ab9be 100644 --- a/openapi_project/openapi_package/models/order_market_condition.py +++ b/openapi_project/openapi_package/models/order_market_condition.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/order_optional_data.py b/openapi_project/openapi_package/models/order_optional_data.py index 79b9dd6bf..7213979b3 100644 --- a/openapi_project/openapi_package/models/order_optional_data.py +++ b/openapi_project/openapi_package/models/order_optional_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/order_update.py b/openapi_project/openapi_package/models/order_update.py index 89a4e1ad4..98b71f91d 100644 --- a/openapi_project/openapi_package/models/order_update.py +++ b/openapi_project/openapi_package/models/order_update.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -19,12 +21,12 @@ from typing import cast if TYPE_CHECKING: + from ..models.order_update_algo import OrderUpdateAlgo from ..models.order_instruction import OrderInstruction + from ..models.order_update_optional_data import OrderUpdateOptionalData from ..models.security import Security - from ..models.clearing_info import ClearingInfo from ..models.header import Header - from ..models.order_update_optional_data import OrderUpdateOptionalData - from ..models.order_update_algo import OrderUpdateAlgo + from ..models.clearing_info import ClearingInfo T = TypeVar("T", bound="OrderUpdate") @@ -53,7 +55,7 @@ class OrderUpdate: incoming_cl_ord_id (Unset | str): incoming_ord_id (Unset | str): incoming_orig_cl_ord_id (Unset | str): - instructions (Unset | list['OrderInstruction']): + instructions (Unset | list[OrderInstruction]): last_market (Unset | str): last_price (Unset | float): last_qty (Unset | float): @@ -88,11 +90,11 @@ class OrderUpdate: """ account_id: Unset | int = UNSET - algo: Unset | "OrderUpdateAlgo" = UNSET + algo: Unset | OrderUpdateAlgo = UNSET alloc_id: Unset | str = UNSET aux_price: Unset | float = UNSET avg_price: Unset | float = UNSET - clearing_info: Unset | "ClearingInfo" = UNSET + clearing_info: Unset | ClearingInfo = UNSET commission: Unset | float = UNSET cum_qty: Unset | float = UNSET cur_ord_id: Unset | str = UNSET @@ -102,11 +104,11 @@ class OrderUpdate: exec_type: Unset | ExecType = UNSET fee1: Unset | float = UNSET fee2: Unset | float = UNSET - header: Unset | "Header" = UNSET + header: Unset | Header = UNSET incoming_cl_ord_id: Unset | str = UNSET incoming_ord_id: Unset | str = UNSET incoming_orig_cl_ord_id: Unset | str = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET + instructions: Unset | list[OrderInstruction] = UNSET last_market: Unset | str = UNSET last_price: Unset | float = UNSET last_qty: Unset | float = UNSET @@ -115,7 +117,7 @@ class OrderUpdate: liquidity_flag: Unset | str = UNSET multi_leg_reporting_type: Unset | MultiLegReportingType = UNSET notes: Unset | str = UNSET - optional_data: Unset | "OrderUpdateOptionalData" = UNSET + optional_data: Unset | OrderUpdateOptionalData = UNSET order_flags: Unset | int = UNSET ord_status: Unset | OrdStatus = UNSET ord_type: Unset | OrdType = UNSET @@ -128,7 +130,7 @@ class OrderUpdate: price_type: Unset | PriceType = UNSET qty: Unset | float = UNSET route: Unset | str = UNSET - security: Unset | "Security" = UNSET + security: Unset | Security = UNSET side: Unset | Side = UNSET source: Unset | str = UNSET symbol: Unset | str = UNSET diff --git a/openapi_project/openapi_package/models/order_update_algo.py b/openapi_project/openapi_package/models/order_update_algo.py index 09d906f34..2db8286c8 100644 --- a/openapi_project/openapi_package/models/order_update_algo.py +++ b/openapi_project/openapi_package/models/order_update_algo.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/order_update_event.py b/openapi_project/openapi_package/models/order_update_event.py index deca2ae77..b3f8aace8 100644 --- a/openapi_project/openapi_package/models/order_update_event.py +++ b/openapi_project/openapi_package/models/order_update_event.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -10,15 +12,15 @@ from typing import cast if TYPE_CHECKING: + from ..models.order_update import OrderUpdate + from ..models.order_delete import OrderDelete + from ..models.execution import Execution from ..models.order_cancel_reject import OrderCancelReject - from ..models.order_cancel_request import OrderCancelRequest - from ..models.order_cancel_replace_request import OrderCancelReplaceRequest from ..models.multi_leg_order_cancel_replace_request import ( MultiLegOrderCancelReplaceRequest, ) - from ..models.order_update import OrderUpdate - from ..models.order_delete import OrderDelete - from ..models.execution import Execution + from ..models.order_cancel_request import OrderCancelRequest + from ..models.order_cancel_replace_request import OrderCancelReplaceRequest T = TypeVar("T", bound="OrderUpdateEvent") @@ -37,15 +39,15 @@ class OrderUpdateEvent: order_cancel_reject (Unset | OrderCancelReject): """ - order_cancel_request: Unset | "OrderCancelRequest" = UNSET - order_cancel_replace_request: Unset | "OrderCancelReplaceRequest" = UNSET + order_cancel_request: Unset | OrderCancelRequest = UNSET + order_cancel_replace_request: Unset | OrderCancelReplaceRequest = UNSET multi_leg_order_cancel_replace_request: ( - Unset | "MultiLegOrderCancelReplaceRequest" + Unset | MultiLegOrderCancelReplaceRequest ) = UNSET - execution: Unset | "Execution" = UNSET - order_update: Unset | "OrderUpdate" = UNSET - order_delete: Unset | "OrderDelete" = UNSET - order_cancel_reject: Unset | "OrderCancelReject" = UNSET + execution: Unset | Execution = UNSET + order_update: Unset | OrderUpdate = UNSET + order_delete: Unset | OrderDelete = UNSET + order_cancel_reject: Unset | OrderCancelReject = UNSET def to_dict(self) -> dict[str, Any]: order_cancel_request: Unset | dict[str, Any] = ( diff --git a/openapi_project/openapi_package/models/order_update_optional_data.py b/openapi_project/openapi_package/models/order_update_optional_data.py index da6282409..51b5d35ec 100644 --- a/openapi_project/openapi_package/models/order_update_optional_data.py +++ b/openapi_project/openapi_package/models/order_update_optional_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/position.py b/openapi_project/openapi_package/models/position.py index dd3fea1ab..747be0ace 100644 --- a/openapi_project/openapi_package/models/position.py +++ b/openapi_project/openapi_package/models/position.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/position_analysis.py b/openapi_project/openapi_package/models/position_analysis.py index f8d4f05d8..3cb817239 100644 --- a/openapi_project/openapi_package/models/position_analysis.py +++ b/openapi_project/openapi_package/models/position_analysis.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -22,11 +24,11 @@ class PositionAnalysis: """ Attributes: position_theo (Unset | PositionTheo): - scenario_theos (Unset | list['ScenarioTheo']): + scenario_theos (Unset | list[ScenarioTheo]): """ - position_theo: Unset | "PositionTheo" = UNSET - scenario_theos: Unset | list["ScenarioTheo"] = UNSET + position_theo: Unset | PositionTheo = UNSET + scenario_theos: Unset | list[ScenarioTheo] = UNSET def to_dict(self) -> dict[str, Any]: position_theo: Unset | dict[str, Any] = ( diff --git a/openapi_project/openapi_package/models/position_theo.py b/openapi_project/openapi_package/models/position_theo.py index 86d8320ff..fb83c4d75 100644 --- a/openapi_project/openapi_package/models/position_theo.py +++ b/openapi_project/openapi_package/models/position_theo.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -23,7 +25,7 @@ class PositionTheo: as_of_ts (Unset | str): delta (Unset | float): gamma (Unset | float): - legs (Unset | list['PositionTheoLeg']): + legs (Unset | list[PositionTheoLeg]): max_loss (Unset | float): max_loss_lsd (Unset | list[float]): max_profit (Unset | float): @@ -42,7 +44,7 @@ class PositionTheo: as_of_ts: Unset | str = UNSET delta: Unset | float = UNSET gamma: Unset | float = UNSET - legs: Unset | list["PositionTheoLeg"] = UNSET + legs: Unset | list[PositionTheoLeg] = UNSET max_loss: Unset | float = UNSET max_loss_lsd: Unset | list[float] = UNSET max_profit: Unset | float = UNSET diff --git a/openapi_project/openapi_package/models/position_theo_leg.py b/openapi_project/openapi_package/models/position_theo_leg.py index 786e4dda7..ee0a7fd90 100644 --- a/openapi_project/openapi_package/models/position_theo_leg.py +++ b/openapi_project/openapi_package/models/position_theo_leg.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/risk_radar_account_group.py b/openapi_project/openapi_package/models/risk_radar_account_group.py index 29f1582ea..bccdb691e 100644 --- a/openapi_project/openapi_package/models/risk_radar_account_group.py +++ b/openapi_project/openapi_package/models/risk_radar_account_group.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -11,8 +13,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.risk_radar_product_group import RiskRadarProductGroup from ..models.shock_value import ShockValue + from ..models.risk_radar_product_group import RiskRadarProductGroup T = TypeVar("T", bound="RiskRadarAccountGroup") @@ -25,15 +27,15 @@ class RiskRadarAccountGroup: account_id (Unset | int): currency (Unset | Currency): nav (Unset | float): - product_groups (Unset | list['RiskRadarProductGroup']): - shock_values (Unset | list['ShockValue']): + product_groups (Unset | list[RiskRadarProductGroup]): + shock_values (Unset | list[ShockValue]): """ account_id: Unset | int = UNSET currency: Unset | Currency = UNSET nav: Unset | float = UNSET - product_groups: Unset | list["RiskRadarProductGroup"] = UNSET - shock_values: Unset | list["ShockValue"] = UNSET + product_groups: Unset | list[RiskRadarProductGroup] = UNSET + shock_values: Unset | list[ShockValue] = UNSET def to_dict(self) -> dict[str, Any]: account_id = self.account_id diff --git a/openapi_project/openapi_package/models/risk_radar_class_group.py b/openapi_project/openapi_package/models/risk_radar_class_group.py index f012e46d5..c34719463 100644 --- a/openapi_project/openapi_package/models/risk_radar_class_group.py +++ b/openapi_project/openapi_package/models/risk_radar_class_group.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -10,8 +12,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.risk_radar_position import RiskRadarPosition from ..models.shock_value import ShockValue + from ..models.risk_radar_position import RiskRadarPosition T = TypeVar("T", bound="RiskRadarClassGroup") @@ -29,11 +31,11 @@ class RiskRadarClassGroup: price (Unset | float): rho (Unset | float): shock_keys (Unset | list[float]): - shock_values (Unset | list['ShockValue']): + shock_values (Unset | list[ShockValue]): symbol (Unset | str): theta (Unset | float): vega (Unset | float): - positions (Unset | list['RiskRadarPosition']): + positions (Unset | list[RiskRadarPosition]): """ delta: Unset | float = UNSET @@ -44,11 +46,11 @@ class RiskRadarClassGroup: price: Unset | float = UNSET rho: Unset | float = UNSET shock_keys: Unset | list[float] = UNSET - shock_values: Unset | list["ShockValue"] = UNSET + shock_values: Unset | list[ShockValue] = UNSET symbol: Unset | str = UNSET theta: Unset | float = UNSET vega: Unset | float = UNSET - positions: Unset | list["RiskRadarPosition"] = UNSET + positions: Unset | list[RiskRadarPosition] = UNSET def to_dict(self) -> dict[str, Any]: delta = self.delta diff --git a/openapi_project/openapi_package/models/risk_radar_data.py b/openapi_project/openapi_package/models/risk_radar_data.py index 44599568a..58894b001 100644 --- a/openapi_project/openapi_package/models/risk_radar_data.py +++ b/openapi_project/openapi_package/models/risk_radar_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -20,11 +22,11 @@ class RiskRadarData: """ Attributes: - risks_result (Unset | list['RiskRadarAccountGroup']): + risks_result (Unset | list[RiskRadarAccountGroup]): shock_keys (Unset | list[str]): """ - risks_result: Unset | list["RiskRadarAccountGroup"] = UNSET + risks_result: Unset | list[RiskRadarAccountGroup] = UNSET shock_keys: Unset | list[str] = UNSET def to_dict(self) -> dict[str, Any]: diff --git a/openapi_project/openapi_package/models/risk_radar_position.py b/openapi_project/openapi_package/models/risk_radar_position.py index 0d0793192..1eabf0567 100644 --- a/openapi_project/openapi_package/models/risk_radar_position.py +++ b/openapi_project/openapi_package/models/risk_radar_position.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -28,7 +30,7 @@ class RiskRadarPosition: price (Unset | float): p_zero (Unset | float): rho (Unset | float): - shock_values (Unset | list['ShockValue']): + shock_values (Unset | list[ShockValue]): symbol (Unset | str): theta (Unset | float): vega (Unset | float): @@ -45,7 +47,7 @@ class RiskRadarPosition: price: Unset | float = UNSET p_zero: Unset | float = UNSET rho: Unset | float = UNSET - shock_values: Unset | list["ShockValue"] = UNSET + shock_values: Unset | list[ShockValue] = UNSET symbol: Unset | str = UNSET theta: Unset | float = UNSET vega: Unset | float = UNSET diff --git a/openapi_project/openapi_package/models/risk_radar_product_group.py b/openapi_project/openapi_package/models/risk_radar_product_group.py index 61669f769..1eeb321dd 100644 --- a/openapi_project/openapi_package/models/risk_radar_product_group.py +++ b/openapi_project/openapi_package/models/risk_radar_product_group.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -10,8 +12,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.risk_radar_class_group import RiskRadarClassGroup from ..models.shock_value import ShockValue + from ..models.risk_radar_class_group import RiskRadarClassGroup T = TypeVar("T", bound="RiskRadarProductGroup") @@ -23,16 +25,16 @@ class RiskRadarProductGroup: Attributes: group (Unset | str): nav (Unset | float): - class_groups (Unset | list['RiskRadarClassGroup']): + class_groups (Unset | list[RiskRadarClassGroup]): product_id (Unset | str): - shock_values (Unset | list['ShockValue']): + shock_values (Unset | list[ShockValue]): """ group: Unset | str = UNSET nav: Unset | float = UNSET - class_groups: Unset | list["RiskRadarClassGroup"] = UNSET + class_groups: Unset | list[RiskRadarClassGroup] = UNSET product_id: Unset | str = UNSET - shock_values: Unset | list["ShockValue"] = UNSET + shock_values: Unset | list[ShockValue] = UNSET def to_dict(self) -> dict[str, Any]: group = self.group diff --git a/openapi_project/openapi_package/models/risk_radar_request.py b/openapi_project/openapi_package/models/risk_radar_request.py index 0d65cce66..a6c0c8e81 100644 --- a/openapi_project/openapi_package/models/risk_radar_request.py +++ b/openapi_project/openapi_package/models/risk_radar_request.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -26,7 +28,7 @@ class RiskRadarRequest: """ Attributes: account_ids (Unset | list[int]): - positions_by_account_id (Unset | list['RiskRadarRequestPositionList']): + positions_by_account_id (Unset | list[RiskRadarRequestPositionList]): source (Unset | PositionSource): range_ (Unset | float): timestep (Unset | str): @@ -39,7 +41,7 @@ class RiskRadarRequest: """ account_ids: Unset | list[int] = UNSET - positions_by_account_id: Unset | list["RiskRadarRequestPositionList"] = UNSET + positions_by_account_id: Unset | list[RiskRadarRequestPositionList] = UNSET source: Unset | PositionSource = UNSET range_: Unset | float = UNSET timestep: Unset | str = UNSET diff --git a/openapi_project/openapi_package/models/risk_radar_request_position.py b/openapi_project/openapi_package/models/risk_radar_request_position.py index 245f8eaec..7afbefe05 100644 --- a/openapi_project/openapi_package/models/risk_radar_request_position.py +++ b/openapi_project/openapi_package/models/risk_radar_request_position.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/risk_radar_request_position_list.py b/openapi_project/openapi_package/models/risk_radar_request_position_list.py index d68af186c..fd48a44eb 100644 --- a/openapi_project/openapi_package/models/risk_radar_request_position_list.py +++ b/openapi_project/openapi_package/models/risk_radar_request_position_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -21,11 +23,11 @@ class RiskRadarRequestPositionList: """ Attributes: account_id (Unset | int): - positions (Unset | list['RiskRadarRequestPosition']): + positions (Unset | list[RiskRadarRequestPosition]): """ account_id: Unset | int = UNSET - positions: Unset | list["RiskRadarRequestPosition"] = UNSET + positions: Unset | list[RiskRadarRequestPosition] = UNSET def to_dict(self) -> dict[str, Any]: account_id = self.account_id diff --git a/openapi_project/openapi_package/models/risk_radar_response.py b/openapi_project/openapi_package/models/risk_radar_response.py index e24c05e20..215972ada 100644 --- a/openapi_project/openapi_package/models/risk_radar_response.py +++ b/openapi_project/openapi_package/models/risk_radar_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -26,7 +28,7 @@ class RiskRadarResponse: status_code (Unset | StatusCode): """ - result: Unset | "RiskRadarData" = UNSET + result: Unset | RiskRadarData = UNSET error_message: Unset | str = UNSET status_code: Unset | StatusCode = UNSET diff --git a/openapi_project/openapi_package/models/risk_reject.py b/openapi_project/openapi_package/models/risk_reject.py index 346a887e9..77ee51658 100644 --- a/openapi_project/openapi_package/models/risk_reject.py +++ b/openapi_project/openapi_package/models/risk_reject.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/route.py b/openapi_project/openapi_package/models/route.py index 3939fd63d..b5592b2db 100644 --- a/openapi_project/openapi_package/models/route.py +++ b/openapi_project/openapi_package/models/route.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -30,7 +32,7 @@ class Route: is_enabled (Unset | bool): name (Unset | str): order_type (Unset | OrderType): - route_properties (Unset | list['RouteProperty']): + route_properties (Unset | list[RouteProperty]): security_type (Unset | SecurityType): type_ (Unset | RouteType): ui_schema (Unset | str): @@ -43,7 +45,7 @@ class Route: is_enabled: Unset | bool = UNSET name: Unset | str = UNSET order_type: Unset | OrderType = UNSET - route_properties: Unset | list["RouteProperty"] = UNSET + route_properties: Unset | list[RouteProperty] = UNSET security_type: Unset | SecurityType = UNSET type_: Unset | RouteType = UNSET ui_schema: Unset | str = UNSET diff --git a/openapi_project/openapi_package/models/route_applicability.py b/openapi_project/openapi_package/models/route_applicability.py index d7335559c..b6f847478 100644 --- a/openapi_project/openapi_package/models/route_applicability.py +++ b/openapi_project/openapi_package/models/route_applicability.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/route_property.py b/openapi_project/openapi_package/models/route_property.py index ef0a474ab..943b19d27 100644 --- a/openapi_project/openapi_package/models/route_property.py +++ b/openapi_project/openapi_package/models/route_property.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/routing_session_group.py b/openapi_project/openapi_package/models/routing_session_group.py index 0df2e8376..d55fddf82 100644 --- a/openapi_project/openapi_package/models/routing_session_group.py +++ b/openapi_project/openapi_package/models/routing_session_group.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/scenario.py b/openapi_project/openapi_package/models/scenario.py index a4c9758ef..7f2d018f2 100644 --- a/openapi_project/openapi_package/models/scenario.py +++ b/openapi_project/openapi_package/models/scenario.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -10,8 +12,8 @@ from typing import cast if TYPE_CHECKING: - from ..models.scenario_leg import ScenarioLeg from ..models.scenario_position import ScenarioPosition + from ..models.scenario_leg import ScenarioLeg T = TypeVar("T", bound="Scenario") @@ -22,13 +24,13 @@ class Scenario: """ Attributes: price (Unset | float): - legs (Unset | list['ScenarioLeg']): + legs (Unset | list[ScenarioLeg]): position (Unset | ScenarioPosition): """ price: Unset | float = UNSET - legs: Unset | list["ScenarioLeg"] = UNSET - position: Unset | "ScenarioPosition" = UNSET + legs: Unset | list[ScenarioLeg] = UNSET + position: Unset | ScenarioPosition = UNSET def to_dict(self) -> dict[str, Any]: price = self.price diff --git a/openapi_project/openapi_package/models/scenario_leg.py b/openapi_project/openapi_package/models/scenario_leg.py index 3a3e06b73..9667e090a 100644 --- a/openapi_project/openapi_package/models/scenario_leg.py +++ b/openapi_project/openapi_package/models/scenario_leg.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/scenario_position.py b/openapi_project/openapi_package/models/scenario_position.py index 48a5d02b9..76eef35e0 100644 --- a/openapi_project/openapi_package/models/scenario_position.py +++ b/openapi_project/openapi_package/models/scenario_position.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/scenario_theo.py b/openapi_project/openapi_package/models/scenario_theo.py index f85b20d9a..fce5beab9 100644 --- a/openapi_project/openapi_package/models/scenario_theo.py +++ b/openapi_project/openapi_package/models/scenario_theo.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -22,12 +24,12 @@ class ScenarioTheo: Attributes: as_of_ts (Unset | str): as_of_eval_expiry (Unset | bool): - scenarios (Unset | list['Scenario']): + scenarios (Unset | list[Scenario]): """ as_of_ts: Unset | str = UNSET as_of_eval_expiry: Unset | bool = UNSET - scenarios: Unset | list["Scenario"] = UNSET + scenarios: Unset | list[Scenario] = UNSET def to_dict(self) -> dict[str, Any]: as_of_ts = self.as_of_ts diff --git a/openapi_project/openapi_package/models/search_order_history_response.py b/openapi_project/openapi_package/models/search_order_history_response.py index 81d042dc6..97f60a426 100644 --- a/openapi_project/openapi_package/models/search_order_history_response.py +++ b/openapi_project/openapi_package/models/search_order_history_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -21,12 +23,12 @@ class SearchOrderHistoryResponse: """ Attributes: - orders (Unset | list['GenericOrder']): + orders (Unset | list[GenericOrder]): error_message (Unset | str): status_code (Unset | StatusCode): """ - orders: Unset | list["GenericOrder"] = UNSET + orders: Unset | list[GenericOrder] = UNSET error_message: Unset | str = UNSET status_code: Unset | StatusCode = UNSET diff --git a/openapi_project/openapi_package/models/security.py b/openapi_project/openapi_package/models/security.py index 926924d02..899a773bf 100644 --- a/openapi_project/openapi_package/models/security.py +++ b/openapi_project/openapi_package/models/security.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -10,16 +12,16 @@ from typing import cast if TYPE_CHECKING: - from ..models.future import Future from ..models.future_root import FutureRoot + from ..models.option_root import OptionRoot + from ..models.future import Future from ..models.future_spread import FutureSpread + from ..models.fx import Fx from ..models.option import Option from ..models.stock import Stock - from ..models.fx import Fx - from ..models.flex_option import FlexOption from ..models.crypto import Crypto - from ..models.option_root import OptionRoot from ..models.index import Index + from ..models.flex_option import FlexOption T = TypeVar("T", bound="Security") @@ -41,16 +43,16 @@ class Security: flex_option (Unset | FlexOption): """ - stock: Unset | "Stock" = UNSET - option: Unset | "Option" = UNSET - option_root: Unset | "OptionRoot" = UNSET - future: Unset | "Future" = UNSET - future_root: Unset | "FutureRoot" = UNSET - index: Unset | "Index" = UNSET - future_spread: Unset | "FutureSpread" = UNSET - fx: Unset | "Fx" = UNSET - crypto: Unset | "Crypto" = UNSET - flex_option: Unset | "FlexOption" = UNSET + stock: Unset | Stock = UNSET + option: Unset | Option = UNSET + option_root: Unset | OptionRoot = UNSET + future: Unset | Future = UNSET + future_root: Unset | FutureRoot = UNSET + index: Unset | Index = UNSET + future_spread: Unset | FutureSpread = UNSET + fx: Unset | Fx = UNSET + crypto: Unset | Crypto = UNSET + flex_option: Unset | FlexOption = UNSET def to_dict(self) -> dict[str, Any]: stock: Unset | dict[str, Any] = ( diff --git a/openapi_project/openapi_package/models/settlement_info.py b/openapi_project/openapi_package/models/settlement_info.py index 9da35f41b..9380bb6b0 100644 --- a/openapi_project/openapi_package/models/settlement_info.py +++ b/openapi_project/openapi_package/models/settlement_info.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/shock_value.py b/openapi_project/openapi_package/models/shock_value.py index a4db8a779..535f649d8 100644 --- a/openapi_project/openapi_package/models/shock_value.py +++ b/openapi_project/openapi_package/models/shock_value.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -33,7 +35,7 @@ class ShockValue: pn_l: Unset | float = UNSET nav: Unset | float = UNSET volatility: Unset | float = UNSET - flags: Unset | "ShockValueFlags" = UNSET + flags: Unset | ShockValueFlags = UNSET def to_dict(self) -> dict[str, Any]: delta = self.delta diff --git a/openapi_project/openapi_package/models/shock_value_flags.py b/openapi_project/openapi_package/models/shock_value_flags.py index df55be608..cbe112070 100644 --- a/openapi_project/openapi_package/models/shock_value_flags.py +++ b/openapi_project/openapi_package/models/shock_value_flags.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/status.py b/openapi_project/openapi_package/models/status.py index 5ad15ca5d..091d1168b 100644 --- a/openapi_project/openapi_package/models/status.py +++ b/openapi_project/openapi_package/models/status.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -22,12 +24,12 @@ class Status: Attributes: code (Unset | int): message (Unset | str): - details (Unset | list['AnyModel']): + details (Unset | list[AnyModel]): """ code: Unset | int = UNSET message: Unset | str = UNSET - details: Unset | list["AnyModel"] = UNSET + details: Unset | list[AnyModel] = UNSET def to_dict(self) -> dict[str, Any]: code = self.code diff --git a/openapi_project/openapi_package/models/stock.py b/openapi_project/openapi_package/models/stock.py index 3c2c82d0c..355db8982 100644 --- a/openapi_project/openapi_package/models/stock.py +++ b/openapi_project/openapi_package/models/stock.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -50,10 +52,10 @@ class Stock: sector (Unset | str): """ - aliases: Unset | "StockAliases" = UNSET + aliases: Unset | StockAliases = UNSET currency: Unset | Currency = UNSET - listed_dt: Unset | "Date" = UNSET - delisted_dt: Unset | "Date" = UNSET + listed_dt: Unset | Date = UNSET + delisted_dt: Unset | Date = UNSET description: Unset | str = UNSET exchange_id: Unset | int = UNSET id: Unset | int = UNSET diff --git a/openapi_project/openapi_package/models/stock_aliases.py b/openapi_project/openapi_package/models/stock_aliases.py index 47650fde3..dbff0a0ab 100644 --- a/openapi_project/openapi_package/models/stock_aliases.py +++ b/openapi_project/openapi_package/models/stock_aliases.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/time_of_day.py b/openapi_project/openapi_package/models/time_of_day.py index 33f1c9353..da3f91e76 100644 --- a/openapi_project/openapi_package/models/time_of_day.py +++ b/openapi_project/openapi_package/models/time_of_day.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/tims_class_group.py b/openapi_project/openapi_package/models/tims_class_group.py index 9e63777a8..2f8d822bf 100644 --- a/openapi_project/openapi_package/models/tims_class_group.py +++ b/openapi_project/openapi_package/models/tims_class_group.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -30,7 +32,7 @@ class TimsClassGroup: margin_req (Unset | float): nav (Unset | float): pn_l (Unset | list[float]): - positions (Unset | list['TimsPositionGroup']): + positions (Unset | list[TimsPositionGroup]): product_group (Unset | str): rho (Unset | float): short_nav (Unset | float): @@ -49,7 +51,7 @@ class TimsClassGroup: margin_req: Unset | float = UNSET nav: Unset | float = UNSET pn_l: Unset | list[float] = UNSET - positions: Unset | list["TimsPositionGroup"] = UNSET + positions: Unset | list[TimsPositionGroup] = UNSET product_group: Unset | str = UNSET rho: Unset | float = UNSET short_nav: Unset | float = UNSET diff --git a/openapi_project/openapi_package/models/tims_margin_data.py b/openapi_project/openapi_package/models/tims_margin_data.py index 6f647d205..b06cba47f 100644 --- a/openapi_project/openapi_package/models/tims_margin_data.py +++ b/openapi_project/openapi_package/models/tims_margin_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -24,7 +26,7 @@ class TimsMarginData: Attributes: account_type (Unset | str): class_group_count (Unset | int): - class_groups (Unset | list['TimsClassGroup']): + class_groups (Unset | list[TimsClassGroup]): currency (Unset | Currency): dollar_delta (Unset | float): dollar_gamma (Unset | float): @@ -34,7 +36,7 @@ class TimsMarginData: porfolio_group_count (Unset | int): position_group_count (Unset | int): product_group_count (Unset | int): - product_groups (Unset | list['TimsProductGroup']): + product_groups (Unset | list[TimsProductGroup]): rho (Unset | float): short_nav (Unset | float): theta (Unset | float): @@ -43,7 +45,7 @@ class TimsMarginData: account_type: Unset | str = UNSET class_group_count: Unset | int = UNSET - class_groups: Unset | list["TimsClassGroup"] = UNSET + class_groups: Unset | list[TimsClassGroup] = UNSET currency: Unset | Currency = UNSET dollar_delta: Unset | float = UNSET dollar_gamma: Unset | float = UNSET @@ -53,7 +55,7 @@ class TimsMarginData: porfolio_group_count: Unset | int = UNSET position_group_count: Unset | int = UNSET product_group_count: Unset | int = UNSET - product_groups: Unset | list["TimsProductGroup"] = UNSET + product_groups: Unset | list[TimsProductGroup] = UNSET rho: Unset | float = UNSET short_nav: Unset | float = UNSET theta: Unset | float = UNSET diff --git a/openapi_project/openapi_package/models/tims_position_group.py b/openapi_project/openapi_package/models/tims_position_group.py index 3bd798745..c1092fb8f 100644 --- a/openapi_project/openapi_package/models/tims_position_group.py +++ b/openapi_project/openapi_package/models/tims_position_group.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/tims_product_group.py b/openapi_project/openapi_package/models/tims_product_group.py index bfcd30ebe..7eeabd8f0 100644 --- a/openapi_project/openapi_package/models/tims_product_group.py +++ b/openapi_project/openapi_package/models/tims_product_group.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/trade_confirm.py b/openapi_project/openapi_package/models/trade_confirm.py index 65b773920..ffdef7e4d 100644 --- a/openapi_project/openapi_package/models/trade_confirm.py +++ b/openapi_project/openapi_package/models/trade_confirm.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -149,7 +151,7 @@ class TradeConfirm: exec_ref_id: Unset | str = UNSET exec_type: Unset | ExecType = UNSET exercise_style: Unset | OptionExerciseStyle = UNSET - expiration_dt: Unset | "Date" = UNSET + expiration_dt: Unset | Date = UNSET fee1: Unset | float = UNSET fee2: Unset | float = UNSET frequent_trader_id: Unset | str = UNSET @@ -195,7 +197,7 @@ class TradeConfirm: target_sub_id: Unset | str = UNSET text: Unset | str = UNSET tif: Unset | Tif = UNSET - traded_dt: Unset | "Date" = UNSET + traded_dt: Unset | Date = UNSET trader_id: Unset | str = UNSET trading_firm_id: Unset | int = UNSET transact_ts: Unset | str = UNSET diff --git a/openapi_project/openapi_package/models/trading_firm.py b/openapi_project/openapi_package/models/trading_firm.py index 2b9de2c65..4fa827e10 100644 --- a/openapi_project/openapi_package/models/trading_firm.py +++ b/openapi_project/openapi_package/models/trading_firm.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/trading_firm_slim.py b/openapi_project/openapi_package/models/trading_firm_slim.py index 1214adb87..29ec69551 100644 --- a/openapi_project/openapi_package/models/trading_firm_slim.py +++ b/openapi_project/openapi_package/models/trading_firm_slim.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/trading_holiday.py b/openapi_project/openapi_package/models/trading_holiday.py index 5e3a08561..f60d5f5d3 100644 --- a/openapi_project/openapi_package/models/trading_holiday.py +++ b/openapi_project/openapi_package/models/trading_holiday.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -30,7 +32,7 @@ class TradingHoliday: id: Unset | int = UNSET country: Unset | Country = UNSET - date: Unset | "Date" = UNSET + date: Unset | Date = UNSET description: Unset | str = UNSET is_early_close: Unset | bool = UNSET diff --git a/openapi_project/openapi_package/models/trading_session.py b/openapi_project/openapi_package/models/trading_session.py index 5c84e69ab..439446273 100644 --- a/openapi_project/openapi_package/models/trading_session.py +++ b/openapi_project/openapi_package/models/trading_session.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -29,10 +31,10 @@ class TradingSession: """ days_of_the_week: Unset | str = UNSET - end_time: Unset | "TimeOfDay" = UNSET + end_time: Unset | TimeOfDay = UNSET id: Unset | int = UNSET name: Unset | str = UNSET - start_time: Unset | "TimeOfDay" = UNSET + start_time: Unset | TimeOfDay = UNSET trading_session_group_id: Unset | int = UNSET def to_dict(self) -> dict[str, Any]: diff --git a/openapi_project/openapi_package/models/trading_session_group.py b/openapi_project/openapi_package/models/trading_session_group.py index 37d983bb5..ee64a1ae2 100644 --- a/openapi_project/openapi_package/models/trading_session_group.py +++ b/openapi_project/openapi_package/models/trading_session_group.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -22,12 +24,12 @@ class TradingSessionGroup: Attributes: id (Unset | int): name (Unset | str): - sessions (Unset | list['TradingSession']): + sessions (Unset | list[TradingSession]): """ id: Unset | int = UNSET name: Unset | str = UNSET - sessions: Unset | list["TradingSession"] = UNSET + sessions: Unset | list[TradingSession] = UNSET def to_dict(self) -> dict[str, Any]: id = self.id diff --git a/openapi_project/openapi_package/models/user.py b/openapi_project/openapi_package/models/user.py index 7fc483d38..d67643b63 100644 --- a/openapi_project/openapi_package/models/user.py +++ b/openapi_project/openapi_package/models/user.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -39,7 +41,7 @@ class User: type_ (Unset | UserType): user_name (Unset | str): city (Unset | str): - permissions (Unset | list['UserPermission']): + permissions (Unset | list[UserPermission]): setup_ticket (Unset | str): large_trader_id (Unset | str): """ @@ -60,7 +62,7 @@ class User: type_: Unset | UserType = UNSET user_name: Unset | str = UNSET city: Unset | str = UNSET - permissions: Unset | list["UserPermission"] = UNSET + permissions: Unset | list[UserPermission] = UNSET setup_ticket: Unset | str = UNSET large_trader_id: Unset | str = UNSET diff --git a/openapi_project/openapi_package/models/user_permission.py b/openapi_project/openapi_package/models/user_permission.py index 10f777507..d076485d4 100644 --- a/openapi_project/openapi_package/models/user_permission.py +++ b/openapi_project/openapi_package/models/user_permission.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator diff --git a/openapi_project/openapi_package/models/validate_risk_response.py b/openapi_project/openapi_package/models/validate_risk_response.py index b09edaa82..c2ebc076f 100644 --- a/openapi_project/openapi_package/models/validate_risk_response.py +++ b/openapi_project/openapi_package/models/validate_risk_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -22,13 +24,13 @@ class ValidateRiskResponse: """ Attributes: is_valid (Unset | bool): - risk_rejects (Unset | list['RiskReject']): + risk_rejects (Unset | list[RiskReject]): error_message (Unset | str): status_code (Unset | StatusCode): """ is_valid: Unset | bool = UNSET - risk_rejects: Unset | list["RiskReject"] = UNSET + risk_rejects: Unset | list[RiskReject] = UNSET error_message: Unset | str = UNSET status_code: Unset | StatusCode = UNSET diff --git a/openapi_python_client/parser/properties/list_property.py b/openapi_python_client/parser/properties/list_property.py index ae174aaaf..9e2a614ef 100644 --- a/openapi_python_client/parser/properties/list_property.py +++ b/openapi_python_client/parser/properties/list_property.py @@ -108,10 +108,10 @@ def convert_value(self, value: Any) -> Value | None | PropertyError: return None # pragma: no cover def get_base_type_string(self, *, quoted: bool = False) -> str: - return f"list[{self.inner_property.get_type_string(quoted=not self.inner_property.is_base_type)}]" + return f"list[{self.inner_property.get_type_string(quoted=False)}]" def get_base_json_type_string(self, *, quoted: bool = False) -> str: - return f"list[{self.inner_property.get_type_string(json=True, quoted=not self.inner_property.is_base_type)}]" + return f"list[{self.inner_property.get_type_string(json=True, quoted=False)}]" def get_instance_type_string(self) -> str: """Get a string representation of runtime type that should be used for `isinstance` checks""" diff --git a/openapi_python_client/parser/properties/model_property.py b/openapi_python_client/parser/properties/model_property.py index bf330267e..c6c7b0bbd 100644 --- a/openapi_python_client/parser/properties/model_property.py +++ b/openapi_python_client/parser/properties/model_property.py @@ -150,7 +150,7 @@ def self_import(self) -> str: return f"models.{self.class_info.module_name} import {self.class_info.name}" def get_base_type_string(self, *, quoted: bool = False) -> str: - return f'"{self.class_info.name}"' if quoted else self.class_info.name + return self.class_info.name def get_imports(self, *, prefix: str) -> set[str]: """ @@ -220,10 +220,6 @@ def get_type_string( else: type_string = self.get_base_type_string() - if quoted: - if type_string == self.class_info.name: - type_string = f"'{type_string}'" - if no_optional or self.required: return type_string return f"Unset | {type_string}" diff --git a/openapi_python_client/parser/properties/union.py b/openapi_python_client/parser/properties/union.py index c8a342ae0..d611e13e4 100644 --- a/openapi_python_client/parser/properties/union.py +++ b/openapi_python_client/parser/properties/union.py @@ -142,7 +142,7 @@ def _get_inner_type_strings(self, json: bool) -> set[str]: p.get_type_string( no_optional=True, json=json, - quoted=not p.is_base_type, + quoted=False, ) for p in self.inner_properties } diff --git a/openapi_python_client/templates/client.py.jinja b/openapi_python_client/templates/client.py.jinja index 7a166a013..ad4f63a86 100644 --- a/openapi_python_client/templates/client.py.jinja +++ b/openapi_python_client/templates/client.py.jinja @@ -1,3 +1,5 @@ +from __future__ import annotations + import ssl from typing import Any diff --git a/openapi_python_client/templates/endpoint_module.py.jinja b/openapi_python_client/templates/endpoint_module.py.jinja index d08cefab1..ba4e7412c 100644 --- a/openapi_python_client/templates/endpoint_module.py.jinja +++ b/openapi_python_client/templates/endpoint_module.py.jinja @@ -1,3 +1,5 @@ +from __future__ import annotations + from http import HTTPStatus from typing import Any, cast diff --git a/openapi_python_client/templates/errors.py.jinja b/openapi_python_client/templates/errors.py.jinja index b912123d0..798d8a158 100644 --- a/openapi_python_client/templates/errors.py.jinja +++ b/openapi_python_client/templates/errors.py.jinja @@ -1,5 +1,7 @@ """ Contains shared errors types that can be raised from API functions """ +from __future__ import annotations + class UnexpectedStatus(Exception): """Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True""" diff --git a/openapi_python_client/templates/literal_enum.py.jinja b/openapi_python_client/templates/literal_enum.py.jinja index 72207efa3..d24ff09f2 100644 --- a/openapi_python_client/templates/literal_enum.py.jinja +++ b/openapi_python_client/templates/literal_enum.py.jinja @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Literal, cast {{ enum.class_info.name }} = Literal{{ "%r" | format(enum.values|list|sort) }} diff --git a/openapi_python_client/templates/model.py.jinja b/openapi_python_client/templates/model.py.jinja index 4292e6204..abce0acf9 100644 --- a/openapi_python_client/templates/model.py.jinja +++ b/openapi_python_client/templates/model.py.jinja @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator @@ -27,7 +29,7 @@ if TYPE_CHECKING: {% if model.additional_properties %} -{% set additional_property_type = 'Any' if model.additional_properties == True else model.additional_properties.get_type_string(quoted=not model.additional_properties.is_base_type) %} +{% set additional_property_type = 'Any' if model.additional_properties == True else model.additional_properties.get_type_string() %} {% endif %} {% set class_name = model.class_info.name %} diff --git a/openapi_python_client/templates/types.py.jinja b/openapi_python_client/templates/types.py.jinja index aebf5f11c..108d3068f 100644 --- a/openapi_python_client/templates/types.py.jinja +++ b/openapi_python_client/templates/types.py.jinja @@ -1,5 +1,7 @@ """ Contains some shared types for properties """ +from __future__ import annotations + from collections.abc import Mapping, MutableMapping from http import HTTPStatus from typing import BinaryIO, Generic, TypeVar, Literal, IO From 2c6a4fc6232a23ee7cd109311a60c1120e4a3d35 Mon Sep 17 00:00:00 2001 From: Itay Bavly Date: Wed, 20 Aug 2025 14:31:16 -0400 Subject: [PATCH 07/16] replace imports --- replace_imports.py | 227 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 227 insertions(+) create mode 100644 replace_imports.py diff --git a/replace_imports.py b/replace_imports.py new file mode 100644 index 000000000..93956ef51 --- /dev/null +++ b/replace_imports.py @@ -0,0 +1,227 @@ +#!/usr/bin/env python3 +import argparse +import sys +from pathlib import Path + +import libcst as cst +from libcst.metadata import MetadataWrapper, ParentNodeProvider + + +def find_top_package_dir(d: Path) -> Path | None: + """ + Return the highest directory in the package chain for d (which itself must + be inside a package). A 'package' is a dir with __init__.py. + Example: /src/my_pkg/sub/mod -> returns /src/my_pkg + """ + cur = d + top = None + while (cur / "__init__.py").exists(): + top = cur + parent = cur.parent + if not (parent / "__init__.py").exists(): + break + cur = parent + return top + + +def package_components_for_file( + file_path: Path, import_root: Path | None = None +) -> list[str] | None: + """ + Current *package* of the module containing file_path. + - For foo/bar/baz.py -> package is foo.bar + - For foo/bar/__init__.py -> package is foo.bar + Returns None if file isn't inside a package (no __init__.py chain). + + If import_root is specified, it's used as the base for computing package structure + instead of the actual file system location. + """ + file_dir = file_path.parent + + if import_root is not None: + # Use the specified import root to compute package structure + try: + # Get the relative path from import_root to file_dir + rel_path = file_dir.relative_to(import_root) + return list(rel_path.parts) + except ValueError: + # File is not under the import_root + return None + + # Original logic: use actual file system location + top_pkg_dir = find_top_package_dir( + file_dir if file_path.name != "__init__.py" else file_dir + ) + if top_pkg_dir is None: + return None + # package is from top_pkg_dir down to file_dir + pkg_rel = file_dir.relative_to(top_pkg_dir.parent) + return list(pkg_rel.parts) + + +def compute_abs_module( + pkg_comps: list[str], level: int, rel_module: str | None +) -> str | None: + """ + Translate 'from .rel_module import x' (level >= 1) to absolute module string. + Rule: base = pkg_comps[: len(pkg_comps) - (level - 1)] + Then append rel_module parts if present. + """ + if level < 1: + return None + cut = len(pkg_comps) - (level - 1) + if cut <= 0: + # Would escape top-level package; skip (leave as-is). + return None + base = pkg_comps[:cut] + if rel_module: + base += rel_module.split(".") + return ".".join(base) + + +def importfrom_level(node: cst.ImportFrom) -> int: + r = node.relative + if r is None: + return 0 + if isinstance(r, int): + return r + # In some LibCST versions, this is a tuple of Dot tokens + return len(r) + + +class RelToAbsTransformer(cst.CSTTransformer): + METADATA_DEPENDENCIES = (ParentNodeProvider,) + + def __init__(self, file_path: Path, import_root: Path | None = None): + self.file_path = file_path + self.pkg_comps = package_components_for_file(file_path, import_root) + self.changed = False + + def leave_ImportFrom( + self, original_node: cst.ImportFrom, updated_node: cst.ImportFrom + ) -> cst.ImportFrom: + if self.pkg_comps is None: + return updated_node + + level = importfrom_level(original_node) + if level <= 0: + return updated_node # already absolute or 'from x import y' with no dots + + # Get module string if present + mod = None + if original_node.module is not None: + if isinstance(original_node.module, cst.Name): + mod = original_node.module.value + elif isinstance(original_node.module, cst.Attribute): + # Convert dotted attribute chain to string + parts = [] + cur = original_node.module + while isinstance(cur, cst.Attribute): + if isinstance(cur.attr, cst.Name): + parts.append(cur.attr.value) + else: + return updated_node # unexpected; bail + if isinstance(cur.value, cst.Name): + parts.append(cur.value.value) + break + cur = cur.value + mod = ".".join(reversed(parts)) if parts else None + + abs_mod = compute_abs_module(self.pkg_comps, level, mod) + if not abs_mod: + return updated_node # can’t safely compute; skip + + self.changed = True + return cst.ImportFrom( + module=cst.parse_expression(abs_mod), + names=updated_node.names, + relative=0, + whitespace_after_from=updated_node.whitespace_after_from, + whitespace_before_import=updated_node.whitespace_before_import, + ) + + +def rewrite_file(path: Path, write: bool, import_root: Path | None = None) -> bool: + try: + code = path.read_text(encoding="utf-8") + except Exception: + return False + try: + mod = cst.parse_module(code) + wrapper = MetadataWrapper(mod) + tx = RelToAbsTransformer(path, import_root) + new_mod = wrapper.visit(tx) + if tx.changed: + if write: + path.write_text(new_mod.code, encoding="utf-8") + else: + # Show a minimal preview header in dry-run + rel = str(path) + print(f"[change] {rel}") + return True + return False + except Exception as e: + print(f"[skip] {path}: {e}", file=sys.stderr) + return False + + +def main(): + ap = argparse.ArgumentParser( + description="Rewrite relative imports to absolute across a tree." + ) + ap.add_argument("root", type=Path, help="Folder to process") + ap.add_argument( + "--write", action="store_true", help="Apply changes in-place (default: dry-run)" + ) + ap.add_argument( + "--include-glob", + default="**/*.py", + help="Glob of files to include (default: **/*.py)", + ) + ap.add_argument( + "--exclude", + action="append", + default=[".venv", "venv", "__pycache__", ".git", "site-packages"], + help="Directories to skip (repeatable)", + ) + ap.add_argument( + "--import-root", + type=Path, + help="Root directory to use for computing import paths (default: use actual file system location)", + ) + args = ap.parse_args() + + root = args.root.resolve() + if not root.exists(): + print(f"Root not found: {root}", file=sys.stderr) + sys.exit(2) + + import_root = args.import_root.resolve() if args.import_root else None + if import_root and not import_root.exists(): + print(f"Import root not found: {import_root}", file=sys.stderr) + sys.exit(2) + + changed = 0 + for path in root.glob(args.include_glob): + if not path.is_file(): + continue + # Exclusions + p = path + skip = False + for ex in args.exclude: + if ex and ex in p.parts: + skip = True + break + if skip: + continue + if rewrite_file(path, args.write, import_root): + changed += 1 + + if not args.write: + print(f"\nDry-run complete. Files to change: {changed}") + else: + print(f"Rewritten files: {changed}") + + +if __name__ == "__main__": + main() From b48b100236776543ad231e83f0e1cab6df319c5d Mon Sep 17 00:00:00 2001 From: Itay Bavly Date: Wed, 20 Aug 2025 14:41:20 -0400 Subject: [PATCH 08/16] replace imports --- .../openapi_package/__init__.py | 2 +- .../post_application_login.py | 10 +- .../api/order_service/get_orders.py | 8 +- .../order_service/get_orders_searchhistory.py | 8 +- .../order_service/get_orders_tradeconfirms.py | 8 +- .../order_service/post_orders_cancelorder.py | 10 +- .../post_orders_createmultilegorder.py | 10 +- .../post_orders_createmultilegordercross.py | 16 +- .../order_service/post_orders_createorder.py | 10 +- .../post_orders_createordercross.py | 10 +- .../post_orders_replacemultilegorder.py | 16 +- .../order_service/post_orders_replaceorder.py | 10 +- ...orders_validaterisk_createmultilegorder.py | 10 +- ...s_validaterisk_createmultilegordercross.py | 13 +- .../post_orders_validaterisk_createorder.py | 10 +- ...st_orders_validaterisk_createordercross.py | 10 +- ...rders_validaterisk_replacemultilegorder.py | 13 +- .../post_orders_validaterisk_replaceorder.py | 10 +- .../get_portfolio_positions.py | 8 +- .../post_portfolio_analyzepositions.py | 10 +- .../post_portfolio_calculatemargins.py | 10 +- .../post_portfolio_riskradar.py | 10 +- .../get_securities_exchanges.py | 8 +- .../post_securities_easytoborrowsecurities.py | 16 +- .../post_securities_flexoption.py | 10 +- .../post_securities_optionchains.py | 10 +- .../post_securities_securities.py | 10 +- .../get_userdata_accounts.py | 8 +- .../get_userdata_activeuser.py | 8 +- .../get_userdata_affiliatedtradingfirms.py | 11 +- .../get_userdata_p2paccounts.py | 8 +- .../user_data_service/get_userdata_routes.py | 8 +- .../get_userdata_tradingfirms.py | 8 +- .../utility_service/get_utility_serverinfo.py | 8 +- .../utility_service/get_utility_servertime.py | 8 +- .../get_utility_tradingholidays.py | 8 +- .../openapi_package/models/__init__.py | 564 +++++++++--------- .../openapi_package/models/account.py | 20 +- .../openapi_package/models/account_script.py | 2 +- .../models/analyze_position_item.py | 2 +- .../models/analyze_positions_request.py | 6 +- .../models/analyze_positions_response.py | 8 +- .../models/calculate_margin_request.py | 18 +- .../calculate_margin_request_position.py | 2 +- .../calculate_margin_request_position_list.py | 12 +- .../models/calculate_margin_response.py | 8 +- .../models/cancel_order_request.py | 16 +- .../models/cancel_order_response.py | 4 +- .../cancel_replace_multi_leg_order_request.py | 44 +- ...cancel_replace_multi_leg_order_response.py | 4 +- .../models/cancel_replace_order_request.py | 41 +- .../models/cancel_replace_order_response.py | 4 +- .../openapi_package/models/clearing_info.py | 6 +- .../models/create_flex_option_request.py | 14 +- .../models/create_flex_option_response.py | 8 +- ...create_multi_leg_order_cross_allocation.py | 26 +- .../create_multi_leg_order_cross_request.py | 54 +- .../create_multi_leg_order_cross_response.py | 8 +- .../models/create_multi_leg_order_leg.py | 30 +- .../models/create_multi_leg_order_request.py | 50 +- .../models/create_multi_leg_order_response.py | 8 +- .../models/create_order_cross_allocation.py | 26 +- .../models/create_order_cross_request.py | 46 +- .../models/create_order_cross_response.py | 8 +- .../models/create_order_request.py | 48 +- .../models/create_order_response.py | 8 +- .../openapi_package/models/crypto.py | 18 +- .../openapi_package/models/date.py | 2 +- .../models/easy_to_borrow_security.py | 2 +- .../openapi_package/models/exchange.py | 2 +- .../openapi_package/models/execution.py | 44 +- .../openapi_package/models/flex_option.py | 26 +- .../openapi_package/models/future.py | 22 +- .../openapi_package/models/future_root.py | 28 +- .../openapi_package/models/future_spread.py | 22 +- .../models/future_spread_leg.py | 10 +- .../openapi_package/models/fx.py | 18 +- .../openapi_package/models/generic_order.py | 18 +- .../models/get_active_user_response.py | 8 +- .../models/get_server_info_response.py | 14 +- .../models/get_server_time_response.py | 4 +- .../models/get_trading_holidays_response.py | 8 +- .../openapi_package/models/header.py | 2 +- .../openapi_package/models/index.py | 18 +- .../models/list_accounts_response.py | 8 +- .../list_affiliated_trading_firms_response.py | 8 +- .../list_easy_to_borrow_securities_request.py | 2 +- ...list_easy_to_borrow_securities_response.py | 8 +- .../models/list_exchanges_response.py | 8 +- .../models/list_option_chains_repsonse.py | 8 +- .../models/list_option_chains_request.py | 2 +- .../models/list_orders_response.py | 8 +- .../models/list_positions_response.py | 8 +- .../models/list_routes_response.py | 12 +- .../models/list_securities_request.py | 2 +- .../models/list_securities_response.py | 8 +- .../models/list_trade_confirms_response.py | 8 +- .../models/list_trading_firms_response.py | 8 +- .../openapi_package/models/login_request.py | 2 +- .../openapi_package/models/login_response.py | 14 +- .../openapi_package/models/margin_data.py | 10 +- .../openapi_package/models/multi_leg_order.py | 47 +- .../multi_leg_order_cancel_replace_request.py | 54 +- .../models/multi_leg_order_cross.py | 57 +- .../multi_leg_order_cross_allocation.py | 28 +- .../models/multi_leg_order_leg.py | 31 +- .../openapi_package/models/option.py | 26 +- .../openapi_package/models/option_chain.py | 18 +- .../models/option_chain_option.py | 14 +- .../models/option_chain_options.py | 4 +- .../models/option_chain_roots.py | 4 +- .../openapi_package/models/option_root.py | 34 +- .../openapi_package/models/option_series.py | 18 +- .../openapi_package/models/order.py | 48 +- .../models/order_cancel_reject.py | 15 +- .../models/order_cancel_replace_request.py | 51 +- .../models/order_cancel_request.py | 18 +- .../openapi_package/models/order_cross.py | 46 +- .../models/order_cross_allocation.py | 28 +- .../openapi_package/models/order_delete.py | 8 +- .../models/order_instruction.py | 4 +- .../openapi_package/models/order_update.py | 44 +- .../models/order_update_event.py | 36 +- .../openapi_package/models/position.py | 2 +- .../models/position_analysis.py | 10 +- .../openapi_package/models/position_theo.py | 6 +- .../models/position_theo_leg.py | 2 +- .../models/risk_radar_account_group.py | 12 +- .../models/risk_radar_class_group.py | 10 +- .../openapi_package/models/risk_radar_data.py | 6 +- .../models/risk_radar_position.py | 6 +- .../models/risk_radar_product_group.py | 10 +- .../models/risk_radar_request.py | 19 +- .../models/risk_radar_request_position.py | 2 +- .../risk_radar_request_position_list.py | 6 +- .../models/risk_radar_response.py | 8 +- .../openapi_package/models/risk_reject.py | 6 +- .../openapi_package/models/route.py | 14 +- .../models/route_applicability.py | 8 +- .../openapi_package/models/route_property.py | 4 +- .../models/routing_session_group.py | 4 +- .../openapi_package/models/scenario.py | 10 +- .../openapi_package/models/scenario_leg.py | 2 +- .../models/scenario_position.py | 2 +- .../openapi_package/models/scenario_theo.py | 6 +- .../models/search_order_history_response.py | 8 +- .../openapi_package/models/security.py | 42 +- .../openapi_package/models/settlement_info.py | 4 +- .../openapi_package/models/shock_value.py | 6 +- .../models/shock_value_flags.py | 2 +- .../openapi_package/models/status.py | 6 +- .../openapi_package/models/stock.py | 18 +- .../openapi_package/models/time_of_day.py | 2 +- .../models/tims_class_group.py | 6 +- .../models/tims_margin_data.py | 12 +- .../models/tims_position_group.py | 2 +- .../models/tims_product_group.py | 2 +- .../openapi_package/models/trade_confirm.py | 38 +- .../openapi_package/models/trading_firm.py | 2 +- .../models/trading_firm_slim.py | 2 +- .../openapi_package/models/trading_holiday.py | 8 +- .../openapi_package/models/trading_session.py | 6 +- .../models/trading_session_group.py | 6 +- .../openapi_package/models/user.py | 12 +- .../openapi_package/models/user_permission.py | 4 +- .../models/validate_risk_response.py | 8 +- replace_imports.py | 8 +- 167 files changed, 1358 insertions(+), 1470 deletions(-) diff --git a/openapi/openapi_project/openapi_package/__init__.py b/openapi/openapi_project/openapi_package/__init__.py index 4eeee1912..80fd8e99d 100644 --- a/openapi/openapi_project/openapi_package/__init__.py +++ b/openapi/openapi_project/openapi_package/__init__.py @@ -1,6 +1,6 @@ """A client library for accessing Silexx API""" -from .client import AuthenticatedClient, Client +from openapi_project.openapi_package.client import AuthenticatedClient, Client __all__ = ( "AuthenticatedClient", diff --git a/openapi/openapi_project/openapi_package/api/application_service/post_application_login.py b/openapi/openapi_project/openapi_package/api/application_service/post_application_login.py index 840b19d1b..ff28064ab 100644 --- a/openapi/openapi_project/openapi_package/api/application_service/post_application_login.py +++ b/openapi/openapi_project/openapi_package/api/application_service/post_application_login.py @@ -3,11 +3,11 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.login_request import LoginRequest -from ...models.login_response import LoginResponse -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.login_request import LoginRequest +from openapi_project.openapi_package.models.login_response import LoginResponse +from openapi_project.openapi_package.types import Response def _get_kwargs( diff --git a/openapi/openapi_project/openapi_package/api/order_service/get_orders.py b/openapi/openapi_project/openapi_package/api/order_service/get_orders.py index d9c0716fb..9aea8a0da 100644 --- a/openapi/openapi_project/openapi_package/api/order_service/get_orders.py +++ b/openapi/openapi_project/openapi_package/api/order_service/get_orders.py @@ -3,10 +3,10 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.list_orders_response import ListOrdersResponse -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.list_orders_response import ListOrdersResponse +from openapi_project.openapi_package.types import Response def _get_kwargs() -> dict[str, Any]: diff --git a/openapi/openapi_project/openapi_package/api/order_service/get_orders_searchhistory.py b/openapi/openapi_project/openapi_package/api/order_service/get_orders_searchhistory.py index ee5601a21..2e8ec55dd 100644 --- a/openapi/openapi_project/openapi_package/api/order_service/get_orders_searchhistory.py +++ b/openapi/openapi_project/openapi_package/api/order_service/get_orders_searchhistory.py @@ -3,10 +3,10 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.search_order_history_response import SearchOrderHistoryResponse -from ...types import UNSET, Response, Unset +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.search_order_history_response import SearchOrderHistoryResponse +from openapi_project.openapi_package.types import UNSET, Response, Unset def _get_kwargs( diff --git a/openapi/openapi_project/openapi_package/api/order_service/get_orders_tradeconfirms.py b/openapi/openapi_project/openapi_package/api/order_service/get_orders_tradeconfirms.py index f153b8d1c..028730f92 100644 --- a/openapi/openapi_project/openapi_package/api/order_service/get_orders_tradeconfirms.py +++ b/openapi/openapi_project/openapi_package/api/order_service/get_orders_tradeconfirms.py @@ -3,10 +3,10 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.list_trade_confirms_response import ListTradeConfirmsResponse -from ...types import UNSET, Response, Unset +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.list_trade_confirms_response import ListTradeConfirmsResponse +from openapi_project.openapi_package.types import UNSET, Response, Unset def _get_kwargs( diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_cancelorder.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_cancelorder.py index 4f77ee5f7..326cc71d9 100644 --- a/openapi/openapi_project/openapi_package/api/order_service/post_orders_cancelorder.py +++ b/openapi/openapi_project/openapi_package/api/order_service/post_orders_cancelorder.py @@ -3,11 +3,11 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.cancel_order_request import CancelOrderRequest -from ...models.cancel_order_response import CancelOrderResponse -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.cancel_order_request import CancelOrderRequest +from openapi_project.openapi_package.models.cancel_order_response import CancelOrderResponse +from openapi_project.openapi_package.types import Response def _get_kwargs( diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_createmultilegorder.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_createmultilegorder.py index 244f618f7..337536ea2 100644 --- a/openapi/openapi_project/openapi_package/api/order_service/post_orders_createmultilegorder.py +++ b/openapi/openapi_project/openapi_package/api/order_service/post_orders_createmultilegorder.py @@ -3,11 +3,11 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.create_multi_leg_order_request import CreateMultiLegOrderRequest -from ...models.create_multi_leg_order_response import CreateMultiLegOrderResponse -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.create_multi_leg_order_request import CreateMultiLegOrderRequest +from openapi_project.openapi_package.models.create_multi_leg_order_response import CreateMultiLegOrderResponse +from openapi_project.openapi_package.types import Response def _get_kwargs( diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_createmultilegordercross.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_createmultilegordercross.py index b26c3b915..4f396ec5d 100644 --- a/openapi/openapi_project/openapi_package/api/order_service/post_orders_createmultilegordercross.py +++ b/openapi/openapi_project/openapi_package/api/order_service/post_orders_createmultilegordercross.py @@ -3,15 +3,13 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.create_multi_leg_order_cross_request import ( - CreateMultiLegOrderCrossRequest, -) -from ...models.create_multi_leg_order_cross_response import ( - CreateMultiLegOrderCrossResponse, -) -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.create_multi_leg_order_cross_request import CreateMultiLegOrderCrossRequest, + +from openapi_project.openapi_package.models.create_multi_leg_order_cross_response import CreateMultiLegOrderCrossResponse, + +from openapi_project.openapi_package.types import Response def _get_kwargs( diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_createorder.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_createorder.py index 8e6561ac9..60a7a68f4 100644 --- a/openapi/openapi_project/openapi_package/api/order_service/post_orders_createorder.py +++ b/openapi/openapi_project/openapi_package/api/order_service/post_orders_createorder.py @@ -3,11 +3,11 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.create_order_request import CreateOrderRequest -from ...models.create_order_response import CreateOrderResponse -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.create_order_request import CreateOrderRequest +from openapi_project.openapi_package.models.create_order_response import CreateOrderResponse +from openapi_project.openapi_package.types import Response def _get_kwargs( diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_createordercross.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_createordercross.py index 1ad1aeded..9a97b5fdd 100644 --- a/openapi/openapi_project/openapi_package/api/order_service/post_orders_createordercross.py +++ b/openapi/openapi_project/openapi_package/api/order_service/post_orders_createordercross.py @@ -3,11 +3,11 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.create_order_cross_request import CreateOrderCrossRequest -from ...models.create_order_cross_response import CreateOrderCrossResponse -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.create_order_cross_request import CreateOrderCrossRequest +from openapi_project.openapi_package.models.create_order_cross_response import CreateOrderCrossResponse +from openapi_project.openapi_package.types import Response def _get_kwargs( diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_replacemultilegorder.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_replacemultilegorder.py index 99edd1177..2a0172725 100644 --- a/openapi/openapi_project/openapi_package/api/order_service/post_orders_replacemultilegorder.py +++ b/openapi/openapi_project/openapi_package/api/order_service/post_orders_replacemultilegorder.py @@ -3,15 +3,13 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.cancel_replace_multi_leg_order_request import ( - CancelReplaceMultiLegOrderRequest, -) -from ...models.cancel_replace_multi_leg_order_response import ( - CancelReplaceMultiLegOrderResponse, -) -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request import CancelReplaceMultiLegOrderRequest, + +from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_response import CancelReplaceMultiLegOrderResponse, + +from openapi_project.openapi_package.types import Response def _get_kwargs( diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_replaceorder.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_replaceorder.py index c16d3f72c..b6b670db0 100644 --- a/openapi/openapi_project/openapi_package/api/order_service/post_orders_replaceorder.py +++ b/openapi/openapi_project/openapi_package/api/order_service/post_orders_replaceorder.py @@ -3,11 +3,11 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.cancel_replace_order_request import CancelReplaceOrderRequest -from ...models.cancel_replace_order_response import CancelReplaceOrderResponse -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.cancel_replace_order_request import CancelReplaceOrderRequest +from openapi_project.openapi_package.models.cancel_replace_order_response import CancelReplaceOrderResponse +from openapi_project.openapi_package.types import Response def _get_kwargs( diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegorder.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegorder.py index 184bcd0d7..a93ab9eda 100644 --- a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegorder.py +++ b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegorder.py @@ -3,11 +3,11 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.create_multi_leg_order_request import CreateMultiLegOrderRequest -from ...models.validate_risk_response import ValidateRiskResponse -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.create_multi_leg_order_request import CreateMultiLegOrderRequest +from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse +from openapi_project.openapi_package.types import Response def _get_kwargs( diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegordercross.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegordercross.py index 16ca8e2e3..f397d79a0 100644 --- a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegordercross.py +++ b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegordercross.py @@ -3,13 +3,12 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.create_multi_leg_order_cross_request import ( - CreateMultiLegOrderCrossRequest, -) -from ...models.validate_risk_response import ValidateRiskResponse -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.create_multi_leg_order_cross_request import CreateMultiLegOrderCrossRequest, + +from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse +from openapi_project.openapi_package.types import Response def _get_kwargs( diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createorder.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createorder.py index 83931714e..ef561489f 100644 --- a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createorder.py +++ b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createorder.py @@ -3,11 +3,11 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.create_order_request import CreateOrderRequest -from ...models.validate_risk_response import ValidateRiskResponse -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.create_order_request import CreateOrderRequest +from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse +from openapi_project.openapi_package.types import Response def _get_kwargs( diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createordercross.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createordercross.py index b2adcc914..8131433bb 100644 --- a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createordercross.py +++ b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createordercross.py @@ -3,11 +3,11 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.create_order_cross_request import CreateOrderCrossRequest -from ...models.validate_risk_response import ValidateRiskResponse -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.create_order_cross_request import CreateOrderCrossRequest +from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse +from openapi_project.openapi_package.types import Response def _get_kwargs( diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replacemultilegorder.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replacemultilegorder.py index 7655b76ba..4ddcddcea 100644 --- a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replacemultilegorder.py +++ b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replacemultilegorder.py @@ -3,13 +3,12 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.cancel_replace_multi_leg_order_request import ( - CancelReplaceMultiLegOrderRequest, -) -from ...models.validate_risk_response import ValidateRiskResponse -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request import CancelReplaceMultiLegOrderRequest, + +from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse +from openapi_project.openapi_package.types import Response def _get_kwargs( diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replaceorder.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replaceorder.py index d7319c92b..58e31dfba 100644 --- a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replaceorder.py +++ b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replaceorder.py @@ -3,11 +3,11 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.cancel_replace_order_request import CancelReplaceOrderRequest -from ...models.validate_risk_response import ValidateRiskResponse -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.cancel_replace_order_request import CancelReplaceOrderRequest +from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse +from openapi_project.openapi_package.types import Response def _get_kwargs( diff --git a/openapi/openapi_project/openapi_package/api/portfolio_service/get_portfolio_positions.py b/openapi/openapi_project/openapi_package/api/portfolio_service/get_portfolio_positions.py index b1b7e1d3f..6f5bed08e 100644 --- a/openapi/openapi_project/openapi_package/api/portfolio_service/get_portfolio_positions.py +++ b/openapi/openapi_project/openapi_package/api/portfolio_service/get_portfolio_positions.py @@ -3,10 +3,10 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.list_positions_response import ListPositionsResponse -from ...types import UNSET, Response, Unset +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.list_positions_response import ListPositionsResponse +from openapi_project.openapi_package.types import UNSET, Response, Unset def _get_kwargs( diff --git a/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_analyzepositions.py b/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_analyzepositions.py index 20b1be3de..bc38ed39a 100644 --- a/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_analyzepositions.py +++ b/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_analyzepositions.py @@ -3,11 +3,11 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.analyze_positions_request import AnalyzePositionsRequest -from ...models.analyze_positions_response import AnalyzePositionsResponse -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.analyze_positions_request import AnalyzePositionsRequest +from openapi_project.openapi_package.models.analyze_positions_response import AnalyzePositionsResponse +from openapi_project.openapi_package.types import Response def _get_kwargs( diff --git a/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_calculatemargins.py b/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_calculatemargins.py index 93b714d29..11b1f826b 100644 --- a/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_calculatemargins.py +++ b/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_calculatemargins.py @@ -3,11 +3,11 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.calculate_margin_request import CalculateMarginRequest -from ...models.calculate_margin_response import CalculateMarginResponse -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.calculate_margin_request import CalculateMarginRequest +from openapi_project.openapi_package.models.calculate_margin_response import CalculateMarginResponse +from openapi_project.openapi_package.types import Response def _get_kwargs( diff --git a/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_riskradar.py b/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_riskradar.py index 2d3976dc7..14fea3697 100644 --- a/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_riskradar.py +++ b/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_riskradar.py @@ -3,11 +3,11 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.risk_radar_request import RiskRadarRequest -from ...models.risk_radar_response import RiskRadarResponse -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.risk_radar_request import RiskRadarRequest +from openapi_project.openapi_package.models.risk_radar_response import RiskRadarResponse +from openapi_project.openapi_package.types import Response def _get_kwargs( diff --git a/openapi/openapi_project/openapi_package/api/security_service/get_securities_exchanges.py b/openapi/openapi_project/openapi_package/api/security_service/get_securities_exchanges.py index 4db2b1403..56c4e2fcc 100644 --- a/openapi/openapi_project/openapi_package/api/security_service/get_securities_exchanges.py +++ b/openapi/openapi_project/openapi_package/api/security_service/get_securities_exchanges.py @@ -3,10 +3,10 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.list_exchanges_response import ListExchangesResponse -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.list_exchanges_response import ListExchangesResponse +from openapi_project.openapi_package.types import Response def _get_kwargs() -> dict[str, Any]: diff --git a/openapi/openapi_project/openapi_package/api/security_service/post_securities_easytoborrowsecurities.py b/openapi/openapi_project/openapi_package/api/security_service/post_securities_easytoborrowsecurities.py index 5768e69c7..1e4b01014 100644 --- a/openapi/openapi_project/openapi_package/api/security_service/post_securities_easytoborrowsecurities.py +++ b/openapi/openapi_project/openapi_package/api/security_service/post_securities_easytoborrowsecurities.py @@ -3,15 +3,13 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.list_easy_to_borrow_securities_request import ( - ListEasyToBorrowSecuritiesRequest, -) -from ...models.list_easy_to_borrow_securities_response import ( - ListEasyToBorrowSecuritiesResponse, -) -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.list_easy_to_borrow_securities_request import ListEasyToBorrowSecuritiesRequest, + +from openapi_project.openapi_package.models.list_easy_to_borrow_securities_response import ListEasyToBorrowSecuritiesResponse, + +from openapi_project.openapi_package.types import Response def _get_kwargs( diff --git a/openapi/openapi_project/openapi_package/api/security_service/post_securities_flexoption.py b/openapi/openapi_project/openapi_package/api/security_service/post_securities_flexoption.py index 0f6ef5c9e..3fb9c3902 100644 --- a/openapi/openapi_project/openapi_package/api/security_service/post_securities_flexoption.py +++ b/openapi/openapi_project/openapi_package/api/security_service/post_securities_flexoption.py @@ -3,11 +3,11 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.create_flex_option_request import CreateFlexOptionRequest -from ...models.create_flex_option_response import CreateFlexOptionResponse -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.create_flex_option_request import CreateFlexOptionRequest +from openapi_project.openapi_package.models.create_flex_option_response import CreateFlexOptionResponse +from openapi_project.openapi_package.types import Response def _get_kwargs( diff --git a/openapi/openapi_project/openapi_package/api/security_service/post_securities_optionchains.py b/openapi/openapi_project/openapi_package/api/security_service/post_securities_optionchains.py index 594be48fc..6e211c30e 100644 --- a/openapi/openapi_project/openapi_package/api/security_service/post_securities_optionchains.py +++ b/openapi/openapi_project/openapi_package/api/security_service/post_securities_optionchains.py @@ -3,11 +3,11 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.list_option_chains_repsonse import ListOptionChainsRepsonse -from ...models.list_option_chains_request import ListOptionChainsRequest -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.list_option_chains_repsonse import ListOptionChainsRepsonse +from openapi_project.openapi_package.models.list_option_chains_request import ListOptionChainsRequest +from openapi_project.openapi_package.types import Response def _get_kwargs( diff --git a/openapi/openapi_project/openapi_package/api/security_service/post_securities_securities.py b/openapi/openapi_project/openapi_package/api/security_service/post_securities_securities.py index 0274f693c..6a86b0dc7 100644 --- a/openapi/openapi_project/openapi_package/api/security_service/post_securities_securities.py +++ b/openapi/openapi_project/openapi_package/api/security_service/post_securities_securities.py @@ -3,11 +3,11 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.list_securities_request import ListSecuritiesRequest -from ...models.list_securities_response import ListSecuritiesResponse -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.list_securities_request import ListSecuritiesRequest +from openapi_project.openapi_package.models.list_securities_response import ListSecuritiesResponse +from openapi_project.openapi_package.types import Response def _get_kwargs( diff --git a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_accounts.py b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_accounts.py index d98626366..46cf576c8 100644 --- a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_accounts.py +++ b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_accounts.py @@ -3,10 +3,10 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.list_accounts_response import ListAccountsResponse -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.list_accounts_response import ListAccountsResponse +from openapi_project.openapi_package.types import Response def _get_kwargs() -> dict[str, Any]: diff --git a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_activeuser.py b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_activeuser.py index 449bc4d65..1e505b464 100644 --- a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_activeuser.py +++ b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_activeuser.py @@ -3,10 +3,10 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.get_active_user_response import GetActiveUserResponse -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.get_active_user_response import GetActiveUserResponse +from openapi_project.openapi_package.types import Response def _get_kwargs() -> dict[str, Any]: diff --git a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_affiliatedtradingfirms.py b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_affiliatedtradingfirms.py index 710a91d00..9f890e995 100644 --- a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_affiliatedtradingfirms.py +++ b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_affiliatedtradingfirms.py @@ -3,12 +3,11 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.list_affiliated_trading_firms_response import ( - ListAffiliatedTradingFirmsResponse, -) -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.list_affiliated_trading_firms_response import ListAffiliatedTradingFirmsResponse, + +from openapi_project.openapi_package.types import Response def _get_kwargs() -> dict[str, Any]: diff --git a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_p2paccounts.py b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_p2paccounts.py index 7a4c9e428..8eabf87fe 100644 --- a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_p2paccounts.py +++ b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_p2paccounts.py @@ -3,10 +3,10 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.list_accounts_response import ListAccountsResponse -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.list_accounts_response import ListAccountsResponse +from openapi_project.openapi_package.types import Response def _get_kwargs() -> dict[str, Any]: diff --git a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_routes.py b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_routes.py index 55797199c..5b9ae67aa 100644 --- a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_routes.py +++ b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_routes.py @@ -3,10 +3,10 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.list_routes_response import ListRoutesResponse -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.list_routes_response import ListRoutesResponse +from openapi_project.openapi_package.types import Response def _get_kwargs() -> dict[str, Any]: diff --git a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_tradingfirms.py b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_tradingfirms.py index 887aa13a8..96a0bbe69 100644 --- a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_tradingfirms.py +++ b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_tradingfirms.py @@ -3,10 +3,10 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.list_trading_firms_response import ListTradingFirmsResponse -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.list_trading_firms_response import ListTradingFirmsResponse +from openapi_project.openapi_package.types import Response def _get_kwargs() -> dict[str, Any]: diff --git a/openapi/openapi_project/openapi_package/api/utility_service/get_utility_serverinfo.py b/openapi/openapi_project/openapi_package/api/utility_service/get_utility_serverinfo.py index 83bf38609..1a0ee34b1 100644 --- a/openapi/openapi_project/openapi_package/api/utility_service/get_utility_serverinfo.py +++ b/openapi/openapi_project/openapi_package/api/utility_service/get_utility_serverinfo.py @@ -3,10 +3,10 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.get_server_info_response import GetServerInfoResponse -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.get_server_info_response import GetServerInfoResponse +from openapi_project.openapi_package.types import Response def _get_kwargs() -> dict[str, Any]: diff --git a/openapi/openapi_project/openapi_package/api/utility_service/get_utility_servertime.py b/openapi/openapi_project/openapi_package/api/utility_service/get_utility_servertime.py index 45acefb97..7afb9513b 100644 --- a/openapi/openapi_project/openapi_package/api/utility_service/get_utility_servertime.py +++ b/openapi/openapi_project/openapi_package/api/utility_service/get_utility_servertime.py @@ -3,10 +3,10 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.get_server_time_response import GetServerTimeResponse -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.get_server_time_response import GetServerTimeResponse +from openapi_project.openapi_package.types import Response def _get_kwargs() -> dict[str, Any]: diff --git a/openapi/openapi_project/openapi_package/api/utility_service/get_utility_tradingholidays.py b/openapi/openapi_project/openapi_package/api/utility_service/get_utility_tradingholidays.py index a2ad9d3f8..20e41ca98 100644 --- a/openapi/openapi_project/openapi_package/api/utility_service/get_utility_tradingholidays.py +++ b/openapi/openapi_project/openapi_package/api/utility_service/get_utility_tradingholidays.py @@ -3,10 +3,10 @@ import httpx -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.get_trading_holidays_response import GetTradingHolidaysResponse -from ...types import Response +from openapi_project.openapi_package import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.models.get_trading_holidays_response import GetTradingHolidaysResponse +from openapi_project.openapi_package.types import Response def _get_kwargs() -> dict[str, Any]: diff --git a/openapi/openapi_project/openapi_package/models/__init__.py b/openapi/openapi_project/openapi_package/models/__init__.py index fb15fd046..8b56c7530 100644 --- a/openapi/openapi_project/openapi_package/models/__init__.py +++ b/openapi/openapi_project/openapi_package/models/__init__.py @@ -1,298 +1,276 @@ """Contains all the data models used in inputs/outputs""" -from .account import Account -from .account_script import AccountScript -from .account_status import AccountStatus -from .account_type import AccountType -from .analyze_position_item import AnalyzePositionItem -from .analyze_positions_request import AnalyzePositionsRequest -from .analyze_positions_response import AnalyzePositionsResponse -from .any_model import AnyModel -from .calculate_margin_request import CalculateMarginRequest -from .calculate_margin_request_position import CalculateMarginRequestPosition -from .calculate_margin_request_position_list import CalculateMarginRequestPositionList -from .calculate_margin_response import CalculateMarginResponse -from .cancel_order_request import CancelOrderRequest -from .cancel_order_request_optional_data import CancelOrderRequestOptionalData -from .cancel_order_response import CancelOrderResponse -from .cancel_replace_multi_leg_order_request import CancelReplaceMultiLegOrderRequest -from .cancel_replace_multi_leg_order_request_algo import ( - CancelReplaceMultiLegOrderRequestAlgo, -) -from .cancel_replace_multi_leg_order_request_market_condition import ( - CancelReplaceMultiLegOrderRequestMarketCondition, -) -from .cancel_replace_multi_leg_order_request_optional_data import ( - CancelReplaceMultiLegOrderRequestOptionalData, -) -from .cancel_replace_multi_leg_order_response import CancelReplaceMultiLegOrderResponse -from .cancel_replace_order_request import CancelReplaceOrderRequest -from .cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo -from .cancel_replace_order_request_market_condition import ( - CancelReplaceOrderRequestMarketCondition, -) -from .cancel_replace_order_request_optional_data import ( - CancelReplaceOrderRequestOptionalData, -) -from .cancel_replace_order_response import CancelReplaceOrderResponse -from .capacity_code import CapacityCode -from .claim_type import ClaimType -from .clearing_info import ClearingInfo -from .clearing_range import ClearingRange -from .country import Country -from .create_flex_option_request import CreateFlexOptionRequest -from .create_flex_option_response import CreateFlexOptionResponse -from .create_multi_leg_order_cross_allocation import CreateMultiLegOrderCrossAllocation -from .create_multi_leg_order_cross_allocation_optional_data import ( - CreateMultiLegOrderCrossAllocationOptionalData, -) -from .create_multi_leg_order_cross_request import CreateMultiLegOrderCrossRequest -from .create_multi_leg_order_cross_request_algo import ( - CreateMultiLegOrderCrossRequestAlgo, -) -from .create_multi_leg_order_cross_request_market_condition import ( - CreateMultiLegOrderCrossRequestMarketCondition, -) -from .create_multi_leg_order_cross_request_optional_data import ( - CreateMultiLegOrderCrossRequestOptionalData, -) -from .create_multi_leg_order_cross_response import CreateMultiLegOrderCrossResponse -from .create_multi_leg_order_leg import CreateMultiLegOrderLeg -from .create_multi_leg_order_leg_market_condition import ( - CreateMultiLegOrderLegMarketCondition, -) -from .create_multi_leg_order_leg_optional_data import CreateMultiLegOrderLegOptionalData -from .create_multi_leg_order_request import CreateMultiLegOrderRequest -from .create_multi_leg_order_request_algo import CreateMultiLegOrderRequestAlgo -from .create_multi_leg_order_request_market_condition import ( - CreateMultiLegOrderRequestMarketCondition, -) -from .create_multi_leg_order_request_optional_data import ( - CreateMultiLegOrderRequestOptionalData, -) -from .create_multi_leg_order_response import CreateMultiLegOrderResponse -from .create_order_cross_allocation import CreateOrderCrossAllocation -from .create_order_cross_allocation_optional_data import ( - CreateOrderCrossAllocationOptionalData, -) -from .create_order_cross_request import CreateOrderCrossRequest -from .create_order_cross_request_algo import CreateOrderCrossRequestAlgo -from .create_order_cross_request_market_condition import ( - CreateOrderCrossRequestMarketCondition, -) -from .create_order_cross_request_optional_data import ( - CreateOrderCrossRequestOptionalData, -) -from .create_order_cross_response import CreateOrderCrossResponse -from .create_order_request import CreateOrderRequest -from .create_order_request_algo import CreateOrderRequestAlgo -from .create_order_request_market_condition import CreateOrderRequestMarketCondition -from .create_order_request_optional_data import CreateOrderRequestOptionalData -from .create_order_response import CreateOrderResponse -from .cross_side_type import CrossSideType -from .cross_type import CrossType -from .crypto import Crypto -from .crypto_aliases import CryptoAliases -from .currency import Currency -from .cxl_rej_response_to import CxlRejResponseTo -from .date import Date -from .easy_to_borrow_security import EasyToBorrowSecurity -from .empty import Empty -from .exchange import Exchange -from .exchange_code import ExchangeCode -from .exec_type import ExecType -from .execution import Execution -from .execution_algo import ExecutionAlgo -from .execution_optional_data import ExecutionOptionalData -from .flex_option import FlexOption -from .flex_option_aliases import FlexOptionAliases -from .flex_settlement_type import FlexSettlementType -from .future import Future -from .future_aliases import FutureAliases -from .future_root import FutureRoot -from .future_root_aliases import FutureRootAliases -from .future_spread import FutureSpread -from .future_spread_aliases import FutureSpreadAliases -from .future_spread_leg import FutureSpreadLeg -from .fx import Fx -from .fx_aliases import FxAliases -from .generic_order import GenericOrder -from .get_active_user_response import GetActiveUserResponse -from .get_server_info_response import GetServerInfoResponse -from .get_server_info_response_system_settings import ( - GetServerInfoResponseSystemSettings, -) -from .get_server_time_response import GetServerTimeResponse -from .get_trading_holidays_response import GetTradingHolidaysResponse -from .header import Header -from .index import Index -from .index_aliases import IndexAliases -from .list_accounts_response import ListAccountsResponse -from .list_affiliated_trading_firms_response import ListAffiliatedTradingFirmsResponse -from .list_easy_to_borrow_securities_request import ListEasyToBorrowSecuritiesRequest -from .list_easy_to_borrow_securities_response import ListEasyToBorrowSecuritiesResponse -from .list_exchanges_response import ListExchangesResponse -from .list_option_chains_repsonse import ListOptionChainsRepsonse -from .list_option_chains_request import ListOptionChainsRequest -from .list_orders_response import ListOrdersResponse -from .list_positions_response import ListPositionsResponse -from .list_routes_response import ListRoutesResponse -from .list_securities_request import ListSecuritiesRequest -from .list_securities_response import ListSecuritiesResponse -from .list_trade_confirms_response import ListTradeConfirmsResponse -from .list_trading_firms_response import ListTradingFirmsResponse -from .login_request import LoginRequest -from .login_response import LoginResponse -from .login_response_system_settings import LoginResponseSystemSettings -from .login_status import LoginStatus -from .margin_data import MarginData -from .margin_data_type import MarginDataType -from .multi_leg_order import MultiLegOrder -from .multi_leg_order_algo import MultiLegOrderAlgo -from .multi_leg_order_cancel_replace_request import MultiLegOrderCancelReplaceRequest -from .multi_leg_order_cancel_replace_request_algo import ( - MultiLegOrderCancelReplaceRequestAlgo, -) -from .multi_leg_order_cancel_replace_request_market_condition import ( - MultiLegOrderCancelReplaceRequestMarketCondition, -) -from .multi_leg_order_cancel_replace_request_optional_data import ( - MultiLegOrderCancelReplaceRequestOptionalData, -) -from .multi_leg_order_cross import MultiLegOrderCross -from .multi_leg_order_cross_algo import MultiLegOrderCrossAlgo -from .multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation -from .multi_leg_order_cross_allocation_optional_data import ( - MultiLegOrderCrossAllocationOptionalData, -) -from .multi_leg_order_cross_market_condition import MultiLegOrderCrossMarketCondition -from .multi_leg_order_cross_optional_data import MultiLegOrderCrossOptionalData -from .multi_leg_order_leg import MultiLegOrderLeg -from .multi_leg_order_leg_market_condition import MultiLegOrderLegMarketCondition -from .multi_leg_order_leg_optional_data import MultiLegOrderLegOptionalData -from .multi_leg_order_market_condition import MultiLegOrderMarketCondition -from .multi_leg_order_optional_data import MultiLegOrderOptionalData -from .multi_leg_reporting_type import MultiLegReportingType -from .numeric_display_format import NumericDisplayFormat -from .option import Option -from .option_aliases import OptionAliases -from .option_chain import OptionChain -from .option_chain_option import OptionChainOption -from .option_chain_option_aliases import OptionChainOptionAliases -from .option_chain_options import OptionChainOptions -from .option_chain_roots import OptionChainRoots -from .option_exercise_style import OptionExerciseStyle -from .option_expiration_style import OptionExpirationStyle -from .option_root import OptionRoot -from .option_root_aliases import OptionRootAliases -from .option_series import OptionSeries -from .option_series_product_type import OptionSeriesProductType -from .option_series_type import OptionSeriesType -from .option_settlement_type import OptionSettlementType -from .ord_status import OrdStatus -from .ord_type import OrdType -from .order import Order -from .order_algo import OrderAlgo -from .order_cancel_reject import OrderCancelReject -from .order_cancel_reject_optional_data import OrderCancelRejectOptionalData -from .order_cancel_replace_request import OrderCancelReplaceRequest -from .order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo -from .order_cancel_replace_request_market_condition import ( - OrderCancelReplaceRequestMarketCondition, -) -from .order_cancel_replace_request_optional_data import ( - OrderCancelReplaceRequestOptionalData, -) -from .order_cancel_request import OrderCancelRequest -from .order_cancel_request_optional_data import OrderCancelRequestOptionalData -from .order_cross import OrderCross -from .order_cross_algo import OrderCrossAlgo -from .order_cross_allocation import OrderCrossAllocation -from .order_cross_allocation_optional_data import OrderCrossAllocationOptionalData -from .order_cross_market_condition import OrderCrossMarketCondition -from .order_cross_optional_data import OrderCrossOptionalData -from .order_delete import OrderDelete -from .order_delete_optional_data import OrderDeleteOptionalData -from .order_instruction import OrderInstruction -from .order_instruction_type import OrderInstructionType -from .order_market_condition import OrderMarketCondition -from .order_optional_data import OrderOptionalData -from .order_type import OrderType -from .order_update import OrderUpdate -from .order_update_algo import OrderUpdateAlgo -from .order_update_event import OrderUpdateEvent -from .order_update_optional_data import OrderUpdateOptionalData -from .origination_type import OriginationType -from .position import Position -from .position_analysis import PositionAnalysis -from .position_effect import PositionEffect -from .position_source import PositionSource -from .position_theo import PositionTheo -from .position_theo_leg import PositionTheoLeg -from .price_type import PriceType -from .product_group import ProductGroup -from .product_sub_group import ProductSubGroup -from .put_call import PutCall -from .risk_calculation_type import RiskCalculationType -from .risk_eval_mode import RiskEvalMode -from .risk_radar_account_group import RiskRadarAccountGroup -from .risk_radar_class_group import RiskRadarClassGroup -from .risk_radar_data import RiskRadarData -from .risk_radar_position import RiskRadarPosition -from .risk_radar_product_group import RiskRadarProductGroup -from .risk_radar_request import RiskRadarRequest -from .risk_radar_request_position import RiskRadarRequestPosition -from .risk_radar_request_position_list import RiskRadarRequestPositionList -from .risk_radar_response import RiskRadarResponse -from .risk_radar_scenario_order import RiskRadarScenarioOrder -from .risk_reject import RiskReject -from .risk_reject_type import RiskRejectType -from .route import Route -from .route_applicability import RouteApplicability -from .route_property import RouteProperty -from .route_property_type import RoutePropertyType -from .route_type import RouteType -from .routing_session_group import RoutingSessionGroup -from .routing_session_group_type import RoutingSessionGroupType -from .scenario import Scenario -from .scenario_leg import ScenarioLeg -from .scenario_position import ScenarioPosition -from .scenario_theo import ScenarioTheo -from .search_order_history_response import SearchOrderHistoryResponse -from .security import Security -from .security_category import SecurityCategory -from .security_type import SecurityType -from .settlement_deliverable_type import SettlementDeliverableType -from .settlement_info import SettlementInfo -from .shock_value import ShockValue -from .shock_value_flags import ShockValueFlags -from .side import Side -from .spread_leg_side import SpreadLegSide -from .spread_leg_type import SpreadLegType -from .status import Status -from .status_code import StatusCode -from .stock import Stock -from .stock_aliases import StockAliases -from .tif import Tif -from .time_of_day import TimeOfDay -from .tims_class_group import TimsClassGroup -from .tims_margin_data import TimsMarginData -from .tims_position_group import TimsPositionGroup -from .tims_product_group import TimsProductGroup -from .trade_confirm import TradeConfirm -from .trading_firm import TradingFirm -from .trading_firm_slim import TradingFirmSlim -from .trading_holiday import TradingHoliday -from .trading_session import TradingSession -from .trading_session_group import TradingSessionGroup -from .user import User -from .user_location import UserLocation -from .user_permission import UserPermission -from .user_status import UserStatus -from .user_type import UserType -from .validate_risk_response import ValidateRiskResponse -from .volatility_shock_skew import VolatilityShockSkew -from .volatility_shock_type import VolatilityShockType +from openapi_project.openapi_package.models.account import Account +from openapi_project.openapi_package.models.account_script import AccountScript +from openapi_project.openapi_package.models.account_status import AccountStatus +from openapi_project.openapi_package.models.account_type import AccountType +from openapi_project.openapi_package.models.analyze_position_item import AnalyzePositionItem +from openapi_project.openapi_package.models.analyze_positions_request import AnalyzePositionsRequest +from openapi_project.openapi_package.models.analyze_positions_response import AnalyzePositionsResponse +from openapi_project.openapi_package.models.any_model import AnyModel +from openapi_project.openapi_package.models.calculate_margin_request import CalculateMarginRequest +from openapi_project.openapi_package.models.calculate_margin_request_position import CalculateMarginRequestPosition +from openapi_project.openapi_package.models.calculate_margin_request_position_list import CalculateMarginRequestPositionList +from openapi_project.openapi_package.models.calculate_margin_response import CalculateMarginResponse +from openapi_project.openapi_package.models.cancel_order_request import CancelOrderRequest +from openapi_project.openapi_package.models.cancel_order_request_optional_data import CancelOrderRequestOptionalData +from openapi_project.openapi_package.models.cancel_order_response import CancelOrderResponse +from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request import CancelReplaceMultiLegOrderRequest +from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_algo import CancelReplaceMultiLegOrderRequestAlgo, + +from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_market_condition import CancelReplaceMultiLegOrderRequestMarketCondition, + +from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_optional_data import CancelReplaceMultiLegOrderRequestOptionalData, + +from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_response import CancelReplaceMultiLegOrderResponse +from openapi_project.openapi_package.models.cancel_replace_order_request import CancelReplaceOrderRequest +from openapi_project.openapi_package.models.cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo +from openapi_project.openapi_package.models.cancel_replace_order_request_market_condition import CancelReplaceOrderRequestMarketCondition, + +from openapi_project.openapi_package.models.cancel_replace_order_request_optional_data import CancelReplaceOrderRequestOptionalData, + +from openapi_project.openapi_package.models.cancel_replace_order_response import CancelReplaceOrderResponse +from openapi_project.openapi_package.models.capacity_code import CapacityCode +from openapi_project.openapi_package.models.claim_type import ClaimType +from openapi_project.openapi_package.models.clearing_info import ClearingInfo +from openapi_project.openapi_package.models.clearing_range import ClearingRange +from openapi_project.openapi_package.models.country import Country +from openapi_project.openapi_package.models.create_flex_option_request import CreateFlexOptionRequest +from openapi_project.openapi_package.models.create_flex_option_response import CreateFlexOptionResponse +from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation import CreateMultiLegOrderCrossAllocation +from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation_optional_data import CreateMultiLegOrderCrossAllocationOptionalData, + +from openapi_project.openapi_package.models.create_multi_leg_order_cross_request import CreateMultiLegOrderCrossRequest +from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_algo import CreateMultiLegOrderCrossRequestAlgo, + +from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_market_condition import CreateMultiLegOrderCrossRequestMarketCondition, + +from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_optional_data import CreateMultiLegOrderCrossRequestOptionalData, + +from openapi_project.openapi_package.models.create_multi_leg_order_cross_response import CreateMultiLegOrderCrossResponse +from openapi_project.openapi_package.models.create_multi_leg_order_leg import CreateMultiLegOrderLeg +from openapi_project.openapi_package.models.create_multi_leg_order_leg_market_condition import CreateMultiLegOrderLegMarketCondition, + +from openapi_project.openapi_package.models.create_multi_leg_order_leg_optional_data import CreateMultiLegOrderLegOptionalData +from openapi_project.openapi_package.models.create_multi_leg_order_request import CreateMultiLegOrderRequest +from openapi_project.openapi_package.models.create_multi_leg_order_request_algo import CreateMultiLegOrderRequestAlgo +from openapi_project.openapi_package.models.create_multi_leg_order_request_market_condition import CreateMultiLegOrderRequestMarketCondition, + +from openapi_project.openapi_package.models.create_multi_leg_order_request_optional_data import CreateMultiLegOrderRequestOptionalData, + +from openapi_project.openapi_package.models.create_multi_leg_order_response import CreateMultiLegOrderResponse +from openapi_project.openapi_package.models.create_order_cross_allocation import CreateOrderCrossAllocation +from openapi_project.openapi_package.models.create_order_cross_allocation_optional_data import CreateOrderCrossAllocationOptionalData, + +from openapi_project.openapi_package.models.create_order_cross_request import CreateOrderCrossRequest +from openapi_project.openapi_package.models.create_order_cross_request_algo import CreateOrderCrossRequestAlgo +from openapi_project.openapi_package.models.create_order_cross_request_market_condition import CreateOrderCrossRequestMarketCondition, + +from openapi_project.openapi_package.models.create_order_cross_request_optional_data import CreateOrderCrossRequestOptionalData, + +from openapi_project.openapi_package.models.create_order_cross_response import CreateOrderCrossResponse +from openapi_project.openapi_package.models.create_order_request import CreateOrderRequest +from openapi_project.openapi_package.models.create_order_request_algo import CreateOrderRequestAlgo +from openapi_project.openapi_package.models.create_order_request_market_condition import CreateOrderRequestMarketCondition +from openapi_project.openapi_package.models.create_order_request_optional_data import CreateOrderRequestOptionalData +from openapi_project.openapi_package.models.create_order_response import CreateOrderResponse +from openapi_project.openapi_package.models.cross_side_type import CrossSideType +from openapi_project.openapi_package.models.cross_type import CrossType +from openapi_project.openapi_package.models.crypto import Crypto +from openapi_project.openapi_package.models.crypto_aliases import CryptoAliases +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.models.cxl_rej_response_to import CxlRejResponseTo +from openapi_project.openapi_package.models.date import Date +from openapi_project.openapi_package.models.easy_to_borrow_security import EasyToBorrowSecurity +from openapi_project.openapi_package.models.empty import Empty +from openapi_project.openapi_package.models.exchange import Exchange +from openapi_project.openapi_package.models.exchange_code import ExchangeCode +from openapi_project.openapi_package.models.exec_type import ExecType +from openapi_project.openapi_package.models.execution import Execution +from openapi_project.openapi_package.models.execution_algo import ExecutionAlgo +from openapi_project.openapi_package.models.execution_optional_data import ExecutionOptionalData +from openapi_project.openapi_package.models.flex_option import FlexOption +from openapi_project.openapi_package.models.flex_option_aliases import FlexOptionAliases +from openapi_project.openapi_package.models.flex_settlement_type import FlexSettlementType +from openapi_project.openapi_package.models.future import Future +from openapi_project.openapi_package.models.future_aliases import FutureAliases +from openapi_project.openapi_package.models.future_root import FutureRoot +from openapi_project.openapi_package.models.future_root_aliases import FutureRootAliases +from openapi_project.openapi_package.models.future_spread import FutureSpread +from openapi_project.openapi_package.models.future_spread_aliases import FutureSpreadAliases +from openapi_project.openapi_package.models.future_spread_leg import FutureSpreadLeg +from openapi_project.openapi_package.models.fx import Fx +from openapi_project.openapi_package.models.fx_aliases import FxAliases +from openapi_project.openapi_package.models.generic_order import GenericOrder +from openapi_project.openapi_package.models.get_active_user_response import GetActiveUserResponse +from openapi_project.openapi_package.models.get_server_info_response import GetServerInfoResponse +from openapi_project.openapi_package.models.get_server_info_response_system_settings import GetServerInfoResponseSystemSettings, + +from openapi_project.openapi_package.models.get_server_time_response import GetServerTimeResponse +from openapi_project.openapi_package.models.get_trading_holidays_response import GetTradingHolidaysResponse +from openapi_project.openapi_package.models.header import Header +from openapi_project.openapi_package.models.index import Index +from openapi_project.openapi_package.models.index_aliases import IndexAliases +from openapi_project.openapi_package.models.list_accounts_response import ListAccountsResponse +from openapi_project.openapi_package.models.list_affiliated_trading_firms_response import ListAffiliatedTradingFirmsResponse +from openapi_project.openapi_package.models.list_easy_to_borrow_securities_request import ListEasyToBorrowSecuritiesRequest +from openapi_project.openapi_package.models.list_easy_to_borrow_securities_response import ListEasyToBorrowSecuritiesResponse +from openapi_project.openapi_package.models.list_exchanges_response import ListExchangesResponse +from openapi_project.openapi_package.models.list_option_chains_repsonse import ListOptionChainsRepsonse +from openapi_project.openapi_package.models.list_option_chains_request import ListOptionChainsRequest +from openapi_project.openapi_package.models.list_orders_response import ListOrdersResponse +from openapi_project.openapi_package.models.list_positions_response import ListPositionsResponse +from openapi_project.openapi_package.models.list_routes_response import ListRoutesResponse +from openapi_project.openapi_package.models.list_securities_request import ListSecuritiesRequest +from openapi_project.openapi_package.models.list_securities_response import ListSecuritiesResponse +from openapi_project.openapi_package.models.list_trade_confirms_response import ListTradeConfirmsResponse +from openapi_project.openapi_package.models.list_trading_firms_response import ListTradingFirmsResponse +from openapi_project.openapi_package.models.login_request import LoginRequest +from openapi_project.openapi_package.models.login_response import LoginResponse +from openapi_project.openapi_package.models.login_response_system_settings import LoginResponseSystemSettings +from openapi_project.openapi_package.models.login_status import LoginStatus +from openapi_project.openapi_package.models.margin_data import MarginData +from openapi_project.openapi_package.models.margin_data_type import MarginDataType +from openapi_project.openapi_package.models.multi_leg_order import MultiLegOrder +from openapi_project.openapi_package.models.multi_leg_order_algo import MultiLegOrderAlgo +from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request import MultiLegOrderCancelReplaceRequest +from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_algo import MultiLegOrderCancelReplaceRequestAlgo, + +from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_market_condition import MultiLegOrderCancelReplaceRequestMarketCondition, + +from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_optional_data import MultiLegOrderCancelReplaceRequestOptionalData, + +from openapi_project.openapi_package.models.multi_leg_order_cross import MultiLegOrderCross +from openapi_project.openapi_package.models.multi_leg_order_cross_algo import MultiLegOrderCrossAlgo +from openapi_project.openapi_package.models.multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation +from openapi_project.openapi_package.models.multi_leg_order_cross_allocation_optional_data import MultiLegOrderCrossAllocationOptionalData, + +from openapi_project.openapi_package.models.multi_leg_order_cross_market_condition import MultiLegOrderCrossMarketCondition +from openapi_project.openapi_package.models.multi_leg_order_cross_optional_data import MultiLegOrderCrossOptionalData +from openapi_project.openapi_package.models.multi_leg_order_leg import MultiLegOrderLeg +from openapi_project.openapi_package.models.multi_leg_order_leg_market_condition import MultiLegOrderLegMarketCondition +from openapi_project.openapi_package.models.multi_leg_order_leg_optional_data import MultiLegOrderLegOptionalData +from openapi_project.openapi_package.models.multi_leg_order_market_condition import MultiLegOrderMarketCondition +from openapi_project.openapi_package.models.multi_leg_order_optional_data import MultiLegOrderOptionalData +from openapi_project.openapi_package.models.multi_leg_reporting_type import MultiLegReportingType +from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat +from openapi_project.openapi_package.models.option import Option +from openapi_project.openapi_package.models.option_aliases import OptionAliases +from openapi_project.openapi_package.models.option_chain import OptionChain +from openapi_project.openapi_package.models.option_chain_option import OptionChainOption +from openapi_project.openapi_package.models.option_chain_option_aliases import OptionChainOptionAliases +from openapi_project.openapi_package.models.option_chain_options import OptionChainOptions +from openapi_project.openapi_package.models.option_chain_roots import OptionChainRoots +from openapi_project.openapi_package.models.option_exercise_style import OptionExerciseStyle +from openapi_project.openapi_package.models.option_expiration_style import OptionExpirationStyle +from openapi_project.openapi_package.models.option_root import OptionRoot +from openapi_project.openapi_package.models.option_root_aliases import OptionRootAliases +from openapi_project.openapi_package.models.option_series import OptionSeries +from openapi_project.openapi_package.models.option_series_product_type import OptionSeriesProductType +from openapi_project.openapi_package.models.option_series_type import OptionSeriesType +from openapi_project.openapi_package.models.option_settlement_type import OptionSettlementType +from openapi_project.openapi_package.models.ord_status import OrdStatus +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.order import Order +from openapi_project.openapi_package.models.order_algo import OrderAlgo +from openapi_project.openapi_package.models.order_cancel_reject import OrderCancelReject +from openapi_project.openapi_package.models.order_cancel_reject_optional_data import OrderCancelRejectOptionalData +from openapi_project.openapi_package.models.order_cancel_replace_request import OrderCancelReplaceRequest +from openapi_project.openapi_package.models.order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo +from openapi_project.openapi_package.models.order_cancel_replace_request_market_condition import OrderCancelReplaceRequestMarketCondition, + +from openapi_project.openapi_package.models.order_cancel_replace_request_optional_data import OrderCancelReplaceRequestOptionalData, + +from openapi_project.openapi_package.models.order_cancel_request import OrderCancelRequest +from openapi_project.openapi_package.models.order_cancel_request_optional_data import OrderCancelRequestOptionalData +from openapi_project.openapi_package.models.order_cross import OrderCross +from openapi_project.openapi_package.models.order_cross_algo import OrderCrossAlgo +from openapi_project.openapi_package.models.order_cross_allocation import OrderCrossAllocation +from openapi_project.openapi_package.models.order_cross_allocation_optional_data import OrderCrossAllocationOptionalData +from openapi_project.openapi_package.models.order_cross_market_condition import OrderCrossMarketCondition +from openapi_project.openapi_package.models.order_cross_optional_data import OrderCrossOptionalData +from openapi_project.openapi_package.models.order_delete import OrderDelete +from openapi_project.openapi_package.models.order_delete_optional_data import OrderDeleteOptionalData +from openapi_project.openapi_package.models.order_instruction import OrderInstruction +from openapi_project.openapi_package.models.order_instruction_type import OrderInstructionType +from openapi_project.openapi_package.models.order_market_condition import OrderMarketCondition +from openapi_project.openapi_package.models.order_optional_data import OrderOptionalData +from openapi_project.openapi_package.models.order_type import OrderType +from openapi_project.openapi_package.models.order_update import OrderUpdate +from openapi_project.openapi_package.models.order_update_algo import OrderUpdateAlgo +from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent +from openapi_project.openapi_package.models.order_update_optional_data import OrderUpdateOptionalData +from openapi_project.openapi_package.models.origination_type import OriginationType +from openapi_project.openapi_package.models.position import Position +from openapi_project.openapi_package.models.position_analysis import PositionAnalysis +from openapi_project.openapi_package.models.position_effect import PositionEffect +from openapi_project.openapi_package.models.position_source import PositionSource +from openapi_project.openapi_package.models.position_theo import PositionTheo +from openapi_project.openapi_package.models.position_theo_leg import PositionTheoLeg +from openapi_project.openapi_package.models.price_type import PriceType +from openapi_project.openapi_package.models.product_group import ProductGroup +from openapi_project.openapi_package.models.product_sub_group import ProductSubGroup +from openapi_project.openapi_package.models.put_call import PutCall +from openapi_project.openapi_package.models.risk_calculation_type import RiskCalculationType +from openapi_project.openapi_package.models.risk_eval_mode import RiskEvalMode +from openapi_project.openapi_package.models.risk_radar_account_group import RiskRadarAccountGroup +from openapi_project.openapi_package.models.risk_radar_class_group import RiskRadarClassGroup +from openapi_project.openapi_package.models.risk_radar_data import RiskRadarData +from openapi_project.openapi_package.models.risk_radar_position import RiskRadarPosition +from openapi_project.openapi_package.models.risk_radar_product_group import RiskRadarProductGroup +from openapi_project.openapi_package.models.risk_radar_request import RiskRadarRequest +from openapi_project.openapi_package.models.risk_radar_request_position import RiskRadarRequestPosition +from openapi_project.openapi_package.models.risk_radar_request_position_list import RiskRadarRequestPositionList +from openapi_project.openapi_package.models.risk_radar_response import RiskRadarResponse +from openapi_project.openapi_package.models.risk_radar_scenario_order import RiskRadarScenarioOrder +from openapi_project.openapi_package.models.risk_reject import RiskReject +from openapi_project.openapi_package.models.risk_reject_type import RiskRejectType +from openapi_project.openapi_package.models.route import Route +from openapi_project.openapi_package.models.route_applicability import RouteApplicability +from openapi_project.openapi_package.models.route_property import RouteProperty +from openapi_project.openapi_package.models.route_property_type import RoutePropertyType +from openapi_project.openapi_package.models.route_type import RouteType +from openapi_project.openapi_package.models.routing_session_group import RoutingSessionGroup +from openapi_project.openapi_package.models.routing_session_group_type import RoutingSessionGroupType +from openapi_project.openapi_package.models.scenario import Scenario +from openapi_project.openapi_package.models.scenario_leg import ScenarioLeg +from openapi_project.openapi_package.models.scenario_position import ScenarioPosition +from openapi_project.openapi_package.models.scenario_theo import ScenarioTheo +from openapi_project.openapi_package.models.search_order_history_response import SearchOrderHistoryResponse +from openapi_project.openapi_package.models.security import Security +from openapi_project.openapi_package.models.security_category import SecurityCategory +from openapi_project.openapi_package.models.security_type import SecurityType +from openapi_project.openapi_package.models.settlement_deliverable_type import SettlementDeliverableType +from openapi_project.openapi_package.models.settlement_info import SettlementInfo +from openapi_project.openapi_package.models.shock_value import ShockValue +from openapi_project.openapi_package.models.shock_value_flags import ShockValueFlags +from openapi_project.openapi_package.models.side import Side +from openapi_project.openapi_package.models.spread_leg_side import SpreadLegSide +from openapi_project.openapi_package.models.spread_leg_type import SpreadLegType +from openapi_project.openapi_package.models.status import Status +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.models.stock import Stock +from openapi_project.openapi_package.models.stock_aliases import StockAliases +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.models.time_of_day import TimeOfDay +from openapi_project.openapi_package.models.tims_class_group import TimsClassGroup +from openapi_project.openapi_package.models.tims_margin_data import TimsMarginData +from openapi_project.openapi_package.models.tims_position_group import TimsPositionGroup +from openapi_project.openapi_package.models.tims_product_group import TimsProductGroup +from openapi_project.openapi_package.models.trade_confirm import TradeConfirm +from openapi_project.openapi_package.models.trading_firm import TradingFirm +from openapi_project.openapi_package.models.trading_firm_slim import TradingFirmSlim +from openapi_project.openapi_package.models.trading_holiday import TradingHoliday +from openapi_project.openapi_package.models.trading_session import TradingSession +from openapi_project.openapi_package.models.trading_session_group import TradingSessionGroup +from openapi_project.openapi_package.models.user import User +from openapi_project.openapi_package.models.user_location import UserLocation +from openapi_project.openapi_package.models.user_permission import UserPermission +from openapi_project.openapi_package.models.user_status import UserStatus +from openapi_project.openapi_package.models.user_type import UserType +from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse +from openapi_project.openapi_package.models.volatility_shock_skew import VolatilityShockSkew +from openapi_project.openapi_package.models.volatility_shock_type import VolatilityShockType __all__ = ( "Account", diff --git a/openapi/openapi_project/openapi_package/models/account.py b/openapi/openapi_project/openapi_package/models/account.py index 10279ba80..c57a49650 100644 --- a/openapi/openapi_project/openapi_package/models/account.py +++ b/openapi/openapi_project/openapi_package/models/account.py @@ -3,16 +3,16 @@ from attrs import define as _attrs_define -from ..models.account_status import AccountStatus -from ..models.account_type import AccountType -from ..models.capacity_code import CapacityCode -from ..models.clearing_range import ClearingRange -from ..models.currency import Currency -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.account_status import AccountStatus +from openapi_project.openapi_package.models.account_type import AccountType +from openapi_project.openapi_package.models.capacity_code import CapacityCode +from openapi_project.openapi_package.models.clearing_range import ClearingRange +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.account_script import AccountScript - from ..models.routing_session_group import RoutingSessionGroup + from openapi_project.openapi_package.models.account_script import AccountScript + from openapi_project.openapi_package.models.routing_session_group import RoutingSessionGroup T = TypeVar("T", bound="Account") @@ -225,8 +225,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.account_script import AccountScript - from ..models.routing_session_group import RoutingSessionGroup + from openapi_project.openapi_package.models.account_script import AccountScript + from openapi_project.openapi_package.models.routing_session_group import RoutingSessionGroup d = dict(src_dict) id = d.pop("id", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/account_script.py b/openapi/openapi_project/openapi_package/models/account_script.py index 180e5ba44..c8b7ad121 100644 --- a/openapi/openapi_project/openapi_package/models/account_script.py +++ b/openapi/openapi_project/openapi_package/models/account_script.py @@ -3,7 +3,7 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="AccountScript") diff --git a/openapi/openapi_project/openapi_package/models/analyze_position_item.py b/openapi/openapi_project/openapi_package/models/analyze_position_item.py index de889950e..bb9a6fd08 100644 --- a/openapi/openapi_project/openapi_package/models/analyze_position_item.py +++ b/openapi/openapi_project/openapi_package/models/analyze_position_item.py @@ -3,7 +3,7 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="AnalyzePositionItem") diff --git a/openapi/openapi_project/openapi_package/models/analyze_positions_request.py b/openapi/openapi_project/openapi_package/models/analyze_positions_request.py index dfaba24d7..dd5d03865 100644 --- a/openapi/openapi_project/openapi_package/models/analyze_positions_request.py +++ b/openapi/openapi_project/openapi_package/models/analyze_positions_request.py @@ -3,10 +3,10 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.analyze_position_item import AnalyzePositionItem + from openapi_project.openapi_package.models.analyze_position_item import AnalyzePositionItem T = TypeVar("T", bound="AnalyzePositionsRequest") @@ -93,7 +93,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.analyze_position_item import AnalyzePositionItem + from openapi_project.openapi_package.models.analyze_position_item import AnalyzePositionItem d = dict(src_dict) as_of_ts = d.pop("asOfTs", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/analyze_positions_response.py b/openapi/openapi_project/openapi_package/models/analyze_positions_response.py index 0cac7e11f..7e6ce7c30 100644 --- a/openapi/openapi_project/openapi_package/models/analyze_positions_response.py +++ b/openapi/openapi_project/openapi_package/models/analyze_positions_response.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.position_analysis import PositionAnalysis + from openapi_project.openapi_package.models.position_analysis import PositionAnalysis T = TypeVar("T", bound="AnalyzePositionsResponse") @@ -51,7 +51,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.position_analysis import PositionAnalysis + from openapi_project.openapi_package.models.position_analysis import PositionAnalysis d = dict(src_dict) _analysis = d.pop("analysis", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/calculate_margin_request.py b/openapi/openapi_project/openapi_package/models/calculate_margin_request.py index c8446eac2..47295abeb 100644 --- a/openapi/openapi_project/openapi_package/models/calculate_margin_request.py +++ b/openapi/openapi_project/openapi_package/models/calculate_margin_request.py @@ -3,15 +3,14 @@ from attrs import define as _attrs_define -from ..models.margin_data_type import MarginDataType -from ..models.position_source import PositionSource -from ..models.risk_eval_mode import RiskEvalMode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.margin_data_type import MarginDataType +from openapi_project.openapi_package.models.position_source import PositionSource +from openapi_project.openapi_package.models.risk_eval_mode import RiskEvalMode +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.calculate_margin_request_position_list import ( - CalculateMarginRequestPositionList, - ) + from openapi_project.openapi_package.models.calculate_margin_request_position_list import CalculateMarginRequestPositionList, + T = TypeVar("T", bound="CalculateMarginRequest") @@ -78,9 +77,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.calculate_margin_request_position_list import ( - CalculateMarginRequestPositionList, - ) + from openapi_project.openapi_package.models.calculate_margin_request_position_list import CalculateMarginRequestPositionList, + d = dict(src_dict) account_ids = cast(list[int], d.pop("accountIds", UNSET)) diff --git a/openapi/openapi_project/openapi_package/models/calculate_margin_request_position.py b/openapi/openapi_project/openapi_package/models/calculate_margin_request_position.py index 93c54a0ff..88d754cd0 100644 --- a/openapi/openapi_project/openapi_package/models/calculate_margin_request_position.py +++ b/openapi/openapi_project/openapi_package/models/calculate_margin_request_position.py @@ -3,7 +3,7 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="CalculateMarginRequestPosition") diff --git a/openapi/openapi_project/openapi_package/models/calculate_margin_request_position_list.py b/openapi/openapi_project/openapi_package/models/calculate_margin_request_position_list.py index 16cd08822..86e28fb2b 100644 --- a/openapi/openapi_project/openapi_package/models/calculate_margin_request_position_list.py +++ b/openapi/openapi_project/openapi_package/models/calculate_margin_request_position_list.py @@ -3,12 +3,11 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.calculate_margin_request_position import ( - CalculateMarginRequestPosition, - ) + from openapi_project.openapi_package.models.calculate_margin_request_position import CalculateMarginRequestPosition, + T = TypeVar("T", bound="CalculateMarginRequestPositionList") @@ -47,9 +46,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.calculate_margin_request_position import ( - CalculateMarginRequestPosition, - ) + from openapi_project.openapi_package.models.calculate_margin_request_position import CalculateMarginRequestPosition, + d = dict(src_dict) account_id = d.pop("accountId", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/calculate_margin_response.py b/openapi/openapi_project/openapi_package/models/calculate_margin_response.py index 2693a25f7..4f68a58b1 100644 --- a/openapi/openapi_project/openapi_package/models/calculate_margin_response.py +++ b/openapi/openapi_project/openapi_package/models/calculate_margin_response.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.margin_data import MarginData + from openapi_project.openapi_package.models.margin_data import MarginData T = TypeVar("T", bound="CalculateMarginResponse") @@ -54,7 +54,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.margin_data import MarginData + from openapi_project.openapi_package.models.margin_data import MarginData d = dict(src_dict) margin_data = [] diff --git a/openapi/openapi_project/openapi_package/models/cancel_order_request.py b/openapi/openapi_project/openapi_package/models/cancel_order_request.py index 636934aaa..3bbf45bc8 100644 --- a/openapi/openapi_project/openapi_package/models/cancel_order_request.py +++ b/openapi/openapi_project/openapi_package/models/cancel_order_request.py @@ -3,13 +3,12 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.cancel_order_request_optional_data import ( - CancelOrderRequestOptionalData, - ) - from ..models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.cancel_order_request_optional_data import CancelOrderRequestOptionalData, + + from openapi_project.openapi_package.models.order_instruction import OrderInstruction T = TypeVar("T", bound="CancelOrderRequest") @@ -62,10 +61,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.cancel_order_request_optional_data import ( - CancelOrderRequestOptionalData, - ) - from ..models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.cancel_order_request_optional_data import CancelOrderRequestOptionalData, + + from openapi_project.openapi_package.models.order_instruction import OrderInstruction d = dict(src_dict) cur_ord_id = d.pop("curOrdId", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/cancel_order_response.py b/openapi/openapi_project/openapi_package/models/cancel_order_response.py index 489cc9cf2..1f5e9e69f 100644 --- a/openapi/openapi_project/openapi_package/models/cancel_order_response.py +++ b/openapi/openapi_project/openapi_package/models/cancel_order_response.py @@ -3,8 +3,8 @@ from attrs import define as _attrs_define -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="CancelOrderResponse") diff --git a/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py b/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py index 935178101..d7ae84643 100644 --- a/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py +++ b/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py @@ -3,22 +3,19 @@ from attrs import define as _attrs_define -from ..models.ord_type import OrdType -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.cancel_replace_multi_leg_order_request_algo import ( - CancelReplaceMultiLegOrderRequestAlgo, - ) - from ..models.cancel_replace_multi_leg_order_request_market_condition import ( - CancelReplaceMultiLegOrderRequestMarketCondition, - ) - from ..models.cancel_replace_multi_leg_order_request_optional_data import ( - CancelReplaceMultiLegOrderRequestOptionalData, - ) - from ..models.clearing_info import ClearingInfo - from ..models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_algo import CancelReplaceMultiLegOrderRequestAlgo, + + from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_market_condition import CancelReplaceMultiLegOrderRequestMarketCondition, + + from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_optional_data import CancelReplaceMultiLegOrderRequestOptionalData, + + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.order_instruction import OrderInstruction T = TypeVar("T", bound="CancelReplaceMultiLegOrderRequest") @@ -143,17 +140,14 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.cancel_replace_multi_leg_order_request_algo import ( - CancelReplaceMultiLegOrderRequestAlgo, - ) - from ..models.cancel_replace_multi_leg_order_request_market_condition import ( - CancelReplaceMultiLegOrderRequestMarketCondition, - ) - from ..models.cancel_replace_multi_leg_order_request_optional_data import ( - CancelReplaceMultiLegOrderRequestOptionalData, - ) - from ..models.clearing_info import ClearingInfo - from ..models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_algo import CancelReplaceMultiLegOrderRequestAlgo, + + from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_market_condition import CancelReplaceMultiLegOrderRequestMarketCondition, + + from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_optional_data import CancelReplaceMultiLegOrderRequestOptionalData, + + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.order_instruction import OrderInstruction d = dict(src_dict) aux_price = d.pop("auxPrice", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py b/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py index c09c8791c..125455d27 100644 --- a/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py +++ b/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py @@ -3,8 +3,8 @@ from attrs import define as _attrs_define -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="CancelReplaceMultiLegOrderResponse") diff --git a/openapi/openapi_project/openapi_package/models/cancel_replace_order_request.py b/openapi/openapi_project/openapi_package/models/cancel_replace_order_request.py index 796a89381..a0202effd 100644 --- a/openapi/openapi_project/openapi_package/models/cancel_replace_order_request.py +++ b/openapi/openapi_project/openapi_package/models/cancel_replace_order_request.py @@ -3,20 +3,18 @@ from attrs import define as _attrs_define -from ..models.ord_type import OrdType -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo - from ..models.cancel_replace_order_request_market_condition import ( - CancelReplaceOrderRequestMarketCondition, - ) - from ..models.cancel_replace_order_request_optional_data import ( - CancelReplaceOrderRequestOptionalData, - ) - from ..models.clearing_info import ClearingInfo - from ..models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo + from openapi_project.openapi_package.models.cancel_replace_order_request_market_condition import CancelReplaceOrderRequestMarketCondition, + + from openapi_project.openapi_package.models.cancel_replace_order_request_optional_data import CancelReplaceOrderRequestOptionalData, + + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.order_instruction import OrderInstruction T = TypeVar("T", bound="CancelReplaceOrderRequest") @@ -127,17 +125,14 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.cancel_replace_order_request_algo import ( - CancelReplaceOrderRequestAlgo, - ) - from ..models.cancel_replace_order_request_market_condition import ( - CancelReplaceOrderRequestMarketCondition, - ) - from ..models.cancel_replace_order_request_optional_data import ( - CancelReplaceOrderRequestOptionalData, - ) - from ..models.clearing_info import ClearingInfo - from ..models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo, + + from openapi_project.openapi_package.models.cancel_replace_order_request_market_condition import CancelReplaceOrderRequestMarketCondition, + + from openapi_project.openapi_package.models.cancel_replace_order_request_optional_data import CancelReplaceOrderRequestOptionalData, + + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.order_instruction import OrderInstruction d = dict(src_dict) aux_price = d.pop("auxPrice", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/cancel_replace_order_response.py b/openapi/openapi_project/openapi_package/models/cancel_replace_order_response.py index bda3041be..36f6201e3 100644 --- a/openapi/openapi_project/openapi_package/models/cancel_replace_order_response.py +++ b/openapi/openapi_project/openapi_package/models/cancel_replace_order_response.py @@ -3,8 +3,8 @@ from attrs import define as _attrs_define -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="CancelReplaceOrderResponse") diff --git a/openapi/openapi_project/openapi_package/models/clearing_info.py b/openapi/openapi_project/openapi_package/models/clearing_info.py index d452bb777..f03ec22e7 100644 --- a/openapi/openapi_project/openapi_package/models/clearing_info.py +++ b/openapi/openapi_project/openapi_package/models/clearing_info.py @@ -3,9 +3,9 @@ from attrs import define as _attrs_define -from ..models.capacity_code import CapacityCode -from ..models.clearing_range import ClearingRange -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.capacity_code import CapacityCode +from openapi_project.openapi_package.models.clearing_range import ClearingRange +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="ClearingInfo") diff --git a/openapi/openapi_project/openapi_package/models/create_flex_option_request.py b/openapi/openapi_project/openapi_package/models/create_flex_option_request.py index 0b0c163ca..5370636e7 100644 --- a/openapi/openapi_project/openapi_package/models/create_flex_option_request.py +++ b/openapi/openapi_project/openapi_package/models/create_flex_option_request.py @@ -3,14 +3,14 @@ from attrs import define as _attrs_define -from ..models.flex_settlement_type import FlexSettlementType -from ..models.option_exercise_style import OptionExerciseStyle -from ..models.option_series_product_type import OptionSeriesProductType -from ..models.put_call import PutCall -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.flex_settlement_type import FlexSettlementType +from openapi_project.openapi_package.models.option_exercise_style import OptionExerciseStyle +from openapi_project.openapi_package.models.option_series_product_type import OptionSeriesProductType +from openapi_project.openapi_package.models.put_call import PutCall +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.date import Date + from openapi_project.openapi_package.models.date import Date T = TypeVar("T", bound="CreateFlexOptionRequest") @@ -110,7 +110,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.date import Date + from openapi_project.openapi_package.models.date import Date d = dict(src_dict) root_symbol = d.pop("rootSymbol", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/create_flex_option_response.py b/openapi/openapi_project/openapi_package/models/create_flex_option_response.py index b2228e9e9..09ce058da 100644 --- a/openapi/openapi_project/openapi_package/models/create_flex_option_response.py +++ b/openapi/openapi_project/openapi_package/models/create_flex_option_response.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.flex_option import FlexOption + from openapi_project.openapi_package.models.flex_option import FlexOption T = TypeVar("T", bound="CreateFlexOptionResponse") @@ -51,7 +51,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.flex_option import FlexOption + from openapi_project.openapi_package.models.flex_option import FlexOption d = dict(src_dict) _flex_option = d.pop("flexOption", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py index 725e88196..6f97480aa 100644 --- a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py +++ b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py @@ -3,16 +3,15 @@ from attrs import define as _attrs_define -from ..models.cross_side_type import CrossSideType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.cross_side_type import CrossSideType +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.clearing_info import ClearingInfo - from ..models.create_multi_leg_order_cross_allocation_optional_data import ( - CreateMultiLegOrderCrossAllocationOptionalData, - ) - from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg - from ..models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation_optional_data import CreateMultiLegOrderCrossAllocationOptionalData, + + from openapi_project.openapi_package.models.create_multi_leg_order_leg import CreateMultiLegOrderLeg + from openapi_project.openapi_package.models.order_instruction import OrderInstruction T = TypeVar("T", bound="CreateMultiLegOrderCrossAllocation") @@ -94,12 +93,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.clearing_info import ClearingInfo - from ..models.create_multi_leg_order_cross_allocation_optional_data import ( - CreateMultiLegOrderCrossAllocationOptionalData, - ) - from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg - from ..models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation_optional_data import CreateMultiLegOrderCrossAllocationOptionalData, + + from openapi_project.openapi_package.models.create_multi_leg_order_leg import CreateMultiLegOrderLeg + from openapi_project.openapi_package.models.order_instruction import OrderInstruction d = dict(src_dict) account_id = d.pop("accountId", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py index e5c84b370..c1e92e575 100644 --- a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py +++ b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py @@ -3,26 +3,22 @@ from attrs import define as _attrs_define -from ..models.cross_type import CrossType -from ..models.ord_type import OrdType -from ..models.price_type import PriceType -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.cross_type import CrossType +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.price_type import PriceType +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.create_multi_leg_order_cross_allocation import ( - CreateMultiLegOrderCrossAllocation, - ) - from ..models.create_multi_leg_order_cross_request_algo import ( - CreateMultiLegOrderCrossRequestAlgo, - ) - from ..models.create_multi_leg_order_cross_request_market_condition import ( - CreateMultiLegOrderCrossRequestMarketCondition, - ) - from ..models.create_multi_leg_order_cross_request_optional_data import ( - CreateMultiLegOrderCrossRequestOptionalData, - ) - from ..models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation import CreateMultiLegOrderCrossAllocation, + + from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_algo import CreateMultiLegOrderCrossRequestAlgo, + + from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_market_condition import CreateMultiLegOrderCrossRequestMarketCondition, + + from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_optional_data import CreateMultiLegOrderCrossRequestOptionalData, + + from openapi_project.openapi_package.models.order_instruction import OrderInstruction T = TypeVar("T", bound="CreateMultiLegOrderCrossRequest") @@ -172,19 +168,15 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.create_multi_leg_order_cross_allocation import ( - CreateMultiLegOrderCrossAllocation, - ) - from ..models.create_multi_leg_order_cross_request_algo import ( - CreateMultiLegOrderCrossRequestAlgo, - ) - from ..models.create_multi_leg_order_cross_request_market_condition import ( - CreateMultiLegOrderCrossRequestMarketCondition, - ) - from ..models.create_multi_leg_order_cross_request_optional_data import ( - CreateMultiLegOrderCrossRequestOptionalData, - ) - from ..models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation import CreateMultiLegOrderCrossAllocation, + + from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_algo import CreateMultiLegOrderCrossRequestAlgo, + + from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_market_condition import CreateMultiLegOrderCrossRequestMarketCondition, + + from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_optional_data import CreateMultiLegOrderCrossRequestOptionalData, + + from openapi_project.openapi_package.models.order_instruction import OrderInstruction d = dict(src_dict) account_id = d.pop("accountId", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py index 9ad3d858a..f3101175d 100644 --- a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py +++ b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.multi_leg_order_cross import MultiLegOrderCross + from openapi_project.openapi_package.models.multi_leg_order_cross import MultiLegOrderCross T = TypeVar("T", bound="CreateMultiLegOrderCrossResponse") @@ -51,7 +51,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.multi_leg_order_cross import MultiLegOrderCross + from openapi_project.openapi_package.models.multi_leg_order_cross import MultiLegOrderCross d = dict(src_dict) _multi_leg_order_cross = d.pop("multiLegOrderCross", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_leg.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_leg.py index aec64ad46..1d2aa4162 100644 --- a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_leg.py +++ b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_leg.py @@ -3,18 +3,16 @@ from attrs import define as _attrs_define -from ..models.position_effect import PositionEffect -from ..models.side import Side -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.position_effect import PositionEffect +from openapi_project.openapi_package.models.side import Side +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.create_multi_leg_order_leg_market_condition import ( - CreateMultiLegOrderLegMarketCondition, - ) - from ..models.create_multi_leg_order_leg_optional_data import ( - CreateMultiLegOrderLegOptionalData, - ) - from ..models.flex_option import FlexOption + from openapi_project.openapi_package.models.create_multi_leg_order_leg_market_condition import CreateMultiLegOrderLegMarketCondition, + + from openapi_project.openapi_package.models.create_multi_leg_order_leg_optional_data import CreateMultiLegOrderLegOptionalData, + + from openapi_project.openapi_package.models.flex_option import FlexOption T = TypeVar("T", bound="CreateMultiLegOrderLeg") @@ -94,13 +92,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.create_multi_leg_order_leg_market_condition import ( - CreateMultiLegOrderLegMarketCondition, - ) - from ..models.create_multi_leg_order_leg_optional_data import ( - CreateMultiLegOrderLegOptionalData, - ) - from ..models.flex_option import FlexOption + from openapi_project.openapi_package.models.create_multi_leg_order_leg_market_condition import CreateMultiLegOrderLegMarketCondition, + + from openapi_project.openapi_package.models.create_multi_leg_order_leg_optional_data import CreateMultiLegOrderLegOptionalData, + + from openapi_project.openapi_package.models.flex_option import FlexOption d = dict(src_dict) _position_effect = d.pop("positionEffect", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_request.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_request.py index 3a04056b6..5609d0f7c 100644 --- a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_request.py +++ b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_request.py @@ -3,24 +3,21 @@ from attrs import define as _attrs_define -from ..models.ord_type import OrdType -from ..models.price_type import PriceType -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.price_type import PriceType +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.clearing_info import ClearingInfo - from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg - from ..models.create_multi_leg_order_request_algo import ( - CreateMultiLegOrderRequestAlgo, - ) - from ..models.create_multi_leg_order_request_market_condition import ( - CreateMultiLegOrderRequestMarketCondition, - ) - from ..models.create_multi_leg_order_request_optional_data import ( - CreateMultiLegOrderRequestOptionalData, - ) - from ..models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.create_multi_leg_order_leg import CreateMultiLegOrderLeg + from openapi_project.openapi_package.models.create_multi_leg_order_request_algo import CreateMultiLegOrderRequestAlgo, + + from openapi_project.openapi_package.models.create_multi_leg_order_request_market_condition import CreateMultiLegOrderRequestMarketCondition, + + from openapi_project.openapi_package.models.create_multi_leg_order_request_optional_data import CreateMultiLegOrderRequestOptionalData, + + from openapi_project.openapi_package.models.order_instruction import OrderInstruction T = TypeVar("T", bound="CreateMultiLegOrderRequest") @@ -174,18 +171,15 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.clearing_info import ClearingInfo - from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg - from ..models.create_multi_leg_order_request_algo import ( - CreateMultiLegOrderRequestAlgo, - ) - from ..models.create_multi_leg_order_request_market_condition import ( - CreateMultiLegOrderRequestMarketCondition, - ) - from ..models.create_multi_leg_order_request_optional_data import ( - CreateMultiLegOrderRequestOptionalData, - ) - from ..models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.create_multi_leg_order_leg import CreateMultiLegOrderLeg + from openapi_project.openapi_package.models.create_multi_leg_order_request_algo import CreateMultiLegOrderRequestAlgo, + + from openapi_project.openapi_package.models.create_multi_leg_order_request_market_condition import CreateMultiLegOrderRequestMarketCondition, + + from openapi_project.openapi_package.models.create_multi_leg_order_request_optional_data import CreateMultiLegOrderRequestOptionalData, + + from openapi_project.openapi_package.models.order_instruction import OrderInstruction d = dict(src_dict) account_id = d.pop("accountId", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_response.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_response.py index ad2cbc8c1..c586092f2 100644 --- a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_response.py +++ b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_response.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.multi_leg_order import MultiLegOrder + from openapi_project.openapi_package.models.multi_leg_order import MultiLegOrder T = TypeVar("T", bound="CreateMultiLegOrderResponse") @@ -51,7 +51,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.multi_leg_order import MultiLegOrder + from openapi_project.openapi_package.models.multi_leg_order import MultiLegOrder d = dict(src_dict) _multi_leg_order = d.pop("multiLegOrder", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/create_order_cross_allocation.py b/openapi/openapi_project/openapi_package/models/create_order_cross_allocation.py index 010d0f3a1..2d8333a9d 100644 --- a/openapi/openapi_project/openapi_package/models/create_order_cross_allocation.py +++ b/openapi/openapi_project/openapi_package/models/create_order_cross_allocation.py @@ -3,17 +3,16 @@ from attrs import define as _attrs_define -from ..models.cross_side_type import CrossSideType -from ..models.position_effect import PositionEffect -from ..models.side import Side -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.cross_side_type import CrossSideType +from openapi_project.openapi_package.models.position_effect import PositionEffect +from openapi_project.openapi_package.models.side import Side +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.clearing_info import ClearingInfo - from ..models.create_order_cross_allocation_optional_data import ( - CreateOrderCrossAllocationOptionalData, - ) - from ..models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.create_order_cross_allocation_optional_data import CreateOrderCrossAllocationOptionalData, + + from openapi_project.openapi_package.models.order_instruction import OrderInstruction T = TypeVar("T", bound="CreateOrderCrossAllocation") @@ -98,11 +97,10 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.clearing_info import ClearingInfo - from ..models.create_order_cross_allocation_optional_data import ( - CreateOrderCrossAllocationOptionalData, - ) - from ..models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.create_order_cross_allocation_optional_data import CreateOrderCrossAllocationOptionalData, + + from openapi_project.openapi_package.models.order_instruction import OrderInstruction d = dict(src_dict) account_id = d.pop("accountId", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/create_order_cross_request.py b/openapi/openapi_project/openapi_package/models/create_order_cross_request.py index 2c32f1c44..db924575b 100644 --- a/openapi/openapi_project/openapi_package/models/create_order_cross_request.py +++ b/openapi/openapi_project/openapi_package/models/create_order_cross_request.py @@ -3,23 +3,21 @@ from attrs import define as _attrs_define -from ..models.cross_type import CrossType -from ..models.ord_type import OrdType -from ..models.price_type import PriceType -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.cross_type import CrossType +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.price_type import PriceType +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.create_order_cross_allocation import CreateOrderCrossAllocation - from ..models.create_order_cross_request_algo import CreateOrderCrossRequestAlgo - from ..models.create_order_cross_request_market_condition import ( - CreateOrderCrossRequestMarketCondition, - ) - from ..models.create_order_cross_request_optional_data import ( - CreateOrderCrossRequestOptionalData, - ) - from ..models.flex_option import FlexOption - from ..models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.create_order_cross_allocation import CreateOrderCrossAllocation + from openapi_project.openapi_package.models.create_order_cross_request_algo import CreateOrderCrossRequestAlgo + from openapi_project.openapi_package.models.create_order_cross_request_market_condition import CreateOrderCrossRequestMarketCondition, + + from openapi_project.openapi_package.models.create_order_cross_request_optional_data import CreateOrderCrossRequestOptionalData, + + from openapi_project.openapi_package.models.flex_option import FlexOption + from openapi_project.openapi_package.models.order_instruction import OrderInstruction T = TypeVar("T", bound="CreateOrderCrossRequest") @@ -181,16 +179,14 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.create_order_cross_allocation import CreateOrderCrossAllocation - from ..models.create_order_cross_request_algo import CreateOrderCrossRequestAlgo - from ..models.create_order_cross_request_market_condition import ( - CreateOrderCrossRequestMarketCondition, - ) - from ..models.create_order_cross_request_optional_data import ( - CreateOrderCrossRequestOptionalData, - ) - from ..models.flex_option import FlexOption - from ..models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.create_order_cross_allocation import CreateOrderCrossAllocation + from openapi_project.openapi_package.models.create_order_cross_request_algo import CreateOrderCrossRequestAlgo + from openapi_project.openapi_package.models.create_order_cross_request_market_condition import CreateOrderCrossRequestMarketCondition, + + from openapi_project.openapi_package.models.create_order_cross_request_optional_data import CreateOrderCrossRequestOptionalData, + + from openapi_project.openapi_package.models.flex_option import FlexOption + from openapi_project.openapi_package.models.order_instruction import OrderInstruction d = dict(src_dict) account_id = d.pop("accountId", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/create_order_cross_response.py b/openapi/openapi_project/openapi_package/models/create_order_cross_response.py index 483b9cd65..1d2de4eef 100644 --- a/openapi/openapi_project/openapi_package/models/create_order_cross_response.py +++ b/openapi/openapi_project/openapi_package/models/create_order_cross_response.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.order_cross import OrderCross + from openapi_project.openapi_package.models.order_cross import OrderCross T = TypeVar("T", bound="CreateOrderCrossResponse") @@ -51,7 +51,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.order_cross import OrderCross + from openapi_project.openapi_package.models.order_cross import OrderCross d = dict(src_dict) _order_cross = d.pop("orderCross", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/create_order_request.py b/openapi/openapi_project/openapi_package/models/create_order_request.py index 21fdadd88..2c9ee3780 100644 --- a/openapi/openapi_project/openapi_package/models/create_order_request.py +++ b/openapi/openapi_project/openapi_package/models/create_order_request.py @@ -3,24 +3,22 @@ from attrs import define as _attrs_define -from ..models.ord_type import OrdType -from ..models.position_effect import PositionEffect -from ..models.price_type import PriceType -from ..models.side import Side -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.position_effect import PositionEffect +from openapi_project.openapi_package.models.price_type import PriceType +from openapi_project.openapi_package.models.side import Side +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.clearing_info import ClearingInfo - from ..models.create_order_request_algo import CreateOrderRequestAlgo - from ..models.create_order_request_market_condition import ( - CreateOrderRequestMarketCondition, - ) - from ..models.create_order_request_optional_data import ( - CreateOrderRequestOptionalData, - ) - from ..models.flex_option import FlexOption - from ..models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.create_order_request_algo import CreateOrderRequestAlgo + from openapi_project.openapi_package.models.create_order_request_market_condition import CreateOrderRequestMarketCondition, + + from openapi_project.openapi_package.models.create_order_request_optional_data import CreateOrderRequestOptionalData, + + from openapi_project.openapi_package.models.flex_option import FlexOption + from openapi_project.openapi_package.models.order_instruction import OrderInstruction T = TypeVar("T", bound="CreateOrderRequest") @@ -193,16 +191,14 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.clearing_info import ClearingInfo - from ..models.create_order_request_algo import CreateOrderRequestAlgo - from ..models.create_order_request_market_condition import ( - CreateOrderRequestMarketCondition, - ) - from ..models.create_order_request_optional_data import ( - CreateOrderRequestOptionalData, - ) - from ..models.flex_option import FlexOption - from ..models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.create_order_request_algo import CreateOrderRequestAlgo + from openapi_project.openapi_package.models.create_order_request_market_condition import CreateOrderRequestMarketCondition, + + from openapi_project.openapi_package.models.create_order_request_optional_data import CreateOrderRequestOptionalData, + + from openapi_project.openapi_package.models.flex_option import FlexOption + from openapi_project.openapi_package.models.order_instruction import OrderInstruction d = dict(src_dict) account_id = d.pop("accountId", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/create_order_response.py b/openapi/openapi_project/openapi_package/models/create_order_response.py index 99cd84e8a..dae330db9 100644 --- a/openapi/openapi_project/openapi_package/models/create_order_response.py +++ b/openapi/openapi_project/openapi_package/models/create_order_response.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.order import Order + from openapi_project.openapi_package.models.order import Order T = TypeVar("T", bound="CreateOrderResponse") @@ -51,7 +51,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.order import Order + from openapi_project.openapi_package.models.order import Order d = dict(src_dict) _order = d.pop("order", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/crypto.py b/openapi/openapi_project/openapi_package/models/crypto.py index 540b7a745..a6110fbf4 100644 --- a/openapi/openapi_project/openapi_package/models/crypto.py +++ b/openapi/openapi_project/openapi_package/models/crypto.py @@ -3,15 +3,15 @@ from attrs import define as _attrs_define -from ..models.currency import Currency -from ..models.exchange_code import ExchangeCode -from ..models.numeric_display_format import NumericDisplayFormat -from ..models.security_category import SecurityCategory -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.models.exchange_code import ExchangeCode +from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat +from openapi_project.openapi_package.models.security_category import SecurityCategory +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.crypto_aliases import CryptoAliases - from ..models.date import Date + from openapi_project.openapi_package.models.crypto_aliases import CryptoAliases + from openapi_project.openapi_package.models.date import Date T = TypeVar("T", bound="Crypto") @@ -174,8 +174,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.crypto_aliases import CryptoAliases - from ..models.date import Date + from openapi_project.openapi_package.models.crypto_aliases import CryptoAliases + from openapi_project.openapi_package.models.date import Date d = dict(src_dict) _aliases = d.pop("aliases", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/date.py b/openapi/openapi_project/openapi_package/models/date.py index c2b8d90e6..167fc74ec 100644 --- a/openapi/openapi_project/openapi_package/models/date.py +++ b/openapi/openapi_project/openapi_package/models/date.py @@ -3,7 +3,7 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="Date") diff --git a/openapi/openapi_project/openapi_package/models/easy_to_borrow_security.py b/openapi/openapi_project/openapi_package/models/easy_to_borrow_security.py index 6ad84f15e..e0fff86c9 100644 --- a/openapi/openapi_project/openapi_package/models/easy_to_borrow_security.py +++ b/openapi/openapi_project/openapi_package/models/easy_to_borrow_security.py @@ -3,7 +3,7 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="EasyToBorrowSecurity") diff --git a/openapi/openapi_project/openapi_package/models/exchange.py b/openapi/openapi_project/openapi_package/models/exchange.py index 92e7d9ec6..a667d9be8 100644 --- a/openapi/openapi_project/openapi_package/models/exchange.py +++ b/openapi/openapi_project/openapi_package/models/exchange.py @@ -3,7 +3,7 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="Exchange") diff --git a/openapi/openapi_project/openapi_package/models/execution.py b/openapi/openapi_project/openapi_package/models/execution.py index 8644ffd83..fdcf2d754 100644 --- a/openapi/openapi_project/openapi_package/models/execution.py +++ b/openapi/openapi_project/openapi_package/models/execution.py @@ -3,24 +3,24 @@ from attrs import define as _attrs_define -from ..models.exec_type import ExecType -from ..models.multi_leg_reporting_type import MultiLegReportingType -from ..models.ord_status import OrdStatus -from ..models.ord_type import OrdType -from ..models.origination_type import OriginationType -from ..models.position_effect import PositionEffect -from ..models.price_type import PriceType -from ..models.side import Side -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.exec_type import ExecType +from openapi_project.openapi_package.models.multi_leg_reporting_type import MultiLegReportingType +from openapi_project.openapi_package.models.ord_status import OrdStatus +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.origination_type import OriginationType +from openapi_project.openapi_package.models.position_effect import PositionEffect +from openapi_project.openapi_package.models.price_type import PriceType +from openapi_project.openapi_package.models.side import Side +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.clearing_info import ClearingInfo - from ..models.execution_algo import ExecutionAlgo - from ..models.execution_optional_data import ExecutionOptionalData - from ..models.header import Header - from ..models.order_instruction import OrderInstruction - from ..models.security import Security + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.execution_algo import ExecutionAlgo + from openapi_project.openapi_package.models.execution_optional_data import ExecutionOptionalData + from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.security import Security T = TypeVar("T", bound="Execution") @@ -393,12 +393,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.clearing_info import ClearingInfo - from ..models.execution_algo import ExecutionAlgo - from ..models.execution_optional_data import ExecutionOptionalData - from ..models.header import Header - from ..models.order_instruction import OrderInstruction - from ..models.security import Security + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.execution_algo import ExecutionAlgo + from openapi_project.openapi_package.models.execution_optional_data import ExecutionOptionalData + from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.security import Security d = dict(src_dict) account_id = d.pop("accountId", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/flex_option.py b/openapi/openapi_project/openapi_package/models/flex_option.py index e24c5cc10..690cc8e24 100644 --- a/openapi/openapi_project/openapi_package/models/flex_option.py +++ b/openapi/openapi_project/openapi_package/models/flex_option.py @@ -3,19 +3,19 @@ from attrs import define as _attrs_define -from ..models.currency import Currency -from ..models.exchange_code import ExchangeCode -from ..models.numeric_display_format import NumericDisplayFormat -from ..models.option_exercise_style import OptionExerciseStyle -from ..models.option_series_product_type import OptionSeriesProductType -from ..models.option_settlement_type import OptionSettlementType -from ..models.put_call import PutCall -from ..models.security_category import SecurityCategory -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.models.exchange_code import ExchangeCode +from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat +from openapi_project.openapi_package.models.option_exercise_style import OptionExerciseStyle +from openapi_project.openapi_package.models.option_series_product_type import OptionSeriesProductType +from openapi_project.openapi_package.models.option_settlement_type import OptionSettlementType +from openapi_project.openapi_package.models.put_call import PutCall +from openapi_project.openapi_package.models.security_category import SecurityCategory +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.date import Date - from ..models.flex_option_aliases import FlexOptionAliases + from openapi_project.openapi_package.models.date import Date + from openapi_project.openapi_package.models.flex_option_aliases import FlexOptionAliases T = TypeVar("T", bound="FlexOption") @@ -266,8 +266,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.date import Date - from ..models.flex_option_aliases import FlexOptionAliases + from openapi_project.openapi_package.models.date import Date + from openapi_project.openapi_package.models.flex_option_aliases import FlexOptionAliases d = dict(src_dict) _aliases = d.pop("aliases", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/future.py b/openapi/openapi_project/openapi_package/models/future.py index c27b81445..80610603e 100644 --- a/openapi/openapi_project/openapi_package/models/future.py +++ b/openapi/openapi_project/openapi_package/models/future.py @@ -3,16 +3,16 @@ from attrs import define as _attrs_define -from ..models.currency import Currency -from ..models.exchange_code import ExchangeCode -from ..models.numeric_display_format import NumericDisplayFormat -from ..models.security_category import SecurityCategory -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.models.exchange_code import ExchangeCode +from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat +from openapi_project.openapi_package.models.security_category import SecurityCategory +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.date import Date - from ..models.future_aliases import FutureAliases - from ..models.future_root import FutureRoot + from openapi_project.openapi_package.models.date import Date + from openapi_project.openapi_package.models.future_aliases import FutureAliases + from openapi_project.openapi_package.models.future_root import FutureRoot T = TypeVar("T", bound="Future") @@ -213,9 +213,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.date import Date - from ..models.future_aliases import FutureAliases - from ..models.future_root import FutureRoot + from openapi_project.openapi_package.models.date import Date + from openapi_project.openapi_package.models.future_aliases import FutureAliases + from openapi_project.openapi_package.models.future_root import FutureRoot d = dict(src_dict) _aliases = d.pop("aliases", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/future_root.py b/openapi/openapi_project/openapi_package/models/future_root.py index 4523534a1..cb7607e50 100644 --- a/openapi/openapi_project/openapi_package/models/future_root.py +++ b/openapi/openapi_project/openapi_package/models/future_root.py @@ -3,19 +3,19 @@ from attrs import define as _attrs_define -from ..models.currency import Currency -from ..models.exchange_code import ExchangeCode -from ..models.numeric_display_format import NumericDisplayFormat -from ..models.product_group import ProductGroup -from ..models.product_sub_group import ProductSubGroup -from ..models.security_category import SecurityCategory -from ..models.settlement_deliverable_type import SettlementDeliverableType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.models.exchange_code import ExchangeCode +from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat +from openapi_project.openapi_package.models.product_group import ProductGroup +from openapi_project.openapi_package.models.product_sub_group import ProductSubGroup +from openapi_project.openapi_package.models.security_category import SecurityCategory +from openapi_project.openapi_package.models.settlement_deliverable_type import SettlementDeliverableType +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.date import Date - from ..models.future_root_aliases import FutureRootAliases - from ..models.trading_session_group import TradingSessionGroup + from openapi_project.openapi_package.models.date import Date + from openapi_project.openapi_package.models.future_root_aliases import FutureRootAliases + from openapi_project.openapi_package.models.trading_session_group import TradingSessionGroup T = TypeVar("T", bound="FutureRoot") @@ -214,9 +214,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.date import Date - from ..models.future_root_aliases import FutureRootAliases - from ..models.trading_session_group import TradingSessionGroup + from openapi_project.openapi_package.models.date import Date + from openapi_project.openapi_package.models.future_root_aliases import FutureRootAliases + from openapi_project.openapi_package.models.trading_session_group import TradingSessionGroup d = dict(src_dict) _aliases = d.pop("aliases", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/future_spread.py b/openapi/openapi_project/openapi_package/models/future_spread.py index c804658be..4efee6460 100644 --- a/openapi/openapi_project/openapi_package/models/future_spread.py +++ b/openapi/openapi_project/openapi_package/models/future_spread.py @@ -3,16 +3,16 @@ from attrs import define as _attrs_define -from ..models.currency import Currency -from ..models.exchange_code import ExchangeCode -from ..models.numeric_display_format import NumericDisplayFormat -from ..models.security_category import SecurityCategory -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.models.exchange_code import ExchangeCode +from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat +from openapi_project.openapi_package.models.security_category import SecurityCategory +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.date import Date - from ..models.future_spread_aliases import FutureSpreadAliases - from ..models.future_spread_leg import FutureSpreadLeg + from openapi_project.openapi_package.models.date import Date + from openapi_project.openapi_package.models.future_spread_aliases import FutureSpreadAliases + from openapi_project.openapi_package.models.future_spread_leg import FutureSpreadLeg T = TypeVar("T", bound="FutureSpread") @@ -228,9 +228,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.date import Date - from ..models.future_spread_aliases import FutureSpreadAliases - from ..models.future_spread_leg import FutureSpreadLeg + from openapi_project.openapi_package.models.date import Date + from openapi_project.openapi_package.models.future_spread_aliases import FutureSpreadAliases + from openapi_project.openapi_package.models.future_spread_leg import FutureSpreadLeg d = dict(src_dict) _aliases = d.pop("aliases", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/future_spread_leg.py b/openapi/openapi_project/openapi_package/models/future_spread_leg.py index 3beec7287..ed28eac22 100644 --- a/openapi/openapi_project/openapi_package/models/future_spread_leg.py +++ b/openapi/openapi_project/openapi_package/models/future_spread_leg.py @@ -3,12 +3,12 @@ from attrs import define as _attrs_define -from ..models.spread_leg_side import SpreadLegSide -from ..models.spread_leg_type import SpreadLegType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.spread_leg_side import SpreadLegSide +from openapi_project.openapi_package.models.spread_leg_type import SpreadLegType +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.future import Future + from openapi_project.openapi_package.models.future import Future T = TypeVar("T", bound="FutureSpreadLeg") @@ -72,7 +72,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.future import Future + from openapi_project.openapi_package.models.future import Future d = dict(src_dict) delta = d.pop("delta", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/fx.py b/openapi/openapi_project/openapi_package/models/fx.py index c4c61ffa1..e4b1f68c0 100644 --- a/openapi/openapi_project/openapi_package/models/fx.py +++ b/openapi/openapi_project/openapi_package/models/fx.py @@ -3,15 +3,15 @@ from attrs import define as _attrs_define -from ..models.currency import Currency -from ..models.exchange_code import ExchangeCode -from ..models.numeric_display_format import NumericDisplayFormat -from ..models.security_category import SecurityCategory -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.models.exchange_code import ExchangeCode +from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat +from openapi_project.openapi_package.models.security_category import SecurityCategory +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.date import Date - from ..models.fx_aliases import FxAliases + from openapi_project.openapi_package.models.date import Date + from openapi_project.openapi_package.models.fx_aliases import FxAliases T = TypeVar("T", bound="Fx") @@ -174,8 +174,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.date import Date - from ..models.fx_aliases import FxAliases + from openapi_project.openapi_package.models.date import Date + from openapi_project.openapi_package.models.fx_aliases import FxAliases d = dict(src_dict) _aliases = d.pop("aliases", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/generic_order.py b/openapi/openapi_project/openapi_package/models/generic_order.py index e943d1343..380ee4174 100644 --- a/openapi/openapi_project/openapi_package/models/generic_order.py +++ b/openapi/openapi_project/openapi_package/models/generic_order.py @@ -3,13 +3,13 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.multi_leg_order import MultiLegOrder - from ..models.multi_leg_order_cross import MultiLegOrderCross - from ..models.order import Order - from ..models.order_cross import OrderCross + from openapi_project.openapi_package.models.multi_leg_order import MultiLegOrder + from openapi_project.openapi_package.models.multi_leg_order_cross import MultiLegOrderCross + from openapi_project.openapi_package.models.order import Order + from openapi_project.openapi_package.models.order_cross import OrderCross T = TypeVar("T", bound="GenericOrder") @@ -63,10 +63,10 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.multi_leg_order import MultiLegOrder - from ..models.multi_leg_order_cross import MultiLegOrderCross - from ..models.order import Order - from ..models.order_cross import OrderCross + from openapi_project.openapi_package.models.multi_leg_order import MultiLegOrder + from openapi_project.openapi_package.models.multi_leg_order_cross import MultiLegOrderCross + from openapi_project.openapi_package.models.order import Order + from openapi_project.openapi_package.models.order_cross import OrderCross d = dict(src_dict) _order = d.pop("order", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/get_active_user_response.py b/openapi/openapi_project/openapi_package/models/get_active_user_response.py index 08b20d969..d47f9eede 100644 --- a/openapi/openapi_project/openapi_package/models/get_active_user_response.py +++ b/openapi/openapi_project/openapi_package/models/get_active_user_response.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.user import User + from openapi_project.openapi_package.models.user import User T = TypeVar("T", bound="GetActiveUserResponse") @@ -51,7 +51,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.user import User + from openapi_project.openapi_package.models.user import User d = dict(src_dict) _user = d.pop("user", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/get_server_info_response.py b/openapi/openapi_project/openapi_package/models/get_server_info_response.py index 0bbbe7a2a..dc64e5fd3 100644 --- a/openapi/openapi_project/openapi_package/models/get_server_info_response.py +++ b/openapi/openapi_project/openapi_package/models/get_server_info_response.py @@ -3,13 +3,12 @@ from attrs import define as _attrs_define -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.get_server_info_response_system_settings import ( - GetServerInfoResponseSystemSettings, - ) + from openapi_project.openapi_package.models.get_server_info_response_system_settings import GetServerInfoResponseSystemSettings, + T = TypeVar("T", bound="GetServerInfoResponse") @@ -89,9 +88,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.get_server_info_response_system_settings import ( - GetServerInfoResponseSystemSettings, - ) + from openapi_project.openapi_package.models.get_server_info_response_system_settings import GetServerInfoResponseSystemSettings, + d = dict(src_dict) environment = d.pop("environment", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/get_server_time_response.py b/openapi/openapi_project/openapi_package/models/get_server_time_response.py index c19f78f0e..65c8ff92f 100644 --- a/openapi/openapi_project/openapi_package/models/get_server_time_response.py +++ b/openapi/openapi_project/openapi_package/models/get_server_time_response.py @@ -3,8 +3,8 @@ from attrs import define as _attrs_define -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="GetServerTimeResponse") diff --git a/openapi/openapi_project/openapi_package/models/get_trading_holidays_response.py b/openapi/openapi_project/openapi_package/models/get_trading_holidays_response.py index 81f204a68..fd2bed4f6 100644 --- a/openapi/openapi_project/openapi_package/models/get_trading_holidays_response.py +++ b/openapi/openapi_project/openapi_package/models/get_trading_holidays_response.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.trading_holiday import TradingHoliday + from openapi_project.openapi_package.models.trading_holiday import TradingHoliday T = TypeVar("T", bound="GetTradingHolidaysResponse") @@ -54,7 +54,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.trading_holiday import TradingHoliday + from openapi_project.openapi_package.models.trading_holiday import TradingHoliday d = dict(src_dict) trading_holidays = [] diff --git a/openapi/openapi_project/openapi_package/models/header.py b/openapi/openapi_project/openapi_package/models/header.py index dd5dd0fb9..cdc0ecdb8 100644 --- a/openapi/openapi_project/openapi_package/models/header.py +++ b/openapi/openapi_project/openapi_package/models/header.py @@ -3,7 +3,7 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="Header") diff --git a/openapi/openapi_project/openapi_package/models/index.py b/openapi/openapi_project/openapi_package/models/index.py index 350f9871a..d7ffa9151 100644 --- a/openapi/openapi_project/openapi_package/models/index.py +++ b/openapi/openapi_project/openapi_package/models/index.py @@ -3,15 +3,15 @@ from attrs import define as _attrs_define -from ..models.currency import Currency -from ..models.exchange_code import ExchangeCode -from ..models.numeric_display_format import NumericDisplayFormat -from ..models.security_category import SecurityCategory -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.models.exchange_code import ExchangeCode +from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat +from openapi_project.openapi_package.models.security_category import SecurityCategory +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.date import Date - from ..models.index_aliases import IndexAliases + from openapi_project.openapi_package.models.date import Date + from openapi_project.openapi_package.models.index_aliases import IndexAliases T = TypeVar("T", bound="Index") @@ -166,8 +166,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.date import Date - from ..models.index_aliases import IndexAliases + from openapi_project.openapi_package.models.date import Date + from openapi_project.openapi_package.models.index_aliases import IndexAliases d = dict(src_dict) _aliases = d.pop("aliases", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/list_accounts_response.py b/openapi/openapi_project/openapi_package/models/list_accounts_response.py index b12ec1951..2b18c3f18 100644 --- a/openapi/openapi_project/openapi_package/models/list_accounts_response.py +++ b/openapi/openapi_project/openapi_package/models/list_accounts_response.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.account import Account + from openapi_project.openapi_package.models.account import Account T = TypeVar("T", bound="ListAccountsResponse") @@ -54,7 +54,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.account import Account + from openapi_project.openapi_package.models.account import Account d = dict(src_dict) accounts = [] diff --git a/openapi/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py b/openapi/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py index 4717d9bd4..e5de5f0ad 100644 --- a/openapi/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py +++ b/openapi/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.trading_firm_slim import TradingFirmSlim + from openapi_project.openapi_package.models.trading_firm_slim import TradingFirmSlim T = TypeVar("T", bound="ListAffiliatedTradingFirmsResponse") @@ -54,7 +54,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.trading_firm_slim import TradingFirmSlim + from openapi_project.openapi_package.models.trading_firm_slim import TradingFirmSlim d = dict(src_dict) affiliated_firms = [] diff --git a/openapi/openapi_project/openapi_package/models/list_easy_to_borrow_securities_request.py b/openapi/openapi_project/openapi_package/models/list_easy_to_borrow_securities_request.py index 20674d12f..64b8c84aa 100644 --- a/openapi/openapi_project/openapi_package/models/list_easy_to_borrow_securities_request.py +++ b/openapi/openapi_project/openapi_package/models/list_easy_to_borrow_securities_request.py @@ -3,7 +3,7 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="ListEasyToBorrowSecuritiesRequest") diff --git a/openapi/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py b/openapi/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py index 7046c3360..0f898aabc 100644 --- a/openapi/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py +++ b/openapi/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.easy_to_borrow_security import EasyToBorrowSecurity + from openapi_project.openapi_package.models.easy_to_borrow_security import EasyToBorrowSecurity T = TypeVar("T", bound="ListEasyToBorrowSecuritiesResponse") @@ -54,7 +54,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.easy_to_borrow_security import EasyToBorrowSecurity + from openapi_project.openapi_package.models.easy_to_borrow_security import EasyToBorrowSecurity d = dict(src_dict) securities = [] diff --git a/openapi/openapi_project/openapi_package/models/list_exchanges_response.py b/openapi/openapi_project/openapi_package/models/list_exchanges_response.py index 32dc42c16..1a0c582e6 100644 --- a/openapi/openapi_project/openapi_package/models/list_exchanges_response.py +++ b/openapi/openapi_project/openapi_package/models/list_exchanges_response.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.exchange import Exchange + from openapi_project.openapi_package.models.exchange import Exchange T = TypeVar("T", bound="ListExchangesResponse") @@ -54,7 +54,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.exchange import Exchange + from openapi_project.openapi_package.models.exchange import Exchange d = dict(src_dict) exchanges = [] diff --git a/openapi/openapi_project/openapi_package/models/list_option_chains_repsonse.py b/openapi/openapi_project/openapi_package/models/list_option_chains_repsonse.py index b4ebc9b39..b5215c75d 100644 --- a/openapi/openapi_project/openapi_package/models/list_option_chains_repsonse.py +++ b/openapi/openapi_project/openapi_package/models/list_option_chains_repsonse.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.option_chain import OptionChain + from openapi_project.openapi_package.models.option_chain import OptionChain T = TypeVar("T", bound="ListOptionChainsRepsonse") @@ -54,7 +54,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.option_chain import OptionChain + from openapi_project.openapi_package.models.option_chain import OptionChain d = dict(src_dict) option_chains = [] diff --git a/openapi/openapi_project/openapi_package/models/list_option_chains_request.py b/openapi/openapi_project/openapi_package/models/list_option_chains_request.py index efcb9c431..bf5b1e3ae 100644 --- a/openapi/openapi_project/openapi_package/models/list_option_chains_request.py +++ b/openapi/openapi_project/openapi_package/models/list_option_chains_request.py @@ -3,7 +3,7 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="ListOptionChainsRequest") diff --git a/openapi/openapi_project/openapi_package/models/list_orders_response.py b/openapi/openapi_project/openapi_package/models/list_orders_response.py index 789644369..25040a2c8 100644 --- a/openapi/openapi_project/openapi_package/models/list_orders_response.py +++ b/openapi/openapi_project/openapi_package/models/list_orders_response.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.generic_order import GenericOrder + from openapi_project.openapi_package.models.generic_order import GenericOrder T = TypeVar("T", bound="ListOrdersResponse") @@ -54,7 +54,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.generic_order import GenericOrder + from openapi_project.openapi_package.models.generic_order import GenericOrder d = dict(src_dict) orders = [] diff --git a/openapi/openapi_project/openapi_package/models/list_positions_response.py b/openapi/openapi_project/openapi_package/models/list_positions_response.py index fbc77d357..e87621c08 100644 --- a/openapi/openapi_project/openapi_package/models/list_positions_response.py +++ b/openapi/openapi_project/openapi_package/models/list_positions_response.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.position import Position + from openapi_project.openapi_package.models.position import Position T = TypeVar("T", bound="ListPositionsResponse") @@ -54,7 +54,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.position import Position + from openapi_project.openapi_package.models.position import Position d = dict(src_dict) positions = [] diff --git a/openapi/openapi_project/openapi_package/models/list_routes_response.py b/openapi/openapi_project/openapi_package/models/list_routes_response.py index 2455f717b..7d8e699b3 100644 --- a/openapi/openapi_project/openapi_package/models/list_routes_response.py +++ b/openapi/openapi_project/openapi_package/models/list_routes_response.py @@ -3,12 +3,12 @@ from attrs import define as _attrs_define -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.route import Route - from ..models.route_applicability import RouteApplicability + from openapi_project.openapi_package.models.route import Route + from openapi_project.openapi_package.models.route_applicability import RouteApplicability T = TypeVar("T", bound="ListRoutesResponse") @@ -66,8 +66,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.route import Route - from ..models.route_applicability import RouteApplicability + from openapi_project.openapi_package.models.route import Route + from openapi_project.openapi_package.models.route_applicability import RouteApplicability d = dict(src_dict) routes = [] diff --git a/openapi/openapi_project/openapi_package/models/list_securities_request.py b/openapi/openapi_project/openapi_package/models/list_securities_request.py index 1390029ae..41330326b 100644 --- a/openapi/openapi_project/openapi_package/models/list_securities_request.py +++ b/openapi/openapi_project/openapi_package/models/list_securities_request.py @@ -3,7 +3,7 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="ListSecuritiesRequest") diff --git a/openapi/openapi_project/openapi_package/models/list_securities_response.py b/openapi/openapi_project/openapi_package/models/list_securities_response.py index 9e4934459..b752a2e10 100644 --- a/openapi/openapi_project/openapi_package/models/list_securities_response.py +++ b/openapi/openapi_project/openapi_package/models/list_securities_response.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.security import Security + from openapi_project.openapi_package.models.security import Security T = TypeVar("T", bound="ListSecuritiesResponse") @@ -54,7 +54,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.security import Security + from openapi_project.openapi_package.models.security import Security d = dict(src_dict) securities = [] diff --git a/openapi/openapi_project/openapi_package/models/list_trade_confirms_response.py b/openapi/openapi_project/openapi_package/models/list_trade_confirms_response.py index c882c7c47..69aaf9cab 100644 --- a/openapi/openapi_project/openapi_package/models/list_trade_confirms_response.py +++ b/openapi/openapi_project/openapi_package/models/list_trade_confirms_response.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.trade_confirm import TradeConfirm + from openapi_project.openapi_package.models.trade_confirm import TradeConfirm T = TypeVar("T", bound="ListTradeConfirmsResponse") @@ -54,7 +54,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.trade_confirm import TradeConfirm + from openapi_project.openapi_package.models.trade_confirm import TradeConfirm d = dict(src_dict) trade_confirms = [] diff --git a/openapi/openapi_project/openapi_package/models/list_trading_firms_response.py b/openapi/openapi_project/openapi_package/models/list_trading_firms_response.py index 9759c68e5..fc841f880 100644 --- a/openapi/openapi_project/openapi_package/models/list_trading_firms_response.py +++ b/openapi/openapi_project/openapi_package/models/list_trading_firms_response.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.trading_firm import TradingFirm + from openapi_project.openapi_package.models.trading_firm import TradingFirm T = TypeVar("T", bound="ListTradingFirmsResponse") @@ -54,7 +54,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.trading_firm import TradingFirm + from openapi_project.openapi_package.models.trading_firm import TradingFirm d = dict(src_dict) trading_firms = [] diff --git a/openapi/openapi_project/openapi_package/models/login_request.py b/openapi/openapi_project/openapi_package/models/login_request.py index fc9347b21..e5ad8c36a 100644 --- a/openapi/openapi_project/openapi_package/models/login_request.py +++ b/openapi/openapi_project/openapi_package/models/login_request.py @@ -3,7 +3,7 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="LoginRequest") diff --git a/openapi/openapi_project/openapi_package/models/login_response.py b/openapi/openapi_project/openapi_package/models/login_response.py index 757b0879c..91d63d449 100644 --- a/openapi/openapi_project/openapi_package/models/login_response.py +++ b/openapi/openapi_project/openapi_package/models/login_response.py @@ -3,13 +3,13 @@ from attrs import define as _attrs_define -from ..models.login_status import LoginStatus -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.login_status import LoginStatus +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.login_response_system_settings import LoginResponseSystemSettings - from ..models.user import User + from openapi_project.openapi_package.models.login_response_system_settings import LoginResponseSystemSettings + from openapi_project.openapi_package.models.user import User T = TypeVar("T", bound="LoginResponse") @@ -129,8 +129,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.login_response_system_settings import LoginResponseSystemSettings - from ..models.user import User + from openapi_project.openapi_package.models.login_response_system_settings import LoginResponseSystemSettings + from openapi_project.openapi_package.models.user import User d = dict(src_dict) token = d.pop("token", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/margin_data.py b/openapi/openapi_project/openapi_package/models/margin_data.py index a5a72ebcf..c97d6e06d 100644 --- a/openapi/openapi_project/openapi_package/models/margin_data.py +++ b/openapi/openapi_project/openapi_package/models/margin_data.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.empty import Empty - from ..models.tims_margin_data import TimsMarginData + from openapi_project.openapi_package.models.empty import Empty + from openapi_project.openapi_package.models.tims_margin_data import TimsMarginData T = TypeVar("T", bound="MarginData") @@ -51,8 +51,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.empty import Empty - from ..models.tims_margin_data import TimsMarginData + from openapi_project.openapi_package.models.empty import Empty + from openapi_project.openapi_package.models.tims_margin_data import TimsMarginData d = dict(src_dict) account_id = d.pop("accountId", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order.py b/openapi/openapi_project/openapi_package/models/multi_leg_order.py index c925ee6b2..bc9095996 100644 --- a/openapi/openapi_project/openapi_package/models/multi_leg_order.py +++ b/openapi/openapi_project/openapi_package/models/multi_leg_order.py @@ -3,22 +3,22 @@ from attrs import define as _attrs_define -from ..models.ord_status import OrdStatus -from ..models.ord_type import OrdType -from ..models.origination_type import OriginationType -from ..models.price_type import PriceType -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.ord_status import OrdStatus +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.origination_type import OriginationType +from openapi_project.openapi_package.models.price_type import PriceType +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.clearing_info import ClearingInfo - from ..models.header import Header - from ..models.multi_leg_order_algo import MultiLegOrderAlgo - from ..models.multi_leg_order_leg import MultiLegOrderLeg - from ..models.multi_leg_order_market_condition import MultiLegOrderMarketCondition - from ..models.multi_leg_order_optional_data import MultiLegOrderOptionalData - from ..models.order_instruction import OrderInstruction - from ..models.order_update_event import OrderUpdateEvent + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.multi_leg_order_algo import MultiLegOrderAlgo + from openapi_project.openapi_package.models.multi_leg_order_leg import MultiLegOrderLeg + from openapi_project.openapi_package.models.multi_leg_order_market_condition import MultiLegOrderMarketCondition + from openapi_project.openapi_package.models.multi_leg_order_optional_data import MultiLegOrderOptionalData + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent T = TypeVar("T", bound="MultiLegOrder") @@ -333,16 +333,15 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.clearing_info import ClearingInfo - from ..models.header import Header - from ..models.multi_leg_order_algo import MultiLegOrderAlgo - from ..models.multi_leg_order_leg import MultiLegOrderLeg - from ..models.multi_leg_order_market_condition import ( - MultiLegOrderMarketCondition, - ) - from ..models.multi_leg_order_optional_data import MultiLegOrderOptionalData - from ..models.order_instruction import OrderInstruction - from ..models.order_update_event import OrderUpdateEvent + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.multi_leg_order_algo import MultiLegOrderAlgo + from openapi_project.openapi_package.models.multi_leg_order_leg import MultiLegOrderLeg + from openapi_project.openapi_package.models.multi_leg_order_market_condition import MultiLegOrderMarketCondition, + + from openapi_project.openapi_package.models.multi_leg_order_optional_data import MultiLegOrderOptionalData + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent d = dict(src_dict) account_id = d.pop("accountId", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py index f1c4373c6..a1a890f6f 100644 --- a/openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py +++ b/openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py @@ -3,26 +3,23 @@ from attrs import define as _attrs_define -from ..models.ord_type import OrdType -from ..models.origination_type import OriginationType -from ..models.price_type import PriceType -from ..models.side import Side -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.origination_type import OriginationType +from openapi_project.openapi_package.models.price_type import PriceType +from openapi_project.openapi_package.models.side import Side +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.clearing_info import ClearingInfo - from ..models.header import Header - from ..models.multi_leg_order_cancel_replace_request_algo import ( - MultiLegOrderCancelReplaceRequestAlgo, - ) - from ..models.multi_leg_order_cancel_replace_request_market_condition import ( - MultiLegOrderCancelReplaceRequestMarketCondition, - ) - from ..models.multi_leg_order_cancel_replace_request_optional_data import ( - MultiLegOrderCancelReplaceRequestOptionalData, - ) - from ..models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_algo import MultiLegOrderCancelReplaceRequestAlgo, + + from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_market_condition import MultiLegOrderCancelReplaceRequestMarketCondition, + + from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_optional_data import MultiLegOrderCancelReplaceRequestOptionalData, + + from openapi_project.openapi_package.models.order_instruction import OrderInstruction T = TypeVar("T", bound="MultiLegOrderCancelReplaceRequest") @@ -221,18 +218,15 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.clearing_info import ClearingInfo - from ..models.header import Header - from ..models.multi_leg_order_cancel_replace_request_algo import ( - MultiLegOrderCancelReplaceRequestAlgo, - ) - from ..models.multi_leg_order_cancel_replace_request_market_condition import ( - MultiLegOrderCancelReplaceRequestMarketCondition, - ) - from ..models.multi_leg_order_cancel_replace_request_optional_data import ( - MultiLegOrderCancelReplaceRequestOptionalData, - ) - from ..models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_algo import MultiLegOrderCancelReplaceRequestAlgo, + + from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_market_condition import MultiLegOrderCancelReplaceRequestMarketCondition, + + from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_optional_data import MultiLegOrderCancelReplaceRequestOptionalData, + + from openapi_project.openapi_package.models.order_instruction import OrderInstruction d = dict(src_dict) _algo = d.pop("algo", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_cross.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_cross.py index f62bf4e99..846366bba 100644 --- a/openapi/openapi_project/openapi_package/models/multi_leg_order_cross.py +++ b/openapi/openapi_project/openapi_package/models/multi_leg_order_cross.py @@ -3,26 +3,24 @@ from attrs import define as _attrs_define -from ..models.cross_type import CrossType -from ..models.ord_status import OrdStatus -from ..models.ord_type import OrdType -from ..models.origination_type import OriginationType -from ..models.price_type import PriceType -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.cross_type import CrossType +from openapi_project.openapi_package.models.ord_status import OrdStatus +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.origination_type import OriginationType +from openapi_project.openapi_package.models.price_type import PriceType +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.header import Header - from ..models.multi_leg_order_cross_algo import MultiLegOrderCrossAlgo - from ..models.multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation - from ..models.multi_leg_order_cross_market_condition import ( - MultiLegOrderCrossMarketCondition, - ) - from ..models.multi_leg_order_cross_optional_data import ( - MultiLegOrderCrossOptionalData, - ) - from ..models.order_instruction import OrderInstruction - from ..models.order_update_event import OrderUpdateEvent + from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.multi_leg_order_cross_algo import MultiLegOrderCrossAlgo + from openapi_project.openapi_package.models.multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation + from openapi_project.openapi_package.models.multi_leg_order_cross_market_condition import MultiLegOrderCrossMarketCondition, + + from openapi_project.openapi_package.models.multi_leg_order_cross_optional_data import MultiLegOrderCrossOptionalData, + + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent T = TypeVar("T", bound="MultiLegOrderCross") @@ -289,19 +287,16 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.header import Header - from ..models.multi_leg_order_cross_algo import MultiLegOrderCrossAlgo - from ..models.multi_leg_order_cross_allocation import ( - MultiLegOrderCrossAllocation, - ) - from ..models.multi_leg_order_cross_market_condition import ( - MultiLegOrderCrossMarketCondition, - ) - from ..models.multi_leg_order_cross_optional_data import ( - MultiLegOrderCrossOptionalData, - ) - from ..models.order_instruction import OrderInstruction - from ..models.order_update_event import OrderUpdateEvent + from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.multi_leg_order_cross_algo import MultiLegOrderCrossAlgo + from openapi_project.openapi_package.models.multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation, + + from openapi_project.openapi_package.models.multi_leg_order_cross_market_condition import MultiLegOrderCrossMarketCondition, + + from openapi_project.openapi_package.models.multi_leg_order_cross_optional_data import MultiLegOrderCrossOptionalData, + + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent d = dict(src_dict) account_id = d.pop("accountId", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py index c4cc4e4d7..c2b487050 100644 --- a/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py +++ b/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py @@ -3,17 +3,16 @@ from attrs import define as _attrs_define -from ..models.cross_side_type import CrossSideType -from ..models.ord_status import OrdStatus -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.cross_side_type import CrossSideType +from openapi_project.openapi_package.models.ord_status import OrdStatus +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.clearing_info import ClearingInfo - from ..models.multi_leg_order_cross_allocation_optional_data import ( - MultiLegOrderCrossAllocationOptionalData, - ) - from ..models.multi_leg_order_leg import MultiLegOrderLeg - from ..models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.multi_leg_order_cross_allocation_optional_data import MultiLegOrderCrossAllocationOptionalData, + + from openapi_project.openapi_package.models.multi_leg_order_leg import MultiLegOrderLeg + from openapi_project.openapi_package.models.order_instruction import OrderInstruction T = TypeVar("T", bound="MultiLegOrderCrossAllocation") @@ -161,12 +160,11 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.clearing_info import ClearingInfo - from ..models.multi_leg_order_cross_allocation_optional_data import ( - MultiLegOrderCrossAllocationOptionalData, - ) - from ..models.multi_leg_order_leg import MultiLegOrderLeg - from ..models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.multi_leg_order_cross_allocation_optional_data import MultiLegOrderCrossAllocationOptionalData, + + from openapi_project.openapi_package.models.multi_leg_order_leg import MultiLegOrderLeg + from openapi_project.openapi_package.models.order_instruction import OrderInstruction d = dict(src_dict) account_id = d.pop("accountId", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_leg.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_leg.py index d3374e9cf..45677bb3a 100644 --- a/openapi/openapi_project/openapi_package/models/multi_leg_order_leg.py +++ b/openapi/openapi_project/openapi_package/models/multi_leg_order_leg.py @@ -3,17 +3,16 @@ from attrs import define as _attrs_define -from ..models.position_effect import PositionEffect -from ..models.side import Side -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.position_effect import PositionEffect +from openapi_project.openapi_package.models.side import Side +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.multi_leg_order_leg_market_condition import ( - MultiLegOrderLegMarketCondition, - ) - from ..models.multi_leg_order_leg_optional_data import MultiLegOrderLegOptionalData - from ..models.order_update_event import OrderUpdateEvent - from ..models.security import Security + from openapi_project.openapi_package.models.multi_leg_order_leg_market_condition import MultiLegOrderLegMarketCondition, + + from openapi_project.openapi_package.models.multi_leg_order_leg_optional_data import MultiLegOrderLegOptionalData + from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent + from openapi_project.openapi_package.models.security import Security T = TypeVar("T", bound="MultiLegOrderLeg") @@ -158,14 +157,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.multi_leg_order_leg_market_condition import ( - MultiLegOrderLegMarketCondition, - ) - from ..models.multi_leg_order_leg_optional_data import ( - MultiLegOrderLegOptionalData, - ) - from ..models.order_update_event import OrderUpdateEvent - from ..models.security import Security + from openapi_project.openapi_package.models.multi_leg_order_leg_market_condition import MultiLegOrderLegMarketCondition, + + from openapi_project.openapi_package.models.multi_leg_order_leg_optional_data import MultiLegOrderLegOptionalData, + + from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent + from openapi_project.openapi_package.models.security import Security d = dict(src_dict) id = d.pop("id", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/option.py b/openapi/openapi_project/openapi_package/models/option.py index be4c11837..fe49a7dc8 100644 --- a/openapi/openapi_project/openapi_package/models/option.py +++ b/openapi/openapi_project/openapi_package/models/option.py @@ -3,18 +3,18 @@ from attrs import define as _attrs_define -from ..models.currency import Currency -from ..models.exchange_code import ExchangeCode -from ..models.numeric_display_format import NumericDisplayFormat -from ..models.option_expiration_style import OptionExpirationStyle -from ..models.put_call import PutCall -from ..models.security_category import SecurityCategory -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.models.exchange_code import ExchangeCode +from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat +from openapi_project.openapi_package.models.option_expiration_style import OptionExpirationStyle +from openapi_project.openapi_package.models.put_call import PutCall +from openapi_project.openapi_package.models.security_category import SecurityCategory +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.date import Date - from ..models.option_aliases import OptionAliases - from ..models.option_root import OptionRoot + from openapi_project.openapi_package.models.date import Date + from openapi_project.openapi_package.models.option_aliases import OptionAliases + from openapi_project.openapi_package.models.option_root import OptionRoot T = TypeVar("T", bound="Option") @@ -229,9 +229,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.date import Date - from ..models.option_aliases import OptionAliases - from ..models.option_root import OptionRoot + from openapi_project.openapi_package.models.date import Date + from openapi_project.openapi_package.models.option_aliases import OptionAliases + from openapi_project.openapi_package.models.option_root import OptionRoot d = dict(src_dict) _aliases = d.pop("aliases", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/option_chain.py b/openapi/openapi_project/openapi_package/models/option_chain.py index 90be1bac4..8d5cada4f 100644 --- a/openapi/openapi_project/openapi_package/models/option_chain.py +++ b/openapi/openapi_project/openapi_package/models/option_chain.py @@ -3,13 +3,13 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.option_chain_options import OptionChainOptions - from ..models.option_chain_roots import OptionChainRoots - from ..models.option_series import OptionSeries - from ..models.security import Security + from openapi_project.openapi_package.models.option_chain_options import OptionChainOptions + from openapi_project.openapi_package.models.option_chain_roots import OptionChainRoots + from openapi_project.openapi_package.models.option_series import OptionSeries + from openapi_project.openapi_package.models.security import Security T = TypeVar("T", bound="OptionChain") @@ -78,10 +78,10 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.option_chain_options import OptionChainOptions - from ..models.option_chain_roots import OptionChainRoots - from ..models.option_series import OptionSeries - from ..models.security import Security + from openapi_project.openapi_package.models.option_chain_options import OptionChainOptions + from openapi_project.openapi_package.models.option_chain_roots import OptionChainRoots + from openapi_project.openapi_package.models.option_series import OptionSeries + from openapi_project.openapi_package.models.security import Security d = dict(src_dict) _underlying = d.pop("underlying", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/option_chain_option.py b/openapi/openapi_project/openapi_package/models/option_chain_option.py index abd7d82b4..cc8e4a085 100644 --- a/openapi/openapi_project/openapi_package/models/option_chain_option.py +++ b/openapi/openapi_project/openapi_package/models/option_chain_option.py @@ -3,13 +3,13 @@ from attrs import define as _attrs_define -from ..models.exchange_code import ExchangeCode -from ..models.put_call import PutCall -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.exchange_code import ExchangeCode +from openapi_project.openapi_package.models.put_call import PutCall +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.date import Date - from ..models.option_chain_option_aliases import OptionChainOptionAliases + from openapi_project.openapi_package.models.date import Date + from openapi_project.openapi_package.models.option_chain_option_aliases import OptionChainOptionAliases T = TypeVar("T", bound="OptionChainOption") @@ -132,8 +132,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.date import Date - from ..models.option_chain_option_aliases import OptionChainOptionAliases + from openapi_project.openapi_package.models.date import Date + from openapi_project.openapi_package.models.option_chain_option_aliases import OptionChainOptionAliases d = dict(src_dict) _aliases = d.pop("aliases", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/option_chain_options.py b/openapi/openapi_project/openapi_package/models/option_chain_options.py index 601a13e40..46b79fd15 100644 --- a/openapi/openapi_project/openapi_package/models/option_chain_options.py +++ b/openapi/openapi_project/openapi_package/models/option_chain_options.py @@ -5,7 +5,7 @@ from attrs import field as _attrs_field if TYPE_CHECKING: - from ..models.option_chain_option import OptionChainOption + from openapi_project.openapi_package.models.option_chain_option import OptionChainOption T = TypeVar("T", bound="OptionChainOptions") @@ -28,7 +28,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.option_chain_option import OptionChainOption + from openapi_project.openapi_package.models.option_chain_option import OptionChainOption d = dict(src_dict) option_chain_options = cls() diff --git a/openapi/openapi_project/openapi_package/models/option_chain_roots.py b/openapi/openapi_project/openapi_package/models/option_chain_roots.py index 1f6694c13..aff87bf59 100644 --- a/openapi/openapi_project/openapi_package/models/option_chain_roots.py +++ b/openapi/openapi_project/openapi_package/models/option_chain_roots.py @@ -5,7 +5,7 @@ from attrs import field as _attrs_field if TYPE_CHECKING: - from ..models.option_root import OptionRoot + from openapi_project.openapi_package.models.option_root import OptionRoot T = TypeVar("T", bound="OptionChainRoots") @@ -28,7 +28,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.option_root import OptionRoot + from openapi_project.openapi_package.models.option_root import OptionRoot d = dict(src_dict) option_chain_roots = cls() diff --git a/openapi/openapi_project/openapi_package/models/option_root.py b/openapi/openapi_project/openapi_package/models/option_root.py index 6ef3ff488..d9d0d74f0 100644 --- a/openapi/openapi_project/openapi_package/models/option_root.py +++ b/openapi/openapi_project/openapi_package/models/option_root.py @@ -3,21 +3,21 @@ from attrs import define as _attrs_define -from ..models.currency import Currency -from ..models.exchange_code import ExchangeCode -from ..models.numeric_display_format import NumericDisplayFormat -from ..models.option_exercise_style import OptionExerciseStyle -from ..models.option_series_product_type import OptionSeriesProductType -from ..models.option_series_type import OptionSeriesType -from ..models.option_settlement_type import OptionSettlementType -from ..models.security_category import SecurityCategory -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.models.exchange_code import ExchangeCode +from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat +from openapi_project.openapi_package.models.option_exercise_style import OptionExerciseStyle +from openapi_project.openapi_package.models.option_series_product_type import OptionSeriesProductType +from openapi_project.openapi_package.models.option_series_type import OptionSeriesType +from openapi_project.openapi_package.models.option_settlement_type import OptionSettlementType +from openapi_project.openapi_package.models.security_category import SecurityCategory +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.date import Date - from ..models.option_root_aliases import OptionRootAliases - from ..models.settlement_info import SettlementInfo - from ..models.trading_session_group import TradingSessionGroup + from openapi_project.openapi_package.models.date import Date + from openapi_project.openapi_package.models.option_root_aliases import OptionRootAliases + from openapi_project.openapi_package.models.settlement_info import SettlementInfo + from openapi_project.openapi_package.models.trading_session_group import TradingSessionGroup T = TypeVar("T", bound="OptionRoot") @@ -247,10 +247,10 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.date import Date - from ..models.option_root_aliases import OptionRootAliases - from ..models.settlement_info import SettlementInfo - from ..models.trading_session_group import TradingSessionGroup + from openapi_project.openapi_package.models.date import Date + from openapi_project.openapi_package.models.option_root_aliases import OptionRootAliases + from openapi_project.openapi_package.models.settlement_info import SettlementInfo + from openapi_project.openapi_package.models.trading_session_group import TradingSessionGroup d = dict(src_dict) _aliases = d.pop("aliases", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/option_series.py b/openapi/openapi_project/openapi_package/models/option_series.py index fbd7897ac..dda3fb697 100644 --- a/openapi/openapi_project/openapi_package/models/option_series.py +++ b/openapi/openapi_project/openapi_package/models/option_series.py @@ -3,16 +3,16 @@ from attrs import define as _attrs_define -from ..models.currency import Currency -from ..models.numeric_display_format import NumericDisplayFormat -from ..models.option_expiration_style import OptionExpirationStyle -from ..models.option_series_type import OptionSeriesType -from ..models.option_settlement_type import OptionSettlementType -from ..models.security_category import SecurityCategory -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat +from openapi_project.openapi_package.models.option_expiration_style import OptionExpirationStyle +from openapi_project.openapi_package.models.option_series_type import OptionSeriesType +from openapi_project.openapi_package.models.option_settlement_type import OptionSettlementType +from openapi_project.openapi_package.models.security_category import SecurityCategory +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.date import Date + from openapi_project.openapi_package.models.date import Date T = TypeVar("T", bound="OptionSeries") @@ -136,7 +136,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.date import Date + from openapi_project.openapi_package.models.date import Date d = dict(src_dict) _expiration_dt = d.pop("expirationDt", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/order.py b/openapi/openapi_project/openapi_package/models/order.py index 5510d3917..68578c635 100644 --- a/openapi/openapi_project/openapi_package/models/order.py +++ b/openapi/openapi_project/openapi_package/models/order.py @@ -3,24 +3,24 @@ from attrs import define as _attrs_define -from ..models.ord_status import OrdStatus -from ..models.ord_type import OrdType -from ..models.origination_type import OriginationType -from ..models.position_effect import PositionEffect -from ..models.price_type import PriceType -from ..models.side import Side -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.ord_status import OrdStatus +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.origination_type import OriginationType +from openapi_project.openapi_package.models.position_effect import PositionEffect +from openapi_project.openapi_package.models.price_type import PriceType +from openapi_project.openapi_package.models.side import Side +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.clearing_info import ClearingInfo - from ..models.header import Header - from ..models.order_algo import OrderAlgo - from ..models.order_instruction import OrderInstruction - from ..models.order_market_condition import OrderMarketCondition - from ..models.order_optional_data import OrderOptionalData - from ..models.order_update_event import OrderUpdateEvent - from ..models.security import Security + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.order_algo import OrderAlgo + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.order_market_condition import OrderMarketCondition + from openapi_project.openapi_package.models.order_optional_data import OrderOptionalData + from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent + from openapi_project.openapi_package.models.security import Security T = TypeVar("T", bound="Order") @@ -354,14 +354,14 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.clearing_info import ClearingInfo - from ..models.header import Header - from ..models.order_algo import OrderAlgo - from ..models.order_instruction import OrderInstruction - from ..models.order_market_condition import OrderMarketCondition - from ..models.order_optional_data import OrderOptionalData - from ..models.order_update_event import OrderUpdateEvent - from ..models.security import Security + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.order_algo import OrderAlgo + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.order_market_condition import OrderMarketCondition + from openapi_project.openapi_package.models.order_optional_data import OrderOptionalData + from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent + from openapi_project.openapi_package.models.security import Security d = dict(src_dict) account_id = d.pop("accountId", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/order_cancel_reject.py b/openapi/openapi_project/openapi_package/models/order_cancel_reject.py index e188474f0..5daec3f44 100644 --- a/openapi/openapi_project/openapi_package/models/order_cancel_reject.py +++ b/openapi/openapi_project/openapi_package/models/order_cancel_reject.py @@ -3,13 +3,13 @@ from attrs import define as _attrs_define -from ..models.cxl_rej_response_to import CxlRejResponseTo -from ..models.ord_status import OrdStatus -from ..models.origination_type import OriginationType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.cxl_rej_response_to import CxlRejResponseTo +from openapi_project.openapi_package.models.ord_status import OrdStatus +from openapi_project.openapi_package.models.origination_type import OriginationType +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.order_cancel_reject_optional_data import OrderCancelRejectOptionalData + from openapi_project.openapi_package.models.order_cancel_reject_optional_data import OrderCancelRejectOptionalData T = TypeVar("T", bound="OrderCancelReject") @@ -117,9 +117,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.order_cancel_reject_optional_data import ( - OrderCancelRejectOptionalData, - ) + from openapi_project.openapi_package.models.order_cancel_reject_optional_data import OrderCancelRejectOptionalData, + d = dict(src_dict) cur_ord_id = d.pop("curOrdId", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/order_cancel_replace_request.py b/openapi/openapi_project/openapi_package/models/order_cancel_replace_request.py index 82046e0ff..a90c700a7 100644 --- a/openapi/openapi_project/openapi_package/models/order_cancel_replace_request.py +++ b/openapi/openapi_project/openapi_package/models/order_cancel_replace_request.py @@ -3,24 +3,22 @@ from attrs import define as _attrs_define -from ..models.ord_type import OrdType -from ..models.origination_type import OriginationType -from ..models.price_type import PriceType -from ..models.side import Side -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.origination_type import OriginationType +from openapi_project.openapi_package.models.price_type import PriceType +from openapi_project.openapi_package.models.side import Side +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.clearing_info import ClearingInfo - from ..models.header import Header - from ..models.order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo - from ..models.order_cancel_replace_request_market_condition import ( - OrderCancelReplaceRequestMarketCondition, - ) - from ..models.order_cancel_replace_request_optional_data import ( - OrderCancelReplaceRequestOptionalData, - ) - from ..models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo + from openapi_project.openapi_package.models.order_cancel_replace_request_market_condition import OrderCancelReplaceRequestMarketCondition, + + from openapi_project.openapi_package.models.order_cancel_replace_request_optional_data import OrderCancelReplaceRequestOptionalData, + + from openapi_project.openapi_package.models.order_instruction import OrderInstruction T = TypeVar("T", bound="OrderCancelReplaceRequest") @@ -205,18 +203,15 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.clearing_info import ClearingInfo - from ..models.header import Header - from ..models.order_cancel_replace_request_algo import ( - OrderCancelReplaceRequestAlgo, - ) - from ..models.order_cancel_replace_request_market_condition import ( - OrderCancelReplaceRequestMarketCondition, - ) - from ..models.order_cancel_replace_request_optional_data import ( - OrderCancelReplaceRequestOptionalData, - ) - from ..models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo, + + from openapi_project.openapi_package.models.order_cancel_replace_request_market_condition import OrderCancelReplaceRequestMarketCondition, + + from openapi_project.openapi_package.models.order_cancel_replace_request_optional_data import OrderCancelReplaceRequestOptionalData, + + from openapi_project.openapi_package.models.order_instruction import OrderInstruction d = dict(src_dict) _algo = d.pop("algo", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/order_cancel_request.py b/openapi/openapi_project/openapi_package/models/order_cancel_request.py index 0b51c72c0..c8be6aea2 100644 --- a/openapi/openapi_project/openapi_package/models/order_cancel_request.py +++ b/openapi/openapi_project/openapi_package/models/order_cancel_request.py @@ -3,14 +3,13 @@ from attrs import define as _attrs_define -from ..models.origination_type import OriginationType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.origination_type import OriginationType +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.order_cancel_request_optional_data import ( - OrderCancelRequestOptionalData, - ) - from ..models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.order_cancel_request_optional_data import OrderCancelRequestOptionalData, + + from openapi_project.openapi_package.models.order_instruction import OrderInstruction T = TypeVar("T", bound="OrderCancelRequest") @@ -113,10 +112,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.order_cancel_request_optional_data import ( - OrderCancelRequestOptionalData, - ) - from ..models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.order_cancel_request_optional_data import OrderCancelRequestOptionalData, + + from openapi_project.openapi_package.models.order_instruction import OrderInstruction d = dict(src_dict) cur_ord_id = d.pop("curOrdId", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/order_cross.py b/openapi/openapi_project/openapi_package/models/order_cross.py index cc19c8ab3..c61fdb2ac 100644 --- a/openapi/openapi_project/openapi_package/models/order_cross.py +++ b/openapi/openapi_project/openapi_package/models/order_cross.py @@ -3,23 +3,23 @@ from attrs import define as _attrs_define -from ..models.cross_type import CrossType -from ..models.ord_status import OrdStatus -from ..models.ord_type import OrdType -from ..models.origination_type import OriginationType -from ..models.price_type import PriceType -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.cross_type import CrossType +from openapi_project.openapi_package.models.ord_status import OrdStatus +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.origination_type import OriginationType +from openapi_project.openapi_package.models.price_type import PriceType +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.header import Header - from ..models.order_cross_algo import OrderCrossAlgo - from ..models.order_cross_allocation import OrderCrossAllocation - from ..models.order_cross_market_condition import OrderCrossMarketCondition - from ..models.order_cross_optional_data import OrderCrossOptionalData - from ..models.order_instruction import OrderInstruction - from ..models.order_update_event import OrderUpdateEvent - from ..models.security import Security + from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.order_cross_algo import OrderCrossAlgo + from openapi_project.openapi_package.models.order_cross_allocation import OrderCrossAllocation + from openapi_project.openapi_package.models.order_cross_market_condition import OrderCrossMarketCondition + from openapi_project.openapi_package.models.order_cross_optional_data import OrderCrossOptionalData + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent + from openapi_project.openapi_package.models.security import Security T = TypeVar("T", bound="OrderCross") @@ -300,14 +300,14 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.header import Header - from ..models.order_cross_algo import OrderCrossAlgo - from ..models.order_cross_allocation import OrderCrossAllocation - from ..models.order_cross_market_condition import OrderCrossMarketCondition - from ..models.order_cross_optional_data import OrderCrossOptionalData - from ..models.order_instruction import OrderInstruction - from ..models.order_update_event import OrderUpdateEvent - from ..models.security import Security + from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.order_cross_algo import OrderCrossAlgo + from openapi_project.openapi_package.models.order_cross_allocation import OrderCrossAllocation + from openapi_project.openapi_package.models.order_cross_market_condition import OrderCrossMarketCondition + from openapi_project.openapi_package.models.order_cross_optional_data import OrderCrossOptionalData + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent + from openapi_project.openapi_package.models.security import Security d = dict(src_dict) account_id = d.pop("accountId", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/order_cross_allocation.py b/openapi/openapi_project/openapi_package/models/order_cross_allocation.py index b79a16449..47544587b 100644 --- a/openapi/openapi_project/openapi_package/models/order_cross_allocation.py +++ b/openapi/openapi_project/openapi_package/models/order_cross_allocation.py @@ -3,18 +3,17 @@ from attrs import define as _attrs_define -from ..models.cross_side_type import CrossSideType -from ..models.ord_status import OrdStatus -from ..models.position_effect import PositionEffect -from ..models.side import Side -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.cross_side_type import CrossSideType +from openapi_project.openapi_package.models.ord_status import OrdStatus +from openapi_project.openapi_package.models.position_effect import PositionEffect +from openapi_project.openapi_package.models.side import Side +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.clearing_info import ClearingInfo - from ..models.order_cross_allocation_optional_data import ( - OrderCrossAllocationOptionalData, - ) - from ..models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.order_cross_allocation_optional_data import OrderCrossAllocationOptionalData, + + from openapi_project.openapi_package.models.order_instruction import OrderInstruction T = TypeVar("T", bound="OrderCrossAllocation") @@ -161,11 +160,10 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.clearing_info import ClearingInfo - from ..models.order_cross_allocation_optional_data import ( - OrderCrossAllocationOptionalData, - ) - from ..models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.order_cross_allocation_optional_data import OrderCrossAllocationOptionalData, + + from openapi_project.openapi_package.models.order_instruction import OrderInstruction d = dict(src_dict) account_id = d.pop("accountId", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/order_delete.py b/openapi/openapi_project/openapi_package/models/order_delete.py index 06bbdd0dd..62b89ce4e 100644 --- a/openapi/openapi_project/openapi_package/models/order_delete.py +++ b/openapi/openapi_project/openapi_package/models/order_delete.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..models.origination_type import OriginationType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.origination_type import OriginationType +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.order_delete_optional_data import OrderDeleteOptionalData + from openapi_project.openapi_package.models.order_delete_optional_data import OrderDeleteOptionalData T = TypeVar("T", bound="OrderDelete") @@ -69,7 +69,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.order_delete_optional_data import OrderDeleteOptionalData + from openapi_project.openapi_package.models.order_delete_optional_data import OrderDeleteOptionalData d = dict(src_dict) cur_ord_id = d.pop("curOrdId", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/order_instruction.py b/openapi/openapi_project/openapi_package/models/order_instruction.py index 29068f573..ca3a086a4 100644 --- a/openapi/openapi_project/openapi_package/models/order_instruction.py +++ b/openapi/openapi_project/openapi_package/models/order_instruction.py @@ -3,8 +3,8 @@ from attrs import define as _attrs_define -from ..models.order_instruction_type import OrderInstructionType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.order_instruction_type import OrderInstructionType +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="OrderInstruction") diff --git a/openapi/openapi_project/openapi_package/models/order_update.py b/openapi/openapi_project/openapi_package/models/order_update.py index 6bd5e9c9c..5bb1caa6a 100644 --- a/openapi/openapi_project/openapi_package/models/order_update.py +++ b/openapi/openapi_project/openapi_package/models/order_update.py @@ -3,24 +3,24 @@ from attrs import define as _attrs_define -from ..models.exec_type import ExecType -from ..models.multi_leg_reporting_type import MultiLegReportingType -from ..models.ord_status import OrdStatus -from ..models.ord_type import OrdType -from ..models.origination_type import OriginationType -from ..models.position_effect import PositionEffect -from ..models.price_type import PriceType -from ..models.side import Side -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.exec_type import ExecType +from openapi_project.openapi_package.models.multi_leg_reporting_type import MultiLegReportingType +from openapi_project.openapi_package.models.ord_status import OrdStatus +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.origination_type import OriginationType +from openapi_project.openapi_package.models.position_effect import PositionEffect +from openapi_project.openapi_package.models.price_type import PriceType +from openapi_project.openapi_package.models.side import Side +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.clearing_info import ClearingInfo - from ..models.header import Header - from ..models.order_instruction import OrderInstruction - from ..models.order_update_algo import OrderUpdateAlgo - from ..models.order_update_optional_data import OrderUpdateOptionalData - from ..models.security import Security + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.order_update_algo import OrderUpdateAlgo + from openapi_project.openapi_package.models.order_update_optional_data import OrderUpdateOptionalData + from openapi_project.openapi_package.models.security import Security T = TypeVar("T", bound="OrderUpdate") @@ -381,12 +381,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.clearing_info import ClearingInfo - from ..models.header import Header - from ..models.order_instruction import OrderInstruction - from ..models.order_update_algo import OrderUpdateAlgo - from ..models.order_update_optional_data import OrderUpdateOptionalData - from ..models.security import Security + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.order_update_algo import OrderUpdateAlgo + from openapi_project.openapi_package.models.order_update_optional_data import OrderUpdateOptionalData + from openapi_project.openapi_package.models.security import Security d = dict(src_dict) account_id = d.pop("accountId", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/order_update_event.py b/openapi/openapi_project/openapi_package/models/order_update_event.py index cc4da2419..6ed63dbc8 100644 --- a/openapi/openapi_project/openapi_package/models/order_update_event.py +++ b/openapi/openapi_project/openapi_package/models/order_update_event.py @@ -3,18 +3,17 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.execution import Execution - from ..models.multi_leg_order_cancel_replace_request import ( - MultiLegOrderCancelReplaceRequest, - ) - from ..models.order_cancel_reject import OrderCancelReject - from ..models.order_cancel_replace_request import OrderCancelReplaceRequest - from ..models.order_cancel_request import OrderCancelRequest - from ..models.order_delete import OrderDelete - from ..models.order_update import OrderUpdate + from openapi_project.openapi_package.models.execution import Execution + from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request import MultiLegOrderCancelReplaceRequest, + + from openapi_project.openapi_package.models.order_cancel_reject import OrderCancelReject + from openapi_project.openapi_package.models.order_cancel_replace_request import OrderCancelReplaceRequest + from openapi_project.openapi_package.models.order_cancel_request import OrderCancelRequest + from openapi_project.openapi_package.models.order_delete import OrderDelete + from openapi_project.openapi_package.models.order_update import OrderUpdate T = TypeVar("T", bound="OrderUpdateEvent") @@ -98,15 +97,14 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.execution import Execution - from ..models.multi_leg_order_cancel_replace_request import ( - MultiLegOrderCancelReplaceRequest, - ) - from ..models.order_cancel_reject import OrderCancelReject - from ..models.order_cancel_replace_request import OrderCancelReplaceRequest - from ..models.order_cancel_request import OrderCancelRequest - from ..models.order_delete import OrderDelete - from ..models.order_update import OrderUpdate + from openapi_project.openapi_package.models.execution import Execution + from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request import MultiLegOrderCancelReplaceRequest, + + from openapi_project.openapi_package.models.order_cancel_reject import OrderCancelReject + from openapi_project.openapi_package.models.order_cancel_replace_request import OrderCancelReplaceRequest + from openapi_project.openapi_package.models.order_cancel_request import OrderCancelRequest + from openapi_project.openapi_package.models.order_delete import OrderDelete + from openapi_project.openapi_package.models.order_update import OrderUpdate d = dict(src_dict) _order_cancel_request = d.pop("orderCancelRequest", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/position.py b/openapi/openapi_project/openapi_package/models/position.py index f415c0b56..ec5a67fda 100644 --- a/openapi/openapi_project/openapi_package/models/position.py +++ b/openapi/openapi_project/openapi_package/models/position.py @@ -3,7 +3,7 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="Position") diff --git a/openapi/openapi_project/openapi_package/models/position_analysis.py b/openapi/openapi_project/openapi_package/models/position_analysis.py index 27a6fe63a..6233406be 100644 --- a/openapi/openapi_project/openapi_package/models/position_analysis.py +++ b/openapi/openapi_project/openapi_package/models/position_analysis.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.position_theo import PositionTheo - from ..models.scenario_theo import ScenarioTheo + from openapi_project.openapi_package.models.position_theo import PositionTheo + from openapi_project.openapi_package.models.scenario_theo import ScenarioTheo T = TypeVar("T", bound="PositionAnalysis") @@ -48,8 +48,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.position_theo import PositionTheo - from ..models.scenario_theo import ScenarioTheo + from openapi_project.openapi_package.models.position_theo import PositionTheo + from openapi_project.openapi_package.models.scenario_theo import ScenarioTheo d = dict(src_dict) _position_theo = d.pop("positionTheo", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/position_theo.py b/openapi/openapi_project/openapi_package/models/position_theo.py index dd434eb3f..19fe85323 100644 --- a/openapi/openapi_project/openapi_package/models/position_theo.py +++ b/openapi/openapi_project/openapi_package/models/position_theo.py @@ -3,10 +3,10 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.position_theo_leg import PositionTheoLeg + from openapi_project.openapi_package.models.position_theo_leg import PositionTheoLeg T = TypeVar("T", bound="PositionTheo") @@ -141,7 +141,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.position_theo_leg import PositionTheoLeg + from openapi_project.openapi_package.models.position_theo_leg import PositionTheoLeg d = dict(src_dict) as_of_ts = d.pop("asOfTs", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/position_theo_leg.py b/openapi/openapi_project/openapi_package/models/position_theo_leg.py index 0ffe36634..05f83b201 100644 --- a/openapi/openapi_project/openapi_package/models/position_theo_leg.py +++ b/openapi/openapi_project/openapi_package/models/position_theo_leg.py @@ -3,7 +3,7 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="PositionTheoLeg") diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_account_group.py b/openapi/openapi_project/openapi_package/models/risk_radar_account_group.py index 272b18685..c6685b252 100644 --- a/openapi/openapi_project/openapi_package/models/risk_radar_account_group.py +++ b/openapi/openapi_project/openapi_package/models/risk_radar_account_group.py @@ -3,12 +3,12 @@ from attrs import define as _attrs_define -from ..models.currency import Currency -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.risk_radar_product_group import RiskRadarProductGroup - from ..models.shock_value import ShockValue + from openapi_project.openapi_package.models.risk_radar_product_group import RiskRadarProductGroup + from openapi_project.openapi_package.models.shock_value import ShockValue T = TypeVar("T", bound="RiskRadarAccountGroup") @@ -72,8 +72,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.risk_radar_product_group import RiskRadarProductGroup - from ..models.shock_value import ShockValue + from openapi_project.openapi_package.models.risk_radar_product_group import RiskRadarProductGroup + from openapi_project.openapi_package.models.shock_value import ShockValue d = dict(src_dict) account_id = d.pop("accountId", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_class_group.py b/openapi/openapi_project/openapi_package/models/risk_radar_class_group.py index 8b97bd70c..f42e4a45b 100644 --- a/openapi/openapi_project/openapi_package/models/risk_radar_class_group.py +++ b/openapi/openapi_project/openapi_package/models/risk_radar_class_group.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.risk_radar_position import RiskRadarPosition - from ..models.shock_value import ShockValue + from openapi_project.openapi_package.models.risk_radar_position import RiskRadarPosition + from openapi_project.openapi_package.models.shock_value import ShockValue T = TypeVar("T", bound="RiskRadarClassGroup") @@ -119,8 +119,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.risk_radar_position import RiskRadarPosition - from ..models.shock_value import ShockValue + from openapi_project.openapi_package.models.risk_radar_position import RiskRadarPosition + from openapi_project.openapi_package.models.shock_value import ShockValue d = dict(src_dict) delta = d.pop("delta", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_data.py b/openapi/openapi_project/openapi_package/models/risk_radar_data.py index 817b995f1..42131b380 100644 --- a/openapi/openapi_project/openapi_package/models/risk_radar_data.py +++ b/openapi/openapi_project/openapi_package/models/risk_radar_data.py @@ -3,10 +3,10 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.risk_radar_account_group import RiskRadarAccountGroup + from openapi_project.openapi_package.models.risk_radar_account_group import RiskRadarAccountGroup T = TypeVar("T", bound="RiskRadarData") @@ -47,7 +47,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.risk_radar_account_group import RiskRadarAccountGroup + from openapi_project.openapi_package.models.risk_radar_account_group import RiskRadarAccountGroup d = dict(src_dict) risks_result = [] diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_position.py b/openapi/openapi_project/openapi_package/models/risk_radar_position.py index f78032469..23cc5fdbc 100644 --- a/openapi/openapi_project/openapi_package/models/risk_radar_position.py +++ b/openapi/openapi_project/openapi_package/models/risk_radar_position.py @@ -3,10 +3,10 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.shock_value import ShockValue + from openapi_project.openapi_package.models.shock_value import ShockValue T = TypeVar("T", bound="RiskRadarPosition") @@ -123,7 +123,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.shock_value import ShockValue + from openapi_project.openapi_package.models.shock_value import ShockValue d = dict(src_dict) delta = d.pop("delta", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_product_group.py b/openapi/openapi_project/openapi_package/models/risk_radar_product_group.py index 64b00bdc3..d80c8d80d 100644 --- a/openapi/openapi_project/openapi_package/models/risk_radar_product_group.py +++ b/openapi/openapi_project/openapi_package/models/risk_radar_product_group.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.risk_radar_class_group import RiskRadarClassGroup - from ..models.shock_value import ShockValue + from openapi_project.openapi_package.models.risk_radar_class_group import RiskRadarClassGroup + from openapi_project.openapi_package.models.shock_value import ShockValue T = TypeVar("T", bound="RiskRadarProductGroup") @@ -69,8 +69,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.risk_radar_class_group import RiskRadarClassGroup - from ..models.shock_value import ShockValue + from openapi_project.openapi_package.models.risk_radar_class_group import RiskRadarClassGroup + from openapi_project.openapi_package.models.shock_value import ShockValue d = dict(src_dict) group = d.pop("group", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_request.py b/openapi/openapi_project/openapi_package/models/risk_radar_request.py index c9692ed41..ca7c62246 100644 --- a/openapi/openapi_project/openapi_package/models/risk_radar_request.py +++ b/openapi/openapi_project/openapi_package/models/risk_radar_request.py @@ -3,15 +3,15 @@ from attrs import define as _attrs_define -from ..models.position_source import PositionSource -from ..models.risk_eval_mode import RiskEvalMode -from ..models.risk_radar_scenario_order import RiskRadarScenarioOrder -from ..models.volatility_shock_skew import VolatilityShockSkew -from ..models.volatility_shock_type import VolatilityShockType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.position_source import PositionSource +from openapi_project.openapi_package.models.risk_eval_mode import RiskEvalMode +from openapi_project.openapi_package.models.risk_radar_scenario_order import RiskRadarScenarioOrder +from openapi_project.openapi_package.models.volatility_shock_skew import VolatilityShockSkew +from openapi_project.openapi_package.models.volatility_shock_type import VolatilityShockType +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.risk_radar_request_position_list import RiskRadarRequestPositionList + from openapi_project.openapi_package.models.risk_radar_request_position_list import RiskRadarRequestPositionList T = TypeVar("T", bound="RiskRadarRequest") @@ -118,9 +118,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.risk_radar_request_position_list import ( - RiskRadarRequestPositionList, - ) + from openapi_project.openapi_package.models.risk_radar_request_position_list import RiskRadarRequestPositionList, + d = dict(src_dict) account_ids = cast(list[int], d.pop("accountIds", UNSET)) diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_request_position.py b/openapi/openapi_project/openapi_package/models/risk_radar_request_position.py index 42f339f4a..d747a8bbf 100644 --- a/openapi/openapi_project/openapi_package/models/risk_radar_request_position.py +++ b/openapi/openapi_project/openapi_package/models/risk_radar_request_position.py @@ -3,7 +3,7 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="RiskRadarRequestPosition") diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_request_position_list.py b/openapi/openapi_project/openapi_package/models/risk_radar_request_position_list.py index 4510fb76d..532e0c659 100644 --- a/openapi/openapi_project/openapi_package/models/risk_radar_request_position_list.py +++ b/openapi/openapi_project/openapi_package/models/risk_radar_request_position_list.py @@ -3,10 +3,10 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.risk_radar_request_position import RiskRadarRequestPosition + from openapi_project.openapi_package.models.risk_radar_request_position import RiskRadarRequestPosition T = TypeVar("T", bound="RiskRadarRequestPositionList") @@ -45,7 +45,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.risk_radar_request_position import RiskRadarRequestPosition + from openapi_project.openapi_package.models.risk_radar_request_position import RiskRadarRequestPosition d = dict(src_dict) account_id = d.pop("accountId", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_response.py b/openapi/openapi_project/openapi_package/models/risk_radar_response.py index 833c7cf00..9d5b30a0d 100644 --- a/openapi/openapi_project/openapi_package/models/risk_radar_response.py +++ b/openapi/openapi_project/openapi_package/models/risk_radar_response.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.risk_radar_data import RiskRadarData + from openapi_project.openapi_package.models.risk_radar_data import RiskRadarData T = TypeVar("T", bound="RiskRadarResponse") @@ -51,7 +51,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.risk_radar_data import RiskRadarData + from openapi_project.openapi_package.models.risk_radar_data import RiskRadarData d = dict(src_dict) _result = d.pop("result", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/risk_reject.py b/openapi/openapi_project/openapi_package/models/risk_reject.py index 72e28bb23..146b8eaa9 100644 --- a/openapi/openapi_project/openapi_package/models/risk_reject.py +++ b/openapi/openapi_project/openapi_package/models/risk_reject.py @@ -3,9 +3,9 @@ from attrs import define as _attrs_define -from ..models.risk_calculation_type import RiskCalculationType -from ..models.risk_reject_type import RiskRejectType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.risk_calculation_type import RiskCalculationType +from openapi_project.openapi_package.models.risk_reject_type import RiskRejectType +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="RiskReject") diff --git a/openapi/openapi_project/openapi_package/models/route.py b/openapi/openapi_project/openapi_package/models/route.py index c05328a3b..505e9f423 100644 --- a/openapi/openapi_project/openapi_package/models/route.py +++ b/openapi/openapi_project/openapi_package/models/route.py @@ -3,14 +3,14 @@ from attrs import define as _attrs_define -from ..models.currency import Currency -from ..models.order_type import OrderType -from ..models.route_type import RouteType -from ..models.security_type import SecurityType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.models.order_type import OrderType +from openapi_project.openapi_package.models.route_type import RouteType +from openapi_project.openapi_package.models.security_type import SecurityType +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.route_property import RouteProperty + from openapi_project.openapi_package.models.route_property import RouteProperty T = TypeVar("T", bound="Route") @@ -111,7 +111,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.route_property import RouteProperty + from openapi_project.openapi_package.models.route_property import RouteProperty d = dict(src_dict) id = d.pop("id", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/route_applicability.py b/openapi/openapi_project/openapi_package/models/route_applicability.py index 9ec1fe42f..53a16b748 100644 --- a/openapi/openapi_project/openapi_package/models/route_applicability.py +++ b/openapi/openapi_project/openapi_package/models/route_applicability.py @@ -3,10 +3,10 @@ from attrs import define as _attrs_define -from ..models.currency import Currency -from ..models.order_type import OrderType -from ..models.security_type import SecurityType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.models.order_type import OrderType +from openapi_project.openapi_package.models.security_type import SecurityType +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="RouteApplicability") diff --git a/openapi/openapi_project/openapi_package/models/route_property.py b/openapi/openapi_project/openapi_package/models/route_property.py index d3662d8a0..ab6d3ddbd 100644 --- a/openapi/openapi_project/openapi_package/models/route_property.py +++ b/openapi/openapi_project/openapi_package/models/route_property.py @@ -3,8 +3,8 @@ from attrs import define as _attrs_define -from ..models.route_property_type import RoutePropertyType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.route_property_type import RoutePropertyType +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="RouteProperty") diff --git a/openapi/openapi_project/openapi_package/models/routing_session_group.py b/openapi/openapi_project/openapi_package/models/routing_session_group.py index 521ffcffa..b1bbb4b14 100644 --- a/openapi/openapi_project/openapi_package/models/routing_session_group.py +++ b/openapi/openapi_project/openapi_package/models/routing_session_group.py @@ -3,8 +3,8 @@ from attrs import define as _attrs_define -from ..models.routing_session_group_type import RoutingSessionGroupType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.routing_session_group_type import RoutingSessionGroupType +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="RoutingSessionGroup") diff --git a/openapi/openapi_project/openapi_package/models/scenario.py b/openapi/openapi_project/openapi_package/models/scenario.py index d8013ea75..2a98a9612 100644 --- a/openapi/openapi_project/openapi_package/models/scenario.py +++ b/openapi/openapi_project/openapi_package/models/scenario.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.scenario_leg import ScenarioLeg - from ..models.scenario_position import ScenarioPosition + from openapi_project.openapi_package.models.scenario_leg import ScenarioLeg + from openapi_project.openapi_package.models.scenario_position import ScenarioPosition T = TypeVar("T", bound="Scenario") @@ -54,8 +54,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.scenario_leg import ScenarioLeg - from ..models.scenario_position import ScenarioPosition + from openapi_project.openapi_package.models.scenario_leg import ScenarioLeg + from openapi_project.openapi_package.models.scenario_position import ScenarioPosition d = dict(src_dict) price = d.pop("price", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/scenario_leg.py b/openapi/openapi_project/openapi_package/models/scenario_leg.py index 50659f4dd..0792a2b50 100644 --- a/openapi/openapi_project/openapi_package/models/scenario_leg.py +++ b/openapi/openapi_project/openapi_package/models/scenario_leg.py @@ -3,7 +3,7 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="ScenarioLeg") diff --git a/openapi/openapi_project/openapi_package/models/scenario_position.py b/openapi/openapi_project/openapi_package/models/scenario_position.py index 37853e7ea..f56bd3eea 100644 --- a/openapi/openapi_project/openapi_package/models/scenario_position.py +++ b/openapi/openapi_project/openapi_package/models/scenario_position.py @@ -3,7 +3,7 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="ScenarioPosition") diff --git a/openapi/openapi_project/openapi_package/models/scenario_theo.py b/openapi/openapi_project/openapi_package/models/scenario_theo.py index c5edd6d33..16a8a4f35 100644 --- a/openapi/openapi_project/openapi_package/models/scenario_theo.py +++ b/openapi/openapi_project/openapi_package/models/scenario_theo.py @@ -3,10 +3,10 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.scenario import Scenario + from openapi_project.openapi_package.models.scenario import Scenario T = TypeVar("T", bound="ScenarioTheo") @@ -51,7 +51,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.scenario import Scenario + from openapi_project.openapi_package.models.scenario import Scenario d = dict(src_dict) as_of_ts = d.pop("asOfTs", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/search_order_history_response.py b/openapi/openapi_project/openapi_package/models/search_order_history_response.py index 91f36e485..9640b2164 100644 --- a/openapi/openapi_project/openapi_package/models/search_order_history_response.py +++ b/openapi/openapi_project/openapi_package/models/search_order_history_response.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.generic_order import GenericOrder + from openapi_project.openapi_package.models.generic_order import GenericOrder T = TypeVar("T", bound="SearchOrderHistoryResponse") @@ -54,7 +54,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.generic_order import GenericOrder + from openapi_project.openapi_package.models.generic_order import GenericOrder d = dict(src_dict) orders = [] diff --git a/openapi/openapi_project/openapi_package/models/security.py b/openapi/openapi_project/openapi_package/models/security.py index bf721a1fe..07d4c27b6 100644 --- a/openapi/openapi_project/openapi_package/models/security.py +++ b/openapi/openapi_project/openapi_package/models/security.py @@ -3,19 +3,19 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.crypto import Crypto - from ..models.flex_option import FlexOption - from ..models.future import Future - from ..models.future_root import FutureRoot - from ..models.future_spread import FutureSpread - from ..models.fx import Fx - from ..models.index import Index - from ..models.option import Option - from ..models.option_root import OptionRoot - from ..models.stock import Stock + from openapi_project.openapi_package.models.crypto import Crypto + from openapi_project.openapi_package.models.flex_option import FlexOption + from openapi_project.openapi_package.models.future import Future + from openapi_project.openapi_package.models.future_root import FutureRoot + from openapi_project.openapi_package.models.future_spread import FutureSpread + from openapi_project.openapi_package.models.fx import Fx + from openapi_project.openapi_package.models.index import Index + from openapi_project.openapi_package.models.option import Option + from openapi_project.openapi_package.models.option_root import OptionRoot + from openapi_project.openapi_package.models.stock import Stock T = TypeVar("T", bound="Security") @@ -117,16 +117,16 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.crypto import Crypto - from ..models.flex_option import FlexOption - from ..models.future import Future - from ..models.future_root import FutureRoot - from ..models.future_spread import FutureSpread - from ..models.fx import Fx - from ..models.index import Index - from ..models.option import Option - from ..models.option_root import OptionRoot - from ..models.stock import Stock + from openapi_project.openapi_package.models.crypto import Crypto + from openapi_project.openapi_package.models.flex_option import FlexOption + from openapi_project.openapi_package.models.future import Future + from openapi_project.openapi_package.models.future_root import FutureRoot + from openapi_project.openapi_package.models.future_spread import FutureSpread + from openapi_project.openapi_package.models.fx import Fx + from openapi_project.openapi_package.models.index import Index + from openapi_project.openapi_package.models.option import Option + from openapi_project.openapi_package.models.option_root import OptionRoot + from openapi_project.openapi_package.models.stock import Stock d = dict(src_dict) _stock = d.pop("stock", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/settlement_info.py b/openapi/openapi_project/openapi_package/models/settlement_info.py index d36fd9a55..eedbfd270 100644 --- a/openapi/openapi_project/openapi_package/models/settlement_info.py +++ b/openapi/openapi_project/openapi_package/models/settlement_info.py @@ -3,8 +3,8 @@ from attrs import define as _attrs_define -from ..models.settlement_deliverable_type import SettlementDeliverableType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.settlement_deliverable_type import SettlementDeliverableType +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="SettlementInfo") diff --git a/openapi/openapi_project/openapi_package/models/shock_value.py b/openapi/openapi_project/openapi_package/models/shock_value.py index 0f34d4b86..2c5af4b2e 100644 --- a/openapi/openapi_project/openapi_package/models/shock_value.py +++ b/openapi/openapi_project/openapi_package/models/shock_value.py @@ -3,10 +3,10 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.shock_value_flags import ShockValueFlags + from openapi_project.openapi_package.models.shock_value_flags import ShockValueFlags T = TypeVar("T", bound="ShockValue") @@ -66,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.shock_value_flags import ShockValueFlags + from openapi_project.openapi_package.models.shock_value_flags import ShockValueFlags d = dict(src_dict) delta = d.pop("delta", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/shock_value_flags.py b/openapi/openapi_project/openapi_package/models/shock_value_flags.py index e6f5df57c..ef99a2b22 100644 --- a/openapi/openapi_project/openapi_package/models/shock_value_flags.py +++ b/openapi/openapi_project/openapi_package/models/shock_value_flags.py @@ -3,7 +3,7 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="ShockValueFlags") diff --git a/openapi/openapi_project/openapi_package/models/status.py b/openapi/openapi_project/openapi_package/models/status.py index 93c607c82..1aa10203b 100644 --- a/openapi/openapi_project/openapi_package/models/status.py +++ b/openapi/openapi_project/openapi_package/models/status.py @@ -3,10 +3,10 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.any_model import AnyModel + from openapi_project.openapi_package.models.any_model import AnyModel T = TypeVar("T", bound="Status") @@ -51,7 +51,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.any_model import AnyModel + from openapi_project.openapi_package.models.any_model import AnyModel d = dict(src_dict) code = d.pop("code", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/stock.py b/openapi/openapi_project/openapi_package/models/stock.py index c2dfc0a3a..0b385c53a 100644 --- a/openapi/openapi_project/openapi_package/models/stock.py +++ b/openapi/openapi_project/openapi_package/models/stock.py @@ -3,15 +3,15 @@ from attrs import define as _attrs_define -from ..models.currency import Currency -from ..models.exchange_code import ExchangeCode -from ..models.numeric_display_format import NumericDisplayFormat -from ..models.security_category import SecurityCategory -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.models.exchange_code import ExchangeCode +from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat +from openapi_project.openapi_package.models.security_category import SecurityCategory +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.date import Date - from ..models.stock_aliases import StockAliases + from openapi_project.openapi_package.models.date import Date + from openapi_project.openapi_package.models.stock_aliases import StockAliases T = TypeVar("T", bound="Stock") @@ -190,8 +190,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.date import Date - from ..models.stock_aliases import StockAliases + from openapi_project.openapi_package.models.date import Date + from openapi_project.openapi_package.models.stock_aliases import StockAliases d = dict(src_dict) _aliases = d.pop("aliases", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/time_of_day.py b/openapi/openapi_project/openapi_package/models/time_of_day.py index bd21b0257..055d8e5f1 100644 --- a/openapi/openapi_project/openapi_package/models/time_of_day.py +++ b/openapi/openapi_project/openapi_package/models/time_of_day.py @@ -3,7 +3,7 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="TimeOfDay") diff --git a/openapi/openapi_project/openapi_package/models/tims_class_group.py b/openapi/openapi_project/openapi_package/models/tims_class_group.py index 48f36d699..a892e00c8 100644 --- a/openapi/openapi_project/openapi_package/models/tims_class_group.py +++ b/openapi/openapi_project/openapi_package/models/tims_class_group.py @@ -3,10 +3,10 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.tims_position_group import TimsPositionGroup + from openapi_project.openapi_package.models.tims_position_group import TimsPositionGroup T = TypeVar("T", bound="TimsClassGroup") @@ -137,7 +137,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.tims_position_group import TimsPositionGroup + from openapi_project.openapi_package.models.tims_position_group import TimsPositionGroup d = dict(src_dict) delta = d.pop("delta", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/tims_margin_data.py b/openapi/openapi_project/openapi_package/models/tims_margin_data.py index 897d4e247..2526c84ac 100644 --- a/openapi/openapi_project/openapi_package/models/tims_margin_data.py +++ b/openapi/openapi_project/openapi_package/models/tims_margin_data.py @@ -3,12 +3,12 @@ from attrs import define as _attrs_define -from ..models.currency import Currency -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.tims_class_group import TimsClassGroup - from ..models.tims_product_group import TimsProductGroup + from openapi_project.openapi_package.models.tims_class_group import TimsClassGroup + from openapi_project.openapi_package.models.tims_product_group import TimsProductGroup T = TypeVar("T", bound="TimsMarginData") @@ -144,8 +144,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.tims_class_group import TimsClassGroup - from ..models.tims_product_group import TimsProductGroup + from openapi_project.openapi_package.models.tims_class_group import TimsClassGroup + from openapi_project.openapi_package.models.tims_product_group import TimsProductGroup d = dict(src_dict) account_type = d.pop("accountType", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/tims_position_group.py b/openapi/openapi_project/openapi_package/models/tims_position_group.py index f11038384..93ca7af4f 100644 --- a/openapi/openapi_project/openapi_package/models/tims_position_group.py +++ b/openapi/openapi_project/openapi_package/models/tims_position_group.py @@ -3,7 +3,7 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="TimsPositionGroup") diff --git a/openapi/openapi_project/openapi_package/models/tims_product_group.py b/openapi/openapi_project/openapi_package/models/tims_product_group.py index 74d943e14..5997a224a 100644 --- a/openapi/openapi_project/openapi_package/models/tims_product_group.py +++ b/openapi/openapi_project/openapi_package/models/tims_product_group.py @@ -3,7 +3,7 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="TimsProductGroup") diff --git a/openapi/openapi_project/openapi_package/models/trade_confirm.py b/openapi/openapi_project/openapi_package/models/trade_confirm.py index a7697c36e..c5b5e0731 100644 --- a/openapi/openapi_project/openapi_package/models/trade_confirm.py +++ b/openapi/openapi_project/openapi_package/models/trade_confirm.py @@ -3,26 +3,26 @@ from attrs import define as _attrs_define -from ..models.capacity_code import CapacityCode -from ..models.clearing_range import ClearingRange -from ..models.cross_side_type import CrossSideType -from ..models.cross_type import CrossType -from ..models.exec_type import ExecType -from ..models.multi_leg_reporting_type import MultiLegReportingType -from ..models.option_exercise_style import OptionExerciseStyle -from ..models.option_settlement_type import OptionSettlementType -from ..models.ord_type import OrdType -from ..models.origination_type import OriginationType -from ..models.position_effect import PositionEffect -from ..models.price_type import PriceType -from ..models.put_call import PutCall -from ..models.security_type import SecurityType -from ..models.side import Side -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.capacity_code import CapacityCode +from openapi_project.openapi_package.models.clearing_range import ClearingRange +from openapi_project.openapi_package.models.cross_side_type import CrossSideType +from openapi_project.openapi_package.models.cross_type import CrossType +from openapi_project.openapi_package.models.exec_type import ExecType +from openapi_project.openapi_package.models.multi_leg_reporting_type import MultiLegReportingType +from openapi_project.openapi_package.models.option_exercise_style import OptionExerciseStyle +from openapi_project.openapi_package.models.option_settlement_type import OptionSettlementType +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.origination_type import OriginationType +from openapi_project.openapi_package.models.position_effect import PositionEffect +from openapi_project.openapi_package.models.price_type import PriceType +from openapi_project.openapi_package.models.put_call import PutCall +from openapi_project.openapi_package.models.security_type import SecurityType +from openapi_project.openapi_package.models.side import Side +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.date import Date + from openapi_project.openapi_package.models.date import Date T = TypeVar("T", bound="TradeConfirm") @@ -584,7 +584,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.date import Date + from openapi_project.openapi_package.models.date import Date d = dict(src_dict) account_id = d.pop("accountId", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/trading_firm.py b/openapi/openapi_project/openapi_package/models/trading_firm.py index af3229cbc..4babd203a 100644 --- a/openapi/openapi_project/openapi_package/models/trading_firm.py +++ b/openapi/openapi_project/openapi_package/models/trading_firm.py @@ -3,7 +3,7 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="TradingFirm") diff --git a/openapi/openapi_project/openapi_package/models/trading_firm_slim.py b/openapi/openapi_project/openapi_package/models/trading_firm_slim.py index 0a174c44c..5eeca4b4d 100644 --- a/openapi/openapi_project/openapi_package/models/trading_firm_slim.py +++ b/openapi/openapi_project/openapi_package/models/trading_firm_slim.py @@ -3,7 +3,7 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="TradingFirmSlim") diff --git a/openapi/openapi_project/openapi_package/models/trading_holiday.py b/openapi/openapi_project/openapi_package/models/trading_holiday.py index d13428460..4101a7635 100644 --- a/openapi/openapi_project/openapi_package/models/trading_holiday.py +++ b/openapi/openapi_project/openapi_package/models/trading_holiday.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..models.country import Country -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.country import Country +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.date import Date + from openapi_project.openapi_package.models.date import Date T = TypeVar("T", bound="TradingHoliday") @@ -63,7 +63,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.date import Date + from openapi_project.openapi_package.models.date import Date d = dict(src_dict) id = d.pop("id", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/trading_session.py b/openapi/openapi_project/openapi_package/models/trading_session.py index 8824858a5..b7467aea1 100644 --- a/openapi/openapi_project/openapi_package/models/trading_session.py +++ b/openapi/openapi_project/openapi_package/models/trading_session.py @@ -3,10 +3,10 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.time_of_day import TimeOfDay + from openapi_project.openapi_package.models.time_of_day import TimeOfDay T = TypeVar("T", bound="TradingSession") @@ -68,7 +68,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.time_of_day import TimeOfDay + from openapi_project.openapi_package.models.time_of_day import TimeOfDay d = dict(src_dict) days_of_the_week = d.pop("daysOfTheWeek", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/trading_session_group.py b/openapi/openapi_project/openapi_package/models/trading_session_group.py index f7659b992..67e310e62 100644 --- a/openapi/openapi_project/openapi_package/models/trading_session_group.py +++ b/openapi/openapi_project/openapi_package/models/trading_session_group.py @@ -3,10 +3,10 @@ from attrs import define as _attrs_define -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.trading_session import TradingSession + from openapi_project.openapi_package.models.trading_session import TradingSession T = TypeVar("T", bound="TradingSessionGroup") @@ -51,7 +51,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.trading_session import TradingSession + from openapi_project.openapi_package.models.trading_session import TradingSession d = dict(src_dict) id = d.pop("id", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/user.py b/openapi/openapi_project/openapi_package/models/user.py index b3de854ed..cfed5394f 100644 --- a/openapi/openapi_project/openapi_package/models/user.py +++ b/openapi/openapi_project/openapi_package/models/user.py @@ -3,13 +3,13 @@ from attrs import define as _attrs_define -from ..models.user_location import UserLocation -from ..models.user_status import UserStatus -from ..models.user_type import UserType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.user_location import UserLocation +from openapi_project.openapi_package.models.user_status import UserStatus +from openapi_project.openapi_package.models.user_type import UserType +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.user_permission import UserPermission + from openapi_project.openapi_package.models.user_permission import UserPermission T = TypeVar("T", bound="User") @@ -156,7 +156,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.user_permission import UserPermission + from openapi_project.openapi_package.models.user_permission import UserPermission d = dict(src_dict) domain = d.pop("domain", UNSET) diff --git a/openapi/openapi_project/openapi_package/models/user_permission.py b/openapi/openapi_project/openapi_package/models/user_permission.py index 533c074a8..63974b6ac 100644 --- a/openapi/openapi_project/openapi_package/models/user_permission.py +++ b/openapi/openapi_project/openapi_package/models/user_permission.py @@ -3,8 +3,8 @@ from attrs import define as _attrs_define -from ..models.claim_type import ClaimType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.claim_type import ClaimType +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="UserPermission") diff --git a/openapi/openapi_project/openapi_package/models/validate_risk_response.py b/openapi/openapi_project/openapi_package/models/validate_risk_response.py index d00eef7d7..e5d66abc8 100644 --- a/openapi/openapi_project/openapi_package/models/validate_risk_response.py +++ b/openapi/openapi_project/openapi_package/models/validate_risk_response.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset if TYPE_CHECKING: - from ..models.risk_reject import RiskReject + from openapi_project.openapi_package.models.risk_reject import RiskReject T = TypeVar("T", bound="ValidateRiskResponse") @@ -60,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.risk_reject import RiskReject + from openapi_project.openapi_package.models.risk_reject import RiskReject d = dict(src_dict) is_valid = d.pop("isValid", UNSET) diff --git a/replace_imports.py b/replace_imports.py index 93956ef51..e7578cc68 100644 --- a/replace_imports.py +++ b/replace_imports.py @@ -83,9 +83,7 @@ def importfrom_level(node: cst.ImportFrom) -> int: r = node.relative if r is None: return 0 - if isinstance(r, int): - return r - # In some LibCST versions, this is a tuple of Dot tokens + # In LibCST, relative is a sequence of Dot tokens return len(r) @@ -129,13 +127,13 @@ def leave_ImportFrom( abs_mod = compute_abs_module(self.pkg_comps, level, mod) if not abs_mod: - return updated_node # can’t safely compute; skip + return updated_node # can't safely compute; skip self.changed = True return cst.ImportFrom( module=cst.parse_expression(abs_mod), names=updated_node.names, - relative=0, + relative=(), # Empty sequence for absolute imports whitespace_after_from=updated_node.whitespace_after_from, whitespace_before_import=updated_node.whitespace_before_import, ) From 9246369cbe9067432cac1ee0450bfbd888e8f17e Mon Sep 17 00:00:00 2001 From: Itay Bavly Date: Wed, 20 Aug 2025 15:00:14 -0400 Subject: [PATCH 09/16] more --- openapi/openapi_project/README.md | 124 --- .../openapi_package/__init__.py | 8 - .../openapi_package/api/__init__.py | 1 - .../api/application_service/__init__.py | 1 - .../post_application_login.py | 154 --- .../api/order_service/__init__.py | 1 - .../api/order_service/get_orders.py | 121 --- .../order_service/get_orders_searchhistory.py | 243 ----- .../order_service/get_orders_tradeconfirms.py | 213 ---- .../order_service/post_orders_cancelorder.py | 154 --- .../post_orders_createmultilegorder.py | 154 --- .../post_orders_createmultilegordercross.py | 156 --- .../order_service/post_orders_createorder.py | 154 --- .../post_orders_createordercross.py | 154 --- .../post_orders_replacemultilegorder.py | 156 --- .../order_service/post_orders_replaceorder.py | 154 --- ...orders_validaterisk_createmultilegorder.py | 154 --- ...s_validaterisk_createmultilegordercross.py | 155 --- .../post_orders_validaterisk_createorder.py | 154 --- ...st_orders_validaterisk_createordercross.py | 154 --- ...rders_validaterisk_replacemultilegorder.py | 155 --- .../post_orders_validaterisk_replaceorder.py | 154 --- .../api/portfolio_service/__init__.py | 1 - .../get_portfolio_positions.py | 198 ---- .../post_portfolio_analyzepositions.py | 154 --- .../post_portfolio_calculatemargins.py | 154 --- .../post_portfolio_riskradar.py | 154 --- .../api/security_service/__init__.py | 1 - .../get_securities_exchanges.py | 121 --- .../post_securities_easytoborrowsecurities.py | 156 --- .../post_securities_flexoption.py | 154 --- .../post_securities_optionchains.py | 154 --- .../post_securities_securities.py | 154 --- .../api/user_data_service/__init__.py | 1 - .../get_userdata_accounts.py | 121 --- .../get_userdata_activeuser.py | 121 --- .../get_userdata_affiliatedtradingfirms.py | 122 --- .../get_userdata_p2paccounts.py | 121 --- .../user_data_service/get_userdata_routes.py | 121 --- .../get_userdata_tradingfirms.py | 121 --- .../api/utility_service/__init__.py | 1 - .../utility_service/get_utility_serverinfo.py | 121 --- .../utility_service/get_utility_servertime.py | 121 --- .../get_utility_tradingholidays.py | 121 --- .../openapi_project/openapi_package/client.py | 282 ------ .../openapi_project/openapi_package/errors.py | 16 - .../openapi_package/models/__init__.py | 525 ---------- .../openapi_package/models/account.py | 371 ------- .../openapi_package/models/account_script.py | 49 - .../openapi_package/models/account_status.py | 11 - .../openapi_package/models/account_type.py | 10 - .../models/analyze_position_item.py | 67 -- .../models/analyze_positions_request.py | 136 --- .../models/analyze_positions_response.py | 79 -- .../openapi_package/models/any_model.py | 59 -- .../models/calculate_margin_request.py | 124 --- .../calculate_margin_request_position.py | 58 -- .../calculate_margin_request_position_list.py | 69 -- .../models/calculate_margin_response.py | 82 -- .../models/cancel_order_request.py | 94 -- .../cancel_order_request_optional_data.py | 59 -- .../models/cancel_order_response.py | 75 -- .../cancel_replace_multi_leg_order_request.py | 239 ----- ...el_replace_multi_leg_order_request_algo.py | 61 -- ...ulti_leg_order_request_market_condition.py | 61 -- ...e_multi_leg_order_request_optional_data.py | 61 -- ...cancel_replace_multi_leg_order_response.py | 75 -- .../models/cancel_replace_order_request.py | 216 ---- .../cancel_replace_order_request_algo.py | 59 -- ..._replace_order_request_market_condition.py | 61 -- ...cel_replace_order_request_optional_data.py | 61 -- .../models/cancel_replace_order_response.py | 75 -- .../openapi_package/models/capacity_code.py | 10 - .../openapi_package/models/claim_type.py | 11 - .../openapi_package/models/clearing_info.py | 216 ---- .../openapi_package/models/clearing_range.py | 21 - .../openapi_package/models/country.py | 14 - .../models/create_flex_option_request.py | 182 ---- .../models/create_flex_option_response.py | 79 -- ...create_multi_leg_order_cross_allocation.py | 154 --- ...eg_order_cross_allocation_optional_data.py | 61 -- .../create_multi_leg_order_cross_request.py | 287 ------ ...eate_multi_leg_order_cross_request_algo.py | 61 -- ...eg_order_cross_request_market_condition.py | 61 -- ...i_leg_order_cross_request_optional_data.py | 61 -- .../create_multi_leg_order_cross_response.py | 79 -- .../models/create_multi_leg_order_leg.py | 156 --- ...te_multi_leg_order_leg_market_condition.py | 61 -- ...reate_multi_leg_order_leg_optional_data.py | 61 -- .../models/create_multi_leg_order_request.py | 291 ------ .../create_multi_leg_order_request_algo.py | 61 -- ...ulti_leg_order_request_market_condition.py | 61 -- ...e_multi_leg_order_request_optional_data.py | 61 -- .../models/create_multi_leg_order_response.py | 79 -- .../models/create_order_cross_allocation.py | 165 ---- ...te_order_cross_allocation_optional_data.py | 61 -- .../models/create_order_cross_request.py | 308 ------ .../models/create_order_cross_request_algo.py | 59 -- ...te_order_cross_request_market_condition.py | 61 -- ...reate_order_cross_request_optional_data.py | 61 -- .../models/create_order_cross_response.py | 79 -- .../models/create_order_request.py | 327 ------ .../models/create_order_request_algo.py | 59 -- .../create_order_request_market_condition.py | 61 -- .../create_order_request_optional_data.py | 59 -- .../models/create_order_response.py | 79 -- .../openapi_package/models/cross_side_type.py | 10 - .../openapi_package/models/cross_type.py | 20 - .../openapi_package/models/crypto.py | 289 ------ .../openapi_package/models/crypto_aliases.py | 59 -- .../openapi_package/models/currency.py | 180 ---- .../models/cxl_rej_response_to.py | 14 - .../openapi_package/models/date.py | 58 -- .../models/easy_to_borrow_security.py | 49 - .../openapi_package/models/empty.py | 22 - .../openapi_package/models/exchange.py | 157 --- .../openapi_package/models/exchange_code.py | 72 -- .../openapi_package/models/exec_type.py | 30 - .../openapi_package/models/execution.py | 641 ------------ .../openapi_package/models/execution_algo.py | 59 -- .../models/execution_optional_data.py | 59 -- .../openapi_package/models/flex_option.py | 445 --------- .../models/flex_option_aliases.py | 59 -- .../models/flex_settlement_type.py | 12 - .../openapi_package/models/future.py | 364 ------- .../openapi_package/models/future_aliases.py | 59 -- .../openapi_package/models/future_root.py | 364 ------- .../models/future_root_aliases.py | 59 -- .../openapi_package/models/future_spread.py | 385 -------- .../models/future_spread_aliases.py | 59 -- .../models/future_spread_leg.py | 114 --- .../openapi_package/models/fx.py | 289 ------ .../openapi_package/models/fx_aliases.py | 59 -- .../openapi_package/models/generic_order.py | 107 -- .../models/get_active_user_response.py | 79 -- .../models/get_server_info_response.py | 137 --- ...et_server_info_response_system_settings.py | 61 -- .../models/get_server_time_response.py | 66 -- .../models/get_trading_holidays_response.py | 82 -- .../openapi_package/models/header.py | 103 -- .../openapi_package/models/index.py | 273 ----- .../openapi_package/models/index_aliases.py | 59 -- .../models/list_accounts_response.py | 82 -- .../list_affiliated_trading_firms_response.py | 84 -- .../list_easy_to_borrow_securities_request.py | 49 - ...list_easy_to_borrow_securities_response.py | 82 -- .../models/list_exchanges_response.py | 82 -- .../models/list_option_chains_repsonse.py | 82 -- .../models/list_option_chains_request.py | 42 - .../models/list_orders_response.py | 82 -- .../models/list_positions_response.py | 82 -- .../models/list_routes_response.py | 105 -- .../models/list_securities_request.py | 42 - .../models/list_securities_response.py | 82 -- .../models/list_trade_confirms_response.py | 82 -- .../models/list_trading_firms_response.py | 82 -- .../openapi_package/models/login_request.py | 76 -- .../openapi_package/models/login_response.py | 204 ---- .../models/login_response_system_settings.py | 59 -- .../openapi_package/models/login_status.py | 19 - .../openapi_package/models/margin_data.py | 80 -- .../models/margin_data_type.py | 10 - .../openapi_package/models/multi_leg_order.py | 544 ---------- .../models/multi_leg_order_algo.py | 59 -- .../multi_leg_order_cancel_replace_request.py | 371 ------- ...i_leg_order_cancel_replace_request_algo.py | 61 -- ...cancel_replace_request_market_condition.py | 61 -- ...er_cancel_replace_request_optional_data.py | 61 -- .../models/multi_leg_order_cross.py | 479 --------- .../models/multi_leg_order_cross_algo.py | 59 -- .../multi_leg_order_cross_allocation.py | 259 ----- ...eg_order_cross_allocation_optional_data.py | 61 -- .../multi_leg_order_cross_market_condition.py | 61 -- .../multi_leg_order_cross_optional_data.py | 61 -- .../models/multi_leg_order_leg.py | 257 ----- .../multi_leg_order_leg_market_condition.py | 61 -- .../multi_leg_order_leg_optional_data.py | 59 -- .../multi_leg_order_market_condition.py | 59 -- .../models/multi_leg_order_optional_data.py | 59 -- .../models/multi_leg_reporting_type.py | 10 - .../models/numeric_display_format.py | 32 - .../openapi_package/models/option.py | 391 -------- .../openapi_package/models/option_aliases.py | 59 -- .../openapi_package/models/option_chain.py | 128 --- .../models/option_chain_option.py | 219 ---- .../models/option_chain_option_aliases.py | 59 -- .../models/option_chain_options.py | 59 -- .../models/option_chain_roots.py | 59 -- .../models/option_exercise_style.py | 11 - .../models/option_expiration_style.py | 19 - .../openapi_package/models/option_root.py | 418 -------- .../models/option_root_aliases.py | 59 -- .../openapi_package/models/option_series.py | 227 ----- .../models/option_series_product_type.py | 9 - .../models/option_series_type.py | 13 - .../models/option_settlement_type.py | 12 - .../openapi_package/models/ord_status.py | 30 - .../openapi_package/models/ord_type.py | 14 - .../openapi_package/models/order.py | 583 ----------- .../openapi_package/models/order_algo.py | 59 -- .../models/order_cancel_reject.py | 186 ---- .../order_cancel_reject_optional_data.py | 59 -- .../models/order_cancel_replace_request.py | 348 ------- .../order_cancel_replace_request_algo.py | 59 -- ...cancel_replace_request_market_condition.py | 61 -- ...er_cancel_replace_request_optional_data.py | 61 -- .../models/order_cancel_request.py | 174 ---- .../order_cancel_request_optional_data.py | 59 -- .../openapi_package/models/order_cross.py | 497 ---------- .../models/order_cross_algo.py | 59 -- .../models/order_cross_allocation.py | 261 ----- .../order_cross_allocation_optional_data.py | 61 -- .../models/order_cross_market_condition.py | 59 -- .../models/order_cross_optional_data.py | 59 -- .../openapi_package/models/order_delete.py | 106 -- .../models/order_delete_optional_data.py | 59 -- .../models/order_instruction.py | 57 -- .../models/order_instruction_type.py | 91 -- .../models/order_market_condition.py | 59 -- .../models/order_optional_data.py | 59 -- .../openapi_package/models/order_type.py | 12 - .../openapi_package/models/order_update.py | 623 ------------ .../models/order_update_algo.py | 59 -- .../models/order_update_event.py | 179 ---- .../models/order_update_optional_data.py | 59 -- .../models/origination_type.py | 39 - .../openapi_package/models/position.py | 193 ---- .../models/position_analysis.py | 74 -- .../openapi_package/models/position_effect.py | 11 - .../openapi_package/models/position_source.py | 9 - .../openapi_package/models/position_theo.py | 206 ---- .../models/position_theo_leg.py | 154 --- .../openapi_package/models/price_type.py | 14 - .../openapi_package/models/product_group.py | 19 - .../models/product_sub_group.py | 8 - .../openapi_package/models/put_call.py | 10 - .../models/risk_calculation_type.py | 11 - .../openapi_package/models/risk_eval_mode.py | 9 - .../models/risk_radar_account_group.py | 114 --- .../models/risk_radar_class_group.py | 178 ---- .../openapi_package/models/risk_radar_data.py | 67 -- .../models/risk_radar_position.py | 182 ---- .../models/risk_radar_product_group.py | 104 -- .../models/risk_radar_request.py | 193 ---- .../models/risk_radar_request_position.py | 58 -- .../risk_radar_request_position_list.py | 65 -- .../models/risk_radar_response.py | 79 -- .../models/risk_radar_scenario_order.py | 9 - .../openapi_package/models/risk_reject.py | 137 --- .../models/risk_reject_type.py | 120 --- .../openapi_package/models/route.py | 178 ---- .../models/route_applicability.py | 120 --- .../openapi_package/models/route_property.py | 66 -- .../models/route_property_type.py | 19 - .../openapi_package/models/route_type.py | 16 - .../models/routing_session_group.py | 66 -- .../models/routing_session_group_type.py | 15 - .../openapi_package/models/scenario.py | 83 -- .../openapi_package/models/scenario_leg.py | 112 --- .../models/scenario_position.py | 112 --- .../openapi_package/models/scenario_theo.py | 74 -- .../models/search_order_history_response.py | 82 -- .../openapi_package/models/security.py | 215 ---- .../models/security_category.py | 39 - .../openapi_package/models/security_type.py | 19 - .../models/settlement_deliverable_type.py | 11 - .../openapi_package/models/settlement_info.py | 66 -- .../openapi_package/models/shock_value.py | 98 -- .../models/shock_value_flags.py | 58 -- .../openapi_package/models/side.py | 13 - .../openapi_package/models/spread_leg_side.py | 10 - .../openapi_package/models/spread_leg_type.py | 10 - .../openapi_package/models/status.py | 74 -- .../openapi_package/models/status_code.py | 19 - .../openapi_package/models/stock.py | 309 ------ .../openapi_package/models/stock_aliases.py | 59 -- .../openapi_package/models/tif.py | 17 - .../openapi_package/models/time_of_day.py | 67 -- .../models/tims_class_group.py | 202 ---- .../models/tims_margin_data.py | 220 ----- .../models/tims_position_group.py | 159 --- .../models/tims_product_group.py | 177 ---- .../openapi_package/models/trade_confirm.py | 935 ------------------ .../openapi_package/models/trading_firm.py | 67 -- .../models/trading_firm_slim.py | 49 - .../openapi_package/models/trading_holiday.py | 97 -- .../openapi_package/models/trading_session.py | 105 -- .../models/trading_session_group.py | 74 -- .../openapi_package/models/user.py | 242 ----- .../openapi_package/models/user_location.py | 10 - .../openapi_package/models/user_permission.py | 66 -- .../openapi_package/models/user_status.py | 12 - .../openapi_package/models/user_type.py | 10 - .../models/validate_risk_response.py | 91 -- .../models/volatility_shock_skew.py | 9 - .../models/volatility_shock_type.py | 9 - .../openapi_project/openapi_package/py.typed | 1 - .../openapi_project/openapi_package/types.py | 55 -- openapi_project/openapi_package/__init__.py | 2 +- .../post_application_login.py | 10 +- .../api/order_service/get_orders.py | 8 +- .../order_service/get_orders_searchhistory.py | 10 +- .../order_service/get_orders_tradeconfirms.py | 10 +- .../order_service/post_orders_cancelorder.py | 10 +- .../post_orders_createmultilegorder.py | 10 +- .../post_orders_createmultilegordercross.py | 18 +- .../order_service/post_orders_createorder.py | 10 +- .../post_orders_createordercross.py | 10 +- .../post_orders_replacemultilegorder.py | 18 +- .../order_service/post_orders_replaceorder.py | 10 +- ...orders_validaterisk_createmultilegorder.py | 10 +- ...s_validaterisk_createmultilegordercross.py | 15 +- .../post_orders_validaterisk_createorder.py | 10 +- ...st_orders_validaterisk_createordercross.py | 10 +- ...rders_validaterisk_replacemultilegorder.py | 15 +- .../post_orders_validaterisk_replaceorder.py | 10 +- .../get_portfolio_positions.py | 10 +- .../post_portfolio_analyzepositions.py | 10 +- .../post_portfolio_calculatemargins.py | 10 +- .../post_portfolio_riskradar.py | 10 +- .../get_securities_exchanges.py | 8 +- .../post_securities_easytoborrowsecurities.py | 18 +- .../post_securities_flexoption.py | 10 +- .../post_securities_optionchains.py | 10 +- .../post_securities_securities.py | 10 +- .../get_userdata_accounts.py | 8 +- .../get_userdata_activeuser.py | 8 +- .../get_userdata_affiliatedtradingfirms.py | 11 +- .../get_userdata_p2paccounts.py | 8 +- .../user_data_service/get_userdata_routes.py | 8 +- .../get_userdata_tradingfirms.py | 8 +- .../utility_service/get_utility_serverinfo.py | 8 +- .../utility_service/get_utility_servertime.py | 8 +- .../get_utility_tradingholidays.py | 8 +- .../openapi_package/models/__init__.py | 564 +++++------ .../openapi_package/models/account.py | 20 +- .../openapi_package/models/account_script.py | 4 +- .../models/analyze_position_item.py | 4 +- .../models/analyze_positions_request.py | 6 +- .../models/analyze_positions_response.py | 8 +- .../openapi_package/models/any_model.py | 2 +- .../models/calculate_margin_request.py | 15 +- .../calculate_margin_request_position.py | 4 +- .../calculate_margin_request_position_list.py | 9 +- .../models/calculate_margin_response.py | 8 +- .../models/cancel_order_request.py | 11 +- .../cancel_order_request_optional_data.py | 2 +- .../models/cancel_order_response.py | 6 +- .../cancel_replace_multi_leg_order_request.py | 27 +- ...el_replace_multi_leg_order_request_algo.py | 2 +- ...ulti_leg_order_request_market_condition.py | 2 +- ...e_multi_leg_order_request_optional_data.py | 2 +- ...cancel_replace_multi_leg_order_response.py | 6 +- .../models/cancel_replace_order_request.py | 24 +- .../cancel_replace_order_request_algo.py | 2 +- ..._replace_order_request_market_condition.py | 2 +- ...cel_replace_order_request_optional_data.py | 2 +- .../models/cancel_replace_order_response.py | 6 +- .../openapi_package/models/clearing_info.py | 8 +- .../models/create_flex_option_request.py | 14 +- .../models/create_flex_option_response.py | 8 +- ...create_multi_leg_order_cross_allocation.py | 17 +- ...eg_order_cross_allocation_optional_data.py | 2 +- .../create_multi_leg_order_cross_request.py | 34 +- ...eate_multi_leg_order_cross_request_algo.py | 2 +- ...eg_order_cross_request_market_condition.py | 2 +- ...i_leg_order_cross_request_optional_data.py | 2 +- .../create_multi_leg_order_cross_response.py | 8 +- .../models/create_multi_leg_order_leg.py | 20 +- ...te_multi_leg_order_leg_market_condition.py | 2 +- ...reate_multi_leg_order_leg_optional_data.py | 2 +- .../models/create_multi_leg_order_request.py | 31 +- .../create_multi_leg_order_request_algo.py | 2 +- ...ulti_leg_order_request_market_condition.py | 2 +- ...e_multi_leg_order_request_optional_data.py | 2 +- .../models/create_multi_leg_order_response.py | 8 +- .../models/create_order_cross_allocation.py | 19 +- ...te_order_cross_allocation_optional_data.py | 2 +- .../models/create_order_cross_request.py | 30 +- .../models/create_order_cross_request_algo.py | 2 +- ...te_order_cross_request_market_condition.py | 2 +- ...reate_order_cross_request_optional_data.py | 2 +- .../models/create_order_cross_response.py | 8 +- .../models/create_order_request.py | 34 +- .../models/create_order_request_algo.py | 2 +- .../create_order_request_market_condition.py | 2 +- .../create_order_request_optional_data.py | 2 +- .../models/create_order_response.py | 8 +- .../openapi_package/models/crypto.py | 16 +- .../openapi_package/models/crypto_aliases.py | 2 +- .../openapi_package/models/date.py | 4 +- .../models/easy_to_borrow_security.py | 4 +- .../openapi_package/models/empty.py | 2 +- .../openapi_package/models/exchange.py | 4 +- .../openapi_package/models/execution.py | 36 +- .../openapi_package/models/execution_algo.py | 2 +- .../models/execution_optional_data.py | 2 +- .../openapi_package/models/flex_option.py | 26 +- .../models/flex_option_aliases.py | 2 +- .../openapi_package/models/future.py | 18 +- .../openapi_package/models/future_aliases.py | 2 +- .../openapi_package/models/future_root.py | 26 +- .../models/future_root_aliases.py | 2 +- .../openapi_package/models/future_spread.py | 18 +- .../models/future_spread_aliases.py | 2 +- .../models/future_spread_leg.py | 10 +- openapi_project/openapi_package/models/fx.py | 16 +- .../openapi_package/models/fx_aliases.py | 2 +- .../openapi_package/models/generic_order.py | 12 +- .../models/get_active_user_response.py | 8 +- .../models/get_server_info_response.py | 11 +- ...et_server_info_response_system_settings.py | 2 +- .../models/get_server_time_response.py | 6 +- .../models/get_trading_holidays_response.py | 8 +- .../openapi_package/models/header.py | 4 +- .../openapi_package/models/index.py | 16 +- .../openapi_package/models/index_aliases.py | 2 +- .../models/list_accounts_response.py | 8 +- .../list_affiliated_trading_firms_response.py | 8 +- .../list_easy_to_borrow_securities_request.py | 4 +- ...list_easy_to_borrow_securities_response.py | 8 +- .../models/list_exchanges_response.py | 8 +- .../models/list_option_chains_repsonse.py | 8 +- .../models/list_option_chains_request.py | 4 +- .../models/list_orders_response.py | 8 +- .../models/list_positions_response.py | 8 +- .../models/list_routes_response.py | 10 +- .../models/list_securities_request.py | 4 +- .../models/list_securities_response.py | 8 +- .../models/list_trade_confirms_response.py | 8 +- .../models/list_trading_firms_response.py | 8 +- .../openapi_package/models/login_request.py | 4 +- .../openapi_package/models/login_response.py | 12 +- .../models/login_response_system_settings.py | 2 +- .../openapi_package/models/margin_data.py | 8 +- .../openapi_package/models/multi_leg_order.py | 32 +- .../models/multi_leg_order_algo.py | 2 +- .../multi_leg_order_cancel_replace_request.py | 37 +- ...i_leg_order_cancel_replace_request_algo.py | 2 +- ...cancel_replace_request_market_condition.py | 2 +- ...er_cancel_replace_request_optional_data.py | 2 +- .../models/multi_leg_order_cross.py | 38 +- .../models/multi_leg_order_cross_algo.py | 2 +- .../multi_leg_order_cross_allocation.py | 19 +- ...eg_order_cross_allocation_optional_data.py | 2 +- .../multi_leg_order_cross_market_condition.py | 2 +- .../multi_leg_order_cross_optional_data.py | 2 +- .../models/multi_leg_order_leg.py | 19 +- .../multi_leg_order_leg_market_condition.py | 2 +- .../multi_leg_order_leg_optional_data.py | 2 +- .../multi_leg_order_market_condition.py | 2 +- .../models/multi_leg_order_optional_data.py | 2 +- .../openapi_package/models/option.py | 24 +- .../openapi_package/models/option_aliases.py | 2 +- .../openapi_package/models/option_chain.py | 12 +- .../models/option_chain_option.py | 12 +- .../models/option_chain_option_aliases.py | 2 +- .../models/option_chain_options.py | 4 +- .../models/option_chain_roots.py | 4 +- .../openapi_package/models/option_root.py | 30 +- .../models/option_root_aliases.py | 2 +- .../openapi_package/models/option_series.py | 20 +- .../openapi_package/models/order.py | 36 +- .../openapi_package/models/order_algo.py | 2 +- .../models/order_cancel_reject.py | 12 +- .../order_cancel_reject_optional_data.py | 2 +- .../models/order_cancel_replace_request.py | 34 +- .../order_cancel_replace_request_algo.py | 2 +- ...cancel_replace_request_market_condition.py | 2 +- ...er_cancel_replace_request_optional_data.py | 2 +- .../models/order_cancel_request.py | 13 +- .../order_cancel_request_optional_data.py | 2 +- .../openapi_package/models/order_cross.py | 34 +- .../models/order_cross_algo.py | 2 +- .../models/order_cross_allocation.py | 21 +- .../order_cross_allocation_optional_data.py | 2 +- .../models/order_cross_market_condition.py | 2 +- .../models/order_cross_optional_data.py | 2 +- .../openapi_package/models/order_delete.py | 8 +- .../models/order_delete_optional_data.py | 2 +- .../models/order_instruction.py | 6 +- .../models/order_market_condition.py | 2 +- .../models/order_optional_data.py | 2 +- .../openapi_package/models/order_update.py | 36 +- .../models/order_update_algo.py | 2 +- .../models/order_update_event.py | 21 +- .../models/order_update_optional_data.py | 2 +- .../openapi_package/models/position.py | 4 +- .../models/position_analysis.py | 8 +- .../openapi_package/models/position_theo.py | 6 +- .../models/position_theo_leg.py | 4 +- .../models/risk_radar_account_group.py | 10 +- .../models/risk_radar_class_group.py | 8 +- .../openapi_package/models/risk_radar_data.py | 6 +- .../models/risk_radar_position.py | 6 +- .../models/risk_radar_product_group.py | 8 +- .../models/risk_radar_request.py | 18 +- .../models/risk_radar_request_position.py | 4 +- .../risk_radar_request_position_list.py | 6 +- .../models/risk_radar_response.py | 8 +- .../openapi_package/models/risk_reject.py | 8 +- .../openapi_package/models/route.py | 14 +- .../models/route_applicability.py | 10 +- .../openapi_package/models/route_property.py | 6 +- .../models/routing_session_group.py | 6 +- .../openapi_package/models/scenario.py | 8 +- .../openapi_package/models/scenario_leg.py | 4 +- .../models/scenario_position.py | 4 +- .../openapi_package/models/scenario_theo.py | 6 +- .../models/search_order_history_response.py | 8 +- .../openapi_package/models/security.py | 24 +- .../openapi_package/models/settlement_info.py | 6 +- .../openapi_package/models/shock_value.py | 6 +- .../models/shock_value_flags.py | 4 +- .../openapi_package/models/status.py | 6 +- .../openapi_package/models/stock.py | 16 +- .../openapi_package/models/stock_aliases.py | 2 +- .../openapi_package/models/time_of_day.py | 4 +- .../models/tims_class_group.py | 6 +- .../models/tims_margin_data.py | 10 +- .../models/tims_position_group.py | 4 +- .../models/tims_product_group.py | 4 +- .../openapi_package/models/trade_confirm.py | 40 +- .../openapi_package/models/trading_firm.py | 4 +- .../models/trading_firm_slim.py | 4 +- .../openapi_package/models/trading_holiday.py | 8 +- .../openapi_package/models/trading_session.py | 6 +- .../models/trading_session_group.py | 6 +- .../openapi_package/models/user.py | 12 +- .../openapi_package/models/user_permission.py | 6 +- .../models/validate_risk_response.py | 8 +- replace_imports.py | 4 +- 532 files changed, 1302 insertions(+), 34986 deletions(-) delete mode 100644 openapi/openapi_project/README.md delete mode 100644 openapi/openapi_project/openapi_package/__init__.py delete mode 100644 openapi/openapi_project/openapi_package/api/__init__.py delete mode 100644 openapi/openapi_project/openapi_package/api/application_service/__init__.py delete mode 100644 openapi/openapi_project/openapi_package/api/application_service/post_application_login.py delete mode 100644 openapi/openapi_project/openapi_package/api/order_service/__init__.py delete mode 100644 openapi/openapi_project/openapi_package/api/order_service/get_orders.py delete mode 100644 openapi/openapi_project/openapi_package/api/order_service/get_orders_searchhistory.py delete mode 100644 openapi/openapi_project/openapi_package/api/order_service/get_orders_tradeconfirms.py delete mode 100644 openapi/openapi_project/openapi_package/api/order_service/post_orders_cancelorder.py delete mode 100644 openapi/openapi_project/openapi_package/api/order_service/post_orders_createmultilegorder.py delete mode 100644 openapi/openapi_project/openapi_package/api/order_service/post_orders_createmultilegordercross.py delete mode 100644 openapi/openapi_project/openapi_package/api/order_service/post_orders_createorder.py delete mode 100644 openapi/openapi_project/openapi_package/api/order_service/post_orders_createordercross.py delete mode 100644 openapi/openapi_project/openapi_package/api/order_service/post_orders_replacemultilegorder.py delete mode 100644 openapi/openapi_project/openapi_package/api/order_service/post_orders_replaceorder.py delete mode 100644 openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegorder.py delete mode 100644 openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegordercross.py delete mode 100644 openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createorder.py delete mode 100644 openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createordercross.py delete mode 100644 openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replacemultilegorder.py delete mode 100644 openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replaceorder.py delete mode 100644 openapi/openapi_project/openapi_package/api/portfolio_service/__init__.py delete mode 100644 openapi/openapi_project/openapi_package/api/portfolio_service/get_portfolio_positions.py delete mode 100644 openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_analyzepositions.py delete mode 100644 openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_calculatemargins.py delete mode 100644 openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_riskradar.py delete mode 100644 openapi/openapi_project/openapi_package/api/security_service/__init__.py delete mode 100644 openapi/openapi_project/openapi_package/api/security_service/get_securities_exchanges.py delete mode 100644 openapi/openapi_project/openapi_package/api/security_service/post_securities_easytoborrowsecurities.py delete mode 100644 openapi/openapi_project/openapi_package/api/security_service/post_securities_flexoption.py delete mode 100644 openapi/openapi_project/openapi_package/api/security_service/post_securities_optionchains.py delete mode 100644 openapi/openapi_project/openapi_package/api/security_service/post_securities_securities.py delete mode 100644 openapi/openapi_project/openapi_package/api/user_data_service/__init__.py delete mode 100644 openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_accounts.py delete mode 100644 openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_activeuser.py delete mode 100644 openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_affiliatedtradingfirms.py delete mode 100644 openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_p2paccounts.py delete mode 100644 openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_routes.py delete mode 100644 openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_tradingfirms.py delete mode 100644 openapi/openapi_project/openapi_package/api/utility_service/__init__.py delete mode 100644 openapi/openapi_project/openapi_package/api/utility_service/get_utility_serverinfo.py delete mode 100644 openapi/openapi_project/openapi_package/api/utility_service/get_utility_servertime.py delete mode 100644 openapi/openapi_project/openapi_package/api/utility_service/get_utility_tradingholidays.py delete mode 100644 openapi/openapi_project/openapi_package/client.py delete mode 100644 openapi/openapi_project/openapi_package/errors.py delete mode 100644 openapi/openapi_project/openapi_package/models/__init__.py delete mode 100644 openapi/openapi_project/openapi_package/models/account.py delete mode 100644 openapi/openapi_project/openapi_package/models/account_script.py delete mode 100644 openapi/openapi_project/openapi_package/models/account_status.py delete mode 100644 openapi/openapi_project/openapi_package/models/account_type.py delete mode 100644 openapi/openapi_project/openapi_package/models/analyze_position_item.py delete mode 100644 openapi/openapi_project/openapi_package/models/analyze_positions_request.py delete mode 100644 openapi/openapi_project/openapi_package/models/analyze_positions_response.py delete mode 100644 openapi/openapi_project/openapi_package/models/any_model.py delete mode 100644 openapi/openapi_project/openapi_package/models/calculate_margin_request.py delete mode 100644 openapi/openapi_project/openapi_package/models/calculate_margin_request_position.py delete mode 100644 openapi/openapi_project/openapi_package/models/calculate_margin_request_position_list.py delete mode 100644 openapi/openapi_project/openapi_package/models/calculate_margin_response.py delete mode 100644 openapi/openapi_project/openapi_package/models/cancel_order_request.py delete mode 100644 openapi/openapi_project/openapi_package/models/cancel_order_request_optional_data.py delete mode 100644 openapi/openapi_project/openapi_package/models/cancel_order_response.py delete mode 100644 openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py delete mode 100644 openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py delete mode 100644 openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py delete mode 100644 openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py delete mode 100644 openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py delete mode 100644 openapi/openapi_project/openapi_package/models/cancel_replace_order_request.py delete mode 100644 openapi/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py delete mode 100644 openapi/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py delete mode 100644 openapi/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py delete mode 100644 openapi/openapi_project/openapi_package/models/cancel_replace_order_response.py delete mode 100644 openapi/openapi_project/openapi_package/models/capacity_code.py delete mode 100644 openapi/openapi_project/openapi_package/models/claim_type.py delete mode 100644 openapi/openapi_project/openapi_package/models/clearing_info.py delete mode 100644 openapi/openapi_project/openapi_package/models/clearing_range.py delete mode 100644 openapi/openapi_project/openapi_package/models/country.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_flex_option_request.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_flex_option_response.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_leg.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_request.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_multi_leg_order_response.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_order_cross_allocation.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_order_cross_request.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_order_cross_request_algo.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_order_cross_response.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_order_request.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_order_request_algo.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_order_request_market_condition.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_order_request_optional_data.py delete mode 100644 openapi/openapi_project/openapi_package/models/create_order_response.py delete mode 100644 openapi/openapi_project/openapi_package/models/cross_side_type.py delete mode 100644 openapi/openapi_project/openapi_package/models/cross_type.py delete mode 100644 openapi/openapi_project/openapi_package/models/crypto.py delete mode 100644 openapi/openapi_project/openapi_package/models/crypto_aliases.py delete mode 100644 openapi/openapi_project/openapi_package/models/currency.py delete mode 100644 openapi/openapi_project/openapi_package/models/cxl_rej_response_to.py delete mode 100644 openapi/openapi_project/openapi_package/models/date.py delete mode 100644 openapi/openapi_project/openapi_package/models/easy_to_borrow_security.py delete mode 100644 openapi/openapi_project/openapi_package/models/empty.py delete mode 100644 openapi/openapi_project/openapi_package/models/exchange.py delete mode 100644 openapi/openapi_project/openapi_package/models/exchange_code.py delete mode 100644 openapi/openapi_project/openapi_package/models/exec_type.py delete mode 100644 openapi/openapi_project/openapi_package/models/execution.py delete mode 100644 openapi/openapi_project/openapi_package/models/execution_algo.py delete mode 100644 openapi/openapi_project/openapi_package/models/execution_optional_data.py delete mode 100644 openapi/openapi_project/openapi_package/models/flex_option.py delete mode 100644 openapi/openapi_project/openapi_package/models/flex_option_aliases.py delete mode 100644 openapi/openapi_project/openapi_package/models/flex_settlement_type.py delete mode 100644 openapi/openapi_project/openapi_package/models/future.py delete mode 100644 openapi/openapi_project/openapi_package/models/future_aliases.py delete mode 100644 openapi/openapi_project/openapi_package/models/future_root.py delete mode 100644 openapi/openapi_project/openapi_package/models/future_root_aliases.py delete mode 100644 openapi/openapi_project/openapi_package/models/future_spread.py delete mode 100644 openapi/openapi_project/openapi_package/models/future_spread_aliases.py delete mode 100644 openapi/openapi_project/openapi_package/models/future_spread_leg.py delete mode 100644 openapi/openapi_project/openapi_package/models/fx.py delete mode 100644 openapi/openapi_project/openapi_package/models/fx_aliases.py delete mode 100644 openapi/openapi_project/openapi_package/models/generic_order.py delete mode 100644 openapi/openapi_project/openapi_package/models/get_active_user_response.py delete mode 100644 openapi/openapi_project/openapi_package/models/get_server_info_response.py delete mode 100644 openapi/openapi_project/openapi_package/models/get_server_info_response_system_settings.py delete mode 100644 openapi/openapi_project/openapi_package/models/get_server_time_response.py delete mode 100644 openapi/openapi_project/openapi_package/models/get_trading_holidays_response.py delete mode 100644 openapi/openapi_project/openapi_package/models/header.py delete mode 100644 openapi/openapi_project/openapi_package/models/index.py delete mode 100644 openapi/openapi_project/openapi_package/models/index_aliases.py delete mode 100644 openapi/openapi_project/openapi_package/models/list_accounts_response.py delete mode 100644 openapi/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py delete mode 100644 openapi/openapi_project/openapi_package/models/list_easy_to_borrow_securities_request.py delete mode 100644 openapi/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py delete mode 100644 openapi/openapi_project/openapi_package/models/list_exchanges_response.py delete mode 100644 openapi/openapi_project/openapi_package/models/list_option_chains_repsonse.py delete mode 100644 openapi/openapi_project/openapi_package/models/list_option_chains_request.py delete mode 100644 openapi/openapi_project/openapi_package/models/list_orders_response.py delete mode 100644 openapi/openapi_project/openapi_package/models/list_positions_response.py delete mode 100644 openapi/openapi_project/openapi_package/models/list_routes_response.py delete mode 100644 openapi/openapi_project/openapi_package/models/list_securities_request.py delete mode 100644 openapi/openapi_project/openapi_package/models/list_securities_response.py delete mode 100644 openapi/openapi_project/openapi_package/models/list_trade_confirms_response.py delete mode 100644 openapi/openapi_project/openapi_package/models/list_trading_firms_response.py delete mode 100644 openapi/openapi_project/openapi_package/models/login_request.py delete mode 100644 openapi/openapi_project/openapi_package/models/login_response.py delete mode 100644 openapi/openapi_project/openapi_package/models/login_response_system_settings.py delete mode 100644 openapi/openapi_project/openapi_package/models/login_status.py delete mode 100644 openapi/openapi_project/openapi_package/models/margin_data.py delete mode 100644 openapi/openapi_project/openapi_package/models/margin_data_type.py delete mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order.py delete mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_algo.py delete mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py delete mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py delete mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py delete mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py delete mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_cross.py delete mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py delete mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py delete mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py delete mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py delete mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py delete mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_leg.py delete mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py delete mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py delete mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_market_condition.py delete mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_order_optional_data.py delete mode 100644 openapi/openapi_project/openapi_package/models/multi_leg_reporting_type.py delete mode 100644 openapi/openapi_project/openapi_package/models/numeric_display_format.py delete mode 100644 openapi/openapi_project/openapi_package/models/option.py delete mode 100644 openapi/openapi_project/openapi_package/models/option_aliases.py delete mode 100644 openapi/openapi_project/openapi_package/models/option_chain.py delete mode 100644 openapi/openapi_project/openapi_package/models/option_chain_option.py delete mode 100644 openapi/openapi_project/openapi_package/models/option_chain_option_aliases.py delete mode 100644 openapi/openapi_project/openapi_package/models/option_chain_options.py delete mode 100644 openapi/openapi_project/openapi_package/models/option_chain_roots.py delete mode 100644 openapi/openapi_project/openapi_package/models/option_exercise_style.py delete mode 100644 openapi/openapi_project/openapi_package/models/option_expiration_style.py delete mode 100644 openapi/openapi_project/openapi_package/models/option_root.py delete mode 100644 openapi/openapi_project/openapi_package/models/option_root_aliases.py delete mode 100644 openapi/openapi_project/openapi_package/models/option_series.py delete mode 100644 openapi/openapi_project/openapi_package/models/option_series_product_type.py delete mode 100644 openapi/openapi_project/openapi_package/models/option_series_type.py delete mode 100644 openapi/openapi_project/openapi_package/models/option_settlement_type.py delete mode 100644 openapi/openapi_project/openapi_package/models/ord_status.py delete mode 100644 openapi/openapi_project/openapi_package/models/ord_type.py delete mode 100644 openapi/openapi_project/openapi_package/models/order.py delete mode 100644 openapi/openapi_project/openapi_package/models/order_algo.py delete mode 100644 openapi/openapi_project/openapi_package/models/order_cancel_reject.py delete mode 100644 openapi/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py delete mode 100644 openapi/openapi_project/openapi_package/models/order_cancel_replace_request.py delete mode 100644 openapi/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py delete mode 100644 openapi/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py delete mode 100644 openapi/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py delete mode 100644 openapi/openapi_project/openapi_package/models/order_cancel_request.py delete mode 100644 openapi/openapi_project/openapi_package/models/order_cancel_request_optional_data.py delete mode 100644 openapi/openapi_project/openapi_package/models/order_cross.py delete mode 100644 openapi/openapi_project/openapi_package/models/order_cross_algo.py delete mode 100644 openapi/openapi_project/openapi_package/models/order_cross_allocation.py delete mode 100644 openapi/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py delete mode 100644 openapi/openapi_project/openapi_package/models/order_cross_market_condition.py delete mode 100644 openapi/openapi_project/openapi_package/models/order_cross_optional_data.py delete mode 100644 openapi/openapi_project/openapi_package/models/order_delete.py delete mode 100644 openapi/openapi_project/openapi_package/models/order_delete_optional_data.py delete mode 100644 openapi/openapi_project/openapi_package/models/order_instruction.py delete mode 100644 openapi/openapi_project/openapi_package/models/order_instruction_type.py delete mode 100644 openapi/openapi_project/openapi_package/models/order_market_condition.py delete mode 100644 openapi/openapi_project/openapi_package/models/order_optional_data.py delete mode 100644 openapi/openapi_project/openapi_package/models/order_type.py delete mode 100644 openapi/openapi_project/openapi_package/models/order_update.py delete mode 100644 openapi/openapi_project/openapi_package/models/order_update_algo.py delete mode 100644 openapi/openapi_project/openapi_package/models/order_update_event.py delete mode 100644 openapi/openapi_project/openapi_package/models/order_update_optional_data.py delete mode 100644 openapi/openapi_project/openapi_package/models/origination_type.py delete mode 100644 openapi/openapi_project/openapi_package/models/position.py delete mode 100644 openapi/openapi_project/openapi_package/models/position_analysis.py delete mode 100644 openapi/openapi_project/openapi_package/models/position_effect.py delete mode 100644 openapi/openapi_project/openapi_package/models/position_source.py delete mode 100644 openapi/openapi_project/openapi_package/models/position_theo.py delete mode 100644 openapi/openapi_project/openapi_package/models/position_theo_leg.py delete mode 100644 openapi/openapi_project/openapi_package/models/price_type.py delete mode 100644 openapi/openapi_project/openapi_package/models/product_group.py delete mode 100644 openapi/openapi_project/openapi_package/models/product_sub_group.py delete mode 100644 openapi/openapi_project/openapi_package/models/put_call.py delete mode 100644 openapi/openapi_project/openapi_package/models/risk_calculation_type.py delete mode 100644 openapi/openapi_project/openapi_package/models/risk_eval_mode.py delete mode 100644 openapi/openapi_project/openapi_package/models/risk_radar_account_group.py delete mode 100644 openapi/openapi_project/openapi_package/models/risk_radar_class_group.py delete mode 100644 openapi/openapi_project/openapi_package/models/risk_radar_data.py delete mode 100644 openapi/openapi_project/openapi_package/models/risk_radar_position.py delete mode 100644 openapi/openapi_project/openapi_package/models/risk_radar_product_group.py delete mode 100644 openapi/openapi_project/openapi_package/models/risk_radar_request.py delete mode 100644 openapi/openapi_project/openapi_package/models/risk_radar_request_position.py delete mode 100644 openapi/openapi_project/openapi_package/models/risk_radar_request_position_list.py delete mode 100644 openapi/openapi_project/openapi_package/models/risk_radar_response.py delete mode 100644 openapi/openapi_project/openapi_package/models/risk_radar_scenario_order.py delete mode 100644 openapi/openapi_project/openapi_package/models/risk_reject.py delete mode 100644 openapi/openapi_project/openapi_package/models/risk_reject_type.py delete mode 100644 openapi/openapi_project/openapi_package/models/route.py delete mode 100644 openapi/openapi_project/openapi_package/models/route_applicability.py delete mode 100644 openapi/openapi_project/openapi_package/models/route_property.py delete mode 100644 openapi/openapi_project/openapi_package/models/route_property_type.py delete mode 100644 openapi/openapi_project/openapi_package/models/route_type.py delete mode 100644 openapi/openapi_project/openapi_package/models/routing_session_group.py delete mode 100644 openapi/openapi_project/openapi_package/models/routing_session_group_type.py delete mode 100644 openapi/openapi_project/openapi_package/models/scenario.py delete mode 100644 openapi/openapi_project/openapi_package/models/scenario_leg.py delete mode 100644 openapi/openapi_project/openapi_package/models/scenario_position.py delete mode 100644 openapi/openapi_project/openapi_package/models/scenario_theo.py delete mode 100644 openapi/openapi_project/openapi_package/models/search_order_history_response.py delete mode 100644 openapi/openapi_project/openapi_package/models/security.py delete mode 100644 openapi/openapi_project/openapi_package/models/security_category.py delete mode 100644 openapi/openapi_project/openapi_package/models/security_type.py delete mode 100644 openapi/openapi_project/openapi_package/models/settlement_deliverable_type.py delete mode 100644 openapi/openapi_project/openapi_package/models/settlement_info.py delete mode 100644 openapi/openapi_project/openapi_package/models/shock_value.py delete mode 100644 openapi/openapi_project/openapi_package/models/shock_value_flags.py delete mode 100644 openapi/openapi_project/openapi_package/models/side.py delete mode 100644 openapi/openapi_project/openapi_package/models/spread_leg_side.py delete mode 100644 openapi/openapi_project/openapi_package/models/spread_leg_type.py delete mode 100644 openapi/openapi_project/openapi_package/models/status.py delete mode 100644 openapi/openapi_project/openapi_package/models/status_code.py delete mode 100644 openapi/openapi_project/openapi_package/models/stock.py delete mode 100644 openapi/openapi_project/openapi_package/models/stock_aliases.py delete mode 100644 openapi/openapi_project/openapi_package/models/tif.py delete mode 100644 openapi/openapi_project/openapi_package/models/time_of_day.py delete mode 100644 openapi/openapi_project/openapi_package/models/tims_class_group.py delete mode 100644 openapi/openapi_project/openapi_package/models/tims_margin_data.py delete mode 100644 openapi/openapi_project/openapi_package/models/tims_position_group.py delete mode 100644 openapi/openapi_project/openapi_package/models/tims_product_group.py delete mode 100644 openapi/openapi_project/openapi_package/models/trade_confirm.py delete mode 100644 openapi/openapi_project/openapi_package/models/trading_firm.py delete mode 100644 openapi/openapi_project/openapi_package/models/trading_firm_slim.py delete mode 100644 openapi/openapi_project/openapi_package/models/trading_holiday.py delete mode 100644 openapi/openapi_project/openapi_package/models/trading_session.py delete mode 100644 openapi/openapi_project/openapi_package/models/trading_session_group.py delete mode 100644 openapi/openapi_project/openapi_package/models/user.py delete mode 100644 openapi/openapi_project/openapi_package/models/user_location.py delete mode 100644 openapi/openapi_project/openapi_package/models/user_permission.py delete mode 100644 openapi/openapi_project/openapi_package/models/user_status.py delete mode 100644 openapi/openapi_project/openapi_package/models/user_type.py delete mode 100644 openapi/openapi_project/openapi_package/models/validate_risk_response.py delete mode 100644 openapi/openapi_project/openapi_package/models/volatility_shock_skew.py delete mode 100644 openapi/openapi_project/openapi_package/models/volatility_shock_type.py delete mode 100644 openapi/openapi_project/openapi_package/py.typed delete mode 100644 openapi/openapi_project/openapi_package/types.py diff --git a/openapi/openapi_project/README.md b/openapi/openapi_project/README.md deleted file mode 100644 index 126ad5b7e..000000000 --- a/openapi/openapi_project/README.md +++ /dev/null @@ -1,124 +0,0 @@ -# openapi_project -A client library for accessing Silexx API - -## Usage -First, create a client: - -```python -from openapi_package import Client - -client = Client(base_url="https://api.example.com") -``` - -If the endpoints you're going to hit require authentication, use `AuthenticatedClient` instead: - -```python -from openapi_package import AuthenticatedClient - -client = AuthenticatedClient(base_url="https://api.example.com", token="SuperSecretToken") -``` - -Now call your endpoint and use your models: - -```python -from openapi_package.models import MyDataModel -from openapi_package.api.my_tag import get_my_data_model -from openapi_package.types import Response - -with client as client: - my_data: MyDataModel = get_my_data_model.sync(client=client) - # or if you need more info (e.g. status_code) - response: Response[MyDataModel] = get_my_data_model.sync_detailed(client=client) -``` - -Or do the same thing with an async version: - -```python -from openapi_package.models import MyDataModel -from openapi_package.api.my_tag import get_my_data_model -from openapi_package.types import Response - -async with client as client: - my_data: MyDataModel = await get_my_data_model.asyncio(client=client) - response: Response[MyDataModel] = await get_my_data_model.asyncio_detailed(client=client) -``` - -By default, when you're calling an HTTPS API it will attempt to verify that SSL is working correctly. Using certificate verification is highly recommended most of the time, but sometimes you may need to authenticate to a server (especially an internal server) using a custom certificate bundle. - -```python -client = AuthenticatedClient( - base_url="https://internal_api.example.com", - token="SuperSecretToken", - verify_ssl="/path/to/certificate_bundle.pem", -) -``` - -You can also disable certificate validation altogether, but beware that **this is a security risk**. - -```python -client = AuthenticatedClient( - base_url="https://internal_api.example.com", - token="SuperSecretToken", - verify_ssl=False -) -``` - -Things to know: -1. Every path/method combo becomes a Python module with four functions: - 1. `sync`: Blocking request that returns parsed data (if successful) or `None` - 1. `sync_detailed`: Blocking request that always returns a `Request`, optionally with `parsed` set if the request was successful. - 1. `asyncio`: Like `sync` but async instead of blocking - 1. `asyncio_detailed`: Like `sync_detailed` but async instead of blocking - -1. All path/query params, and bodies become method arguments. -1. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above) -1. Any endpoint which did not have a tag will be in `openapi_package.api.default` - -## Advanced customizations - -There are more settings on the generated `Client` class which let you control more runtime behavior, check out the docstring on that class for more info. You can also customize the underlying `httpx.Client` or `httpx.AsyncClient` (depending on your use-case): - -```python -from openapi_package import Client - -def log_request(request): - print(f"Request event hook: {request.method} {request.url} - Waiting for response") - -def log_response(response): - request = response.request - print(f"Response event hook: {request.method} {request.url} - Status {response.status_code}") - -client = Client( - base_url="https://api.example.com", - httpx_args={"event_hooks": {"request": [log_request], "response": [log_response]}}, -) - -# Or get the underlying httpx client to modify directly with client.get_httpx_client() or client.get_async_httpx_client() -``` - -You can even set the httpx client directly, but beware that this will override any existing settings (e.g., base_url): - -```python -import httpx -from openapi_package import Client - -client = Client( - base_url="https://api.example.com", -) -# Note that base_url needs to be re-set, as would any shared cookies, headers, etc. -client.set_httpx_client(httpx.Client(base_url="https://api.example.com", proxies="http://localhost:8030")) -``` - -## Building / publishing this package -This project uses [Poetry](https://python-poetry.org/) to manage dependencies and packaging. Here are the basics: -1. Update the metadata in pyproject.toml (e.g. authors, version) -1. If you're using a private repository, configure it with Poetry - 1. `poetry config repositories. ` - 1. `poetry config http-basic. ` -1. Publish the client with `poetry publish --build -r ` or, if for public PyPI, just `poetry publish --build` - -If you want to install this client into another project without publishing it (e.g. for development) then: -1. If that project **is using Poetry**, you can simply do `poetry add ` from that project -1. If that project is not using Poetry: - 1. Build a wheel with `poetry build -f wheel` - 1. Install that wheel from the other project `pip install ` diff --git a/openapi/openapi_project/openapi_package/__init__.py b/openapi/openapi_project/openapi_package/__init__.py deleted file mode 100644 index 80fd8e99d..000000000 --- a/openapi/openapi_project/openapi_package/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -"""A client library for accessing Silexx API""" - -from openapi_project.openapi_package.client import AuthenticatedClient, Client - -__all__ = ( - "AuthenticatedClient", - "Client", -) diff --git a/openapi/openapi_project/openapi_package/api/__init__.py b/openapi/openapi_project/openapi_package/api/__init__.py deleted file mode 100644 index e6035bd9f..000000000 --- a/openapi/openapi_project/openapi_package/api/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains methods for accessing the API""" diff --git a/openapi/openapi_project/openapi_package/api/application_service/__init__.py b/openapi/openapi_project/openapi_package/api/application_service/__init__.py deleted file mode 100644 index dcbab9a7a..000000000 --- a/openapi/openapi_project/openapi_package/api/application_service/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/openapi/openapi_project/openapi_package/api/application_service/post_application_login.py b/openapi/openapi_project/openapi_package/api/application_service/post_application_login.py deleted file mode 100644 index ff28064ab..000000000 --- a/openapi/openapi_project/openapi_package/api/application_service/post_application_login.py +++ /dev/null @@ -1,154 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.login_request import LoginRequest -from openapi_project.openapi_package.models.login_response import LoginResponse -from openapi_project.openapi_package.types import Response - - -def _get_kwargs( - *, - body: LoginRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/application/login", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> LoginResponse | None: - if response.status_code == 200: - response_200 = LoginResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[LoginResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: LoginRequest, -) -> Response[LoginResponse]: - """ - Args: - body (LoginRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[LoginResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: LoginRequest, -) -> LoginResponse | None: - """ - Args: - body (LoginRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - LoginResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: LoginRequest, -) -> Response[LoginResponse]: - """ - Args: - body (LoginRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[LoginResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: LoginRequest, -) -> LoginResponse | None: - """ - Args: - body (LoginRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - LoginResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/__init__.py b/openapi/openapi_project/openapi_package/api/order_service/__init__.py deleted file mode 100644 index dcbab9a7a..000000000 --- a/openapi/openapi_project/openapi_package/api/order_service/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/openapi/openapi_project/openapi_package/api/order_service/get_orders.py b/openapi/openapi_project/openapi_package/api/order_service/get_orders.py deleted file mode 100644 index 9aea8a0da..000000000 --- a/openapi/openapi_project/openapi_package/api/order_service/get_orders.py +++ /dev/null @@ -1,121 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.list_orders_response import ListOrdersResponse -from openapi_project.openapi_package.types import Response - - -def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/orders", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ListOrdersResponse | None: - if response.status_code == 200: - response_200 = ListOrdersResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ListOrdersResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[ListOrdersResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListOrdersResponse] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, -) -> ListOrdersResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListOrdersResponse - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[ListOrdersResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListOrdersResponse] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, -) -> ListOrdersResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListOrdersResponse - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/get_orders_searchhistory.py b/openapi/openapi_project/openapi_package/api/order_service/get_orders_searchhistory.py deleted file mode 100644 index 2e8ec55dd..000000000 --- a/openapi/openapi_project/openapi_package/api/order_service/get_orders_searchhistory.py +++ /dev/null @@ -1,243 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.search_order_history_response import SearchOrderHistoryResponse -from openapi_project.openapi_package.types import UNSET, Response, Unset - - -def _get_kwargs( - *, - account_ids: Unset | str = UNSET, - to_dt_year: Unset | str = UNSET, - to_dt_month: Unset | str = UNSET, - to_dt_day: Unset | str = UNSET, - from_dt_year: Unset | str = UNSET, - from_dt_month: Unset | str = UNSET, - from_dt_day: Unset | str = UNSET, -) -> dict[str, Any]: - params: dict[str, Any] = {} - - params["accountIds"] = account_ids - - params["toDt.year"] = to_dt_year - - params["toDt.month"] = to_dt_month - - params["toDt.day"] = to_dt_day - - params["fromDt.year"] = from_dt_year - - params["fromDt.month"] = from_dt_month - - params["fromDt.day"] = from_dt_day - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/orders/searchhistory", - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> SearchOrderHistoryResponse | None: - if response.status_code == 200: - response_200 = SearchOrderHistoryResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[SearchOrderHistoryResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - account_ids: Unset | str = UNSET, - to_dt_year: Unset | str = UNSET, - to_dt_month: Unset | str = UNSET, - to_dt_day: Unset | str = UNSET, - from_dt_year: Unset | str = UNSET, - from_dt_month: Unset | str = UNSET, - from_dt_day: Unset | str = UNSET, -) -> Response[SearchOrderHistoryResponse]: - """ - Args: - account_ids (Union[Unset, str]): - to_dt_year (Union[Unset, str]): - to_dt_month (Union[Unset, str]): - to_dt_day (Union[Unset, str]): - from_dt_year (Union[Unset, str]): - from_dt_month (Union[Unset, str]): - from_dt_day (Union[Unset, str]): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[SearchOrderHistoryResponse] - """ - - kwargs = _get_kwargs( - account_ids=account_ids, - to_dt_year=to_dt_year, - to_dt_month=to_dt_month, - to_dt_day=to_dt_day, - from_dt_year=from_dt_year, - from_dt_month=from_dt_month, - from_dt_day=from_dt_day, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - account_ids: Unset | str = UNSET, - to_dt_year: Unset | str = UNSET, - to_dt_month: Unset | str = UNSET, - to_dt_day: Unset | str = UNSET, - from_dt_year: Unset | str = UNSET, - from_dt_month: Unset | str = UNSET, - from_dt_day: Unset | str = UNSET, -) -> SearchOrderHistoryResponse | None: - """ - Args: - account_ids (Union[Unset, str]): - to_dt_year (Union[Unset, str]): - to_dt_month (Union[Unset, str]): - to_dt_day (Union[Unset, str]): - from_dt_year (Union[Unset, str]): - from_dt_month (Union[Unset, str]): - from_dt_day (Union[Unset, str]): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - SearchOrderHistoryResponse - """ - - return sync_detailed( - client=client, - account_ids=account_ids, - to_dt_year=to_dt_year, - to_dt_month=to_dt_month, - to_dt_day=to_dt_day, - from_dt_year=from_dt_year, - from_dt_month=from_dt_month, - from_dt_day=from_dt_day, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - account_ids: Unset | str = UNSET, - to_dt_year: Unset | str = UNSET, - to_dt_month: Unset | str = UNSET, - to_dt_day: Unset | str = UNSET, - from_dt_year: Unset | str = UNSET, - from_dt_month: Unset | str = UNSET, - from_dt_day: Unset | str = UNSET, -) -> Response[SearchOrderHistoryResponse]: - """ - Args: - account_ids (Union[Unset, str]): - to_dt_year (Union[Unset, str]): - to_dt_month (Union[Unset, str]): - to_dt_day (Union[Unset, str]): - from_dt_year (Union[Unset, str]): - from_dt_month (Union[Unset, str]): - from_dt_day (Union[Unset, str]): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[SearchOrderHistoryResponse] - """ - - kwargs = _get_kwargs( - account_ids=account_ids, - to_dt_year=to_dt_year, - to_dt_month=to_dt_month, - to_dt_day=to_dt_day, - from_dt_year=from_dt_year, - from_dt_month=from_dt_month, - from_dt_day=from_dt_day, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - account_ids: Unset | str = UNSET, - to_dt_year: Unset | str = UNSET, - to_dt_month: Unset | str = UNSET, - to_dt_day: Unset | str = UNSET, - from_dt_year: Unset | str = UNSET, - from_dt_month: Unset | str = UNSET, - from_dt_day: Unset | str = UNSET, -) -> SearchOrderHistoryResponse | None: - """ - Args: - account_ids (Union[Unset, str]): - to_dt_year (Union[Unset, str]): - to_dt_month (Union[Unset, str]): - to_dt_day (Union[Unset, str]): - from_dt_year (Union[Unset, str]): - from_dt_month (Union[Unset, str]): - from_dt_day (Union[Unset, str]): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - SearchOrderHistoryResponse - """ - - return ( - await asyncio_detailed( - client=client, - account_ids=account_ids, - to_dt_year=to_dt_year, - to_dt_month=to_dt_month, - to_dt_day=to_dt_day, - from_dt_year=from_dt_year, - from_dt_month=from_dt_month, - from_dt_day=from_dt_day, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/get_orders_tradeconfirms.py b/openapi/openapi_project/openapi_package/api/order_service/get_orders_tradeconfirms.py deleted file mode 100644 index 028730f92..000000000 --- a/openapi/openapi_project/openapi_package/api/order_service/get_orders_tradeconfirms.py +++ /dev/null @@ -1,213 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.list_trade_confirms_response import ListTradeConfirmsResponse -from openapi_project.openapi_package.types import UNSET, Response, Unset - - -def _get_kwargs( - *, - account_ids: Unset | str = UNSET, - end_time_utc: Unset | str = UNSET, - start_time_utc: Unset | str = UNSET, - trading_firm_ids: Unset | str = UNSET, - user_ids: Unset | str = UNSET, -) -> dict[str, Any]: - params: dict[str, Any] = {} - - params["accountIds"] = account_ids - - params["endTimeUtc"] = end_time_utc - - params["startTimeUtc"] = start_time_utc - - params["tradingFirmIds"] = trading_firm_ids - - params["userIds"] = user_ids - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/orders/tradeconfirms", - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ListTradeConfirmsResponse | None: - if response.status_code == 200: - response_200 = ListTradeConfirmsResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ListTradeConfirmsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - account_ids: Unset | str = UNSET, - end_time_utc: Unset | str = UNSET, - start_time_utc: Unset | str = UNSET, - trading_firm_ids: Unset | str = UNSET, - user_ids: Unset | str = UNSET, -) -> Response[ListTradeConfirmsResponse]: - """ - Args: - account_ids (Union[Unset, str]): - end_time_utc (Union[Unset, str]): - start_time_utc (Union[Unset, str]): - trading_firm_ids (Union[Unset, str]): - user_ids (Union[Unset, str]): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListTradeConfirmsResponse] - """ - - kwargs = _get_kwargs( - account_ids=account_ids, - end_time_utc=end_time_utc, - start_time_utc=start_time_utc, - trading_firm_ids=trading_firm_ids, - user_ids=user_ids, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - account_ids: Unset | str = UNSET, - end_time_utc: Unset | str = UNSET, - start_time_utc: Unset | str = UNSET, - trading_firm_ids: Unset | str = UNSET, - user_ids: Unset | str = UNSET, -) -> ListTradeConfirmsResponse | None: - """ - Args: - account_ids (Union[Unset, str]): - end_time_utc (Union[Unset, str]): - start_time_utc (Union[Unset, str]): - trading_firm_ids (Union[Unset, str]): - user_ids (Union[Unset, str]): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListTradeConfirmsResponse - """ - - return sync_detailed( - client=client, - account_ids=account_ids, - end_time_utc=end_time_utc, - start_time_utc=start_time_utc, - trading_firm_ids=trading_firm_ids, - user_ids=user_ids, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - account_ids: Unset | str = UNSET, - end_time_utc: Unset | str = UNSET, - start_time_utc: Unset | str = UNSET, - trading_firm_ids: Unset | str = UNSET, - user_ids: Unset | str = UNSET, -) -> Response[ListTradeConfirmsResponse]: - """ - Args: - account_ids (Union[Unset, str]): - end_time_utc (Union[Unset, str]): - start_time_utc (Union[Unset, str]): - trading_firm_ids (Union[Unset, str]): - user_ids (Union[Unset, str]): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListTradeConfirmsResponse] - """ - - kwargs = _get_kwargs( - account_ids=account_ids, - end_time_utc=end_time_utc, - start_time_utc=start_time_utc, - trading_firm_ids=trading_firm_ids, - user_ids=user_ids, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - account_ids: Unset | str = UNSET, - end_time_utc: Unset | str = UNSET, - start_time_utc: Unset | str = UNSET, - trading_firm_ids: Unset | str = UNSET, - user_ids: Unset | str = UNSET, -) -> ListTradeConfirmsResponse | None: - """ - Args: - account_ids (Union[Unset, str]): - end_time_utc (Union[Unset, str]): - start_time_utc (Union[Unset, str]): - trading_firm_ids (Union[Unset, str]): - user_ids (Union[Unset, str]): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListTradeConfirmsResponse - """ - - return ( - await asyncio_detailed( - client=client, - account_ids=account_ids, - end_time_utc=end_time_utc, - start_time_utc=start_time_utc, - trading_firm_ids=trading_firm_ids, - user_ids=user_ids, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_cancelorder.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_cancelorder.py deleted file mode 100644 index 326cc71d9..000000000 --- a/openapi/openapi_project/openapi_package/api/order_service/post_orders_cancelorder.py +++ /dev/null @@ -1,154 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.cancel_order_request import CancelOrderRequest -from openapi_project.openapi_package.models.cancel_order_response import CancelOrderResponse -from openapi_project.openapi_package.types import Response - - -def _get_kwargs( - *, - body: CancelOrderRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/orders/cancelorder", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CancelOrderResponse | None: - if response.status_code == 200: - response_200 = CancelOrderResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CancelOrderResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CancelOrderRequest, -) -> Response[CancelOrderResponse]: - """ - Args: - body (CancelOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CancelOrderResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CancelOrderRequest, -) -> CancelOrderResponse | None: - """ - Args: - body (CancelOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CancelOrderResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CancelOrderRequest, -) -> Response[CancelOrderResponse]: - """ - Args: - body (CancelOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CancelOrderResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CancelOrderRequest, -) -> CancelOrderResponse | None: - """ - Args: - body (CancelOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CancelOrderResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_createmultilegorder.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_createmultilegorder.py deleted file mode 100644 index 337536ea2..000000000 --- a/openapi/openapi_project/openapi_package/api/order_service/post_orders_createmultilegorder.py +++ /dev/null @@ -1,154 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.create_multi_leg_order_request import CreateMultiLegOrderRequest -from openapi_project.openapi_package.models.create_multi_leg_order_response import CreateMultiLegOrderResponse -from openapi_project.openapi_package.types import Response - - -def _get_kwargs( - *, - body: CreateMultiLegOrderRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/orders/createmultilegorder", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CreateMultiLegOrderResponse | None: - if response.status_code == 200: - response_200 = CreateMultiLegOrderResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CreateMultiLegOrderResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderRequest, -) -> Response[CreateMultiLegOrderResponse]: - """ - Args: - body (CreateMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateMultiLegOrderResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderRequest, -) -> CreateMultiLegOrderResponse | None: - """ - Args: - body (CreateMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateMultiLegOrderResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderRequest, -) -> Response[CreateMultiLegOrderResponse]: - """ - Args: - body (CreateMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateMultiLegOrderResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderRequest, -) -> CreateMultiLegOrderResponse | None: - """ - Args: - body (CreateMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateMultiLegOrderResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_createmultilegordercross.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_createmultilegordercross.py deleted file mode 100644 index 4f396ec5d..000000000 --- a/openapi/openapi_project/openapi_package/api/order_service/post_orders_createmultilegordercross.py +++ /dev/null @@ -1,156 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.create_multi_leg_order_cross_request import CreateMultiLegOrderCrossRequest, - -from openapi_project.openapi_package.models.create_multi_leg_order_cross_response import CreateMultiLegOrderCrossResponse, - -from openapi_project.openapi_package.types import Response - - -def _get_kwargs( - *, - body: CreateMultiLegOrderCrossRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/orders/createmultilegordercross", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CreateMultiLegOrderCrossResponse | None: - if response.status_code == 200: - response_200 = CreateMultiLegOrderCrossResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CreateMultiLegOrderCrossResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderCrossRequest, -) -> Response[CreateMultiLegOrderCrossResponse]: - """ - Args: - body (CreateMultiLegOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateMultiLegOrderCrossResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderCrossRequest, -) -> CreateMultiLegOrderCrossResponse | None: - """ - Args: - body (CreateMultiLegOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateMultiLegOrderCrossResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderCrossRequest, -) -> Response[CreateMultiLegOrderCrossResponse]: - """ - Args: - body (CreateMultiLegOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateMultiLegOrderCrossResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderCrossRequest, -) -> CreateMultiLegOrderCrossResponse | None: - """ - Args: - body (CreateMultiLegOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateMultiLegOrderCrossResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_createorder.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_createorder.py deleted file mode 100644 index 60a7a68f4..000000000 --- a/openapi/openapi_project/openapi_package/api/order_service/post_orders_createorder.py +++ /dev/null @@ -1,154 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.create_order_request import CreateOrderRequest -from openapi_project.openapi_package.models.create_order_response import CreateOrderResponse -from openapi_project.openapi_package.types import Response - - -def _get_kwargs( - *, - body: CreateOrderRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/orders/createorder", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CreateOrderResponse | None: - if response.status_code == 200: - response_200 = CreateOrderResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CreateOrderResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateOrderRequest, -) -> Response[CreateOrderResponse]: - """ - Args: - body (CreateOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateOrderResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CreateOrderRequest, -) -> CreateOrderResponse | None: - """ - Args: - body (CreateOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateOrderResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateOrderRequest, -) -> Response[CreateOrderResponse]: - """ - Args: - body (CreateOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateOrderResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CreateOrderRequest, -) -> CreateOrderResponse | None: - """ - Args: - body (CreateOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateOrderResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_createordercross.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_createordercross.py deleted file mode 100644 index 9a97b5fdd..000000000 --- a/openapi/openapi_project/openapi_package/api/order_service/post_orders_createordercross.py +++ /dev/null @@ -1,154 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.create_order_cross_request import CreateOrderCrossRequest -from openapi_project.openapi_package.models.create_order_cross_response import CreateOrderCrossResponse -from openapi_project.openapi_package.types import Response - - -def _get_kwargs( - *, - body: CreateOrderCrossRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/orders/createordercross", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CreateOrderCrossResponse | None: - if response.status_code == 200: - response_200 = CreateOrderCrossResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CreateOrderCrossResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateOrderCrossRequest, -) -> Response[CreateOrderCrossResponse]: - """ - Args: - body (CreateOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateOrderCrossResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CreateOrderCrossRequest, -) -> CreateOrderCrossResponse | None: - """ - Args: - body (CreateOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateOrderCrossResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateOrderCrossRequest, -) -> Response[CreateOrderCrossResponse]: - """ - Args: - body (CreateOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateOrderCrossResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CreateOrderCrossRequest, -) -> CreateOrderCrossResponse | None: - """ - Args: - body (CreateOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateOrderCrossResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_replacemultilegorder.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_replacemultilegorder.py deleted file mode 100644 index 2a0172725..000000000 --- a/openapi/openapi_project/openapi_package/api/order_service/post_orders_replacemultilegorder.py +++ /dev/null @@ -1,156 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request import CancelReplaceMultiLegOrderRequest, - -from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_response import CancelReplaceMultiLegOrderResponse, - -from openapi_project.openapi_package.types import Response - - -def _get_kwargs( - *, - body: CancelReplaceMultiLegOrderRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/orders/replacemultilegorder", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CancelReplaceMultiLegOrderResponse | None: - if response.status_code == 200: - response_200 = CancelReplaceMultiLegOrderResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CancelReplaceMultiLegOrderResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceMultiLegOrderRequest, -) -> Response[CancelReplaceMultiLegOrderResponse]: - """ - Args: - body (CancelReplaceMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CancelReplaceMultiLegOrderResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceMultiLegOrderRequest, -) -> CancelReplaceMultiLegOrderResponse | None: - """ - Args: - body (CancelReplaceMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CancelReplaceMultiLegOrderResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceMultiLegOrderRequest, -) -> Response[CancelReplaceMultiLegOrderResponse]: - """ - Args: - body (CancelReplaceMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CancelReplaceMultiLegOrderResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceMultiLegOrderRequest, -) -> CancelReplaceMultiLegOrderResponse | None: - """ - Args: - body (CancelReplaceMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CancelReplaceMultiLegOrderResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_replaceorder.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_replaceorder.py deleted file mode 100644 index b6b670db0..000000000 --- a/openapi/openapi_project/openapi_package/api/order_service/post_orders_replaceorder.py +++ /dev/null @@ -1,154 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.cancel_replace_order_request import CancelReplaceOrderRequest -from openapi_project.openapi_package.models.cancel_replace_order_response import CancelReplaceOrderResponse -from openapi_project.openapi_package.types import Response - - -def _get_kwargs( - *, - body: CancelReplaceOrderRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/orders/replaceorder", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CancelReplaceOrderResponse | None: - if response.status_code == 200: - response_200 = CancelReplaceOrderResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CancelReplaceOrderResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceOrderRequest, -) -> Response[CancelReplaceOrderResponse]: - """ - Args: - body (CancelReplaceOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CancelReplaceOrderResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceOrderRequest, -) -> CancelReplaceOrderResponse | None: - """ - Args: - body (CancelReplaceOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CancelReplaceOrderResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceOrderRequest, -) -> Response[CancelReplaceOrderResponse]: - """ - Args: - body (CancelReplaceOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CancelReplaceOrderResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceOrderRequest, -) -> CancelReplaceOrderResponse | None: - """ - Args: - body (CancelReplaceOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CancelReplaceOrderResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegorder.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegorder.py deleted file mode 100644 index a93ab9eda..000000000 --- a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegorder.py +++ /dev/null @@ -1,154 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.create_multi_leg_order_request import CreateMultiLegOrderRequest -from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse -from openapi_project.openapi_package.types import Response - - -def _get_kwargs( - *, - body: CreateMultiLegOrderRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/orders/validaterisk/createmultilegorder", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ValidateRiskResponse | None: - if response.status_code == 200: - response_200 = ValidateRiskResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ValidateRiskResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderRequest, -) -> Response[ValidateRiskResponse]: - """ - Args: - body (CreateMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ValidateRiskResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderRequest, -) -> ValidateRiskResponse | None: - """ - Args: - body (CreateMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ValidateRiskResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderRequest, -) -> Response[ValidateRiskResponse]: - """ - Args: - body (CreateMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ValidateRiskResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderRequest, -) -> ValidateRiskResponse | None: - """ - Args: - body (CreateMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ValidateRiskResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegordercross.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegordercross.py deleted file mode 100644 index f397d79a0..000000000 --- a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegordercross.py +++ /dev/null @@ -1,155 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.create_multi_leg_order_cross_request import CreateMultiLegOrderCrossRequest, - -from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse -from openapi_project.openapi_package.types import Response - - -def _get_kwargs( - *, - body: CreateMultiLegOrderCrossRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/orders/validaterisk/createmultilegordercross", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ValidateRiskResponse | None: - if response.status_code == 200: - response_200 = ValidateRiskResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ValidateRiskResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderCrossRequest, -) -> Response[ValidateRiskResponse]: - """ - Args: - body (CreateMultiLegOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ValidateRiskResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderCrossRequest, -) -> ValidateRiskResponse | None: - """ - Args: - body (CreateMultiLegOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ValidateRiskResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderCrossRequest, -) -> Response[ValidateRiskResponse]: - """ - Args: - body (CreateMultiLegOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ValidateRiskResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderCrossRequest, -) -> ValidateRiskResponse | None: - """ - Args: - body (CreateMultiLegOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ValidateRiskResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createorder.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createorder.py deleted file mode 100644 index ef561489f..000000000 --- a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createorder.py +++ /dev/null @@ -1,154 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.create_order_request import CreateOrderRequest -from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse -from openapi_project.openapi_package.types import Response - - -def _get_kwargs( - *, - body: CreateOrderRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/orders/validaterisk/createorder", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ValidateRiskResponse | None: - if response.status_code == 200: - response_200 = ValidateRiskResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ValidateRiskResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateOrderRequest, -) -> Response[ValidateRiskResponse]: - """ - Args: - body (CreateOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ValidateRiskResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CreateOrderRequest, -) -> ValidateRiskResponse | None: - """ - Args: - body (CreateOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ValidateRiskResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateOrderRequest, -) -> Response[ValidateRiskResponse]: - """ - Args: - body (CreateOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ValidateRiskResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CreateOrderRequest, -) -> ValidateRiskResponse | None: - """ - Args: - body (CreateOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ValidateRiskResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createordercross.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createordercross.py deleted file mode 100644 index 8131433bb..000000000 --- a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createordercross.py +++ /dev/null @@ -1,154 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.create_order_cross_request import CreateOrderCrossRequest -from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse -from openapi_project.openapi_package.types import Response - - -def _get_kwargs( - *, - body: CreateOrderCrossRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/orders/validaterisk/createordercross", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ValidateRiskResponse | None: - if response.status_code == 200: - response_200 = ValidateRiskResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ValidateRiskResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateOrderCrossRequest, -) -> Response[ValidateRiskResponse]: - """ - Args: - body (CreateOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ValidateRiskResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CreateOrderCrossRequest, -) -> ValidateRiskResponse | None: - """ - Args: - body (CreateOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ValidateRiskResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateOrderCrossRequest, -) -> Response[ValidateRiskResponse]: - """ - Args: - body (CreateOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ValidateRiskResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CreateOrderCrossRequest, -) -> ValidateRiskResponse | None: - """ - Args: - body (CreateOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ValidateRiskResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replacemultilegorder.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replacemultilegorder.py deleted file mode 100644 index 4ddcddcea..000000000 --- a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replacemultilegorder.py +++ /dev/null @@ -1,155 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request import CancelReplaceMultiLegOrderRequest, - -from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse -from openapi_project.openapi_package.types import Response - - -def _get_kwargs( - *, - body: CancelReplaceMultiLegOrderRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/orders/validaterisk/replacemultilegorder", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ValidateRiskResponse | None: - if response.status_code == 200: - response_200 = ValidateRiskResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ValidateRiskResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceMultiLegOrderRequest, -) -> Response[ValidateRiskResponse]: - """ - Args: - body (CancelReplaceMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ValidateRiskResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceMultiLegOrderRequest, -) -> ValidateRiskResponse | None: - """ - Args: - body (CancelReplaceMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ValidateRiskResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceMultiLegOrderRequest, -) -> Response[ValidateRiskResponse]: - """ - Args: - body (CancelReplaceMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ValidateRiskResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceMultiLegOrderRequest, -) -> ValidateRiskResponse | None: - """ - Args: - body (CancelReplaceMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ValidateRiskResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replaceorder.py b/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replaceorder.py deleted file mode 100644 index 58e31dfba..000000000 --- a/openapi/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replaceorder.py +++ /dev/null @@ -1,154 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.cancel_replace_order_request import CancelReplaceOrderRequest -from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse -from openapi_project.openapi_package.types import Response - - -def _get_kwargs( - *, - body: CancelReplaceOrderRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/orders/validaterisk/replaceorder", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ValidateRiskResponse | None: - if response.status_code == 200: - response_200 = ValidateRiskResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ValidateRiskResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceOrderRequest, -) -> Response[ValidateRiskResponse]: - """ - Args: - body (CancelReplaceOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ValidateRiskResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceOrderRequest, -) -> ValidateRiskResponse | None: - """ - Args: - body (CancelReplaceOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ValidateRiskResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceOrderRequest, -) -> Response[ValidateRiskResponse]: - """ - Args: - body (CancelReplaceOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ValidateRiskResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceOrderRequest, -) -> ValidateRiskResponse | None: - """ - Args: - body (CancelReplaceOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ValidateRiskResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/portfolio_service/__init__.py b/openapi/openapi_project/openapi_package/api/portfolio_service/__init__.py deleted file mode 100644 index dcbab9a7a..000000000 --- a/openapi/openapi_project/openapi_package/api/portfolio_service/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/openapi/openapi_project/openapi_package/api/portfolio_service/get_portfolio_positions.py b/openapi/openapi_project/openapi_package/api/portfolio_service/get_portfolio_positions.py deleted file mode 100644 index 6f5bed08e..000000000 --- a/openapi/openapi_project/openapi_package/api/portfolio_service/get_portfolio_positions.py +++ /dev/null @@ -1,198 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.list_positions_response import ListPositionsResponse -from openapi_project.openapi_package.types import UNSET, Response, Unset - - -def _get_kwargs( - *, - all_: Unset | str = UNSET, - account_id: Unset | str = UNSET, - account_id_and_symbol_account_id: Unset | str = UNSET, - account_id_and_symbol_symbol: Unset | str = UNSET, -) -> dict[str, Any]: - params: dict[str, Any] = {} - - params["all"] = all_ - - params["accountId"] = account_id - - params["accountIdAndSymbol.accountId"] = account_id_and_symbol_account_id - - params["accountIdAndSymbol.symbol"] = account_id_and_symbol_symbol - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/portfolio/positions", - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ListPositionsResponse | None: - if response.status_code == 200: - response_200 = ListPositionsResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ListPositionsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - all_: Unset | str = UNSET, - account_id: Unset | str = UNSET, - account_id_and_symbol_account_id: Unset | str = UNSET, - account_id_and_symbol_symbol: Unset | str = UNSET, -) -> Response[ListPositionsResponse]: - """ - Args: - all_ (Union[Unset, str]): - account_id (Union[Unset, str]): - account_id_and_symbol_account_id (Union[Unset, str]): - account_id_and_symbol_symbol (Union[Unset, str]): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListPositionsResponse] - """ - - kwargs = _get_kwargs( - all_=all_, - account_id=account_id, - account_id_and_symbol_account_id=account_id_and_symbol_account_id, - account_id_and_symbol_symbol=account_id_and_symbol_symbol, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - all_: Unset | str = UNSET, - account_id: Unset | str = UNSET, - account_id_and_symbol_account_id: Unset | str = UNSET, - account_id_and_symbol_symbol: Unset | str = UNSET, -) -> ListPositionsResponse | None: - """ - Args: - all_ (Union[Unset, str]): - account_id (Union[Unset, str]): - account_id_and_symbol_account_id (Union[Unset, str]): - account_id_and_symbol_symbol (Union[Unset, str]): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListPositionsResponse - """ - - return sync_detailed( - client=client, - all_=all_, - account_id=account_id, - account_id_and_symbol_account_id=account_id_and_symbol_account_id, - account_id_and_symbol_symbol=account_id_and_symbol_symbol, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - all_: Unset | str = UNSET, - account_id: Unset | str = UNSET, - account_id_and_symbol_account_id: Unset | str = UNSET, - account_id_and_symbol_symbol: Unset | str = UNSET, -) -> Response[ListPositionsResponse]: - """ - Args: - all_ (Union[Unset, str]): - account_id (Union[Unset, str]): - account_id_and_symbol_account_id (Union[Unset, str]): - account_id_and_symbol_symbol (Union[Unset, str]): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListPositionsResponse] - """ - - kwargs = _get_kwargs( - all_=all_, - account_id=account_id, - account_id_and_symbol_account_id=account_id_and_symbol_account_id, - account_id_and_symbol_symbol=account_id_and_symbol_symbol, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - all_: Unset | str = UNSET, - account_id: Unset | str = UNSET, - account_id_and_symbol_account_id: Unset | str = UNSET, - account_id_and_symbol_symbol: Unset | str = UNSET, -) -> ListPositionsResponse | None: - """ - Args: - all_ (Union[Unset, str]): - account_id (Union[Unset, str]): - account_id_and_symbol_account_id (Union[Unset, str]): - account_id_and_symbol_symbol (Union[Unset, str]): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListPositionsResponse - """ - - return ( - await asyncio_detailed( - client=client, - all_=all_, - account_id=account_id, - account_id_and_symbol_account_id=account_id_and_symbol_account_id, - account_id_and_symbol_symbol=account_id_and_symbol_symbol, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_analyzepositions.py b/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_analyzepositions.py deleted file mode 100644 index bc38ed39a..000000000 --- a/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_analyzepositions.py +++ /dev/null @@ -1,154 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.analyze_positions_request import AnalyzePositionsRequest -from openapi_project.openapi_package.models.analyze_positions_response import AnalyzePositionsResponse -from openapi_project.openapi_package.types import Response - - -def _get_kwargs( - *, - body: AnalyzePositionsRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/portfolio/analyzepositions", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AnalyzePositionsResponse | None: - if response.status_code == 200: - response_200 = AnalyzePositionsResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AnalyzePositionsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: AnalyzePositionsRequest, -) -> Response[AnalyzePositionsResponse]: - """ - Args: - body (AnalyzePositionsRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[AnalyzePositionsResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: AnalyzePositionsRequest, -) -> AnalyzePositionsResponse | None: - """ - Args: - body (AnalyzePositionsRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - AnalyzePositionsResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: AnalyzePositionsRequest, -) -> Response[AnalyzePositionsResponse]: - """ - Args: - body (AnalyzePositionsRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[AnalyzePositionsResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: AnalyzePositionsRequest, -) -> AnalyzePositionsResponse | None: - """ - Args: - body (AnalyzePositionsRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - AnalyzePositionsResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_calculatemargins.py b/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_calculatemargins.py deleted file mode 100644 index 11b1f826b..000000000 --- a/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_calculatemargins.py +++ /dev/null @@ -1,154 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.calculate_margin_request import CalculateMarginRequest -from openapi_project.openapi_package.models.calculate_margin_response import CalculateMarginResponse -from openapi_project.openapi_package.types import Response - - -def _get_kwargs( - *, - body: CalculateMarginRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/portfolio/calculatemargins", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CalculateMarginResponse | None: - if response.status_code == 200: - response_200 = CalculateMarginResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CalculateMarginResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CalculateMarginRequest, -) -> Response[CalculateMarginResponse]: - """ - Args: - body (CalculateMarginRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CalculateMarginResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CalculateMarginRequest, -) -> CalculateMarginResponse | None: - """ - Args: - body (CalculateMarginRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CalculateMarginResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CalculateMarginRequest, -) -> Response[CalculateMarginResponse]: - """ - Args: - body (CalculateMarginRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CalculateMarginResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CalculateMarginRequest, -) -> CalculateMarginResponse | None: - """ - Args: - body (CalculateMarginRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CalculateMarginResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_riskradar.py b/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_riskradar.py deleted file mode 100644 index 14fea3697..000000000 --- a/openapi/openapi_project/openapi_package/api/portfolio_service/post_portfolio_riskradar.py +++ /dev/null @@ -1,154 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.risk_radar_request import RiskRadarRequest -from openapi_project.openapi_package.models.risk_radar_response import RiskRadarResponse -from openapi_project.openapi_package.types import Response - - -def _get_kwargs( - *, - body: RiskRadarRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/portfolio/riskradar", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> RiskRadarResponse | None: - if response.status_code == 200: - response_200 = RiskRadarResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[RiskRadarResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: RiskRadarRequest, -) -> Response[RiskRadarResponse]: - """ - Args: - body (RiskRadarRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[RiskRadarResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: RiskRadarRequest, -) -> RiskRadarResponse | None: - """ - Args: - body (RiskRadarRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - RiskRadarResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: RiskRadarRequest, -) -> Response[RiskRadarResponse]: - """ - Args: - body (RiskRadarRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[RiskRadarResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: RiskRadarRequest, -) -> RiskRadarResponse | None: - """ - Args: - body (RiskRadarRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - RiskRadarResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/security_service/__init__.py b/openapi/openapi_project/openapi_package/api/security_service/__init__.py deleted file mode 100644 index dcbab9a7a..000000000 --- a/openapi/openapi_project/openapi_package/api/security_service/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/openapi/openapi_project/openapi_package/api/security_service/get_securities_exchanges.py b/openapi/openapi_project/openapi_package/api/security_service/get_securities_exchanges.py deleted file mode 100644 index 56c4e2fcc..000000000 --- a/openapi/openapi_project/openapi_package/api/security_service/get_securities_exchanges.py +++ /dev/null @@ -1,121 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.list_exchanges_response import ListExchangesResponse -from openapi_project.openapi_package.types import Response - - -def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/securities/exchanges", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ListExchangesResponse | None: - if response.status_code == 200: - response_200 = ListExchangesResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ListExchangesResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[ListExchangesResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListExchangesResponse] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, -) -> ListExchangesResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListExchangesResponse - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[ListExchangesResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListExchangesResponse] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, -) -> ListExchangesResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListExchangesResponse - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/security_service/post_securities_easytoborrowsecurities.py b/openapi/openapi_project/openapi_package/api/security_service/post_securities_easytoborrowsecurities.py deleted file mode 100644 index 1e4b01014..000000000 --- a/openapi/openapi_project/openapi_package/api/security_service/post_securities_easytoborrowsecurities.py +++ /dev/null @@ -1,156 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.list_easy_to_borrow_securities_request import ListEasyToBorrowSecuritiesRequest, - -from openapi_project.openapi_package.models.list_easy_to_borrow_securities_response import ListEasyToBorrowSecuritiesResponse, - -from openapi_project.openapi_package.types import Response - - -def _get_kwargs( - *, - body: ListEasyToBorrowSecuritiesRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/securities/easytoborrowsecurities", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ListEasyToBorrowSecuritiesResponse | None: - if response.status_code == 200: - response_200 = ListEasyToBorrowSecuritiesResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ListEasyToBorrowSecuritiesResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: ListEasyToBorrowSecuritiesRequest, -) -> Response[ListEasyToBorrowSecuritiesResponse]: - """ - Args: - body (ListEasyToBorrowSecuritiesRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListEasyToBorrowSecuritiesResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: ListEasyToBorrowSecuritiesRequest, -) -> ListEasyToBorrowSecuritiesResponse | None: - """ - Args: - body (ListEasyToBorrowSecuritiesRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListEasyToBorrowSecuritiesResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: ListEasyToBorrowSecuritiesRequest, -) -> Response[ListEasyToBorrowSecuritiesResponse]: - """ - Args: - body (ListEasyToBorrowSecuritiesRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListEasyToBorrowSecuritiesResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: ListEasyToBorrowSecuritiesRequest, -) -> ListEasyToBorrowSecuritiesResponse | None: - """ - Args: - body (ListEasyToBorrowSecuritiesRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListEasyToBorrowSecuritiesResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/security_service/post_securities_flexoption.py b/openapi/openapi_project/openapi_package/api/security_service/post_securities_flexoption.py deleted file mode 100644 index 3fb9c3902..000000000 --- a/openapi/openapi_project/openapi_package/api/security_service/post_securities_flexoption.py +++ /dev/null @@ -1,154 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.create_flex_option_request import CreateFlexOptionRequest -from openapi_project.openapi_package.models.create_flex_option_response import CreateFlexOptionResponse -from openapi_project.openapi_package.types import Response - - -def _get_kwargs( - *, - body: CreateFlexOptionRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/securities/flexoption", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CreateFlexOptionResponse | None: - if response.status_code == 200: - response_200 = CreateFlexOptionResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CreateFlexOptionResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateFlexOptionRequest, -) -> Response[CreateFlexOptionResponse]: - """ - Args: - body (CreateFlexOptionRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateFlexOptionResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CreateFlexOptionRequest, -) -> CreateFlexOptionResponse | None: - """ - Args: - body (CreateFlexOptionRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateFlexOptionResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateFlexOptionRequest, -) -> Response[CreateFlexOptionResponse]: - """ - Args: - body (CreateFlexOptionRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateFlexOptionResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CreateFlexOptionRequest, -) -> CreateFlexOptionResponse | None: - """ - Args: - body (CreateFlexOptionRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateFlexOptionResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/security_service/post_securities_optionchains.py b/openapi/openapi_project/openapi_package/api/security_service/post_securities_optionchains.py deleted file mode 100644 index 6e211c30e..000000000 --- a/openapi/openapi_project/openapi_package/api/security_service/post_securities_optionchains.py +++ /dev/null @@ -1,154 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.list_option_chains_repsonse import ListOptionChainsRepsonse -from openapi_project.openapi_package.models.list_option_chains_request import ListOptionChainsRequest -from openapi_project.openapi_package.types import Response - - -def _get_kwargs( - *, - body: ListOptionChainsRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/securities/optionchains", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ListOptionChainsRepsonse | None: - if response.status_code == 200: - response_200 = ListOptionChainsRepsonse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ListOptionChainsRepsonse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: ListOptionChainsRequest, -) -> Response[ListOptionChainsRepsonse]: - """ - Args: - body (ListOptionChainsRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListOptionChainsRepsonse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: ListOptionChainsRequest, -) -> ListOptionChainsRepsonse | None: - """ - Args: - body (ListOptionChainsRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListOptionChainsRepsonse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: ListOptionChainsRequest, -) -> Response[ListOptionChainsRepsonse]: - """ - Args: - body (ListOptionChainsRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListOptionChainsRepsonse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: ListOptionChainsRequest, -) -> ListOptionChainsRepsonse | None: - """ - Args: - body (ListOptionChainsRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListOptionChainsRepsonse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/security_service/post_securities_securities.py b/openapi/openapi_project/openapi_package/api/security_service/post_securities_securities.py deleted file mode 100644 index 6a86b0dc7..000000000 --- a/openapi/openapi_project/openapi_package/api/security_service/post_securities_securities.py +++ /dev/null @@ -1,154 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.list_securities_request import ListSecuritiesRequest -from openapi_project.openapi_package.models.list_securities_response import ListSecuritiesResponse -from openapi_project.openapi_package.types import Response - - -def _get_kwargs( - *, - body: ListSecuritiesRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/securities/securities", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ListSecuritiesResponse | None: - if response.status_code == 200: - response_200 = ListSecuritiesResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ListSecuritiesResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: ListSecuritiesRequest, -) -> Response[ListSecuritiesResponse]: - """ - Args: - body (ListSecuritiesRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListSecuritiesResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: ListSecuritiesRequest, -) -> ListSecuritiesResponse | None: - """ - Args: - body (ListSecuritiesRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListSecuritiesResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: ListSecuritiesRequest, -) -> Response[ListSecuritiesResponse]: - """ - Args: - body (ListSecuritiesRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListSecuritiesResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: ListSecuritiesRequest, -) -> ListSecuritiesResponse | None: - """ - Args: - body (ListSecuritiesRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListSecuritiesResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/user_data_service/__init__.py b/openapi/openapi_project/openapi_package/api/user_data_service/__init__.py deleted file mode 100644 index dcbab9a7a..000000000 --- a/openapi/openapi_project/openapi_package/api/user_data_service/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_accounts.py b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_accounts.py deleted file mode 100644 index 46cf576c8..000000000 --- a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_accounts.py +++ /dev/null @@ -1,121 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.list_accounts_response import ListAccountsResponse -from openapi_project.openapi_package.types import Response - - -def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/userdata/accounts", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ListAccountsResponse | None: - if response.status_code == 200: - response_200 = ListAccountsResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ListAccountsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[ListAccountsResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListAccountsResponse] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, -) -> ListAccountsResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListAccountsResponse - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[ListAccountsResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListAccountsResponse] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, -) -> ListAccountsResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListAccountsResponse - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_activeuser.py b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_activeuser.py deleted file mode 100644 index 1e505b464..000000000 --- a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_activeuser.py +++ /dev/null @@ -1,121 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.get_active_user_response import GetActiveUserResponse -from openapi_project.openapi_package.types import Response - - -def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/userdata/activeuser", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> GetActiveUserResponse | None: - if response.status_code == 200: - response_200 = GetActiveUserResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[GetActiveUserResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[GetActiveUserResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[GetActiveUserResponse] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, -) -> GetActiveUserResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - GetActiveUserResponse - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[GetActiveUserResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[GetActiveUserResponse] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, -) -> GetActiveUserResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - GetActiveUserResponse - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_affiliatedtradingfirms.py b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_affiliatedtradingfirms.py deleted file mode 100644 index 9f890e995..000000000 --- a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_affiliatedtradingfirms.py +++ /dev/null @@ -1,122 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.list_affiliated_trading_firms_response import ListAffiliatedTradingFirmsResponse, - -from openapi_project.openapi_package.types import Response - - -def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/userdata/affiliatedtradingfirms", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ListAffiliatedTradingFirmsResponse | None: - if response.status_code == 200: - response_200 = ListAffiliatedTradingFirmsResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ListAffiliatedTradingFirmsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[ListAffiliatedTradingFirmsResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListAffiliatedTradingFirmsResponse] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, -) -> ListAffiliatedTradingFirmsResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListAffiliatedTradingFirmsResponse - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[ListAffiliatedTradingFirmsResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListAffiliatedTradingFirmsResponse] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, -) -> ListAffiliatedTradingFirmsResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListAffiliatedTradingFirmsResponse - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_p2paccounts.py b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_p2paccounts.py deleted file mode 100644 index 8eabf87fe..000000000 --- a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_p2paccounts.py +++ /dev/null @@ -1,121 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.list_accounts_response import ListAccountsResponse -from openapi_project.openapi_package.types import Response - - -def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/userdata/p2paccounts", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ListAccountsResponse | None: - if response.status_code == 200: - response_200 = ListAccountsResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ListAccountsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[ListAccountsResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListAccountsResponse] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, -) -> ListAccountsResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListAccountsResponse - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[ListAccountsResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListAccountsResponse] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, -) -> ListAccountsResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListAccountsResponse - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_routes.py b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_routes.py deleted file mode 100644 index 5b9ae67aa..000000000 --- a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_routes.py +++ /dev/null @@ -1,121 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.list_routes_response import ListRoutesResponse -from openapi_project.openapi_package.types import Response - - -def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/userdata/routes", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ListRoutesResponse | None: - if response.status_code == 200: - response_200 = ListRoutesResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ListRoutesResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[ListRoutesResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListRoutesResponse] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, -) -> ListRoutesResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListRoutesResponse - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[ListRoutesResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListRoutesResponse] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, -) -> ListRoutesResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListRoutesResponse - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_tradingfirms.py b/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_tradingfirms.py deleted file mode 100644 index 96a0bbe69..000000000 --- a/openapi/openapi_project/openapi_package/api/user_data_service/get_userdata_tradingfirms.py +++ /dev/null @@ -1,121 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.list_trading_firms_response import ListTradingFirmsResponse -from openapi_project.openapi_package.types import Response - - -def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/userdata/tradingfirms", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ListTradingFirmsResponse | None: - if response.status_code == 200: - response_200 = ListTradingFirmsResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ListTradingFirmsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[ListTradingFirmsResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListTradingFirmsResponse] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, -) -> ListTradingFirmsResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListTradingFirmsResponse - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[ListTradingFirmsResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListTradingFirmsResponse] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, -) -> ListTradingFirmsResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListTradingFirmsResponse - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/utility_service/__init__.py b/openapi/openapi_project/openapi_package/api/utility_service/__init__.py deleted file mode 100644 index dcbab9a7a..000000000 --- a/openapi/openapi_project/openapi_package/api/utility_service/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/openapi/openapi_project/openapi_package/api/utility_service/get_utility_serverinfo.py b/openapi/openapi_project/openapi_package/api/utility_service/get_utility_serverinfo.py deleted file mode 100644 index 1a0ee34b1..000000000 --- a/openapi/openapi_project/openapi_package/api/utility_service/get_utility_serverinfo.py +++ /dev/null @@ -1,121 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.get_server_info_response import GetServerInfoResponse -from openapi_project.openapi_package.types import Response - - -def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/utility/serverinfo", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> GetServerInfoResponse | None: - if response.status_code == 200: - response_200 = GetServerInfoResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[GetServerInfoResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[GetServerInfoResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[GetServerInfoResponse] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, -) -> GetServerInfoResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - GetServerInfoResponse - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[GetServerInfoResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[GetServerInfoResponse] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, -) -> GetServerInfoResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - GetServerInfoResponse - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/utility_service/get_utility_servertime.py b/openapi/openapi_project/openapi_package/api/utility_service/get_utility_servertime.py deleted file mode 100644 index 7afb9513b..000000000 --- a/openapi/openapi_project/openapi_package/api/utility_service/get_utility_servertime.py +++ /dev/null @@ -1,121 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.get_server_time_response import GetServerTimeResponse -from openapi_project.openapi_package.types import Response - - -def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/utility/servertime", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> GetServerTimeResponse | None: - if response.status_code == 200: - response_200 = GetServerTimeResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[GetServerTimeResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[GetServerTimeResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[GetServerTimeResponse] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, -) -> GetServerTimeResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - GetServerTimeResponse - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[GetServerTimeResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[GetServerTimeResponse] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, -) -> GetServerTimeResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - GetServerTimeResponse - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/api/utility_service/get_utility_tradingholidays.py b/openapi/openapi_project/openapi_package/api/utility_service/get_utility_tradingholidays.py deleted file mode 100644 index 20e41ca98..000000000 --- a/openapi/openapi_project/openapi_package/api/utility_service/get_utility_tradingholidays.py +++ /dev/null @@ -1,121 +0,0 @@ -from http import HTTPStatus -from typing import Any - -import httpx - -from openapi_project.openapi_package import errors -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.models.get_trading_holidays_response import GetTradingHolidaysResponse -from openapi_project.openapi_package.types import Response - - -def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/utility/tradingholidays", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> GetTradingHolidaysResponse | None: - if response.status_code == 200: - response_200 = GetTradingHolidaysResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[GetTradingHolidaysResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[GetTradingHolidaysResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[GetTradingHolidaysResponse] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, -) -> GetTradingHolidaysResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - GetTradingHolidaysResponse - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[GetTradingHolidaysResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[GetTradingHolidaysResponse] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, -) -> GetTradingHolidaysResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - GetTradingHolidaysResponse - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/openapi/openapi_project/openapi_package/client.py b/openapi/openapi_project/openapi_package/client.py deleted file mode 100644 index 55aa3eb2c..000000000 --- a/openapi/openapi_project/openapi_package/client.py +++ /dev/null @@ -1,282 +0,0 @@ -import ssl -from typing import Any - -import httpx -from attrs import define, evolve, field - - -@define -class Client: - """A class for keeping track of data related to the API - - The following are accepted as keyword arguments and will be used to construct httpx Clients internally: - - ``base_url``: The base URL for the API, all requests are made to a relative path to this URL - - ``cookies``: A dictionary of cookies to be sent with every request - - ``headers``: A dictionary of headers to be sent with every request - - ``timeout``: The maximum amount of a time a request can take. API functions will raise - httpx.TimeoutException if this is exceeded. - - ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, - but can be set to False for testing purposes. - - ``follow_redirects``: Whether or not to follow redirects. Default value is False. - - ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. - - - Attributes: - raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a - status code that was not documented in the source OpenAPI document. Can also be provided as a keyword - argument to the constructor. - """ - - raise_on_unexpected_status: bool = field(default=False, kw_only=True) - _base_url: str = field(alias="base_url") - _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") - _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") - _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") - _verify_ssl: str | bool | ssl.SSLContext = field( - default=True, kw_only=True, alias="verify_ssl" - ) - _follow_redirects: bool = field( - default=False, kw_only=True, alias="follow_redirects" - ) - _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") - _client: httpx.Client | None = field(default=None, init=False) - _async_client: httpx.AsyncClient | None = field(default=None, init=False) - - def with_headers(self, headers: dict[str, str]) -> "Client": - """Get a new client matching this one with additional headers""" - if self._client is not None: - self._client.headers.update(headers) - if self._async_client is not None: - self._async_client.headers.update(headers) - return evolve(self, headers={**self._headers, **headers}) - - def with_cookies(self, cookies: dict[str, str]) -> "Client": - """Get a new client matching this one with additional cookies""" - if self._client is not None: - self._client.cookies.update(cookies) - if self._async_client is not None: - self._async_client.cookies.update(cookies) - return evolve(self, cookies={**self._cookies, **cookies}) - - def with_timeout(self, timeout: httpx.Timeout) -> "Client": - """Get a new client matching this one with a new timeout (in seconds)""" - if self._client is not None: - self._client.timeout = timeout - if self._async_client is not None: - self._async_client.timeout = timeout - return evolve(self, timeout=timeout) - - def set_httpx_client(self, client: httpx.Client) -> "Client": - """Manually set the underlying httpx.Client - - **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. - """ - self._client = client - return self - - def get_httpx_client(self) -> httpx.Client: - """Get the underlying httpx.Client, constructing a new one if not previously set""" - if self._client is None: - self._client = httpx.Client( - base_url=self._base_url, - cookies=self._cookies, - headers=self._headers, - timeout=self._timeout, - verify=self._verify_ssl, - follow_redirects=self._follow_redirects, - **self._httpx_args, - ) - return self._client - - def __enter__(self) -> "Client": - """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" - self.get_httpx_client().__enter__() - return self - - def __exit__(self, *args: Any, **kwargs: Any) -> None: - """Exit a context manager for internal httpx.Client (see httpx docs)""" - self.get_httpx_client().__exit__(*args, **kwargs) - - def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client": - """Manually the underlying httpx.AsyncClient - - **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. - """ - self._async_client = async_client - return self - - def get_async_httpx_client(self) -> httpx.AsyncClient: - """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" - if self._async_client is None: - self._async_client = httpx.AsyncClient( - base_url=self._base_url, - cookies=self._cookies, - headers=self._headers, - timeout=self._timeout, - verify=self._verify_ssl, - follow_redirects=self._follow_redirects, - **self._httpx_args, - ) - return self._async_client - - async def __aenter__(self) -> "Client": - """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" - await self.get_async_httpx_client().__aenter__() - return self - - async def __aexit__(self, *args: Any, **kwargs: Any) -> None: - """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" - await self.get_async_httpx_client().__aexit__(*args, **kwargs) - - -@define -class AuthenticatedClient: - """A Client which has been authenticated for use on secured endpoints - - The following are accepted as keyword arguments and will be used to construct httpx Clients internally: - - ``base_url``: The base URL for the API, all requests are made to a relative path to this URL - - ``cookies``: A dictionary of cookies to be sent with every request - - ``headers``: A dictionary of headers to be sent with every request - - ``timeout``: The maximum amount of a time a request can take. API functions will raise - httpx.TimeoutException if this is exceeded. - - ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, - but can be set to False for testing purposes. - - ``follow_redirects``: Whether or not to follow redirects. Default value is False. - - ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. - - - Attributes: - raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a - status code that was not documented in the source OpenAPI document. Can also be provided as a keyword - argument to the constructor. - token: The token to use for authentication - prefix: The prefix to use for the Authorization header - auth_header_name: The name of the Authorization header - """ - - raise_on_unexpected_status: bool = field(default=False, kw_only=True) - _base_url: str = field(alias="base_url") - _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") - _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") - _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") - _verify_ssl: str | bool | ssl.SSLContext = field( - default=True, kw_only=True, alias="verify_ssl" - ) - _follow_redirects: bool = field( - default=False, kw_only=True, alias="follow_redirects" - ) - _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") - _client: httpx.Client | None = field(default=None, init=False) - _async_client: httpx.AsyncClient | None = field(default=None, init=False) - - token: str - prefix: str = "Bearer" - auth_header_name: str = "Authorization" - - def with_headers(self, headers: dict[str, str]) -> "AuthenticatedClient": - """Get a new client matching this one with additional headers""" - if self._client is not None: - self._client.headers.update(headers) - if self._async_client is not None: - self._async_client.headers.update(headers) - return evolve(self, headers={**self._headers, **headers}) - - def with_cookies(self, cookies: dict[str, str]) -> "AuthenticatedClient": - """Get a new client matching this one with additional cookies""" - if self._client is not None: - self._client.cookies.update(cookies) - if self._async_client is not None: - self._async_client.cookies.update(cookies) - return evolve(self, cookies={**self._cookies, **cookies}) - - def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient": - """Get a new client matching this one with a new timeout (in seconds)""" - if self._client is not None: - self._client.timeout = timeout - if self._async_client is not None: - self._async_client.timeout = timeout - return evolve(self, timeout=timeout) - - def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient": - """Manually set the underlying httpx.Client - - **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. - """ - self._client = client - return self - - def get_httpx_client(self) -> httpx.Client: - """Get the underlying httpx.Client, constructing a new one if not previously set""" - if self._client is None: - self._headers[self.auth_header_name] = ( - f"{self.prefix} {self.token}" if self.prefix else self.token - ) - self._client = httpx.Client( - base_url=self._base_url, - cookies=self._cookies, - headers=self._headers, - timeout=self._timeout, - verify=self._verify_ssl, - follow_redirects=self._follow_redirects, - **self._httpx_args, - ) - return self._client - - def __enter__(self) -> "AuthenticatedClient": - """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" - self.get_httpx_client().__enter__() - return self - - def __exit__(self, *args: Any, **kwargs: Any) -> None: - """Exit a context manager for internal httpx.Client (see httpx docs)""" - self.get_httpx_client().__exit__(*args, **kwargs) - - def set_async_httpx_client( - self, async_client: httpx.AsyncClient - ) -> "AuthenticatedClient": - """Manually the underlying httpx.AsyncClient - - **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. - """ - self._async_client = async_client - return self - - def get_async_httpx_client(self) -> httpx.AsyncClient: - """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" - if self._async_client is None: - self._headers[self.auth_header_name] = ( - f"{self.prefix} {self.token}" if self.prefix else self.token - ) - self._async_client = httpx.AsyncClient( - base_url=self._base_url, - cookies=self._cookies, - headers=self._headers, - timeout=self._timeout, - verify=self._verify_ssl, - follow_redirects=self._follow_redirects, - **self._httpx_args, - ) - return self._async_client - - async def __aenter__(self) -> "AuthenticatedClient": - """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" - await self.get_async_httpx_client().__aenter__() - return self - - async def __aexit__(self, *args: Any, **kwargs: Any) -> None: - """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" - await self.get_async_httpx_client().__aexit__(*args, **kwargs) diff --git a/openapi/openapi_project/openapi_package/errors.py b/openapi/openapi_project/openapi_package/errors.py deleted file mode 100644 index 9bf275435..000000000 --- a/openapi/openapi_project/openapi_package/errors.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Contains shared errors types that can be raised from API functions""" - - -class UnexpectedStatus(Exception): - """Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True""" - - def __init__(self, status_code: int, content: bytes): - self.status_code = status_code - self.content = content - - super().__init__( - f"Unexpected status code: {status_code}\n\nResponse content:\n{content.decode(errors='ignore')}" - ) - - -__all__ = ["UnexpectedStatus"] diff --git a/openapi/openapi_project/openapi_package/models/__init__.py b/openapi/openapi_project/openapi_package/models/__init__.py deleted file mode 100644 index 8b56c7530..000000000 --- a/openapi/openapi_project/openapi_package/models/__init__.py +++ /dev/null @@ -1,525 +0,0 @@ -"""Contains all the data models used in inputs/outputs""" - -from openapi_project.openapi_package.models.account import Account -from openapi_project.openapi_package.models.account_script import AccountScript -from openapi_project.openapi_package.models.account_status import AccountStatus -from openapi_project.openapi_package.models.account_type import AccountType -from openapi_project.openapi_package.models.analyze_position_item import AnalyzePositionItem -from openapi_project.openapi_package.models.analyze_positions_request import AnalyzePositionsRequest -from openapi_project.openapi_package.models.analyze_positions_response import AnalyzePositionsResponse -from openapi_project.openapi_package.models.any_model import AnyModel -from openapi_project.openapi_package.models.calculate_margin_request import CalculateMarginRequest -from openapi_project.openapi_package.models.calculate_margin_request_position import CalculateMarginRequestPosition -from openapi_project.openapi_package.models.calculate_margin_request_position_list import CalculateMarginRequestPositionList -from openapi_project.openapi_package.models.calculate_margin_response import CalculateMarginResponse -from openapi_project.openapi_package.models.cancel_order_request import CancelOrderRequest -from openapi_project.openapi_package.models.cancel_order_request_optional_data import CancelOrderRequestOptionalData -from openapi_project.openapi_package.models.cancel_order_response import CancelOrderResponse -from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request import CancelReplaceMultiLegOrderRequest -from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_algo import CancelReplaceMultiLegOrderRequestAlgo, - -from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_market_condition import CancelReplaceMultiLegOrderRequestMarketCondition, - -from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_optional_data import CancelReplaceMultiLegOrderRequestOptionalData, - -from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_response import CancelReplaceMultiLegOrderResponse -from openapi_project.openapi_package.models.cancel_replace_order_request import CancelReplaceOrderRequest -from openapi_project.openapi_package.models.cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo -from openapi_project.openapi_package.models.cancel_replace_order_request_market_condition import CancelReplaceOrderRequestMarketCondition, - -from openapi_project.openapi_package.models.cancel_replace_order_request_optional_data import CancelReplaceOrderRequestOptionalData, - -from openapi_project.openapi_package.models.cancel_replace_order_response import CancelReplaceOrderResponse -from openapi_project.openapi_package.models.capacity_code import CapacityCode -from openapi_project.openapi_package.models.claim_type import ClaimType -from openapi_project.openapi_package.models.clearing_info import ClearingInfo -from openapi_project.openapi_package.models.clearing_range import ClearingRange -from openapi_project.openapi_package.models.country import Country -from openapi_project.openapi_package.models.create_flex_option_request import CreateFlexOptionRequest -from openapi_project.openapi_package.models.create_flex_option_response import CreateFlexOptionResponse -from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation import CreateMultiLegOrderCrossAllocation -from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation_optional_data import CreateMultiLegOrderCrossAllocationOptionalData, - -from openapi_project.openapi_package.models.create_multi_leg_order_cross_request import CreateMultiLegOrderCrossRequest -from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_algo import CreateMultiLegOrderCrossRequestAlgo, - -from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_market_condition import CreateMultiLegOrderCrossRequestMarketCondition, - -from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_optional_data import CreateMultiLegOrderCrossRequestOptionalData, - -from openapi_project.openapi_package.models.create_multi_leg_order_cross_response import CreateMultiLegOrderCrossResponse -from openapi_project.openapi_package.models.create_multi_leg_order_leg import CreateMultiLegOrderLeg -from openapi_project.openapi_package.models.create_multi_leg_order_leg_market_condition import CreateMultiLegOrderLegMarketCondition, - -from openapi_project.openapi_package.models.create_multi_leg_order_leg_optional_data import CreateMultiLegOrderLegOptionalData -from openapi_project.openapi_package.models.create_multi_leg_order_request import CreateMultiLegOrderRequest -from openapi_project.openapi_package.models.create_multi_leg_order_request_algo import CreateMultiLegOrderRequestAlgo -from openapi_project.openapi_package.models.create_multi_leg_order_request_market_condition import CreateMultiLegOrderRequestMarketCondition, - -from openapi_project.openapi_package.models.create_multi_leg_order_request_optional_data import CreateMultiLegOrderRequestOptionalData, - -from openapi_project.openapi_package.models.create_multi_leg_order_response import CreateMultiLegOrderResponse -from openapi_project.openapi_package.models.create_order_cross_allocation import CreateOrderCrossAllocation -from openapi_project.openapi_package.models.create_order_cross_allocation_optional_data import CreateOrderCrossAllocationOptionalData, - -from openapi_project.openapi_package.models.create_order_cross_request import CreateOrderCrossRequest -from openapi_project.openapi_package.models.create_order_cross_request_algo import CreateOrderCrossRequestAlgo -from openapi_project.openapi_package.models.create_order_cross_request_market_condition import CreateOrderCrossRequestMarketCondition, - -from openapi_project.openapi_package.models.create_order_cross_request_optional_data import CreateOrderCrossRequestOptionalData, - -from openapi_project.openapi_package.models.create_order_cross_response import CreateOrderCrossResponse -from openapi_project.openapi_package.models.create_order_request import CreateOrderRequest -from openapi_project.openapi_package.models.create_order_request_algo import CreateOrderRequestAlgo -from openapi_project.openapi_package.models.create_order_request_market_condition import CreateOrderRequestMarketCondition -from openapi_project.openapi_package.models.create_order_request_optional_data import CreateOrderRequestOptionalData -from openapi_project.openapi_package.models.create_order_response import CreateOrderResponse -from openapi_project.openapi_package.models.cross_side_type import CrossSideType -from openapi_project.openapi_package.models.cross_type import CrossType -from openapi_project.openapi_package.models.crypto import Crypto -from openapi_project.openapi_package.models.crypto_aliases import CryptoAliases -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.models.cxl_rej_response_to import CxlRejResponseTo -from openapi_project.openapi_package.models.date import Date -from openapi_project.openapi_package.models.easy_to_borrow_security import EasyToBorrowSecurity -from openapi_project.openapi_package.models.empty import Empty -from openapi_project.openapi_package.models.exchange import Exchange -from openapi_project.openapi_package.models.exchange_code import ExchangeCode -from openapi_project.openapi_package.models.exec_type import ExecType -from openapi_project.openapi_package.models.execution import Execution -from openapi_project.openapi_package.models.execution_algo import ExecutionAlgo -from openapi_project.openapi_package.models.execution_optional_data import ExecutionOptionalData -from openapi_project.openapi_package.models.flex_option import FlexOption -from openapi_project.openapi_package.models.flex_option_aliases import FlexOptionAliases -from openapi_project.openapi_package.models.flex_settlement_type import FlexSettlementType -from openapi_project.openapi_package.models.future import Future -from openapi_project.openapi_package.models.future_aliases import FutureAliases -from openapi_project.openapi_package.models.future_root import FutureRoot -from openapi_project.openapi_package.models.future_root_aliases import FutureRootAliases -from openapi_project.openapi_package.models.future_spread import FutureSpread -from openapi_project.openapi_package.models.future_spread_aliases import FutureSpreadAliases -from openapi_project.openapi_package.models.future_spread_leg import FutureSpreadLeg -from openapi_project.openapi_package.models.fx import Fx -from openapi_project.openapi_package.models.fx_aliases import FxAliases -from openapi_project.openapi_package.models.generic_order import GenericOrder -from openapi_project.openapi_package.models.get_active_user_response import GetActiveUserResponse -from openapi_project.openapi_package.models.get_server_info_response import GetServerInfoResponse -from openapi_project.openapi_package.models.get_server_info_response_system_settings import GetServerInfoResponseSystemSettings, - -from openapi_project.openapi_package.models.get_server_time_response import GetServerTimeResponse -from openapi_project.openapi_package.models.get_trading_holidays_response import GetTradingHolidaysResponse -from openapi_project.openapi_package.models.header import Header -from openapi_project.openapi_package.models.index import Index -from openapi_project.openapi_package.models.index_aliases import IndexAliases -from openapi_project.openapi_package.models.list_accounts_response import ListAccountsResponse -from openapi_project.openapi_package.models.list_affiliated_trading_firms_response import ListAffiliatedTradingFirmsResponse -from openapi_project.openapi_package.models.list_easy_to_borrow_securities_request import ListEasyToBorrowSecuritiesRequest -from openapi_project.openapi_package.models.list_easy_to_borrow_securities_response import ListEasyToBorrowSecuritiesResponse -from openapi_project.openapi_package.models.list_exchanges_response import ListExchangesResponse -from openapi_project.openapi_package.models.list_option_chains_repsonse import ListOptionChainsRepsonse -from openapi_project.openapi_package.models.list_option_chains_request import ListOptionChainsRequest -from openapi_project.openapi_package.models.list_orders_response import ListOrdersResponse -from openapi_project.openapi_package.models.list_positions_response import ListPositionsResponse -from openapi_project.openapi_package.models.list_routes_response import ListRoutesResponse -from openapi_project.openapi_package.models.list_securities_request import ListSecuritiesRequest -from openapi_project.openapi_package.models.list_securities_response import ListSecuritiesResponse -from openapi_project.openapi_package.models.list_trade_confirms_response import ListTradeConfirmsResponse -from openapi_project.openapi_package.models.list_trading_firms_response import ListTradingFirmsResponse -from openapi_project.openapi_package.models.login_request import LoginRequest -from openapi_project.openapi_package.models.login_response import LoginResponse -from openapi_project.openapi_package.models.login_response_system_settings import LoginResponseSystemSettings -from openapi_project.openapi_package.models.login_status import LoginStatus -from openapi_project.openapi_package.models.margin_data import MarginData -from openapi_project.openapi_package.models.margin_data_type import MarginDataType -from openapi_project.openapi_package.models.multi_leg_order import MultiLegOrder -from openapi_project.openapi_package.models.multi_leg_order_algo import MultiLegOrderAlgo -from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request import MultiLegOrderCancelReplaceRequest -from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_algo import MultiLegOrderCancelReplaceRequestAlgo, - -from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_market_condition import MultiLegOrderCancelReplaceRequestMarketCondition, - -from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_optional_data import MultiLegOrderCancelReplaceRequestOptionalData, - -from openapi_project.openapi_package.models.multi_leg_order_cross import MultiLegOrderCross -from openapi_project.openapi_package.models.multi_leg_order_cross_algo import MultiLegOrderCrossAlgo -from openapi_project.openapi_package.models.multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation -from openapi_project.openapi_package.models.multi_leg_order_cross_allocation_optional_data import MultiLegOrderCrossAllocationOptionalData, - -from openapi_project.openapi_package.models.multi_leg_order_cross_market_condition import MultiLegOrderCrossMarketCondition -from openapi_project.openapi_package.models.multi_leg_order_cross_optional_data import MultiLegOrderCrossOptionalData -from openapi_project.openapi_package.models.multi_leg_order_leg import MultiLegOrderLeg -from openapi_project.openapi_package.models.multi_leg_order_leg_market_condition import MultiLegOrderLegMarketCondition -from openapi_project.openapi_package.models.multi_leg_order_leg_optional_data import MultiLegOrderLegOptionalData -from openapi_project.openapi_package.models.multi_leg_order_market_condition import MultiLegOrderMarketCondition -from openapi_project.openapi_package.models.multi_leg_order_optional_data import MultiLegOrderOptionalData -from openapi_project.openapi_package.models.multi_leg_reporting_type import MultiLegReportingType -from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat -from openapi_project.openapi_package.models.option import Option -from openapi_project.openapi_package.models.option_aliases import OptionAliases -from openapi_project.openapi_package.models.option_chain import OptionChain -from openapi_project.openapi_package.models.option_chain_option import OptionChainOption -from openapi_project.openapi_package.models.option_chain_option_aliases import OptionChainOptionAliases -from openapi_project.openapi_package.models.option_chain_options import OptionChainOptions -from openapi_project.openapi_package.models.option_chain_roots import OptionChainRoots -from openapi_project.openapi_package.models.option_exercise_style import OptionExerciseStyle -from openapi_project.openapi_package.models.option_expiration_style import OptionExpirationStyle -from openapi_project.openapi_package.models.option_root import OptionRoot -from openapi_project.openapi_package.models.option_root_aliases import OptionRootAliases -from openapi_project.openapi_package.models.option_series import OptionSeries -from openapi_project.openapi_package.models.option_series_product_type import OptionSeriesProductType -from openapi_project.openapi_package.models.option_series_type import OptionSeriesType -from openapi_project.openapi_package.models.option_settlement_type import OptionSettlementType -from openapi_project.openapi_package.models.ord_status import OrdStatus -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.order import Order -from openapi_project.openapi_package.models.order_algo import OrderAlgo -from openapi_project.openapi_package.models.order_cancel_reject import OrderCancelReject -from openapi_project.openapi_package.models.order_cancel_reject_optional_data import OrderCancelRejectOptionalData -from openapi_project.openapi_package.models.order_cancel_replace_request import OrderCancelReplaceRequest -from openapi_project.openapi_package.models.order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo -from openapi_project.openapi_package.models.order_cancel_replace_request_market_condition import OrderCancelReplaceRequestMarketCondition, - -from openapi_project.openapi_package.models.order_cancel_replace_request_optional_data import OrderCancelReplaceRequestOptionalData, - -from openapi_project.openapi_package.models.order_cancel_request import OrderCancelRequest -from openapi_project.openapi_package.models.order_cancel_request_optional_data import OrderCancelRequestOptionalData -from openapi_project.openapi_package.models.order_cross import OrderCross -from openapi_project.openapi_package.models.order_cross_algo import OrderCrossAlgo -from openapi_project.openapi_package.models.order_cross_allocation import OrderCrossAllocation -from openapi_project.openapi_package.models.order_cross_allocation_optional_data import OrderCrossAllocationOptionalData -from openapi_project.openapi_package.models.order_cross_market_condition import OrderCrossMarketCondition -from openapi_project.openapi_package.models.order_cross_optional_data import OrderCrossOptionalData -from openapi_project.openapi_package.models.order_delete import OrderDelete -from openapi_project.openapi_package.models.order_delete_optional_data import OrderDeleteOptionalData -from openapi_project.openapi_package.models.order_instruction import OrderInstruction -from openapi_project.openapi_package.models.order_instruction_type import OrderInstructionType -from openapi_project.openapi_package.models.order_market_condition import OrderMarketCondition -from openapi_project.openapi_package.models.order_optional_data import OrderOptionalData -from openapi_project.openapi_package.models.order_type import OrderType -from openapi_project.openapi_package.models.order_update import OrderUpdate -from openapi_project.openapi_package.models.order_update_algo import OrderUpdateAlgo -from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent -from openapi_project.openapi_package.models.order_update_optional_data import OrderUpdateOptionalData -from openapi_project.openapi_package.models.origination_type import OriginationType -from openapi_project.openapi_package.models.position import Position -from openapi_project.openapi_package.models.position_analysis import PositionAnalysis -from openapi_project.openapi_package.models.position_effect import PositionEffect -from openapi_project.openapi_package.models.position_source import PositionSource -from openapi_project.openapi_package.models.position_theo import PositionTheo -from openapi_project.openapi_package.models.position_theo_leg import PositionTheoLeg -from openapi_project.openapi_package.models.price_type import PriceType -from openapi_project.openapi_package.models.product_group import ProductGroup -from openapi_project.openapi_package.models.product_sub_group import ProductSubGroup -from openapi_project.openapi_package.models.put_call import PutCall -from openapi_project.openapi_package.models.risk_calculation_type import RiskCalculationType -from openapi_project.openapi_package.models.risk_eval_mode import RiskEvalMode -from openapi_project.openapi_package.models.risk_radar_account_group import RiskRadarAccountGroup -from openapi_project.openapi_package.models.risk_radar_class_group import RiskRadarClassGroup -from openapi_project.openapi_package.models.risk_radar_data import RiskRadarData -from openapi_project.openapi_package.models.risk_radar_position import RiskRadarPosition -from openapi_project.openapi_package.models.risk_radar_product_group import RiskRadarProductGroup -from openapi_project.openapi_package.models.risk_radar_request import RiskRadarRequest -from openapi_project.openapi_package.models.risk_radar_request_position import RiskRadarRequestPosition -from openapi_project.openapi_package.models.risk_radar_request_position_list import RiskRadarRequestPositionList -from openapi_project.openapi_package.models.risk_radar_response import RiskRadarResponse -from openapi_project.openapi_package.models.risk_radar_scenario_order import RiskRadarScenarioOrder -from openapi_project.openapi_package.models.risk_reject import RiskReject -from openapi_project.openapi_package.models.risk_reject_type import RiskRejectType -from openapi_project.openapi_package.models.route import Route -from openapi_project.openapi_package.models.route_applicability import RouteApplicability -from openapi_project.openapi_package.models.route_property import RouteProperty -from openapi_project.openapi_package.models.route_property_type import RoutePropertyType -from openapi_project.openapi_package.models.route_type import RouteType -from openapi_project.openapi_package.models.routing_session_group import RoutingSessionGroup -from openapi_project.openapi_package.models.routing_session_group_type import RoutingSessionGroupType -from openapi_project.openapi_package.models.scenario import Scenario -from openapi_project.openapi_package.models.scenario_leg import ScenarioLeg -from openapi_project.openapi_package.models.scenario_position import ScenarioPosition -from openapi_project.openapi_package.models.scenario_theo import ScenarioTheo -from openapi_project.openapi_package.models.search_order_history_response import SearchOrderHistoryResponse -from openapi_project.openapi_package.models.security import Security -from openapi_project.openapi_package.models.security_category import SecurityCategory -from openapi_project.openapi_package.models.security_type import SecurityType -from openapi_project.openapi_package.models.settlement_deliverable_type import SettlementDeliverableType -from openapi_project.openapi_package.models.settlement_info import SettlementInfo -from openapi_project.openapi_package.models.shock_value import ShockValue -from openapi_project.openapi_package.models.shock_value_flags import ShockValueFlags -from openapi_project.openapi_package.models.side import Side -from openapi_project.openapi_package.models.spread_leg_side import SpreadLegSide -from openapi_project.openapi_package.models.spread_leg_type import SpreadLegType -from openapi_project.openapi_package.models.status import Status -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.models.stock import Stock -from openapi_project.openapi_package.models.stock_aliases import StockAliases -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.models.time_of_day import TimeOfDay -from openapi_project.openapi_package.models.tims_class_group import TimsClassGroup -from openapi_project.openapi_package.models.tims_margin_data import TimsMarginData -from openapi_project.openapi_package.models.tims_position_group import TimsPositionGroup -from openapi_project.openapi_package.models.tims_product_group import TimsProductGroup -from openapi_project.openapi_package.models.trade_confirm import TradeConfirm -from openapi_project.openapi_package.models.trading_firm import TradingFirm -from openapi_project.openapi_package.models.trading_firm_slim import TradingFirmSlim -from openapi_project.openapi_package.models.trading_holiday import TradingHoliday -from openapi_project.openapi_package.models.trading_session import TradingSession -from openapi_project.openapi_package.models.trading_session_group import TradingSessionGroup -from openapi_project.openapi_package.models.user import User -from openapi_project.openapi_package.models.user_location import UserLocation -from openapi_project.openapi_package.models.user_permission import UserPermission -from openapi_project.openapi_package.models.user_status import UserStatus -from openapi_project.openapi_package.models.user_type import UserType -from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse -from openapi_project.openapi_package.models.volatility_shock_skew import VolatilityShockSkew -from openapi_project.openapi_package.models.volatility_shock_type import VolatilityShockType - -__all__ = ( - "Account", - "AccountScript", - "AccountStatus", - "AccountType", - "AnalyzePositionItem", - "AnalyzePositionsRequest", - "AnalyzePositionsResponse", - "AnyModel", - "CalculateMarginRequest", - "CalculateMarginRequestPosition", - "CalculateMarginRequestPositionList", - "CalculateMarginResponse", - "CancelOrderRequest", - "CancelOrderRequestOptionalData", - "CancelOrderResponse", - "CancelReplaceMultiLegOrderRequest", - "CancelReplaceMultiLegOrderRequestAlgo", - "CancelReplaceMultiLegOrderRequestMarketCondition", - "CancelReplaceMultiLegOrderRequestOptionalData", - "CancelReplaceMultiLegOrderResponse", - "CancelReplaceOrderRequest", - "CancelReplaceOrderRequestAlgo", - "CancelReplaceOrderRequestMarketCondition", - "CancelReplaceOrderRequestOptionalData", - "CancelReplaceOrderResponse", - "CapacityCode", - "ClaimType", - "ClearingInfo", - "ClearingRange", - "Country", - "CreateFlexOptionRequest", - "CreateFlexOptionResponse", - "CreateMultiLegOrderCrossAllocation", - "CreateMultiLegOrderCrossAllocationOptionalData", - "CreateMultiLegOrderCrossRequest", - "CreateMultiLegOrderCrossRequestAlgo", - "CreateMultiLegOrderCrossRequestMarketCondition", - "CreateMultiLegOrderCrossRequestOptionalData", - "CreateMultiLegOrderCrossResponse", - "CreateMultiLegOrderLeg", - "CreateMultiLegOrderLegMarketCondition", - "CreateMultiLegOrderLegOptionalData", - "CreateMultiLegOrderRequest", - "CreateMultiLegOrderRequestAlgo", - "CreateMultiLegOrderRequestMarketCondition", - "CreateMultiLegOrderRequestOptionalData", - "CreateMultiLegOrderResponse", - "CreateOrderCrossAllocation", - "CreateOrderCrossAllocationOptionalData", - "CreateOrderCrossRequest", - "CreateOrderCrossRequestAlgo", - "CreateOrderCrossRequestMarketCondition", - "CreateOrderCrossRequestOptionalData", - "CreateOrderCrossResponse", - "CreateOrderRequest", - "CreateOrderRequestAlgo", - "CreateOrderRequestMarketCondition", - "CreateOrderRequestOptionalData", - "CreateOrderResponse", - "CrossSideType", - "CrossType", - "Crypto", - "CryptoAliases", - "Currency", - "CxlRejResponseTo", - "Date", - "EasyToBorrowSecurity", - "Empty", - "Exchange", - "ExchangeCode", - "ExecType", - "Execution", - "ExecutionAlgo", - "ExecutionOptionalData", - "FlexOption", - "FlexOptionAliases", - "FlexSettlementType", - "Future", - "FutureAliases", - "FutureRoot", - "FutureRootAliases", - "FutureSpread", - "FutureSpreadAliases", - "FutureSpreadLeg", - "Fx", - "FxAliases", - "GenericOrder", - "GetActiveUserResponse", - "GetServerInfoResponse", - "GetServerInfoResponseSystemSettings", - "GetServerTimeResponse", - "GetTradingHolidaysResponse", - "Header", - "Index", - "IndexAliases", - "ListAccountsResponse", - "ListAffiliatedTradingFirmsResponse", - "ListEasyToBorrowSecuritiesRequest", - "ListEasyToBorrowSecuritiesResponse", - "ListExchangesResponse", - "ListOptionChainsRepsonse", - "ListOptionChainsRequest", - "ListOrdersResponse", - "ListPositionsResponse", - "ListRoutesResponse", - "ListSecuritiesRequest", - "ListSecuritiesResponse", - "ListTradeConfirmsResponse", - "ListTradingFirmsResponse", - "LoginRequest", - "LoginResponse", - "LoginResponseSystemSettings", - "LoginStatus", - "MarginData", - "MarginDataType", - "MultiLegOrder", - "MultiLegOrderAlgo", - "MultiLegOrderCancelReplaceRequest", - "MultiLegOrderCancelReplaceRequestAlgo", - "MultiLegOrderCancelReplaceRequestMarketCondition", - "MultiLegOrderCancelReplaceRequestOptionalData", - "MultiLegOrderCross", - "MultiLegOrderCrossAlgo", - "MultiLegOrderCrossAllocation", - "MultiLegOrderCrossAllocationOptionalData", - "MultiLegOrderCrossMarketCondition", - "MultiLegOrderCrossOptionalData", - "MultiLegOrderLeg", - "MultiLegOrderLegMarketCondition", - "MultiLegOrderLegOptionalData", - "MultiLegOrderMarketCondition", - "MultiLegOrderOptionalData", - "MultiLegReportingType", - "NumericDisplayFormat", - "Option", - "OptionAliases", - "OptionChain", - "OptionChainOption", - "OptionChainOptionAliases", - "OptionChainOptions", - "OptionChainRoots", - "OptionExerciseStyle", - "OptionExpirationStyle", - "OptionRoot", - "OptionRootAliases", - "OptionSeries", - "OptionSeriesProductType", - "OptionSeriesType", - "OptionSettlementType", - "Order", - "OrderAlgo", - "OrderCancelReject", - "OrderCancelRejectOptionalData", - "OrderCancelReplaceRequest", - "OrderCancelReplaceRequestAlgo", - "OrderCancelReplaceRequestMarketCondition", - "OrderCancelReplaceRequestOptionalData", - "OrderCancelRequest", - "OrderCancelRequestOptionalData", - "OrderCross", - "OrderCrossAlgo", - "OrderCrossAllocation", - "OrderCrossAllocationOptionalData", - "OrderCrossMarketCondition", - "OrderCrossOptionalData", - "OrderDelete", - "OrderDeleteOptionalData", - "OrderInstruction", - "OrderInstructionType", - "OrderMarketCondition", - "OrderOptionalData", - "OrderType", - "OrderUpdate", - "OrderUpdateAlgo", - "OrderUpdateEvent", - "OrderUpdateOptionalData", - "OrdStatus", - "OrdType", - "OriginationType", - "Position", - "PositionAnalysis", - "PositionEffect", - "PositionSource", - "PositionTheo", - "PositionTheoLeg", - "PriceType", - "ProductGroup", - "ProductSubGroup", - "PutCall", - "RiskCalculationType", - "RiskEvalMode", - "RiskRadarAccountGroup", - "RiskRadarClassGroup", - "RiskRadarData", - "RiskRadarPosition", - "RiskRadarProductGroup", - "RiskRadarRequest", - "RiskRadarRequestPosition", - "RiskRadarRequestPositionList", - "RiskRadarResponse", - "RiskRadarScenarioOrder", - "RiskReject", - "RiskRejectType", - "Route", - "RouteApplicability", - "RouteProperty", - "RoutePropertyType", - "RouteType", - "RoutingSessionGroup", - "RoutingSessionGroupType", - "Scenario", - "ScenarioLeg", - "ScenarioPosition", - "ScenarioTheo", - "SearchOrderHistoryResponse", - "Security", - "SecurityCategory", - "SecurityType", - "SettlementDeliverableType", - "SettlementInfo", - "ShockValue", - "ShockValueFlags", - "Side", - "SpreadLegSide", - "SpreadLegType", - "Status", - "StatusCode", - "Stock", - "StockAliases", - "Tif", - "TimeOfDay", - "TimsClassGroup", - "TimsMarginData", - "TimsPositionGroup", - "TimsProductGroup", - "TradeConfirm", - "TradingFirm", - "TradingFirmSlim", - "TradingHoliday", - "TradingSession", - "TradingSessionGroup", - "User", - "UserLocation", - "UserPermission", - "UserStatus", - "UserType", - "ValidateRiskResponse", - "VolatilityShockSkew", - "VolatilityShockType", -) diff --git a/openapi/openapi_project/openapi_package/models/account.py b/openapi/openapi_project/openapi_package/models/account.py deleted file mode 100644 index c57a49650..000000000 --- a/openapi/openapi_project/openapi_package/models/account.py +++ /dev/null @@ -1,371 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.account_status import AccountStatus -from openapi_project.openapi_package.models.account_type import AccountType -from openapi_project.openapi_package.models.capacity_code import CapacityCode -from openapi_project.openapi_package.models.clearing_range import ClearingRange -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.account_script import AccountScript - from openapi_project.openapi_package.models.routing_session_group import RoutingSessionGroup - - -T = TypeVar("T", bound="Account") - - -@_attrs_define -class Account: - """ - Attributes: - id (Union[Unset, int]): - billing_code (Union[Unset, str]): - cti_code (Union[Unset, str]): - currency (Union[Unset, Currency]): - equities_capacity (Union[Unset, CapacityCode]): - equities_give_up (Union[Unset, str]): - equities_mpid (Union[Unset, str]): - futures_clearing_account (Union[Unset, str]): - futures_clearing_range (Union[Unset, ClearingRange]): - futures_cmta (Union[Unset, str]): - futures_execution_broker (Union[Unset, str]): - name (Union[Unset, str]): - occ_actionable_id (Union[Unset, str]): - options_clearing_account (Union[Unset, str]): - options_clearing_range (Union[Unset, ClearingRange]): - options_cmta (Union[Unset, str]): - options_efid (Union[Unset, str]): - options_give_up (Union[Unset, str]): - routing_session_groups (Union[Unset, list['RoutingSessionGroup']]): - status (Union[Unset, AccountStatus]): - tag1 (Union[Unset, str]): - trading_firm_id (Union[Unset, int]): - type_ (Union[Unset, AccountType]): - created_ts (Union[Unset, str]): - optional_data (Union[Unset, str]): - position_script (Union[Unset, AccountScript]): - buying_power_script (Union[Unset, AccountScript]): - clearing_script (Union[Unset, AccountScript]): - """ - - id: Unset | int = UNSET - billing_code: Unset | str = UNSET - cti_code: Unset | str = UNSET - currency: Unset | Currency = UNSET - equities_capacity: Unset | CapacityCode = UNSET - equities_give_up: Unset | str = UNSET - equities_mpid: Unset | str = UNSET - futures_clearing_account: Unset | str = UNSET - futures_clearing_range: Unset | ClearingRange = UNSET - futures_cmta: Unset | str = UNSET - futures_execution_broker: Unset | str = UNSET - name: Unset | str = UNSET - occ_actionable_id: Unset | str = UNSET - options_clearing_account: Unset | str = UNSET - options_clearing_range: Unset | ClearingRange = UNSET - options_cmta: Unset | str = UNSET - options_efid: Unset | str = UNSET - options_give_up: Unset | str = UNSET - routing_session_groups: Unset | list["RoutingSessionGroup"] = UNSET - status: Unset | AccountStatus = UNSET - tag1: Unset | str = UNSET - trading_firm_id: Unset | int = UNSET - type_: Unset | AccountType = UNSET - created_ts: Unset | str = UNSET - optional_data: Unset | str = UNSET - position_script: Union[Unset, "AccountScript"] = UNSET - buying_power_script: Union[Unset, "AccountScript"] = UNSET - clearing_script: Union[Unset, "AccountScript"] = UNSET - - def to_dict(self) -> dict[str, Any]: - id = self.id - - billing_code = self.billing_code - - cti_code = self.cti_code - - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value - - equities_capacity: Unset | str = UNSET - if not isinstance(self.equities_capacity, Unset): - equities_capacity = self.equities_capacity.value - - equities_give_up = self.equities_give_up - - equities_mpid = self.equities_mpid - - futures_clearing_account = self.futures_clearing_account - - futures_clearing_range: Unset | str = UNSET - if not isinstance(self.futures_clearing_range, Unset): - futures_clearing_range = self.futures_clearing_range.value - - futures_cmta = self.futures_cmta - - futures_execution_broker = self.futures_execution_broker - - name = self.name - - occ_actionable_id = self.occ_actionable_id - - options_clearing_account = self.options_clearing_account - - options_clearing_range: Unset | str = UNSET - if not isinstance(self.options_clearing_range, Unset): - options_clearing_range = self.options_clearing_range.value - - options_cmta = self.options_cmta - - options_efid = self.options_efid - - options_give_up = self.options_give_up - - routing_session_groups: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.routing_session_groups, Unset): - routing_session_groups = [] - for routing_session_groups_item_data in self.routing_session_groups: - routing_session_groups_item = routing_session_groups_item_data.to_dict() - routing_session_groups.append(routing_session_groups_item) - - status: Unset | str = UNSET - if not isinstance(self.status, Unset): - status = self.status.value - - tag1 = self.tag1 - - trading_firm_id = self.trading_firm_id - - type_: Unset | str = UNSET - if not isinstance(self.type_, Unset): - type_ = self.type_.value - - created_ts = self.created_ts - - optional_data = self.optional_data - - position_script: Unset | dict[str, Any] = UNSET - if not isinstance(self.position_script, Unset): - position_script = self.position_script.to_dict() - - buying_power_script: Unset | dict[str, Any] = UNSET - if not isinstance(self.buying_power_script, Unset): - buying_power_script = self.buying_power_script.to_dict() - - clearing_script: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_script, Unset): - clearing_script = self.clearing_script.to_dict() - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if id is not UNSET: - field_dict["id"] = id - if billing_code is not UNSET: - field_dict["billingCode"] = billing_code - if cti_code is not UNSET: - field_dict["ctiCode"] = cti_code - if currency is not UNSET: - field_dict["currency"] = currency - if equities_capacity is not UNSET: - field_dict["equitiesCapacity"] = equities_capacity - if equities_give_up is not UNSET: - field_dict["equitiesGiveUp"] = equities_give_up - if equities_mpid is not UNSET: - field_dict["equitiesMpid"] = equities_mpid - if futures_clearing_account is not UNSET: - field_dict["futuresClearingAccount"] = futures_clearing_account - if futures_clearing_range is not UNSET: - field_dict["futuresClearingRange"] = futures_clearing_range - if futures_cmta is not UNSET: - field_dict["futuresCmta"] = futures_cmta - if futures_execution_broker is not UNSET: - field_dict["futuresExecutionBroker"] = futures_execution_broker - if name is not UNSET: - field_dict["name"] = name - if occ_actionable_id is not UNSET: - field_dict["occActionableId"] = occ_actionable_id - if options_clearing_account is not UNSET: - field_dict["optionsClearingAccount"] = options_clearing_account - if options_clearing_range is not UNSET: - field_dict["optionsClearingRange"] = options_clearing_range - if options_cmta is not UNSET: - field_dict["optionsCmta"] = options_cmta - if options_efid is not UNSET: - field_dict["optionsEfid"] = options_efid - if options_give_up is not UNSET: - field_dict["optionsGiveUp"] = options_give_up - if routing_session_groups is not UNSET: - field_dict["routingSessionGroups"] = routing_session_groups - if status is not UNSET: - field_dict["status"] = status - if tag1 is not UNSET: - field_dict["tag1"] = tag1 - if trading_firm_id is not UNSET: - field_dict["tradingFirmId"] = trading_firm_id - if type_ is not UNSET: - field_dict["type"] = type_ - if created_ts is not UNSET: - field_dict["createdTs"] = created_ts - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if position_script is not UNSET: - field_dict["positionScript"] = position_script - if buying_power_script is not UNSET: - field_dict["buyingPowerScript"] = buying_power_script - if clearing_script is not UNSET: - field_dict["clearingScript"] = clearing_script - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.account_script import AccountScript - from openapi_project.openapi_package.models.routing_session_group import RoutingSessionGroup - - d = dict(src_dict) - id = d.pop("id", UNSET) - - billing_code = d.pop("billingCode", UNSET) - - cti_code = d.pop("ctiCode", UNSET) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) - - _equities_capacity = d.pop("equitiesCapacity", UNSET) - equities_capacity: Unset | CapacityCode - if isinstance(_equities_capacity, Unset): - equities_capacity = UNSET - else: - equities_capacity = CapacityCode(_equities_capacity) - - equities_give_up = d.pop("equitiesGiveUp", UNSET) - - equities_mpid = d.pop("equitiesMpid", UNSET) - - futures_clearing_account = d.pop("futuresClearingAccount", UNSET) - - _futures_clearing_range = d.pop("futuresClearingRange", UNSET) - futures_clearing_range: Unset | ClearingRange - if isinstance(_futures_clearing_range, Unset): - futures_clearing_range = UNSET - else: - futures_clearing_range = ClearingRange(_futures_clearing_range) - - futures_cmta = d.pop("futuresCmta", UNSET) - - futures_execution_broker = d.pop("futuresExecutionBroker", UNSET) - - name = d.pop("name", UNSET) - - occ_actionable_id = d.pop("occActionableId", UNSET) - - options_clearing_account = d.pop("optionsClearingAccount", UNSET) - - _options_clearing_range = d.pop("optionsClearingRange", UNSET) - options_clearing_range: Unset | ClearingRange - if isinstance(_options_clearing_range, Unset): - options_clearing_range = UNSET - else: - options_clearing_range = ClearingRange(_options_clearing_range) - - options_cmta = d.pop("optionsCmta", UNSET) - - options_efid = d.pop("optionsEfid", UNSET) - - options_give_up = d.pop("optionsGiveUp", UNSET) - - routing_session_groups = [] - _routing_session_groups = d.pop("routingSessionGroups", UNSET) - for routing_session_groups_item_data in _routing_session_groups or []: - routing_session_groups_item = RoutingSessionGroup.from_dict( - routing_session_groups_item_data - ) - - routing_session_groups.append(routing_session_groups_item) - - _status = d.pop("status", UNSET) - status: Unset | AccountStatus - if isinstance(_status, Unset): - status = UNSET - else: - status = AccountStatus(_status) - - tag1 = d.pop("tag1", UNSET) - - trading_firm_id = d.pop("tradingFirmId", UNSET) - - _type_ = d.pop("type", UNSET) - type_: Unset | AccountType - if isinstance(_type_, Unset): - type_ = UNSET - else: - type_ = AccountType(_type_) - - created_ts = d.pop("createdTs", UNSET) - - optional_data = d.pop("optionalData", UNSET) - - _position_script = d.pop("positionScript", UNSET) - position_script: Unset | AccountScript - if isinstance(_position_script, Unset): - position_script = UNSET - else: - position_script = AccountScript.from_dict(_position_script) - - _buying_power_script = d.pop("buyingPowerScript", UNSET) - buying_power_script: Unset | AccountScript - if isinstance(_buying_power_script, Unset): - buying_power_script = UNSET - else: - buying_power_script = AccountScript.from_dict(_buying_power_script) - - _clearing_script = d.pop("clearingScript", UNSET) - clearing_script: Unset | AccountScript - if isinstance(_clearing_script, Unset): - clearing_script = UNSET - else: - clearing_script = AccountScript.from_dict(_clearing_script) - - account = cls( - id=id, - billing_code=billing_code, - cti_code=cti_code, - currency=currency, - equities_capacity=equities_capacity, - equities_give_up=equities_give_up, - equities_mpid=equities_mpid, - futures_clearing_account=futures_clearing_account, - futures_clearing_range=futures_clearing_range, - futures_cmta=futures_cmta, - futures_execution_broker=futures_execution_broker, - name=name, - occ_actionable_id=occ_actionable_id, - options_clearing_account=options_clearing_account, - options_clearing_range=options_clearing_range, - options_cmta=options_cmta, - options_efid=options_efid, - options_give_up=options_give_up, - routing_session_groups=routing_session_groups, - status=status, - tag1=tag1, - trading_firm_id=trading_firm_id, - type_=type_, - created_ts=created_ts, - optional_data=optional_data, - position_script=position_script, - buying_power_script=buying_power_script, - clearing_script=clearing_script, - ) - - return account diff --git a/openapi/openapi_project/openapi_package/models/account_script.py b/openapi/openapi_project/openapi_package/models/account_script.py deleted file mode 100644 index c8b7ad121..000000000 --- a/openapi/openapi_project/openapi_package/models/account_script.py +++ /dev/null @@ -1,49 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="AccountScript") - - -@_attrs_define -class AccountScript: - """ - Attributes: - script_name (Union[Unset, str]): - account_name (Union[Unset, str]): - """ - - script_name: Unset | str = UNSET - account_name: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - script_name = self.script_name - - account_name = self.account_name - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if script_name is not UNSET: - field_dict["scriptName"] = script_name - if account_name is not UNSET: - field_dict["accountName"] = account_name - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - script_name = d.pop("scriptName", UNSET) - - account_name = d.pop("accountName", UNSET) - - account_script = cls( - script_name=script_name, - account_name=account_name, - ) - - return account_script diff --git a/openapi/openapi_project/openapi_package/models/account_status.py b/openapi/openapi_project/openapi_package/models/account_status.py deleted file mode 100644 index 0a19e6040..000000000 --- a/openapi/openapi_project/openapi_package/models/account_status.py +++ /dev/null @@ -1,11 +0,0 @@ -from enum import Enum - - -class AccountStatus(str, Enum): - ACCOUNT_STATUS_ACTIVE = "ACCOUNT_STATUS_ACTIVE" - ACCOUNT_STATUS_DELETED = "ACCOUNT_STATUS_DELETED" - ACCOUNT_STATUS_LIQUIDATION = "ACCOUNT_STATUS_LIQUIDATION" - ACCOUNT_STATUS_VIEW_ONLY = "ACCOUNT_STATUS_VIEW_ONLY" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/account_type.py b/openapi/openapi_project/openapi_package/models/account_type.py deleted file mode 100644 index 65c58c63a..000000000 --- a/openapi/openapi_project/openapi_package/models/account_type.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class AccountType(str, Enum): - ACCOUNT_TYPE_CASH = "ACCOUNT_TYPE_CASH" - ACCOUNT_TYPE_INVENTORY = "ACCOUNT_TYPE_INVENTORY" - ACCOUNT_TYPE_MARGIN = "ACCOUNT_TYPE_MARGIN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/analyze_position_item.py b/openapi/openapi_project/openapi_package/models/analyze_position_item.py deleted file mode 100644 index bb9a6fd08..000000000 --- a/openapi/openapi_project/openapi_package/models/analyze_position_item.py +++ /dev/null @@ -1,67 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="AnalyzePositionItem") - - -@_attrs_define -class AnalyzePositionItem: - """ - Attributes: - price (Union[Unset, float]): - qty (Union[Unset, int]): - symbol (Union[Unset, str]): - volatility (Union[Unset, float]): - """ - - price: Unset | float = UNSET - qty: Unset | int = UNSET - symbol: Unset | str = UNSET - volatility: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - price = self.price - - qty = self.qty - - symbol = self.symbol - - volatility = self.volatility - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if price is not UNSET: - field_dict["price"] = price - if qty is not UNSET: - field_dict["qty"] = qty - if symbol is not UNSET: - field_dict["symbol"] = symbol - if volatility is not UNSET: - field_dict["volatility"] = volatility - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - price = d.pop("price", UNSET) - - qty = d.pop("qty", UNSET) - - symbol = d.pop("symbol", UNSET) - - volatility = d.pop("volatility", UNSET) - - analyze_position_item = cls( - price=price, - qty=qty, - symbol=symbol, - volatility=volatility, - ) - - return analyze_position_item diff --git a/openapi/openapi_project/openapi_package/models/analyze_positions_request.py b/openapi/openapi_project/openapi_package/models/analyze_positions_request.py deleted file mode 100644 index dd5d03865..000000000 --- a/openapi/openapi_project/openapi_package/models/analyze_positions_request.py +++ /dev/null @@ -1,136 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.analyze_position_item import AnalyzePositionItem - - -T = TypeVar("T", bound="AnalyzePositionsRequest") - - -@_attrs_define -class AnalyzePositionsRequest: - """ - Attributes: - as_of_ts (Union[Unset, str]): - evaluate_at_expiry (Union[Unset, bool]): - evaluate_at_strike (Union[Unset, bool]): - evaluation_as_of (Union[Unset, list[str]]): - positions (Union[Unset, list['AnalyzePositionItem']]): - price (Union[Unset, float]): - underlying_volatility (Union[Unset, list[float]]): - historical_volatility_days (Union[Unset, list[int]]): - volatility_change (Union[Unset, float]): - """ - - as_of_ts: Unset | str = UNSET - evaluate_at_expiry: Unset | bool = UNSET - evaluate_at_strike: Unset | bool = UNSET - evaluation_as_of: Unset | list[str] = UNSET - positions: Unset | list["AnalyzePositionItem"] = UNSET - price: Unset | float = UNSET - underlying_volatility: Unset | list[float] = UNSET - historical_volatility_days: Unset | list[int] = UNSET - volatility_change: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - as_of_ts = self.as_of_ts - - evaluate_at_expiry = self.evaluate_at_expiry - - evaluate_at_strike = self.evaluate_at_strike - - evaluation_as_of: Unset | list[str] = UNSET - if not isinstance(self.evaluation_as_of, Unset): - evaluation_as_of = self.evaluation_as_of - - positions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.positions, Unset): - positions = [] - for positions_item_data in self.positions: - positions_item = positions_item_data.to_dict() - positions.append(positions_item) - - price = self.price - - underlying_volatility: Unset | list[float] = UNSET - if not isinstance(self.underlying_volatility, Unset): - underlying_volatility = self.underlying_volatility - - historical_volatility_days: Unset | list[int] = UNSET - if not isinstance(self.historical_volatility_days, Unset): - historical_volatility_days = self.historical_volatility_days - - volatility_change = self.volatility_change - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if as_of_ts is not UNSET: - field_dict["asOfTs"] = as_of_ts - if evaluate_at_expiry is not UNSET: - field_dict["evaluateAtExpiry"] = evaluate_at_expiry - if evaluate_at_strike is not UNSET: - field_dict["evaluateAtStrike"] = evaluate_at_strike - if evaluation_as_of is not UNSET: - field_dict["evaluationAsOf"] = evaluation_as_of - if positions is not UNSET: - field_dict["positions"] = positions - if price is not UNSET: - field_dict["price"] = price - if underlying_volatility is not UNSET: - field_dict["underlyingVolatility"] = underlying_volatility - if historical_volatility_days is not UNSET: - field_dict["historicalVolatilityDays"] = historical_volatility_days - if volatility_change is not UNSET: - field_dict["volatilityChange"] = volatility_change - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.analyze_position_item import AnalyzePositionItem - - d = dict(src_dict) - as_of_ts = d.pop("asOfTs", UNSET) - - evaluate_at_expiry = d.pop("evaluateAtExpiry", UNSET) - - evaluate_at_strike = d.pop("evaluateAtStrike", UNSET) - - evaluation_as_of = cast(list[str], d.pop("evaluationAsOf", UNSET)) - - positions = [] - _positions = d.pop("positions", UNSET) - for positions_item_data in _positions or []: - positions_item = AnalyzePositionItem.from_dict(positions_item_data) - - positions.append(positions_item) - - price = d.pop("price", UNSET) - - underlying_volatility = cast(list[float], d.pop("underlyingVolatility", UNSET)) - - historical_volatility_days = cast( - list[int], d.pop("historicalVolatilityDays", UNSET) - ) - - volatility_change = d.pop("volatilityChange", UNSET) - - analyze_positions_request = cls( - as_of_ts=as_of_ts, - evaluate_at_expiry=evaluate_at_expiry, - evaluate_at_strike=evaluate_at_strike, - evaluation_as_of=evaluation_as_of, - positions=positions, - price=price, - underlying_volatility=underlying_volatility, - historical_volatility_days=historical_volatility_days, - volatility_change=volatility_change, - ) - - return analyze_positions_request diff --git a/openapi/openapi_project/openapi_package/models/analyze_positions_response.py b/openapi/openapi_project/openapi_package/models/analyze_positions_response.py deleted file mode 100644 index 7e6ce7c30..000000000 --- a/openapi/openapi_project/openapi_package/models/analyze_positions_response.py +++ /dev/null @@ -1,79 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.position_analysis import PositionAnalysis - - -T = TypeVar("T", bound="AnalyzePositionsResponse") - - -@_attrs_define -class AnalyzePositionsResponse: - """ - Attributes: - analysis (Union[Unset, PositionAnalysis]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - analysis: Union[Unset, "PositionAnalysis"] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - analysis: Unset | dict[str, Any] = UNSET - if not isinstance(self.analysis, Unset): - analysis = self.analysis.to_dict() - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if analysis is not UNSET: - field_dict["analysis"] = analysis - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.position_analysis import PositionAnalysis - - d = dict(src_dict) - _analysis = d.pop("analysis", UNSET) - analysis: Unset | PositionAnalysis - if isinstance(_analysis, Unset): - analysis = UNSET - else: - analysis = PositionAnalysis.from_dict(_analysis) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - analyze_positions_response = cls( - analysis=analysis, - error_message=error_message, - status_code=status_code, - ) - - return analyze_positions_response diff --git a/openapi/openapi_project/openapi_package/models/any_model.py b/openapi/openapi_project/openapi_package/models/any_model.py deleted file mode 100644 index c40b6a3fe..000000000 --- a/openapi/openapi_project/openapi_package/models/any_model.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="AnyModel") - - -@_attrs_define -class AnyModel: - """ - Attributes: - type_ (str): - """ - - type_: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - type_ = self.type_ - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "@type": type_, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - type_ = d.pop("@type") - - any_model = cls( - type_=type_, - ) - - any_model.additional_properties = d - return any_model - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/calculate_margin_request.py b/openapi/openapi_project/openapi_package/models/calculate_margin_request.py deleted file mode 100644 index 47295abeb..000000000 --- a/openapi/openapi_project/openapi_package/models/calculate_margin_request.py +++ /dev/null @@ -1,124 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.margin_data_type import MarginDataType -from openapi_project.openapi_package.models.position_source import PositionSource -from openapi_project.openapi_package.models.risk_eval_mode import RiskEvalMode -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.calculate_margin_request_position_list import CalculateMarginRequestPositionList, - - - -T = TypeVar("T", bound="CalculateMarginRequest") - - -@_attrs_define -class CalculateMarginRequest: - """ - Attributes: - account_ids (Union[Unset, list[int]]): - margin_data_type (Union[Unset, MarginDataType]): - positions_by_account_id (Union[Unset, list['CalculateMarginRequestPositionList']]): - eval_mode (Union[Unset, RiskEvalMode]): - source (Union[Unset, PositionSource]): - """ - - account_ids: Unset | list[int] = UNSET - margin_data_type: Unset | MarginDataType = UNSET - positions_by_account_id: Unset | list["CalculateMarginRequestPositionList"] = UNSET - eval_mode: Unset | RiskEvalMode = UNSET - source: Unset | PositionSource = UNSET - - def to_dict(self) -> dict[str, Any]: - account_ids: Unset | list[int] = UNSET - if not isinstance(self.account_ids, Unset): - account_ids = self.account_ids - - margin_data_type: Unset | str = UNSET - if not isinstance(self.margin_data_type, Unset): - margin_data_type = self.margin_data_type.value - - positions_by_account_id: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.positions_by_account_id, Unset): - positions_by_account_id = [] - for positions_by_account_id_item_data in self.positions_by_account_id: - positions_by_account_id_item = ( - positions_by_account_id_item_data.to_dict() - ) - positions_by_account_id.append(positions_by_account_id_item) - - eval_mode: Unset | str = UNSET - if not isinstance(self.eval_mode, Unset): - eval_mode = self.eval_mode.value - - source: Unset | str = UNSET - if not isinstance(self.source, Unset): - source = self.source.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_ids is not UNSET: - field_dict["accountIds"] = account_ids - if margin_data_type is not UNSET: - field_dict["marginDataType"] = margin_data_type - if positions_by_account_id is not UNSET: - field_dict["positionsByAccountId"] = positions_by_account_id - if eval_mode is not UNSET: - field_dict["evalMode"] = eval_mode - if source is not UNSET: - field_dict["source"] = source - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.calculate_margin_request_position_list import CalculateMarginRequestPositionList, - - - d = dict(src_dict) - account_ids = cast(list[int], d.pop("accountIds", UNSET)) - - _margin_data_type = d.pop("marginDataType", UNSET) - margin_data_type: Unset | MarginDataType - if isinstance(_margin_data_type, Unset): - margin_data_type = UNSET - else: - margin_data_type = MarginDataType(_margin_data_type) - - positions_by_account_id = [] - _positions_by_account_id = d.pop("positionsByAccountId", UNSET) - for positions_by_account_id_item_data in _positions_by_account_id or []: - positions_by_account_id_item = CalculateMarginRequestPositionList.from_dict( - positions_by_account_id_item_data - ) - - positions_by_account_id.append(positions_by_account_id_item) - - _eval_mode = d.pop("evalMode", UNSET) - eval_mode: Unset | RiskEvalMode - if isinstance(_eval_mode, Unset): - eval_mode = UNSET - else: - eval_mode = RiskEvalMode(_eval_mode) - - _source = d.pop("source", UNSET) - source: Unset | PositionSource - if isinstance(_source, Unset): - source = UNSET - else: - source = PositionSource(_source) - - calculate_margin_request = cls( - account_ids=account_ids, - margin_data_type=margin_data_type, - positions_by_account_id=positions_by_account_id, - eval_mode=eval_mode, - source=source, - ) - - return calculate_margin_request diff --git a/openapi/openapi_project/openapi_package/models/calculate_margin_request_position.py b/openapi/openapi_project/openapi_package/models/calculate_margin_request_position.py deleted file mode 100644 index 88d754cd0..000000000 --- a/openapi/openapi_project/openapi_package/models/calculate_margin_request_position.py +++ /dev/null @@ -1,58 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="CalculateMarginRequestPosition") - - -@_attrs_define -class CalculateMarginRequestPosition: - """ - Attributes: - is_simulated_position (Union[Unset, bool]): - qty (Union[Unset, float]): - symbol (Union[Unset, str]): - """ - - is_simulated_position: Unset | bool = UNSET - qty: Unset | float = UNSET - symbol: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - is_simulated_position = self.is_simulated_position - - qty = self.qty - - symbol = self.symbol - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if is_simulated_position is not UNSET: - field_dict["isSimulatedPosition"] = is_simulated_position - if qty is not UNSET: - field_dict["qty"] = qty - if symbol is not UNSET: - field_dict["symbol"] = symbol - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - is_simulated_position = d.pop("isSimulatedPosition", UNSET) - - qty = d.pop("qty", UNSET) - - symbol = d.pop("symbol", UNSET) - - calculate_margin_request_position = cls( - is_simulated_position=is_simulated_position, - qty=qty, - symbol=symbol, - ) - - return calculate_margin_request_position diff --git a/openapi/openapi_project/openapi_package/models/calculate_margin_request_position_list.py b/openapi/openapi_project/openapi_package/models/calculate_margin_request_position_list.py deleted file mode 100644 index 86e28fb2b..000000000 --- a/openapi/openapi_project/openapi_package/models/calculate_margin_request_position_list.py +++ /dev/null @@ -1,69 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.calculate_margin_request_position import CalculateMarginRequestPosition, - - - -T = TypeVar("T", bound="CalculateMarginRequestPositionList") - - -@_attrs_define -class CalculateMarginRequestPositionList: - """ - Attributes: - account_id (Union[Unset, int]): - positions (Union[Unset, list['CalculateMarginRequestPosition']]): - """ - - account_id: Unset | int = UNSET - positions: Unset | list["CalculateMarginRequestPosition"] = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - positions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.positions, Unset): - positions = [] - for positions_item_data in self.positions: - positions_item = positions_item_data.to_dict() - positions.append(positions_item) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if positions is not UNSET: - field_dict["positions"] = positions - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.calculate_margin_request_position import CalculateMarginRequestPosition, - - - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - positions = [] - _positions = d.pop("positions", UNSET) - for positions_item_data in _positions or []: - positions_item = CalculateMarginRequestPosition.from_dict( - positions_item_data - ) - - positions.append(positions_item) - - calculate_margin_request_position_list = cls( - account_id=account_id, - positions=positions, - ) - - return calculate_margin_request_position_list diff --git a/openapi/openapi_project/openapi_package/models/calculate_margin_response.py b/openapi/openapi_project/openapi_package/models/calculate_margin_response.py deleted file mode 100644 index 4f68a58b1..000000000 --- a/openapi/openapi_project/openapi_package/models/calculate_margin_response.py +++ /dev/null @@ -1,82 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.margin_data import MarginData - - -T = TypeVar("T", bound="CalculateMarginResponse") - - -@_attrs_define -class CalculateMarginResponse: - """ - Attributes: - margin_data (Union[Unset, list['MarginData']]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - margin_data: Unset | list["MarginData"] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - margin_data: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.margin_data, Unset): - margin_data = [] - for margin_data_item_data in self.margin_data: - margin_data_item = margin_data_item_data.to_dict() - margin_data.append(margin_data_item) - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if margin_data is not UNSET: - field_dict["marginData"] = margin_data - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.margin_data import MarginData - - d = dict(src_dict) - margin_data = [] - _margin_data = d.pop("marginData", UNSET) - for margin_data_item_data in _margin_data or []: - margin_data_item = MarginData.from_dict(margin_data_item_data) - - margin_data.append(margin_data_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - calculate_margin_response = cls( - margin_data=margin_data, - error_message=error_message, - status_code=status_code, - ) - - return calculate_margin_response diff --git a/openapi/openapi_project/openapi_package/models/cancel_order_request.py b/openapi/openapi_project/openapi_package/models/cancel_order_request.py deleted file mode 100644 index 3bbf45bc8..000000000 --- a/openapi/openapi_project/openapi_package/models/cancel_order_request.py +++ /dev/null @@ -1,94 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.cancel_order_request_optional_data import CancelOrderRequestOptionalData, - - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - -T = TypeVar("T", bound="CancelOrderRequest") - - -@_attrs_define -class CancelOrderRequest: - """ - Attributes: - cur_ord_id (Union[Unset, str]): - instructions (Union[Unset, list['OrderInstruction']]): - perm_ord_id (Union[Unset, str]): - optional_data (Union[Unset, CancelOrderRequestOptionalData]): - """ - - cur_ord_id: Unset | str = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - perm_ord_id: Unset | str = UNSET - optional_data: Union[Unset, "CancelOrderRequestOptionalData"] = UNSET - - def to_dict(self) -> dict[str, Any]: - cur_ord_id = self.cur_ord_id - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - perm_ord_id = self.perm_ord_id - - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if instructions is not UNSET: - field_dict["instructions"] = instructions - if perm_ord_id is not UNSET: - field_dict["permOrdId"] = perm_ord_id - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.cancel_order_request_optional_data import CancelOrderRequestOptionalData, - - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - d = dict(src_dict) - cur_ord_id = d.pop("curOrdId", UNSET) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - perm_ord_id = d.pop("permOrdId", UNSET) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CancelOrderRequestOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = CancelOrderRequestOptionalData.from_dict(_optional_data) - - cancel_order_request = cls( - cur_ord_id=cur_ord_id, - instructions=instructions, - perm_ord_id=perm_ord_id, - optional_data=optional_data, - ) - - return cancel_order_request diff --git a/openapi/openapi_project/openapi_package/models/cancel_order_request_optional_data.py b/openapi/openapi_project/openapi_package/models/cancel_order_request_optional_data.py deleted file mode 100644 index 4b34136e3..000000000 --- a/openapi/openapi_project/openapi_package/models/cancel_order_request_optional_data.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CancelOrderRequestOptionalData") - - -@_attrs_define -class CancelOrderRequestOptionalData: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - cancel_order_request_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - cancel_order_request_optional_data.additional_properties = additional_properties - return cancel_order_request_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/cancel_order_response.py b/openapi/openapi_project/openapi_package/models/cancel_order_response.py deleted file mode 100644 index 1f5e9e69f..000000000 --- a/openapi/openapi_project/openapi_package/models/cancel_order_response.py +++ /dev/null @@ -1,75 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="CancelOrderResponse") - - -@_attrs_define -class CancelOrderResponse: - """ - Attributes: - submit_ts (Union[Unset, str]): - req_ord_id (Union[Unset, str]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - submit_ts: Unset | str = UNSET - req_ord_id: Unset | str = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - submit_ts = self.submit_ts - - req_ord_id = self.req_ord_id - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if submit_ts is not UNSET: - field_dict["submitTs"] = submit_ts - if req_ord_id is not UNSET: - field_dict["reqOrdId"] = req_ord_id - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - submit_ts = d.pop("submitTs", UNSET) - - req_ord_id = d.pop("reqOrdId", UNSET) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - cancel_order_response = cls( - submit_ts=submit_ts, - req_ord_id=req_ord_id, - error_message=error_message, - status_code=status_code, - ) - - return cancel_order_response diff --git a/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py b/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py deleted file mode 100644 index d7ae84643..000000000 --- a/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py +++ /dev/null @@ -1,239 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_algo import CancelReplaceMultiLegOrderRequestAlgo, - - from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_market_condition import CancelReplaceMultiLegOrderRequestMarketCondition, - - from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_optional_data import CancelReplaceMultiLegOrderRequestOptionalData, - - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - -T = TypeVar("T", bound="CancelReplaceMultiLegOrderRequest") - - -@_attrs_define -class CancelReplaceMultiLegOrderRequest: - """ - Attributes: - aux_price (Union[Unset, float]): - clearing_info (Union[Unset, ClearingInfo]): - cur_ord_id (Union[Unset, str]): - instructions (Union[Unset, list['OrderInstruction']]): - ord_type (Union[Unset, OrdType]): - perm_ord_id (Union[Unset, str]): - price (Union[Unset, float]): - qty (Union[Unset, float]): - tag (Union[Unset, str]): - text (Union[Unset, str]): - tif (Union[Unset, Tif]): - algo (Union[Unset, CancelReplaceMultiLegOrderRequestAlgo]): - market_condition (Union[Unset, CancelReplaceMultiLegOrderRequestMarketCondition]): - optional_data (Union[Unset, CancelReplaceMultiLegOrderRequestOptionalData]): - """ - - aux_price: Unset | float = UNSET - clearing_info: Union[Unset, "ClearingInfo"] = UNSET - cur_ord_id: Unset | str = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - ord_type: Unset | OrdType = UNSET - perm_ord_id: Unset | str = UNSET - price: Unset | float = UNSET - qty: Unset | float = UNSET - tag: Unset | str = UNSET - text: Unset | str = UNSET - tif: Unset | Tif = UNSET - algo: Union[Unset, "CancelReplaceMultiLegOrderRequestAlgo"] = UNSET - market_condition: Union[ - Unset, "CancelReplaceMultiLegOrderRequestMarketCondition" - ] = UNSET - optional_data: Union[Unset, "CancelReplaceMultiLegOrderRequestOptionalData"] = UNSET - - def to_dict(self) -> dict[str, Any]: - aux_price = self.aux_price - - clearing_info: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_info, Unset): - clearing_info = self.clearing_info.to_dict() - - cur_ord_id = self.cur_ord_id - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value - - perm_ord_id = self.perm_ord_id - - price = self.price - - qty = self.qty - - tag = self.tag - - text = self.text - - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value - - algo: Unset | dict[str, Any] = UNSET - if not isinstance(self.algo, Unset): - algo = self.algo.to_dict() - - market_condition: Unset | dict[str, Any] = UNSET - if not isinstance(self.market_condition, Unset): - market_condition = self.market_condition.to_dict() - - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if aux_price is not UNSET: - field_dict["auxPrice"] = aux_price - if clearing_info is not UNSET: - field_dict["clearingInfo"] = clearing_info - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if instructions is not UNSET: - field_dict["instructions"] = instructions - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if perm_ord_id is not UNSET: - field_dict["permOrdId"] = perm_ord_id - if price is not UNSET: - field_dict["price"] = price - if qty is not UNSET: - field_dict["qty"] = qty - if tag is not UNSET: - field_dict["tag"] = tag - if text is not UNSET: - field_dict["text"] = text - if tif is not UNSET: - field_dict["tif"] = tif - if algo is not UNSET: - field_dict["algo"] = algo - if market_condition is not UNSET: - field_dict["marketCondition"] = market_condition - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_algo import CancelReplaceMultiLegOrderRequestAlgo, - - from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_market_condition import CancelReplaceMultiLegOrderRequestMarketCondition, - - from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_optional_data import CancelReplaceMultiLegOrderRequestOptionalData, - - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - d = dict(src_dict) - aux_price = d.pop("auxPrice", UNSET) - - _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo - if isinstance(_clearing_info, Unset): - clearing_info = UNSET - else: - clearing_info = ClearingInfo.from_dict(_clearing_info) - - cur_ord_id = d.pop("curOrdId", UNSET) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) - - perm_ord_id = d.pop("permOrdId", UNSET) - - price = d.pop("price", UNSET) - - qty = d.pop("qty", UNSET) - - tag = d.pop("tag", UNSET) - - text = d.pop("text", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) - - _algo = d.pop("algo", UNSET) - algo: Unset | CancelReplaceMultiLegOrderRequestAlgo - if isinstance(_algo, Unset): - algo = UNSET - else: - algo = CancelReplaceMultiLegOrderRequestAlgo.from_dict(_algo) - - _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | CancelReplaceMultiLegOrderRequestMarketCondition - if isinstance(_market_condition, Unset): - market_condition = UNSET - else: - market_condition = ( - CancelReplaceMultiLegOrderRequestMarketCondition.from_dict( - _market_condition - ) - ) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CancelReplaceMultiLegOrderRequestOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = CancelReplaceMultiLegOrderRequestOptionalData.from_dict( - _optional_data - ) - - cancel_replace_multi_leg_order_request = cls( - aux_price=aux_price, - clearing_info=clearing_info, - cur_ord_id=cur_ord_id, - instructions=instructions, - ord_type=ord_type, - perm_ord_id=perm_ord_id, - price=price, - qty=qty, - tag=tag, - text=text, - tif=tif, - algo=algo, - market_condition=market_condition, - optional_data=optional_data, - ) - - return cancel_replace_multi_leg_order_request diff --git a/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py b/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py deleted file mode 100644 index 717b5d06f..000000000 --- a/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CancelReplaceMultiLegOrderRequestAlgo") - - -@_attrs_define -class CancelReplaceMultiLegOrderRequestAlgo: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - cancel_replace_multi_leg_order_request_algo = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - cancel_replace_multi_leg_order_request_algo.additional_properties = ( - additional_properties - ) - return cancel_replace_multi_leg_order_request_algo - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py b/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py deleted file mode 100644 index fac43107f..000000000 --- a/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CancelReplaceMultiLegOrderRequestMarketCondition") - - -@_attrs_define -class CancelReplaceMultiLegOrderRequestMarketCondition: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - cancel_replace_multi_leg_order_request_market_condition = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - cancel_replace_multi_leg_order_request_market_condition.additional_properties = ( - additional_properties - ) - return cancel_replace_multi_leg_order_request_market_condition - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py b/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py deleted file mode 100644 index 6a874b1bf..000000000 --- a/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CancelReplaceMultiLegOrderRequestOptionalData") - - -@_attrs_define -class CancelReplaceMultiLegOrderRequestOptionalData: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - cancel_replace_multi_leg_order_request_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - cancel_replace_multi_leg_order_request_optional_data.additional_properties = ( - additional_properties - ) - return cancel_replace_multi_leg_order_request_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py b/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py deleted file mode 100644 index 125455d27..000000000 --- a/openapi/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py +++ /dev/null @@ -1,75 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="CancelReplaceMultiLegOrderResponse") - - -@_attrs_define -class CancelReplaceMultiLegOrderResponse: - """ - Attributes: - submit_ts (Union[Unset, str]): - req_ord_id (Union[Unset, str]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - submit_ts: Unset | str = UNSET - req_ord_id: Unset | str = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - submit_ts = self.submit_ts - - req_ord_id = self.req_ord_id - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if submit_ts is not UNSET: - field_dict["submitTs"] = submit_ts - if req_ord_id is not UNSET: - field_dict["reqOrdId"] = req_ord_id - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - submit_ts = d.pop("submitTs", UNSET) - - req_ord_id = d.pop("reqOrdId", UNSET) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - cancel_replace_multi_leg_order_response = cls( - submit_ts=submit_ts, - req_ord_id=req_ord_id, - error_message=error_message, - status_code=status_code, - ) - - return cancel_replace_multi_leg_order_response diff --git a/openapi/openapi_project/openapi_package/models/cancel_replace_order_request.py b/openapi/openapi_project/openapi_package/models/cancel_replace_order_request.py deleted file mode 100644 index a0202effd..000000000 --- a/openapi/openapi_project/openapi_package/models/cancel_replace_order_request.py +++ /dev/null @@ -1,216 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo - from openapi_project.openapi_package.models.cancel_replace_order_request_market_condition import CancelReplaceOrderRequestMarketCondition, - - from openapi_project.openapi_package.models.cancel_replace_order_request_optional_data import CancelReplaceOrderRequestOptionalData, - - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - -T = TypeVar("T", bound="CancelReplaceOrderRequest") - - -@_attrs_define -class CancelReplaceOrderRequest: - """ - Attributes: - aux_price (Union[Unset, float]): - clearing_info (Union[Unset, ClearingInfo]): - cur_ord_id (Union[Unset, str]): - instructions (Union[Unset, list['OrderInstruction']]): - ord_type (Union[Unset, OrdType]): - perm_ord_id (Union[Unset, str]): - price (Union[Unset, float]): - qty (Union[Unset, float]): - tif (Union[Unset, Tif]): - algo (Union[Unset, CancelReplaceOrderRequestAlgo]): - market_condition (Union[Unset, CancelReplaceOrderRequestMarketCondition]): - optional_data (Union[Unset, CancelReplaceOrderRequestOptionalData]): - """ - - aux_price: Unset | float = UNSET - clearing_info: Union[Unset, "ClearingInfo"] = UNSET - cur_ord_id: Unset | str = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - ord_type: Unset | OrdType = UNSET - perm_ord_id: Unset | str = UNSET - price: Unset | float = UNSET - qty: Unset | float = UNSET - tif: Unset | Tif = UNSET - algo: Union[Unset, "CancelReplaceOrderRequestAlgo"] = UNSET - market_condition: Union[Unset, "CancelReplaceOrderRequestMarketCondition"] = UNSET - optional_data: Union[Unset, "CancelReplaceOrderRequestOptionalData"] = UNSET - - def to_dict(self) -> dict[str, Any]: - aux_price = self.aux_price - - clearing_info: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_info, Unset): - clearing_info = self.clearing_info.to_dict() - - cur_ord_id = self.cur_ord_id - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value - - perm_ord_id = self.perm_ord_id - - price = self.price - - qty = self.qty - - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value - - algo: Unset | dict[str, Any] = UNSET - if not isinstance(self.algo, Unset): - algo = self.algo.to_dict() - - market_condition: Unset | dict[str, Any] = UNSET - if not isinstance(self.market_condition, Unset): - market_condition = self.market_condition.to_dict() - - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if aux_price is not UNSET: - field_dict["auxPrice"] = aux_price - if clearing_info is not UNSET: - field_dict["clearingInfo"] = clearing_info - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if instructions is not UNSET: - field_dict["instructions"] = instructions - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if perm_ord_id is not UNSET: - field_dict["permOrdId"] = perm_ord_id - if price is not UNSET: - field_dict["price"] = price - if qty is not UNSET: - field_dict["qty"] = qty - if tif is not UNSET: - field_dict["tif"] = tif - if algo is not UNSET: - field_dict["algo"] = algo - if market_condition is not UNSET: - field_dict["marketCondition"] = market_condition - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo, - - from openapi_project.openapi_package.models.cancel_replace_order_request_market_condition import CancelReplaceOrderRequestMarketCondition, - - from openapi_project.openapi_package.models.cancel_replace_order_request_optional_data import CancelReplaceOrderRequestOptionalData, - - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - d = dict(src_dict) - aux_price = d.pop("auxPrice", UNSET) - - _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo - if isinstance(_clearing_info, Unset): - clearing_info = UNSET - else: - clearing_info = ClearingInfo.from_dict(_clearing_info) - - cur_ord_id = d.pop("curOrdId", UNSET) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) - - perm_ord_id = d.pop("permOrdId", UNSET) - - price = d.pop("price", UNSET) - - qty = d.pop("qty", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) - - _algo = d.pop("algo", UNSET) - algo: Unset | CancelReplaceOrderRequestAlgo - if isinstance(_algo, Unset): - algo = UNSET - else: - algo = CancelReplaceOrderRequestAlgo.from_dict(_algo) - - _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | CancelReplaceOrderRequestMarketCondition - if isinstance(_market_condition, Unset): - market_condition = UNSET - else: - market_condition = CancelReplaceOrderRequestMarketCondition.from_dict( - _market_condition - ) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CancelReplaceOrderRequestOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = CancelReplaceOrderRequestOptionalData.from_dict( - _optional_data - ) - - cancel_replace_order_request = cls( - aux_price=aux_price, - clearing_info=clearing_info, - cur_ord_id=cur_ord_id, - instructions=instructions, - ord_type=ord_type, - perm_ord_id=perm_ord_id, - price=price, - qty=qty, - tif=tif, - algo=algo, - market_condition=market_condition, - optional_data=optional_data, - ) - - return cancel_replace_order_request diff --git a/openapi/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py b/openapi/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py deleted file mode 100644 index 9e59fac7d..000000000 --- a/openapi/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CancelReplaceOrderRequestAlgo") - - -@_attrs_define -class CancelReplaceOrderRequestAlgo: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - cancel_replace_order_request_algo = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - cancel_replace_order_request_algo.additional_properties = additional_properties - return cancel_replace_order_request_algo - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py b/openapi/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py deleted file mode 100644 index df8263244..000000000 --- a/openapi/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CancelReplaceOrderRequestMarketCondition") - - -@_attrs_define -class CancelReplaceOrderRequestMarketCondition: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - cancel_replace_order_request_market_condition = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - cancel_replace_order_request_market_condition.additional_properties = ( - additional_properties - ) - return cancel_replace_order_request_market_condition - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py b/openapi/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py deleted file mode 100644 index a6f8ee555..000000000 --- a/openapi/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CancelReplaceOrderRequestOptionalData") - - -@_attrs_define -class CancelReplaceOrderRequestOptionalData: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - cancel_replace_order_request_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - cancel_replace_order_request_optional_data.additional_properties = ( - additional_properties - ) - return cancel_replace_order_request_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/cancel_replace_order_response.py b/openapi/openapi_project/openapi_package/models/cancel_replace_order_response.py deleted file mode 100644 index 36f6201e3..000000000 --- a/openapi/openapi_project/openapi_package/models/cancel_replace_order_response.py +++ /dev/null @@ -1,75 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="CancelReplaceOrderResponse") - - -@_attrs_define -class CancelReplaceOrderResponse: - """ - Attributes: - submit_ts (Union[Unset, str]): - req_ord_id (Union[Unset, str]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - submit_ts: Unset | str = UNSET - req_ord_id: Unset | str = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - submit_ts = self.submit_ts - - req_ord_id = self.req_ord_id - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if submit_ts is not UNSET: - field_dict["submitTs"] = submit_ts - if req_ord_id is not UNSET: - field_dict["reqOrdId"] = req_ord_id - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - submit_ts = d.pop("submitTs", UNSET) - - req_ord_id = d.pop("reqOrdId", UNSET) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - cancel_replace_order_response = cls( - submit_ts=submit_ts, - req_ord_id=req_ord_id, - error_message=error_message, - status_code=status_code, - ) - - return cancel_replace_order_response diff --git a/openapi/openapi_project/openapi_package/models/capacity_code.py b/openapi/openapi_project/openapi_package/models/capacity_code.py deleted file mode 100644 index db23b3407..000000000 --- a/openapi/openapi_project/openapi_package/models/capacity_code.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class CapacityCode(str, Enum): - CAPACITY_CODE_AGENT = "CAPACITY_CODE_AGENT" - CAPACITY_CODE_NOT_SET = "CAPACITY_CODE_NOT_SET" - CAPACITY_CODE_PRINCIPAL = "CAPACITY_CODE_PRINCIPAL" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/claim_type.py b/openapi/openapi_project/openapi_package/models/claim_type.py deleted file mode 100644 index a4ac678ab..000000000 --- a/openapi/openapi_project/openapi_package/models/claim_type.py +++ /dev/null @@ -1,11 +0,0 @@ -from enum import Enum - - -class ClaimType(str, Enum): - CLAIM_TYPE_FUNCTIONALITY_PERMISSION = "CLAIM_TYPE_FUNCTIONALITY_PERMISSION" - CLAIM_TYPE_SYSOP_PERMISSION = "CLAIM_TYPE_SYSOP_PERMISSION" - CLAIM_TYPE_UI_MODULE_PERMISSION = "CLAIM_TYPE_UI_MODULE_PERMISSION" - CLAIM_TYPE_UNDEFINED = "CLAIM_TYPE_UNDEFINED" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/clearing_info.py b/openapi/openapi_project/openapi_package/models/clearing_info.py deleted file mode 100644 index f03ec22e7..000000000 --- a/openapi/openapi_project/openapi_package/models/clearing_info.py +++ /dev/null @@ -1,216 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.capacity_code import CapacityCode -from openapi_project.openapi_package.models.clearing_range import ClearingRange -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="ClearingInfo") - - -@_attrs_define -class ClearingInfo: - """ - Attributes: - clearing_optional_data (Union[Unset, str]): - cti_code (Union[Unset, str]): - efid (Union[Unset, str]): - eq_capacity (Union[Unset, CapacityCode]): - eq_clearing_account (Union[Unset, str]): - eq_give_up (Union[Unset, str]): - eq_mpid (Union[Unset, str]): - fut_clearing_account (Union[Unset, str]): - fut_clearing_range (Union[Unset, ClearingRange]): - fut_cmta (Union[Unset, str]): - fut_exec_broker (Union[Unset, str]): - locate_id (Union[Unset, str]): - opt_clearing_account (Union[Unset, str]): - opt_clearing_range (Union[Unset, ClearingRange]): - opt_cmta (Union[Unset, str]): - opt_give_up (Union[Unset, str]): - tag1 (Union[Unset, str]): - billing_code (Union[Unset, str]): - """ - - clearing_optional_data: Unset | str = UNSET - cti_code: Unset | str = UNSET - efid: Unset | str = UNSET - eq_capacity: Unset | CapacityCode = UNSET - eq_clearing_account: Unset | str = UNSET - eq_give_up: Unset | str = UNSET - eq_mpid: Unset | str = UNSET - fut_clearing_account: Unset | str = UNSET - fut_clearing_range: Unset | ClearingRange = UNSET - fut_cmta: Unset | str = UNSET - fut_exec_broker: Unset | str = UNSET - locate_id: Unset | str = UNSET - opt_clearing_account: Unset | str = UNSET - opt_clearing_range: Unset | ClearingRange = UNSET - opt_cmta: Unset | str = UNSET - opt_give_up: Unset | str = UNSET - tag1: Unset | str = UNSET - billing_code: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - clearing_optional_data = self.clearing_optional_data - - cti_code = self.cti_code - - efid = self.efid - - eq_capacity: Unset | str = UNSET - if not isinstance(self.eq_capacity, Unset): - eq_capacity = self.eq_capacity.value - - eq_clearing_account = self.eq_clearing_account - - eq_give_up = self.eq_give_up - - eq_mpid = self.eq_mpid - - fut_clearing_account = self.fut_clearing_account - - fut_clearing_range: Unset | str = UNSET - if not isinstance(self.fut_clearing_range, Unset): - fut_clearing_range = self.fut_clearing_range.value - - fut_cmta = self.fut_cmta - - fut_exec_broker = self.fut_exec_broker - - locate_id = self.locate_id - - opt_clearing_account = self.opt_clearing_account - - opt_clearing_range: Unset | str = UNSET - if not isinstance(self.opt_clearing_range, Unset): - opt_clearing_range = self.opt_clearing_range.value - - opt_cmta = self.opt_cmta - - opt_give_up = self.opt_give_up - - tag1 = self.tag1 - - billing_code = self.billing_code - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if clearing_optional_data is not UNSET: - field_dict["clearingOptionalData"] = clearing_optional_data - if cti_code is not UNSET: - field_dict["ctiCode"] = cti_code - if efid is not UNSET: - field_dict["efid"] = efid - if eq_capacity is not UNSET: - field_dict["eqCapacity"] = eq_capacity - if eq_clearing_account is not UNSET: - field_dict["eqClearingAccount"] = eq_clearing_account - if eq_give_up is not UNSET: - field_dict["eqGiveUp"] = eq_give_up - if eq_mpid is not UNSET: - field_dict["eqMpid"] = eq_mpid - if fut_clearing_account is not UNSET: - field_dict["futClearingAccount"] = fut_clearing_account - if fut_clearing_range is not UNSET: - field_dict["futClearingRange"] = fut_clearing_range - if fut_cmta is not UNSET: - field_dict["futCmta"] = fut_cmta - if fut_exec_broker is not UNSET: - field_dict["futExecBroker"] = fut_exec_broker - if locate_id is not UNSET: - field_dict["locateId"] = locate_id - if opt_clearing_account is not UNSET: - field_dict["optClearingAccount"] = opt_clearing_account - if opt_clearing_range is not UNSET: - field_dict["optClearingRange"] = opt_clearing_range - if opt_cmta is not UNSET: - field_dict["optCmta"] = opt_cmta - if opt_give_up is not UNSET: - field_dict["optGiveUp"] = opt_give_up - if tag1 is not UNSET: - field_dict["tag1"] = tag1 - if billing_code is not UNSET: - field_dict["billingCode"] = billing_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - clearing_optional_data = d.pop("clearingOptionalData", UNSET) - - cti_code = d.pop("ctiCode", UNSET) - - efid = d.pop("efid", UNSET) - - _eq_capacity = d.pop("eqCapacity", UNSET) - eq_capacity: Unset | CapacityCode - if isinstance(_eq_capacity, Unset): - eq_capacity = UNSET - else: - eq_capacity = CapacityCode(_eq_capacity) - - eq_clearing_account = d.pop("eqClearingAccount", UNSET) - - eq_give_up = d.pop("eqGiveUp", UNSET) - - eq_mpid = d.pop("eqMpid", UNSET) - - fut_clearing_account = d.pop("futClearingAccount", UNSET) - - _fut_clearing_range = d.pop("futClearingRange", UNSET) - fut_clearing_range: Unset | ClearingRange - if isinstance(_fut_clearing_range, Unset): - fut_clearing_range = UNSET - else: - fut_clearing_range = ClearingRange(_fut_clearing_range) - - fut_cmta = d.pop("futCmta", UNSET) - - fut_exec_broker = d.pop("futExecBroker", UNSET) - - locate_id = d.pop("locateId", UNSET) - - opt_clearing_account = d.pop("optClearingAccount", UNSET) - - _opt_clearing_range = d.pop("optClearingRange", UNSET) - opt_clearing_range: Unset | ClearingRange - if isinstance(_opt_clearing_range, Unset): - opt_clearing_range = UNSET - else: - opt_clearing_range = ClearingRange(_opt_clearing_range) - - opt_cmta = d.pop("optCmta", UNSET) - - opt_give_up = d.pop("optGiveUp", UNSET) - - tag1 = d.pop("tag1", UNSET) - - billing_code = d.pop("billingCode", UNSET) - - clearing_info = cls( - clearing_optional_data=clearing_optional_data, - cti_code=cti_code, - efid=efid, - eq_capacity=eq_capacity, - eq_clearing_account=eq_clearing_account, - eq_give_up=eq_give_up, - eq_mpid=eq_mpid, - fut_clearing_account=fut_clearing_account, - fut_clearing_range=fut_clearing_range, - fut_cmta=fut_cmta, - fut_exec_broker=fut_exec_broker, - locate_id=locate_id, - opt_clearing_account=opt_clearing_account, - opt_clearing_range=opt_clearing_range, - opt_cmta=opt_cmta, - opt_give_up=opt_give_up, - tag1=tag1, - billing_code=billing_code, - ) - - return clearing_info diff --git a/openapi/openapi_project/openapi_package/models/clearing_range.py b/openapi/openapi_project/openapi_package/models/clearing_range.py deleted file mode 100644 index a4f20d190..000000000 --- a/openapi/openapi_project/openapi_package/models/clearing_range.py +++ /dev/null @@ -1,21 +0,0 @@ -from enum import Enum - - -class ClearingRange(str, Enum): - CLEARING_RANGE_AWAY_MARKET_MAKER = "CLEARING_RANGE_AWAY_MARKET_MAKER" - CLEARING_RANGE_BROKER_DEALER = "CLEARING_RANGE_BROKER_DEALER" - CLEARING_RANGE_BROKER_DEALER_CUSTOMER = "CLEARING_RANGE_BROKER_DEALER_CUSTOMER" - CLEARING_RANGE_BROKER_DEALER_FIRM = "CLEARING_RANGE_BROKER_DEALER_FIRM" - CLEARING_RANGE_CUSTOMER = "CLEARING_RANGE_CUSTOMER" - CLEARING_RANGE_FIRM = "CLEARING_RANGE_FIRM" - CLEARING_RANGE_JOINT_BACK_OFFICE = "CLEARING_RANGE_JOINT_BACK_OFFICE" - CLEARING_RANGE_MARKET_MAKER = "CLEARING_RANGE_MARKET_MAKER" - CLEARING_RANGE_NON_TPH_AFFILIATE = "CLEARING_RANGE_NON_TPH_AFFILIATE" - CLEARING_RANGE_NON_TPH_BROKER_DEALER = "CLEARING_RANGE_NON_TPH_BROKER_DEALER" - CLEARING_RANGE_NOTSET = "CLEARING_RANGE_NOTSET" - CLEARING_RANGE_PROFESSIONAL_CUSTOMER = "CLEARING_RANGE_PROFESSIONAL_CUSTOMER" - CLEARING_RANGE_PROPRIETARY_CUSTOMER = "CLEARING_RANGE_PROPRIETARY_CUSTOMER" - CLEARING_RANGE_PROPRIETARY_FIRM = "CLEARING_RANGE_PROPRIETARY_FIRM" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/country.py b/openapi/openapi_project/openapi_package/models/country.py deleted file mode 100644 index a29ba6b7a..000000000 --- a/openapi/openapi_project/openapi_package/models/country.py +++ /dev/null @@ -1,14 +0,0 @@ -from enum import Enum - - -class Country(str, Enum): - COUNTRY_CHINA = "COUNTRY_CHINA" - COUNTRY_GERMANY = "COUNTRY_GERMANY" - COUNTRY_INDIA = "COUNTRY_INDIA" - COUNTRY_JAPAN = "COUNTRY_JAPAN" - COUNTRY_UNITED_KINGDOM = "COUNTRY_UNITED_KINGDOM" - COUNTRY_UNITED_STATES = "COUNTRY_UNITED_STATES" - COUNTRY_UNKNOWN = "COUNTRY_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/create_flex_option_request.py b/openapi/openapi_project/openapi_package/models/create_flex_option_request.py deleted file mode 100644 index 5370636e7..000000000 --- a/openapi/openapi_project/openapi_package/models/create_flex_option_request.py +++ /dev/null @@ -1,182 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.flex_settlement_type import FlexSettlementType -from openapi_project.openapi_package.models.option_exercise_style import OptionExerciseStyle -from openapi_project.openapi_package.models.option_series_product_type import OptionSeriesProductType -from openapi_project.openapi_package.models.put_call import PutCall -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.date import Date - - -T = TypeVar("T", bound="CreateFlexOptionRequest") - - -@_attrs_define -class CreateFlexOptionRequest: - """ - Attributes: - root_symbol (Union[Unset, str]): - settlement_type (Union[Unset, FlexSettlementType]): - expiration_dt (Union[Unset, Date]): - strike (Union[Unset, float]): - put_call (Union[Unset, PutCall]): - product_type (Union[Unset, OptionSeriesProductType]): - exercise_style (Union[Unset, OptionExerciseStyle]): - creation_dt (Union[Unset, Date]): - observation_day (Union[Unset, int]): - is_percentage_priced (Union[Unset, bool]): - cap_percentage (Union[Unset, float]): - """ - - root_symbol: Unset | str = UNSET - settlement_type: Unset | FlexSettlementType = UNSET - expiration_dt: Union[Unset, "Date"] = UNSET - strike: Unset | float = UNSET - put_call: Unset | PutCall = UNSET - product_type: Unset | OptionSeriesProductType = UNSET - exercise_style: Unset | OptionExerciseStyle = UNSET - creation_dt: Union[Unset, "Date"] = UNSET - observation_day: Unset | int = UNSET - is_percentage_priced: Unset | bool = UNSET - cap_percentage: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - root_symbol = self.root_symbol - - settlement_type: Unset | str = UNSET - if not isinstance(self.settlement_type, Unset): - settlement_type = self.settlement_type.value - - expiration_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.expiration_dt, Unset): - expiration_dt = self.expiration_dt.to_dict() - - strike = self.strike - - put_call: Unset | str = UNSET - if not isinstance(self.put_call, Unset): - put_call = self.put_call.value - - product_type: Unset | str = UNSET - if not isinstance(self.product_type, Unset): - product_type = self.product_type.value - - exercise_style: Unset | str = UNSET - if not isinstance(self.exercise_style, Unset): - exercise_style = self.exercise_style.value - - creation_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.creation_dt, Unset): - creation_dt = self.creation_dt.to_dict() - - observation_day = self.observation_day - - is_percentage_priced = self.is_percentage_priced - - cap_percentage = self.cap_percentage - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if root_symbol is not UNSET: - field_dict["rootSymbol"] = root_symbol - if settlement_type is not UNSET: - field_dict["settlementType"] = settlement_type - if expiration_dt is not UNSET: - field_dict["expirationDt"] = expiration_dt - if strike is not UNSET: - field_dict["strike"] = strike - if put_call is not UNSET: - field_dict["putCall"] = put_call - if product_type is not UNSET: - field_dict["productType"] = product_type - if exercise_style is not UNSET: - field_dict["exerciseStyle"] = exercise_style - if creation_dt is not UNSET: - field_dict["creationDt"] = creation_dt - if observation_day is not UNSET: - field_dict["observationDay"] = observation_day - if is_percentage_priced is not UNSET: - field_dict["isPercentagePriced"] = is_percentage_priced - if cap_percentage is not UNSET: - field_dict["capPercentage"] = cap_percentage - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.date import Date - - d = dict(src_dict) - root_symbol = d.pop("rootSymbol", UNSET) - - _settlement_type = d.pop("settlementType", UNSET) - settlement_type: Unset | FlexSettlementType - if isinstance(_settlement_type, Unset): - settlement_type = UNSET - else: - settlement_type = FlexSettlementType(_settlement_type) - - _expiration_dt = d.pop("expirationDt", UNSET) - expiration_dt: Unset | Date - if isinstance(_expiration_dt, Unset): - expiration_dt = UNSET - else: - expiration_dt = Date.from_dict(_expiration_dt) - - strike = d.pop("strike", UNSET) - - _put_call = d.pop("putCall", UNSET) - put_call: Unset | PutCall - if isinstance(_put_call, Unset): - put_call = UNSET - else: - put_call = PutCall(_put_call) - - _product_type = d.pop("productType", UNSET) - product_type: Unset | OptionSeriesProductType - if isinstance(_product_type, Unset): - product_type = UNSET - else: - product_type = OptionSeriesProductType(_product_type) - - _exercise_style = d.pop("exerciseStyle", UNSET) - exercise_style: Unset | OptionExerciseStyle - if isinstance(_exercise_style, Unset): - exercise_style = UNSET - else: - exercise_style = OptionExerciseStyle(_exercise_style) - - _creation_dt = d.pop("creationDt", UNSET) - creation_dt: Unset | Date - if isinstance(_creation_dt, Unset): - creation_dt = UNSET - else: - creation_dt = Date.from_dict(_creation_dt) - - observation_day = d.pop("observationDay", UNSET) - - is_percentage_priced = d.pop("isPercentagePriced", UNSET) - - cap_percentage = d.pop("capPercentage", UNSET) - - create_flex_option_request = cls( - root_symbol=root_symbol, - settlement_type=settlement_type, - expiration_dt=expiration_dt, - strike=strike, - put_call=put_call, - product_type=product_type, - exercise_style=exercise_style, - creation_dt=creation_dt, - observation_day=observation_day, - is_percentage_priced=is_percentage_priced, - cap_percentage=cap_percentage, - ) - - return create_flex_option_request diff --git a/openapi/openapi_project/openapi_package/models/create_flex_option_response.py b/openapi/openapi_project/openapi_package/models/create_flex_option_response.py deleted file mode 100644 index 09ce058da..000000000 --- a/openapi/openapi_project/openapi_package/models/create_flex_option_response.py +++ /dev/null @@ -1,79 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.flex_option import FlexOption - - -T = TypeVar("T", bound="CreateFlexOptionResponse") - - -@_attrs_define -class CreateFlexOptionResponse: - """ - Attributes: - flex_option (Union[Unset, FlexOption]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - flex_option: Union[Unset, "FlexOption"] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - flex_option: Unset | dict[str, Any] = UNSET - if not isinstance(self.flex_option, Unset): - flex_option = self.flex_option.to_dict() - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if flex_option is not UNSET: - field_dict["flexOption"] = flex_option - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.flex_option import FlexOption - - d = dict(src_dict) - _flex_option = d.pop("flexOption", UNSET) - flex_option: Unset | FlexOption - if isinstance(_flex_option, Unset): - flex_option = UNSET - else: - flex_option = FlexOption.from_dict(_flex_option) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - create_flex_option_response = cls( - flex_option=flex_option, - error_message=error_message, - status_code=status_code, - ) - - return create_flex_option_response diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py deleted file mode 100644 index 6f97480aa..000000000 --- a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py +++ /dev/null @@ -1,154 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.cross_side_type import CrossSideType -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation_optional_data import CreateMultiLegOrderCrossAllocationOptionalData, - - from openapi_project.openapi_package.models.create_multi_leg_order_leg import CreateMultiLegOrderLeg - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - -T = TypeVar("T", bound="CreateMultiLegOrderCrossAllocation") - - -@_attrs_define -class CreateMultiLegOrderCrossAllocation: - """ - Attributes: - account_id (Union[Unset, int]): - clearing_info (Union[Unset, ClearingInfo]): - instructions (Union[Unset, list['OrderInstruction']]): - legs (Union[Unset, list['CreateMultiLegOrderLeg']]): - optional_data (Union[Unset, CreateMultiLegOrderCrossAllocationOptionalData]): - qty (Union[Unset, float]): - side_type (Union[Unset, CrossSideType]): - """ - - account_id: Unset | int = UNSET - clearing_info: Union[Unset, "ClearingInfo"] = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - legs: Unset | list["CreateMultiLegOrderLeg"] = UNSET - optional_data: Union[Unset, "CreateMultiLegOrderCrossAllocationOptionalData"] = ( - UNSET - ) - qty: Unset | float = UNSET - side_type: Unset | CrossSideType = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - clearing_info: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_info, Unset): - clearing_info = self.clearing_info.to_dict() - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - legs: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.legs, Unset): - legs = [] - for legs_item_data in self.legs: - legs_item = legs_item_data.to_dict() - legs.append(legs_item) - - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() - - qty = self.qty - - side_type: Unset | str = UNSET - if not isinstance(self.side_type, Unset): - side_type = self.side_type.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if clearing_info is not UNSET: - field_dict["clearingInfo"] = clearing_info - if instructions is not UNSET: - field_dict["instructions"] = instructions - if legs is not UNSET: - field_dict["legs"] = legs - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if qty is not UNSET: - field_dict["qty"] = qty - if side_type is not UNSET: - field_dict["sideType"] = side_type - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation_optional_data import CreateMultiLegOrderCrossAllocationOptionalData, - - from openapi_project.openapi_package.models.create_multi_leg_order_leg import CreateMultiLegOrderLeg - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo - if isinstance(_clearing_info, Unset): - clearing_info = UNSET - else: - clearing_info = ClearingInfo.from_dict(_clearing_info) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - legs = [] - _legs = d.pop("legs", UNSET) - for legs_item_data in _legs or []: - legs_item = CreateMultiLegOrderLeg.from_dict(legs_item_data) - - legs.append(legs_item) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CreateMultiLegOrderCrossAllocationOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = CreateMultiLegOrderCrossAllocationOptionalData.from_dict( - _optional_data - ) - - qty = d.pop("qty", UNSET) - - _side_type = d.pop("sideType", UNSET) - side_type: Unset | CrossSideType - if isinstance(_side_type, Unset): - side_type = UNSET - else: - side_type = CrossSideType(_side_type) - - create_multi_leg_order_cross_allocation = cls( - account_id=account_id, - clearing_info=clearing_info, - instructions=instructions, - legs=legs, - optional_data=optional_data, - qty=qty, - side_type=side_type, - ) - - return create_multi_leg_order_cross_allocation diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py deleted file mode 100644 index 64af0aa54..000000000 --- a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CreateMultiLegOrderCrossAllocationOptionalData") - - -@_attrs_define -class CreateMultiLegOrderCrossAllocationOptionalData: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_multi_leg_order_cross_allocation_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_multi_leg_order_cross_allocation_optional_data.additional_properties = ( - additional_properties - ) - return create_multi_leg_order_cross_allocation_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py deleted file mode 100644 index c1e92e575..000000000 --- a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py +++ /dev/null @@ -1,287 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.cross_type import CrossType -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.price_type import PriceType -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation import CreateMultiLegOrderCrossAllocation, - - from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_algo import CreateMultiLegOrderCrossRequestAlgo, - - from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_market_condition import CreateMultiLegOrderCrossRequestMarketCondition, - - from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_optional_data import CreateMultiLegOrderCrossRequestOptionalData, - - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - -T = TypeVar("T", bound="CreateMultiLegOrderCrossRequest") - - -@_attrs_define -class CreateMultiLegOrderCrossRequest: - """ - Attributes: - account_id (Union[Unset, int]): - allocations (Union[Unset, list['CreateMultiLegOrderCrossAllocation']]): - cross_type (Union[Unset, CrossType]): - instructions (Union[Unset, list['OrderInstruction']]): - ord_type (Union[Unset, OrdType]): - order_flags (Union[Unset, int]): - parent_ord_id (Union[Unset, str]): - price (Union[Unset, float]): - price_type (Union[Unset, PriceType]): - qty (Union[Unset, float]): - route (Union[Unset, str]): - tag (Union[Unset, str]): - text (Union[Unset, str]): - tif (Union[Unset, Tif]): - algo (Union[Unset, CreateMultiLegOrderCrossRequestAlgo]): - market_condition (Union[Unset, CreateMultiLegOrderCrossRequestMarketCondition]): - optional_data (Union[Unset, CreateMultiLegOrderCrossRequestOptionalData]): - """ - - account_id: Unset | int = UNSET - allocations: Unset | list["CreateMultiLegOrderCrossAllocation"] = UNSET - cross_type: Unset | CrossType = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - ord_type: Unset | OrdType = UNSET - order_flags: Unset | int = UNSET - parent_ord_id: Unset | str = UNSET - price: Unset | float = UNSET - price_type: Unset | PriceType = UNSET - qty: Unset | float = UNSET - route: Unset | str = UNSET - tag: Unset | str = UNSET - text: Unset | str = UNSET - tif: Unset | Tif = UNSET - algo: Union[Unset, "CreateMultiLegOrderCrossRequestAlgo"] = UNSET - market_condition: Union[Unset, "CreateMultiLegOrderCrossRequestMarketCondition"] = ( - UNSET - ) - optional_data: Union[Unset, "CreateMultiLegOrderCrossRequestOptionalData"] = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - allocations: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.allocations, Unset): - allocations = [] - for allocations_item_data in self.allocations: - allocations_item = allocations_item_data.to_dict() - allocations.append(allocations_item) - - cross_type: Unset | str = UNSET - if not isinstance(self.cross_type, Unset): - cross_type = self.cross_type.value - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value - - order_flags = self.order_flags - - parent_ord_id = self.parent_ord_id - - price = self.price - - price_type: Unset | str = UNSET - if not isinstance(self.price_type, Unset): - price_type = self.price_type.value - - qty = self.qty - - route = self.route - - tag = self.tag - - text = self.text - - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value - - algo: Unset | dict[str, Any] = UNSET - if not isinstance(self.algo, Unset): - algo = self.algo.to_dict() - - market_condition: Unset | dict[str, Any] = UNSET - if not isinstance(self.market_condition, Unset): - market_condition = self.market_condition.to_dict() - - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if allocations is not UNSET: - field_dict["allocations"] = allocations - if cross_type is not UNSET: - field_dict["crossType"] = cross_type - if instructions is not UNSET: - field_dict["instructions"] = instructions - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if order_flags is not UNSET: - field_dict["orderFlags"] = order_flags - if parent_ord_id is not UNSET: - field_dict["parentOrdId"] = parent_ord_id - if price is not UNSET: - field_dict["price"] = price - if price_type is not UNSET: - field_dict["priceType"] = price_type - if qty is not UNSET: - field_dict["qty"] = qty - if route is not UNSET: - field_dict["route"] = route - if tag is not UNSET: - field_dict["tag"] = tag - if text is not UNSET: - field_dict["text"] = text - if tif is not UNSET: - field_dict["tif"] = tif - if algo is not UNSET: - field_dict["algo"] = algo - if market_condition is not UNSET: - field_dict["marketCondition"] = market_condition - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation import CreateMultiLegOrderCrossAllocation, - - from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_algo import CreateMultiLegOrderCrossRequestAlgo, - - from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_market_condition import CreateMultiLegOrderCrossRequestMarketCondition, - - from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_optional_data import CreateMultiLegOrderCrossRequestOptionalData, - - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - allocations = [] - _allocations = d.pop("allocations", UNSET) - for allocations_item_data in _allocations or []: - allocations_item = CreateMultiLegOrderCrossAllocation.from_dict( - allocations_item_data - ) - - allocations.append(allocations_item) - - _cross_type = d.pop("crossType", UNSET) - cross_type: Unset | CrossType - if isinstance(_cross_type, Unset): - cross_type = UNSET - else: - cross_type = CrossType(_cross_type) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) - - order_flags = d.pop("orderFlags", UNSET) - - parent_ord_id = d.pop("parentOrdId", UNSET) - - price = d.pop("price", UNSET) - - _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType - if isinstance(_price_type, Unset): - price_type = UNSET - else: - price_type = PriceType(_price_type) - - qty = d.pop("qty", UNSET) - - route = d.pop("route", UNSET) - - tag = d.pop("tag", UNSET) - - text = d.pop("text", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) - - _algo = d.pop("algo", UNSET) - algo: Unset | CreateMultiLegOrderCrossRequestAlgo - if isinstance(_algo, Unset): - algo = UNSET - else: - algo = CreateMultiLegOrderCrossRequestAlgo.from_dict(_algo) - - _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | CreateMultiLegOrderCrossRequestMarketCondition - if isinstance(_market_condition, Unset): - market_condition = UNSET - else: - market_condition = CreateMultiLegOrderCrossRequestMarketCondition.from_dict( - _market_condition - ) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CreateMultiLegOrderCrossRequestOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = CreateMultiLegOrderCrossRequestOptionalData.from_dict( - _optional_data - ) - - create_multi_leg_order_cross_request = cls( - account_id=account_id, - allocations=allocations, - cross_type=cross_type, - instructions=instructions, - ord_type=ord_type, - order_flags=order_flags, - parent_ord_id=parent_ord_id, - price=price, - price_type=price_type, - qty=qty, - route=route, - tag=tag, - text=text, - tif=tif, - algo=algo, - market_condition=market_condition, - optional_data=optional_data, - ) - - return create_multi_leg_order_cross_request diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py deleted file mode 100644 index 88bb3a5a9..000000000 --- a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CreateMultiLegOrderCrossRequestAlgo") - - -@_attrs_define -class CreateMultiLegOrderCrossRequestAlgo: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_multi_leg_order_cross_request_algo = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_multi_leg_order_cross_request_algo.additional_properties = ( - additional_properties - ) - return create_multi_leg_order_cross_request_algo - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py deleted file mode 100644 index 4ed3fccd0..000000000 --- a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CreateMultiLegOrderCrossRequestMarketCondition") - - -@_attrs_define -class CreateMultiLegOrderCrossRequestMarketCondition: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_multi_leg_order_cross_request_market_condition = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_multi_leg_order_cross_request_market_condition.additional_properties = ( - additional_properties - ) - return create_multi_leg_order_cross_request_market_condition - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py deleted file mode 100644 index 0106a37a4..000000000 --- a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CreateMultiLegOrderCrossRequestOptionalData") - - -@_attrs_define -class CreateMultiLegOrderCrossRequestOptionalData: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_multi_leg_order_cross_request_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_multi_leg_order_cross_request_optional_data.additional_properties = ( - additional_properties - ) - return create_multi_leg_order_cross_request_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py deleted file mode 100644 index f3101175d..000000000 --- a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py +++ /dev/null @@ -1,79 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.multi_leg_order_cross import MultiLegOrderCross - - -T = TypeVar("T", bound="CreateMultiLegOrderCrossResponse") - - -@_attrs_define -class CreateMultiLegOrderCrossResponse: - """ - Attributes: - multi_leg_order_cross (Union[Unset, MultiLegOrderCross]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - multi_leg_order_cross: Union[Unset, "MultiLegOrderCross"] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - multi_leg_order_cross: Unset | dict[str, Any] = UNSET - if not isinstance(self.multi_leg_order_cross, Unset): - multi_leg_order_cross = self.multi_leg_order_cross.to_dict() - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if multi_leg_order_cross is not UNSET: - field_dict["multiLegOrderCross"] = multi_leg_order_cross - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.multi_leg_order_cross import MultiLegOrderCross - - d = dict(src_dict) - _multi_leg_order_cross = d.pop("multiLegOrderCross", UNSET) - multi_leg_order_cross: Unset | MultiLegOrderCross - if isinstance(_multi_leg_order_cross, Unset): - multi_leg_order_cross = UNSET - else: - multi_leg_order_cross = MultiLegOrderCross.from_dict(_multi_leg_order_cross) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - create_multi_leg_order_cross_response = cls( - multi_leg_order_cross=multi_leg_order_cross, - error_message=error_message, - status_code=status_code, - ) - - return create_multi_leg_order_cross_response diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_leg.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_leg.py deleted file mode 100644 index 1d2aa4162..000000000 --- a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_leg.py +++ /dev/null @@ -1,156 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.position_effect import PositionEffect -from openapi_project.openapi_package.models.side import Side -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.create_multi_leg_order_leg_market_condition import CreateMultiLegOrderLegMarketCondition, - - from openapi_project.openapi_package.models.create_multi_leg_order_leg_optional_data import CreateMultiLegOrderLegOptionalData, - - from openapi_project.openapi_package.models.flex_option import FlexOption - - -T = TypeVar("T", bound="CreateMultiLegOrderLeg") - - -@_attrs_define -class CreateMultiLegOrderLeg: - """ - Attributes: - position_effect (Union[Unset, PositionEffect]): - price (Union[Unset, float]): - ratio (Union[Unset, int]): - side (Union[Unset, Side]): - symbol (Union[Unset, str]): - market_condition (Union[Unset, CreateMultiLegOrderLegMarketCondition]): - optional_data (Union[Unset, CreateMultiLegOrderLegOptionalData]): - flex_option (Union[Unset, FlexOption]): - """ - - position_effect: Unset | PositionEffect = UNSET - price: Unset | float = UNSET - ratio: Unset | int = UNSET - side: Unset | Side = UNSET - symbol: Unset | str = UNSET - market_condition: Union[Unset, "CreateMultiLegOrderLegMarketCondition"] = UNSET - optional_data: Union[Unset, "CreateMultiLegOrderLegOptionalData"] = UNSET - flex_option: Union[Unset, "FlexOption"] = UNSET - - def to_dict(self) -> dict[str, Any]: - position_effect: Unset | str = UNSET - if not isinstance(self.position_effect, Unset): - position_effect = self.position_effect.value - - price = self.price - - ratio = self.ratio - - side: Unset | str = UNSET - if not isinstance(self.side, Unset): - side = self.side.value - - symbol = self.symbol - - market_condition: Unset | dict[str, Any] = UNSET - if not isinstance(self.market_condition, Unset): - market_condition = self.market_condition.to_dict() - - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() - - flex_option: Unset | dict[str, Any] = UNSET - if not isinstance(self.flex_option, Unset): - flex_option = self.flex_option.to_dict() - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if position_effect is not UNSET: - field_dict["positionEffect"] = position_effect - if price is not UNSET: - field_dict["price"] = price - if ratio is not UNSET: - field_dict["ratio"] = ratio - if side is not UNSET: - field_dict["side"] = side - if symbol is not UNSET: - field_dict["symbol"] = symbol - if market_condition is not UNSET: - field_dict["marketCondition"] = market_condition - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if flex_option is not UNSET: - field_dict["flexOption"] = flex_option - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.create_multi_leg_order_leg_market_condition import CreateMultiLegOrderLegMarketCondition, - - from openapi_project.openapi_package.models.create_multi_leg_order_leg_optional_data import CreateMultiLegOrderLegOptionalData, - - from openapi_project.openapi_package.models.flex_option import FlexOption - - d = dict(src_dict) - _position_effect = d.pop("positionEffect", UNSET) - position_effect: Unset | PositionEffect - if isinstance(_position_effect, Unset): - position_effect = UNSET - else: - position_effect = PositionEffect(_position_effect) - - price = d.pop("price", UNSET) - - ratio = d.pop("ratio", UNSET) - - _side = d.pop("side", UNSET) - side: Unset | Side - if isinstance(_side, Unset): - side = UNSET - else: - side = Side(_side) - - symbol = d.pop("symbol", UNSET) - - _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | CreateMultiLegOrderLegMarketCondition - if isinstance(_market_condition, Unset): - market_condition = UNSET - else: - market_condition = CreateMultiLegOrderLegMarketCondition.from_dict( - _market_condition - ) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CreateMultiLegOrderLegOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = CreateMultiLegOrderLegOptionalData.from_dict(_optional_data) - - _flex_option = d.pop("flexOption", UNSET) - flex_option: Unset | FlexOption - if isinstance(_flex_option, Unset): - flex_option = UNSET - else: - flex_option = FlexOption.from_dict(_flex_option) - - create_multi_leg_order_leg = cls( - position_effect=position_effect, - price=price, - ratio=ratio, - side=side, - symbol=symbol, - market_condition=market_condition, - optional_data=optional_data, - flex_option=flex_option, - ) - - return create_multi_leg_order_leg diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py deleted file mode 100644 index dc7f302a5..000000000 --- a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CreateMultiLegOrderLegMarketCondition") - - -@_attrs_define -class CreateMultiLegOrderLegMarketCondition: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_multi_leg_order_leg_market_condition = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_multi_leg_order_leg_market_condition.additional_properties = ( - additional_properties - ) - return create_multi_leg_order_leg_market_condition - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py deleted file mode 100644 index c2abc7171..000000000 --- a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CreateMultiLegOrderLegOptionalData") - - -@_attrs_define -class CreateMultiLegOrderLegOptionalData: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_multi_leg_order_leg_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_multi_leg_order_leg_optional_data.additional_properties = ( - additional_properties - ) - return create_multi_leg_order_leg_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_request.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_request.py deleted file mode 100644 index 5609d0f7c..000000000 --- a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_request.py +++ /dev/null @@ -1,291 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.price_type import PriceType -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.create_multi_leg_order_leg import CreateMultiLegOrderLeg - from openapi_project.openapi_package.models.create_multi_leg_order_request_algo import CreateMultiLegOrderRequestAlgo, - - from openapi_project.openapi_package.models.create_multi_leg_order_request_market_condition import CreateMultiLegOrderRequestMarketCondition, - - from openapi_project.openapi_package.models.create_multi_leg_order_request_optional_data import CreateMultiLegOrderRequestOptionalData, - - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - -T = TypeVar("T", bound="CreateMultiLegOrderRequest") - - -@_attrs_define -class CreateMultiLegOrderRequest: - """ - Attributes: - account_id (Union[Unset, int]): - aux_price (Union[Unset, float]): - clearing_info (Union[Unset, ClearingInfo]): - instructions (Union[Unset, list['OrderInstruction']]): - legs (Union[Unset, list['CreateMultiLegOrderLeg']]): - ord_type (Union[Unset, OrdType]): - order_flags (Union[Unset, int]): - parent_ord_id (Union[Unset, str]): - price (Union[Unset, float]): - price_type (Union[Unset, PriceType]): - qty (Union[Unset, float]): - route (Union[Unset, str]): - tag (Union[Unset, str]): - text (Union[Unset, str]): - tif (Union[Unset, Tif]): - algo (Union[Unset, CreateMultiLegOrderRequestAlgo]): - market_condition (Union[Unset, CreateMultiLegOrderRequestMarketCondition]): - optional_data (Union[Unset, CreateMultiLegOrderRequestOptionalData]): - """ - - account_id: Unset | int = UNSET - aux_price: Unset | float = UNSET - clearing_info: Union[Unset, "ClearingInfo"] = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - legs: Unset | list["CreateMultiLegOrderLeg"] = UNSET - ord_type: Unset | OrdType = UNSET - order_flags: Unset | int = UNSET - parent_ord_id: Unset | str = UNSET - price: Unset | float = UNSET - price_type: Unset | PriceType = UNSET - qty: Unset | float = UNSET - route: Unset | str = UNSET - tag: Unset | str = UNSET - text: Unset | str = UNSET - tif: Unset | Tif = UNSET - algo: Union[Unset, "CreateMultiLegOrderRequestAlgo"] = UNSET - market_condition: Union[Unset, "CreateMultiLegOrderRequestMarketCondition"] = UNSET - optional_data: Union[Unset, "CreateMultiLegOrderRequestOptionalData"] = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - aux_price = self.aux_price - - clearing_info: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_info, Unset): - clearing_info = self.clearing_info.to_dict() - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - legs: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.legs, Unset): - legs = [] - for legs_item_data in self.legs: - legs_item = legs_item_data.to_dict() - legs.append(legs_item) - - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value - - order_flags = self.order_flags - - parent_ord_id = self.parent_ord_id - - price = self.price - - price_type: Unset | str = UNSET - if not isinstance(self.price_type, Unset): - price_type = self.price_type.value - - qty = self.qty - - route = self.route - - tag = self.tag - - text = self.text - - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value - - algo: Unset | dict[str, Any] = UNSET - if not isinstance(self.algo, Unset): - algo = self.algo.to_dict() - - market_condition: Unset | dict[str, Any] = UNSET - if not isinstance(self.market_condition, Unset): - market_condition = self.market_condition.to_dict() - - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if aux_price is not UNSET: - field_dict["auxPrice"] = aux_price - if clearing_info is not UNSET: - field_dict["clearingInfo"] = clearing_info - if instructions is not UNSET: - field_dict["instructions"] = instructions - if legs is not UNSET: - field_dict["legs"] = legs - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if order_flags is not UNSET: - field_dict["orderFlags"] = order_flags - if parent_ord_id is not UNSET: - field_dict["parentOrdId"] = parent_ord_id - if price is not UNSET: - field_dict["price"] = price - if price_type is not UNSET: - field_dict["priceType"] = price_type - if qty is not UNSET: - field_dict["qty"] = qty - if route is not UNSET: - field_dict["route"] = route - if tag is not UNSET: - field_dict["tag"] = tag - if text is not UNSET: - field_dict["text"] = text - if tif is not UNSET: - field_dict["tif"] = tif - if algo is not UNSET: - field_dict["algo"] = algo - if market_condition is not UNSET: - field_dict["marketCondition"] = market_condition - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.create_multi_leg_order_leg import CreateMultiLegOrderLeg - from openapi_project.openapi_package.models.create_multi_leg_order_request_algo import CreateMultiLegOrderRequestAlgo, - - from openapi_project.openapi_package.models.create_multi_leg_order_request_market_condition import CreateMultiLegOrderRequestMarketCondition, - - from openapi_project.openapi_package.models.create_multi_leg_order_request_optional_data import CreateMultiLegOrderRequestOptionalData, - - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - aux_price = d.pop("auxPrice", UNSET) - - _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo - if isinstance(_clearing_info, Unset): - clearing_info = UNSET - else: - clearing_info = ClearingInfo.from_dict(_clearing_info) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - legs = [] - _legs = d.pop("legs", UNSET) - for legs_item_data in _legs or []: - legs_item = CreateMultiLegOrderLeg.from_dict(legs_item_data) - - legs.append(legs_item) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) - - order_flags = d.pop("orderFlags", UNSET) - - parent_ord_id = d.pop("parentOrdId", UNSET) - - price = d.pop("price", UNSET) - - _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType - if isinstance(_price_type, Unset): - price_type = UNSET - else: - price_type = PriceType(_price_type) - - qty = d.pop("qty", UNSET) - - route = d.pop("route", UNSET) - - tag = d.pop("tag", UNSET) - - text = d.pop("text", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) - - _algo = d.pop("algo", UNSET) - algo: Unset | CreateMultiLegOrderRequestAlgo - if isinstance(_algo, Unset): - algo = UNSET - else: - algo = CreateMultiLegOrderRequestAlgo.from_dict(_algo) - - _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | CreateMultiLegOrderRequestMarketCondition - if isinstance(_market_condition, Unset): - market_condition = UNSET - else: - market_condition = CreateMultiLegOrderRequestMarketCondition.from_dict( - _market_condition - ) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CreateMultiLegOrderRequestOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = CreateMultiLegOrderRequestOptionalData.from_dict( - _optional_data - ) - - create_multi_leg_order_request = cls( - account_id=account_id, - aux_price=aux_price, - clearing_info=clearing_info, - instructions=instructions, - legs=legs, - ord_type=ord_type, - order_flags=order_flags, - parent_ord_id=parent_ord_id, - price=price, - price_type=price_type, - qty=qty, - route=route, - tag=tag, - text=text, - tif=tif, - algo=algo, - market_condition=market_condition, - optional_data=optional_data, - ) - - return create_multi_leg_order_request diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py deleted file mode 100644 index 1c3365cc6..000000000 --- a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CreateMultiLegOrderRequestAlgo") - - -@_attrs_define -class CreateMultiLegOrderRequestAlgo: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_multi_leg_order_request_algo = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_multi_leg_order_request_algo.additional_properties = ( - additional_properties - ) - return create_multi_leg_order_request_algo - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py deleted file mode 100644 index 801f1b5d2..000000000 --- a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CreateMultiLegOrderRequestMarketCondition") - - -@_attrs_define -class CreateMultiLegOrderRequestMarketCondition: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_multi_leg_order_request_market_condition = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_multi_leg_order_request_market_condition.additional_properties = ( - additional_properties - ) - return create_multi_leg_order_request_market_condition - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py deleted file mode 100644 index 80c559ed0..000000000 --- a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CreateMultiLegOrderRequestOptionalData") - - -@_attrs_define -class CreateMultiLegOrderRequestOptionalData: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_multi_leg_order_request_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_multi_leg_order_request_optional_data.additional_properties = ( - additional_properties - ) - return create_multi_leg_order_request_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_response.py b/openapi/openapi_project/openapi_package/models/create_multi_leg_order_response.py deleted file mode 100644 index c586092f2..000000000 --- a/openapi/openapi_project/openapi_package/models/create_multi_leg_order_response.py +++ /dev/null @@ -1,79 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.multi_leg_order import MultiLegOrder - - -T = TypeVar("T", bound="CreateMultiLegOrderResponse") - - -@_attrs_define -class CreateMultiLegOrderResponse: - """ - Attributes: - multi_leg_order (Union[Unset, MultiLegOrder]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - multi_leg_order: Union[Unset, "MultiLegOrder"] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - multi_leg_order: Unset | dict[str, Any] = UNSET - if not isinstance(self.multi_leg_order, Unset): - multi_leg_order = self.multi_leg_order.to_dict() - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if multi_leg_order is not UNSET: - field_dict["multiLegOrder"] = multi_leg_order - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.multi_leg_order import MultiLegOrder - - d = dict(src_dict) - _multi_leg_order = d.pop("multiLegOrder", UNSET) - multi_leg_order: Unset | MultiLegOrder - if isinstance(_multi_leg_order, Unset): - multi_leg_order = UNSET - else: - multi_leg_order = MultiLegOrder.from_dict(_multi_leg_order) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - create_multi_leg_order_response = cls( - multi_leg_order=multi_leg_order, - error_message=error_message, - status_code=status_code, - ) - - return create_multi_leg_order_response diff --git a/openapi/openapi_project/openapi_package/models/create_order_cross_allocation.py b/openapi/openapi_project/openapi_package/models/create_order_cross_allocation.py deleted file mode 100644 index 2d8333a9d..000000000 --- a/openapi/openapi_project/openapi_package/models/create_order_cross_allocation.py +++ /dev/null @@ -1,165 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.cross_side_type import CrossSideType -from openapi_project.openapi_package.models.position_effect import PositionEffect -from openapi_project.openapi_package.models.side import Side -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.create_order_cross_allocation_optional_data import CreateOrderCrossAllocationOptionalData, - - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - -T = TypeVar("T", bound="CreateOrderCrossAllocation") - - -@_attrs_define -class CreateOrderCrossAllocation: - """ - Attributes: - account_id (Union[Unset, int]): - clearing_info (Union[Unset, ClearingInfo]): - instructions (Union[Unset, list['OrderInstruction']]): - optional_data (Union[Unset, CreateOrderCrossAllocationOptionalData]): - position_effect (Union[Unset, PositionEffect]): - qty (Union[Unset, float]): - side (Union[Unset, Side]): - side_type (Union[Unset, CrossSideType]): - """ - - account_id: Unset | int = UNSET - clearing_info: Union[Unset, "ClearingInfo"] = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - optional_data: Union[Unset, "CreateOrderCrossAllocationOptionalData"] = UNSET - position_effect: Unset | PositionEffect = UNSET - qty: Unset | float = UNSET - side: Unset | Side = UNSET - side_type: Unset | CrossSideType = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - clearing_info: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_info, Unset): - clearing_info = self.clearing_info.to_dict() - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() - - position_effect: Unset | str = UNSET - if not isinstance(self.position_effect, Unset): - position_effect = self.position_effect.value - - qty = self.qty - - side: Unset | str = UNSET - if not isinstance(self.side, Unset): - side = self.side.value - - side_type: Unset | str = UNSET - if not isinstance(self.side_type, Unset): - side_type = self.side_type.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if clearing_info is not UNSET: - field_dict["clearingInfo"] = clearing_info - if instructions is not UNSET: - field_dict["instructions"] = instructions - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if position_effect is not UNSET: - field_dict["positionEffect"] = position_effect - if qty is not UNSET: - field_dict["qty"] = qty - if side is not UNSET: - field_dict["side"] = side - if side_type is not UNSET: - field_dict["sideType"] = side_type - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.create_order_cross_allocation_optional_data import CreateOrderCrossAllocationOptionalData, - - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo - if isinstance(_clearing_info, Unset): - clearing_info = UNSET - else: - clearing_info = ClearingInfo.from_dict(_clearing_info) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CreateOrderCrossAllocationOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = CreateOrderCrossAllocationOptionalData.from_dict( - _optional_data - ) - - _position_effect = d.pop("positionEffect", UNSET) - position_effect: Unset | PositionEffect - if isinstance(_position_effect, Unset): - position_effect = UNSET - else: - position_effect = PositionEffect(_position_effect) - - qty = d.pop("qty", UNSET) - - _side = d.pop("side", UNSET) - side: Unset | Side - if isinstance(_side, Unset): - side = UNSET - else: - side = Side(_side) - - _side_type = d.pop("sideType", UNSET) - side_type: Unset | CrossSideType - if isinstance(_side_type, Unset): - side_type = UNSET - else: - side_type = CrossSideType(_side_type) - - create_order_cross_allocation = cls( - account_id=account_id, - clearing_info=clearing_info, - instructions=instructions, - optional_data=optional_data, - position_effect=position_effect, - qty=qty, - side=side, - side_type=side_type, - ) - - return create_order_cross_allocation diff --git a/openapi/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py b/openapi/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py deleted file mode 100644 index e8bb12c13..000000000 --- a/openapi/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CreateOrderCrossAllocationOptionalData") - - -@_attrs_define -class CreateOrderCrossAllocationOptionalData: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_order_cross_allocation_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_order_cross_allocation_optional_data.additional_properties = ( - additional_properties - ) - return create_order_cross_allocation_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_order_cross_request.py b/openapi/openapi_project/openapi_package/models/create_order_cross_request.py deleted file mode 100644 index db924575b..000000000 --- a/openapi/openapi_project/openapi_package/models/create_order_cross_request.py +++ /dev/null @@ -1,308 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.cross_type import CrossType -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.price_type import PriceType -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.create_order_cross_allocation import CreateOrderCrossAllocation - from openapi_project.openapi_package.models.create_order_cross_request_algo import CreateOrderCrossRequestAlgo - from openapi_project.openapi_package.models.create_order_cross_request_market_condition import CreateOrderCrossRequestMarketCondition, - - from openapi_project.openapi_package.models.create_order_cross_request_optional_data import CreateOrderCrossRequestOptionalData, - - from openapi_project.openapi_package.models.flex_option import FlexOption - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - -T = TypeVar("T", bound="CreateOrderCrossRequest") - - -@_attrs_define -class CreateOrderCrossRequest: - """ - Attributes: - account_id (Union[Unset, int]): - allocations (Union[Unset, list['CreateOrderCrossAllocation']]): - cross_type (Union[Unset, CrossType]): - instructions (Union[Unset, list['OrderInstruction']]): - ord_type (Union[Unset, OrdType]): - order_flags (Union[Unset, int]): - parent_ord_id (Union[Unset, str]): - price (Union[Unset, float]): - price_type (Union[Unset, PriceType]): - qty (Union[Unset, float]): - route (Union[Unset, str]): - symbol (Union[Unset, str]): - tag (Union[Unset, str]): - text (Union[Unset, str]): - tif (Union[Unset, Tif]): - algo (Union[Unset, CreateOrderCrossRequestAlgo]): - market_condition (Union[Unset, CreateOrderCrossRequestMarketCondition]): - optional_data (Union[Unset, CreateOrderCrossRequestOptionalData]): - flex_option (Union[Unset, FlexOption]): - """ - - account_id: Unset | int = UNSET - allocations: Unset | list["CreateOrderCrossAllocation"] = UNSET - cross_type: Unset | CrossType = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - ord_type: Unset | OrdType = UNSET - order_flags: Unset | int = UNSET - parent_ord_id: Unset | str = UNSET - price: Unset | float = UNSET - price_type: Unset | PriceType = UNSET - qty: Unset | float = UNSET - route: Unset | str = UNSET - symbol: Unset | str = UNSET - tag: Unset | str = UNSET - text: Unset | str = UNSET - tif: Unset | Tif = UNSET - algo: Union[Unset, "CreateOrderCrossRequestAlgo"] = UNSET - market_condition: Union[Unset, "CreateOrderCrossRequestMarketCondition"] = UNSET - optional_data: Union[Unset, "CreateOrderCrossRequestOptionalData"] = UNSET - flex_option: Union[Unset, "FlexOption"] = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - allocations: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.allocations, Unset): - allocations = [] - for allocations_item_data in self.allocations: - allocations_item = allocations_item_data.to_dict() - allocations.append(allocations_item) - - cross_type: Unset | str = UNSET - if not isinstance(self.cross_type, Unset): - cross_type = self.cross_type.value - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value - - order_flags = self.order_flags - - parent_ord_id = self.parent_ord_id - - price = self.price - - price_type: Unset | str = UNSET - if not isinstance(self.price_type, Unset): - price_type = self.price_type.value - - qty = self.qty - - route = self.route - - symbol = self.symbol - - tag = self.tag - - text = self.text - - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value - - algo: Unset | dict[str, Any] = UNSET - if not isinstance(self.algo, Unset): - algo = self.algo.to_dict() - - market_condition: Unset | dict[str, Any] = UNSET - if not isinstance(self.market_condition, Unset): - market_condition = self.market_condition.to_dict() - - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() - - flex_option: Unset | dict[str, Any] = UNSET - if not isinstance(self.flex_option, Unset): - flex_option = self.flex_option.to_dict() - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if allocations is not UNSET: - field_dict["allocations"] = allocations - if cross_type is not UNSET: - field_dict["crossType"] = cross_type - if instructions is not UNSET: - field_dict["instructions"] = instructions - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if order_flags is not UNSET: - field_dict["orderFlags"] = order_flags - if parent_ord_id is not UNSET: - field_dict["parentOrdId"] = parent_ord_id - if price is not UNSET: - field_dict["price"] = price - if price_type is not UNSET: - field_dict["priceType"] = price_type - if qty is not UNSET: - field_dict["qty"] = qty - if route is not UNSET: - field_dict["route"] = route - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tag is not UNSET: - field_dict["tag"] = tag - if text is not UNSET: - field_dict["text"] = text - if tif is not UNSET: - field_dict["tif"] = tif - if algo is not UNSET: - field_dict["algo"] = algo - if market_condition is not UNSET: - field_dict["marketCondition"] = market_condition - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if flex_option is not UNSET: - field_dict["flexOption"] = flex_option - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.create_order_cross_allocation import CreateOrderCrossAllocation - from openapi_project.openapi_package.models.create_order_cross_request_algo import CreateOrderCrossRequestAlgo - from openapi_project.openapi_package.models.create_order_cross_request_market_condition import CreateOrderCrossRequestMarketCondition, - - from openapi_project.openapi_package.models.create_order_cross_request_optional_data import CreateOrderCrossRequestOptionalData, - - from openapi_project.openapi_package.models.flex_option import FlexOption - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - allocations = [] - _allocations = d.pop("allocations", UNSET) - for allocations_item_data in _allocations or []: - allocations_item = CreateOrderCrossAllocation.from_dict( - allocations_item_data - ) - - allocations.append(allocations_item) - - _cross_type = d.pop("crossType", UNSET) - cross_type: Unset | CrossType - if isinstance(_cross_type, Unset): - cross_type = UNSET - else: - cross_type = CrossType(_cross_type) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) - - order_flags = d.pop("orderFlags", UNSET) - - parent_ord_id = d.pop("parentOrdId", UNSET) - - price = d.pop("price", UNSET) - - _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType - if isinstance(_price_type, Unset): - price_type = UNSET - else: - price_type = PriceType(_price_type) - - qty = d.pop("qty", UNSET) - - route = d.pop("route", UNSET) - - symbol = d.pop("symbol", UNSET) - - tag = d.pop("tag", UNSET) - - text = d.pop("text", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) - - _algo = d.pop("algo", UNSET) - algo: Unset | CreateOrderCrossRequestAlgo - if isinstance(_algo, Unset): - algo = UNSET - else: - algo = CreateOrderCrossRequestAlgo.from_dict(_algo) - - _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | CreateOrderCrossRequestMarketCondition - if isinstance(_market_condition, Unset): - market_condition = UNSET - else: - market_condition = CreateOrderCrossRequestMarketCondition.from_dict( - _market_condition - ) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CreateOrderCrossRequestOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = CreateOrderCrossRequestOptionalData.from_dict( - _optional_data - ) - - _flex_option = d.pop("flexOption", UNSET) - flex_option: Unset | FlexOption - if isinstance(_flex_option, Unset): - flex_option = UNSET - else: - flex_option = FlexOption.from_dict(_flex_option) - - create_order_cross_request = cls( - account_id=account_id, - allocations=allocations, - cross_type=cross_type, - instructions=instructions, - ord_type=ord_type, - order_flags=order_flags, - parent_ord_id=parent_ord_id, - price=price, - price_type=price_type, - qty=qty, - route=route, - symbol=symbol, - tag=tag, - text=text, - tif=tif, - algo=algo, - market_condition=market_condition, - optional_data=optional_data, - flex_option=flex_option, - ) - - return create_order_cross_request diff --git a/openapi/openapi_project/openapi_package/models/create_order_cross_request_algo.py b/openapi/openapi_project/openapi_package/models/create_order_cross_request_algo.py deleted file mode 100644 index aa0a3120d..000000000 --- a/openapi/openapi_project/openapi_package/models/create_order_cross_request_algo.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CreateOrderCrossRequestAlgo") - - -@_attrs_define -class CreateOrderCrossRequestAlgo: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_order_cross_request_algo = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_order_cross_request_algo.additional_properties = additional_properties - return create_order_cross_request_algo - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py b/openapi/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py deleted file mode 100644 index ee5a05afd..000000000 --- a/openapi/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CreateOrderCrossRequestMarketCondition") - - -@_attrs_define -class CreateOrderCrossRequestMarketCondition: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_order_cross_request_market_condition = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_order_cross_request_market_condition.additional_properties = ( - additional_properties - ) - return create_order_cross_request_market_condition - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py b/openapi/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py deleted file mode 100644 index 1ab09a7be..000000000 --- a/openapi/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CreateOrderCrossRequestOptionalData") - - -@_attrs_define -class CreateOrderCrossRequestOptionalData: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_order_cross_request_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_order_cross_request_optional_data.additional_properties = ( - additional_properties - ) - return create_order_cross_request_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_order_cross_response.py b/openapi/openapi_project/openapi_package/models/create_order_cross_response.py deleted file mode 100644 index 1d2de4eef..000000000 --- a/openapi/openapi_project/openapi_package/models/create_order_cross_response.py +++ /dev/null @@ -1,79 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_cross import OrderCross - - -T = TypeVar("T", bound="CreateOrderCrossResponse") - - -@_attrs_define -class CreateOrderCrossResponse: - """ - Attributes: - order_cross (Union[Unset, OrderCross]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - order_cross: Union[Unset, "OrderCross"] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - order_cross: Unset | dict[str, Any] = UNSET - if not isinstance(self.order_cross, Unset): - order_cross = self.order_cross.to_dict() - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if order_cross is not UNSET: - field_dict["orderCross"] = order_cross - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.order_cross import OrderCross - - d = dict(src_dict) - _order_cross = d.pop("orderCross", UNSET) - order_cross: Unset | OrderCross - if isinstance(_order_cross, Unset): - order_cross = UNSET - else: - order_cross = OrderCross.from_dict(_order_cross) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - create_order_cross_response = cls( - order_cross=order_cross, - error_message=error_message, - status_code=status_code, - ) - - return create_order_cross_response diff --git a/openapi/openapi_project/openapi_package/models/create_order_request.py b/openapi/openapi_project/openapi_package/models/create_order_request.py deleted file mode 100644 index 2c9ee3780..000000000 --- a/openapi/openapi_project/openapi_package/models/create_order_request.py +++ /dev/null @@ -1,327 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.position_effect import PositionEffect -from openapi_project.openapi_package.models.price_type import PriceType -from openapi_project.openapi_package.models.side import Side -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.create_order_request_algo import CreateOrderRequestAlgo - from openapi_project.openapi_package.models.create_order_request_market_condition import CreateOrderRequestMarketCondition, - - from openapi_project.openapi_package.models.create_order_request_optional_data import CreateOrderRequestOptionalData, - - from openapi_project.openapi_package.models.flex_option import FlexOption - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - -T = TypeVar("T", bound="CreateOrderRequest") - - -@_attrs_define -class CreateOrderRequest: - """ - Attributes: - account_id (Union[Unset, int]): - aux_price (Union[Unset, float]): - clearing_info (Union[Unset, ClearingInfo]): - instructions (Union[Unset, list['OrderInstruction']]): - ord_type (Union[Unset, OrdType]): - order_flags (Union[Unset, int]): - parent_ord_id (Union[Unset, str]): - position_effect (Union[Unset, PositionEffect]): - price (Union[Unset, float]): - price_type (Union[Unset, PriceType]): - qty (Union[Unset, float]): - route (Union[Unset, str]): - side (Union[Unset, Side]): - symbol (Union[Unset, str]): - tag (Union[Unset, str]): - text (Union[Unset, str]): - tif (Union[Unset, Tif]): - algo (Union[Unset, CreateOrderRequestAlgo]): - market_condition (Union[Unset, CreateOrderRequestMarketCondition]): - optional_data (Union[Unset, CreateOrderRequestOptionalData]): - flex_option (Union[Unset, FlexOption]): - """ - - account_id: Unset | int = UNSET - aux_price: Unset | float = UNSET - clearing_info: Union[Unset, "ClearingInfo"] = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - ord_type: Unset | OrdType = UNSET - order_flags: Unset | int = UNSET - parent_ord_id: Unset | str = UNSET - position_effect: Unset | PositionEffect = UNSET - price: Unset | float = UNSET - price_type: Unset | PriceType = UNSET - qty: Unset | float = UNSET - route: Unset | str = UNSET - side: Unset | Side = UNSET - symbol: Unset | str = UNSET - tag: Unset | str = UNSET - text: Unset | str = UNSET - tif: Unset | Tif = UNSET - algo: Union[Unset, "CreateOrderRequestAlgo"] = UNSET - market_condition: Union[Unset, "CreateOrderRequestMarketCondition"] = UNSET - optional_data: Union[Unset, "CreateOrderRequestOptionalData"] = UNSET - flex_option: Union[Unset, "FlexOption"] = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - aux_price = self.aux_price - - clearing_info: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_info, Unset): - clearing_info = self.clearing_info.to_dict() - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value - - order_flags = self.order_flags - - parent_ord_id = self.parent_ord_id - - position_effect: Unset | str = UNSET - if not isinstance(self.position_effect, Unset): - position_effect = self.position_effect.value - - price = self.price - - price_type: Unset | str = UNSET - if not isinstance(self.price_type, Unset): - price_type = self.price_type.value - - qty = self.qty - - route = self.route - - side: Unset | str = UNSET - if not isinstance(self.side, Unset): - side = self.side.value - - symbol = self.symbol - - tag = self.tag - - text = self.text - - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value - - algo: Unset | dict[str, Any] = UNSET - if not isinstance(self.algo, Unset): - algo = self.algo.to_dict() - - market_condition: Unset | dict[str, Any] = UNSET - if not isinstance(self.market_condition, Unset): - market_condition = self.market_condition.to_dict() - - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() - - flex_option: Unset | dict[str, Any] = UNSET - if not isinstance(self.flex_option, Unset): - flex_option = self.flex_option.to_dict() - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if aux_price is not UNSET: - field_dict["auxPrice"] = aux_price - if clearing_info is not UNSET: - field_dict["clearingInfo"] = clearing_info - if instructions is not UNSET: - field_dict["instructions"] = instructions - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if order_flags is not UNSET: - field_dict["orderFlags"] = order_flags - if parent_ord_id is not UNSET: - field_dict["parentOrdId"] = parent_ord_id - if position_effect is not UNSET: - field_dict["positionEffect"] = position_effect - if price is not UNSET: - field_dict["price"] = price - if price_type is not UNSET: - field_dict["priceType"] = price_type - if qty is not UNSET: - field_dict["qty"] = qty - if route is not UNSET: - field_dict["route"] = route - if side is not UNSET: - field_dict["side"] = side - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tag is not UNSET: - field_dict["tag"] = tag - if text is not UNSET: - field_dict["text"] = text - if tif is not UNSET: - field_dict["tif"] = tif - if algo is not UNSET: - field_dict["algo"] = algo - if market_condition is not UNSET: - field_dict["marketCondition"] = market_condition - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if flex_option is not UNSET: - field_dict["flexOption"] = flex_option - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.create_order_request_algo import CreateOrderRequestAlgo - from openapi_project.openapi_package.models.create_order_request_market_condition import CreateOrderRequestMarketCondition, - - from openapi_project.openapi_package.models.create_order_request_optional_data import CreateOrderRequestOptionalData, - - from openapi_project.openapi_package.models.flex_option import FlexOption - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - aux_price = d.pop("auxPrice", UNSET) - - _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo - if isinstance(_clearing_info, Unset): - clearing_info = UNSET - else: - clearing_info = ClearingInfo.from_dict(_clearing_info) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) - - order_flags = d.pop("orderFlags", UNSET) - - parent_ord_id = d.pop("parentOrdId", UNSET) - - _position_effect = d.pop("positionEffect", UNSET) - position_effect: Unset | PositionEffect - if isinstance(_position_effect, Unset): - position_effect = UNSET - else: - position_effect = PositionEffect(_position_effect) - - price = d.pop("price", UNSET) - - _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType - if isinstance(_price_type, Unset): - price_type = UNSET - else: - price_type = PriceType(_price_type) - - qty = d.pop("qty", UNSET) - - route = d.pop("route", UNSET) - - _side = d.pop("side", UNSET) - side: Unset | Side - if isinstance(_side, Unset): - side = UNSET - else: - side = Side(_side) - - symbol = d.pop("symbol", UNSET) - - tag = d.pop("tag", UNSET) - - text = d.pop("text", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) - - _algo = d.pop("algo", UNSET) - algo: Unset | CreateOrderRequestAlgo - if isinstance(_algo, Unset): - algo = UNSET - else: - algo = CreateOrderRequestAlgo.from_dict(_algo) - - _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | CreateOrderRequestMarketCondition - if isinstance(_market_condition, Unset): - market_condition = UNSET - else: - market_condition = CreateOrderRequestMarketCondition.from_dict( - _market_condition - ) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CreateOrderRequestOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = CreateOrderRequestOptionalData.from_dict(_optional_data) - - _flex_option = d.pop("flexOption", UNSET) - flex_option: Unset | FlexOption - if isinstance(_flex_option, Unset): - flex_option = UNSET - else: - flex_option = FlexOption.from_dict(_flex_option) - - create_order_request = cls( - account_id=account_id, - aux_price=aux_price, - clearing_info=clearing_info, - instructions=instructions, - ord_type=ord_type, - order_flags=order_flags, - parent_ord_id=parent_ord_id, - position_effect=position_effect, - price=price, - price_type=price_type, - qty=qty, - route=route, - side=side, - symbol=symbol, - tag=tag, - text=text, - tif=tif, - algo=algo, - market_condition=market_condition, - optional_data=optional_data, - flex_option=flex_option, - ) - - return create_order_request diff --git a/openapi/openapi_project/openapi_package/models/create_order_request_algo.py b/openapi/openapi_project/openapi_package/models/create_order_request_algo.py deleted file mode 100644 index e3d00825a..000000000 --- a/openapi/openapi_project/openapi_package/models/create_order_request_algo.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CreateOrderRequestAlgo") - - -@_attrs_define -class CreateOrderRequestAlgo: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_order_request_algo = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_order_request_algo.additional_properties = additional_properties - return create_order_request_algo - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_order_request_market_condition.py b/openapi/openapi_project/openapi_package/models/create_order_request_market_condition.py deleted file mode 100644 index 00153a8a6..000000000 --- a/openapi/openapi_project/openapi_package/models/create_order_request_market_condition.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CreateOrderRequestMarketCondition") - - -@_attrs_define -class CreateOrderRequestMarketCondition: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_order_request_market_condition = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_order_request_market_condition.additional_properties = ( - additional_properties - ) - return create_order_request_market_condition - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_order_request_optional_data.py b/openapi/openapi_project/openapi_package/models/create_order_request_optional_data.py deleted file mode 100644 index a6246ddf4..000000000 --- a/openapi/openapi_project/openapi_package/models/create_order_request_optional_data.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CreateOrderRequestOptionalData") - - -@_attrs_define -class CreateOrderRequestOptionalData: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_order_request_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_order_request_optional_data.additional_properties = additional_properties - return create_order_request_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/create_order_response.py b/openapi/openapi_project/openapi_package/models/create_order_response.py deleted file mode 100644 index dae330db9..000000000 --- a/openapi/openapi_project/openapi_package/models/create_order_response.py +++ /dev/null @@ -1,79 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.order import Order - - -T = TypeVar("T", bound="CreateOrderResponse") - - -@_attrs_define -class CreateOrderResponse: - """ - Attributes: - order (Union[Unset, Order]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - order: Union[Unset, "Order"] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - order: Unset | dict[str, Any] = UNSET - if not isinstance(self.order, Unset): - order = self.order.to_dict() - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if order is not UNSET: - field_dict["order"] = order - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.order import Order - - d = dict(src_dict) - _order = d.pop("order", UNSET) - order: Unset | Order - if isinstance(_order, Unset): - order = UNSET - else: - order = Order.from_dict(_order) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - create_order_response = cls( - order=order, - error_message=error_message, - status_code=status_code, - ) - - return create_order_response diff --git a/openapi/openapi_project/openapi_package/models/cross_side_type.py b/openapi/openapi_project/openapi_package/models/cross_side_type.py deleted file mode 100644 index 31e60a925..000000000 --- a/openapi/openapi_project/openapi_package/models/cross_side_type.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class CrossSideType(str, Enum): - CROSS_SIDE_TYPE_AGENCY = "CROSS_SIDE_TYPE_AGENCY" - CROSS_SIDE_TYPE_CONTRA = "CROSS_SIDE_TYPE_CONTRA" - CROSS_SIDE_TYPE_UNDEFINED = "CROSS_SIDE_TYPE_UNDEFINED" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/cross_type.py b/openapi/openapi_project/openapi_package/models/cross_type.py deleted file mode 100644 index 41cbd00c3..000000000 --- a/openapi/openapi_project/openapi_package/models/cross_type.py +++ /dev/null @@ -1,20 +0,0 @@ -from enum import Enum - - -class CrossType(str, Enum): - CROSS_TYPE_AIM = "CROSS_TYPE_AIM" - CROSS_TYPE_BAM = "CROSS_TYPE_BAM" - CROSS_TYPE_C2C = "CROSS_TYPE_C2C" - CROSS_TYPE_FACILITATION = "CROSS_TYPE_FACILITATION" - CROSS_TYPE_MATRIX_CROSS = "CROSS_TYPE_MATRIX_CROSS" - CROSS_TYPE_PCC = "CROSS_TYPE_PCC" - CROSS_TYPE_PIM = "CROSS_TYPE_PIM" - CROSS_TYPE_QCC = "CROSS_TYPE_QCC" - CROSS_TYPE_RFC = "CROSS_TYPE_RFC" - CROSS_TYPE_SAM = "CROSS_TYPE_SAM" - CROSS_TYPE_SWEEP_AND_AIM = "CROSS_TYPE_SWEEP_AND_AIM" - CROSS_TYPE_SWEEP_AND_CROSS = "CROSS_TYPE_SWEEP_AND_CROSS" - CROSS_TYPE_UNDEFINED = "CROSS_TYPE_UNDEFINED" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/crypto.py b/openapi/openapi_project/openapi_package/models/crypto.py deleted file mode 100644 index a6110fbf4..000000000 --- a/openapi/openapi_project/openapi_package/models/crypto.py +++ /dev/null @@ -1,289 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.models.exchange_code import ExchangeCode -from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat -from openapi_project.openapi_package.models.security_category import SecurityCategory -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.crypto_aliases import CryptoAliases - from openapi_project.openapi_package.models.date import Date - - -T = TypeVar("T", bound="Crypto") - - -@_attrs_define -class Crypto: - """ - Attributes: - aliases (Union[Unset, CryptoAliases]): - currency (Union[Unset, Currency]): - listed_dt (Union[Unset, Date]): - delisted_dt (Union[Unset, Date]): - description (Union[Unset, str]): - exchange_id (Union[Unset, int]): - id (Union[Unset, int]): - multiplier (Union[Unset, float]): - price_base_factor (Union[Unset, float]): - price_display_factor (Union[Unset, float]): - price_display_format (Union[Unset, NumericDisplayFormat]): - qty_display_factor (Union[Unset, float]): - qty_display_format (Union[Unset, NumericDisplayFormat]): - security_category (Union[Unset, SecurityCategory]): - symbol (Union[Unset, str]): - tick_rule (Union[Unset, str]): - tick_size (Union[Unset, float]): - tick_value (Union[Unset, float]): - traded_exchanges (Union[Unset, list[ExchangeCode]]): - quote_currency (Union[Unset, Currency]): - """ - - aliases: Union[Unset, "CryptoAliases"] = UNSET - currency: Unset | Currency = UNSET - listed_dt: Union[Unset, "Date"] = UNSET - delisted_dt: Union[Unset, "Date"] = UNSET - description: Unset | str = UNSET - exchange_id: Unset | int = UNSET - id: Unset | int = UNSET - multiplier: Unset | float = UNSET - price_base_factor: Unset | float = UNSET - price_display_factor: Unset | float = UNSET - price_display_format: Unset | NumericDisplayFormat = UNSET - qty_display_factor: Unset | float = UNSET - qty_display_format: Unset | NumericDisplayFormat = UNSET - security_category: Unset | SecurityCategory = UNSET - symbol: Unset | str = UNSET - tick_rule: Unset | str = UNSET - tick_size: Unset | float = UNSET - tick_value: Unset | float = UNSET - traded_exchanges: Unset | list[ExchangeCode] = UNSET - quote_currency: Unset | Currency = UNSET - - def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = UNSET - if not isinstance(self.aliases, Unset): - aliases = self.aliases.to_dict() - - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value - - listed_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.listed_dt, Unset): - listed_dt = self.listed_dt.to_dict() - - delisted_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.delisted_dt, Unset): - delisted_dt = self.delisted_dt.to_dict() - - description = self.description - - exchange_id = self.exchange_id - - id = self.id - - multiplier = self.multiplier - - price_base_factor = self.price_base_factor - - price_display_factor = self.price_display_factor - - price_display_format: Unset | str = UNSET - if not isinstance(self.price_display_format, Unset): - price_display_format = self.price_display_format.value - - qty_display_factor = self.qty_display_factor - - qty_display_format: Unset | str = UNSET - if not isinstance(self.qty_display_format, Unset): - qty_display_format = self.qty_display_format.value - - security_category: Unset | str = UNSET - if not isinstance(self.security_category, Unset): - security_category = self.security_category.value - - symbol = self.symbol - - tick_rule = self.tick_rule - - tick_size = self.tick_size - - tick_value = self.tick_value - - traded_exchanges: Unset | list[str] = UNSET - if not isinstance(self.traded_exchanges, Unset): - traded_exchanges = [] - for traded_exchanges_item_data in self.traded_exchanges: - traded_exchanges_item = traded_exchanges_item_data.value - traded_exchanges.append(traded_exchanges_item) - - quote_currency: Unset | str = UNSET - if not isinstance(self.quote_currency, Unset): - quote_currency = self.quote_currency.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if aliases is not UNSET: - field_dict["aliases"] = aliases - if currency is not UNSET: - field_dict["currency"] = currency - if listed_dt is not UNSET: - field_dict["listedDt"] = listed_dt - if delisted_dt is not UNSET: - field_dict["delistedDt"] = delisted_dt - if description is not UNSET: - field_dict["description"] = description - if exchange_id is not UNSET: - field_dict["exchangeId"] = exchange_id - if id is not UNSET: - field_dict["id"] = id - if multiplier is not UNSET: - field_dict["multiplier"] = multiplier - if price_base_factor is not UNSET: - field_dict["priceBaseFactor"] = price_base_factor - if price_display_factor is not UNSET: - field_dict["priceDisplayFactor"] = price_display_factor - if price_display_format is not UNSET: - field_dict["priceDisplayFormat"] = price_display_format - if qty_display_factor is not UNSET: - field_dict["qtyDisplayFactor"] = qty_display_factor - if qty_display_format is not UNSET: - field_dict["qtyDisplayFormat"] = qty_display_format - if security_category is not UNSET: - field_dict["securityCategory"] = security_category - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tick_rule is not UNSET: - field_dict["tickRule"] = tick_rule - if tick_size is not UNSET: - field_dict["tickSize"] = tick_size - if tick_value is not UNSET: - field_dict["tickValue"] = tick_value - if traded_exchanges is not UNSET: - field_dict["tradedExchanges"] = traded_exchanges - if quote_currency is not UNSET: - field_dict["quoteCurrency"] = quote_currency - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.crypto_aliases import CryptoAliases - from openapi_project.openapi_package.models.date import Date - - d = dict(src_dict) - _aliases = d.pop("aliases", UNSET) - aliases: Unset | CryptoAliases - if isinstance(_aliases, Unset): - aliases = UNSET - else: - aliases = CryptoAliases.from_dict(_aliases) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) - - _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date - if isinstance(_listed_dt, Unset): - listed_dt = UNSET - else: - listed_dt = Date.from_dict(_listed_dt) - - _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date - if isinstance(_delisted_dt, Unset): - delisted_dt = UNSET - else: - delisted_dt = Date.from_dict(_delisted_dt) - - description = d.pop("description", UNSET) - - exchange_id = d.pop("exchangeId", UNSET) - - id = d.pop("id", UNSET) - - multiplier = d.pop("multiplier", UNSET) - - price_base_factor = d.pop("priceBaseFactor", UNSET) - - price_display_factor = d.pop("priceDisplayFactor", UNSET) - - _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat - if isinstance(_price_display_format, Unset): - price_display_format = UNSET - else: - price_display_format = NumericDisplayFormat(_price_display_format) - - qty_display_factor = d.pop("qtyDisplayFactor", UNSET) - - _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat - if isinstance(_qty_display_format, Unset): - qty_display_format = UNSET - else: - qty_display_format = NumericDisplayFormat(_qty_display_format) - - _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory - if isinstance(_security_category, Unset): - security_category = UNSET - else: - security_category = SecurityCategory(_security_category) - - symbol = d.pop("symbol", UNSET) - - tick_rule = d.pop("tickRule", UNSET) - - tick_size = d.pop("tickSize", UNSET) - - tick_value = d.pop("tickValue", UNSET) - - traded_exchanges = [] - _traded_exchanges = d.pop("tradedExchanges", UNSET) - for traded_exchanges_item_data in _traded_exchanges or []: - traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) - - traded_exchanges.append(traded_exchanges_item) - - _quote_currency = d.pop("quoteCurrency", UNSET) - quote_currency: Unset | Currency - if isinstance(_quote_currency, Unset): - quote_currency = UNSET - else: - quote_currency = Currency(_quote_currency) - - crypto = cls( - aliases=aliases, - currency=currency, - listed_dt=listed_dt, - delisted_dt=delisted_dt, - description=description, - exchange_id=exchange_id, - id=id, - multiplier=multiplier, - price_base_factor=price_base_factor, - price_display_factor=price_display_factor, - price_display_format=price_display_format, - qty_display_factor=qty_display_factor, - qty_display_format=qty_display_format, - security_category=security_category, - symbol=symbol, - tick_rule=tick_rule, - tick_size=tick_size, - tick_value=tick_value, - traded_exchanges=traded_exchanges, - quote_currency=quote_currency, - ) - - return crypto diff --git a/openapi/openapi_project/openapi_package/models/crypto_aliases.py b/openapi/openapi_project/openapi_package/models/crypto_aliases.py deleted file mode 100644 index b7275e189..000000000 --- a/openapi/openapi_project/openapi_package/models/crypto_aliases.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CryptoAliases") - - -@_attrs_define -class CryptoAliases: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - crypto_aliases = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - crypto_aliases.additional_properties = additional_properties - return crypto_aliases - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/currency.py b/openapi/openapi_project/openapi_package/models/currency.py deleted file mode 100644 index bb1f74189..000000000 --- a/openapi/openapi_project/openapi_package/models/currency.py +++ /dev/null @@ -1,180 +0,0 @@ -from enum import Enum - - -class Currency(str, Enum): - CURRENCY_AED = "CURRENCY_AED" - CURRENCY_AFN = "CURRENCY_AFN" - CURRENCY_ALL = "CURRENCY_ALL" - CURRENCY_AMD = "CURRENCY_AMD" - CURRENCY_ANG = "CURRENCY_ANG" - CURRENCY_AOA = "CURRENCY_AOA" - CURRENCY_ARS = "CURRENCY_ARS" - CURRENCY_AUD = "CURRENCY_AUD" - CURRENCY_AWG = "CURRENCY_AWG" - CURRENCY_AZN = "CURRENCY_AZN" - CURRENCY_BAM = "CURRENCY_BAM" - CURRENCY_BBD = "CURRENCY_BBD" - CURRENCY_BDT = "CURRENCY_BDT" - CURRENCY_BGN = "CURRENCY_BGN" - CURRENCY_BHD = "CURRENCY_BHD" - CURRENCY_BIF = "CURRENCY_BIF" - CURRENCY_BMD = "CURRENCY_BMD" - CURRENCY_BND = "CURRENCY_BND" - CURRENCY_BOB = "CURRENCY_BOB" - CURRENCY_BRL = "CURRENCY_BRL" - CURRENCY_BSD = "CURRENCY_BSD" - CURRENCY_BTC = "CURRENCY_BTC" - CURRENCY_BTN = "CURRENCY_BTN" - CURRENCY_BWP = "CURRENCY_BWP" - CURRENCY_BYR = "CURRENCY_BYR" - CURRENCY_BZD = "CURRENCY_BZD" - CURRENCY_CAD = "CURRENCY_CAD" - CURRENCY_CDF = "CURRENCY_CDF" - CURRENCY_CHF = "CURRENCY_CHF" - CURRENCY_CLP = "CURRENCY_CLP" - CURRENCY_CNH = "CURRENCY_CNH" - CURRENCY_CNY = "CURRENCY_CNY" - CURRENCY_COP = "CURRENCY_COP" - CURRENCY_CRC = "CURRENCY_CRC" - CURRENCY_CUC = "CURRENCY_CUC" - CURRENCY_CUP = "CURRENCY_CUP" - CURRENCY_CVE = "CURRENCY_CVE" - CURRENCY_CZK = "CURRENCY_CZK" - CURRENCY_DEM = "CURRENCY_DEM" - CURRENCY_DJF = "CURRENCY_DJF" - CURRENCY_DKK = "CURRENCY_DKK" - CURRENCY_DOP = "CURRENCY_DOP" - CURRENCY_DZD = "CURRENCY_DZD" - CURRENCY_EEK = "CURRENCY_EEK" - CURRENCY_EGP = "CURRENCY_EGP" - CURRENCY_ERN = "CURRENCY_ERN" - CURRENCY_ETB = "CURRENCY_ETB" - CURRENCY_ETH = "CURRENCY_ETH" - CURRENCY_EUR = "CURRENCY_EUR" - CURRENCY_FJD = "CURRENCY_FJD" - CURRENCY_FKP = "CURRENCY_FKP" - CURRENCY_GBP = "CURRENCY_GBP" - CURRENCY_GBX = "CURRENCY_GBX" - CURRENCY_GEL = "CURRENCY_GEL" - CURRENCY_GGP = "CURRENCY_GGP" - CURRENCY_GHS = "CURRENCY_GHS" - CURRENCY_GIP = "CURRENCY_GIP" - CURRENCY_GMD = "CURRENCY_GMD" - CURRENCY_GNF = "CURRENCY_GNF" - CURRENCY_GTQ = "CURRENCY_GTQ" - CURRENCY_GYD = "CURRENCY_GYD" - CURRENCY_HKD = "CURRENCY_HKD" - CURRENCY_HNL = "CURRENCY_HNL" - CURRENCY_HRK = "CURRENCY_HRK" - CURRENCY_HTG = "CURRENCY_HTG" - CURRENCY_HUF = "CURRENCY_HUF" - CURRENCY_IDR = "CURRENCY_IDR" - CURRENCY_ILS = "CURRENCY_ILS" - CURRENCY_IMP = "CURRENCY_IMP" - CURRENCY_INR = "CURRENCY_INR" - CURRENCY_IQD = "CURRENCY_IQD" - CURRENCY_IRR = "CURRENCY_IRR" - CURRENCY_ISK = "CURRENCY_ISK" - CURRENCY_JEP = "CURRENCY_JEP" - CURRENCY_JMD = "CURRENCY_JMD" - CURRENCY_JOD = "CURRENCY_JOD" - CURRENCY_JPY = "CURRENCY_JPY" - CURRENCY_KES = "CURRENCY_KES" - CURRENCY_KGS = "CURRENCY_KGS" - CURRENCY_KHR = "CURRENCY_KHR" - CURRENCY_KMF = "CURRENCY_KMF" - CURRENCY_KPW = "CURRENCY_KPW" - CURRENCY_KRW = "CURRENCY_KRW" - CURRENCY_KWD = "CURRENCY_KWD" - CURRENCY_KYD = "CURRENCY_KYD" - CURRENCY_KZT = "CURRENCY_KZT" - CURRENCY_LAK = "CURRENCY_LAK" - CURRENCY_LBP = "CURRENCY_LBP" - CURRENCY_LKR = "CURRENCY_LKR" - CURRENCY_LRD = "CURRENCY_LRD" - CURRENCY_LSL = "CURRENCY_LSL" - CURRENCY_LTL = "CURRENCY_LTL" - CURRENCY_LVL = "CURRENCY_LVL" - CURRENCY_LYD = "CURRENCY_LYD" - CURRENCY_MAD = "CURRENCY_MAD" - CURRENCY_MDL = "CURRENCY_MDL" - CURRENCY_MGA = "CURRENCY_MGA" - CURRENCY_MKD = "CURRENCY_MKD" - CURRENCY_MMK = "CURRENCY_MMK" - CURRENCY_MNT = "CURRENCY_MNT" - CURRENCY_MOP = "CURRENCY_MOP" - CURRENCY_MRO = "CURRENCY_MRO" - CURRENCY_MUR = "CURRENCY_MUR" - CURRENCY_MVR = "CURRENCY_MVR" - CURRENCY_MWK = "CURRENCY_MWK" - CURRENCY_MXN = "CURRENCY_MXN" - CURRENCY_MYR = "CURRENCY_MYR" - CURRENCY_MZN = "CURRENCY_MZN" - CURRENCY_NAD = "CURRENCY_NAD" - CURRENCY_NGN = "CURRENCY_NGN" - CURRENCY_NIO = "CURRENCY_NIO" - CURRENCY_NLG = "CURRENCY_NLG" - CURRENCY_NOK = "CURRENCY_NOK" - CURRENCY_NPR = "CURRENCY_NPR" - CURRENCY_NZD = "CURRENCY_NZD" - CURRENCY_OMR = "CURRENCY_OMR" - CURRENCY_PAB = "CURRENCY_PAB" - CURRENCY_PEN = "CURRENCY_PEN" - CURRENCY_PGK = "CURRENCY_PGK" - CURRENCY_PHP = "CURRENCY_PHP" - CURRENCY_PKR = "CURRENCY_PKR" - CURRENCY_PLN = "CURRENCY_PLN" - CURRENCY_PYG = "CURRENCY_PYG" - CURRENCY_QAR = "CURRENCY_QAR" - CURRENCY_RON = "CURRENCY_RON" - CURRENCY_RSD = "CURRENCY_RSD" - CURRENCY_RUB = "CURRENCY_RUB" - CURRENCY_RWF = "CURRENCY_RWF" - CURRENCY_SAR = "CURRENCY_SAR" - CURRENCY_SBD = "CURRENCY_SBD" - CURRENCY_SCR = "CURRENCY_SCR" - CURRENCY_SDG = "CURRENCY_SDG" - CURRENCY_SEK = "CURRENCY_SEK" - CURRENCY_SGD = "CURRENCY_SGD" - CURRENCY_SHP = "CURRENCY_SHP" - CURRENCY_SKK = "CURRENCY_SKK" - CURRENCY_SLL = "CURRENCY_SLL" - CURRENCY_SOS = "CURRENCY_SOS" - CURRENCY_SPL = "CURRENCY_SPL" - CURRENCY_SRD = "CURRENCY_SRD" - CURRENCY_STD = "CURRENCY_STD" - CURRENCY_SVC = "CURRENCY_SVC" - CURRENCY_SYP = "CURRENCY_SYP" - CURRENCY_SZL = "CURRENCY_SZL" - CURRENCY_THB = "CURRENCY_THB" - CURRENCY_TJS = "CURRENCY_TJS" - CURRENCY_TMT = "CURRENCY_TMT" - CURRENCY_TND = "CURRENCY_TND" - CURRENCY_TOP = "CURRENCY_TOP" - CURRENCY_TRY = "CURRENCY_TRY" - CURRENCY_TTD = "CURRENCY_TTD" - CURRENCY_TVD = "CURRENCY_TVD" - CURRENCY_TWD = "CURRENCY_TWD" - CURRENCY_TZS = "CURRENCY_TZS" - CURRENCY_UAH = "CURRENCY_UAH" - CURRENCY_UGX = "CURRENCY_UGX" - CURRENCY_USD = "CURRENCY_USD" - CURRENCY_UYU = "CURRENCY_UYU" - CURRENCY_UZS = "CURRENCY_UZS" - CURRENCY_VEF = "CURRENCY_VEF" - CURRENCY_VND = "CURRENCY_VND" - CURRENCY_VUV = "CURRENCY_VUV" - CURRENCY_WST = "CURRENCY_WST" - CURRENCY_XAF = "CURRENCY_XAF" - CURRENCY_XCD = "CURRENCY_XCD" - CURRENCY_XDR = "CURRENCY_XDR" - CURRENCY_XOF = "CURRENCY_XOF" - CURRENCY_XPF = "CURRENCY_XPF" - CURRENCY_XXX = "CURRENCY_XXX" - CURRENCY_YER = "CURRENCY_YER" - CURRENCY_ZAR = "CURRENCY_ZAR" - CURRENCY_ZMW = "CURRENCY_ZMW" - CURRENCY_ZWD = "CURRENCY_ZWD" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/cxl_rej_response_to.py b/openapi/openapi_project/openapi_package/models/cxl_rej_response_to.py deleted file mode 100644 index 294c6354a..000000000 --- a/openapi/openapi_project/openapi_package/models/cxl_rej_response_to.py +++ /dev/null @@ -1,14 +0,0 @@ -from enum import Enum - - -class CxlRejResponseTo(str, Enum): - CXL_REJ_RESPONSE_TO_ORDER_CANCEL_REPLACE_REQUEST = ( - "CXL_REJ_RESPONSE_TO_ORDER_CANCEL_REPLACE_REQUEST" - ) - CXL_REJ_RESPONSE_TO_ORDER_CANCEL_REQUEST = ( - "CXL_REJ_RESPONSE_TO_ORDER_CANCEL_REQUEST" - ) - CXL_REJ_RESPONSE_TO_UNKNOWN = "CXL_REJ_RESPONSE_TO_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/date.py b/openapi/openapi_project/openapi_package/models/date.py deleted file mode 100644 index 167fc74ec..000000000 --- a/openapi/openapi_project/openapi_package/models/date.py +++ /dev/null @@ -1,58 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="Date") - - -@_attrs_define -class Date: - """ - Attributes: - year (Union[Unset, int]): - month (Union[Unset, int]): - day (Union[Unset, int]): - """ - - year: Unset | int = UNSET - month: Unset | int = UNSET - day: Unset | int = UNSET - - def to_dict(self) -> dict[str, Any]: - year = self.year - - month = self.month - - day = self.day - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if year is not UNSET: - field_dict["year"] = year - if month is not UNSET: - field_dict["month"] = month - if day is not UNSET: - field_dict["day"] = day - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - year = d.pop("year", UNSET) - - month = d.pop("month", UNSET) - - day = d.pop("day", UNSET) - - date = cls( - year=year, - month=month, - day=day, - ) - - return date diff --git a/openapi/openapi_project/openapi_package/models/easy_to_borrow_security.py b/openapi/openapi_project/openapi_package/models/easy_to_borrow_security.py deleted file mode 100644 index e0fff86c9..000000000 --- a/openapi/openapi_project/openapi_package/models/easy_to_borrow_security.py +++ /dev/null @@ -1,49 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="EasyToBorrowSecurity") - - -@_attrs_define -class EasyToBorrowSecurity: - """ - Attributes: - symbol (Union[Unset, str]): - locate_id (Union[Unset, str]): - """ - - symbol: Unset | str = UNSET - locate_id: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - symbol = self.symbol - - locate_id = self.locate_id - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if symbol is not UNSET: - field_dict["symbol"] = symbol - if locate_id is not UNSET: - field_dict["locateId"] = locate_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - symbol = d.pop("symbol", UNSET) - - locate_id = d.pop("locateId", UNSET) - - easy_to_borrow_security = cls( - symbol=symbol, - locate_id=locate_id, - ) - - return easy_to_borrow_security diff --git a/openapi/openapi_project/openapi_package/models/empty.py b/openapi/openapi_project/openapi_package/models/empty.py deleted file mode 100644 index 4a89f74ef..000000000 --- a/openapi/openapi_project/openapi_package/models/empty.py +++ /dev/null @@ -1,22 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -T = TypeVar("T", bound="Empty") - - -@_attrs_define -class Empty: - """ """ - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - empty = cls() - - return empty diff --git a/openapi/openapi_project/openapi_package/models/exchange.py b/openapi/openapi_project/openapi_package/models/exchange.py deleted file mode 100644 index a667d9be8..000000000 --- a/openapi/openapi_project/openapi_package/models/exchange.py +++ /dev/null @@ -1,157 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="Exchange") - - -@_attrs_define -class Exchange: - """ - Attributes: - country (Union[Unset, str]): - description (Union[Unset, str]): - display_name (Union[Unset, str]): - id (Union[Unset, int]): - mic (Union[Unset, str]): - microsoft_timezone (Union[Unset, str]): - name (Union[Unset, str]): - olson_timezone (Union[Unset, str]): - operating_mic (Union[Unset, str]): - region (Union[Unset, str]): - short_code (Union[Unset, str]): - suffix (Union[Unset, str]): - utc_offset (Union[Unset, int]): - website (Union[Unset, str]): - """ - - country: Unset | str = UNSET - description: Unset | str = UNSET - display_name: Unset | str = UNSET - id: Unset | int = UNSET - mic: Unset | str = UNSET - microsoft_timezone: Unset | str = UNSET - name: Unset | str = UNSET - olson_timezone: Unset | str = UNSET - operating_mic: Unset | str = UNSET - region: Unset | str = UNSET - short_code: Unset | str = UNSET - suffix: Unset | str = UNSET - utc_offset: Unset | int = UNSET - website: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - country = self.country - - description = self.description - - display_name = self.display_name - - id = self.id - - mic = self.mic - - microsoft_timezone = self.microsoft_timezone - - name = self.name - - olson_timezone = self.olson_timezone - - operating_mic = self.operating_mic - - region = self.region - - short_code = self.short_code - - suffix = self.suffix - - utc_offset = self.utc_offset - - website = self.website - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if country is not UNSET: - field_dict["Country"] = country - if description is not UNSET: - field_dict["Description"] = description - if display_name is not UNSET: - field_dict["DisplayName"] = display_name - if id is not UNSET: - field_dict["Id"] = id - if mic is not UNSET: - field_dict["MIC"] = mic - if microsoft_timezone is not UNSET: - field_dict["MicrosoftTimezone"] = microsoft_timezone - if name is not UNSET: - field_dict["Name"] = name - if olson_timezone is not UNSET: - field_dict["OlsonTimezone"] = olson_timezone - if operating_mic is not UNSET: - field_dict["OperatingMIC"] = operating_mic - if region is not UNSET: - field_dict["Region"] = region - if short_code is not UNSET: - field_dict["ShortCode"] = short_code - if suffix is not UNSET: - field_dict["Suffix"] = suffix - if utc_offset is not UNSET: - field_dict["UtcOffset"] = utc_offset - if website is not UNSET: - field_dict["Website"] = website - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - country = d.pop("Country", UNSET) - - description = d.pop("Description", UNSET) - - display_name = d.pop("DisplayName", UNSET) - - id = d.pop("Id", UNSET) - - mic = d.pop("MIC", UNSET) - - microsoft_timezone = d.pop("MicrosoftTimezone", UNSET) - - name = d.pop("Name", UNSET) - - olson_timezone = d.pop("OlsonTimezone", UNSET) - - operating_mic = d.pop("OperatingMIC", UNSET) - - region = d.pop("Region", UNSET) - - short_code = d.pop("ShortCode", UNSET) - - suffix = d.pop("Suffix", UNSET) - - utc_offset = d.pop("UtcOffset", UNSET) - - website = d.pop("Website", UNSET) - - exchange = cls( - country=country, - description=description, - display_name=display_name, - id=id, - mic=mic, - microsoft_timezone=microsoft_timezone, - name=name, - olson_timezone=olson_timezone, - operating_mic=operating_mic, - region=region, - short_code=short_code, - suffix=suffix, - utc_offset=utc_offset, - website=website, - ) - - return exchange diff --git a/openapi/openapi_project/openapi_package/models/exchange_code.py b/openapi/openapi_project/openapi_package/models/exchange_code.py deleted file mode 100644 index fff12c425..000000000 --- a/openapi/openapi_project/openapi_package/models/exchange_code.py +++ /dev/null @@ -1,72 +0,0 @@ -from enum import Enum - - -class ExchangeCode(str, Enum): - EXCHANGE_CODE_AMXO = "EXCHANGE_CODE_AMXO" - EXCHANGE_CODE_ARCO = "EXCHANGE_CODE_ARCO" - EXCHANGE_CODE_ARCX = "EXCHANGE_CODE_ARCX" - EXCHANGE_CODE_BATO = "EXCHANGE_CODE_BATO" - EXCHANGE_CODE_BATS = "EXCHANGE_CODE_BATS" - EXCHANGE_CODE_BATY = "EXCHANGE_CODE_BATY" - EXCHANGE_CODE_BLCK = "EXCHANGE_CODE_BLCK" - EXCHANGE_CODE_C2OX = "EXCHANGE_CODE_C2OX" - EXCHANGE_CODE_CBSX = "EXCHANGE_CODE_CBSX" - EXCHANGE_CODE_CGIX = "EXCHANGE_CODE_CGIX" - EXCHANGE_CODE_CSMI = "EXCHANGE_CODE_CSMI" - EXCHANGE_CODE_DJXX = "EXCHANGE_CODE_DJXX" - EXCHANGE_CODE_EDGA = "EXCHANGE_CODE_EDGA" - EXCHANGE_CODE_EDGO = "EXCHANGE_CODE_EDGO" - EXCHANGE_CODE_EDGX = "EXCHANGE_CODE_EDGX" - EXCHANGE_CODE_EMLD = "EXCHANGE_CODE_EMLD" - EXCHANGE_CODE_EPRL = "EXCHANGE_CODE_EPRL" - EXCHANGE_CODE_GIDS = "EXCHANGE_CODE_GIDS" - EXCHANGE_CODE_GLBX = "EXCHANGE_CODE_GLBX" - EXCHANGE_CODE_GMNI = "EXCHANGE_CODE_GMNI" - EXCHANGE_CODE_IEXG = "EXCHANGE_CODE_IEXG" - EXCHANGE_CODE_LTSE = "EXCHANGE_CODE_LTSE" - EXCHANGE_CODE_MCRY = "EXCHANGE_CODE_MCRY" - EXCHANGE_CODE_MEMX = "EXCHANGE_CODE_MEMX" - EXCHANGE_CODE_MPRL = "EXCHANGE_CODE_MPRL" - EXCHANGE_CODE_MSCI = "EXCHANGE_CODE_MSCI" - EXCHANGE_CODE_MSTR = "EXCHANGE_CODE_MSTR" - EXCHANGE_CODE_MXOP = "EXCHANGE_CODE_MXOP" - EXCHANGE_CODE_OOTC = "EXCHANGE_CODE_OOTC" - EXCHANGE_CODE_OPRA = "EXCHANGE_CODE_OPRA" - EXCHANGE_CODE_OTCB = "EXCHANGE_CODE_OTCB" - EXCHANGE_CODE_OTCM = "EXCHANGE_CODE_OTCM" - EXCHANGE_CODE_OTCQ = "EXCHANGE_CODE_OTCQ" - EXCHANGE_CODE_PINC = "EXCHANGE_CODE_PINC" - EXCHANGE_CODE_PINX = "EXCHANGE_CODE_PINX" - EXCHANGE_CODE_RTXX = "EXCHANGE_CODE_RTXX" - EXCHANGE_CODE_SPHR = "EXCHANGE_CODE_SPHR" - EXCHANGE_CODE_SPXX = "EXCHANGE_CODE_SPXX" - EXCHANGE_CODE_USEQ = "EXCHANGE_CODE_USEQ" - EXCHANGE_CODE_XADF = "EXCHANGE_CODE_XADF" - EXCHANGE_CODE_XASE = "EXCHANGE_CODE_XASE" - EXCHANGE_CODE_XBOS = "EXCHANGE_CODE_XBOS" - EXCHANGE_CODE_XBOX = "EXCHANGE_CODE_XBOX" - EXCHANGE_CODE_XBXO = "EXCHANGE_CODE_XBXO" - EXCHANGE_CODE_XCBF = "EXCHANGE_CODE_XCBF" - EXCHANGE_CODE_XCBO = "EXCHANGE_CODE_XCBO" - EXCHANGE_CODE_XCBT = "EXCHANGE_CODE_XCBT" - EXCHANGE_CODE_XCEC = "EXCHANGE_CODE_XCEC" - EXCHANGE_CODE_XCHI = "EXCHANGE_CODE_XCHI" - EXCHANGE_CODE_XCIS = "EXCHANGE_CODE_XCIS" - EXCHANGE_CODE_XCME = "EXCHANGE_CODE_XCME" - EXCHANGE_CODE_XISE = "EXCHANGE_CODE_XISE" - EXCHANGE_CODE_XISX = "EXCHANGE_CODE_XISX" - EXCHANGE_CODE_XKBT = "EXCHANGE_CODE_XKBT" - EXCHANGE_CODE_XMIO = "EXCHANGE_CODE_XMIO" - EXCHANGE_CODE_XNAS = "EXCHANGE_CODE_XNAS" - EXCHANGE_CODE_XNDQ = "EXCHANGE_CODE_XNDQ" - EXCHANGE_CODE_XNGS = "EXCHANGE_CODE_XNGS" - EXCHANGE_CODE_XNYM = "EXCHANGE_CODE_XNYM" - EXCHANGE_CODE_XNYS = "EXCHANGE_CODE_XNYS" - EXCHANGE_CODE_XOCC = "EXCHANGE_CODE_XOCC" - EXCHANGE_CODE_XOTC = "EXCHANGE_CODE_XOTC" - EXCHANGE_CODE_XPHO = "EXCHANGE_CODE_XPHO" - EXCHANGE_CODE_XPSX = "EXCHANGE_CODE_XPSX" - EXCHANGE_CODE_XXXX = "EXCHANGE_CODE_XXXX" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/exec_type.py b/openapi/openapi_project/openapi_package/models/exec_type.py deleted file mode 100644 index 851f1e912..000000000 --- a/openapi/openapi_project/openapi_package/models/exec_type.py +++ /dev/null @@ -1,30 +0,0 @@ -from enum import Enum - - -class ExecType(str, Enum): - EXEC_TYPE_CANCELED = "EXEC_TYPE_CANCELED" - EXEC_TYPE_CLAIM_REQUIRED = "EXEC_TYPE_CLAIM_REQUIRED" - EXEC_TYPE_DONE_FOR_DAY = "EXEC_TYPE_DONE_FOR_DAY" - EXEC_TYPE_EXPIRED = "EXEC_TYPE_EXPIRED" - EXEC_TYPE_NEW = "EXEC_TYPE_NEW" - EXEC_TYPE_NOTE = "EXEC_TYPE_NOTE" - EXEC_TYPE_PENDING_CANCEL = "EXEC_TYPE_PENDING_CANCEL" - EXEC_TYPE_PENDING_NEW = "EXEC_TYPE_PENDING_NEW" - EXEC_TYPE_PENDING_REPLACE = "EXEC_TYPE_PENDING_REPLACE" - EXEC_TYPE_QUEUED_ORDER = "EXEC_TYPE_QUEUED_ORDER" - EXEC_TYPE_REJECTED = "EXEC_TYPE_REJECTED" - EXEC_TYPE_REPLACED = "EXEC_TYPE_REPLACED" - EXEC_TYPE_REPRESENTED = "EXEC_TYPE_REPRESENTED" - EXEC_TYPE_RESTATED = "EXEC_TYPE_RESTATED" - EXEC_TYPE_STOPPED = "EXEC_TYPE_STOPPED" - EXEC_TYPE_SUSPENDED = "EXEC_TYPE_SUSPENDED" - EXEC_TYPE_TRADE = "EXEC_TYPE_TRADE" - EXEC_TYPE_TRADE_BUST = "EXEC_TYPE_TRADE_BUST" - EXEC_TYPE_TRADE_CORRECT = "EXEC_TYPE_TRADE_CORRECT" - EXEC_TYPE_UNKNOWN = "EXEC_TYPE_UNKNOWN" - EXEC_TYPE_UPDATE = "EXEC_TYPE_UPDATE" - EXEC_TYPE_UPDATE_OPTIONAL_DATA = "EXEC_TYPE_UPDATE_OPTIONAL_DATA" - EXEC_TYPE_USER_CLAIMED = "EXEC_TYPE_USER_CLAIMED" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/execution.py b/openapi/openapi_project/openapi_package/models/execution.py deleted file mode 100644 index fdcf2d754..000000000 --- a/openapi/openapi_project/openapi_package/models/execution.py +++ /dev/null @@ -1,641 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.exec_type import ExecType -from openapi_project.openapi_package.models.multi_leg_reporting_type import MultiLegReportingType -from openapi_project.openapi_package.models.ord_status import OrdStatus -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.origination_type import OriginationType -from openapi_project.openapi_package.models.position_effect import PositionEffect -from openapi_project.openapi_package.models.price_type import PriceType -from openapi_project.openapi_package.models.side import Side -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.execution_algo import ExecutionAlgo - from openapi_project.openapi_package.models.execution_optional_data import ExecutionOptionalData - from openapi_project.openapi_package.models.header import Header - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.security import Security - - -T = TypeVar("T", bound="Execution") - - -@_attrs_define -class Execution: - """ - Attributes: - account_id (Union[Unset, int]): - algo (Union[Unset, ExecutionAlgo]): - alloc_id (Union[Unset, str]): - aux_price (Union[Unset, float]): - avg_price (Union[Unset, float]): - claimed_by (Union[Unset, str]): - clearing_info (Union[Unset, ClearingInfo]): - commission (Union[Unset, float]): - cum_qty (Union[Unset, float]): - cur_ord_id (Union[Unset, str]): - exec_broker (Union[Unset, str]): - exec_id (Union[Unset, str]): - exec_ref_id (Union[Unset, str]): - exec_type (Union[Unset, ExecType]): - fee1 (Union[Unset, float]): - fee2 (Union[Unset, float]): - header (Union[Unset, Header]): - incoming_cl_ord_id (Union[Unset, str]): - incoming_ord_id (Union[Unset, str]): - incoming_orig_cl_ord_id (Union[Unset, str]): - instructions (Union[Unset, list['OrderInstruction']]): - last_market (Union[Unset, str]): - last_price (Union[Unset, float]): - last_qty (Union[Unset, float]): - leaves_qty (Union[Unset, float]): - leg_id (Union[Unset, str]): - liquidity_flag (Union[Unset, str]): - multi_leg_reporting_type (Union[Unset, MultiLegReportingType]): - optional_data (Union[Unset, ExecutionOptionalData]): - order_flags (Union[Unset, int]): - ord_status (Union[Unset, OrdStatus]): - ord_type (Union[Unset, OrdType]): - origination_type (Union[Unset, OriginationType]): - orig_ord_id (Union[Unset, str]): - parent_ord_id (Union[Unset, str]): - perm_ord_id (Union[Unset, str]): - position_effect (Union[Unset, PositionEffect]): - price (Union[Unset, float]): - price_type (Union[Unset, PriceType]): - qty (Union[Unset, float]): - route (Union[Unset, str]): - routing_session (Union[Unset, str]): - security (Union[Unset, Security]): - side (Union[Unset, Side]): - source (Union[Unset, str]): - symbol (Union[Unset, str]): - tag (Union[Unset, str]): - text (Union[Unset, str]): - tif (Union[Unset, Tif]): - trader_id (Union[Unset, str]): - transact_ts (Union[Unset, str]): - user_id (Union[Unset, int]): - working_qty (Union[Unset, float]): - """ - - account_id: Unset | int = UNSET - algo: Union[Unset, "ExecutionAlgo"] = UNSET - alloc_id: Unset | str = UNSET - aux_price: Unset | float = UNSET - avg_price: Unset | float = UNSET - claimed_by: Unset | str = UNSET - clearing_info: Union[Unset, "ClearingInfo"] = UNSET - commission: Unset | float = UNSET - cum_qty: Unset | float = UNSET - cur_ord_id: Unset | str = UNSET - exec_broker: Unset | str = UNSET - exec_id: Unset | str = UNSET - exec_ref_id: Unset | str = UNSET - exec_type: Unset | ExecType = UNSET - fee1: Unset | float = UNSET - fee2: Unset | float = UNSET - header: Union[Unset, "Header"] = UNSET - incoming_cl_ord_id: Unset | str = UNSET - incoming_ord_id: Unset | str = UNSET - incoming_orig_cl_ord_id: Unset | str = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - last_market: Unset | str = UNSET - last_price: Unset | float = UNSET - last_qty: Unset | float = UNSET - leaves_qty: Unset | float = UNSET - leg_id: Unset | str = UNSET - liquidity_flag: Unset | str = UNSET - multi_leg_reporting_type: Unset | MultiLegReportingType = UNSET - optional_data: Union[Unset, "ExecutionOptionalData"] = UNSET - order_flags: Unset | int = UNSET - ord_status: Unset | OrdStatus = UNSET - ord_type: Unset | OrdType = UNSET - origination_type: Unset | OriginationType = UNSET - orig_ord_id: Unset | str = UNSET - parent_ord_id: Unset | str = UNSET - perm_ord_id: Unset | str = UNSET - position_effect: Unset | PositionEffect = UNSET - price: Unset | float = UNSET - price_type: Unset | PriceType = UNSET - qty: Unset | float = UNSET - route: Unset | str = UNSET - routing_session: Unset | str = UNSET - security: Union[Unset, "Security"] = UNSET - side: Unset | Side = UNSET - source: Unset | str = UNSET - symbol: Unset | str = UNSET - tag: Unset | str = UNSET - text: Unset | str = UNSET - tif: Unset | Tif = UNSET - trader_id: Unset | str = UNSET - transact_ts: Unset | str = UNSET - user_id: Unset | int = UNSET - working_qty: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - algo: Unset | dict[str, Any] = UNSET - if not isinstance(self.algo, Unset): - algo = self.algo.to_dict() - - alloc_id = self.alloc_id - - aux_price = self.aux_price - - avg_price = self.avg_price - - claimed_by = self.claimed_by - - clearing_info: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_info, Unset): - clearing_info = self.clearing_info.to_dict() - - commission = self.commission - - cum_qty = self.cum_qty - - cur_ord_id = self.cur_ord_id - - exec_broker = self.exec_broker - - exec_id = self.exec_id - - exec_ref_id = self.exec_ref_id - - exec_type: Unset | str = UNSET - if not isinstance(self.exec_type, Unset): - exec_type = self.exec_type.value - - fee1 = self.fee1 - - fee2 = self.fee2 - - header: Unset | dict[str, Any] = UNSET - if not isinstance(self.header, Unset): - header = self.header.to_dict() - - incoming_cl_ord_id = self.incoming_cl_ord_id - - incoming_ord_id = self.incoming_ord_id - - incoming_orig_cl_ord_id = self.incoming_orig_cl_ord_id - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - last_market = self.last_market - - last_price = self.last_price - - last_qty = self.last_qty - - leaves_qty = self.leaves_qty - - leg_id = self.leg_id - - liquidity_flag = self.liquidity_flag - - multi_leg_reporting_type: Unset | str = UNSET - if not isinstance(self.multi_leg_reporting_type, Unset): - multi_leg_reporting_type = self.multi_leg_reporting_type.value - - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() - - order_flags = self.order_flags - - ord_status: Unset | str = UNSET - if not isinstance(self.ord_status, Unset): - ord_status = self.ord_status.value - - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value - - origination_type: Unset | str = UNSET - if not isinstance(self.origination_type, Unset): - origination_type = self.origination_type.value - - orig_ord_id = self.orig_ord_id - - parent_ord_id = self.parent_ord_id - - perm_ord_id = self.perm_ord_id - - position_effect: Unset | str = UNSET - if not isinstance(self.position_effect, Unset): - position_effect = self.position_effect.value - - price = self.price - - price_type: Unset | str = UNSET - if not isinstance(self.price_type, Unset): - price_type = self.price_type.value - - qty = self.qty - - route = self.route - - routing_session = self.routing_session - - security: Unset | dict[str, Any] = UNSET - if not isinstance(self.security, Unset): - security = self.security.to_dict() - - side: Unset | str = UNSET - if not isinstance(self.side, Unset): - side = self.side.value - - source = self.source - - symbol = self.symbol - - tag = self.tag - - text = self.text - - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value - - trader_id = self.trader_id - - transact_ts = self.transact_ts - - user_id = self.user_id - - working_qty = self.working_qty - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if algo is not UNSET: - field_dict["algo"] = algo - if alloc_id is not UNSET: - field_dict["allocId"] = alloc_id - if aux_price is not UNSET: - field_dict["auxPrice"] = aux_price - if avg_price is not UNSET: - field_dict["avgPrice"] = avg_price - if claimed_by is not UNSET: - field_dict["claimedBy"] = claimed_by - if clearing_info is not UNSET: - field_dict["clearingInfo"] = clearing_info - if commission is not UNSET: - field_dict["commission"] = commission - if cum_qty is not UNSET: - field_dict["cumQty"] = cum_qty - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if exec_broker is not UNSET: - field_dict["execBroker"] = exec_broker - if exec_id is not UNSET: - field_dict["execId"] = exec_id - if exec_ref_id is not UNSET: - field_dict["execRefId"] = exec_ref_id - if exec_type is not UNSET: - field_dict["execType"] = exec_type - if fee1 is not UNSET: - field_dict["fee1"] = fee1 - if fee2 is not UNSET: - field_dict["fee2"] = fee2 - if header is not UNSET: - field_dict["header"] = header - if incoming_cl_ord_id is not UNSET: - field_dict["incomingClOrdId"] = incoming_cl_ord_id - if incoming_ord_id is not UNSET: - field_dict["incomingOrdId"] = incoming_ord_id - if incoming_orig_cl_ord_id is not UNSET: - field_dict["incomingOrigClOrdId"] = incoming_orig_cl_ord_id - if instructions is not UNSET: - field_dict["instructions"] = instructions - if last_market is not UNSET: - field_dict["lastMarket"] = last_market - if last_price is not UNSET: - field_dict["lastPrice"] = last_price - if last_qty is not UNSET: - field_dict["lastQty"] = last_qty - if leaves_qty is not UNSET: - field_dict["leavesQty"] = leaves_qty - if leg_id is not UNSET: - field_dict["legId"] = leg_id - if liquidity_flag is not UNSET: - field_dict["liquidityFlag"] = liquidity_flag - if multi_leg_reporting_type is not UNSET: - field_dict["multiLegReportingType"] = multi_leg_reporting_type - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if order_flags is not UNSET: - field_dict["orderFlags"] = order_flags - if ord_status is not UNSET: - field_dict["ordStatus"] = ord_status - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if origination_type is not UNSET: - field_dict["originationType"] = origination_type - if orig_ord_id is not UNSET: - field_dict["origOrdId"] = orig_ord_id - if parent_ord_id is not UNSET: - field_dict["parentOrdId"] = parent_ord_id - if perm_ord_id is not UNSET: - field_dict["permOrdId"] = perm_ord_id - if position_effect is not UNSET: - field_dict["positionEffect"] = position_effect - if price is not UNSET: - field_dict["price"] = price - if price_type is not UNSET: - field_dict["priceType"] = price_type - if qty is not UNSET: - field_dict["qty"] = qty - if route is not UNSET: - field_dict["route"] = route - if routing_session is not UNSET: - field_dict["routingSession"] = routing_session - if security is not UNSET: - field_dict["security"] = security - if side is not UNSET: - field_dict["side"] = side - if source is not UNSET: - field_dict["source"] = source - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tag is not UNSET: - field_dict["tag"] = tag - if text is not UNSET: - field_dict["text"] = text - if tif is not UNSET: - field_dict["tif"] = tif - if trader_id is not UNSET: - field_dict["traderId"] = trader_id - if transact_ts is not UNSET: - field_dict["transactTs"] = transact_ts - if user_id is not UNSET: - field_dict["userId"] = user_id - if working_qty is not UNSET: - field_dict["workingQty"] = working_qty - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.execution_algo import ExecutionAlgo - from openapi_project.openapi_package.models.execution_optional_data import ExecutionOptionalData - from openapi_project.openapi_package.models.header import Header - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.security import Security - - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - _algo = d.pop("algo", UNSET) - algo: Unset | ExecutionAlgo - if isinstance(_algo, Unset): - algo = UNSET - else: - algo = ExecutionAlgo.from_dict(_algo) - - alloc_id = d.pop("allocId", UNSET) - - aux_price = d.pop("auxPrice", UNSET) - - avg_price = d.pop("avgPrice", UNSET) - - claimed_by = d.pop("claimedBy", UNSET) - - _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo - if isinstance(_clearing_info, Unset): - clearing_info = UNSET - else: - clearing_info = ClearingInfo.from_dict(_clearing_info) - - commission = d.pop("commission", UNSET) - - cum_qty = d.pop("cumQty", UNSET) - - cur_ord_id = d.pop("curOrdId", UNSET) - - exec_broker = d.pop("execBroker", UNSET) - - exec_id = d.pop("execId", UNSET) - - exec_ref_id = d.pop("execRefId", UNSET) - - _exec_type = d.pop("execType", UNSET) - exec_type: Unset | ExecType - if isinstance(_exec_type, Unset): - exec_type = UNSET - else: - exec_type = ExecType(_exec_type) - - fee1 = d.pop("fee1", UNSET) - - fee2 = d.pop("fee2", UNSET) - - _header = d.pop("header", UNSET) - header: Unset | Header - if isinstance(_header, Unset): - header = UNSET - else: - header = Header.from_dict(_header) - - incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) - - incoming_ord_id = d.pop("incomingOrdId", UNSET) - - incoming_orig_cl_ord_id = d.pop("incomingOrigClOrdId", UNSET) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - last_market = d.pop("lastMarket", UNSET) - - last_price = d.pop("lastPrice", UNSET) - - last_qty = d.pop("lastQty", UNSET) - - leaves_qty = d.pop("leavesQty", UNSET) - - leg_id = d.pop("legId", UNSET) - - liquidity_flag = d.pop("liquidityFlag", UNSET) - - _multi_leg_reporting_type = d.pop("multiLegReportingType", UNSET) - multi_leg_reporting_type: Unset | MultiLegReportingType - if isinstance(_multi_leg_reporting_type, Unset): - multi_leg_reporting_type = UNSET - else: - multi_leg_reporting_type = MultiLegReportingType(_multi_leg_reporting_type) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | ExecutionOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = ExecutionOptionalData.from_dict(_optional_data) - - order_flags = d.pop("orderFlags", UNSET) - - _ord_status = d.pop("ordStatus", UNSET) - ord_status: Unset | OrdStatus - if isinstance(_ord_status, Unset): - ord_status = UNSET - else: - ord_status = OrdStatus(_ord_status) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) - - _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType - if isinstance(_origination_type, Unset): - origination_type = UNSET - else: - origination_type = OriginationType(_origination_type) - - orig_ord_id = d.pop("origOrdId", UNSET) - - parent_ord_id = d.pop("parentOrdId", UNSET) - - perm_ord_id = d.pop("permOrdId", UNSET) - - _position_effect = d.pop("positionEffect", UNSET) - position_effect: Unset | PositionEffect - if isinstance(_position_effect, Unset): - position_effect = UNSET - else: - position_effect = PositionEffect(_position_effect) - - price = d.pop("price", UNSET) - - _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType - if isinstance(_price_type, Unset): - price_type = UNSET - else: - price_type = PriceType(_price_type) - - qty = d.pop("qty", UNSET) - - route = d.pop("route", UNSET) - - routing_session = d.pop("routingSession", UNSET) - - _security = d.pop("security", UNSET) - security: Unset | Security - if isinstance(_security, Unset): - security = UNSET - else: - security = Security.from_dict(_security) - - _side = d.pop("side", UNSET) - side: Unset | Side - if isinstance(_side, Unset): - side = UNSET - else: - side = Side(_side) - - source = d.pop("source", UNSET) - - symbol = d.pop("symbol", UNSET) - - tag = d.pop("tag", UNSET) - - text = d.pop("text", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) - - trader_id = d.pop("traderId", UNSET) - - transact_ts = d.pop("transactTs", UNSET) - - user_id = d.pop("userId", UNSET) - - working_qty = d.pop("workingQty", UNSET) - - execution = cls( - account_id=account_id, - algo=algo, - alloc_id=alloc_id, - aux_price=aux_price, - avg_price=avg_price, - claimed_by=claimed_by, - clearing_info=clearing_info, - commission=commission, - cum_qty=cum_qty, - cur_ord_id=cur_ord_id, - exec_broker=exec_broker, - exec_id=exec_id, - exec_ref_id=exec_ref_id, - exec_type=exec_type, - fee1=fee1, - fee2=fee2, - header=header, - incoming_cl_ord_id=incoming_cl_ord_id, - incoming_ord_id=incoming_ord_id, - incoming_orig_cl_ord_id=incoming_orig_cl_ord_id, - instructions=instructions, - last_market=last_market, - last_price=last_price, - last_qty=last_qty, - leaves_qty=leaves_qty, - leg_id=leg_id, - liquidity_flag=liquidity_flag, - multi_leg_reporting_type=multi_leg_reporting_type, - optional_data=optional_data, - order_flags=order_flags, - ord_status=ord_status, - ord_type=ord_type, - origination_type=origination_type, - orig_ord_id=orig_ord_id, - parent_ord_id=parent_ord_id, - perm_ord_id=perm_ord_id, - position_effect=position_effect, - price=price, - price_type=price_type, - qty=qty, - route=route, - routing_session=routing_session, - security=security, - side=side, - source=source, - symbol=symbol, - tag=tag, - text=text, - tif=tif, - trader_id=trader_id, - transact_ts=transact_ts, - user_id=user_id, - working_qty=working_qty, - ) - - return execution diff --git a/openapi/openapi_project/openapi_package/models/execution_algo.py b/openapi/openapi_project/openapi_package/models/execution_algo.py deleted file mode 100644 index 0cf4e8d7d..000000000 --- a/openapi/openapi_project/openapi_package/models/execution_algo.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExecutionAlgo") - - -@_attrs_define -class ExecutionAlgo: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - execution_algo = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - execution_algo.additional_properties = additional_properties - return execution_algo - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/execution_optional_data.py b/openapi/openapi_project/openapi_package/models/execution_optional_data.py deleted file mode 100644 index 863b6b07e..000000000 --- a/openapi/openapi_project/openapi_package/models/execution_optional_data.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ExecutionOptionalData") - - -@_attrs_define -class ExecutionOptionalData: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - execution_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - execution_optional_data.additional_properties = additional_properties - return execution_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/flex_option.py b/openapi/openapi_project/openapi_package/models/flex_option.py deleted file mode 100644 index 690cc8e24..000000000 --- a/openapi/openapi_project/openapi_package/models/flex_option.py +++ /dev/null @@ -1,445 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.models.exchange_code import ExchangeCode -from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat -from openapi_project.openapi_package.models.option_exercise_style import OptionExerciseStyle -from openapi_project.openapi_package.models.option_series_product_type import OptionSeriesProductType -from openapi_project.openapi_package.models.option_settlement_type import OptionSettlementType -from openapi_project.openapi_package.models.put_call import PutCall -from openapi_project.openapi_package.models.security_category import SecurityCategory -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.date import Date - from openapi_project.openapi_package.models.flex_option_aliases import FlexOptionAliases - - -T = TypeVar("T", bound="FlexOption") - - -@_attrs_define -class FlexOption: - """ - Attributes: - aliases (Union[Unset, FlexOptionAliases]): - currency (Union[Unset, Currency]): - listed_dt (Union[Unset, Date]): - delisted_dt (Union[Unset, Date]): - description (Union[Unset, str]): - exchange_id (Union[Unset, int]): - id (Union[Unset, int]): - multiplier (Union[Unset, float]): - price_base_factor (Union[Unset, float]): - price_display_factor (Union[Unset, float]): - price_display_format (Union[Unset, NumericDisplayFormat]): - qty_display_factor (Union[Unset, float]): - qty_display_format (Union[Unset, NumericDisplayFormat]): - security_category (Union[Unset, SecurityCategory]): - symbol (Union[Unset, str]): - tick_rule (Union[Unset, str]): - tick_size (Union[Unset, float]): - tick_value (Union[Unset, float]): - traded_exchanges (Union[Unset, list[ExchangeCode]]): - cap_percentage (Union[Unset, float]): - creation_dt (Union[Unset, Date]): - deliverable_per_contract (Union[Unset, float]): - exercise_style (Union[Unset, OptionExerciseStyle]): - expiration_dt (Union[Unset, Date]): - observation_day (Union[Unset, int]): - percentage_pricing (Union[Unset, bool]): - product_type (Union[Unset, OptionSeriesProductType]): - put_call (Union[Unset, PutCall]): - root (Union[Unset, str]): - root_base (Union[Unset, str]): - settlement_type (Union[Unset, OptionSettlementType]): - strike (Union[Unset, float]): - underlying (Union[Unset, str]): - """ - - aliases: Union[Unset, "FlexOptionAliases"] = UNSET - currency: Unset | Currency = UNSET - listed_dt: Union[Unset, "Date"] = UNSET - delisted_dt: Union[Unset, "Date"] = UNSET - description: Unset | str = UNSET - exchange_id: Unset | int = UNSET - id: Unset | int = UNSET - multiplier: Unset | float = UNSET - price_base_factor: Unset | float = UNSET - price_display_factor: Unset | float = UNSET - price_display_format: Unset | NumericDisplayFormat = UNSET - qty_display_factor: Unset | float = UNSET - qty_display_format: Unset | NumericDisplayFormat = UNSET - security_category: Unset | SecurityCategory = UNSET - symbol: Unset | str = UNSET - tick_rule: Unset | str = UNSET - tick_size: Unset | float = UNSET - tick_value: Unset | float = UNSET - traded_exchanges: Unset | list[ExchangeCode] = UNSET - cap_percentage: Unset | float = UNSET - creation_dt: Union[Unset, "Date"] = UNSET - deliverable_per_contract: Unset | float = UNSET - exercise_style: Unset | OptionExerciseStyle = UNSET - expiration_dt: Union[Unset, "Date"] = UNSET - observation_day: Unset | int = UNSET - percentage_pricing: Unset | bool = UNSET - product_type: Unset | OptionSeriesProductType = UNSET - put_call: Unset | PutCall = UNSET - root: Unset | str = UNSET - root_base: Unset | str = UNSET - settlement_type: Unset | OptionSettlementType = UNSET - strike: Unset | float = UNSET - underlying: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = UNSET - if not isinstance(self.aliases, Unset): - aliases = self.aliases.to_dict() - - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value - - listed_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.listed_dt, Unset): - listed_dt = self.listed_dt.to_dict() - - delisted_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.delisted_dt, Unset): - delisted_dt = self.delisted_dt.to_dict() - - description = self.description - - exchange_id = self.exchange_id - - id = self.id - - multiplier = self.multiplier - - price_base_factor = self.price_base_factor - - price_display_factor = self.price_display_factor - - price_display_format: Unset | str = UNSET - if not isinstance(self.price_display_format, Unset): - price_display_format = self.price_display_format.value - - qty_display_factor = self.qty_display_factor - - qty_display_format: Unset | str = UNSET - if not isinstance(self.qty_display_format, Unset): - qty_display_format = self.qty_display_format.value - - security_category: Unset | str = UNSET - if not isinstance(self.security_category, Unset): - security_category = self.security_category.value - - symbol = self.symbol - - tick_rule = self.tick_rule - - tick_size = self.tick_size - - tick_value = self.tick_value - - traded_exchanges: Unset | list[str] = UNSET - if not isinstance(self.traded_exchanges, Unset): - traded_exchanges = [] - for traded_exchanges_item_data in self.traded_exchanges: - traded_exchanges_item = traded_exchanges_item_data.value - traded_exchanges.append(traded_exchanges_item) - - cap_percentage = self.cap_percentage - - creation_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.creation_dt, Unset): - creation_dt = self.creation_dt.to_dict() - - deliverable_per_contract = self.deliverable_per_contract - - exercise_style: Unset | str = UNSET - if not isinstance(self.exercise_style, Unset): - exercise_style = self.exercise_style.value - - expiration_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.expiration_dt, Unset): - expiration_dt = self.expiration_dt.to_dict() - - observation_day = self.observation_day - - percentage_pricing = self.percentage_pricing - - product_type: Unset | str = UNSET - if not isinstance(self.product_type, Unset): - product_type = self.product_type.value - - put_call: Unset | str = UNSET - if not isinstance(self.put_call, Unset): - put_call = self.put_call.value - - root = self.root - - root_base = self.root_base - - settlement_type: Unset | str = UNSET - if not isinstance(self.settlement_type, Unset): - settlement_type = self.settlement_type.value - - strike = self.strike - - underlying = self.underlying - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if aliases is not UNSET: - field_dict["aliases"] = aliases - if currency is not UNSET: - field_dict["currency"] = currency - if listed_dt is not UNSET: - field_dict["listedDt"] = listed_dt - if delisted_dt is not UNSET: - field_dict["delistedDt"] = delisted_dt - if description is not UNSET: - field_dict["description"] = description - if exchange_id is not UNSET: - field_dict["exchangeId"] = exchange_id - if id is not UNSET: - field_dict["id"] = id - if multiplier is not UNSET: - field_dict["multiplier"] = multiplier - if price_base_factor is not UNSET: - field_dict["priceBaseFactor"] = price_base_factor - if price_display_factor is not UNSET: - field_dict["priceDisplayFactor"] = price_display_factor - if price_display_format is not UNSET: - field_dict["priceDisplayFormat"] = price_display_format - if qty_display_factor is not UNSET: - field_dict["qtyDisplayFactor"] = qty_display_factor - if qty_display_format is not UNSET: - field_dict["qtyDisplayFormat"] = qty_display_format - if security_category is not UNSET: - field_dict["securityCategory"] = security_category - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tick_rule is not UNSET: - field_dict["tickRule"] = tick_rule - if tick_size is not UNSET: - field_dict["tickSize"] = tick_size - if tick_value is not UNSET: - field_dict["tickValue"] = tick_value - if traded_exchanges is not UNSET: - field_dict["tradedExchanges"] = traded_exchanges - if cap_percentage is not UNSET: - field_dict["capPercentage"] = cap_percentage - if creation_dt is not UNSET: - field_dict["creationDt"] = creation_dt - if deliverable_per_contract is not UNSET: - field_dict["deliverablePerContract"] = deliverable_per_contract - if exercise_style is not UNSET: - field_dict["exerciseStyle"] = exercise_style - if expiration_dt is not UNSET: - field_dict["expirationDt"] = expiration_dt - if observation_day is not UNSET: - field_dict["observationDay"] = observation_day - if percentage_pricing is not UNSET: - field_dict["percentagePricing"] = percentage_pricing - if product_type is not UNSET: - field_dict["productType"] = product_type - if put_call is not UNSET: - field_dict["putCall"] = put_call - if root is not UNSET: - field_dict["root"] = root - if root_base is not UNSET: - field_dict["rootBase"] = root_base - if settlement_type is not UNSET: - field_dict["settlementType"] = settlement_type - if strike is not UNSET: - field_dict["strike"] = strike - if underlying is not UNSET: - field_dict["underlying"] = underlying - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.date import Date - from openapi_project.openapi_package.models.flex_option_aliases import FlexOptionAliases - - d = dict(src_dict) - _aliases = d.pop("aliases", UNSET) - aliases: Unset | FlexOptionAliases - if isinstance(_aliases, Unset): - aliases = UNSET - else: - aliases = FlexOptionAliases.from_dict(_aliases) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) - - _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date - if isinstance(_listed_dt, Unset): - listed_dt = UNSET - else: - listed_dt = Date.from_dict(_listed_dt) - - _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date - if isinstance(_delisted_dt, Unset): - delisted_dt = UNSET - else: - delisted_dt = Date.from_dict(_delisted_dt) - - description = d.pop("description", UNSET) - - exchange_id = d.pop("exchangeId", UNSET) - - id = d.pop("id", UNSET) - - multiplier = d.pop("multiplier", UNSET) - - price_base_factor = d.pop("priceBaseFactor", UNSET) - - price_display_factor = d.pop("priceDisplayFactor", UNSET) - - _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat - if isinstance(_price_display_format, Unset): - price_display_format = UNSET - else: - price_display_format = NumericDisplayFormat(_price_display_format) - - qty_display_factor = d.pop("qtyDisplayFactor", UNSET) - - _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat - if isinstance(_qty_display_format, Unset): - qty_display_format = UNSET - else: - qty_display_format = NumericDisplayFormat(_qty_display_format) - - _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory - if isinstance(_security_category, Unset): - security_category = UNSET - else: - security_category = SecurityCategory(_security_category) - - symbol = d.pop("symbol", UNSET) - - tick_rule = d.pop("tickRule", UNSET) - - tick_size = d.pop("tickSize", UNSET) - - tick_value = d.pop("tickValue", UNSET) - - traded_exchanges = [] - _traded_exchanges = d.pop("tradedExchanges", UNSET) - for traded_exchanges_item_data in _traded_exchanges or []: - traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) - - traded_exchanges.append(traded_exchanges_item) - - cap_percentage = d.pop("capPercentage", UNSET) - - _creation_dt = d.pop("creationDt", UNSET) - creation_dt: Unset | Date - if isinstance(_creation_dt, Unset): - creation_dt = UNSET - else: - creation_dt = Date.from_dict(_creation_dt) - - deliverable_per_contract = d.pop("deliverablePerContract", UNSET) - - _exercise_style = d.pop("exerciseStyle", UNSET) - exercise_style: Unset | OptionExerciseStyle - if isinstance(_exercise_style, Unset): - exercise_style = UNSET - else: - exercise_style = OptionExerciseStyle(_exercise_style) - - _expiration_dt = d.pop("expirationDt", UNSET) - expiration_dt: Unset | Date - if isinstance(_expiration_dt, Unset): - expiration_dt = UNSET - else: - expiration_dt = Date.from_dict(_expiration_dt) - - observation_day = d.pop("observationDay", UNSET) - - percentage_pricing = d.pop("percentagePricing", UNSET) - - _product_type = d.pop("productType", UNSET) - product_type: Unset | OptionSeriesProductType - if isinstance(_product_type, Unset): - product_type = UNSET - else: - product_type = OptionSeriesProductType(_product_type) - - _put_call = d.pop("putCall", UNSET) - put_call: Unset | PutCall - if isinstance(_put_call, Unset): - put_call = UNSET - else: - put_call = PutCall(_put_call) - - root = d.pop("root", UNSET) - - root_base = d.pop("rootBase", UNSET) - - _settlement_type = d.pop("settlementType", UNSET) - settlement_type: Unset | OptionSettlementType - if isinstance(_settlement_type, Unset): - settlement_type = UNSET - else: - settlement_type = OptionSettlementType(_settlement_type) - - strike = d.pop("strike", UNSET) - - underlying = d.pop("underlying", UNSET) - - flex_option = cls( - aliases=aliases, - currency=currency, - listed_dt=listed_dt, - delisted_dt=delisted_dt, - description=description, - exchange_id=exchange_id, - id=id, - multiplier=multiplier, - price_base_factor=price_base_factor, - price_display_factor=price_display_factor, - price_display_format=price_display_format, - qty_display_factor=qty_display_factor, - qty_display_format=qty_display_format, - security_category=security_category, - symbol=symbol, - tick_rule=tick_rule, - tick_size=tick_size, - tick_value=tick_value, - traded_exchanges=traded_exchanges, - cap_percentage=cap_percentage, - creation_dt=creation_dt, - deliverable_per_contract=deliverable_per_contract, - exercise_style=exercise_style, - expiration_dt=expiration_dt, - observation_day=observation_day, - percentage_pricing=percentage_pricing, - product_type=product_type, - put_call=put_call, - root=root, - root_base=root_base, - settlement_type=settlement_type, - strike=strike, - underlying=underlying, - ) - - return flex_option diff --git a/openapi/openapi_project/openapi_package/models/flex_option_aliases.py b/openapi/openapi_project/openapi_package/models/flex_option_aliases.py deleted file mode 100644 index b0d5a6edc..000000000 --- a/openapi/openapi_project/openapi_package/models/flex_option_aliases.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="FlexOptionAliases") - - -@_attrs_define -class FlexOptionAliases: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - flex_option_aliases = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - flex_option_aliases.additional_properties = additional_properties - return flex_option_aliases - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/flex_settlement_type.py b/openapi/openapi_project/openapi_package/models/flex_settlement_type.py deleted file mode 100644 index 4c2b8eb1a..000000000 --- a/openapi/openapi_project/openapi_package/models/flex_settlement_type.py +++ /dev/null @@ -1,12 +0,0 @@ -from enum import Enum - - -class FlexSettlementType(str, Enum): - FLEX_SETTLEMENT_TYPE_AM = "FLEX_SETTLEMENT_TYPE_AM" - FLEX_SETTLEMENT_TYPE_ASIAN = "FLEX_SETTLEMENT_TYPE_ASIAN" - FLEX_SETTLEMENT_TYPE_CLIQUET = "FLEX_SETTLEMENT_TYPE_CLIQUET" - FLEX_SETTLEMENT_TYPE_PM = "FLEX_SETTLEMENT_TYPE_PM" - FLEX_SETTLEMENT_TYPE_PM_CASH = "FLEX_SETTLEMENT_TYPE_PM_CASH" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/future.py b/openapi/openapi_project/openapi_package/models/future.py deleted file mode 100644 index 80610603e..000000000 --- a/openapi/openapi_project/openapi_package/models/future.py +++ /dev/null @@ -1,364 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.models.exchange_code import ExchangeCode -from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat -from openapi_project.openapi_package.models.security_category import SecurityCategory -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.date import Date - from openapi_project.openapi_package.models.future_aliases import FutureAliases - from openapi_project.openapi_package.models.future_root import FutureRoot - - -T = TypeVar("T", bound="Future") - - -@_attrs_define -class Future: - """ - Attributes: - aliases (Union[Unset, FutureAliases]): - currency (Union[Unset, Currency]): - listed_dt (Union[Unset, Date]): - delisted_dt (Union[Unset, Date]): - description (Union[Unset, str]): - exchange_id (Union[Unset, int]): - id (Union[Unset, int]): - multiplier (Union[Unset, float]): - price_base_factor (Union[Unset, float]): - price_display_factor (Union[Unset, float]): - price_display_format (Union[Unset, NumericDisplayFormat]): - qty_display_factor (Union[Unset, float]): - qty_display_format (Union[Unset, NumericDisplayFormat]): - security_category (Union[Unset, SecurityCategory]): - symbol (Union[Unset, str]): - tick_rule (Union[Unset, str]): - tick_size (Union[Unset, float]): - tick_value (Union[Unset, float]): - traded_exchanges (Union[Unset, list[ExchangeCode]]): - contract_myy (Union[Unset, str]): - first_notice_dt (Union[Unset, Date]): - first_trade_dt (Union[Unset, Date]): - last_notice_dt (Union[Unset, Date]): - last_trade_dt (Union[Unset, Date]): - root (Union[Unset, FutureRoot]): - """ - - aliases: Union[Unset, "FutureAliases"] = UNSET - currency: Unset | Currency = UNSET - listed_dt: Union[Unset, "Date"] = UNSET - delisted_dt: Union[Unset, "Date"] = UNSET - description: Unset | str = UNSET - exchange_id: Unset | int = UNSET - id: Unset | int = UNSET - multiplier: Unset | float = UNSET - price_base_factor: Unset | float = UNSET - price_display_factor: Unset | float = UNSET - price_display_format: Unset | NumericDisplayFormat = UNSET - qty_display_factor: Unset | float = UNSET - qty_display_format: Unset | NumericDisplayFormat = UNSET - security_category: Unset | SecurityCategory = UNSET - symbol: Unset | str = UNSET - tick_rule: Unset | str = UNSET - tick_size: Unset | float = UNSET - tick_value: Unset | float = UNSET - traded_exchanges: Unset | list[ExchangeCode] = UNSET - contract_myy: Unset | str = UNSET - first_notice_dt: Union[Unset, "Date"] = UNSET - first_trade_dt: Union[Unset, "Date"] = UNSET - last_notice_dt: Union[Unset, "Date"] = UNSET - last_trade_dt: Union[Unset, "Date"] = UNSET - root: Union[Unset, "FutureRoot"] = UNSET - - def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = UNSET - if not isinstance(self.aliases, Unset): - aliases = self.aliases.to_dict() - - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value - - listed_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.listed_dt, Unset): - listed_dt = self.listed_dt.to_dict() - - delisted_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.delisted_dt, Unset): - delisted_dt = self.delisted_dt.to_dict() - - description = self.description - - exchange_id = self.exchange_id - - id = self.id - - multiplier = self.multiplier - - price_base_factor = self.price_base_factor - - price_display_factor = self.price_display_factor - - price_display_format: Unset | str = UNSET - if not isinstance(self.price_display_format, Unset): - price_display_format = self.price_display_format.value - - qty_display_factor = self.qty_display_factor - - qty_display_format: Unset | str = UNSET - if not isinstance(self.qty_display_format, Unset): - qty_display_format = self.qty_display_format.value - - security_category: Unset | str = UNSET - if not isinstance(self.security_category, Unset): - security_category = self.security_category.value - - symbol = self.symbol - - tick_rule = self.tick_rule - - tick_size = self.tick_size - - tick_value = self.tick_value - - traded_exchanges: Unset | list[str] = UNSET - if not isinstance(self.traded_exchanges, Unset): - traded_exchanges = [] - for traded_exchanges_item_data in self.traded_exchanges: - traded_exchanges_item = traded_exchanges_item_data.value - traded_exchanges.append(traded_exchanges_item) - - contract_myy = self.contract_myy - - first_notice_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.first_notice_dt, Unset): - first_notice_dt = self.first_notice_dt.to_dict() - - first_trade_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.first_trade_dt, Unset): - first_trade_dt = self.first_trade_dt.to_dict() - - last_notice_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.last_notice_dt, Unset): - last_notice_dt = self.last_notice_dt.to_dict() - - last_trade_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.last_trade_dt, Unset): - last_trade_dt = self.last_trade_dt.to_dict() - - root: Unset | dict[str, Any] = UNSET - if not isinstance(self.root, Unset): - root = self.root.to_dict() - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if aliases is not UNSET: - field_dict["aliases"] = aliases - if currency is not UNSET: - field_dict["currency"] = currency - if listed_dt is not UNSET: - field_dict["listedDt"] = listed_dt - if delisted_dt is not UNSET: - field_dict["delistedDt"] = delisted_dt - if description is not UNSET: - field_dict["description"] = description - if exchange_id is not UNSET: - field_dict["exchangeId"] = exchange_id - if id is not UNSET: - field_dict["id"] = id - if multiplier is not UNSET: - field_dict["multiplier"] = multiplier - if price_base_factor is not UNSET: - field_dict["priceBaseFactor"] = price_base_factor - if price_display_factor is not UNSET: - field_dict["priceDisplayFactor"] = price_display_factor - if price_display_format is not UNSET: - field_dict["priceDisplayFormat"] = price_display_format - if qty_display_factor is not UNSET: - field_dict["qtyDisplayFactor"] = qty_display_factor - if qty_display_format is not UNSET: - field_dict["qtyDisplayFormat"] = qty_display_format - if security_category is not UNSET: - field_dict["securityCategory"] = security_category - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tick_rule is not UNSET: - field_dict["tickRule"] = tick_rule - if tick_size is not UNSET: - field_dict["tickSize"] = tick_size - if tick_value is not UNSET: - field_dict["tickValue"] = tick_value - if traded_exchanges is not UNSET: - field_dict["tradedExchanges"] = traded_exchanges - if contract_myy is not UNSET: - field_dict["contractMYY"] = contract_myy - if first_notice_dt is not UNSET: - field_dict["firstNoticeDt"] = first_notice_dt - if first_trade_dt is not UNSET: - field_dict["firstTradeDt"] = first_trade_dt - if last_notice_dt is not UNSET: - field_dict["lastNoticeDt"] = last_notice_dt - if last_trade_dt is not UNSET: - field_dict["lastTradeDt"] = last_trade_dt - if root is not UNSET: - field_dict["root"] = root - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.date import Date - from openapi_project.openapi_package.models.future_aliases import FutureAliases - from openapi_project.openapi_package.models.future_root import FutureRoot - - d = dict(src_dict) - _aliases = d.pop("aliases", UNSET) - aliases: Unset | FutureAliases - if isinstance(_aliases, Unset): - aliases = UNSET - else: - aliases = FutureAliases.from_dict(_aliases) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) - - _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date - if isinstance(_listed_dt, Unset): - listed_dt = UNSET - else: - listed_dt = Date.from_dict(_listed_dt) - - _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date - if isinstance(_delisted_dt, Unset): - delisted_dt = UNSET - else: - delisted_dt = Date.from_dict(_delisted_dt) - - description = d.pop("description", UNSET) - - exchange_id = d.pop("exchangeId", UNSET) - - id = d.pop("id", UNSET) - - multiplier = d.pop("multiplier", UNSET) - - price_base_factor = d.pop("priceBaseFactor", UNSET) - - price_display_factor = d.pop("priceDisplayFactor", UNSET) - - _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat - if isinstance(_price_display_format, Unset): - price_display_format = UNSET - else: - price_display_format = NumericDisplayFormat(_price_display_format) - - qty_display_factor = d.pop("qtyDisplayFactor", UNSET) - - _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat - if isinstance(_qty_display_format, Unset): - qty_display_format = UNSET - else: - qty_display_format = NumericDisplayFormat(_qty_display_format) - - _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory - if isinstance(_security_category, Unset): - security_category = UNSET - else: - security_category = SecurityCategory(_security_category) - - symbol = d.pop("symbol", UNSET) - - tick_rule = d.pop("tickRule", UNSET) - - tick_size = d.pop("tickSize", UNSET) - - tick_value = d.pop("tickValue", UNSET) - - traded_exchanges = [] - _traded_exchanges = d.pop("tradedExchanges", UNSET) - for traded_exchanges_item_data in _traded_exchanges or []: - traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) - - traded_exchanges.append(traded_exchanges_item) - - contract_myy = d.pop("contractMYY", UNSET) - - _first_notice_dt = d.pop("firstNoticeDt", UNSET) - first_notice_dt: Unset | Date - if isinstance(_first_notice_dt, Unset): - first_notice_dt = UNSET - else: - first_notice_dt = Date.from_dict(_first_notice_dt) - - _first_trade_dt = d.pop("firstTradeDt", UNSET) - first_trade_dt: Unset | Date - if isinstance(_first_trade_dt, Unset): - first_trade_dt = UNSET - else: - first_trade_dt = Date.from_dict(_first_trade_dt) - - _last_notice_dt = d.pop("lastNoticeDt", UNSET) - last_notice_dt: Unset | Date - if isinstance(_last_notice_dt, Unset): - last_notice_dt = UNSET - else: - last_notice_dt = Date.from_dict(_last_notice_dt) - - _last_trade_dt = d.pop("lastTradeDt", UNSET) - last_trade_dt: Unset | Date - if isinstance(_last_trade_dt, Unset): - last_trade_dt = UNSET - else: - last_trade_dt = Date.from_dict(_last_trade_dt) - - _root = d.pop("root", UNSET) - root: Unset | FutureRoot - if isinstance(_root, Unset): - root = UNSET - else: - root = FutureRoot.from_dict(_root) - - future = cls( - aliases=aliases, - currency=currency, - listed_dt=listed_dt, - delisted_dt=delisted_dt, - description=description, - exchange_id=exchange_id, - id=id, - multiplier=multiplier, - price_base_factor=price_base_factor, - price_display_factor=price_display_factor, - price_display_format=price_display_format, - qty_display_factor=qty_display_factor, - qty_display_format=qty_display_format, - security_category=security_category, - symbol=symbol, - tick_rule=tick_rule, - tick_size=tick_size, - tick_value=tick_value, - traded_exchanges=traded_exchanges, - contract_myy=contract_myy, - first_notice_dt=first_notice_dt, - first_trade_dt=first_trade_dt, - last_notice_dt=last_notice_dt, - last_trade_dt=last_trade_dt, - root=root, - ) - - return future diff --git a/openapi/openapi_project/openapi_package/models/future_aliases.py b/openapi/openapi_project/openapi_package/models/future_aliases.py deleted file mode 100644 index 99b81ab33..000000000 --- a/openapi/openapi_project/openapi_package/models/future_aliases.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="FutureAliases") - - -@_attrs_define -class FutureAliases: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - future_aliases = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - future_aliases.additional_properties = additional_properties - return future_aliases - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/future_root.py b/openapi/openapi_project/openapi_package/models/future_root.py deleted file mode 100644 index cb7607e50..000000000 --- a/openapi/openapi_project/openapi_package/models/future_root.py +++ /dev/null @@ -1,364 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.models.exchange_code import ExchangeCode -from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat -from openapi_project.openapi_package.models.product_group import ProductGroup -from openapi_project.openapi_package.models.product_sub_group import ProductSubGroup -from openapi_project.openapi_package.models.security_category import SecurityCategory -from openapi_project.openapi_package.models.settlement_deliverable_type import SettlementDeliverableType -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.date import Date - from openapi_project.openapi_package.models.future_root_aliases import FutureRootAliases - from openapi_project.openapi_package.models.trading_session_group import TradingSessionGroup - - -T = TypeVar("T", bound="FutureRoot") - - -@_attrs_define -class FutureRoot: - """ - Attributes: - aliases (Union[Unset, FutureRootAliases]): - currency (Union[Unset, Currency]): - listed_dt (Union[Unset, Date]): - delisted_dt (Union[Unset, Date]): - description (Union[Unset, str]): - exchange_id (Union[Unset, int]): - id (Union[Unset, int]): - multiplier (Union[Unset, float]): - price_base_factor (Union[Unset, float]): - price_display_factor (Union[Unset, float]): - price_display_format (Union[Unset, NumericDisplayFormat]): - qty_display_factor (Union[Unset, float]): - qty_display_format (Union[Unset, NumericDisplayFormat]): - security_category (Union[Unset, SecurityCategory]): - symbol (Union[Unset, str]): - tick_rule (Union[Unset, str]): - tick_size (Union[Unset, float]): - tick_value (Union[Unset, float]): - traded_exchanges (Union[Unset, list[ExchangeCode]]): - product_group (Union[Unset, ProductGroup]): - product_sub_group (Union[Unset, ProductSubGroup]): - settlement_deliverable_type (Union[Unset, SettlementDeliverableType]): - unit_of_measure (Union[Unset, str]): - unit_of_measure_qty (Union[Unset, float]): - trading_session_group (Union[Unset, TradingSessionGroup]): - """ - - aliases: Union[Unset, "FutureRootAliases"] = UNSET - currency: Unset | Currency = UNSET - listed_dt: Union[Unset, "Date"] = UNSET - delisted_dt: Union[Unset, "Date"] = UNSET - description: Unset | str = UNSET - exchange_id: Unset | int = UNSET - id: Unset | int = UNSET - multiplier: Unset | float = UNSET - price_base_factor: Unset | float = UNSET - price_display_factor: Unset | float = UNSET - price_display_format: Unset | NumericDisplayFormat = UNSET - qty_display_factor: Unset | float = UNSET - qty_display_format: Unset | NumericDisplayFormat = UNSET - security_category: Unset | SecurityCategory = UNSET - symbol: Unset | str = UNSET - tick_rule: Unset | str = UNSET - tick_size: Unset | float = UNSET - tick_value: Unset | float = UNSET - traded_exchanges: Unset | list[ExchangeCode] = UNSET - product_group: Unset | ProductGroup = UNSET - product_sub_group: Unset | ProductSubGroup = UNSET - settlement_deliverable_type: Unset | SettlementDeliverableType = UNSET - unit_of_measure: Unset | str = UNSET - unit_of_measure_qty: Unset | float = UNSET - trading_session_group: Union[Unset, "TradingSessionGroup"] = UNSET - - def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = UNSET - if not isinstance(self.aliases, Unset): - aliases = self.aliases.to_dict() - - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value - - listed_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.listed_dt, Unset): - listed_dt = self.listed_dt.to_dict() - - delisted_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.delisted_dt, Unset): - delisted_dt = self.delisted_dt.to_dict() - - description = self.description - - exchange_id = self.exchange_id - - id = self.id - - multiplier = self.multiplier - - price_base_factor = self.price_base_factor - - price_display_factor = self.price_display_factor - - price_display_format: Unset | str = UNSET - if not isinstance(self.price_display_format, Unset): - price_display_format = self.price_display_format.value - - qty_display_factor = self.qty_display_factor - - qty_display_format: Unset | str = UNSET - if not isinstance(self.qty_display_format, Unset): - qty_display_format = self.qty_display_format.value - - security_category: Unset | str = UNSET - if not isinstance(self.security_category, Unset): - security_category = self.security_category.value - - symbol = self.symbol - - tick_rule = self.tick_rule - - tick_size = self.tick_size - - tick_value = self.tick_value - - traded_exchanges: Unset | list[str] = UNSET - if not isinstance(self.traded_exchanges, Unset): - traded_exchanges = [] - for traded_exchanges_item_data in self.traded_exchanges: - traded_exchanges_item = traded_exchanges_item_data.value - traded_exchanges.append(traded_exchanges_item) - - product_group: Unset | str = UNSET - if not isinstance(self.product_group, Unset): - product_group = self.product_group.value - - product_sub_group: Unset | str = UNSET - if not isinstance(self.product_sub_group, Unset): - product_sub_group = self.product_sub_group.value - - settlement_deliverable_type: Unset | str = UNSET - if not isinstance(self.settlement_deliverable_type, Unset): - settlement_deliverable_type = self.settlement_deliverable_type.value - - unit_of_measure = self.unit_of_measure - - unit_of_measure_qty = self.unit_of_measure_qty - - trading_session_group: Unset | dict[str, Any] = UNSET - if not isinstance(self.trading_session_group, Unset): - trading_session_group = self.trading_session_group.to_dict() - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if aliases is not UNSET: - field_dict["aliases"] = aliases - if currency is not UNSET: - field_dict["currency"] = currency - if listed_dt is not UNSET: - field_dict["listedDt"] = listed_dt - if delisted_dt is not UNSET: - field_dict["delistedDt"] = delisted_dt - if description is not UNSET: - field_dict["description"] = description - if exchange_id is not UNSET: - field_dict["exchangeId"] = exchange_id - if id is not UNSET: - field_dict["id"] = id - if multiplier is not UNSET: - field_dict["multiplier"] = multiplier - if price_base_factor is not UNSET: - field_dict["priceBaseFactor"] = price_base_factor - if price_display_factor is not UNSET: - field_dict["priceDisplayFactor"] = price_display_factor - if price_display_format is not UNSET: - field_dict["priceDisplayFormat"] = price_display_format - if qty_display_factor is not UNSET: - field_dict["qtyDisplayFactor"] = qty_display_factor - if qty_display_format is not UNSET: - field_dict["qtyDisplayFormat"] = qty_display_format - if security_category is not UNSET: - field_dict["securityCategory"] = security_category - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tick_rule is not UNSET: - field_dict["tickRule"] = tick_rule - if tick_size is not UNSET: - field_dict["tickSize"] = tick_size - if tick_value is not UNSET: - field_dict["tickValue"] = tick_value - if traded_exchanges is not UNSET: - field_dict["tradedExchanges"] = traded_exchanges - if product_group is not UNSET: - field_dict["productGroup"] = product_group - if product_sub_group is not UNSET: - field_dict["productSubGroup"] = product_sub_group - if settlement_deliverable_type is not UNSET: - field_dict["settlementDeliverableType"] = settlement_deliverable_type - if unit_of_measure is not UNSET: - field_dict["unitOfMeasure"] = unit_of_measure - if unit_of_measure_qty is not UNSET: - field_dict["unitOfMeasureQty"] = unit_of_measure_qty - if trading_session_group is not UNSET: - field_dict["tradingSessionGroup"] = trading_session_group - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.date import Date - from openapi_project.openapi_package.models.future_root_aliases import FutureRootAliases - from openapi_project.openapi_package.models.trading_session_group import TradingSessionGroup - - d = dict(src_dict) - _aliases = d.pop("aliases", UNSET) - aliases: Unset | FutureRootAliases - if isinstance(_aliases, Unset): - aliases = UNSET - else: - aliases = FutureRootAliases.from_dict(_aliases) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) - - _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date - if isinstance(_listed_dt, Unset): - listed_dt = UNSET - else: - listed_dt = Date.from_dict(_listed_dt) - - _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date - if isinstance(_delisted_dt, Unset): - delisted_dt = UNSET - else: - delisted_dt = Date.from_dict(_delisted_dt) - - description = d.pop("description", UNSET) - - exchange_id = d.pop("exchangeId", UNSET) - - id = d.pop("id", UNSET) - - multiplier = d.pop("multiplier", UNSET) - - price_base_factor = d.pop("priceBaseFactor", UNSET) - - price_display_factor = d.pop("priceDisplayFactor", UNSET) - - _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat - if isinstance(_price_display_format, Unset): - price_display_format = UNSET - else: - price_display_format = NumericDisplayFormat(_price_display_format) - - qty_display_factor = d.pop("qtyDisplayFactor", UNSET) - - _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat - if isinstance(_qty_display_format, Unset): - qty_display_format = UNSET - else: - qty_display_format = NumericDisplayFormat(_qty_display_format) - - _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory - if isinstance(_security_category, Unset): - security_category = UNSET - else: - security_category = SecurityCategory(_security_category) - - symbol = d.pop("symbol", UNSET) - - tick_rule = d.pop("tickRule", UNSET) - - tick_size = d.pop("tickSize", UNSET) - - tick_value = d.pop("tickValue", UNSET) - - traded_exchanges = [] - _traded_exchanges = d.pop("tradedExchanges", UNSET) - for traded_exchanges_item_data in _traded_exchanges or []: - traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) - - traded_exchanges.append(traded_exchanges_item) - - _product_group = d.pop("productGroup", UNSET) - product_group: Unset | ProductGroup - if isinstance(_product_group, Unset): - product_group = UNSET - else: - product_group = ProductGroup(_product_group) - - _product_sub_group = d.pop("productSubGroup", UNSET) - product_sub_group: Unset | ProductSubGroup - if isinstance(_product_sub_group, Unset): - product_sub_group = UNSET - else: - product_sub_group = ProductSubGroup(_product_sub_group) - - _settlement_deliverable_type = d.pop("settlementDeliverableType", UNSET) - settlement_deliverable_type: Unset | SettlementDeliverableType - if isinstance(_settlement_deliverable_type, Unset): - settlement_deliverable_type = UNSET - else: - settlement_deliverable_type = SettlementDeliverableType( - _settlement_deliverable_type - ) - - unit_of_measure = d.pop("unitOfMeasure", UNSET) - - unit_of_measure_qty = d.pop("unitOfMeasureQty", UNSET) - - _trading_session_group = d.pop("tradingSessionGroup", UNSET) - trading_session_group: Unset | TradingSessionGroup - if isinstance(_trading_session_group, Unset): - trading_session_group = UNSET - else: - trading_session_group = TradingSessionGroup.from_dict( - _trading_session_group - ) - - future_root = cls( - aliases=aliases, - currency=currency, - listed_dt=listed_dt, - delisted_dt=delisted_dt, - description=description, - exchange_id=exchange_id, - id=id, - multiplier=multiplier, - price_base_factor=price_base_factor, - price_display_factor=price_display_factor, - price_display_format=price_display_format, - qty_display_factor=qty_display_factor, - qty_display_format=qty_display_format, - security_category=security_category, - symbol=symbol, - tick_rule=tick_rule, - tick_size=tick_size, - tick_value=tick_value, - traded_exchanges=traded_exchanges, - product_group=product_group, - product_sub_group=product_sub_group, - settlement_deliverable_type=settlement_deliverable_type, - unit_of_measure=unit_of_measure, - unit_of_measure_qty=unit_of_measure_qty, - trading_session_group=trading_session_group, - ) - - return future_root diff --git a/openapi/openapi_project/openapi_package/models/future_root_aliases.py b/openapi/openapi_project/openapi_package/models/future_root_aliases.py deleted file mode 100644 index b6f75b0a9..000000000 --- a/openapi/openapi_project/openapi_package/models/future_root_aliases.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="FutureRootAliases") - - -@_attrs_define -class FutureRootAliases: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - future_root_aliases = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - future_root_aliases.additional_properties = additional_properties - return future_root_aliases - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/future_spread.py b/openapi/openapi_project/openapi_package/models/future_spread.py deleted file mode 100644 index 4efee6460..000000000 --- a/openapi/openapi_project/openapi_package/models/future_spread.py +++ /dev/null @@ -1,385 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.models.exchange_code import ExchangeCode -from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat -from openapi_project.openapi_package.models.security_category import SecurityCategory -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.date import Date - from openapi_project.openapi_package.models.future_spread_aliases import FutureSpreadAliases - from openapi_project.openapi_package.models.future_spread_leg import FutureSpreadLeg - - -T = TypeVar("T", bound="FutureSpread") - - -@_attrs_define -class FutureSpread: - """ - Attributes: - aliases (Union[Unset, FutureSpreadAliases]): - currency (Union[Unset, Currency]): - listed_dt (Union[Unset, Date]): - delisted_dt (Union[Unset, Date]): - description (Union[Unset, str]): - exchange_id (Union[Unset, int]): - id (Union[Unset, int]): - multiplier (Union[Unset, float]): - price_base_factor (Union[Unset, float]): - price_display_factor (Union[Unset, float]): - price_display_format (Union[Unset, NumericDisplayFormat]): - qty_display_factor (Union[Unset, float]): - qty_display_format (Union[Unset, NumericDisplayFormat]): - security_category (Union[Unset, SecurityCategory]): - symbol (Union[Unset, str]): - tick_rule (Union[Unset, str]): - tick_size (Union[Unset, float]): - tick_value (Union[Unset, float]): - traded_exchanges (Union[Unset, list[ExchangeCode]]): - contract_myy (Union[Unset, str]): - display_factor (Union[Unset, float]): - first_notice_dt (Union[Unset, Date]): - first_trade_dt (Union[Unset, Date]): - last_notice_dt (Union[Unset, Date]): - last_trade_dt (Union[Unset, Date]): - legs (Union[Unset, list['FutureSpreadLeg']]): - spread_code (Union[Unset, str]): - """ - - aliases: Union[Unset, "FutureSpreadAliases"] = UNSET - currency: Unset | Currency = UNSET - listed_dt: Union[Unset, "Date"] = UNSET - delisted_dt: Union[Unset, "Date"] = UNSET - description: Unset | str = UNSET - exchange_id: Unset | int = UNSET - id: Unset | int = UNSET - multiplier: Unset | float = UNSET - price_base_factor: Unset | float = UNSET - price_display_factor: Unset | float = UNSET - price_display_format: Unset | NumericDisplayFormat = UNSET - qty_display_factor: Unset | float = UNSET - qty_display_format: Unset | NumericDisplayFormat = UNSET - security_category: Unset | SecurityCategory = UNSET - symbol: Unset | str = UNSET - tick_rule: Unset | str = UNSET - tick_size: Unset | float = UNSET - tick_value: Unset | float = UNSET - traded_exchanges: Unset | list[ExchangeCode] = UNSET - contract_myy: Unset | str = UNSET - display_factor: Unset | float = UNSET - first_notice_dt: Union[Unset, "Date"] = UNSET - first_trade_dt: Union[Unset, "Date"] = UNSET - last_notice_dt: Union[Unset, "Date"] = UNSET - last_trade_dt: Union[Unset, "Date"] = UNSET - legs: Unset | list["FutureSpreadLeg"] = UNSET - spread_code: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = UNSET - if not isinstance(self.aliases, Unset): - aliases = self.aliases.to_dict() - - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value - - listed_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.listed_dt, Unset): - listed_dt = self.listed_dt.to_dict() - - delisted_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.delisted_dt, Unset): - delisted_dt = self.delisted_dt.to_dict() - - description = self.description - - exchange_id = self.exchange_id - - id = self.id - - multiplier = self.multiplier - - price_base_factor = self.price_base_factor - - price_display_factor = self.price_display_factor - - price_display_format: Unset | str = UNSET - if not isinstance(self.price_display_format, Unset): - price_display_format = self.price_display_format.value - - qty_display_factor = self.qty_display_factor - - qty_display_format: Unset | str = UNSET - if not isinstance(self.qty_display_format, Unset): - qty_display_format = self.qty_display_format.value - - security_category: Unset | str = UNSET - if not isinstance(self.security_category, Unset): - security_category = self.security_category.value - - symbol = self.symbol - - tick_rule = self.tick_rule - - tick_size = self.tick_size - - tick_value = self.tick_value - - traded_exchanges: Unset | list[str] = UNSET - if not isinstance(self.traded_exchanges, Unset): - traded_exchanges = [] - for traded_exchanges_item_data in self.traded_exchanges: - traded_exchanges_item = traded_exchanges_item_data.value - traded_exchanges.append(traded_exchanges_item) - - contract_myy = self.contract_myy - - display_factor = self.display_factor - - first_notice_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.first_notice_dt, Unset): - first_notice_dt = self.first_notice_dt.to_dict() - - first_trade_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.first_trade_dt, Unset): - first_trade_dt = self.first_trade_dt.to_dict() - - last_notice_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.last_notice_dt, Unset): - last_notice_dt = self.last_notice_dt.to_dict() - - last_trade_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.last_trade_dt, Unset): - last_trade_dt = self.last_trade_dt.to_dict() - - legs: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.legs, Unset): - legs = [] - for legs_item_data in self.legs: - legs_item = legs_item_data.to_dict() - legs.append(legs_item) - - spread_code = self.spread_code - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if aliases is not UNSET: - field_dict["aliases"] = aliases - if currency is not UNSET: - field_dict["currency"] = currency - if listed_dt is not UNSET: - field_dict["listedDt"] = listed_dt - if delisted_dt is not UNSET: - field_dict["delistedDt"] = delisted_dt - if description is not UNSET: - field_dict["description"] = description - if exchange_id is not UNSET: - field_dict["exchangeId"] = exchange_id - if id is not UNSET: - field_dict["id"] = id - if multiplier is not UNSET: - field_dict["multiplier"] = multiplier - if price_base_factor is not UNSET: - field_dict["priceBaseFactor"] = price_base_factor - if price_display_factor is not UNSET: - field_dict["priceDisplayFactor"] = price_display_factor - if price_display_format is not UNSET: - field_dict["priceDisplayFormat"] = price_display_format - if qty_display_factor is not UNSET: - field_dict["qtyDisplayFactor"] = qty_display_factor - if qty_display_format is not UNSET: - field_dict["qtyDisplayFormat"] = qty_display_format - if security_category is not UNSET: - field_dict["securityCategory"] = security_category - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tick_rule is not UNSET: - field_dict["tickRule"] = tick_rule - if tick_size is not UNSET: - field_dict["tickSize"] = tick_size - if tick_value is not UNSET: - field_dict["tickValue"] = tick_value - if traded_exchanges is not UNSET: - field_dict["tradedExchanges"] = traded_exchanges - if contract_myy is not UNSET: - field_dict["contractMYY"] = contract_myy - if display_factor is not UNSET: - field_dict["displayFactor"] = display_factor - if first_notice_dt is not UNSET: - field_dict["firstNoticeDt"] = first_notice_dt - if first_trade_dt is not UNSET: - field_dict["firstTradeDt"] = first_trade_dt - if last_notice_dt is not UNSET: - field_dict["lastNoticeDt"] = last_notice_dt - if last_trade_dt is not UNSET: - field_dict["lastTradeDt"] = last_trade_dt - if legs is not UNSET: - field_dict["legs"] = legs - if spread_code is not UNSET: - field_dict["spreadCode"] = spread_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.date import Date - from openapi_project.openapi_package.models.future_spread_aliases import FutureSpreadAliases - from openapi_project.openapi_package.models.future_spread_leg import FutureSpreadLeg - - d = dict(src_dict) - _aliases = d.pop("aliases", UNSET) - aliases: Unset | FutureSpreadAliases - if isinstance(_aliases, Unset): - aliases = UNSET - else: - aliases = FutureSpreadAliases.from_dict(_aliases) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) - - _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date - if isinstance(_listed_dt, Unset): - listed_dt = UNSET - else: - listed_dt = Date.from_dict(_listed_dt) - - _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date - if isinstance(_delisted_dt, Unset): - delisted_dt = UNSET - else: - delisted_dt = Date.from_dict(_delisted_dt) - - description = d.pop("description", UNSET) - - exchange_id = d.pop("exchangeId", UNSET) - - id = d.pop("id", UNSET) - - multiplier = d.pop("multiplier", UNSET) - - price_base_factor = d.pop("priceBaseFactor", UNSET) - - price_display_factor = d.pop("priceDisplayFactor", UNSET) - - _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat - if isinstance(_price_display_format, Unset): - price_display_format = UNSET - else: - price_display_format = NumericDisplayFormat(_price_display_format) - - qty_display_factor = d.pop("qtyDisplayFactor", UNSET) - - _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat - if isinstance(_qty_display_format, Unset): - qty_display_format = UNSET - else: - qty_display_format = NumericDisplayFormat(_qty_display_format) - - _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory - if isinstance(_security_category, Unset): - security_category = UNSET - else: - security_category = SecurityCategory(_security_category) - - symbol = d.pop("symbol", UNSET) - - tick_rule = d.pop("tickRule", UNSET) - - tick_size = d.pop("tickSize", UNSET) - - tick_value = d.pop("tickValue", UNSET) - - traded_exchanges = [] - _traded_exchanges = d.pop("tradedExchanges", UNSET) - for traded_exchanges_item_data in _traded_exchanges or []: - traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) - - traded_exchanges.append(traded_exchanges_item) - - contract_myy = d.pop("contractMYY", UNSET) - - display_factor = d.pop("displayFactor", UNSET) - - _first_notice_dt = d.pop("firstNoticeDt", UNSET) - first_notice_dt: Unset | Date - if isinstance(_first_notice_dt, Unset): - first_notice_dt = UNSET - else: - first_notice_dt = Date.from_dict(_first_notice_dt) - - _first_trade_dt = d.pop("firstTradeDt", UNSET) - first_trade_dt: Unset | Date - if isinstance(_first_trade_dt, Unset): - first_trade_dt = UNSET - else: - first_trade_dt = Date.from_dict(_first_trade_dt) - - _last_notice_dt = d.pop("lastNoticeDt", UNSET) - last_notice_dt: Unset | Date - if isinstance(_last_notice_dt, Unset): - last_notice_dt = UNSET - else: - last_notice_dt = Date.from_dict(_last_notice_dt) - - _last_trade_dt = d.pop("lastTradeDt", UNSET) - last_trade_dt: Unset | Date - if isinstance(_last_trade_dt, Unset): - last_trade_dt = UNSET - else: - last_trade_dt = Date.from_dict(_last_trade_dt) - - legs = [] - _legs = d.pop("legs", UNSET) - for legs_item_data in _legs or []: - legs_item = FutureSpreadLeg.from_dict(legs_item_data) - - legs.append(legs_item) - - spread_code = d.pop("spreadCode", UNSET) - - future_spread = cls( - aliases=aliases, - currency=currency, - listed_dt=listed_dt, - delisted_dt=delisted_dt, - description=description, - exchange_id=exchange_id, - id=id, - multiplier=multiplier, - price_base_factor=price_base_factor, - price_display_factor=price_display_factor, - price_display_format=price_display_format, - qty_display_factor=qty_display_factor, - qty_display_format=qty_display_format, - security_category=security_category, - symbol=symbol, - tick_rule=tick_rule, - tick_size=tick_size, - tick_value=tick_value, - traded_exchanges=traded_exchanges, - contract_myy=contract_myy, - display_factor=display_factor, - first_notice_dt=first_notice_dt, - first_trade_dt=first_trade_dt, - last_notice_dt=last_notice_dt, - last_trade_dt=last_trade_dt, - legs=legs, - spread_code=spread_code, - ) - - return future_spread diff --git a/openapi/openapi_project/openapi_package/models/future_spread_aliases.py b/openapi/openapi_project/openapi_package/models/future_spread_aliases.py deleted file mode 100644 index 27ac025a6..000000000 --- a/openapi/openapi_project/openapi_package/models/future_spread_aliases.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="FutureSpreadAliases") - - -@_attrs_define -class FutureSpreadAliases: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - future_spread_aliases = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - future_spread_aliases.additional_properties = additional_properties - return future_spread_aliases - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/future_spread_leg.py b/openapi/openapi_project/openapi_package/models/future_spread_leg.py deleted file mode 100644 index ed28eac22..000000000 --- a/openapi/openapi_project/openapi_package/models/future_spread_leg.py +++ /dev/null @@ -1,114 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.spread_leg_side import SpreadLegSide -from openapi_project.openapi_package.models.spread_leg_type import SpreadLegType -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.future import Future - - -T = TypeVar("T", bound="FutureSpreadLeg") - - -@_attrs_define -class FutureSpreadLeg: - """ - Attributes: - delta (Union[Unset, float]): - price (Union[Unset, float]): - ratio (Union[Unset, int]): - future (Union[Unset, Future]): - side (Union[Unset, SpreadLegSide]): - spread_leg_type (Union[Unset, SpreadLegType]): - """ - - delta: Unset | float = UNSET - price: Unset | float = UNSET - ratio: Unset | int = UNSET - future: Union[Unset, "Future"] = UNSET - side: Unset | SpreadLegSide = UNSET - spread_leg_type: Unset | SpreadLegType = UNSET - - def to_dict(self) -> dict[str, Any]: - delta = self.delta - - price = self.price - - ratio = self.ratio - - future: Unset | dict[str, Any] = UNSET - if not isinstance(self.future, Unset): - future = self.future.to_dict() - - side: Unset | str = UNSET - if not isinstance(self.side, Unset): - side = self.side.value - - spread_leg_type: Unset | str = UNSET - if not isinstance(self.spread_leg_type, Unset): - spread_leg_type = self.spread_leg_type.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if delta is not UNSET: - field_dict["delta"] = delta - if price is not UNSET: - field_dict["price"] = price - if ratio is not UNSET: - field_dict["ratio"] = ratio - if future is not UNSET: - field_dict["future"] = future - if side is not UNSET: - field_dict["side"] = side - if spread_leg_type is not UNSET: - field_dict["spreadLegType"] = spread_leg_type - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.future import Future - - d = dict(src_dict) - delta = d.pop("delta", UNSET) - - price = d.pop("price", UNSET) - - ratio = d.pop("ratio", UNSET) - - _future = d.pop("future", UNSET) - future: Unset | Future - if isinstance(_future, Unset): - future = UNSET - else: - future = Future.from_dict(_future) - - _side = d.pop("side", UNSET) - side: Unset | SpreadLegSide - if isinstance(_side, Unset): - side = UNSET - else: - side = SpreadLegSide(_side) - - _spread_leg_type = d.pop("spreadLegType", UNSET) - spread_leg_type: Unset | SpreadLegType - if isinstance(_spread_leg_type, Unset): - spread_leg_type = UNSET - else: - spread_leg_type = SpreadLegType(_spread_leg_type) - - future_spread_leg = cls( - delta=delta, - price=price, - ratio=ratio, - future=future, - side=side, - spread_leg_type=spread_leg_type, - ) - - return future_spread_leg diff --git a/openapi/openapi_project/openapi_package/models/fx.py b/openapi/openapi_project/openapi_package/models/fx.py deleted file mode 100644 index e4b1f68c0..000000000 --- a/openapi/openapi_project/openapi_package/models/fx.py +++ /dev/null @@ -1,289 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.models.exchange_code import ExchangeCode -from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat -from openapi_project.openapi_package.models.security_category import SecurityCategory -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.date import Date - from openapi_project.openapi_package.models.fx_aliases import FxAliases - - -T = TypeVar("T", bound="Fx") - - -@_attrs_define -class Fx: - """ - Attributes: - aliases (Union[Unset, FxAliases]): - currency (Union[Unset, Currency]): - listed_dt (Union[Unset, Date]): - delisted_dt (Union[Unset, Date]): - description (Union[Unset, str]): - exchange_id (Union[Unset, int]): - id (Union[Unset, int]): - multiplier (Union[Unset, float]): - price_base_factor (Union[Unset, float]): - price_display_factor (Union[Unset, float]): - price_display_format (Union[Unset, NumericDisplayFormat]): - qty_display_factor (Union[Unset, float]): - qty_display_format (Union[Unset, NumericDisplayFormat]): - security_category (Union[Unset, SecurityCategory]): - symbol (Union[Unset, str]): - tick_rule (Union[Unset, str]): - tick_size (Union[Unset, float]): - tick_value (Union[Unset, float]): - traded_exchanges (Union[Unset, list[ExchangeCode]]): - quote_currency (Union[Unset, Currency]): - """ - - aliases: Union[Unset, "FxAliases"] = UNSET - currency: Unset | Currency = UNSET - listed_dt: Union[Unset, "Date"] = UNSET - delisted_dt: Union[Unset, "Date"] = UNSET - description: Unset | str = UNSET - exchange_id: Unset | int = UNSET - id: Unset | int = UNSET - multiplier: Unset | float = UNSET - price_base_factor: Unset | float = UNSET - price_display_factor: Unset | float = UNSET - price_display_format: Unset | NumericDisplayFormat = UNSET - qty_display_factor: Unset | float = UNSET - qty_display_format: Unset | NumericDisplayFormat = UNSET - security_category: Unset | SecurityCategory = UNSET - symbol: Unset | str = UNSET - tick_rule: Unset | str = UNSET - tick_size: Unset | float = UNSET - tick_value: Unset | float = UNSET - traded_exchanges: Unset | list[ExchangeCode] = UNSET - quote_currency: Unset | Currency = UNSET - - def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = UNSET - if not isinstance(self.aliases, Unset): - aliases = self.aliases.to_dict() - - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value - - listed_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.listed_dt, Unset): - listed_dt = self.listed_dt.to_dict() - - delisted_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.delisted_dt, Unset): - delisted_dt = self.delisted_dt.to_dict() - - description = self.description - - exchange_id = self.exchange_id - - id = self.id - - multiplier = self.multiplier - - price_base_factor = self.price_base_factor - - price_display_factor = self.price_display_factor - - price_display_format: Unset | str = UNSET - if not isinstance(self.price_display_format, Unset): - price_display_format = self.price_display_format.value - - qty_display_factor = self.qty_display_factor - - qty_display_format: Unset | str = UNSET - if not isinstance(self.qty_display_format, Unset): - qty_display_format = self.qty_display_format.value - - security_category: Unset | str = UNSET - if not isinstance(self.security_category, Unset): - security_category = self.security_category.value - - symbol = self.symbol - - tick_rule = self.tick_rule - - tick_size = self.tick_size - - tick_value = self.tick_value - - traded_exchanges: Unset | list[str] = UNSET - if not isinstance(self.traded_exchanges, Unset): - traded_exchanges = [] - for traded_exchanges_item_data in self.traded_exchanges: - traded_exchanges_item = traded_exchanges_item_data.value - traded_exchanges.append(traded_exchanges_item) - - quote_currency: Unset | str = UNSET - if not isinstance(self.quote_currency, Unset): - quote_currency = self.quote_currency.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if aliases is not UNSET: - field_dict["aliases"] = aliases - if currency is not UNSET: - field_dict["currency"] = currency - if listed_dt is not UNSET: - field_dict["listedDt"] = listed_dt - if delisted_dt is not UNSET: - field_dict["delistedDt"] = delisted_dt - if description is not UNSET: - field_dict["description"] = description - if exchange_id is not UNSET: - field_dict["exchangeId"] = exchange_id - if id is not UNSET: - field_dict["id"] = id - if multiplier is not UNSET: - field_dict["multiplier"] = multiplier - if price_base_factor is not UNSET: - field_dict["priceBaseFactor"] = price_base_factor - if price_display_factor is not UNSET: - field_dict["priceDisplayFactor"] = price_display_factor - if price_display_format is not UNSET: - field_dict["priceDisplayFormat"] = price_display_format - if qty_display_factor is not UNSET: - field_dict["qtyDisplayFactor"] = qty_display_factor - if qty_display_format is not UNSET: - field_dict["qtyDisplayFormat"] = qty_display_format - if security_category is not UNSET: - field_dict["securityCategory"] = security_category - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tick_rule is not UNSET: - field_dict["tickRule"] = tick_rule - if tick_size is not UNSET: - field_dict["tickSize"] = tick_size - if tick_value is not UNSET: - field_dict["tickValue"] = tick_value - if traded_exchanges is not UNSET: - field_dict["tradedExchanges"] = traded_exchanges - if quote_currency is not UNSET: - field_dict["quoteCurrency"] = quote_currency - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.date import Date - from openapi_project.openapi_package.models.fx_aliases import FxAliases - - d = dict(src_dict) - _aliases = d.pop("aliases", UNSET) - aliases: Unset | FxAliases - if isinstance(_aliases, Unset): - aliases = UNSET - else: - aliases = FxAliases.from_dict(_aliases) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) - - _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date - if isinstance(_listed_dt, Unset): - listed_dt = UNSET - else: - listed_dt = Date.from_dict(_listed_dt) - - _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date - if isinstance(_delisted_dt, Unset): - delisted_dt = UNSET - else: - delisted_dt = Date.from_dict(_delisted_dt) - - description = d.pop("description", UNSET) - - exchange_id = d.pop("exchangeId", UNSET) - - id = d.pop("id", UNSET) - - multiplier = d.pop("multiplier", UNSET) - - price_base_factor = d.pop("priceBaseFactor", UNSET) - - price_display_factor = d.pop("priceDisplayFactor", UNSET) - - _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat - if isinstance(_price_display_format, Unset): - price_display_format = UNSET - else: - price_display_format = NumericDisplayFormat(_price_display_format) - - qty_display_factor = d.pop("qtyDisplayFactor", UNSET) - - _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat - if isinstance(_qty_display_format, Unset): - qty_display_format = UNSET - else: - qty_display_format = NumericDisplayFormat(_qty_display_format) - - _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory - if isinstance(_security_category, Unset): - security_category = UNSET - else: - security_category = SecurityCategory(_security_category) - - symbol = d.pop("symbol", UNSET) - - tick_rule = d.pop("tickRule", UNSET) - - tick_size = d.pop("tickSize", UNSET) - - tick_value = d.pop("tickValue", UNSET) - - traded_exchanges = [] - _traded_exchanges = d.pop("tradedExchanges", UNSET) - for traded_exchanges_item_data in _traded_exchanges or []: - traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) - - traded_exchanges.append(traded_exchanges_item) - - _quote_currency = d.pop("quoteCurrency", UNSET) - quote_currency: Unset | Currency - if isinstance(_quote_currency, Unset): - quote_currency = UNSET - else: - quote_currency = Currency(_quote_currency) - - fx = cls( - aliases=aliases, - currency=currency, - listed_dt=listed_dt, - delisted_dt=delisted_dt, - description=description, - exchange_id=exchange_id, - id=id, - multiplier=multiplier, - price_base_factor=price_base_factor, - price_display_factor=price_display_factor, - price_display_format=price_display_format, - qty_display_factor=qty_display_factor, - qty_display_format=qty_display_format, - security_category=security_category, - symbol=symbol, - tick_rule=tick_rule, - tick_size=tick_size, - tick_value=tick_value, - traded_exchanges=traded_exchanges, - quote_currency=quote_currency, - ) - - return fx diff --git a/openapi/openapi_project/openapi_package/models/fx_aliases.py b/openapi/openapi_project/openapi_package/models/fx_aliases.py deleted file mode 100644 index af0dc0adc..000000000 --- a/openapi/openapi_project/openapi_package/models/fx_aliases.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="FxAliases") - - -@_attrs_define -class FxAliases: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - fx_aliases = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - fx_aliases.additional_properties = additional_properties - return fx_aliases - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/generic_order.py b/openapi/openapi_project/openapi_package/models/generic_order.py deleted file mode 100644 index 380ee4174..000000000 --- a/openapi/openapi_project/openapi_package/models/generic_order.py +++ /dev/null @@ -1,107 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.multi_leg_order import MultiLegOrder - from openapi_project.openapi_package.models.multi_leg_order_cross import MultiLegOrderCross - from openapi_project.openapi_package.models.order import Order - from openapi_project.openapi_package.models.order_cross import OrderCross - - -T = TypeVar("T", bound="GenericOrder") - - -@_attrs_define -class GenericOrder: - """ - Attributes: - order (Union[Unset, Order]): - order_cross (Union[Unset, OrderCross]): - multi_leg_order (Union[Unset, MultiLegOrder]): - multi_leg_order_cross (Union[Unset, MultiLegOrderCross]): - """ - - order: Union[Unset, "Order"] = UNSET - order_cross: Union[Unset, "OrderCross"] = UNSET - multi_leg_order: Union[Unset, "MultiLegOrder"] = UNSET - multi_leg_order_cross: Union[Unset, "MultiLegOrderCross"] = UNSET - - def to_dict(self) -> dict[str, Any]: - order: Unset | dict[str, Any] = UNSET - if not isinstance(self.order, Unset): - order = self.order.to_dict() - - order_cross: Unset | dict[str, Any] = UNSET - if not isinstance(self.order_cross, Unset): - order_cross = self.order_cross.to_dict() - - multi_leg_order: Unset | dict[str, Any] = UNSET - if not isinstance(self.multi_leg_order, Unset): - multi_leg_order = self.multi_leg_order.to_dict() - - multi_leg_order_cross: Unset | dict[str, Any] = UNSET - if not isinstance(self.multi_leg_order_cross, Unset): - multi_leg_order_cross = self.multi_leg_order_cross.to_dict() - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if order is not UNSET: - field_dict["order"] = order - if order_cross is not UNSET: - field_dict["orderCross"] = order_cross - if multi_leg_order is not UNSET: - field_dict["multiLegOrder"] = multi_leg_order - if multi_leg_order_cross is not UNSET: - field_dict["multiLegOrderCross"] = multi_leg_order_cross - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.multi_leg_order import MultiLegOrder - from openapi_project.openapi_package.models.multi_leg_order_cross import MultiLegOrderCross - from openapi_project.openapi_package.models.order import Order - from openapi_project.openapi_package.models.order_cross import OrderCross - - d = dict(src_dict) - _order = d.pop("order", UNSET) - order: Unset | Order - if isinstance(_order, Unset): - order = UNSET - else: - order = Order.from_dict(_order) - - _order_cross = d.pop("orderCross", UNSET) - order_cross: Unset | OrderCross - if isinstance(_order_cross, Unset): - order_cross = UNSET - else: - order_cross = OrderCross.from_dict(_order_cross) - - _multi_leg_order = d.pop("multiLegOrder", UNSET) - multi_leg_order: Unset | MultiLegOrder - if isinstance(_multi_leg_order, Unset): - multi_leg_order = UNSET - else: - multi_leg_order = MultiLegOrder.from_dict(_multi_leg_order) - - _multi_leg_order_cross = d.pop("multiLegOrderCross", UNSET) - multi_leg_order_cross: Unset | MultiLegOrderCross - if isinstance(_multi_leg_order_cross, Unset): - multi_leg_order_cross = UNSET - else: - multi_leg_order_cross = MultiLegOrderCross.from_dict(_multi_leg_order_cross) - - generic_order = cls( - order=order, - order_cross=order_cross, - multi_leg_order=multi_leg_order, - multi_leg_order_cross=multi_leg_order_cross, - ) - - return generic_order diff --git a/openapi/openapi_project/openapi_package/models/get_active_user_response.py b/openapi/openapi_project/openapi_package/models/get_active_user_response.py deleted file mode 100644 index d47f9eede..000000000 --- a/openapi/openapi_project/openapi_package/models/get_active_user_response.py +++ /dev/null @@ -1,79 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.user import User - - -T = TypeVar("T", bound="GetActiveUserResponse") - - -@_attrs_define -class GetActiveUserResponse: - """ - Attributes: - user (Union[Unset, User]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - user: Union[Unset, "User"] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - user: Unset | dict[str, Any] = UNSET - if not isinstance(self.user, Unset): - user = self.user.to_dict() - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if user is not UNSET: - field_dict["user"] = user - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.user import User - - d = dict(src_dict) - _user = d.pop("user", UNSET) - user: Unset | User - if isinstance(_user, Unset): - user = UNSET - else: - user = User.from_dict(_user) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - get_active_user_response = cls( - user=user, - error_message=error_message, - status_code=status_code, - ) - - return get_active_user_response diff --git a/openapi/openapi_project/openapi_package/models/get_server_info_response.py b/openapi/openapi_project/openapi_package/models/get_server_info_response.py deleted file mode 100644 index dc64e5fd3..000000000 --- a/openapi/openapi_project/openapi_package/models/get_server_info_response.py +++ /dev/null @@ -1,137 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.get_server_info_response_system_settings import GetServerInfoResponseSystemSettings, - - - -T = TypeVar("T", bound="GetServerInfoResponse") - - -@_attrs_define -class GetServerInfoResponse: - """ - Attributes: - environment (Union[Unset, str]): - server_build_ts (Union[Unset, str]): - server_hash (Union[Unset, str]): - server_name (Union[Unset, str]): - server_version (Union[Unset, str]): - site (Union[Unset, str]): - system_settings (Union[Unset, GetServerInfoResponseSystemSettings]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - environment: Unset | str = UNSET - server_build_ts: Unset | str = UNSET - server_hash: Unset | str = UNSET - server_name: Unset | str = UNSET - server_version: Unset | str = UNSET - site: Unset | str = UNSET - system_settings: Union[Unset, "GetServerInfoResponseSystemSettings"] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - environment = self.environment - - server_build_ts = self.server_build_ts - - server_hash = self.server_hash - - server_name = self.server_name - - server_version = self.server_version - - site = self.site - - system_settings: Unset | dict[str, Any] = UNSET - if not isinstance(self.system_settings, Unset): - system_settings = self.system_settings.to_dict() - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if environment is not UNSET: - field_dict["environment"] = environment - if server_build_ts is not UNSET: - field_dict["serverBuildTs"] = server_build_ts - if server_hash is not UNSET: - field_dict["serverHash"] = server_hash - if server_name is not UNSET: - field_dict["serverName"] = server_name - if server_version is not UNSET: - field_dict["serverVersion"] = server_version - if site is not UNSET: - field_dict["site"] = site - if system_settings is not UNSET: - field_dict["systemSettings"] = system_settings - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.get_server_info_response_system_settings import GetServerInfoResponseSystemSettings, - - - d = dict(src_dict) - environment = d.pop("environment", UNSET) - - server_build_ts = d.pop("serverBuildTs", UNSET) - - server_hash = d.pop("serverHash", UNSET) - - server_name = d.pop("serverName", UNSET) - - server_version = d.pop("serverVersion", UNSET) - - site = d.pop("site", UNSET) - - _system_settings = d.pop("systemSettings", UNSET) - system_settings: Unset | GetServerInfoResponseSystemSettings - if isinstance(_system_settings, Unset): - system_settings = UNSET - else: - system_settings = GetServerInfoResponseSystemSettings.from_dict( - _system_settings - ) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - get_server_info_response = cls( - environment=environment, - server_build_ts=server_build_ts, - server_hash=server_hash, - server_name=server_name, - server_version=server_version, - site=site, - system_settings=system_settings, - error_message=error_message, - status_code=status_code, - ) - - return get_server_info_response diff --git a/openapi/openapi_project/openapi_package/models/get_server_info_response_system_settings.py b/openapi/openapi_project/openapi_package/models/get_server_info_response_system_settings.py deleted file mode 100644 index 4503270cf..000000000 --- a/openapi/openapi_project/openapi_package/models/get_server_info_response_system_settings.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="GetServerInfoResponseSystemSettings") - - -@_attrs_define -class GetServerInfoResponseSystemSettings: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - get_server_info_response_system_settings = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - get_server_info_response_system_settings.additional_properties = ( - additional_properties - ) - return get_server_info_response_system_settings - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/get_server_time_response.py b/openapi/openapi_project/openapi_package/models/get_server_time_response.py deleted file mode 100644 index 65c8ff92f..000000000 --- a/openapi/openapi_project/openapi_package/models/get_server_time_response.py +++ /dev/null @@ -1,66 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="GetServerTimeResponse") - - -@_attrs_define -class GetServerTimeResponse: - """ - Attributes: - server_time_utc (Union[Unset, str]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - server_time_utc: Unset | str = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - server_time_utc = self.server_time_utc - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if server_time_utc is not UNSET: - field_dict["serverTimeUtc"] = server_time_utc - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - server_time_utc = d.pop("serverTimeUtc", UNSET) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - get_server_time_response = cls( - server_time_utc=server_time_utc, - error_message=error_message, - status_code=status_code, - ) - - return get_server_time_response diff --git a/openapi/openapi_project/openapi_package/models/get_trading_holidays_response.py b/openapi/openapi_project/openapi_package/models/get_trading_holidays_response.py deleted file mode 100644 index fd2bed4f6..000000000 --- a/openapi/openapi_project/openapi_package/models/get_trading_holidays_response.py +++ /dev/null @@ -1,82 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.trading_holiday import TradingHoliday - - -T = TypeVar("T", bound="GetTradingHolidaysResponse") - - -@_attrs_define -class GetTradingHolidaysResponse: - """ - Attributes: - trading_holidays (Union[Unset, list['TradingHoliday']]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - trading_holidays: Unset | list["TradingHoliday"] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - trading_holidays: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.trading_holidays, Unset): - trading_holidays = [] - for trading_holidays_item_data in self.trading_holidays: - trading_holidays_item = trading_holidays_item_data.to_dict() - trading_holidays.append(trading_holidays_item) - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if trading_holidays is not UNSET: - field_dict["tradingHolidays"] = trading_holidays - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.trading_holiday import TradingHoliday - - d = dict(src_dict) - trading_holidays = [] - _trading_holidays = d.pop("tradingHolidays", UNSET) - for trading_holidays_item_data in _trading_holidays or []: - trading_holidays_item = TradingHoliday.from_dict(trading_holidays_item_data) - - trading_holidays.append(trading_holidays_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - get_trading_holidays_response = cls( - trading_holidays=trading_holidays, - error_message=error_message, - status_code=status_code, - ) - - return get_trading_holidays_response diff --git a/openapi/openapi_project/openapi_package/models/header.py b/openapi/openapi_project/openapi_package/models/header.py deleted file mode 100644 index cdc0ecdb8..000000000 --- a/openapi/openapi_project/openapi_package/models/header.py +++ /dev/null @@ -1,103 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="Header") - - -@_attrs_define -class Header: - """ - Attributes: - deliver_to_comp_id (Union[Unset, str]): - deliver_to_sub_id (Union[Unset, str]): - on_behalf_of_comp_id (Union[Unset, str]): - on_behalf_of_sub_id (Union[Unset, str]): - sender_comp_id (Union[Unset, str]): - sender_sub_id (Union[Unset, str]): - target_comp_id (Union[Unset, str]): - target_sub_id (Union[Unset, str]): - """ - - deliver_to_comp_id: Unset | str = UNSET - deliver_to_sub_id: Unset | str = UNSET - on_behalf_of_comp_id: Unset | str = UNSET - on_behalf_of_sub_id: Unset | str = UNSET - sender_comp_id: Unset | str = UNSET - sender_sub_id: Unset | str = UNSET - target_comp_id: Unset | str = UNSET - target_sub_id: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - deliver_to_comp_id = self.deliver_to_comp_id - - deliver_to_sub_id = self.deliver_to_sub_id - - on_behalf_of_comp_id = self.on_behalf_of_comp_id - - on_behalf_of_sub_id = self.on_behalf_of_sub_id - - sender_comp_id = self.sender_comp_id - - sender_sub_id = self.sender_sub_id - - target_comp_id = self.target_comp_id - - target_sub_id = self.target_sub_id - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if deliver_to_comp_id is not UNSET: - field_dict["deliverToCompId"] = deliver_to_comp_id - if deliver_to_sub_id is not UNSET: - field_dict["deliverToSubId"] = deliver_to_sub_id - if on_behalf_of_comp_id is not UNSET: - field_dict["onBehalfOfCompId"] = on_behalf_of_comp_id - if on_behalf_of_sub_id is not UNSET: - field_dict["onBehalfOfSubId"] = on_behalf_of_sub_id - if sender_comp_id is not UNSET: - field_dict["senderCompId"] = sender_comp_id - if sender_sub_id is not UNSET: - field_dict["senderSubId"] = sender_sub_id - if target_comp_id is not UNSET: - field_dict["targetCompId"] = target_comp_id - if target_sub_id is not UNSET: - field_dict["targetSubId"] = target_sub_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - deliver_to_comp_id = d.pop("deliverToCompId", UNSET) - - deliver_to_sub_id = d.pop("deliverToSubId", UNSET) - - on_behalf_of_comp_id = d.pop("onBehalfOfCompId", UNSET) - - on_behalf_of_sub_id = d.pop("onBehalfOfSubId", UNSET) - - sender_comp_id = d.pop("senderCompId", UNSET) - - sender_sub_id = d.pop("senderSubId", UNSET) - - target_comp_id = d.pop("targetCompId", UNSET) - - target_sub_id = d.pop("targetSubId", UNSET) - - header = cls( - deliver_to_comp_id=deliver_to_comp_id, - deliver_to_sub_id=deliver_to_sub_id, - on_behalf_of_comp_id=on_behalf_of_comp_id, - on_behalf_of_sub_id=on_behalf_of_sub_id, - sender_comp_id=sender_comp_id, - sender_sub_id=sender_sub_id, - target_comp_id=target_comp_id, - target_sub_id=target_sub_id, - ) - - return header diff --git a/openapi/openapi_project/openapi_package/models/index.py b/openapi/openapi_project/openapi_package/models/index.py deleted file mode 100644 index d7ffa9151..000000000 --- a/openapi/openapi_project/openapi_package/models/index.py +++ /dev/null @@ -1,273 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.models.exchange_code import ExchangeCode -from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat -from openapi_project.openapi_package.models.security_category import SecurityCategory -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.date import Date - from openapi_project.openapi_package.models.index_aliases import IndexAliases - - -T = TypeVar("T", bound="Index") - - -@_attrs_define -class Index: - """ - Attributes: - aliases (Union[Unset, IndexAliases]): - currency (Union[Unset, Currency]): - listed_dt (Union[Unset, Date]): - delisted_dt (Union[Unset, Date]): - description (Union[Unset, str]): - exchange_id (Union[Unset, int]): - id (Union[Unset, int]): - multiplier (Union[Unset, float]): - price_base_factor (Union[Unset, float]): - price_display_factor (Union[Unset, float]): - price_display_format (Union[Unset, NumericDisplayFormat]): - qty_display_factor (Union[Unset, float]): - qty_display_format (Union[Unset, NumericDisplayFormat]): - security_category (Union[Unset, SecurityCategory]): - symbol (Union[Unset, str]): - tick_rule (Union[Unset, str]): - tick_size (Union[Unset, float]): - tick_value (Union[Unset, float]): - traded_exchanges (Union[Unset, list[ExchangeCode]]): - """ - - aliases: Union[Unset, "IndexAliases"] = UNSET - currency: Unset | Currency = UNSET - listed_dt: Union[Unset, "Date"] = UNSET - delisted_dt: Union[Unset, "Date"] = UNSET - description: Unset | str = UNSET - exchange_id: Unset | int = UNSET - id: Unset | int = UNSET - multiplier: Unset | float = UNSET - price_base_factor: Unset | float = UNSET - price_display_factor: Unset | float = UNSET - price_display_format: Unset | NumericDisplayFormat = UNSET - qty_display_factor: Unset | float = UNSET - qty_display_format: Unset | NumericDisplayFormat = UNSET - security_category: Unset | SecurityCategory = UNSET - symbol: Unset | str = UNSET - tick_rule: Unset | str = UNSET - tick_size: Unset | float = UNSET - tick_value: Unset | float = UNSET - traded_exchanges: Unset | list[ExchangeCode] = UNSET - - def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = UNSET - if not isinstance(self.aliases, Unset): - aliases = self.aliases.to_dict() - - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value - - listed_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.listed_dt, Unset): - listed_dt = self.listed_dt.to_dict() - - delisted_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.delisted_dt, Unset): - delisted_dt = self.delisted_dt.to_dict() - - description = self.description - - exchange_id = self.exchange_id - - id = self.id - - multiplier = self.multiplier - - price_base_factor = self.price_base_factor - - price_display_factor = self.price_display_factor - - price_display_format: Unset | str = UNSET - if not isinstance(self.price_display_format, Unset): - price_display_format = self.price_display_format.value - - qty_display_factor = self.qty_display_factor - - qty_display_format: Unset | str = UNSET - if not isinstance(self.qty_display_format, Unset): - qty_display_format = self.qty_display_format.value - - security_category: Unset | str = UNSET - if not isinstance(self.security_category, Unset): - security_category = self.security_category.value - - symbol = self.symbol - - tick_rule = self.tick_rule - - tick_size = self.tick_size - - tick_value = self.tick_value - - traded_exchanges: Unset | list[str] = UNSET - if not isinstance(self.traded_exchanges, Unset): - traded_exchanges = [] - for traded_exchanges_item_data in self.traded_exchanges: - traded_exchanges_item = traded_exchanges_item_data.value - traded_exchanges.append(traded_exchanges_item) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if aliases is not UNSET: - field_dict["aliases"] = aliases - if currency is not UNSET: - field_dict["currency"] = currency - if listed_dt is not UNSET: - field_dict["listedDt"] = listed_dt - if delisted_dt is not UNSET: - field_dict["delistedDt"] = delisted_dt - if description is not UNSET: - field_dict["description"] = description - if exchange_id is not UNSET: - field_dict["exchangeId"] = exchange_id - if id is not UNSET: - field_dict["id"] = id - if multiplier is not UNSET: - field_dict["multiplier"] = multiplier - if price_base_factor is not UNSET: - field_dict["priceBaseFactor"] = price_base_factor - if price_display_factor is not UNSET: - field_dict["priceDisplayFactor"] = price_display_factor - if price_display_format is not UNSET: - field_dict["priceDisplayFormat"] = price_display_format - if qty_display_factor is not UNSET: - field_dict["qtyDisplayFactor"] = qty_display_factor - if qty_display_format is not UNSET: - field_dict["qtyDisplayFormat"] = qty_display_format - if security_category is not UNSET: - field_dict["securityCategory"] = security_category - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tick_rule is not UNSET: - field_dict["tickRule"] = tick_rule - if tick_size is not UNSET: - field_dict["tickSize"] = tick_size - if tick_value is not UNSET: - field_dict["tickValue"] = tick_value - if traded_exchanges is not UNSET: - field_dict["tradedExchanges"] = traded_exchanges - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.date import Date - from openapi_project.openapi_package.models.index_aliases import IndexAliases - - d = dict(src_dict) - _aliases = d.pop("aliases", UNSET) - aliases: Unset | IndexAliases - if isinstance(_aliases, Unset): - aliases = UNSET - else: - aliases = IndexAliases.from_dict(_aliases) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) - - _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date - if isinstance(_listed_dt, Unset): - listed_dt = UNSET - else: - listed_dt = Date.from_dict(_listed_dt) - - _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date - if isinstance(_delisted_dt, Unset): - delisted_dt = UNSET - else: - delisted_dt = Date.from_dict(_delisted_dt) - - description = d.pop("description", UNSET) - - exchange_id = d.pop("exchangeId", UNSET) - - id = d.pop("id", UNSET) - - multiplier = d.pop("multiplier", UNSET) - - price_base_factor = d.pop("priceBaseFactor", UNSET) - - price_display_factor = d.pop("priceDisplayFactor", UNSET) - - _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat - if isinstance(_price_display_format, Unset): - price_display_format = UNSET - else: - price_display_format = NumericDisplayFormat(_price_display_format) - - qty_display_factor = d.pop("qtyDisplayFactor", UNSET) - - _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat - if isinstance(_qty_display_format, Unset): - qty_display_format = UNSET - else: - qty_display_format = NumericDisplayFormat(_qty_display_format) - - _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory - if isinstance(_security_category, Unset): - security_category = UNSET - else: - security_category = SecurityCategory(_security_category) - - symbol = d.pop("symbol", UNSET) - - tick_rule = d.pop("tickRule", UNSET) - - tick_size = d.pop("tickSize", UNSET) - - tick_value = d.pop("tickValue", UNSET) - - traded_exchanges = [] - _traded_exchanges = d.pop("tradedExchanges", UNSET) - for traded_exchanges_item_data in _traded_exchanges or []: - traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) - - traded_exchanges.append(traded_exchanges_item) - - index = cls( - aliases=aliases, - currency=currency, - listed_dt=listed_dt, - delisted_dt=delisted_dt, - description=description, - exchange_id=exchange_id, - id=id, - multiplier=multiplier, - price_base_factor=price_base_factor, - price_display_factor=price_display_factor, - price_display_format=price_display_format, - qty_display_factor=qty_display_factor, - qty_display_format=qty_display_format, - security_category=security_category, - symbol=symbol, - tick_rule=tick_rule, - tick_size=tick_size, - tick_value=tick_value, - traded_exchanges=traded_exchanges, - ) - - return index diff --git a/openapi/openapi_project/openapi_package/models/index_aliases.py b/openapi/openapi_project/openapi_package/models/index_aliases.py deleted file mode 100644 index 297c59786..000000000 --- a/openapi/openapi_project/openapi_package/models/index_aliases.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="IndexAliases") - - -@_attrs_define -class IndexAliases: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - index_aliases = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - index_aliases.additional_properties = additional_properties - return index_aliases - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/list_accounts_response.py b/openapi/openapi_project/openapi_package/models/list_accounts_response.py deleted file mode 100644 index 2b18c3f18..000000000 --- a/openapi/openapi_project/openapi_package/models/list_accounts_response.py +++ /dev/null @@ -1,82 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.account import Account - - -T = TypeVar("T", bound="ListAccountsResponse") - - -@_attrs_define -class ListAccountsResponse: - """ - Attributes: - accounts (Union[Unset, list['Account']]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - accounts: Unset | list["Account"] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - accounts: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.accounts, Unset): - accounts = [] - for accounts_item_data in self.accounts: - accounts_item = accounts_item_data.to_dict() - accounts.append(accounts_item) - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if accounts is not UNSET: - field_dict["accounts"] = accounts - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.account import Account - - d = dict(src_dict) - accounts = [] - _accounts = d.pop("accounts", UNSET) - for accounts_item_data in _accounts or []: - accounts_item = Account.from_dict(accounts_item_data) - - accounts.append(accounts_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - list_accounts_response = cls( - accounts=accounts, - error_message=error_message, - status_code=status_code, - ) - - return list_accounts_response diff --git a/openapi/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py b/openapi/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py deleted file mode 100644 index e5de5f0ad..000000000 --- a/openapi/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py +++ /dev/null @@ -1,84 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.trading_firm_slim import TradingFirmSlim - - -T = TypeVar("T", bound="ListAffiliatedTradingFirmsResponse") - - -@_attrs_define -class ListAffiliatedTradingFirmsResponse: - """ - Attributes: - affiliated_firms (Union[Unset, list['TradingFirmSlim']]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - affiliated_firms: Unset | list["TradingFirmSlim"] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - affiliated_firms: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.affiliated_firms, Unset): - affiliated_firms = [] - for affiliated_firms_item_data in self.affiliated_firms: - affiliated_firms_item = affiliated_firms_item_data.to_dict() - affiliated_firms.append(affiliated_firms_item) - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if affiliated_firms is not UNSET: - field_dict["affiliatedFirms"] = affiliated_firms - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.trading_firm_slim import TradingFirmSlim - - d = dict(src_dict) - affiliated_firms = [] - _affiliated_firms = d.pop("affiliatedFirms", UNSET) - for affiliated_firms_item_data in _affiliated_firms or []: - affiliated_firms_item = TradingFirmSlim.from_dict( - affiliated_firms_item_data - ) - - affiliated_firms.append(affiliated_firms_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - list_affiliated_trading_firms_response = cls( - affiliated_firms=affiliated_firms, - error_message=error_message, - status_code=status_code, - ) - - return list_affiliated_trading_firms_response diff --git a/openapi/openapi_project/openapi_package/models/list_easy_to_borrow_securities_request.py b/openapi/openapi_project/openapi_package/models/list_easy_to_borrow_securities_request.py deleted file mode 100644 index 64b8c84aa..000000000 --- a/openapi/openapi_project/openapi_package/models/list_easy_to_borrow_securities_request.py +++ /dev/null @@ -1,49 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="ListEasyToBorrowSecuritiesRequest") - - -@_attrs_define -class ListEasyToBorrowSecuritiesRequest: - """ - Attributes: - trading_firm_id (Union[Unset, int]): - account_id (Union[Unset, int]): - """ - - trading_firm_id: Unset | int = UNSET - account_id: Unset | int = UNSET - - def to_dict(self) -> dict[str, Any]: - trading_firm_id = self.trading_firm_id - - account_id = self.account_id - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if trading_firm_id is not UNSET: - field_dict["tradingFirmId"] = trading_firm_id - if account_id is not UNSET: - field_dict["accountId"] = account_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - trading_firm_id = d.pop("tradingFirmId", UNSET) - - account_id = d.pop("accountId", UNSET) - - list_easy_to_borrow_securities_request = cls( - trading_firm_id=trading_firm_id, - account_id=account_id, - ) - - return list_easy_to_borrow_securities_request diff --git a/openapi/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py b/openapi/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py deleted file mode 100644 index 0f898aabc..000000000 --- a/openapi/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py +++ /dev/null @@ -1,82 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.easy_to_borrow_security import EasyToBorrowSecurity - - -T = TypeVar("T", bound="ListEasyToBorrowSecuritiesResponse") - - -@_attrs_define -class ListEasyToBorrowSecuritiesResponse: - """ - Attributes: - securities (Union[Unset, list['EasyToBorrowSecurity']]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - securities: Unset | list["EasyToBorrowSecurity"] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - securities: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.securities, Unset): - securities = [] - for securities_item_data in self.securities: - securities_item = securities_item_data.to_dict() - securities.append(securities_item) - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if securities is not UNSET: - field_dict["securities"] = securities - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.easy_to_borrow_security import EasyToBorrowSecurity - - d = dict(src_dict) - securities = [] - _securities = d.pop("securities", UNSET) - for securities_item_data in _securities or []: - securities_item = EasyToBorrowSecurity.from_dict(securities_item_data) - - securities.append(securities_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - list_easy_to_borrow_securities_response = cls( - securities=securities, - error_message=error_message, - status_code=status_code, - ) - - return list_easy_to_borrow_securities_response diff --git a/openapi/openapi_project/openapi_package/models/list_exchanges_response.py b/openapi/openapi_project/openapi_package/models/list_exchanges_response.py deleted file mode 100644 index 1a0c582e6..000000000 --- a/openapi/openapi_project/openapi_package/models/list_exchanges_response.py +++ /dev/null @@ -1,82 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.exchange import Exchange - - -T = TypeVar("T", bound="ListExchangesResponse") - - -@_attrs_define -class ListExchangesResponse: - """ - Attributes: - exchanges (Union[Unset, list['Exchange']]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - exchanges: Unset | list["Exchange"] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - exchanges: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.exchanges, Unset): - exchanges = [] - for exchanges_item_data in self.exchanges: - exchanges_item = exchanges_item_data.to_dict() - exchanges.append(exchanges_item) - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if exchanges is not UNSET: - field_dict["exchanges"] = exchanges - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.exchange import Exchange - - d = dict(src_dict) - exchanges = [] - _exchanges = d.pop("exchanges", UNSET) - for exchanges_item_data in _exchanges or []: - exchanges_item = Exchange.from_dict(exchanges_item_data) - - exchanges.append(exchanges_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - list_exchanges_response = cls( - exchanges=exchanges, - error_message=error_message, - status_code=status_code, - ) - - return list_exchanges_response diff --git a/openapi/openapi_project/openapi_package/models/list_option_chains_repsonse.py b/openapi/openapi_project/openapi_package/models/list_option_chains_repsonse.py deleted file mode 100644 index b5215c75d..000000000 --- a/openapi/openapi_project/openapi_package/models/list_option_chains_repsonse.py +++ /dev/null @@ -1,82 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.option_chain import OptionChain - - -T = TypeVar("T", bound="ListOptionChainsRepsonse") - - -@_attrs_define -class ListOptionChainsRepsonse: - """ - Attributes: - option_chains (Union[Unset, list['OptionChain']]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - option_chains: Unset | list["OptionChain"] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - option_chains: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.option_chains, Unset): - option_chains = [] - for option_chains_item_data in self.option_chains: - option_chains_item = option_chains_item_data.to_dict() - option_chains.append(option_chains_item) - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if option_chains is not UNSET: - field_dict["optionChains"] = option_chains - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.option_chain import OptionChain - - d = dict(src_dict) - option_chains = [] - _option_chains = d.pop("optionChains", UNSET) - for option_chains_item_data in _option_chains or []: - option_chains_item = OptionChain.from_dict(option_chains_item_data) - - option_chains.append(option_chains_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - list_option_chains_repsonse = cls( - option_chains=option_chains, - error_message=error_message, - status_code=status_code, - ) - - return list_option_chains_repsonse diff --git a/openapi/openapi_project/openapi_package/models/list_option_chains_request.py b/openapi/openapi_project/openapi_package/models/list_option_chains_request.py deleted file mode 100644 index bf5b1e3ae..000000000 --- a/openapi/openapi_project/openapi_package/models/list_option_chains_request.py +++ /dev/null @@ -1,42 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="ListOptionChainsRequest") - - -@_attrs_define -class ListOptionChainsRequest: - """ - Attributes: - underlying_symbols (Union[Unset, list[str]]): - """ - - underlying_symbols: Unset | list[str] = UNSET - - def to_dict(self) -> dict[str, Any]: - underlying_symbols: Unset | list[str] = UNSET - if not isinstance(self.underlying_symbols, Unset): - underlying_symbols = self.underlying_symbols - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if underlying_symbols is not UNSET: - field_dict["underlyingSymbols"] = underlying_symbols - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - underlying_symbols = cast(list[str], d.pop("underlyingSymbols", UNSET)) - - list_option_chains_request = cls( - underlying_symbols=underlying_symbols, - ) - - return list_option_chains_request diff --git a/openapi/openapi_project/openapi_package/models/list_orders_response.py b/openapi/openapi_project/openapi_package/models/list_orders_response.py deleted file mode 100644 index 25040a2c8..000000000 --- a/openapi/openapi_project/openapi_package/models/list_orders_response.py +++ /dev/null @@ -1,82 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.generic_order import GenericOrder - - -T = TypeVar("T", bound="ListOrdersResponse") - - -@_attrs_define -class ListOrdersResponse: - """ - Attributes: - orders (Union[Unset, list['GenericOrder']]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - orders: Unset | list["GenericOrder"] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - orders: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.orders, Unset): - orders = [] - for orders_item_data in self.orders: - orders_item = orders_item_data.to_dict() - orders.append(orders_item) - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if orders is not UNSET: - field_dict["orders"] = orders - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.generic_order import GenericOrder - - d = dict(src_dict) - orders = [] - _orders = d.pop("orders", UNSET) - for orders_item_data in _orders or []: - orders_item = GenericOrder.from_dict(orders_item_data) - - orders.append(orders_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - list_orders_response = cls( - orders=orders, - error_message=error_message, - status_code=status_code, - ) - - return list_orders_response diff --git a/openapi/openapi_project/openapi_package/models/list_positions_response.py b/openapi/openapi_project/openapi_package/models/list_positions_response.py deleted file mode 100644 index e87621c08..000000000 --- a/openapi/openapi_project/openapi_package/models/list_positions_response.py +++ /dev/null @@ -1,82 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.position import Position - - -T = TypeVar("T", bound="ListPositionsResponse") - - -@_attrs_define -class ListPositionsResponse: - """ - Attributes: - positions (Union[Unset, list['Position']]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - positions: Unset | list["Position"] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - positions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.positions, Unset): - positions = [] - for positions_item_data in self.positions: - positions_item = positions_item_data.to_dict() - positions.append(positions_item) - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if positions is not UNSET: - field_dict["positions"] = positions - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.position import Position - - d = dict(src_dict) - positions = [] - _positions = d.pop("positions", UNSET) - for positions_item_data in _positions or []: - positions_item = Position.from_dict(positions_item_data) - - positions.append(positions_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - list_positions_response = cls( - positions=positions, - error_message=error_message, - status_code=status_code, - ) - - return list_positions_response diff --git a/openapi/openapi_project/openapi_package/models/list_routes_response.py b/openapi/openapi_project/openapi_package/models/list_routes_response.py deleted file mode 100644 index 7d8e699b3..000000000 --- a/openapi/openapi_project/openapi_package/models/list_routes_response.py +++ /dev/null @@ -1,105 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.route import Route - from openapi_project.openapi_package.models.route_applicability import RouteApplicability - - -T = TypeVar("T", bound="ListRoutesResponse") - - -@_attrs_define -class ListRoutesResponse: - """ - Attributes: - routes (Union[Unset, list['Route']]): - route_applicabilities (Union[Unset, list['RouteApplicability']]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - routes: Unset | list["Route"] = UNSET - route_applicabilities: Unset | list["RouteApplicability"] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - routes: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.routes, Unset): - routes = [] - for routes_item_data in self.routes: - routes_item = routes_item_data.to_dict() - routes.append(routes_item) - - route_applicabilities: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.route_applicabilities, Unset): - route_applicabilities = [] - for route_applicabilities_item_data in self.route_applicabilities: - route_applicabilities_item = route_applicabilities_item_data.to_dict() - route_applicabilities.append(route_applicabilities_item) - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if routes is not UNSET: - field_dict["routes"] = routes - if route_applicabilities is not UNSET: - field_dict["routeApplicabilities"] = route_applicabilities - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.route import Route - from openapi_project.openapi_package.models.route_applicability import RouteApplicability - - d = dict(src_dict) - routes = [] - _routes = d.pop("routes", UNSET) - for routes_item_data in _routes or []: - routes_item = Route.from_dict(routes_item_data) - - routes.append(routes_item) - - route_applicabilities = [] - _route_applicabilities = d.pop("routeApplicabilities", UNSET) - for route_applicabilities_item_data in _route_applicabilities or []: - route_applicabilities_item = RouteApplicability.from_dict( - route_applicabilities_item_data - ) - - route_applicabilities.append(route_applicabilities_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - list_routes_response = cls( - routes=routes, - route_applicabilities=route_applicabilities, - error_message=error_message, - status_code=status_code, - ) - - return list_routes_response diff --git a/openapi/openapi_project/openapi_package/models/list_securities_request.py b/openapi/openapi_project/openapi_package/models/list_securities_request.py deleted file mode 100644 index 41330326b..000000000 --- a/openapi/openapi_project/openapi_package/models/list_securities_request.py +++ /dev/null @@ -1,42 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="ListSecuritiesRequest") - - -@_attrs_define -class ListSecuritiesRequest: - """ - Attributes: - symbols (Union[Unset, list[str]]): - """ - - symbols: Unset | list[str] = UNSET - - def to_dict(self) -> dict[str, Any]: - symbols: Unset | list[str] = UNSET - if not isinstance(self.symbols, Unset): - symbols = self.symbols - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if symbols is not UNSET: - field_dict["symbols"] = symbols - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - symbols = cast(list[str], d.pop("symbols", UNSET)) - - list_securities_request = cls( - symbols=symbols, - ) - - return list_securities_request diff --git a/openapi/openapi_project/openapi_package/models/list_securities_response.py b/openapi/openapi_project/openapi_package/models/list_securities_response.py deleted file mode 100644 index b752a2e10..000000000 --- a/openapi/openapi_project/openapi_package/models/list_securities_response.py +++ /dev/null @@ -1,82 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.security import Security - - -T = TypeVar("T", bound="ListSecuritiesResponse") - - -@_attrs_define -class ListSecuritiesResponse: - """ - Attributes: - securities (Union[Unset, list['Security']]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - securities: Unset | list["Security"] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - securities: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.securities, Unset): - securities = [] - for securities_item_data in self.securities: - securities_item = securities_item_data.to_dict() - securities.append(securities_item) - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if securities is not UNSET: - field_dict["securities"] = securities - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.security import Security - - d = dict(src_dict) - securities = [] - _securities = d.pop("securities", UNSET) - for securities_item_data in _securities or []: - securities_item = Security.from_dict(securities_item_data) - - securities.append(securities_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - list_securities_response = cls( - securities=securities, - error_message=error_message, - status_code=status_code, - ) - - return list_securities_response diff --git a/openapi/openapi_project/openapi_package/models/list_trade_confirms_response.py b/openapi/openapi_project/openapi_package/models/list_trade_confirms_response.py deleted file mode 100644 index 69aaf9cab..000000000 --- a/openapi/openapi_project/openapi_package/models/list_trade_confirms_response.py +++ /dev/null @@ -1,82 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.trade_confirm import TradeConfirm - - -T = TypeVar("T", bound="ListTradeConfirmsResponse") - - -@_attrs_define -class ListTradeConfirmsResponse: - """ - Attributes: - trade_confirms (Union[Unset, list['TradeConfirm']]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - trade_confirms: Unset | list["TradeConfirm"] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - trade_confirms: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.trade_confirms, Unset): - trade_confirms = [] - for trade_confirms_item_data in self.trade_confirms: - trade_confirms_item = trade_confirms_item_data.to_dict() - trade_confirms.append(trade_confirms_item) - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if trade_confirms is not UNSET: - field_dict["tradeConfirms"] = trade_confirms - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.trade_confirm import TradeConfirm - - d = dict(src_dict) - trade_confirms = [] - _trade_confirms = d.pop("tradeConfirms", UNSET) - for trade_confirms_item_data in _trade_confirms or []: - trade_confirms_item = TradeConfirm.from_dict(trade_confirms_item_data) - - trade_confirms.append(trade_confirms_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - list_trade_confirms_response = cls( - trade_confirms=trade_confirms, - error_message=error_message, - status_code=status_code, - ) - - return list_trade_confirms_response diff --git a/openapi/openapi_project/openapi_package/models/list_trading_firms_response.py b/openapi/openapi_project/openapi_package/models/list_trading_firms_response.py deleted file mode 100644 index fc841f880..000000000 --- a/openapi/openapi_project/openapi_package/models/list_trading_firms_response.py +++ /dev/null @@ -1,82 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.trading_firm import TradingFirm - - -T = TypeVar("T", bound="ListTradingFirmsResponse") - - -@_attrs_define -class ListTradingFirmsResponse: - """ - Attributes: - trading_firms (Union[Unset, list['TradingFirm']]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - trading_firms: Unset | list["TradingFirm"] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - trading_firms: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.trading_firms, Unset): - trading_firms = [] - for trading_firms_item_data in self.trading_firms: - trading_firms_item = trading_firms_item_data.to_dict() - trading_firms.append(trading_firms_item) - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if trading_firms is not UNSET: - field_dict["tradingFirms"] = trading_firms - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.trading_firm import TradingFirm - - d = dict(src_dict) - trading_firms = [] - _trading_firms = d.pop("tradingFirms", UNSET) - for trading_firms_item_data in _trading_firms or []: - trading_firms_item = TradingFirm.from_dict(trading_firms_item_data) - - trading_firms.append(trading_firms_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - list_trading_firms_response = cls( - trading_firms=trading_firms, - error_message=error_message, - status_code=status_code, - ) - - return list_trading_firms_response diff --git a/openapi/openapi_project/openapi_package/models/login_request.py b/openapi/openapi_project/openapi_package/models/login_request.py deleted file mode 100644 index e5ad8c36a..000000000 --- a/openapi/openapi_project/openapi_package/models/login_request.py +++ /dev/null @@ -1,76 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="LoginRequest") - - -@_attrs_define -class LoginRequest: - """ - Attributes: - domain (Union[Unset, str]): - username (Union[Unset, str]): - password (Union[Unset, str]): - application_name (Union[Unset, str]): - application_version (Union[Unset, str]): - """ - - domain: Unset | str = UNSET - username: Unset | str = UNSET - password: Unset | str = UNSET - application_name: Unset | str = UNSET - application_version: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - domain = self.domain - - username = self.username - - password = self.password - - application_name = self.application_name - - application_version = self.application_version - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if domain is not UNSET: - field_dict["domain"] = domain - if username is not UNSET: - field_dict["username"] = username - if password is not UNSET: - field_dict["password"] = password - if application_name is not UNSET: - field_dict["applicationName"] = application_name - if application_version is not UNSET: - field_dict["applicationVersion"] = application_version - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - domain = d.pop("domain", UNSET) - - username = d.pop("username", UNSET) - - password = d.pop("password", UNSET) - - application_name = d.pop("applicationName", UNSET) - - application_version = d.pop("applicationVersion", UNSET) - - login_request = cls( - domain=domain, - username=username, - password=password, - application_name=application_name, - application_version=application_version, - ) - - return login_request diff --git a/openapi/openapi_project/openapi_package/models/login_response.py b/openapi/openapi_project/openapi_package/models/login_response.py deleted file mode 100644 index 91d63d449..000000000 --- a/openapi/openapi_project/openapi_package/models/login_response.py +++ /dev/null @@ -1,204 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.login_status import LoginStatus -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.login_response_system_settings import LoginResponseSystemSettings - from openapi_project.openapi_package.models.user import User - - -T = TypeVar("T", bound="LoginResponse") - - -@_attrs_define -class LoginResponse: - """ - Attributes: - token (Union[Unset, str]): - environment (Union[Unset, str]): - login_attempts_remaining (Union[Unset, int]): - login_status (Union[Unset, LoginStatus]): - server_build_ts (Union[Unset, str]): - server_hash (Union[Unset, str]): - server_name (Union[Unset, str]): - server_time_utc (Union[Unset, str]): - server_version (Union[Unset, str]): - site (Union[Unset, str]): - text (Union[Unset, str]): - user (Union[Unset, User]): - system_settings (Union[Unset, LoginResponseSystemSettings]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - token: Unset | str = UNSET - environment: Unset | str = UNSET - login_attempts_remaining: Unset | int = UNSET - login_status: Unset | LoginStatus = UNSET - server_build_ts: Unset | str = UNSET - server_hash: Unset | str = UNSET - server_name: Unset | str = UNSET - server_time_utc: Unset | str = UNSET - server_version: Unset | str = UNSET - site: Unset | str = UNSET - text: Unset | str = UNSET - user: Union[Unset, "User"] = UNSET - system_settings: Union[Unset, "LoginResponseSystemSettings"] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - token = self.token - - environment = self.environment - - login_attempts_remaining = self.login_attempts_remaining - - login_status: Unset | str = UNSET - if not isinstance(self.login_status, Unset): - login_status = self.login_status.value - - server_build_ts = self.server_build_ts - - server_hash = self.server_hash - - server_name = self.server_name - - server_time_utc = self.server_time_utc - - server_version = self.server_version - - site = self.site - - text = self.text - - user: Unset | dict[str, Any] = UNSET - if not isinstance(self.user, Unset): - user = self.user.to_dict() - - system_settings: Unset | dict[str, Any] = UNSET - if not isinstance(self.system_settings, Unset): - system_settings = self.system_settings.to_dict() - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if token is not UNSET: - field_dict["token"] = token - if environment is not UNSET: - field_dict["environment"] = environment - if login_attempts_remaining is not UNSET: - field_dict["loginAttemptsRemaining"] = login_attempts_remaining - if login_status is not UNSET: - field_dict["loginStatus"] = login_status - if server_build_ts is not UNSET: - field_dict["serverBuildTs"] = server_build_ts - if server_hash is not UNSET: - field_dict["serverHash"] = server_hash - if server_name is not UNSET: - field_dict["serverName"] = server_name - if server_time_utc is not UNSET: - field_dict["serverTimeUtc"] = server_time_utc - if server_version is not UNSET: - field_dict["serverVersion"] = server_version - if site is not UNSET: - field_dict["site"] = site - if text is not UNSET: - field_dict["text"] = text - if user is not UNSET: - field_dict["user"] = user - if system_settings is not UNSET: - field_dict["systemSettings"] = system_settings - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.login_response_system_settings import LoginResponseSystemSettings - from openapi_project.openapi_package.models.user import User - - d = dict(src_dict) - token = d.pop("token", UNSET) - - environment = d.pop("environment", UNSET) - - login_attempts_remaining = d.pop("loginAttemptsRemaining", UNSET) - - _login_status = d.pop("loginStatus", UNSET) - login_status: Unset | LoginStatus - if isinstance(_login_status, Unset): - login_status = UNSET - else: - login_status = LoginStatus(_login_status) - - server_build_ts = d.pop("serverBuildTs", UNSET) - - server_hash = d.pop("serverHash", UNSET) - - server_name = d.pop("serverName", UNSET) - - server_time_utc = d.pop("serverTimeUtc", UNSET) - - server_version = d.pop("serverVersion", UNSET) - - site = d.pop("site", UNSET) - - text = d.pop("text", UNSET) - - _user = d.pop("user", UNSET) - user: Unset | User - if isinstance(_user, Unset): - user = UNSET - else: - user = User.from_dict(_user) - - _system_settings = d.pop("systemSettings", UNSET) - system_settings: Unset | LoginResponseSystemSettings - if isinstance(_system_settings, Unset): - system_settings = UNSET - else: - system_settings = LoginResponseSystemSettings.from_dict(_system_settings) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - login_response = cls( - token=token, - environment=environment, - login_attempts_remaining=login_attempts_remaining, - login_status=login_status, - server_build_ts=server_build_ts, - server_hash=server_hash, - server_name=server_name, - server_time_utc=server_time_utc, - server_version=server_version, - site=site, - text=text, - user=user, - system_settings=system_settings, - error_message=error_message, - status_code=status_code, - ) - - return login_response diff --git a/openapi/openapi_project/openapi_package/models/login_response_system_settings.py b/openapi/openapi_project/openapi_package/models/login_response_system_settings.py deleted file mode 100644 index cd0f44a86..000000000 --- a/openapi/openapi_project/openapi_package/models/login_response_system_settings.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="LoginResponseSystemSettings") - - -@_attrs_define -class LoginResponseSystemSettings: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - login_response_system_settings = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - login_response_system_settings.additional_properties = additional_properties - return login_response_system_settings - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/login_status.py b/openapi/openapi_project/openapi_package/models/login_status.py deleted file mode 100644 index 30ad89211..000000000 --- a/openapi/openapi_project/openapi_package/models/login_status.py +++ /dev/null @@ -1,19 +0,0 @@ -from enum import Enum - - -class LoginStatus(str, Enum): - CONNECTION_FAILED = "CONNECTION_FAILED" - LOGIN_DISALLOWED = "LOGIN_DISALLOWED" - LOGIN_SUCCESS = "LOGIN_SUCCESS" - MFA_FAILED = "MFA_FAILED" - MFA_REQUIRED = "MFA_REQUIRED" - NOT_AUTHORIZED = "NOT_AUTHORIZED" - PASSWORD_CHANGE_FAILED = "PASSWORD_CHANGE_FAILED" - PASSWORD_CHANGE_SUCCESSFUL = "PASSWORD_CHANGE_SUCCESSFUL" - PASSWORD_EXPIRED = "PASSWORD_EXPIRED" - SERVER_HASH_CHANGED = "SERVER_HASH_CHANGED" - UNDEFINED = "UNDEFINED" - VERSION_TOO_OLD = "VERSION_TOO_OLD" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/margin_data.py b/openapi/openapi_project/openapi_package/models/margin_data.py deleted file mode 100644 index c97d6e06d..000000000 --- a/openapi/openapi_project/openapi_package/models/margin_data.py +++ /dev/null @@ -1,80 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.empty import Empty - from openapi_project.openapi_package.models.tims_margin_data import TimsMarginData - - -T = TypeVar("T", bound="MarginData") - - -@_attrs_define -class MarginData: - """ - Attributes: - account_id (Union[Unset, int]): - tims (Union[Unset, TimsMarginData]): - span (Union[Unset, Empty]): - """ - - account_id: Unset | int = UNSET - tims: Union[Unset, "TimsMarginData"] = UNSET - span: Union[Unset, "Empty"] = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - tims: Unset | dict[str, Any] = UNSET - if not isinstance(self.tims, Unset): - tims = self.tims.to_dict() - - span: Unset | dict[str, Any] = UNSET - if not isinstance(self.span, Unset): - span = self.span.to_dict() - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if tims is not UNSET: - field_dict["tims"] = tims - if span is not UNSET: - field_dict["span"] = span - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.empty import Empty - from openapi_project.openapi_package.models.tims_margin_data import TimsMarginData - - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - _tims = d.pop("tims", UNSET) - tims: Unset | TimsMarginData - if isinstance(_tims, Unset): - tims = UNSET - else: - tims = TimsMarginData.from_dict(_tims) - - _span = d.pop("span", UNSET) - span: Unset | Empty - if isinstance(_span, Unset): - span = UNSET - else: - span = Empty.from_dict(_span) - - margin_data = cls( - account_id=account_id, - tims=tims, - span=span, - ) - - return margin_data diff --git a/openapi/openapi_project/openapi_package/models/margin_data_type.py b/openapi/openapi_project/openapi_package/models/margin_data_type.py deleted file mode 100644 index aecc4034d..000000000 --- a/openapi/openapi_project/openapi_package/models/margin_data_type.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class MarginDataType(str, Enum): - MARGIN_DATA_TYPE_SPAN = "MARGIN_DATA_TYPE_SPAN" - MARGIN_DATA_TYPE_TIMS = "MARGIN_DATA_TYPE_TIMS" - MARGIN_DATA_TYPE_UNKNOWN = "MARGIN_DATA_TYPE_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order.py b/openapi/openapi_project/openapi_package/models/multi_leg_order.py deleted file mode 100644 index bc9095996..000000000 --- a/openapi/openapi_project/openapi_package/models/multi_leg_order.py +++ /dev/null @@ -1,544 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.ord_status import OrdStatus -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.origination_type import OriginationType -from openapi_project.openapi_package.models.price_type import PriceType -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.header import Header - from openapi_project.openapi_package.models.multi_leg_order_algo import MultiLegOrderAlgo - from openapi_project.openapi_package.models.multi_leg_order_leg import MultiLegOrderLeg - from openapi_project.openapi_package.models.multi_leg_order_market_condition import MultiLegOrderMarketCondition - from openapi_project.openapi_package.models.multi_leg_order_optional_data import MultiLegOrderOptionalData - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent - - -T = TypeVar("T", bound="MultiLegOrder") - - -@_attrs_define -class MultiLegOrder: - """ - Attributes: - account_id (Union[Unset, int]): - algo (Union[Unset, MultiLegOrderAlgo]): - aux_price (Union[Unset, float]): - clearing_info (Union[Unset, ClearingInfo]): - cur_ord_id (Union[Unset, str]): - header (Union[Unset, Header]): - id (Union[Unset, str]): - incoming_cl_ord_id (Union[Unset, str]): - incoming_ord_id (Union[Unset, str]): - instructions (Union[Unset, list['OrderInstruction']]): - legs (Union[Unset, list['MultiLegOrderLeg']]): - market_condition (Union[Unset, MultiLegOrderMarketCondition]): - optional_data (Union[Unset, MultiLegOrderOptionalData]): - order_flags (Union[Unset, int]): - order_updates (Union[Unset, list['OrderUpdateEvent']]): - ord_type (Union[Unset, OrdType]): - origination_type (Union[Unset, OriginationType]): - parent_ord_id (Union[Unset, str]): - price (Union[Unset, float]): - price_type (Union[Unset, PriceType]): - qty (Union[Unset, float]): - route (Union[Unset, str]): - source (Union[Unset, str]): - source_address (Union[Unset, str]): - submit_ts (Union[Unset, str]): - tag (Union[Unset, str]): - text (Union[Unset, str]): - tif (Union[Unset, Tif]): - user_id (Union[Unset, int]): - trader_id (Union[Unset, str]): - ord_status (Union[Unset, OrdStatus]): - avg_price (Union[Unset, float]): - claimed_by (Union[Unset, str]): - last_price (Union[Unset, float]): - last_qty (Union[Unset, float]): - last_market (Union[Unset, str]): - leaves_qty (Union[Unset, float]): - cum_qty (Union[Unset, float]): - transact_ts (Union[Unset, str]): - working_qty (Union[Unset, float]): - has_busts (Union[Unset, bool]): - has_corrects (Union[Unset, bool]): - has_notes (Union[Unset, bool]): - """ - - account_id: Unset | int = UNSET - algo: Union[Unset, "MultiLegOrderAlgo"] = UNSET - aux_price: Unset | float = UNSET - clearing_info: Union[Unset, "ClearingInfo"] = UNSET - cur_ord_id: Unset | str = UNSET - header: Union[Unset, "Header"] = UNSET - id: Unset | str = UNSET - incoming_cl_ord_id: Unset | str = UNSET - incoming_ord_id: Unset | str = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - legs: Unset | list["MultiLegOrderLeg"] = UNSET - market_condition: Union[Unset, "MultiLegOrderMarketCondition"] = UNSET - optional_data: Union[Unset, "MultiLegOrderOptionalData"] = UNSET - order_flags: Unset | int = UNSET - order_updates: Unset | list["OrderUpdateEvent"] = UNSET - ord_type: Unset | OrdType = UNSET - origination_type: Unset | OriginationType = UNSET - parent_ord_id: Unset | str = UNSET - price: Unset | float = UNSET - price_type: Unset | PriceType = UNSET - qty: Unset | float = UNSET - route: Unset | str = UNSET - source: Unset | str = UNSET - source_address: Unset | str = UNSET - submit_ts: Unset | str = UNSET - tag: Unset | str = UNSET - text: Unset | str = UNSET - tif: Unset | Tif = UNSET - user_id: Unset | int = UNSET - trader_id: Unset | str = UNSET - ord_status: Unset | OrdStatus = UNSET - avg_price: Unset | float = UNSET - claimed_by: Unset | str = UNSET - last_price: Unset | float = UNSET - last_qty: Unset | float = UNSET - last_market: Unset | str = UNSET - leaves_qty: Unset | float = UNSET - cum_qty: Unset | float = UNSET - transact_ts: Unset | str = UNSET - working_qty: Unset | float = UNSET - has_busts: Unset | bool = UNSET - has_corrects: Unset | bool = UNSET - has_notes: Unset | bool = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - algo: Unset | dict[str, Any] = UNSET - if not isinstance(self.algo, Unset): - algo = self.algo.to_dict() - - aux_price = self.aux_price - - clearing_info: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_info, Unset): - clearing_info = self.clearing_info.to_dict() - - cur_ord_id = self.cur_ord_id - - header: Unset | dict[str, Any] = UNSET - if not isinstance(self.header, Unset): - header = self.header.to_dict() - - id = self.id - - incoming_cl_ord_id = self.incoming_cl_ord_id - - incoming_ord_id = self.incoming_ord_id - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - legs: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.legs, Unset): - legs = [] - for legs_item_data in self.legs: - legs_item = legs_item_data.to_dict() - legs.append(legs_item) - - market_condition: Unset | dict[str, Any] = UNSET - if not isinstance(self.market_condition, Unset): - market_condition = self.market_condition.to_dict() - - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() - - order_flags = self.order_flags - - order_updates: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.order_updates, Unset): - order_updates = [] - for order_updates_item_data in self.order_updates: - order_updates_item = order_updates_item_data.to_dict() - order_updates.append(order_updates_item) - - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value - - origination_type: Unset | str = UNSET - if not isinstance(self.origination_type, Unset): - origination_type = self.origination_type.value - - parent_ord_id = self.parent_ord_id - - price = self.price - - price_type: Unset | str = UNSET - if not isinstance(self.price_type, Unset): - price_type = self.price_type.value - - qty = self.qty - - route = self.route - - source = self.source - - source_address = self.source_address - - submit_ts = self.submit_ts - - tag = self.tag - - text = self.text - - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value - - user_id = self.user_id - - trader_id = self.trader_id - - ord_status: Unset | str = UNSET - if not isinstance(self.ord_status, Unset): - ord_status = self.ord_status.value - - avg_price = self.avg_price - - claimed_by = self.claimed_by - - last_price = self.last_price - - last_qty = self.last_qty - - last_market = self.last_market - - leaves_qty = self.leaves_qty - - cum_qty = self.cum_qty - - transact_ts = self.transact_ts - - working_qty = self.working_qty - - has_busts = self.has_busts - - has_corrects = self.has_corrects - - has_notes = self.has_notes - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if algo is not UNSET: - field_dict["algo"] = algo - if aux_price is not UNSET: - field_dict["auxPrice"] = aux_price - if clearing_info is not UNSET: - field_dict["clearingInfo"] = clearing_info - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if header is not UNSET: - field_dict["header"] = header - if id is not UNSET: - field_dict["id"] = id - if incoming_cl_ord_id is not UNSET: - field_dict["incomingClOrdId"] = incoming_cl_ord_id - if incoming_ord_id is not UNSET: - field_dict["incomingOrdId"] = incoming_ord_id - if instructions is not UNSET: - field_dict["instructions"] = instructions - if legs is not UNSET: - field_dict["legs"] = legs - if market_condition is not UNSET: - field_dict["marketCondition"] = market_condition - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if order_flags is not UNSET: - field_dict["orderFlags"] = order_flags - if order_updates is not UNSET: - field_dict["orderUpdates"] = order_updates - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if origination_type is not UNSET: - field_dict["originationType"] = origination_type - if parent_ord_id is not UNSET: - field_dict["parentOrdId"] = parent_ord_id - if price is not UNSET: - field_dict["price"] = price - if price_type is not UNSET: - field_dict["priceType"] = price_type - if qty is not UNSET: - field_dict["qty"] = qty - if route is not UNSET: - field_dict["route"] = route - if source is not UNSET: - field_dict["source"] = source - if source_address is not UNSET: - field_dict["sourceAddress"] = source_address - if submit_ts is not UNSET: - field_dict["submitTs"] = submit_ts - if tag is not UNSET: - field_dict["tag"] = tag - if text is not UNSET: - field_dict["text"] = text - if tif is not UNSET: - field_dict["tif"] = tif - if user_id is not UNSET: - field_dict["userId"] = user_id - if trader_id is not UNSET: - field_dict["traderId"] = trader_id - if ord_status is not UNSET: - field_dict["ordStatus"] = ord_status - if avg_price is not UNSET: - field_dict["avgPrice"] = avg_price - if claimed_by is not UNSET: - field_dict["claimedBy"] = claimed_by - if last_price is not UNSET: - field_dict["lastPrice"] = last_price - if last_qty is not UNSET: - field_dict["lastQty"] = last_qty - if last_market is not UNSET: - field_dict["lastMarket"] = last_market - if leaves_qty is not UNSET: - field_dict["leavesQty"] = leaves_qty - if cum_qty is not UNSET: - field_dict["cumQty"] = cum_qty - if transact_ts is not UNSET: - field_dict["transactTs"] = transact_ts - if working_qty is not UNSET: - field_dict["workingQty"] = working_qty - if has_busts is not UNSET: - field_dict["hasBusts"] = has_busts - if has_corrects is not UNSET: - field_dict["hasCorrects"] = has_corrects - if has_notes is not UNSET: - field_dict["hasNotes"] = has_notes - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.header import Header - from openapi_project.openapi_package.models.multi_leg_order_algo import MultiLegOrderAlgo - from openapi_project.openapi_package.models.multi_leg_order_leg import MultiLegOrderLeg - from openapi_project.openapi_package.models.multi_leg_order_market_condition import MultiLegOrderMarketCondition, - - from openapi_project.openapi_package.models.multi_leg_order_optional_data import MultiLegOrderOptionalData - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent - - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - _algo = d.pop("algo", UNSET) - algo: Unset | MultiLegOrderAlgo - if isinstance(_algo, Unset): - algo = UNSET - else: - algo = MultiLegOrderAlgo.from_dict(_algo) - - aux_price = d.pop("auxPrice", UNSET) - - _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo - if isinstance(_clearing_info, Unset): - clearing_info = UNSET - else: - clearing_info = ClearingInfo.from_dict(_clearing_info) - - cur_ord_id = d.pop("curOrdId", UNSET) - - _header = d.pop("header", UNSET) - header: Unset | Header - if isinstance(_header, Unset): - header = UNSET - else: - header = Header.from_dict(_header) - - id = d.pop("id", UNSET) - - incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) - - incoming_ord_id = d.pop("incomingOrdId", UNSET) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - legs = [] - _legs = d.pop("legs", UNSET) - for legs_item_data in _legs or []: - legs_item = MultiLegOrderLeg.from_dict(legs_item_data) - - legs.append(legs_item) - - _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | MultiLegOrderMarketCondition - if isinstance(_market_condition, Unset): - market_condition = UNSET - else: - market_condition = MultiLegOrderMarketCondition.from_dict(_market_condition) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | MultiLegOrderOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = MultiLegOrderOptionalData.from_dict(_optional_data) - - order_flags = d.pop("orderFlags", UNSET) - - order_updates = [] - _order_updates = d.pop("orderUpdates", UNSET) - for order_updates_item_data in _order_updates or []: - order_updates_item = OrderUpdateEvent.from_dict(order_updates_item_data) - - order_updates.append(order_updates_item) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) - - _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType - if isinstance(_origination_type, Unset): - origination_type = UNSET - else: - origination_type = OriginationType(_origination_type) - - parent_ord_id = d.pop("parentOrdId", UNSET) - - price = d.pop("price", UNSET) - - _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType - if isinstance(_price_type, Unset): - price_type = UNSET - else: - price_type = PriceType(_price_type) - - qty = d.pop("qty", UNSET) - - route = d.pop("route", UNSET) - - source = d.pop("source", UNSET) - - source_address = d.pop("sourceAddress", UNSET) - - submit_ts = d.pop("submitTs", UNSET) - - tag = d.pop("tag", UNSET) - - text = d.pop("text", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) - - user_id = d.pop("userId", UNSET) - - trader_id = d.pop("traderId", UNSET) - - _ord_status = d.pop("ordStatus", UNSET) - ord_status: Unset | OrdStatus - if isinstance(_ord_status, Unset): - ord_status = UNSET - else: - ord_status = OrdStatus(_ord_status) - - avg_price = d.pop("avgPrice", UNSET) - - claimed_by = d.pop("claimedBy", UNSET) - - last_price = d.pop("lastPrice", UNSET) - - last_qty = d.pop("lastQty", UNSET) - - last_market = d.pop("lastMarket", UNSET) - - leaves_qty = d.pop("leavesQty", UNSET) - - cum_qty = d.pop("cumQty", UNSET) - - transact_ts = d.pop("transactTs", UNSET) - - working_qty = d.pop("workingQty", UNSET) - - has_busts = d.pop("hasBusts", UNSET) - - has_corrects = d.pop("hasCorrects", UNSET) - - has_notes = d.pop("hasNotes", UNSET) - - multi_leg_order = cls( - account_id=account_id, - algo=algo, - aux_price=aux_price, - clearing_info=clearing_info, - cur_ord_id=cur_ord_id, - header=header, - id=id, - incoming_cl_ord_id=incoming_cl_ord_id, - incoming_ord_id=incoming_ord_id, - instructions=instructions, - legs=legs, - market_condition=market_condition, - optional_data=optional_data, - order_flags=order_flags, - order_updates=order_updates, - ord_type=ord_type, - origination_type=origination_type, - parent_ord_id=parent_ord_id, - price=price, - price_type=price_type, - qty=qty, - route=route, - source=source, - source_address=source_address, - submit_ts=submit_ts, - tag=tag, - text=text, - tif=tif, - user_id=user_id, - trader_id=trader_id, - ord_status=ord_status, - avg_price=avg_price, - claimed_by=claimed_by, - last_price=last_price, - last_qty=last_qty, - last_market=last_market, - leaves_qty=leaves_qty, - cum_qty=cum_qty, - transact_ts=transact_ts, - working_qty=working_qty, - has_busts=has_busts, - has_corrects=has_corrects, - has_notes=has_notes, - ) - - return multi_leg_order diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_algo.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_algo.py deleted file mode 100644 index f151dd1d7..000000000 --- a/openapi/openapi_project/openapi_package/models/multi_leg_order_algo.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="MultiLegOrderAlgo") - - -@_attrs_define -class MultiLegOrderAlgo: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - multi_leg_order_algo = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - multi_leg_order_algo.additional_properties = additional_properties - return multi_leg_order_algo - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py deleted file mode 100644 index a1a890f6f..000000000 --- a/openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py +++ /dev/null @@ -1,371 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.origination_type import OriginationType -from openapi_project.openapi_package.models.price_type import PriceType -from openapi_project.openapi_package.models.side import Side -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.header import Header - from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_algo import MultiLegOrderCancelReplaceRequestAlgo, - - from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_market_condition import MultiLegOrderCancelReplaceRequestMarketCondition, - - from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_optional_data import MultiLegOrderCancelReplaceRequestOptionalData, - - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - -T = TypeVar("T", bound="MultiLegOrderCancelReplaceRequest") - - -@_attrs_define -class MultiLegOrderCancelReplaceRequest: - """ - Attributes: - algo (Union[Unset, MultiLegOrderCancelReplaceRequestAlgo]): - aux_price (Union[Unset, float]): - clearing_info (Union[Unset, ClearingInfo]): - cur_ord_id (Union[Unset, str]): - header (Union[Unset, Header]): - incoming_cl_ord_id (Union[Unset, str]): - incoming_orig_cl_ord_id (Union[Unset, str]): - instructions (Union[Unset, list['OrderInstruction']]): - optional_data (Union[Unset, MultiLegOrderCancelReplaceRequestOptionalData]): - market_condition (Union[Unset, MultiLegOrderCancelReplaceRequestMarketCondition]): - ord_type (Union[Unset, OrdType]): - origination_type (Union[Unset, OriginationType]): - perm_ord_id (Union[Unset, str]): - price (Union[Unset, float]): - price_type (Union[Unset, PriceType]): - qty (Union[Unset, float]): - req_ord_id (Union[Unset, str]): - side (Union[Unset, Side]): - source (Union[Unset, str]): - submit_ts (Union[Unset, str]): - tag (Union[Unset, str]): - text (Union[Unset, str]): - tif (Union[Unset, Tif]): - trader_id (Union[Unset, str]): - user_id (Union[Unset, int]): - """ - - algo: Union[Unset, "MultiLegOrderCancelReplaceRequestAlgo"] = UNSET - aux_price: Unset | float = UNSET - clearing_info: Union[Unset, "ClearingInfo"] = UNSET - cur_ord_id: Unset | str = UNSET - header: Union[Unset, "Header"] = UNSET - incoming_cl_ord_id: Unset | str = UNSET - incoming_orig_cl_ord_id: Unset | str = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - optional_data: Union[Unset, "MultiLegOrderCancelReplaceRequestOptionalData"] = UNSET - market_condition: Union[ - Unset, "MultiLegOrderCancelReplaceRequestMarketCondition" - ] = UNSET - ord_type: Unset | OrdType = UNSET - origination_type: Unset | OriginationType = UNSET - perm_ord_id: Unset | str = UNSET - price: Unset | float = UNSET - price_type: Unset | PriceType = UNSET - qty: Unset | float = UNSET - req_ord_id: Unset | str = UNSET - side: Unset | Side = UNSET - source: Unset | str = UNSET - submit_ts: Unset | str = UNSET - tag: Unset | str = UNSET - text: Unset | str = UNSET - tif: Unset | Tif = UNSET - trader_id: Unset | str = UNSET - user_id: Unset | int = UNSET - - def to_dict(self) -> dict[str, Any]: - algo: Unset | dict[str, Any] = UNSET - if not isinstance(self.algo, Unset): - algo = self.algo.to_dict() - - aux_price = self.aux_price - - clearing_info: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_info, Unset): - clearing_info = self.clearing_info.to_dict() - - cur_ord_id = self.cur_ord_id - - header: Unset | dict[str, Any] = UNSET - if not isinstance(self.header, Unset): - header = self.header.to_dict() - - incoming_cl_ord_id = self.incoming_cl_ord_id - - incoming_orig_cl_ord_id = self.incoming_orig_cl_ord_id - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() - - market_condition: Unset | dict[str, Any] = UNSET - if not isinstance(self.market_condition, Unset): - market_condition = self.market_condition.to_dict() - - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value - - origination_type: Unset | str = UNSET - if not isinstance(self.origination_type, Unset): - origination_type = self.origination_type.value - - perm_ord_id = self.perm_ord_id - - price = self.price - - price_type: Unset | str = UNSET - if not isinstance(self.price_type, Unset): - price_type = self.price_type.value - - qty = self.qty - - req_ord_id = self.req_ord_id - - side: Unset | str = UNSET - if not isinstance(self.side, Unset): - side = self.side.value - - source = self.source - - submit_ts = self.submit_ts - - tag = self.tag - - text = self.text - - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value - - trader_id = self.trader_id - - user_id = self.user_id - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if algo is not UNSET: - field_dict["algo"] = algo - if aux_price is not UNSET: - field_dict["auxPrice"] = aux_price - if clearing_info is not UNSET: - field_dict["clearingInfo"] = clearing_info - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if header is not UNSET: - field_dict["header"] = header - if incoming_cl_ord_id is not UNSET: - field_dict["incomingClOrdId"] = incoming_cl_ord_id - if incoming_orig_cl_ord_id is not UNSET: - field_dict["incomingOrigClOrdId"] = incoming_orig_cl_ord_id - if instructions is not UNSET: - field_dict["instructions"] = instructions - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if market_condition is not UNSET: - field_dict["marketCondition"] = market_condition - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if origination_type is not UNSET: - field_dict["originationType"] = origination_type - if perm_ord_id is not UNSET: - field_dict["permOrdId"] = perm_ord_id - if price is not UNSET: - field_dict["price"] = price - if price_type is not UNSET: - field_dict["priceType"] = price_type - if qty is not UNSET: - field_dict["qty"] = qty - if req_ord_id is not UNSET: - field_dict["reqOrdId"] = req_ord_id - if side is not UNSET: - field_dict["side"] = side - if source is not UNSET: - field_dict["source"] = source - if submit_ts is not UNSET: - field_dict["submitTs"] = submit_ts - if tag is not UNSET: - field_dict["tag"] = tag - if text is not UNSET: - field_dict["text"] = text - if tif is not UNSET: - field_dict["tif"] = tif - if trader_id is not UNSET: - field_dict["traderId"] = trader_id - if user_id is not UNSET: - field_dict["userId"] = user_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.header import Header - from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_algo import MultiLegOrderCancelReplaceRequestAlgo, - - from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_market_condition import MultiLegOrderCancelReplaceRequestMarketCondition, - - from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_optional_data import MultiLegOrderCancelReplaceRequestOptionalData, - - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - d = dict(src_dict) - _algo = d.pop("algo", UNSET) - algo: Unset | MultiLegOrderCancelReplaceRequestAlgo - if isinstance(_algo, Unset): - algo = UNSET - else: - algo = MultiLegOrderCancelReplaceRequestAlgo.from_dict(_algo) - - aux_price = d.pop("auxPrice", UNSET) - - _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo - if isinstance(_clearing_info, Unset): - clearing_info = UNSET - else: - clearing_info = ClearingInfo.from_dict(_clearing_info) - - cur_ord_id = d.pop("curOrdId", UNSET) - - _header = d.pop("header", UNSET) - header: Unset | Header - if isinstance(_header, Unset): - header = UNSET - else: - header = Header.from_dict(_header) - - incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) - - incoming_orig_cl_ord_id = d.pop("incomingOrigClOrdId", UNSET) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | MultiLegOrderCancelReplaceRequestOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = MultiLegOrderCancelReplaceRequestOptionalData.from_dict( - _optional_data - ) - - _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | MultiLegOrderCancelReplaceRequestMarketCondition - if isinstance(_market_condition, Unset): - market_condition = UNSET - else: - market_condition = ( - MultiLegOrderCancelReplaceRequestMarketCondition.from_dict( - _market_condition - ) - ) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) - - _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType - if isinstance(_origination_type, Unset): - origination_type = UNSET - else: - origination_type = OriginationType(_origination_type) - - perm_ord_id = d.pop("permOrdId", UNSET) - - price = d.pop("price", UNSET) - - _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType - if isinstance(_price_type, Unset): - price_type = UNSET - else: - price_type = PriceType(_price_type) - - qty = d.pop("qty", UNSET) - - req_ord_id = d.pop("reqOrdId", UNSET) - - _side = d.pop("side", UNSET) - side: Unset | Side - if isinstance(_side, Unset): - side = UNSET - else: - side = Side(_side) - - source = d.pop("source", UNSET) - - submit_ts = d.pop("submitTs", UNSET) - - tag = d.pop("tag", UNSET) - - text = d.pop("text", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) - - trader_id = d.pop("traderId", UNSET) - - user_id = d.pop("userId", UNSET) - - multi_leg_order_cancel_replace_request = cls( - algo=algo, - aux_price=aux_price, - clearing_info=clearing_info, - cur_ord_id=cur_ord_id, - header=header, - incoming_cl_ord_id=incoming_cl_ord_id, - incoming_orig_cl_ord_id=incoming_orig_cl_ord_id, - instructions=instructions, - optional_data=optional_data, - market_condition=market_condition, - ord_type=ord_type, - origination_type=origination_type, - perm_ord_id=perm_ord_id, - price=price, - price_type=price_type, - qty=qty, - req_ord_id=req_ord_id, - side=side, - source=source, - submit_ts=submit_ts, - tag=tag, - text=text, - tif=tif, - trader_id=trader_id, - user_id=user_id, - ) - - return multi_leg_order_cancel_replace_request diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py deleted file mode 100644 index e417952f1..000000000 --- a/openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="MultiLegOrderCancelReplaceRequestAlgo") - - -@_attrs_define -class MultiLegOrderCancelReplaceRequestAlgo: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - multi_leg_order_cancel_replace_request_algo = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - multi_leg_order_cancel_replace_request_algo.additional_properties = ( - additional_properties - ) - return multi_leg_order_cancel_replace_request_algo - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py deleted file mode 100644 index 4aed01b62..000000000 --- a/openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="MultiLegOrderCancelReplaceRequestMarketCondition") - - -@_attrs_define -class MultiLegOrderCancelReplaceRequestMarketCondition: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - multi_leg_order_cancel_replace_request_market_condition = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - multi_leg_order_cancel_replace_request_market_condition.additional_properties = ( - additional_properties - ) - return multi_leg_order_cancel_replace_request_market_condition - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py deleted file mode 100644 index e0a2e0afc..000000000 --- a/openapi/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="MultiLegOrderCancelReplaceRequestOptionalData") - - -@_attrs_define -class MultiLegOrderCancelReplaceRequestOptionalData: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - multi_leg_order_cancel_replace_request_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - multi_leg_order_cancel_replace_request_optional_data.additional_properties = ( - additional_properties - ) - return multi_leg_order_cancel_replace_request_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_cross.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_cross.py deleted file mode 100644 index 846366bba..000000000 --- a/openapi/openapi_project/openapi_package/models/multi_leg_order_cross.py +++ /dev/null @@ -1,479 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.cross_type import CrossType -from openapi_project.openapi_package.models.ord_status import OrdStatus -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.origination_type import OriginationType -from openapi_project.openapi_package.models.price_type import PriceType -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.header import Header - from openapi_project.openapi_package.models.multi_leg_order_cross_algo import MultiLegOrderCrossAlgo - from openapi_project.openapi_package.models.multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation - from openapi_project.openapi_package.models.multi_leg_order_cross_market_condition import MultiLegOrderCrossMarketCondition, - - from openapi_project.openapi_package.models.multi_leg_order_cross_optional_data import MultiLegOrderCrossOptionalData, - - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent - - -T = TypeVar("T", bound="MultiLegOrderCross") - - -@_attrs_define -class MultiLegOrderCross: - """ - Attributes: - account_id (Union[Unset, int]): - algo (Union[Unset, MultiLegOrderCrossAlgo]): - allocations (Union[Unset, list['MultiLegOrderCrossAllocation']]): - cross_type (Union[Unset, CrossType]): - cur_ord_id (Union[Unset, str]): - header (Union[Unset, Header]): - id (Union[Unset, str]): - incoming_cl_ord_id (Union[Unset, str]): - incoming_ord_id (Union[Unset, str]): - instructions (Union[Unset, list['OrderInstruction']]): - market_condition (Union[Unset, MultiLegOrderCrossMarketCondition]): - optional_data (Union[Unset, MultiLegOrderCrossOptionalData]): - order_flags (Union[Unset, int]): - order_updates (Union[Unset, list['OrderUpdateEvent']]): - ord_type (Union[Unset, OrdType]): - origination_type (Union[Unset, OriginationType]): - parent_ord_id (Union[Unset, str]): - price (Union[Unset, float]): - price_type (Union[Unset, PriceType]): - qty (Union[Unset, float]): - route (Union[Unset, str]): - source (Union[Unset, str]): - source_address (Union[Unset, str]): - submit_ts (Union[Unset, str]): - tag (Union[Unset, str]): - text (Union[Unset, str]): - tif (Union[Unset, Tif]): - user_id (Union[Unset, int]): - trader_id (Union[Unset, str]): - claimed_by (Union[Unset, str]): - ord_status (Union[Unset, OrdStatus]): - transact_ts (Union[Unset, str]): - has_busts (Union[Unset, bool]): - has_corrects (Union[Unset, bool]): - has_notes (Union[Unset, bool]): - """ - - account_id: Unset | int = UNSET - algo: Union[Unset, "MultiLegOrderCrossAlgo"] = UNSET - allocations: Unset | list["MultiLegOrderCrossAllocation"] = UNSET - cross_type: Unset | CrossType = UNSET - cur_ord_id: Unset | str = UNSET - header: Union[Unset, "Header"] = UNSET - id: Unset | str = UNSET - incoming_cl_ord_id: Unset | str = UNSET - incoming_ord_id: Unset | str = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - market_condition: Union[Unset, "MultiLegOrderCrossMarketCondition"] = UNSET - optional_data: Union[Unset, "MultiLegOrderCrossOptionalData"] = UNSET - order_flags: Unset | int = UNSET - order_updates: Unset | list["OrderUpdateEvent"] = UNSET - ord_type: Unset | OrdType = UNSET - origination_type: Unset | OriginationType = UNSET - parent_ord_id: Unset | str = UNSET - price: Unset | float = UNSET - price_type: Unset | PriceType = UNSET - qty: Unset | float = UNSET - route: Unset | str = UNSET - source: Unset | str = UNSET - source_address: Unset | str = UNSET - submit_ts: Unset | str = UNSET - tag: Unset | str = UNSET - text: Unset | str = UNSET - tif: Unset | Tif = UNSET - user_id: Unset | int = UNSET - trader_id: Unset | str = UNSET - claimed_by: Unset | str = UNSET - ord_status: Unset | OrdStatus = UNSET - transact_ts: Unset | str = UNSET - has_busts: Unset | bool = UNSET - has_corrects: Unset | bool = UNSET - has_notes: Unset | bool = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - algo: Unset | dict[str, Any] = UNSET - if not isinstance(self.algo, Unset): - algo = self.algo.to_dict() - - allocations: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.allocations, Unset): - allocations = [] - for allocations_item_data in self.allocations: - allocations_item = allocations_item_data.to_dict() - allocations.append(allocations_item) - - cross_type: Unset | str = UNSET - if not isinstance(self.cross_type, Unset): - cross_type = self.cross_type.value - - cur_ord_id = self.cur_ord_id - - header: Unset | dict[str, Any] = UNSET - if not isinstance(self.header, Unset): - header = self.header.to_dict() - - id = self.id - - incoming_cl_ord_id = self.incoming_cl_ord_id - - incoming_ord_id = self.incoming_ord_id - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - market_condition: Unset | dict[str, Any] = UNSET - if not isinstance(self.market_condition, Unset): - market_condition = self.market_condition.to_dict() - - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() - - order_flags = self.order_flags - - order_updates: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.order_updates, Unset): - order_updates = [] - for order_updates_item_data in self.order_updates: - order_updates_item = order_updates_item_data.to_dict() - order_updates.append(order_updates_item) - - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value - - origination_type: Unset | str = UNSET - if not isinstance(self.origination_type, Unset): - origination_type = self.origination_type.value - - parent_ord_id = self.parent_ord_id - - price = self.price - - price_type: Unset | str = UNSET - if not isinstance(self.price_type, Unset): - price_type = self.price_type.value - - qty = self.qty - - route = self.route - - source = self.source - - source_address = self.source_address - - submit_ts = self.submit_ts - - tag = self.tag - - text = self.text - - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value - - user_id = self.user_id - - trader_id = self.trader_id - - claimed_by = self.claimed_by - - ord_status: Unset | str = UNSET - if not isinstance(self.ord_status, Unset): - ord_status = self.ord_status.value - - transact_ts = self.transact_ts - - has_busts = self.has_busts - - has_corrects = self.has_corrects - - has_notes = self.has_notes - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if algo is not UNSET: - field_dict["algo"] = algo - if allocations is not UNSET: - field_dict["allocations"] = allocations - if cross_type is not UNSET: - field_dict["crossType"] = cross_type - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if header is not UNSET: - field_dict["header"] = header - if id is not UNSET: - field_dict["id"] = id - if incoming_cl_ord_id is not UNSET: - field_dict["incomingClOrdId"] = incoming_cl_ord_id - if incoming_ord_id is not UNSET: - field_dict["incomingOrdId"] = incoming_ord_id - if instructions is not UNSET: - field_dict["instructions"] = instructions - if market_condition is not UNSET: - field_dict["marketCondition"] = market_condition - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if order_flags is not UNSET: - field_dict["orderFlags"] = order_flags - if order_updates is not UNSET: - field_dict["orderUpdates"] = order_updates - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if origination_type is not UNSET: - field_dict["originationType"] = origination_type - if parent_ord_id is not UNSET: - field_dict["parentOrdId"] = parent_ord_id - if price is not UNSET: - field_dict["price"] = price - if price_type is not UNSET: - field_dict["priceType"] = price_type - if qty is not UNSET: - field_dict["qty"] = qty - if route is not UNSET: - field_dict["route"] = route - if source is not UNSET: - field_dict["source"] = source - if source_address is not UNSET: - field_dict["sourceAddress"] = source_address - if submit_ts is not UNSET: - field_dict["submitTs"] = submit_ts - if tag is not UNSET: - field_dict["tag"] = tag - if text is not UNSET: - field_dict["text"] = text - if tif is not UNSET: - field_dict["tif"] = tif - if user_id is not UNSET: - field_dict["userId"] = user_id - if trader_id is not UNSET: - field_dict["traderId"] = trader_id - if claimed_by is not UNSET: - field_dict["claimedBy"] = claimed_by - if ord_status is not UNSET: - field_dict["ordStatus"] = ord_status - if transact_ts is not UNSET: - field_dict["transactTs"] = transact_ts - if has_busts is not UNSET: - field_dict["hasBusts"] = has_busts - if has_corrects is not UNSET: - field_dict["hasCorrects"] = has_corrects - if has_notes is not UNSET: - field_dict["hasNotes"] = has_notes - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.header import Header - from openapi_project.openapi_package.models.multi_leg_order_cross_algo import MultiLegOrderCrossAlgo - from openapi_project.openapi_package.models.multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation, - - from openapi_project.openapi_package.models.multi_leg_order_cross_market_condition import MultiLegOrderCrossMarketCondition, - - from openapi_project.openapi_package.models.multi_leg_order_cross_optional_data import MultiLegOrderCrossOptionalData, - - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent - - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - _algo = d.pop("algo", UNSET) - algo: Unset | MultiLegOrderCrossAlgo - if isinstance(_algo, Unset): - algo = UNSET - else: - algo = MultiLegOrderCrossAlgo.from_dict(_algo) - - allocations = [] - _allocations = d.pop("allocations", UNSET) - for allocations_item_data in _allocations or []: - allocations_item = MultiLegOrderCrossAllocation.from_dict( - allocations_item_data - ) - - allocations.append(allocations_item) - - _cross_type = d.pop("crossType", UNSET) - cross_type: Unset | CrossType - if isinstance(_cross_type, Unset): - cross_type = UNSET - else: - cross_type = CrossType(_cross_type) - - cur_ord_id = d.pop("curOrdId", UNSET) - - _header = d.pop("header", UNSET) - header: Unset | Header - if isinstance(_header, Unset): - header = UNSET - else: - header = Header.from_dict(_header) - - id = d.pop("id", UNSET) - - incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) - - incoming_ord_id = d.pop("incomingOrdId", UNSET) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | MultiLegOrderCrossMarketCondition - if isinstance(_market_condition, Unset): - market_condition = UNSET - else: - market_condition = MultiLegOrderCrossMarketCondition.from_dict( - _market_condition - ) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | MultiLegOrderCrossOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = MultiLegOrderCrossOptionalData.from_dict(_optional_data) - - order_flags = d.pop("orderFlags", UNSET) - - order_updates = [] - _order_updates = d.pop("orderUpdates", UNSET) - for order_updates_item_data in _order_updates or []: - order_updates_item = OrderUpdateEvent.from_dict(order_updates_item_data) - - order_updates.append(order_updates_item) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) - - _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType - if isinstance(_origination_type, Unset): - origination_type = UNSET - else: - origination_type = OriginationType(_origination_type) - - parent_ord_id = d.pop("parentOrdId", UNSET) - - price = d.pop("price", UNSET) - - _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType - if isinstance(_price_type, Unset): - price_type = UNSET - else: - price_type = PriceType(_price_type) - - qty = d.pop("qty", UNSET) - - route = d.pop("route", UNSET) - - source = d.pop("source", UNSET) - - source_address = d.pop("sourceAddress", UNSET) - - submit_ts = d.pop("submitTs", UNSET) - - tag = d.pop("tag", UNSET) - - text = d.pop("text", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) - - user_id = d.pop("userId", UNSET) - - trader_id = d.pop("traderId", UNSET) - - claimed_by = d.pop("claimedBy", UNSET) - - _ord_status = d.pop("ordStatus", UNSET) - ord_status: Unset | OrdStatus - if isinstance(_ord_status, Unset): - ord_status = UNSET - else: - ord_status = OrdStatus(_ord_status) - - transact_ts = d.pop("transactTs", UNSET) - - has_busts = d.pop("hasBusts", UNSET) - - has_corrects = d.pop("hasCorrects", UNSET) - - has_notes = d.pop("hasNotes", UNSET) - - multi_leg_order_cross = cls( - account_id=account_id, - algo=algo, - allocations=allocations, - cross_type=cross_type, - cur_ord_id=cur_ord_id, - header=header, - id=id, - incoming_cl_ord_id=incoming_cl_ord_id, - incoming_ord_id=incoming_ord_id, - instructions=instructions, - market_condition=market_condition, - optional_data=optional_data, - order_flags=order_flags, - order_updates=order_updates, - ord_type=ord_type, - origination_type=origination_type, - parent_ord_id=parent_ord_id, - price=price, - price_type=price_type, - qty=qty, - route=route, - source=source, - source_address=source_address, - submit_ts=submit_ts, - tag=tag, - text=text, - tif=tif, - user_id=user_id, - trader_id=trader_id, - claimed_by=claimed_by, - ord_status=ord_status, - transact_ts=transact_ts, - has_busts=has_busts, - has_corrects=has_corrects, - has_notes=has_notes, - ) - - return multi_leg_order_cross diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py deleted file mode 100644 index f28e1cbb7..000000000 --- a/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="MultiLegOrderCrossAlgo") - - -@_attrs_define -class MultiLegOrderCrossAlgo: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - multi_leg_order_cross_algo = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - multi_leg_order_cross_algo.additional_properties = additional_properties - return multi_leg_order_cross_algo - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py deleted file mode 100644 index c2b487050..000000000 --- a/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py +++ /dev/null @@ -1,259 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.cross_side_type import CrossSideType -from openapi_project.openapi_package.models.ord_status import OrdStatus -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.multi_leg_order_cross_allocation_optional_data import MultiLegOrderCrossAllocationOptionalData, - - from openapi_project.openapi_package.models.multi_leg_order_leg import MultiLegOrderLeg - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - -T = TypeVar("T", bound="MultiLegOrderCrossAllocation") - - -@_attrs_define -class MultiLegOrderCrossAllocation: - """ - Attributes: - account_id (Union[Unset, int]): - clearing_info (Union[Unset, ClearingInfo]): - id (Union[Unset, str]): - instructions (Union[Unset, list['OrderInstruction']]): - legs (Union[Unset, list['MultiLegOrderLeg']]): - optional_data (Union[Unset, MultiLegOrderCrossAllocationOptionalData]): - qty (Union[Unset, float]): - side_type (Union[Unset, CrossSideType]): - avg_price (Union[Unset, float]): - last_price (Union[Unset, float]): - last_qty (Union[Unset, float]): - last_market (Union[Unset, str]): - leaves_qty (Union[Unset, float]): - cum_qty (Union[Unset, float]): - transact_ts (Union[Unset, str]): - ord_status (Union[Unset, OrdStatus]): - incoming_cl_ord_id (Union[Unset, str]): - incoming_ord_id (Union[Unset, str]): - """ - - account_id: Unset | int = UNSET - clearing_info: Union[Unset, "ClearingInfo"] = UNSET - id: Unset | str = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - legs: Unset | list["MultiLegOrderLeg"] = UNSET - optional_data: Union[Unset, "MultiLegOrderCrossAllocationOptionalData"] = UNSET - qty: Unset | float = UNSET - side_type: Unset | CrossSideType = UNSET - avg_price: Unset | float = UNSET - last_price: Unset | float = UNSET - last_qty: Unset | float = UNSET - last_market: Unset | str = UNSET - leaves_qty: Unset | float = UNSET - cum_qty: Unset | float = UNSET - transact_ts: Unset | str = UNSET - ord_status: Unset | OrdStatus = UNSET - incoming_cl_ord_id: Unset | str = UNSET - incoming_ord_id: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - clearing_info: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_info, Unset): - clearing_info = self.clearing_info.to_dict() - - id = self.id - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - legs: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.legs, Unset): - legs = [] - for legs_item_data in self.legs: - legs_item = legs_item_data.to_dict() - legs.append(legs_item) - - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() - - qty = self.qty - - side_type: Unset | str = UNSET - if not isinstance(self.side_type, Unset): - side_type = self.side_type.value - - avg_price = self.avg_price - - last_price = self.last_price - - last_qty = self.last_qty - - last_market = self.last_market - - leaves_qty = self.leaves_qty - - cum_qty = self.cum_qty - - transact_ts = self.transact_ts - - ord_status: Unset | str = UNSET - if not isinstance(self.ord_status, Unset): - ord_status = self.ord_status.value - - incoming_cl_ord_id = self.incoming_cl_ord_id - - incoming_ord_id = self.incoming_ord_id - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if clearing_info is not UNSET: - field_dict["clearingInfo"] = clearing_info - if id is not UNSET: - field_dict["id"] = id - if instructions is not UNSET: - field_dict["instructions"] = instructions - if legs is not UNSET: - field_dict["legs"] = legs - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if qty is not UNSET: - field_dict["qty"] = qty - if side_type is not UNSET: - field_dict["sideType"] = side_type - if avg_price is not UNSET: - field_dict["avgPrice"] = avg_price - if last_price is not UNSET: - field_dict["lastPrice"] = last_price - if last_qty is not UNSET: - field_dict["lastQty"] = last_qty - if last_market is not UNSET: - field_dict["lastMarket"] = last_market - if leaves_qty is not UNSET: - field_dict["leavesQty"] = leaves_qty - if cum_qty is not UNSET: - field_dict["cumQty"] = cum_qty - if transact_ts is not UNSET: - field_dict["transactTs"] = transact_ts - if ord_status is not UNSET: - field_dict["ordStatus"] = ord_status - if incoming_cl_ord_id is not UNSET: - field_dict["incomingClOrdId"] = incoming_cl_ord_id - if incoming_ord_id is not UNSET: - field_dict["incomingOrdId"] = incoming_ord_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.multi_leg_order_cross_allocation_optional_data import MultiLegOrderCrossAllocationOptionalData, - - from openapi_project.openapi_package.models.multi_leg_order_leg import MultiLegOrderLeg - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo - if isinstance(_clearing_info, Unset): - clearing_info = UNSET - else: - clearing_info = ClearingInfo.from_dict(_clearing_info) - - id = d.pop("id", UNSET) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - legs = [] - _legs = d.pop("legs", UNSET) - for legs_item_data in _legs or []: - legs_item = MultiLegOrderLeg.from_dict(legs_item_data) - - legs.append(legs_item) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | MultiLegOrderCrossAllocationOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = MultiLegOrderCrossAllocationOptionalData.from_dict( - _optional_data - ) - - qty = d.pop("qty", UNSET) - - _side_type = d.pop("sideType", UNSET) - side_type: Unset | CrossSideType - if isinstance(_side_type, Unset): - side_type = UNSET - else: - side_type = CrossSideType(_side_type) - - avg_price = d.pop("avgPrice", UNSET) - - last_price = d.pop("lastPrice", UNSET) - - last_qty = d.pop("lastQty", UNSET) - - last_market = d.pop("lastMarket", UNSET) - - leaves_qty = d.pop("leavesQty", UNSET) - - cum_qty = d.pop("cumQty", UNSET) - - transact_ts = d.pop("transactTs", UNSET) - - _ord_status = d.pop("ordStatus", UNSET) - ord_status: Unset | OrdStatus - if isinstance(_ord_status, Unset): - ord_status = UNSET - else: - ord_status = OrdStatus(_ord_status) - - incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) - - incoming_ord_id = d.pop("incomingOrdId", UNSET) - - multi_leg_order_cross_allocation = cls( - account_id=account_id, - clearing_info=clearing_info, - id=id, - instructions=instructions, - legs=legs, - optional_data=optional_data, - qty=qty, - side_type=side_type, - avg_price=avg_price, - last_price=last_price, - last_qty=last_qty, - last_market=last_market, - leaves_qty=leaves_qty, - cum_qty=cum_qty, - transact_ts=transact_ts, - ord_status=ord_status, - incoming_cl_ord_id=incoming_cl_ord_id, - incoming_ord_id=incoming_ord_id, - ) - - return multi_leg_order_cross_allocation diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py deleted file mode 100644 index 3adc30656..000000000 --- a/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="MultiLegOrderCrossAllocationOptionalData") - - -@_attrs_define -class MultiLegOrderCrossAllocationOptionalData: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - multi_leg_order_cross_allocation_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - multi_leg_order_cross_allocation_optional_data.additional_properties = ( - additional_properties - ) - return multi_leg_order_cross_allocation_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py deleted file mode 100644 index 4267a5ea4..000000000 --- a/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="MultiLegOrderCrossMarketCondition") - - -@_attrs_define -class MultiLegOrderCrossMarketCondition: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - multi_leg_order_cross_market_condition = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - multi_leg_order_cross_market_condition.additional_properties = ( - additional_properties - ) - return multi_leg_order_cross_market_condition - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py deleted file mode 100644 index 27c8cc231..000000000 --- a/openapi/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="MultiLegOrderCrossOptionalData") - - -@_attrs_define -class MultiLegOrderCrossOptionalData: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - multi_leg_order_cross_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - multi_leg_order_cross_optional_data.additional_properties = ( - additional_properties - ) - return multi_leg_order_cross_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_leg.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_leg.py deleted file mode 100644 index 45677bb3a..000000000 --- a/openapi/openapi_project/openapi_package/models/multi_leg_order_leg.py +++ /dev/null @@ -1,257 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.position_effect import PositionEffect -from openapi_project.openapi_package.models.side import Side -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.multi_leg_order_leg_market_condition import MultiLegOrderLegMarketCondition, - - from openapi_project.openapi_package.models.multi_leg_order_leg_optional_data import MultiLegOrderLegOptionalData - from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent - from openapi_project.openapi_package.models.security import Security - - -T = TypeVar("T", bound="MultiLegOrderLeg") - - -@_attrs_define -class MultiLegOrderLeg: - """ - Attributes: - id (Union[Unset, str]): - market_condition (Union[Unset, MultiLegOrderLegMarketCondition]): - optional_data (Union[Unset, MultiLegOrderLegOptionalData]): - order_updates (Union[Unset, list['OrderUpdateEvent']]): - position_effect (Union[Unset, PositionEffect]): - price (Union[Unset, float]): - qty (Union[Unset, float]): - ratio (Union[Unset, int]): - security (Union[Unset, Security]): - side (Union[Unset, Side]): - symbol (Union[Unset, str]): - avg_price (Union[Unset, float]): - last_price (Union[Unset, float]): - last_qty (Union[Unset, float]): - last_market (Union[Unset, str]): - leaves_qty (Union[Unset, float]): - cum_qty (Union[Unset, float]): - transact_ts (Union[Unset, str]): - """ - - id: Unset | str = UNSET - market_condition: Union[Unset, "MultiLegOrderLegMarketCondition"] = UNSET - optional_data: Union[Unset, "MultiLegOrderLegOptionalData"] = UNSET - order_updates: Unset | list["OrderUpdateEvent"] = UNSET - position_effect: Unset | PositionEffect = UNSET - price: Unset | float = UNSET - qty: Unset | float = UNSET - ratio: Unset | int = UNSET - security: Union[Unset, "Security"] = UNSET - side: Unset | Side = UNSET - symbol: Unset | str = UNSET - avg_price: Unset | float = UNSET - last_price: Unset | float = UNSET - last_qty: Unset | float = UNSET - last_market: Unset | str = UNSET - leaves_qty: Unset | float = UNSET - cum_qty: Unset | float = UNSET - transact_ts: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - id = self.id - - market_condition: Unset | dict[str, Any] = UNSET - if not isinstance(self.market_condition, Unset): - market_condition = self.market_condition.to_dict() - - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() - - order_updates: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.order_updates, Unset): - order_updates = [] - for order_updates_item_data in self.order_updates: - order_updates_item = order_updates_item_data.to_dict() - order_updates.append(order_updates_item) - - position_effect: Unset | str = UNSET - if not isinstance(self.position_effect, Unset): - position_effect = self.position_effect.value - - price = self.price - - qty = self.qty - - ratio = self.ratio - - security: Unset | dict[str, Any] = UNSET - if not isinstance(self.security, Unset): - security = self.security.to_dict() - - side: Unset | str = UNSET - if not isinstance(self.side, Unset): - side = self.side.value - - symbol = self.symbol - - avg_price = self.avg_price - - last_price = self.last_price - - last_qty = self.last_qty - - last_market = self.last_market - - leaves_qty = self.leaves_qty - - cum_qty = self.cum_qty - - transact_ts = self.transact_ts - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if id is not UNSET: - field_dict["id"] = id - if market_condition is not UNSET: - field_dict["marketCondition"] = market_condition - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if order_updates is not UNSET: - field_dict["orderUpdates"] = order_updates - if position_effect is not UNSET: - field_dict["positionEffect"] = position_effect - if price is not UNSET: - field_dict["price"] = price - if qty is not UNSET: - field_dict["qty"] = qty - if ratio is not UNSET: - field_dict["ratio"] = ratio - if security is not UNSET: - field_dict["security"] = security - if side is not UNSET: - field_dict["side"] = side - if symbol is not UNSET: - field_dict["symbol"] = symbol - if avg_price is not UNSET: - field_dict["avgPrice"] = avg_price - if last_price is not UNSET: - field_dict["lastPrice"] = last_price - if last_qty is not UNSET: - field_dict["lastQty"] = last_qty - if last_market is not UNSET: - field_dict["lastMarket"] = last_market - if leaves_qty is not UNSET: - field_dict["leavesQty"] = leaves_qty - if cum_qty is not UNSET: - field_dict["cumQty"] = cum_qty - if transact_ts is not UNSET: - field_dict["transactTs"] = transact_ts - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.multi_leg_order_leg_market_condition import MultiLegOrderLegMarketCondition, - - from openapi_project.openapi_package.models.multi_leg_order_leg_optional_data import MultiLegOrderLegOptionalData, - - from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent - from openapi_project.openapi_package.models.security import Security - - d = dict(src_dict) - id = d.pop("id", UNSET) - - _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | MultiLegOrderLegMarketCondition - if isinstance(_market_condition, Unset): - market_condition = UNSET - else: - market_condition = MultiLegOrderLegMarketCondition.from_dict( - _market_condition - ) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | MultiLegOrderLegOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = MultiLegOrderLegOptionalData.from_dict(_optional_data) - - order_updates = [] - _order_updates = d.pop("orderUpdates", UNSET) - for order_updates_item_data in _order_updates or []: - order_updates_item = OrderUpdateEvent.from_dict(order_updates_item_data) - - order_updates.append(order_updates_item) - - _position_effect = d.pop("positionEffect", UNSET) - position_effect: Unset | PositionEffect - if isinstance(_position_effect, Unset): - position_effect = UNSET - else: - position_effect = PositionEffect(_position_effect) - - price = d.pop("price", UNSET) - - qty = d.pop("qty", UNSET) - - ratio = d.pop("ratio", UNSET) - - _security = d.pop("security", UNSET) - security: Unset | Security - if isinstance(_security, Unset): - security = UNSET - else: - security = Security.from_dict(_security) - - _side = d.pop("side", UNSET) - side: Unset | Side - if isinstance(_side, Unset): - side = UNSET - else: - side = Side(_side) - - symbol = d.pop("symbol", UNSET) - - avg_price = d.pop("avgPrice", UNSET) - - last_price = d.pop("lastPrice", UNSET) - - last_qty = d.pop("lastQty", UNSET) - - last_market = d.pop("lastMarket", UNSET) - - leaves_qty = d.pop("leavesQty", UNSET) - - cum_qty = d.pop("cumQty", UNSET) - - transact_ts = d.pop("transactTs", UNSET) - - multi_leg_order_leg = cls( - id=id, - market_condition=market_condition, - optional_data=optional_data, - order_updates=order_updates, - position_effect=position_effect, - price=price, - qty=qty, - ratio=ratio, - security=security, - side=side, - symbol=symbol, - avg_price=avg_price, - last_price=last_price, - last_qty=last_qty, - last_market=last_market, - leaves_qty=leaves_qty, - cum_qty=cum_qty, - transact_ts=transact_ts, - ) - - return multi_leg_order_leg diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py deleted file mode 100644 index 1a02af13d..000000000 --- a/openapi/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="MultiLegOrderLegMarketCondition") - - -@_attrs_define -class MultiLegOrderLegMarketCondition: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - multi_leg_order_leg_market_condition = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - multi_leg_order_leg_market_condition.additional_properties = ( - additional_properties - ) - return multi_leg_order_leg_market_condition - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py deleted file mode 100644 index 5f5651b13..000000000 --- a/openapi/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="MultiLegOrderLegOptionalData") - - -@_attrs_define -class MultiLegOrderLegOptionalData: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - multi_leg_order_leg_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - multi_leg_order_leg_optional_data.additional_properties = additional_properties - return multi_leg_order_leg_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_market_condition.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_market_condition.py deleted file mode 100644 index df877977c..000000000 --- a/openapi/openapi_project/openapi_package/models/multi_leg_order_market_condition.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="MultiLegOrderMarketCondition") - - -@_attrs_define -class MultiLegOrderMarketCondition: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - multi_leg_order_market_condition = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - multi_leg_order_market_condition.additional_properties = additional_properties - return multi_leg_order_market_condition - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_order_optional_data.py b/openapi/openapi_project/openapi_package/models/multi_leg_order_optional_data.py deleted file mode 100644 index 1fd555d04..000000000 --- a/openapi/openapi_project/openapi_package/models/multi_leg_order_optional_data.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="MultiLegOrderOptionalData") - - -@_attrs_define -class MultiLegOrderOptionalData: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - multi_leg_order_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - multi_leg_order_optional_data.additional_properties = additional_properties - return multi_leg_order_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/multi_leg_reporting_type.py b/openapi/openapi_project/openapi_package/models/multi_leg_reporting_type.py deleted file mode 100644 index 3bfe5e229..000000000 --- a/openapi/openapi_project/openapi_package/models/multi_leg_reporting_type.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class MultiLegReportingType(str, Enum): - MULTI_LEG_REPORTING_TYPE_LEG = "MULTI_LEG_REPORTING_TYPE_LEG" - MULTI_LEG_REPORTING_TYPE_PARENT = "MULTI_LEG_REPORTING_TYPE_PARENT" - MULTI_LEG_REPORTING_TYPE_SINGLE = "MULTI_LEG_REPORTING_TYPE_SINGLE" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/numeric_display_format.py b/openapi/openapi_project/openapi_package/models/numeric_display_format.py deleted file mode 100644 index f28c58032..000000000 --- a/openapi/openapi_project/openapi_package/models/numeric_display_format.py +++ /dev/null @@ -1,32 +0,0 @@ -from enum import Enum - - -class NumericDisplayFormat(str, Enum): - NUMERIC_DISPLAY_FORMAT_AUTO = "NUMERIC_DISPLAY_FORMAT_AUTO" - NUMERIC_DISPLAY_FORMAT_DECIMAL_00 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_00" - NUMERIC_DISPLAY_FORMAT_DECIMAL_01 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_01" - NUMERIC_DISPLAY_FORMAT_DECIMAL_02 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_02" - NUMERIC_DISPLAY_FORMAT_DECIMAL_03 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_03" - NUMERIC_DISPLAY_FORMAT_DECIMAL_04 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_04" - NUMERIC_DISPLAY_FORMAT_DECIMAL_05 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_05" - NUMERIC_DISPLAY_FORMAT_DECIMAL_06 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_06" - NUMERIC_DISPLAY_FORMAT_DECIMAL_07 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_07" - NUMERIC_DISPLAY_FORMAT_DECIMAL_08 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_08" - NUMERIC_DISPLAY_FORMAT_DECIMAL_09 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_09" - NUMERIC_DISPLAY_FORMAT_DECIMAL_10 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_10" - NUMERIC_DISPLAY_FORMAT_DECIMAL_11 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_11" - NUMERIC_DISPLAY_FORMAT_FRACTIONAL_128TH = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_128TH" - NUMERIC_DISPLAY_FORMAT_FRACTIONAL_16TH = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_16TH" - NUMERIC_DISPLAY_FORMAT_FRACTIONAL_256TH = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_256TH" - NUMERIC_DISPLAY_FORMAT_FRACTIONAL_32ND = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_32ND" - NUMERIC_DISPLAY_FORMAT_FRACTIONAL_512ND = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_512ND" - NUMERIC_DISPLAY_FORMAT_FRACTIONAL_64TH = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_64TH" - NUMERIC_DISPLAY_FORMAT_FRACTIONAL_8TH = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_8TH" - NUMERIC_DISPLAY_FORMAT_FRACTIONAL_HALF = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_HALF" - NUMERIC_DISPLAY_FORMAT_FRACTIONAL_QUARTER = ( - "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_QUARTER" - ) - NUMERIC_DISPLAY_FORMAT_FRACTIONAL_WHOLE = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_WHOLE" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/option.py b/openapi/openapi_project/openapi_package/models/option.py deleted file mode 100644 index fe49a7dc8..000000000 --- a/openapi/openapi_project/openapi_package/models/option.py +++ /dev/null @@ -1,391 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.models.exchange_code import ExchangeCode -from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat -from openapi_project.openapi_package.models.option_expiration_style import OptionExpirationStyle -from openapi_project.openapi_package.models.put_call import PutCall -from openapi_project.openapi_package.models.security_category import SecurityCategory -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.date import Date - from openapi_project.openapi_package.models.option_aliases import OptionAliases - from openapi_project.openapi_package.models.option_root import OptionRoot - - -T = TypeVar("T", bound="Option") - - -@_attrs_define -class Option: - """ - Attributes: - aliases (Union[Unset, OptionAliases]): - currency (Union[Unset, Currency]): - listed_dt (Union[Unset, Date]): - delisted_dt (Union[Unset, Date]): - description (Union[Unset, str]): - exchange_id (Union[Unset, int]): - id (Union[Unset, int]): - multiplier (Union[Unset, float]): - price_base_factor (Union[Unset, float]): - price_display_factor (Union[Unset, float]): - price_display_format (Union[Unset, NumericDisplayFormat]): - qty_display_factor (Union[Unset, float]): - qty_display_format (Union[Unset, NumericDisplayFormat]): - security_category (Union[Unset, SecurityCategory]): - symbol (Union[Unset, str]): - tick_rule (Union[Unset, str]): - tick_size (Union[Unset, float]): - tick_value (Union[Unset, float]): - traded_exchanges (Union[Unset, list[ExchangeCode]]): - expiration_dt (Union[Unset, Date]): - expiration_style (Union[Unset, OptionExpirationStyle]): - first_trade_dt (Union[Unset, Date]): - last_trade_dt (Union[Unset, Date]): - put_call (Union[Unset, PutCall]): - root (Union[Unset, OptionRoot]): - strike (Union[Unset, float]): - underlying (Union[Unset, str]): - """ - - aliases: Union[Unset, "OptionAliases"] = UNSET - currency: Unset | Currency = UNSET - listed_dt: Union[Unset, "Date"] = UNSET - delisted_dt: Union[Unset, "Date"] = UNSET - description: Unset | str = UNSET - exchange_id: Unset | int = UNSET - id: Unset | int = UNSET - multiplier: Unset | float = UNSET - price_base_factor: Unset | float = UNSET - price_display_factor: Unset | float = UNSET - price_display_format: Unset | NumericDisplayFormat = UNSET - qty_display_factor: Unset | float = UNSET - qty_display_format: Unset | NumericDisplayFormat = UNSET - security_category: Unset | SecurityCategory = UNSET - symbol: Unset | str = UNSET - tick_rule: Unset | str = UNSET - tick_size: Unset | float = UNSET - tick_value: Unset | float = UNSET - traded_exchanges: Unset | list[ExchangeCode] = UNSET - expiration_dt: Union[Unset, "Date"] = UNSET - expiration_style: Unset | OptionExpirationStyle = UNSET - first_trade_dt: Union[Unset, "Date"] = UNSET - last_trade_dt: Union[Unset, "Date"] = UNSET - put_call: Unset | PutCall = UNSET - root: Union[Unset, "OptionRoot"] = UNSET - strike: Unset | float = UNSET - underlying: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = UNSET - if not isinstance(self.aliases, Unset): - aliases = self.aliases.to_dict() - - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value - - listed_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.listed_dt, Unset): - listed_dt = self.listed_dt.to_dict() - - delisted_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.delisted_dt, Unset): - delisted_dt = self.delisted_dt.to_dict() - - description = self.description - - exchange_id = self.exchange_id - - id = self.id - - multiplier = self.multiplier - - price_base_factor = self.price_base_factor - - price_display_factor = self.price_display_factor - - price_display_format: Unset | str = UNSET - if not isinstance(self.price_display_format, Unset): - price_display_format = self.price_display_format.value - - qty_display_factor = self.qty_display_factor - - qty_display_format: Unset | str = UNSET - if not isinstance(self.qty_display_format, Unset): - qty_display_format = self.qty_display_format.value - - security_category: Unset | str = UNSET - if not isinstance(self.security_category, Unset): - security_category = self.security_category.value - - symbol = self.symbol - - tick_rule = self.tick_rule - - tick_size = self.tick_size - - tick_value = self.tick_value - - traded_exchanges: Unset | list[str] = UNSET - if not isinstance(self.traded_exchanges, Unset): - traded_exchanges = [] - for traded_exchanges_item_data in self.traded_exchanges: - traded_exchanges_item = traded_exchanges_item_data.value - traded_exchanges.append(traded_exchanges_item) - - expiration_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.expiration_dt, Unset): - expiration_dt = self.expiration_dt.to_dict() - - expiration_style: Unset | str = UNSET - if not isinstance(self.expiration_style, Unset): - expiration_style = self.expiration_style.value - - first_trade_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.first_trade_dt, Unset): - first_trade_dt = self.first_trade_dt.to_dict() - - last_trade_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.last_trade_dt, Unset): - last_trade_dt = self.last_trade_dt.to_dict() - - put_call: Unset | str = UNSET - if not isinstance(self.put_call, Unset): - put_call = self.put_call.value - - root: Unset | dict[str, Any] = UNSET - if not isinstance(self.root, Unset): - root = self.root.to_dict() - - strike = self.strike - - underlying = self.underlying - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if aliases is not UNSET: - field_dict["aliases"] = aliases - if currency is not UNSET: - field_dict["currency"] = currency - if listed_dt is not UNSET: - field_dict["listedDt"] = listed_dt - if delisted_dt is not UNSET: - field_dict["delistedDt"] = delisted_dt - if description is not UNSET: - field_dict["description"] = description - if exchange_id is not UNSET: - field_dict["exchangeId"] = exchange_id - if id is not UNSET: - field_dict["id"] = id - if multiplier is not UNSET: - field_dict["multiplier"] = multiplier - if price_base_factor is not UNSET: - field_dict["priceBaseFactor"] = price_base_factor - if price_display_factor is not UNSET: - field_dict["priceDisplayFactor"] = price_display_factor - if price_display_format is not UNSET: - field_dict["priceDisplayFormat"] = price_display_format - if qty_display_factor is not UNSET: - field_dict["qtyDisplayFactor"] = qty_display_factor - if qty_display_format is not UNSET: - field_dict["qtyDisplayFormat"] = qty_display_format - if security_category is not UNSET: - field_dict["securityCategory"] = security_category - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tick_rule is not UNSET: - field_dict["tickRule"] = tick_rule - if tick_size is not UNSET: - field_dict["tickSize"] = tick_size - if tick_value is not UNSET: - field_dict["tickValue"] = tick_value - if traded_exchanges is not UNSET: - field_dict["tradedExchanges"] = traded_exchanges - if expiration_dt is not UNSET: - field_dict["expirationDt"] = expiration_dt - if expiration_style is not UNSET: - field_dict["expirationStyle"] = expiration_style - if first_trade_dt is not UNSET: - field_dict["firstTradeDt"] = first_trade_dt - if last_trade_dt is not UNSET: - field_dict["lastTradeDt"] = last_trade_dt - if put_call is not UNSET: - field_dict["putCall"] = put_call - if root is not UNSET: - field_dict["root"] = root - if strike is not UNSET: - field_dict["strike"] = strike - if underlying is not UNSET: - field_dict["underlying"] = underlying - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.date import Date - from openapi_project.openapi_package.models.option_aliases import OptionAliases - from openapi_project.openapi_package.models.option_root import OptionRoot - - d = dict(src_dict) - _aliases = d.pop("aliases", UNSET) - aliases: Unset | OptionAliases - if isinstance(_aliases, Unset): - aliases = UNSET - else: - aliases = OptionAliases.from_dict(_aliases) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) - - _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date - if isinstance(_listed_dt, Unset): - listed_dt = UNSET - else: - listed_dt = Date.from_dict(_listed_dt) - - _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date - if isinstance(_delisted_dt, Unset): - delisted_dt = UNSET - else: - delisted_dt = Date.from_dict(_delisted_dt) - - description = d.pop("description", UNSET) - - exchange_id = d.pop("exchangeId", UNSET) - - id = d.pop("id", UNSET) - - multiplier = d.pop("multiplier", UNSET) - - price_base_factor = d.pop("priceBaseFactor", UNSET) - - price_display_factor = d.pop("priceDisplayFactor", UNSET) - - _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat - if isinstance(_price_display_format, Unset): - price_display_format = UNSET - else: - price_display_format = NumericDisplayFormat(_price_display_format) - - qty_display_factor = d.pop("qtyDisplayFactor", UNSET) - - _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat - if isinstance(_qty_display_format, Unset): - qty_display_format = UNSET - else: - qty_display_format = NumericDisplayFormat(_qty_display_format) - - _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory - if isinstance(_security_category, Unset): - security_category = UNSET - else: - security_category = SecurityCategory(_security_category) - - symbol = d.pop("symbol", UNSET) - - tick_rule = d.pop("tickRule", UNSET) - - tick_size = d.pop("tickSize", UNSET) - - tick_value = d.pop("tickValue", UNSET) - - traded_exchanges = [] - _traded_exchanges = d.pop("tradedExchanges", UNSET) - for traded_exchanges_item_data in _traded_exchanges or []: - traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) - - traded_exchanges.append(traded_exchanges_item) - - _expiration_dt = d.pop("expirationDt", UNSET) - expiration_dt: Unset | Date - if isinstance(_expiration_dt, Unset): - expiration_dt = UNSET - else: - expiration_dt = Date.from_dict(_expiration_dt) - - _expiration_style = d.pop("expirationStyle", UNSET) - expiration_style: Unset | OptionExpirationStyle - if isinstance(_expiration_style, Unset): - expiration_style = UNSET - else: - expiration_style = OptionExpirationStyle(_expiration_style) - - _first_trade_dt = d.pop("firstTradeDt", UNSET) - first_trade_dt: Unset | Date - if isinstance(_first_trade_dt, Unset): - first_trade_dt = UNSET - else: - first_trade_dt = Date.from_dict(_first_trade_dt) - - _last_trade_dt = d.pop("lastTradeDt", UNSET) - last_trade_dt: Unset | Date - if isinstance(_last_trade_dt, Unset): - last_trade_dt = UNSET - else: - last_trade_dt = Date.from_dict(_last_trade_dt) - - _put_call = d.pop("putCall", UNSET) - put_call: Unset | PutCall - if isinstance(_put_call, Unset): - put_call = UNSET - else: - put_call = PutCall(_put_call) - - _root = d.pop("root", UNSET) - root: Unset | OptionRoot - if isinstance(_root, Unset): - root = UNSET - else: - root = OptionRoot.from_dict(_root) - - strike = d.pop("strike", UNSET) - - underlying = d.pop("underlying", UNSET) - - option = cls( - aliases=aliases, - currency=currency, - listed_dt=listed_dt, - delisted_dt=delisted_dt, - description=description, - exchange_id=exchange_id, - id=id, - multiplier=multiplier, - price_base_factor=price_base_factor, - price_display_factor=price_display_factor, - price_display_format=price_display_format, - qty_display_factor=qty_display_factor, - qty_display_format=qty_display_format, - security_category=security_category, - symbol=symbol, - tick_rule=tick_rule, - tick_size=tick_size, - tick_value=tick_value, - traded_exchanges=traded_exchanges, - expiration_dt=expiration_dt, - expiration_style=expiration_style, - first_trade_dt=first_trade_dt, - last_trade_dt=last_trade_dt, - put_call=put_call, - root=root, - strike=strike, - underlying=underlying, - ) - - return option diff --git a/openapi/openapi_project/openapi_package/models/option_aliases.py b/openapi/openapi_project/openapi_package/models/option_aliases.py deleted file mode 100644 index 47517bdc7..000000000 --- a/openapi/openapi_project/openapi_package/models/option_aliases.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="OptionAliases") - - -@_attrs_define -class OptionAliases: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - option_aliases = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - option_aliases.additional_properties = additional_properties - return option_aliases - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/option_chain.py b/openapi/openapi_project/openapi_package/models/option_chain.py deleted file mode 100644 index 8d5cada4f..000000000 --- a/openapi/openapi_project/openapi_package/models/option_chain.py +++ /dev/null @@ -1,128 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.option_chain_options import OptionChainOptions - from openapi_project.openapi_package.models.option_chain_roots import OptionChainRoots - from openapi_project.openapi_package.models.option_series import OptionSeries - from openapi_project.openapi_package.models.security import Security - - -T = TypeVar("T", bound="OptionChain") - - -@_attrs_define -class OptionChain: - """ - Attributes: - underlying (Union[Unset, Security]): - roots (Union[Unset, OptionChainRoots]): - options (Union[Unset, OptionChainOptions]): - option_series (Union[Unset, list['OptionSeries']]): - post (Union[Unset, str]): - station (Union[Unset, str]): - """ - - underlying: Union[Unset, "Security"] = UNSET - roots: Union[Unset, "OptionChainRoots"] = UNSET - options: Union[Unset, "OptionChainOptions"] = UNSET - option_series: Unset | list["OptionSeries"] = UNSET - post: Unset | str = UNSET - station: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - underlying: Unset | dict[str, Any] = UNSET - if not isinstance(self.underlying, Unset): - underlying = self.underlying.to_dict() - - roots: Unset | dict[str, Any] = UNSET - if not isinstance(self.roots, Unset): - roots = self.roots.to_dict() - - options: Unset | dict[str, Any] = UNSET - if not isinstance(self.options, Unset): - options = self.options.to_dict() - - option_series: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.option_series, Unset): - option_series = [] - for option_series_item_data in self.option_series: - option_series_item = option_series_item_data.to_dict() - option_series.append(option_series_item) - - post = self.post - - station = self.station - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if underlying is not UNSET: - field_dict["underlying"] = underlying - if roots is not UNSET: - field_dict["roots"] = roots - if options is not UNSET: - field_dict["options"] = options - if option_series is not UNSET: - field_dict["optionSeries"] = option_series - if post is not UNSET: - field_dict["post"] = post - if station is not UNSET: - field_dict["station"] = station - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.option_chain_options import OptionChainOptions - from openapi_project.openapi_package.models.option_chain_roots import OptionChainRoots - from openapi_project.openapi_package.models.option_series import OptionSeries - from openapi_project.openapi_package.models.security import Security - - d = dict(src_dict) - _underlying = d.pop("underlying", UNSET) - underlying: Unset | Security - if isinstance(_underlying, Unset): - underlying = UNSET - else: - underlying = Security.from_dict(_underlying) - - _roots = d.pop("roots", UNSET) - roots: Unset | OptionChainRoots - if isinstance(_roots, Unset): - roots = UNSET - else: - roots = OptionChainRoots.from_dict(_roots) - - _options = d.pop("options", UNSET) - options: Unset | OptionChainOptions - if isinstance(_options, Unset): - options = UNSET - else: - options = OptionChainOptions.from_dict(_options) - - option_series = [] - _option_series = d.pop("optionSeries", UNSET) - for option_series_item_data in _option_series or []: - option_series_item = OptionSeries.from_dict(option_series_item_data) - - option_series.append(option_series_item) - - post = d.pop("post", UNSET) - - station = d.pop("station", UNSET) - - option_chain = cls( - underlying=underlying, - roots=roots, - options=options, - option_series=option_series, - post=post, - station=station, - ) - - return option_chain diff --git a/openapi/openapi_project/openapi_package/models/option_chain_option.py b/openapi/openapi_project/openapi_package/models/option_chain_option.py deleted file mode 100644 index cc8e4a085..000000000 --- a/openapi/openapi_project/openapi_package/models/option_chain_option.py +++ /dev/null @@ -1,219 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.exchange_code import ExchangeCode -from openapi_project.openapi_package.models.put_call import PutCall -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.date import Date - from openapi_project.openapi_package.models.option_chain_option_aliases import OptionChainOptionAliases - - -T = TypeVar("T", bound="OptionChainOption") - - -@_attrs_define -class OptionChainOption: - """ - Attributes: - aliases (Union[Unset, OptionChainOptionAliases]): - listed_dt (Union[Unset, Date]): - delisted_dt (Union[Unset, Date]): - description (Union[Unset, str]): - exchange_id (Union[Unset, int]): - id (Union[Unset, int]): - tick_rule (Union[Unset, str]): - tick_size (Union[Unset, float]): - tick_value (Union[Unset, float]): - traded_exchanges (Union[Unset, list[ExchangeCode]]): - first_trade_dt (Union[Unset, Date]): - last_trade_dt (Union[Unset, Date]): - put_call (Union[Unset, PutCall]): - strike (Union[Unset, float]): - """ - - aliases: Union[Unset, "OptionChainOptionAliases"] = UNSET - listed_dt: Union[Unset, "Date"] = UNSET - delisted_dt: Union[Unset, "Date"] = UNSET - description: Unset | str = UNSET - exchange_id: Unset | int = UNSET - id: Unset | int = UNSET - tick_rule: Unset | str = UNSET - tick_size: Unset | float = UNSET - tick_value: Unset | float = UNSET - traded_exchanges: Unset | list[ExchangeCode] = UNSET - first_trade_dt: Union[Unset, "Date"] = UNSET - last_trade_dt: Union[Unset, "Date"] = UNSET - put_call: Unset | PutCall = UNSET - strike: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = UNSET - if not isinstance(self.aliases, Unset): - aliases = self.aliases.to_dict() - - listed_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.listed_dt, Unset): - listed_dt = self.listed_dt.to_dict() - - delisted_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.delisted_dt, Unset): - delisted_dt = self.delisted_dt.to_dict() - - description = self.description - - exchange_id = self.exchange_id - - id = self.id - - tick_rule = self.tick_rule - - tick_size = self.tick_size - - tick_value = self.tick_value - - traded_exchanges: Unset | list[str] = UNSET - if not isinstance(self.traded_exchanges, Unset): - traded_exchanges = [] - for traded_exchanges_item_data in self.traded_exchanges: - traded_exchanges_item = traded_exchanges_item_data.value - traded_exchanges.append(traded_exchanges_item) - - first_trade_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.first_trade_dt, Unset): - first_trade_dt = self.first_trade_dt.to_dict() - - last_trade_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.last_trade_dt, Unset): - last_trade_dt = self.last_trade_dt.to_dict() - - put_call: Unset | str = UNSET - if not isinstance(self.put_call, Unset): - put_call = self.put_call.value - - strike = self.strike - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if aliases is not UNSET: - field_dict["aliases"] = aliases - if listed_dt is not UNSET: - field_dict["listedDt"] = listed_dt - if delisted_dt is not UNSET: - field_dict["delistedDt"] = delisted_dt - if description is not UNSET: - field_dict["description"] = description - if exchange_id is not UNSET: - field_dict["exchangeId"] = exchange_id - if id is not UNSET: - field_dict["id"] = id - if tick_rule is not UNSET: - field_dict["tickRule"] = tick_rule - if tick_size is not UNSET: - field_dict["tickSize"] = tick_size - if tick_value is not UNSET: - field_dict["tickValue"] = tick_value - if traded_exchanges is not UNSET: - field_dict["tradedExchanges"] = traded_exchanges - if first_trade_dt is not UNSET: - field_dict["firstTradeDt"] = first_trade_dt - if last_trade_dt is not UNSET: - field_dict["lastTradeDt"] = last_trade_dt - if put_call is not UNSET: - field_dict["putCall"] = put_call - if strike is not UNSET: - field_dict["strike"] = strike - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.date import Date - from openapi_project.openapi_package.models.option_chain_option_aliases import OptionChainOptionAliases - - d = dict(src_dict) - _aliases = d.pop("aliases", UNSET) - aliases: Unset | OptionChainOptionAliases - if isinstance(_aliases, Unset): - aliases = UNSET - else: - aliases = OptionChainOptionAliases.from_dict(_aliases) - - _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date - if isinstance(_listed_dt, Unset): - listed_dt = UNSET - else: - listed_dt = Date.from_dict(_listed_dt) - - _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date - if isinstance(_delisted_dt, Unset): - delisted_dt = UNSET - else: - delisted_dt = Date.from_dict(_delisted_dt) - - description = d.pop("description", UNSET) - - exchange_id = d.pop("exchangeId", UNSET) - - id = d.pop("id", UNSET) - - tick_rule = d.pop("tickRule", UNSET) - - tick_size = d.pop("tickSize", UNSET) - - tick_value = d.pop("tickValue", UNSET) - - traded_exchanges = [] - _traded_exchanges = d.pop("tradedExchanges", UNSET) - for traded_exchanges_item_data in _traded_exchanges or []: - traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) - - traded_exchanges.append(traded_exchanges_item) - - _first_trade_dt = d.pop("firstTradeDt", UNSET) - first_trade_dt: Unset | Date - if isinstance(_first_trade_dt, Unset): - first_trade_dt = UNSET - else: - first_trade_dt = Date.from_dict(_first_trade_dt) - - _last_trade_dt = d.pop("lastTradeDt", UNSET) - last_trade_dt: Unset | Date - if isinstance(_last_trade_dt, Unset): - last_trade_dt = UNSET - else: - last_trade_dt = Date.from_dict(_last_trade_dt) - - _put_call = d.pop("putCall", UNSET) - put_call: Unset | PutCall - if isinstance(_put_call, Unset): - put_call = UNSET - else: - put_call = PutCall(_put_call) - - strike = d.pop("strike", UNSET) - - option_chain_option = cls( - aliases=aliases, - listed_dt=listed_dt, - delisted_dt=delisted_dt, - description=description, - exchange_id=exchange_id, - id=id, - tick_rule=tick_rule, - tick_size=tick_size, - tick_value=tick_value, - traded_exchanges=traded_exchanges, - first_trade_dt=first_trade_dt, - last_trade_dt=last_trade_dt, - put_call=put_call, - strike=strike, - ) - - return option_chain_option diff --git a/openapi/openapi_project/openapi_package/models/option_chain_option_aliases.py b/openapi/openapi_project/openapi_package/models/option_chain_option_aliases.py deleted file mode 100644 index 1200fde1c..000000000 --- a/openapi/openapi_project/openapi_package/models/option_chain_option_aliases.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="OptionChainOptionAliases") - - -@_attrs_define -class OptionChainOptionAliases: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - option_chain_option_aliases = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - option_chain_option_aliases.additional_properties = additional_properties - return option_chain_option_aliases - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/option_chain_options.py b/openapi/openapi_project/openapi_package/models/option_chain_options.py deleted file mode 100644 index 46b79fd15..000000000 --- a/openapi/openapi_project/openapi_package/models/option_chain_options.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.option_chain_option import OptionChainOption - - -T = TypeVar("T", bound="OptionChainOptions") - - -@_attrs_define -class OptionChainOptions: - """ """ - - additional_properties: dict[str, "OptionChainOption"] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.option_chain_option import OptionChainOption - - d = dict(src_dict) - option_chain_options = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = OptionChainOption.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - option_chain_options.additional_properties = additional_properties - return option_chain_options - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> "OptionChainOption": - return self.additional_properties[key] - - def __setitem__(self, key: str, value: "OptionChainOption") -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/option_chain_roots.py b/openapi/openapi_project/openapi_package/models/option_chain_roots.py deleted file mode 100644 index aff87bf59..000000000 --- a/openapi/openapi_project/openapi_package/models/option_chain_roots.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.option_root import OptionRoot - - -T = TypeVar("T", bound="OptionChainRoots") - - -@_attrs_define -class OptionChainRoots: - """ """ - - additional_properties: dict[str, "OptionRoot"] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop.to_dict() - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.option_root import OptionRoot - - d = dict(src_dict) - option_chain_roots = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = OptionRoot.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - option_chain_roots.additional_properties = additional_properties - return option_chain_roots - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> "OptionRoot": - return self.additional_properties[key] - - def __setitem__(self, key: str, value: "OptionRoot") -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/option_exercise_style.py b/openapi/openapi_project/openapi_package/models/option_exercise_style.py deleted file mode 100644 index 147be4d65..000000000 --- a/openapi/openapi_project/openapi_package/models/option_exercise_style.py +++ /dev/null @@ -1,11 +0,0 @@ -from enum import Enum - - -class OptionExerciseStyle(str, Enum): - OPTION_EXERCISE_STYLE_AMERICAN = "OPTION_EXERCISE_STYLE_AMERICAN" - OPTION_EXERCISE_STYLE_BERMUDAN = "OPTION_EXERCISE_STYLE_BERMUDAN" - OPTION_EXERCISE_STYLE_EUROPEAN = "OPTION_EXERCISE_STYLE_EUROPEAN" - OPTION_EXERCISE_STYLE_UNDEFINED = "OPTION_EXERCISE_STYLE_UNDEFINED" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/option_expiration_style.py b/openapi/openapi_project/openapi_package/models/option_expiration_style.py deleted file mode 100644 index bf0ad8c56..000000000 --- a/openapi/openapi_project/openapi_package/models/option_expiration_style.py +++ /dev/null @@ -1,19 +0,0 @@ -from enum import Enum - - -class OptionExpirationStyle(str, Enum): - OPTION_EXPIRATION_STYLE_DAILY = "OPTION_EXPIRATION_STYLE_DAILY" - OPTION_EXPIRATION_STYLE_E_O_M = "OPTION_EXPIRATION_STYLE_E_O_M" - OPTION_EXPIRATION_STYLE_LEAP = "OPTION_EXPIRATION_STYLE_LEAP" - OPTION_EXPIRATION_STYLE_MONTHLY = "OPTION_EXPIRATION_STYLE_MONTHLY" - OPTION_EXPIRATION_STYLE_QUARTERLY = "OPTION_EXPIRATION_STYLE_QUARTERLY" - OPTION_EXPIRATION_STYLE_UNKNOWN = "OPTION_EXPIRATION_STYLE_UNKNOWN" - OPTION_EXPIRATION_STYLE_WEEKLY = "OPTION_EXPIRATION_STYLE_WEEKLY" - OPTION_EXPIRATION_STYLE_WK1 = "OPTION_EXPIRATION_STYLE_WK1" - OPTION_EXPIRATION_STYLE_WK2 = "OPTION_EXPIRATION_STYLE_WK2" - OPTION_EXPIRATION_STYLE_WK3 = "OPTION_EXPIRATION_STYLE_WK3" - OPTION_EXPIRATION_STYLE_WK4 = "OPTION_EXPIRATION_STYLE_WK4" - OPTION_EXPIRATION_STYLE_WK5 = "OPTION_EXPIRATION_STYLE_WK5" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/option_root.py b/openapi/openapi_project/openapi_package/models/option_root.py deleted file mode 100644 index d9d0d74f0..000000000 --- a/openapi/openapi_project/openapi_package/models/option_root.py +++ /dev/null @@ -1,418 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.models.exchange_code import ExchangeCode -from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat -from openapi_project.openapi_package.models.option_exercise_style import OptionExerciseStyle -from openapi_project.openapi_package.models.option_series_product_type import OptionSeriesProductType -from openapi_project.openapi_package.models.option_series_type import OptionSeriesType -from openapi_project.openapi_package.models.option_settlement_type import OptionSettlementType -from openapi_project.openapi_package.models.security_category import SecurityCategory -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.date import Date - from openapi_project.openapi_package.models.option_root_aliases import OptionRootAliases - from openapi_project.openapi_package.models.settlement_info import SettlementInfo - from openapi_project.openapi_package.models.trading_session_group import TradingSessionGroup - - -T = TypeVar("T", bound="OptionRoot") - - -@_attrs_define -class OptionRoot: - """ - Attributes: - aliases (Union[Unset, OptionRootAliases]): - currency (Union[Unset, Currency]): - listed_dt (Union[Unset, Date]): - delisted_dt (Union[Unset, Date]): - description (Union[Unset, str]): - exchange_id (Union[Unset, int]): - id (Union[Unset, int]): - multiplier (Union[Unset, float]): - price_base_factor (Union[Unset, float]): - price_display_factor (Union[Unset, float]): - price_display_format (Union[Unset, NumericDisplayFormat]): - qty_display_factor (Union[Unset, float]): - qty_display_format (Union[Unset, NumericDisplayFormat]): - security_category (Union[Unset, SecurityCategory]): - symbol (Union[Unset, str]): - tick_rule (Union[Unset, str]): - tick_size (Union[Unset, float]): - tick_value (Union[Unset, float]): - traded_exchanges (Union[Unset, list[ExchangeCode]]): - deliverable_per_contract (Union[Unset, float]): - exercise_style (Union[Unset, OptionExerciseStyle]): - product_type (Union[Unset, OptionSeriesProductType]): - series_type (Union[Unset, OptionSeriesType]): - settlement_infos (Union[Unset, list['SettlementInfo']]): - settlement_type (Union[Unset, OptionSettlementType]): - strike_multiplier (Union[Unset, float]): - strike_value (Union[Unset, float]): - trading_session_group (Union[Unset, TradingSessionGroup]): - underlying (Union[Unset, str]): - """ - - aliases: Union[Unset, "OptionRootAliases"] = UNSET - currency: Unset | Currency = UNSET - listed_dt: Union[Unset, "Date"] = UNSET - delisted_dt: Union[Unset, "Date"] = UNSET - description: Unset | str = UNSET - exchange_id: Unset | int = UNSET - id: Unset | int = UNSET - multiplier: Unset | float = UNSET - price_base_factor: Unset | float = UNSET - price_display_factor: Unset | float = UNSET - price_display_format: Unset | NumericDisplayFormat = UNSET - qty_display_factor: Unset | float = UNSET - qty_display_format: Unset | NumericDisplayFormat = UNSET - security_category: Unset | SecurityCategory = UNSET - symbol: Unset | str = UNSET - tick_rule: Unset | str = UNSET - tick_size: Unset | float = UNSET - tick_value: Unset | float = UNSET - traded_exchanges: Unset | list[ExchangeCode] = UNSET - deliverable_per_contract: Unset | float = UNSET - exercise_style: Unset | OptionExerciseStyle = UNSET - product_type: Unset | OptionSeriesProductType = UNSET - series_type: Unset | OptionSeriesType = UNSET - settlement_infos: Unset | list["SettlementInfo"] = UNSET - settlement_type: Unset | OptionSettlementType = UNSET - strike_multiplier: Unset | float = UNSET - strike_value: Unset | float = UNSET - trading_session_group: Union[Unset, "TradingSessionGroup"] = UNSET - underlying: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = UNSET - if not isinstance(self.aliases, Unset): - aliases = self.aliases.to_dict() - - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value - - listed_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.listed_dt, Unset): - listed_dt = self.listed_dt.to_dict() - - delisted_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.delisted_dt, Unset): - delisted_dt = self.delisted_dt.to_dict() - - description = self.description - - exchange_id = self.exchange_id - - id = self.id - - multiplier = self.multiplier - - price_base_factor = self.price_base_factor - - price_display_factor = self.price_display_factor - - price_display_format: Unset | str = UNSET - if not isinstance(self.price_display_format, Unset): - price_display_format = self.price_display_format.value - - qty_display_factor = self.qty_display_factor - - qty_display_format: Unset | str = UNSET - if not isinstance(self.qty_display_format, Unset): - qty_display_format = self.qty_display_format.value - - security_category: Unset | str = UNSET - if not isinstance(self.security_category, Unset): - security_category = self.security_category.value - - symbol = self.symbol - - tick_rule = self.tick_rule - - tick_size = self.tick_size - - tick_value = self.tick_value - - traded_exchanges: Unset | list[str] = UNSET - if not isinstance(self.traded_exchanges, Unset): - traded_exchanges = [] - for traded_exchanges_item_data in self.traded_exchanges: - traded_exchanges_item = traded_exchanges_item_data.value - traded_exchanges.append(traded_exchanges_item) - - deliverable_per_contract = self.deliverable_per_contract - - exercise_style: Unset | str = UNSET - if not isinstance(self.exercise_style, Unset): - exercise_style = self.exercise_style.value - - product_type: Unset | str = UNSET - if not isinstance(self.product_type, Unset): - product_type = self.product_type.value - - series_type: Unset | str = UNSET - if not isinstance(self.series_type, Unset): - series_type = self.series_type.value - - settlement_infos: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.settlement_infos, Unset): - settlement_infos = [] - for settlement_infos_item_data in self.settlement_infos: - settlement_infos_item = settlement_infos_item_data.to_dict() - settlement_infos.append(settlement_infos_item) - - settlement_type: Unset | str = UNSET - if not isinstance(self.settlement_type, Unset): - settlement_type = self.settlement_type.value - - strike_multiplier = self.strike_multiplier - - strike_value = self.strike_value - - trading_session_group: Unset | dict[str, Any] = UNSET - if not isinstance(self.trading_session_group, Unset): - trading_session_group = self.trading_session_group.to_dict() - - underlying = self.underlying - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if aliases is not UNSET: - field_dict["aliases"] = aliases - if currency is not UNSET: - field_dict["currency"] = currency - if listed_dt is not UNSET: - field_dict["listedDt"] = listed_dt - if delisted_dt is not UNSET: - field_dict["delistedDt"] = delisted_dt - if description is not UNSET: - field_dict["description"] = description - if exchange_id is not UNSET: - field_dict["exchangeId"] = exchange_id - if id is not UNSET: - field_dict["id"] = id - if multiplier is not UNSET: - field_dict["multiplier"] = multiplier - if price_base_factor is not UNSET: - field_dict["priceBaseFactor"] = price_base_factor - if price_display_factor is not UNSET: - field_dict["priceDisplayFactor"] = price_display_factor - if price_display_format is not UNSET: - field_dict["priceDisplayFormat"] = price_display_format - if qty_display_factor is not UNSET: - field_dict["qtyDisplayFactor"] = qty_display_factor - if qty_display_format is not UNSET: - field_dict["qtyDisplayFormat"] = qty_display_format - if security_category is not UNSET: - field_dict["securityCategory"] = security_category - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tick_rule is not UNSET: - field_dict["tickRule"] = tick_rule - if tick_size is not UNSET: - field_dict["tickSize"] = tick_size - if tick_value is not UNSET: - field_dict["tickValue"] = tick_value - if traded_exchanges is not UNSET: - field_dict["tradedExchanges"] = traded_exchanges - if deliverable_per_contract is not UNSET: - field_dict["deliverablePerContract"] = deliverable_per_contract - if exercise_style is not UNSET: - field_dict["exerciseStyle"] = exercise_style - if product_type is not UNSET: - field_dict["productType"] = product_type - if series_type is not UNSET: - field_dict["seriesType"] = series_type - if settlement_infos is not UNSET: - field_dict["settlementInfos"] = settlement_infos - if settlement_type is not UNSET: - field_dict["settlementType"] = settlement_type - if strike_multiplier is not UNSET: - field_dict["strikeMultiplier"] = strike_multiplier - if strike_value is not UNSET: - field_dict["strikeValue"] = strike_value - if trading_session_group is not UNSET: - field_dict["tradingSessionGroup"] = trading_session_group - if underlying is not UNSET: - field_dict["underlying"] = underlying - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.date import Date - from openapi_project.openapi_package.models.option_root_aliases import OptionRootAliases - from openapi_project.openapi_package.models.settlement_info import SettlementInfo - from openapi_project.openapi_package.models.trading_session_group import TradingSessionGroup - - d = dict(src_dict) - _aliases = d.pop("aliases", UNSET) - aliases: Unset | OptionRootAliases - if isinstance(_aliases, Unset): - aliases = UNSET - else: - aliases = OptionRootAliases.from_dict(_aliases) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) - - _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date - if isinstance(_listed_dt, Unset): - listed_dt = UNSET - else: - listed_dt = Date.from_dict(_listed_dt) - - _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date - if isinstance(_delisted_dt, Unset): - delisted_dt = UNSET - else: - delisted_dt = Date.from_dict(_delisted_dt) - - description = d.pop("description", UNSET) - - exchange_id = d.pop("exchangeId", UNSET) - - id = d.pop("id", UNSET) - - multiplier = d.pop("multiplier", UNSET) - - price_base_factor = d.pop("priceBaseFactor", UNSET) - - price_display_factor = d.pop("priceDisplayFactor", UNSET) - - _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat - if isinstance(_price_display_format, Unset): - price_display_format = UNSET - else: - price_display_format = NumericDisplayFormat(_price_display_format) - - qty_display_factor = d.pop("qtyDisplayFactor", UNSET) - - _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat - if isinstance(_qty_display_format, Unset): - qty_display_format = UNSET - else: - qty_display_format = NumericDisplayFormat(_qty_display_format) - - _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory - if isinstance(_security_category, Unset): - security_category = UNSET - else: - security_category = SecurityCategory(_security_category) - - symbol = d.pop("symbol", UNSET) - - tick_rule = d.pop("tickRule", UNSET) - - tick_size = d.pop("tickSize", UNSET) - - tick_value = d.pop("tickValue", UNSET) - - traded_exchanges = [] - _traded_exchanges = d.pop("tradedExchanges", UNSET) - for traded_exchanges_item_data in _traded_exchanges or []: - traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) - - traded_exchanges.append(traded_exchanges_item) - - deliverable_per_contract = d.pop("deliverablePerContract", UNSET) - - _exercise_style = d.pop("exerciseStyle", UNSET) - exercise_style: Unset | OptionExerciseStyle - if isinstance(_exercise_style, Unset): - exercise_style = UNSET - else: - exercise_style = OptionExerciseStyle(_exercise_style) - - _product_type = d.pop("productType", UNSET) - product_type: Unset | OptionSeriesProductType - if isinstance(_product_type, Unset): - product_type = UNSET - else: - product_type = OptionSeriesProductType(_product_type) - - _series_type = d.pop("seriesType", UNSET) - series_type: Unset | OptionSeriesType - if isinstance(_series_type, Unset): - series_type = UNSET - else: - series_type = OptionSeriesType(_series_type) - - settlement_infos = [] - _settlement_infos = d.pop("settlementInfos", UNSET) - for settlement_infos_item_data in _settlement_infos or []: - settlement_infos_item = SettlementInfo.from_dict(settlement_infos_item_data) - - settlement_infos.append(settlement_infos_item) - - _settlement_type = d.pop("settlementType", UNSET) - settlement_type: Unset | OptionSettlementType - if isinstance(_settlement_type, Unset): - settlement_type = UNSET - else: - settlement_type = OptionSettlementType(_settlement_type) - - strike_multiplier = d.pop("strikeMultiplier", UNSET) - - strike_value = d.pop("strikeValue", UNSET) - - _trading_session_group = d.pop("tradingSessionGroup", UNSET) - trading_session_group: Unset | TradingSessionGroup - if isinstance(_trading_session_group, Unset): - trading_session_group = UNSET - else: - trading_session_group = TradingSessionGroup.from_dict( - _trading_session_group - ) - - underlying = d.pop("underlying", UNSET) - - option_root = cls( - aliases=aliases, - currency=currency, - listed_dt=listed_dt, - delisted_dt=delisted_dt, - description=description, - exchange_id=exchange_id, - id=id, - multiplier=multiplier, - price_base_factor=price_base_factor, - price_display_factor=price_display_factor, - price_display_format=price_display_format, - qty_display_factor=qty_display_factor, - qty_display_format=qty_display_format, - security_category=security_category, - symbol=symbol, - tick_rule=tick_rule, - tick_size=tick_size, - tick_value=tick_value, - traded_exchanges=traded_exchanges, - deliverable_per_contract=deliverable_per_contract, - exercise_style=exercise_style, - product_type=product_type, - series_type=series_type, - settlement_infos=settlement_infos, - settlement_type=settlement_type, - strike_multiplier=strike_multiplier, - strike_value=strike_value, - trading_session_group=trading_session_group, - underlying=underlying, - ) - - return option_root diff --git a/openapi/openapi_project/openapi_package/models/option_root_aliases.py b/openapi/openapi_project/openapi_package/models/option_root_aliases.py deleted file mode 100644 index 98d380e17..000000000 --- a/openapi/openapi_project/openapi_package/models/option_root_aliases.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="OptionRootAliases") - - -@_attrs_define -class OptionRootAliases: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - option_root_aliases = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - option_root_aliases.additional_properties = additional_properties - return option_root_aliases - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/option_series.py b/openapi/openapi_project/openapi_package/models/option_series.py deleted file mode 100644 index dda3fb697..000000000 --- a/openapi/openapi_project/openapi_package/models/option_series.py +++ /dev/null @@ -1,227 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat -from openapi_project.openapi_package.models.option_expiration_style import OptionExpirationStyle -from openapi_project.openapi_package.models.option_series_type import OptionSeriesType -from openapi_project.openapi_package.models.option_settlement_type import OptionSettlementType -from openapi_project.openapi_package.models.security_category import SecurityCategory -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.date import Date - - -T = TypeVar("T", bound="OptionSeries") - - -@_attrs_define -class OptionSeries: - """ - Attributes: - expiration_dt (Union[Unset, Date]): - expiration_style (Union[Unset, OptionExpirationStyle]): - root_symbol (Union[Unset, str]): - series_type (Union[Unset, OptionSeriesType]): - settlement_type (Union[Unset, OptionSettlementType]): - option_symbols (Union[Unset, list[str]]): - currency (Union[Unset, Currency]): - multiplier (Union[Unset, float]): - price_base_factor (Union[Unset, float]): - price_display_factor (Union[Unset, float]): - price_display_format (Union[Unset, NumericDisplayFormat]): - qty_display_factor (Union[Unset, float]): - qty_display_format (Union[Unset, NumericDisplayFormat]): - security_category (Union[Unset, SecurityCategory]): - """ - - expiration_dt: Union[Unset, "Date"] = UNSET - expiration_style: Unset | OptionExpirationStyle = UNSET - root_symbol: Unset | str = UNSET - series_type: Unset | OptionSeriesType = UNSET - settlement_type: Unset | OptionSettlementType = UNSET - option_symbols: Unset | list[str] = UNSET - currency: Unset | Currency = UNSET - multiplier: Unset | float = UNSET - price_base_factor: Unset | float = UNSET - price_display_factor: Unset | float = UNSET - price_display_format: Unset | NumericDisplayFormat = UNSET - qty_display_factor: Unset | float = UNSET - qty_display_format: Unset | NumericDisplayFormat = UNSET - security_category: Unset | SecurityCategory = UNSET - - def to_dict(self) -> dict[str, Any]: - expiration_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.expiration_dt, Unset): - expiration_dt = self.expiration_dt.to_dict() - - expiration_style: Unset | str = UNSET - if not isinstance(self.expiration_style, Unset): - expiration_style = self.expiration_style.value - - root_symbol = self.root_symbol - - series_type: Unset | str = UNSET - if not isinstance(self.series_type, Unset): - series_type = self.series_type.value - - settlement_type: Unset | str = UNSET - if not isinstance(self.settlement_type, Unset): - settlement_type = self.settlement_type.value - - option_symbols: Unset | list[str] = UNSET - if not isinstance(self.option_symbols, Unset): - option_symbols = self.option_symbols - - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value - - multiplier = self.multiplier - - price_base_factor = self.price_base_factor - - price_display_factor = self.price_display_factor - - price_display_format: Unset | str = UNSET - if not isinstance(self.price_display_format, Unset): - price_display_format = self.price_display_format.value - - qty_display_factor = self.qty_display_factor - - qty_display_format: Unset | str = UNSET - if not isinstance(self.qty_display_format, Unset): - qty_display_format = self.qty_display_format.value - - security_category: Unset | str = UNSET - if not isinstance(self.security_category, Unset): - security_category = self.security_category.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if expiration_dt is not UNSET: - field_dict["expirationDt"] = expiration_dt - if expiration_style is not UNSET: - field_dict["expirationStyle"] = expiration_style - if root_symbol is not UNSET: - field_dict["rootSymbol"] = root_symbol - if series_type is not UNSET: - field_dict["seriesType"] = series_type - if settlement_type is not UNSET: - field_dict["settlementType"] = settlement_type - if option_symbols is not UNSET: - field_dict["optionSymbols"] = option_symbols - if currency is not UNSET: - field_dict["currency"] = currency - if multiplier is not UNSET: - field_dict["multiplier"] = multiplier - if price_base_factor is not UNSET: - field_dict["priceBaseFactor"] = price_base_factor - if price_display_factor is not UNSET: - field_dict["priceDisplayFactor"] = price_display_factor - if price_display_format is not UNSET: - field_dict["priceDisplayFormat"] = price_display_format - if qty_display_factor is not UNSET: - field_dict["qtyDisplayFactor"] = qty_display_factor - if qty_display_format is not UNSET: - field_dict["qtyDisplayFormat"] = qty_display_format - if security_category is not UNSET: - field_dict["securityCategory"] = security_category - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.date import Date - - d = dict(src_dict) - _expiration_dt = d.pop("expirationDt", UNSET) - expiration_dt: Unset | Date - if isinstance(_expiration_dt, Unset): - expiration_dt = UNSET - else: - expiration_dt = Date.from_dict(_expiration_dt) - - _expiration_style = d.pop("expirationStyle", UNSET) - expiration_style: Unset | OptionExpirationStyle - if isinstance(_expiration_style, Unset): - expiration_style = UNSET - else: - expiration_style = OptionExpirationStyle(_expiration_style) - - root_symbol = d.pop("rootSymbol", UNSET) - - _series_type = d.pop("seriesType", UNSET) - series_type: Unset | OptionSeriesType - if isinstance(_series_type, Unset): - series_type = UNSET - else: - series_type = OptionSeriesType(_series_type) - - _settlement_type = d.pop("settlementType", UNSET) - settlement_type: Unset | OptionSettlementType - if isinstance(_settlement_type, Unset): - settlement_type = UNSET - else: - settlement_type = OptionSettlementType(_settlement_type) - - option_symbols = cast(list[str], d.pop("optionSymbols", UNSET)) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) - - multiplier = d.pop("multiplier", UNSET) - - price_base_factor = d.pop("priceBaseFactor", UNSET) - - price_display_factor = d.pop("priceDisplayFactor", UNSET) - - _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat - if isinstance(_price_display_format, Unset): - price_display_format = UNSET - else: - price_display_format = NumericDisplayFormat(_price_display_format) - - qty_display_factor = d.pop("qtyDisplayFactor", UNSET) - - _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat - if isinstance(_qty_display_format, Unset): - qty_display_format = UNSET - else: - qty_display_format = NumericDisplayFormat(_qty_display_format) - - _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory - if isinstance(_security_category, Unset): - security_category = UNSET - else: - security_category = SecurityCategory(_security_category) - - option_series = cls( - expiration_dt=expiration_dt, - expiration_style=expiration_style, - root_symbol=root_symbol, - series_type=series_type, - settlement_type=settlement_type, - option_symbols=option_symbols, - currency=currency, - multiplier=multiplier, - price_base_factor=price_base_factor, - price_display_factor=price_display_factor, - price_display_format=price_display_format, - qty_display_factor=qty_display_factor, - qty_display_format=qty_display_format, - security_category=security_category, - ) - - return option_series diff --git a/openapi/openapi_project/openapi_package/models/option_series_product_type.py b/openapi/openapi_project/openapi_package/models/option_series_product_type.py deleted file mode 100644 index 5fed3ad30..000000000 --- a/openapi/openapi_project/openapi_package/models/option_series_product_type.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class OptionSeriesProductType(str, Enum): - OPTION_SERIES_PRODUCT_TYPE_MICRO = "OPTION_SERIES_PRODUCT_TYPE_MICRO" - OPTION_SERIES_PRODUCT_TYPE_STANDARD = "OPTION_SERIES_PRODUCT_TYPE_STANDARD" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/option_series_type.py b/openapi/openapi_project/openapi_package/models/option_series_type.py deleted file mode 100644 index 44b47e8ea..000000000 --- a/openapi/openapi_project/openapi_package/models/option_series_type.py +++ /dev/null @@ -1,13 +0,0 @@ -from enum import Enum - - -class OptionSeriesType(str, Enum): - OPTION_SERIES_TYPE_BINARY = "OPTION_SERIES_TYPE_BINARY" - OPTION_SERIES_TYPE_FLEX = "OPTION_SERIES_TYPE_FLEX" - OPTION_SERIES_TYPE_LEAP = "OPTION_SERIES_TYPE_LEAP" - OPTION_SERIES_TYPE_RANGE = "OPTION_SERIES_TYPE_RANGE" - OPTION_SERIES_TYPE_STANDARD = "OPTION_SERIES_TYPE_STANDARD" - OPTION_SERIES_TYPE_UNKNOWN = "OPTION_SERIES_TYPE_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/option_settlement_type.py b/openapi/openapi_project/openapi_package/models/option_settlement_type.py deleted file mode 100644 index 8ff8df614..000000000 --- a/openapi/openapi_project/openapi_package/models/option_settlement_type.py +++ /dev/null @@ -1,12 +0,0 @@ -from enum import Enum - - -class OptionSettlementType(str, Enum): - OPTION_SETTLEMENT_TYPE_AM = "OPTION_SETTLEMENT_TYPE_AM" - OPTION_SETTLEMENT_TYPE_ASIAN = "OPTION_SETTLEMENT_TYPE_ASIAN" - OPTION_SETTLEMENT_TYPE_CLIQUET = "OPTION_SETTLEMENT_TYPE_CLIQUET" - OPTION_SETTLEMENT_TYPE_PM = "OPTION_SETTLEMENT_TYPE_PM" - OPTION_SETTLEMENT_TYPE_UNDEFINED = "OPTION_SETTLEMENT_TYPE_UNDEFINED" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/ord_status.py b/openapi/openapi_project/openapi_package/models/ord_status.py deleted file mode 100644 index 920d81f37..000000000 --- a/openapi/openapi_project/openapi_package/models/ord_status.py +++ /dev/null @@ -1,30 +0,0 @@ -from enum import Enum - - -class OrdStatus(str, Enum): - ORD_STATUS_ACCEPTED = "ORD_STATUS_ACCEPTED" - ORD_STATUS_ACCEPTED_FOR_BIDDING = "ORD_STATUS_ACCEPTED_FOR_BIDDING" - ORD_STATUS_CANCELED = "ORD_STATUS_CANCELED" - ORD_STATUS_DECLINED = "ORD_STATUS_DECLINED" - ORD_STATUS_DONE_FOR_DAY = "ORD_STATUS_DONE_FOR_DAY" - ORD_STATUS_EXPIRED = "ORD_STATUS_EXPIRED" - ORD_STATUS_FILLED = "ORD_STATUS_FILLED" - ORD_STATUS_NEW = "ORD_STATUS_NEW" - ORD_STATUS_PARTIALLY_FILLED = "ORD_STATUS_PARTIALLY_FILLED" - ORD_STATUS_PENDING_CANCEL = "ORD_STATUS_PENDING_CANCEL" - ORD_STATUS_PENDING_NEW = "ORD_STATUS_PENDING_NEW" - ORD_STATUS_PENDING_REPLACE = "ORD_STATUS_PENDING_REPLACE" - ORD_STATUS_PUSHED = "ORD_STATUS_PUSHED" - ORD_STATUS_QUEUED = "ORD_STATUS_QUEUED" - ORD_STATUS_REJECTED = "ORD_STATUS_REJECTED" - ORD_STATUS_REPLACED = "ORD_STATUS_REPLACED" - ORD_STATUS_REPRESENTED = "ORD_STATUS_REPRESENTED" - ORD_STATUS_STAGED = "ORD_STATUS_STAGED" - ORD_STATUS_STOPPED = "ORD_STATUS_STOPPED" - ORD_STATUS_SUSPENDED = "ORD_STATUS_SUSPENDED" - ORD_STATUS_TIMED_OUT = "ORD_STATUS_TIMED_OUT" - ORD_STATUS_UNKNOWN = "ORD_STATUS_UNKNOWN" - ORD_STATUS_WORKING = "ORD_STATUS_WORKING" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/ord_type.py b/openapi/openapi_project/openapi_package/models/ord_type.py deleted file mode 100644 index 4ef641095..000000000 --- a/openapi/openapi_project/openapi_package/models/ord_type.py +++ /dev/null @@ -1,14 +0,0 @@ -from enum import Enum - - -class OrdType(str, Enum): - ORD_TYPE_LIMIT = "ORD_TYPE_LIMIT" - ORD_TYPE_MARKET = "ORD_TYPE_MARKET" - ORD_TYPE_MARKET_IF_TOUCHED = "ORD_TYPE_MARKET_IF_TOUCHED" - ORD_TYPE_PEGGED = "ORD_TYPE_PEGGED" - ORD_TYPE_STOP = "ORD_TYPE_STOP" - ORD_TYPE_STOP_LIMIT = "ORD_TYPE_STOP_LIMIT" - ORD_TYPE_UNKNOWN = "ORD_TYPE_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/order.py b/openapi/openapi_project/openapi_package/models/order.py deleted file mode 100644 index 68578c635..000000000 --- a/openapi/openapi_project/openapi_package/models/order.py +++ /dev/null @@ -1,583 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.ord_status import OrdStatus -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.origination_type import OriginationType -from openapi_project.openapi_package.models.position_effect import PositionEffect -from openapi_project.openapi_package.models.price_type import PriceType -from openapi_project.openapi_package.models.side import Side -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.header import Header - from openapi_project.openapi_package.models.order_algo import OrderAlgo - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.order_market_condition import OrderMarketCondition - from openapi_project.openapi_package.models.order_optional_data import OrderOptionalData - from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent - from openapi_project.openapi_package.models.security import Security - - -T = TypeVar("T", bound="Order") - - -@_attrs_define -class Order: - """ - Attributes: - account_id (Union[Unset, int]): - algo (Union[Unset, OrderAlgo]): - aux_price (Union[Unset, float]): - clearing_info (Union[Unset, ClearingInfo]): - cur_ord_id (Union[Unset, str]): - header (Union[Unset, Header]): - id (Union[Unset, str]): - incoming_cl_ord_id (Union[Unset, str]): - incoming_ord_id (Union[Unset, str]): - instructions (Union[Unset, list['OrderInstruction']]): - market_condition (Union[Unset, OrderMarketCondition]): - optional_data (Union[Unset, OrderOptionalData]): - order_flags (Union[Unset, int]): - order_updates (Union[Unset, list['OrderUpdateEvent']]): - ord_type (Union[Unset, OrdType]): - origination_type (Union[Unset, OriginationType]): - parent_ord_id (Union[Unset, str]): - position_effect (Union[Unset, PositionEffect]): - price (Union[Unset, float]): - price_type (Union[Unset, PriceType]): - qty (Union[Unset, float]): - route (Union[Unset, str]): - security (Union[Unset, Security]): - side (Union[Unset, Side]): - source (Union[Unset, str]): - source_address (Union[Unset, str]): - submit_ts (Union[Unset, str]): - symbol (Union[Unset, str]): - tag (Union[Unset, str]): - text (Union[Unset, str]): - tif (Union[Unset, Tif]): - trader_id (Union[Unset, str]): - user_id (Union[Unset, int]): - ord_status (Union[Unset, OrdStatus]): - avg_price (Union[Unset, float]): - claimed_by (Union[Unset, str]): - last_price (Union[Unset, float]): - last_qty (Union[Unset, float]): - last_market (Union[Unset, str]): - leaves_qty (Union[Unset, float]): - cum_qty (Union[Unset, float]): - transact_ts (Union[Unset, str]): - working_qty (Union[Unset, float]): - has_busts (Union[Unset, bool]): - has_corrects (Union[Unset, bool]): - has_notes (Union[Unset, bool]): - """ - - account_id: Unset | int = UNSET - algo: Union[Unset, "OrderAlgo"] = UNSET - aux_price: Unset | float = UNSET - clearing_info: Union[Unset, "ClearingInfo"] = UNSET - cur_ord_id: Unset | str = UNSET - header: Union[Unset, "Header"] = UNSET - id: Unset | str = UNSET - incoming_cl_ord_id: Unset | str = UNSET - incoming_ord_id: Unset | str = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - market_condition: Union[Unset, "OrderMarketCondition"] = UNSET - optional_data: Union[Unset, "OrderOptionalData"] = UNSET - order_flags: Unset | int = UNSET - order_updates: Unset | list["OrderUpdateEvent"] = UNSET - ord_type: Unset | OrdType = UNSET - origination_type: Unset | OriginationType = UNSET - parent_ord_id: Unset | str = UNSET - position_effect: Unset | PositionEffect = UNSET - price: Unset | float = UNSET - price_type: Unset | PriceType = UNSET - qty: Unset | float = UNSET - route: Unset | str = UNSET - security: Union[Unset, "Security"] = UNSET - side: Unset | Side = UNSET - source: Unset | str = UNSET - source_address: Unset | str = UNSET - submit_ts: Unset | str = UNSET - symbol: Unset | str = UNSET - tag: Unset | str = UNSET - text: Unset | str = UNSET - tif: Unset | Tif = UNSET - trader_id: Unset | str = UNSET - user_id: Unset | int = UNSET - ord_status: Unset | OrdStatus = UNSET - avg_price: Unset | float = UNSET - claimed_by: Unset | str = UNSET - last_price: Unset | float = UNSET - last_qty: Unset | float = UNSET - last_market: Unset | str = UNSET - leaves_qty: Unset | float = UNSET - cum_qty: Unset | float = UNSET - transact_ts: Unset | str = UNSET - working_qty: Unset | float = UNSET - has_busts: Unset | bool = UNSET - has_corrects: Unset | bool = UNSET - has_notes: Unset | bool = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - algo: Unset | dict[str, Any] = UNSET - if not isinstance(self.algo, Unset): - algo = self.algo.to_dict() - - aux_price = self.aux_price - - clearing_info: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_info, Unset): - clearing_info = self.clearing_info.to_dict() - - cur_ord_id = self.cur_ord_id - - header: Unset | dict[str, Any] = UNSET - if not isinstance(self.header, Unset): - header = self.header.to_dict() - - id = self.id - - incoming_cl_ord_id = self.incoming_cl_ord_id - - incoming_ord_id = self.incoming_ord_id - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - market_condition: Unset | dict[str, Any] = UNSET - if not isinstance(self.market_condition, Unset): - market_condition = self.market_condition.to_dict() - - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() - - order_flags = self.order_flags - - order_updates: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.order_updates, Unset): - order_updates = [] - for order_updates_item_data in self.order_updates: - order_updates_item = order_updates_item_data.to_dict() - order_updates.append(order_updates_item) - - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value - - origination_type: Unset | str = UNSET - if not isinstance(self.origination_type, Unset): - origination_type = self.origination_type.value - - parent_ord_id = self.parent_ord_id - - position_effect: Unset | str = UNSET - if not isinstance(self.position_effect, Unset): - position_effect = self.position_effect.value - - price = self.price - - price_type: Unset | str = UNSET - if not isinstance(self.price_type, Unset): - price_type = self.price_type.value - - qty = self.qty - - route = self.route - - security: Unset | dict[str, Any] = UNSET - if not isinstance(self.security, Unset): - security = self.security.to_dict() - - side: Unset | str = UNSET - if not isinstance(self.side, Unset): - side = self.side.value - - source = self.source - - source_address = self.source_address - - submit_ts = self.submit_ts - - symbol = self.symbol - - tag = self.tag - - text = self.text - - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value - - trader_id = self.trader_id - - user_id = self.user_id - - ord_status: Unset | str = UNSET - if not isinstance(self.ord_status, Unset): - ord_status = self.ord_status.value - - avg_price = self.avg_price - - claimed_by = self.claimed_by - - last_price = self.last_price - - last_qty = self.last_qty - - last_market = self.last_market - - leaves_qty = self.leaves_qty - - cum_qty = self.cum_qty - - transact_ts = self.transact_ts - - working_qty = self.working_qty - - has_busts = self.has_busts - - has_corrects = self.has_corrects - - has_notes = self.has_notes - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if algo is not UNSET: - field_dict["algo"] = algo - if aux_price is not UNSET: - field_dict["auxPrice"] = aux_price - if clearing_info is not UNSET: - field_dict["clearingInfo"] = clearing_info - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if header is not UNSET: - field_dict["header"] = header - if id is not UNSET: - field_dict["id"] = id - if incoming_cl_ord_id is not UNSET: - field_dict["incomingClOrdId"] = incoming_cl_ord_id - if incoming_ord_id is not UNSET: - field_dict["incomingOrdId"] = incoming_ord_id - if instructions is not UNSET: - field_dict["instructions"] = instructions - if market_condition is not UNSET: - field_dict["marketCondition"] = market_condition - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if order_flags is not UNSET: - field_dict["orderFlags"] = order_flags - if order_updates is not UNSET: - field_dict["orderUpdates"] = order_updates - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if origination_type is not UNSET: - field_dict["originationType"] = origination_type - if parent_ord_id is not UNSET: - field_dict["parentOrdId"] = parent_ord_id - if position_effect is not UNSET: - field_dict["positionEffect"] = position_effect - if price is not UNSET: - field_dict["price"] = price - if price_type is not UNSET: - field_dict["priceType"] = price_type - if qty is not UNSET: - field_dict["qty"] = qty - if route is not UNSET: - field_dict["route"] = route - if security is not UNSET: - field_dict["security"] = security - if side is not UNSET: - field_dict["side"] = side - if source is not UNSET: - field_dict["source"] = source - if source_address is not UNSET: - field_dict["sourceAddress"] = source_address - if submit_ts is not UNSET: - field_dict["submitTs"] = submit_ts - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tag is not UNSET: - field_dict["tag"] = tag - if text is not UNSET: - field_dict["text"] = text - if tif is not UNSET: - field_dict["tif"] = tif - if trader_id is not UNSET: - field_dict["traderId"] = trader_id - if user_id is not UNSET: - field_dict["userId"] = user_id - if ord_status is not UNSET: - field_dict["ordStatus"] = ord_status - if avg_price is not UNSET: - field_dict["avgPrice"] = avg_price - if claimed_by is not UNSET: - field_dict["claimedBy"] = claimed_by - if last_price is not UNSET: - field_dict["lastPrice"] = last_price - if last_qty is not UNSET: - field_dict["lastQty"] = last_qty - if last_market is not UNSET: - field_dict["lastMarket"] = last_market - if leaves_qty is not UNSET: - field_dict["leavesQty"] = leaves_qty - if cum_qty is not UNSET: - field_dict["cumQty"] = cum_qty - if transact_ts is not UNSET: - field_dict["transactTs"] = transact_ts - if working_qty is not UNSET: - field_dict["workingQty"] = working_qty - if has_busts is not UNSET: - field_dict["hasBusts"] = has_busts - if has_corrects is not UNSET: - field_dict["hasCorrects"] = has_corrects - if has_notes is not UNSET: - field_dict["hasNotes"] = has_notes - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.header import Header - from openapi_project.openapi_package.models.order_algo import OrderAlgo - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.order_market_condition import OrderMarketCondition - from openapi_project.openapi_package.models.order_optional_data import OrderOptionalData - from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent - from openapi_project.openapi_package.models.security import Security - - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - _algo = d.pop("algo", UNSET) - algo: Unset | OrderAlgo - if isinstance(_algo, Unset): - algo = UNSET - else: - algo = OrderAlgo.from_dict(_algo) - - aux_price = d.pop("auxPrice", UNSET) - - _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo - if isinstance(_clearing_info, Unset): - clearing_info = UNSET - else: - clearing_info = ClearingInfo.from_dict(_clearing_info) - - cur_ord_id = d.pop("curOrdId", UNSET) - - _header = d.pop("header", UNSET) - header: Unset | Header - if isinstance(_header, Unset): - header = UNSET - else: - header = Header.from_dict(_header) - - id = d.pop("id", UNSET) - - incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) - - incoming_ord_id = d.pop("incomingOrdId", UNSET) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | OrderMarketCondition - if isinstance(_market_condition, Unset): - market_condition = UNSET - else: - market_condition = OrderMarketCondition.from_dict(_market_condition) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | OrderOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = OrderOptionalData.from_dict(_optional_data) - - order_flags = d.pop("orderFlags", UNSET) - - order_updates = [] - _order_updates = d.pop("orderUpdates", UNSET) - for order_updates_item_data in _order_updates or []: - order_updates_item = OrderUpdateEvent.from_dict(order_updates_item_data) - - order_updates.append(order_updates_item) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) - - _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType - if isinstance(_origination_type, Unset): - origination_type = UNSET - else: - origination_type = OriginationType(_origination_type) - - parent_ord_id = d.pop("parentOrdId", UNSET) - - _position_effect = d.pop("positionEffect", UNSET) - position_effect: Unset | PositionEffect - if isinstance(_position_effect, Unset): - position_effect = UNSET - else: - position_effect = PositionEffect(_position_effect) - - price = d.pop("price", UNSET) - - _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType - if isinstance(_price_type, Unset): - price_type = UNSET - else: - price_type = PriceType(_price_type) - - qty = d.pop("qty", UNSET) - - route = d.pop("route", UNSET) - - _security = d.pop("security", UNSET) - security: Unset | Security - if isinstance(_security, Unset): - security = UNSET - else: - security = Security.from_dict(_security) - - _side = d.pop("side", UNSET) - side: Unset | Side - if isinstance(_side, Unset): - side = UNSET - else: - side = Side(_side) - - source = d.pop("source", UNSET) - - source_address = d.pop("sourceAddress", UNSET) - - submit_ts = d.pop("submitTs", UNSET) - - symbol = d.pop("symbol", UNSET) - - tag = d.pop("tag", UNSET) - - text = d.pop("text", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) - - trader_id = d.pop("traderId", UNSET) - - user_id = d.pop("userId", UNSET) - - _ord_status = d.pop("ordStatus", UNSET) - ord_status: Unset | OrdStatus - if isinstance(_ord_status, Unset): - ord_status = UNSET - else: - ord_status = OrdStatus(_ord_status) - - avg_price = d.pop("avgPrice", UNSET) - - claimed_by = d.pop("claimedBy", UNSET) - - last_price = d.pop("lastPrice", UNSET) - - last_qty = d.pop("lastQty", UNSET) - - last_market = d.pop("lastMarket", UNSET) - - leaves_qty = d.pop("leavesQty", UNSET) - - cum_qty = d.pop("cumQty", UNSET) - - transact_ts = d.pop("transactTs", UNSET) - - working_qty = d.pop("workingQty", UNSET) - - has_busts = d.pop("hasBusts", UNSET) - - has_corrects = d.pop("hasCorrects", UNSET) - - has_notes = d.pop("hasNotes", UNSET) - - order = cls( - account_id=account_id, - algo=algo, - aux_price=aux_price, - clearing_info=clearing_info, - cur_ord_id=cur_ord_id, - header=header, - id=id, - incoming_cl_ord_id=incoming_cl_ord_id, - incoming_ord_id=incoming_ord_id, - instructions=instructions, - market_condition=market_condition, - optional_data=optional_data, - order_flags=order_flags, - order_updates=order_updates, - ord_type=ord_type, - origination_type=origination_type, - parent_ord_id=parent_ord_id, - position_effect=position_effect, - price=price, - price_type=price_type, - qty=qty, - route=route, - security=security, - side=side, - source=source, - source_address=source_address, - submit_ts=submit_ts, - symbol=symbol, - tag=tag, - text=text, - tif=tif, - trader_id=trader_id, - user_id=user_id, - ord_status=ord_status, - avg_price=avg_price, - claimed_by=claimed_by, - last_price=last_price, - last_qty=last_qty, - last_market=last_market, - leaves_qty=leaves_qty, - cum_qty=cum_qty, - transact_ts=transact_ts, - working_qty=working_qty, - has_busts=has_busts, - has_corrects=has_corrects, - has_notes=has_notes, - ) - - return order diff --git a/openapi/openapi_project/openapi_package/models/order_algo.py b/openapi/openapi_project/openapi_package/models/order_algo.py deleted file mode 100644 index 8ac958125..000000000 --- a/openapi/openapi_project/openapi_package/models/order_algo.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="OrderAlgo") - - -@_attrs_define -class OrderAlgo: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_algo = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_algo.additional_properties = additional_properties - return order_algo - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/order_cancel_reject.py b/openapi/openapi_project/openapi_package/models/order_cancel_reject.py deleted file mode 100644 index 5daec3f44..000000000 --- a/openapi/openapi_project/openapi_package/models/order_cancel_reject.py +++ /dev/null @@ -1,186 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.cxl_rej_response_to import CxlRejResponseTo -from openapi_project.openapi_package.models.ord_status import OrdStatus -from openapi_project.openapi_package.models.origination_type import OriginationType -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_cancel_reject_optional_data import OrderCancelRejectOptionalData - - -T = TypeVar("T", bound="OrderCancelReject") - - -@_attrs_define -class OrderCancelReject: - """ - Attributes: - cur_ord_id (Union[Unset, str]): - incoming_cl_ord_id (Union[Unset, str]): - incoming_orig_cl_ord_id (Union[Unset, str]): - ord_status (Union[Unset, OrdStatus]): - optional_data (Union[Unset, OrderCancelRejectOptionalData]): - origination_type (Union[Unset, OriginationType]): - perm_ord_id (Union[Unset, str]): - req_ord_id (Union[Unset, str]): - source (Union[Unset, str]): - text (Union[Unset, str]): - trader_id (Union[Unset, str]): - transact_ts (Union[Unset, str]): - cxl_rej_response_to (Union[Unset, CxlRejResponseTo]): - """ - - cur_ord_id: Unset | str = UNSET - incoming_cl_ord_id: Unset | str = UNSET - incoming_orig_cl_ord_id: Unset | str = UNSET - ord_status: Unset | OrdStatus = UNSET - optional_data: Union[Unset, "OrderCancelRejectOptionalData"] = UNSET - origination_type: Unset | OriginationType = UNSET - perm_ord_id: Unset | str = UNSET - req_ord_id: Unset | str = UNSET - source: Unset | str = UNSET - text: Unset | str = UNSET - trader_id: Unset | str = UNSET - transact_ts: Unset | str = UNSET - cxl_rej_response_to: Unset | CxlRejResponseTo = UNSET - - def to_dict(self) -> dict[str, Any]: - cur_ord_id = self.cur_ord_id - - incoming_cl_ord_id = self.incoming_cl_ord_id - - incoming_orig_cl_ord_id = self.incoming_orig_cl_ord_id - - ord_status: Unset | str = UNSET - if not isinstance(self.ord_status, Unset): - ord_status = self.ord_status.value - - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() - - origination_type: Unset | str = UNSET - if not isinstance(self.origination_type, Unset): - origination_type = self.origination_type.value - - perm_ord_id = self.perm_ord_id - - req_ord_id = self.req_ord_id - - source = self.source - - text = self.text - - trader_id = self.trader_id - - transact_ts = self.transact_ts - - cxl_rej_response_to: Unset | str = UNSET - if not isinstance(self.cxl_rej_response_to, Unset): - cxl_rej_response_to = self.cxl_rej_response_to.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if incoming_cl_ord_id is not UNSET: - field_dict["incomingClOrdId"] = incoming_cl_ord_id - if incoming_orig_cl_ord_id is not UNSET: - field_dict["incomingOrigClOrdId"] = incoming_orig_cl_ord_id - if ord_status is not UNSET: - field_dict["ordStatus"] = ord_status - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if origination_type is not UNSET: - field_dict["originationType"] = origination_type - if perm_ord_id is not UNSET: - field_dict["permOrdId"] = perm_ord_id - if req_ord_id is not UNSET: - field_dict["reqOrdId"] = req_ord_id - if source is not UNSET: - field_dict["source"] = source - if text is not UNSET: - field_dict["text"] = text - if trader_id is not UNSET: - field_dict["traderId"] = trader_id - if transact_ts is not UNSET: - field_dict["transactTs"] = transact_ts - if cxl_rej_response_to is not UNSET: - field_dict["cxlRejResponseTo"] = cxl_rej_response_to - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.order_cancel_reject_optional_data import OrderCancelRejectOptionalData, - - - d = dict(src_dict) - cur_ord_id = d.pop("curOrdId", UNSET) - - incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) - - incoming_orig_cl_ord_id = d.pop("incomingOrigClOrdId", UNSET) - - _ord_status = d.pop("ordStatus", UNSET) - ord_status: Unset | OrdStatus - if isinstance(_ord_status, Unset): - ord_status = UNSET - else: - ord_status = OrdStatus(_ord_status) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | OrderCancelRejectOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = OrderCancelRejectOptionalData.from_dict(_optional_data) - - _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType - if isinstance(_origination_type, Unset): - origination_type = UNSET - else: - origination_type = OriginationType(_origination_type) - - perm_ord_id = d.pop("permOrdId", UNSET) - - req_ord_id = d.pop("reqOrdId", UNSET) - - source = d.pop("source", UNSET) - - text = d.pop("text", UNSET) - - trader_id = d.pop("traderId", UNSET) - - transact_ts = d.pop("transactTs", UNSET) - - _cxl_rej_response_to = d.pop("cxlRejResponseTo", UNSET) - cxl_rej_response_to: Unset | CxlRejResponseTo - if isinstance(_cxl_rej_response_to, Unset): - cxl_rej_response_to = UNSET - else: - cxl_rej_response_to = CxlRejResponseTo(_cxl_rej_response_to) - - order_cancel_reject = cls( - cur_ord_id=cur_ord_id, - incoming_cl_ord_id=incoming_cl_ord_id, - incoming_orig_cl_ord_id=incoming_orig_cl_ord_id, - ord_status=ord_status, - optional_data=optional_data, - origination_type=origination_type, - perm_ord_id=perm_ord_id, - req_ord_id=req_ord_id, - source=source, - text=text, - trader_id=trader_id, - transact_ts=transact_ts, - cxl_rej_response_to=cxl_rej_response_to, - ) - - return order_cancel_reject diff --git a/openapi/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py b/openapi/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py deleted file mode 100644 index 5f78e4407..000000000 --- a/openapi/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="OrderCancelRejectOptionalData") - - -@_attrs_define -class OrderCancelRejectOptionalData: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_cancel_reject_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_cancel_reject_optional_data.additional_properties = additional_properties - return order_cancel_reject_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/order_cancel_replace_request.py b/openapi/openapi_project/openapi_package/models/order_cancel_replace_request.py deleted file mode 100644 index a90c700a7..000000000 --- a/openapi/openapi_project/openapi_package/models/order_cancel_replace_request.py +++ /dev/null @@ -1,348 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.origination_type import OriginationType -from openapi_project.openapi_package.models.price_type import PriceType -from openapi_project.openapi_package.models.side import Side -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.header import Header - from openapi_project.openapi_package.models.order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo - from openapi_project.openapi_package.models.order_cancel_replace_request_market_condition import OrderCancelReplaceRequestMarketCondition, - - from openapi_project.openapi_package.models.order_cancel_replace_request_optional_data import OrderCancelReplaceRequestOptionalData, - - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - -T = TypeVar("T", bound="OrderCancelReplaceRequest") - - -@_attrs_define -class OrderCancelReplaceRequest: - """ - Attributes: - algo (Union[Unset, OrderCancelReplaceRequestAlgo]): - aux_price (Union[Unset, float]): - clearing_info (Union[Unset, ClearingInfo]): - cur_ord_id (Union[Unset, str]): - header (Union[Unset, Header]): - incoming_cl_ord_id (Union[Unset, str]): - incoming_orig_cl_ord_id (Union[Unset, str]): - instructions (Union[Unset, list['OrderInstruction']]): - optional_data (Union[Unset, OrderCancelReplaceRequestOptionalData]): - market_condition (Union[Unset, OrderCancelReplaceRequestMarketCondition]): - ord_type (Union[Unset, OrdType]): - origination_type (Union[Unset, OriginationType]): - perm_ord_id (Union[Unset, str]): - price (Union[Unset, float]): - price_type (Union[Unset, PriceType]): - qty (Union[Unset, float]): - req_ord_id (Union[Unset, str]): - side (Union[Unset, Side]): - source (Union[Unset, str]): - submit_ts (Union[Unset, str]): - tif (Union[Unset, Tif]): - trader_id (Union[Unset, str]): - user_id (Union[Unset, int]): - """ - - algo: Union[Unset, "OrderCancelReplaceRequestAlgo"] = UNSET - aux_price: Unset | float = UNSET - clearing_info: Union[Unset, "ClearingInfo"] = UNSET - cur_ord_id: Unset | str = UNSET - header: Union[Unset, "Header"] = UNSET - incoming_cl_ord_id: Unset | str = UNSET - incoming_orig_cl_ord_id: Unset | str = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - optional_data: Union[Unset, "OrderCancelReplaceRequestOptionalData"] = UNSET - market_condition: Union[Unset, "OrderCancelReplaceRequestMarketCondition"] = UNSET - ord_type: Unset | OrdType = UNSET - origination_type: Unset | OriginationType = UNSET - perm_ord_id: Unset | str = UNSET - price: Unset | float = UNSET - price_type: Unset | PriceType = UNSET - qty: Unset | float = UNSET - req_ord_id: Unset | str = UNSET - side: Unset | Side = UNSET - source: Unset | str = UNSET - submit_ts: Unset | str = UNSET - tif: Unset | Tif = UNSET - trader_id: Unset | str = UNSET - user_id: Unset | int = UNSET - - def to_dict(self) -> dict[str, Any]: - algo: Unset | dict[str, Any] = UNSET - if not isinstance(self.algo, Unset): - algo = self.algo.to_dict() - - aux_price = self.aux_price - - clearing_info: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_info, Unset): - clearing_info = self.clearing_info.to_dict() - - cur_ord_id = self.cur_ord_id - - header: Unset | dict[str, Any] = UNSET - if not isinstance(self.header, Unset): - header = self.header.to_dict() - - incoming_cl_ord_id = self.incoming_cl_ord_id - - incoming_orig_cl_ord_id = self.incoming_orig_cl_ord_id - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() - - market_condition: Unset | dict[str, Any] = UNSET - if not isinstance(self.market_condition, Unset): - market_condition = self.market_condition.to_dict() - - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value - - origination_type: Unset | str = UNSET - if not isinstance(self.origination_type, Unset): - origination_type = self.origination_type.value - - perm_ord_id = self.perm_ord_id - - price = self.price - - price_type: Unset | str = UNSET - if not isinstance(self.price_type, Unset): - price_type = self.price_type.value - - qty = self.qty - - req_ord_id = self.req_ord_id - - side: Unset | str = UNSET - if not isinstance(self.side, Unset): - side = self.side.value - - source = self.source - - submit_ts = self.submit_ts - - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value - - trader_id = self.trader_id - - user_id = self.user_id - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if algo is not UNSET: - field_dict["algo"] = algo - if aux_price is not UNSET: - field_dict["auxPrice"] = aux_price - if clearing_info is not UNSET: - field_dict["clearingInfo"] = clearing_info - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if header is not UNSET: - field_dict["header"] = header - if incoming_cl_ord_id is not UNSET: - field_dict["incomingClOrdId"] = incoming_cl_ord_id - if incoming_orig_cl_ord_id is not UNSET: - field_dict["incomingOrigClOrdId"] = incoming_orig_cl_ord_id - if instructions is not UNSET: - field_dict["instructions"] = instructions - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if market_condition is not UNSET: - field_dict["marketCondition"] = market_condition - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if origination_type is not UNSET: - field_dict["originationType"] = origination_type - if perm_ord_id is not UNSET: - field_dict["permOrdId"] = perm_ord_id - if price is not UNSET: - field_dict["price"] = price - if price_type is not UNSET: - field_dict["priceType"] = price_type - if qty is not UNSET: - field_dict["qty"] = qty - if req_ord_id is not UNSET: - field_dict["reqOrdId"] = req_ord_id - if side is not UNSET: - field_dict["side"] = side - if source is not UNSET: - field_dict["source"] = source - if submit_ts is not UNSET: - field_dict["submitTs"] = submit_ts - if tif is not UNSET: - field_dict["tif"] = tif - if trader_id is not UNSET: - field_dict["traderId"] = trader_id - if user_id is not UNSET: - field_dict["userId"] = user_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.header import Header - from openapi_project.openapi_package.models.order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo, - - from openapi_project.openapi_package.models.order_cancel_replace_request_market_condition import OrderCancelReplaceRequestMarketCondition, - - from openapi_project.openapi_package.models.order_cancel_replace_request_optional_data import OrderCancelReplaceRequestOptionalData, - - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - d = dict(src_dict) - _algo = d.pop("algo", UNSET) - algo: Unset | OrderCancelReplaceRequestAlgo - if isinstance(_algo, Unset): - algo = UNSET - else: - algo = OrderCancelReplaceRequestAlgo.from_dict(_algo) - - aux_price = d.pop("auxPrice", UNSET) - - _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo - if isinstance(_clearing_info, Unset): - clearing_info = UNSET - else: - clearing_info = ClearingInfo.from_dict(_clearing_info) - - cur_ord_id = d.pop("curOrdId", UNSET) - - _header = d.pop("header", UNSET) - header: Unset | Header - if isinstance(_header, Unset): - header = UNSET - else: - header = Header.from_dict(_header) - - incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) - - incoming_orig_cl_ord_id = d.pop("incomingOrigClOrdId", UNSET) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | OrderCancelReplaceRequestOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = OrderCancelReplaceRequestOptionalData.from_dict( - _optional_data - ) - - _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | OrderCancelReplaceRequestMarketCondition - if isinstance(_market_condition, Unset): - market_condition = UNSET - else: - market_condition = OrderCancelReplaceRequestMarketCondition.from_dict( - _market_condition - ) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) - - _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType - if isinstance(_origination_type, Unset): - origination_type = UNSET - else: - origination_type = OriginationType(_origination_type) - - perm_ord_id = d.pop("permOrdId", UNSET) - - price = d.pop("price", UNSET) - - _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType - if isinstance(_price_type, Unset): - price_type = UNSET - else: - price_type = PriceType(_price_type) - - qty = d.pop("qty", UNSET) - - req_ord_id = d.pop("reqOrdId", UNSET) - - _side = d.pop("side", UNSET) - side: Unset | Side - if isinstance(_side, Unset): - side = UNSET - else: - side = Side(_side) - - source = d.pop("source", UNSET) - - submit_ts = d.pop("submitTs", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) - - trader_id = d.pop("traderId", UNSET) - - user_id = d.pop("userId", UNSET) - - order_cancel_replace_request = cls( - algo=algo, - aux_price=aux_price, - clearing_info=clearing_info, - cur_ord_id=cur_ord_id, - header=header, - incoming_cl_ord_id=incoming_cl_ord_id, - incoming_orig_cl_ord_id=incoming_orig_cl_ord_id, - instructions=instructions, - optional_data=optional_data, - market_condition=market_condition, - ord_type=ord_type, - origination_type=origination_type, - perm_ord_id=perm_ord_id, - price=price, - price_type=price_type, - qty=qty, - req_ord_id=req_ord_id, - side=side, - source=source, - submit_ts=submit_ts, - tif=tif, - trader_id=trader_id, - user_id=user_id, - ) - - return order_cancel_replace_request diff --git a/openapi/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py b/openapi/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py deleted file mode 100644 index 329b25687..000000000 --- a/openapi/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="OrderCancelReplaceRequestAlgo") - - -@_attrs_define -class OrderCancelReplaceRequestAlgo: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_cancel_replace_request_algo = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_cancel_replace_request_algo.additional_properties = additional_properties - return order_cancel_replace_request_algo - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py b/openapi/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py deleted file mode 100644 index cb67173fb..000000000 --- a/openapi/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="OrderCancelReplaceRequestMarketCondition") - - -@_attrs_define -class OrderCancelReplaceRequestMarketCondition: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_cancel_replace_request_market_condition = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_cancel_replace_request_market_condition.additional_properties = ( - additional_properties - ) - return order_cancel_replace_request_market_condition - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py b/openapi/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py deleted file mode 100644 index 4de205dad..000000000 --- a/openapi/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="OrderCancelReplaceRequestOptionalData") - - -@_attrs_define -class OrderCancelReplaceRequestOptionalData: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_cancel_replace_request_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_cancel_replace_request_optional_data.additional_properties = ( - additional_properties - ) - return order_cancel_replace_request_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/order_cancel_request.py b/openapi/openapi_project/openapi_package/models/order_cancel_request.py deleted file mode 100644 index c8be6aea2..000000000 --- a/openapi/openapi_project/openapi_package/models/order_cancel_request.py +++ /dev/null @@ -1,174 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.origination_type import OriginationType -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_cancel_request_optional_data import OrderCancelRequestOptionalData, - - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - -T = TypeVar("T", bound="OrderCancelRequest") - - -@_attrs_define -class OrderCancelRequest: - """ - Attributes: - cur_ord_id (Union[Unset, str]): - incoming_cl_ord_id (Union[Unset, str]): - incoming_orig_cl_ord_id (Union[Unset, str]): - instructions (Union[Unset, list['OrderInstruction']]): - optional_data (Union[Unset, OrderCancelRequestOptionalData]): - origination_type (Union[Unset, OriginationType]): - perm_ord_id (Union[Unset, str]): - req_ord_id (Union[Unset, str]): - source (Union[Unset, str]): - submit_ts (Union[Unset, str]): - trader_id (Union[Unset, str]): - user_id (Union[Unset, int]): - """ - - cur_ord_id: Unset | str = UNSET - incoming_cl_ord_id: Unset | str = UNSET - incoming_orig_cl_ord_id: Unset | str = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - optional_data: Union[Unset, "OrderCancelRequestOptionalData"] = UNSET - origination_type: Unset | OriginationType = UNSET - perm_ord_id: Unset | str = UNSET - req_ord_id: Unset | str = UNSET - source: Unset | str = UNSET - submit_ts: Unset | str = UNSET - trader_id: Unset | str = UNSET - user_id: Unset | int = UNSET - - def to_dict(self) -> dict[str, Any]: - cur_ord_id = self.cur_ord_id - - incoming_cl_ord_id = self.incoming_cl_ord_id - - incoming_orig_cl_ord_id = self.incoming_orig_cl_ord_id - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() - - origination_type: Unset | str = UNSET - if not isinstance(self.origination_type, Unset): - origination_type = self.origination_type.value - - perm_ord_id = self.perm_ord_id - - req_ord_id = self.req_ord_id - - source = self.source - - submit_ts = self.submit_ts - - trader_id = self.trader_id - - user_id = self.user_id - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if incoming_cl_ord_id is not UNSET: - field_dict["incomingClOrdId"] = incoming_cl_ord_id - if incoming_orig_cl_ord_id is not UNSET: - field_dict["incomingOrigClOrdId"] = incoming_orig_cl_ord_id - if instructions is not UNSET: - field_dict["instructions"] = instructions - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if origination_type is not UNSET: - field_dict["originationType"] = origination_type - if perm_ord_id is not UNSET: - field_dict["permOrdId"] = perm_ord_id - if req_ord_id is not UNSET: - field_dict["reqOrdId"] = req_ord_id - if source is not UNSET: - field_dict["source"] = source - if submit_ts is not UNSET: - field_dict["submitTs"] = submit_ts - if trader_id is not UNSET: - field_dict["traderId"] = trader_id - if user_id is not UNSET: - field_dict["userId"] = user_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.order_cancel_request_optional_data import OrderCancelRequestOptionalData, - - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - d = dict(src_dict) - cur_ord_id = d.pop("curOrdId", UNSET) - - incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) - - incoming_orig_cl_ord_id = d.pop("incomingOrigClOrdId", UNSET) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | OrderCancelRequestOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = OrderCancelRequestOptionalData.from_dict(_optional_data) - - _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType - if isinstance(_origination_type, Unset): - origination_type = UNSET - else: - origination_type = OriginationType(_origination_type) - - perm_ord_id = d.pop("permOrdId", UNSET) - - req_ord_id = d.pop("reqOrdId", UNSET) - - source = d.pop("source", UNSET) - - submit_ts = d.pop("submitTs", UNSET) - - trader_id = d.pop("traderId", UNSET) - - user_id = d.pop("userId", UNSET) - - order_cancel_request = cls( - cur_ord_id=cur_ord_id, - incoming_cl_ord_id=incoming_cl_ord_id, - incoming_orig_cl_ord_id=incoming_orig_cl_ord_id, - instructions=instructions, - optional_data=optional_data, - origination_type=origination_type, - perm_ord_id=perm_ord_id, - req_ord_id=req_ord_id, - source=source, - submit_ts=submit_ts, - trader_id=trader_id, - user_id=user_id, - ) - - return order_cancel_request diff --git a/openapi/openapi_project/openapi_package/models/order_cancel_request_optional_data.py b/openapi/openapi_project/openapi_package/models/order_cancel_request_optional_data.py deleted file mode 100644 index 5e5f76c73..000000000 --- a/openapi/openapi_project/openapi_package/models/order_cancel_request_optional_data.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="OrderCancelRequestOptionalData") - - -@_attrs_define -class OrderCancelRequestOptionalData: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_cancel_request_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_cancel_request_optional_data.additional_properties = additional_properties - return order_cancel_request_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/order_cross.py b/openapi/openapi_project/openapi_package/models/order_cross.py deleted file mode 100644 index c61fdb2ac..000000000 --- a/openapi/openapi_project/openapi_package/models/order_cross.py +++ /dev/null @@ -1,497 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.cross_type import CrossType -from openapi_project.openapi_package.models.ord_status import OrdStatus -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.origination_type import OriginationType -from openapi_project.openapi_package.models.price_type import PriceType -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.header import Header - from openapi_project.openapi_package.models.order_cross_algo import OrderCrossAlgo - from openapi_project.openapi_package.models.order_cross_allocation import OrderCrossAllocation - from openapi_project.openapi_package.models.order_cross_market_condition import OrderCrossMarketCondition - from openapi_project.openapi_package.models.order_cross_optional_data import OrderCrossOptionalData - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent - from openapi_project.openapi_package.models.security import Security - - -T = TypeVar("T", bound="OrderCross") - - -@_attrs_define -class OrderCross: - """ - Attributes: - account_id (Union[Unset, int]): - algo (Union[Unset, OrderCrossAlgo]): - allocations (Union[Unset, list['OrderCrossAllocation']]): - cross_type (Union[Unset, CrossType]): - cur_ord_id (Union[Unset, str]): - header (Union[Unset, Header]): - id (Union[Unset, str]): - incoming_cl_ord_id (Union[Unset, str]): - incoming_ord_id (Union[Unset, str]): - instructions (Union[Unset, list['OrderInstruction']]): - market_condition (Union[Unset, OrderCrossMarketCondition]): - optional_data (Union[Unset, OrderCrossOptionalData]): - order_flags (Union[Unset, int]): - order_updates (Union[Unset, list['OrderUpdateEvent']]): - ord_type (Union[Unset, OrdType]): - origination_type (Union[Unset, OriginationType]): - parent_ord_id (Union[Unset, str]): - price (Union[Unset, float]): - price_type (Union[Unset, PriceType]): - qty (Union[Unset, float]): - route (Union[Unset, str]): - security (Union[Unset, Security]): - source (Union[Unset, str]): - source_address (Union[Unset, str]): - submit_ts (Union[Unset, str]): - symbol (Union[Unset, str]): - tag (Union[Unset, str]): - text (Union[Unset, str]): - tif (Union[Unset, Tif]): - user_id (Union[Unset, int]): - trader_id (Union[Unset, str]): - ord_status (Union[Unset, OrdStatus]): - claimed_by (Union[Unset, str]): - transact_ts (Union[Unset, str]): - has_busts (Union[Unset, bool]): - has_corrects (Union[Unset, bool]): - has_notes (Union[Unset, bool]): - """ - - account_id: Unset | int = UNSET - algo: Union[Unset, "OrderCrossAlgo"] = UNSET - allocations: Unset | list["OrderCrossAllocation"] = UNSET - cross_type: Unset | CrossType = UNSET - cur_ord_id: Unset | str = UNSET - header: Union[Unset, "Header"] = UNSET - id: Unset | str = UNSET - incoming_cl_ord_id: Unset | str = UNSET - incoming_ord_id: Unset | str = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - market_condition: Union[Unset, "OrderCrossMarketCondition"] = UNSET - optional_data: Union[Unset, "OrderCrossOptionalData"] = UNSET - order_flags: Unset | int = UNSET - order_updates: Unset | list["OrderUpdateEvent"] = UNSET - ord_type: Unset | OrdType = UNSET - origination_type: Unset | OriginationType = UNSET - parent_ord_id: Unset | str = UNSET - price: Unset | float = UNSET - price_type: Unset | PriceType = UNSET - qty: Unset | float = UNSET - route: Unset | str = UNSET - security: Union[Unset, "Security"] = UNSET - source: Unset | str = UNSET - source_address: Unset | str = UNSET - submit_ts: Unset | str = UNSET - symbol: Unset | str = UNSET - tag: Unset | str = UNSET - text: Unset | str = UNSET - tif: Unset | Tif = UNSET - user_id: Unset | int = UNSET - trader_id: Unset | str = UNSET - ord_status: Unset | OrdStatus = UNSET - claimed_by: Unset | str = UNSET - transact_ts: Unset | str = UNSET - has_busts: Unset | bool = UNSET - has_corrects: Unset | bool = UNSET - has_notes: Unset | bool = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - algo: Unset | dict[str, Any] = UNSET - if not isinstance(self.algo, Unset): - algo = self.algo.to_dict() - - allocations: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.allocations, Unset): - allocations = [] - for allocations_item_data in self.allocations: - allocations_item = allocations_item_data.to_dict() - allocations.append(allocations_item) - - cross_type: Unset | str = UNSET - if not isinstance(self.cross_type, Unset): - cross_type = self.cross_type.value - - cur_ord_id = self.cur_ord_id - - header: Unset | dict[str, Any] = UNSET - if not isinstance(self.header, Unset): - header = self.header.to_dict() - - id = self.id - - incoming_cl_ord_id = self.incoming_cl_ord_id - - incoming_ord_id = self.incoming_ord_id - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - market_condition: Unset | dict[str, Any] = UNSET - if not isinstance(self.market_condition, Unset): - market_condition = self.market_condition.to_dict() - - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() - - order_flags = self.order_flags - - order_updates: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.order_updates, Unset): - order_updates = [] - for order_updates_item_data in self.order_updates: - order_updates_item = order_updates_item_data.to_dict() - order_updates.append(order_updates_item) - - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value - - origination_type: Unset | str = UNSET - if not isinstance(self.origination_type, Unset): - origination_type = self.origination_type.value - - parent_ord_id = self.parent_ord_id - - price = self.price - - price_type: Unset | str = UNSET - if not isinstance(self.price_type, Unset): - price_type = self.price_type.value - - qty = self.qty - - route = self.route - - security: Unset | dict[str, Any] = UNSET - if not isinstance(self.security, Unset): - security = self.security.to_dict() - - source = self.source - - source_address = self.source_address - - submit_ts = self.submit_ts - - symbol = self.symbol - - tag = self.tag - - text = self.text - - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value - - user_id = self.user_id - - trader_id = self.trader_id - - ord_status: Unset | str = UNSET - if not isinstance(self.ord_status, Unset): - ord_status = self.ord_status.value - - claimed_by = self.claimed_by - - transact_ts = self.transact_ts - - has_busts = self.has_busts - - has_corrects = self.has_corrects - - has_notes = self.has_notes - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if algo is not UNSET: - field_dict["algo"] = algo - if allocations is not UNSET: - field_dict["allocations"] = allocations - if cross_type is not UNSET: - field_dict["crossType"] = cross_type - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if header is not UNSET: - field_dict["header"] = header - if id is not UNSET: - field_dict["id"] = id - if incoming_cl_ord_id is not UNSET: - field_dict["incomingClOrdId"] = incoming_cl_ord_id - if incoming_ord_id is not UNSET: - field_dict["incomingOrdId"] = incoming_ord_id - if instructions is not UNSET: - field_dict["instructions"] = instructions - if market_condition is not UNSET: - field_dict["marketCondition"] = market_condition - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if order_flags is not UNSET: - field_dict["orderFlags"] = order_flags - if order_updates is not UNSET: - field_dict["orderUpdates"] = order_updates - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if origination_type is not UNSET: - field_dict["originationType"] = origination_type - if parent_ord_id is not UNSET: - field_dict["parentOrdId"] = parent_ord_id - if price is not UNSET: - field_dict["price"] = price - if price_type is not UNSET: - field_dict["priceType"] = price_type - if qty is not UNSET: - field_dict["qty"] = qty - if route is not UNSET: - field_dict["route"] = route - if security is not UNSET: - field_dict["security"] = security - if source is not UNSET: - field_dict["source"] = source - if source_address is not UNSET: - field_dict["sourceAddress"] = source_address - if submit_ts is not UNSET: - field_dict["submitTs"] = submit_ts - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tag is not UNSET: - field_dict["tag"] = tag - if text is not UNSET: - field_dict["text"] = text - if tif is not UNSET: - field_dict["tif"] = tif - if user_id is not UNSET: - field_dict["userId"] = user_id - if trader_id is not UNSET: - field_dict["traderId"] = trader_id - if ord_status is not UNSET: - field_dict["ordStatus"] = ord_status - if claimed_by is not UNSET: - field_dict["claimedBy"] = claimed_by - if transact_ts is not UNSET: - field_dict["transactTs"] = transact_ts - if has_busts is not UNSET: - field_dict["hasBusts"] = has_busts - if has_corrects is not UNSET: - field_dict["hasCorrects"] = has_corrects - if has_notes is not UNSET: - field_dict["hasNotes"] = has_notes - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.header import Header - from openapi_project.openapi_package.models.order_cross_algo import OrderCrossAlgo - from openapi_project.openapi_package.models.order_cross_allocation import OrderCrossAllocation - from openapi_project.openapi_package.models.order_cross_market_condition import OrderCrossMarketCondition - from openapi_project.openapi_package.models.order_cross_optional_data import OrderCrossOptionalData - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent - from openapi_project.openapi_package.models.security import Security - - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - _algo = d.pop("algo", UNSET) - algo: Unset | OrderCrossAlgo - if isinstance(_algo, Unset): - algo = UNSET - else: - algo = OrderCrossAlgo.from_dict(_algo) - - allocations = [] - _allocations = d.pop("allocations", UNSET) - for allocations_item_data in _allocations or []: - allocations_item = OrderCrossAllocation.from_dict(allocations_item_data) - - allocations.append(allocations_item) - - _cross_type = d.pop("crossType", UNSET) - cross_type: Unset | CrossType - if isinstance(_cross_type, Unset): - cross_type = UNSET - else: - cross_type = CrossType(_cross_type) - - cur_ord_id = d.pop("curOrdId", UNSET) - - _header = d.pop("header", UNSET) - header: Unset | Header - if isinstance(_header, Unset): - header = UNSET - else: - header = Header.from_dict(_header) - - id = d.pop("id", UNSET) - - incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) - - incoming_ord_id = d.pop("incomingOrdId", UNSET) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | OrderCrossMarketCondition - if isinstance(_market_condition, Unset): - market_condition = UNSET - else: - market_condition = OrderCrossMarketCondition.from_dict(_market_condition) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | OrderCrossOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = OrderCrossOptionalData.from_dict(_optional_data) - - order_flags = d.pop("orderFlags", UNSET) - - order_updates = [] - _order_updates = d.pop("orderUpdates", UNSET) - for order_updates_item_data in _order_updates or []: - order_updates_item = OrderUpdateEvent.from_dict(order_updates_item_data) - - order_updates.append(order_updates_item) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) - - _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType - if isinstance(_origination_type, Unset): - origination_type = UNSET - else: - origination_type = OriginationType(_origination_type) - - parent_ord_id = d.pop("parentOrdId", UNSET) - - price = d.pop("price", UNSET) - - _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType - if isinstance(_price_type, Unset): - price_type = UNSET - else: - price_type = PriceType(_price_type) - - qty = d.pop("qty", UNSET) - - route = d.pop("route", UNSET) - - _security = d.pop("security", UNSET) - security: Unset | Security - if isinstance(_security, Unset): - security = UNSET - else: - security = Security.from_dict(_security) - - source = d.pop("source", UNSET) - - source_address = d.pop("sourceAddress", UNSET) - - submit_ts = d.pop("submitTs", UNSET) - - symbol = d.pop("symbol", UNSET) - - tag = d.pop("tag", UNSET) - - text = d.pop("text", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) - - user_id = d.pop("userId", UNSET) - - trader_id = d.pop("traderId", UNSET) - - _ord_status = d.pop("ordStatus", UNSET) - ord_status: Unset | OrdStatus - if isinstance(_ord_status, Unset): - ord_status = UNSET - else: - ord_status = OrdStatus(_ord_status) - - claimed_by = d.pop("claimedBy", UNSET) - - transact_ts = d.pop("transactTs", UNSET) - - has_busts = d.pop("hasBusts", UNSET) - - has_corrects = d.pop("hasCorrects", UNSET) - - has_notes = d.pop("hasNotes", UNSET) - - order_cross = cls( - account_id=account_id, - algo=algo, - allocations=allocations, - cross_type=cross_type, - cur_ord_id=cur_ord_id, - header=header, - id=id, - incoming_cl_ord_id=incoming_cl_ord_id, - incoming_ord_id=incoming_ord_id, - instructions=instructions, - market_condition=market_condition, - optional_data=optional_data, - order_flags=order_flags, - order_updates=order_updates, - ord_type=ord_type, - origination_type=origination_type, - parent_ord_id=parent_ord_id, - price=price, - price_type=price_type, - qty=qty, - route=route, - security=security, - source=source, - source_address=source_address, - submit_ts=submit_ts, - symbol=symbol, - tag=tag, - text=text, - tif=tif, - user_id=user_id, - trader_id=trader_id, - ord_status=ord_status, - claimed_by=claimed_by, - transact_ts=transact_ts, - has_busts=has_busts, - has_corrects=has_corrects, - has_notes=has_notes, - ) - - return order_cross diff --git a/openapi/openapi_project/openapi_package/models/order_cross_algo.py b/openapi/openapi_project/openapi_package/models/order_cross_algo.py deleted file mode 100644 index f96dab4f9..000000000 --- a/openapi/openapi_project/openapi_package/models/order_cross_algo.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="OrderCrossAlgo") - - -@_attrs_define -class OrderCrossAlgo: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_cross_algo = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_cross_algo.additional_properties = additional_properties - return order_cross_algo - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/order_cross_allocation.py b/openapi/openapi_project/openapi_package/models/order_cross_allocation.py deleted file mode 100644 index 47544587b..000000000 --- a/openapi/openapi_project/openapi_package/models/order_cross_allocation.py +++ /dev/null @@ -1,261 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.cross_side_type import CrossSideType -from openapi_project.openapi_package.models.ord_status import OrdStatus -from openapi_project.openapi_package.models.position_effect import PositionEffect -from openapi_project.openapi_package.models.side import Side -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.order_cross_allocation_optional_data import OrderCrossAllocationOptionalData, - - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - -T = TypeVar("T", bound="OrderCrossAllocation") - - -@_attrs_define -class OrderCrossAllocation: - """ - Attributes: - account_id (Union[Unset, int]): - clearing_info (Union[Unset, ClearingInfo]): - id (Union[Unset, str]): - incoming_ord_id (Union[Unset, str]): - instructions (Union[Unset, list['OrderInstruction']]): - optional_data (Union[Unset, OrderCrossAllocationOptionalData]): - position_effect (Union[Unset, PositionEffect]): - qty (Union[Unset, float]): - side (Union[Unset, Side]): - side_type (Union[Unset, CrossSideType]): - avg_price (Union[Unset, float]): - last_price (Union[Unset, float]): - last_qty (Union[Unset, float]): - last_market (Union[Unset, str]): - leaves_qty (Union[Unset, float]): - cum_qty (Union[Unset, float]): - transact_ts (Union[Unset, str]): - ord_status (Union[Unset, OrdStatus]): - """ - - account_id: Unset | int = UNSET - clearing_info: Union[Unset, "ClearingInfo"] = UNSET - id: Unset | str = UNSET - incoming_ord_id: Unset | str = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - optional_data: Union[Unset, "OrderCrossAllocationOptionalData"] = UNSET - position_effect: Unset | PositionEffect = UNSET - qty: Unset | float = UNSET - side: Unset | Side = UNSET - side_type: Unset | CrossSideType = UNSET - avg_price: Unset | float = UNSET - last_price: Unset | float = UNSET - last_qty: Unset | float = UNSET - last_market: Unset | str = UNSET - leaves_qty: Unset | float = UNSET - cum_qty: Unset | float = UNSET - transact_ts: Unset | str = UNSET - ord_status: Unset | OrdStatus = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - clearing_info: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_info, Unset): - clearing_info = self.clearing_info.to_dict() - - id = self.id - - incoming_ord_id = self.incoming_ord_id - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() - - position_effect: Unset | str = UNSET - if not isinstance(self.position_effect, Unset): - position_effect = self.position_effect.value - - qty = self.qty - - side: Unset | str = UNSET - if not isinstance(self.side, Unset): - side = self.side.value - - side_type: Unset | str = UNSET - if not isinstance(self.side_type, Unset): - side_type = self.side_type.value - - avg_price = self.avg_price - - last_price = self.last_price - - last_qty = self.last_qty - - last_market = self.last_market - - leaves_qty = self.leaves_qty - - cum_qty = self.cum_qty - - transact_ts = self.transact_ts - - ord_status: Unset | str = UNSET - if not isinstance(self.ord_status, Unset): - ord_status = self.ord_status.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if clearing_info is not UNSET: - field_dict["clearingInfo"] = clearing_info - if id is not UNSET: - field_dict["id"] = id - if incoming_ord_id is not UNSET: - field_dict["incomingOrdId"] = incoming_ord_id - if instructions is not UNSET: - field_dict["instructions"] = instructions - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if position_effect is not UNSET: - field_dict["positionEffect"] = position_effect - if qty is not UNSET: - field_dict["qty"] = qty - if side is not UNSET: - field_dict["side"] = side - if side_type is not UNSET: - field_dict["sideType"] = side_type - if avg_price is not UNSET: - field_dict["avgPrice"] = avg_price - if last_price is not UNSET: - field_dict["lastPrice"] = last_price - if last_qty is not UNSET: - field_dict["lastQty"] = last_qty - if last_market is not UNSET: - field_dict["lastMarket"] = last_market - if leaves_qty is not UNSET: - field_dict["leavesQty"] = leaves_qty - if cum_qty is not UNSET: - field_dict["cumQty"] = cum_qty - if transact_ts is not UNSET: - field_dict["transactTs"] = transact_ts - if ord_status is not UNSET: - field_dict["ordStatus"] = ord_status - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.order_cross_allocation_optional_data import OrderCrossAllocationOptionalData, - - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo - if isinstance(_clearing_info, Unset): - clearing_info = UNSET - else: - clearing_info = ClearingInfo.from_dict(_clearing_info) - - id = d.pop("id", UNSET) - - incoming_ord_id = d.pop("incomingOrdId", UNSET) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | OrderCrossAllocationOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = OrderCrossAllocationOptionalData.from_dict(_optional_data) - - _position_effect = d.pop("positionEffect", UNSET) - position_effect: Unset | PositionEffect - if isinstance(_position_effect, Unset): - position_effect = UNSET - else: - position_effect = PositionEffect(_position_effect) - - qty = d.pop("qty", UNSET) - - _side = d.pop("side", UNSET) - side: Unset | Side - if isinstance(_side, Unset): - side = UNSET - else: - side = Side(_side) - - _side_type = d.pop("sideType", UNSET) - side_type: Unset | CrossSideType - if isinstance(_side_type, Unset): - side_type = UNSET - else: - side_type = CrossSideType(_side_type) - - avg_price = d.pop("avgPrice", UNSET) - - last_price = d.pop("lastPrice", UNSET) - - last_qty = d.pop("lastQty", UNSET) - - last_market = d.pop("lastMarket", UNSET) - - leaves_qty = d.pop("leavesQty", UNSET) - - cum_qty = d.pop("cumQty", UNSET) - - transact_ts = d.pop("transactTs", UNSET) - - _ord_status = d.pop("ordStatus", UNSET) - ord_status: Unset | OrdStatus - if isinstance(_ord_status, Unset): - ord_status = UNSET - else: - ord_status = OrdStatus(_ord_status) - - order_cross_allocation = cls( - account_id=account_id, - clearing_info=clearing_info, - id=id, - incoming_ord_id=incoming_ord_id, - instructions=instructions, - optional_data=optional_data, - position_effect=position_effect, - qty=qty, - side=side, - side_type=side_type, - avg_price=avg_price, - last_price=last_price, - last_qty=last_qty, - last_market=last_market, - leaves_qty=leaves_qty, - cum_qty=cum_qty, - transact_ts=transact_ts, - ord_status=ord_status, - ) - - return order_cross_allocation diff --git a/openapi/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py b/openapi/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py deleted file mode 100644 index e05a389f3..000000000 --- a/openapi/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py +++ /dev/null @@ -1,61 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="OrderCrossAllocationOptionalData") - - -@_attrs_define -class OrderCrossAllocationOptionalData: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_cross_allocation_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_cross_allocation_optional_data.additional_properties = ( - additional_properties - ) - return order_cross_allocation_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/order_cross_market_condition.py b/openapi/openapi_project/openapi_package/models/order_cross_market_condition.py deleted file mode 100644 index 09b5ab28a..000000000 --- a/openapi/openapi_project/openapi_package/models/order_cross_market_condition.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="OrderCrossMarketCondition") - - -@_attrs_define -class OrderCrossMarketCondition: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_cross_market_condition = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_cross_market_condition.additional_properties = additional_properties - return order_cross_market_condition - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/order_cross_optional_data.py b/openapi/openapi_project/openapi_package/models/order_cross_optional_data.py deleted file mode 100644 index c5a321b08..000000000 --- a/openapi/openapi_project/openapi_package/models/order_cross_optional_data.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="OrderCrossOptionalData") - - -@_attrs_define -class OrderCrossOptionalData: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_cross_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_cross_optional_data.additional_properties = additional_properties - return order_cross_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/order_delete.py b/openapi/openapi_project/openapi_package/models/order_delete.py deleted file mode 100644 index 62b89ce4e..000000000 --- a/openapi/openapi_project/openapi_package/models/order_delete.py +++ /dev/null @@ -1,106 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.origination_type import OriginationType -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_delete_optional_data import OrderDeleteOptionalData - - -T = TypeVar("T", bound="OrderDelete") - - -@_attrs_define -class OrderDelete: - """ - Attributes: - cur_ord_id (Union[Unset, str]): - optional_data (Union[Unset, OrderDeleteOptionalData]): - origination_type (Union[Unset, OriginationType]): - perm_ord_id (Union[Unset, str]): - trader_id (Union[Unset, str]): - submit_ts (Union[Unset, str]): - """ - - cur_ord_id: Unset | str = UNSET - optional_data: Union[Unset, "OrderDeleteOptionalData"] = UNSET - origination_type: Unset | OriginationType = UNSET - perm_ord_id: Unset | str = UNSET - trader_id: Unset | str = UNSET - submit_ts: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - cur_ord_id = self.cur_ord_id - - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() - - origination_type: Unset | str = UNSET - if not isinstance(self.origination_type, Unset): - origination_type = self.origination_type.value - - perm_ord_id = self.perm_ord_id - - trader_id = self.trader_id - - submit_ts = self.submit_ts - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if origination_type is not UNSET: - field_dict["originationType"] = origination_type - if perm_ord_id is not UNSET: - field_dict["permOrdId"] = perm_ord_id - if trader_id is not UNSET: - field_dict["traderId"] = trader_id - if submit_ts is not UNSET: - field_dict["submitTs"] = submit_ts - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.order_delete_optional_data import OrderDeleteOptionalData - - d = dict(src_dict) - cur_ord_id = d.pop("curOrdId", UNSET) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | OrderDeleteOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = OrderDeleteOptionalData.from_dict(_optional_data) - - _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType - if isinstance(_origination_type, Unset): - origination_type = UNSET - else: - origination_type = OriginationType(_origination_type) - - perm_ord_id = d.pop("permOrdId", UNSET) - - trader_id = d.pop("traderId", UNSET) - - submit_ts = d.pop("submitTs", UNSET) - - order_delete = cls( - cur_ord_id=cur_ord_id, - optional_data=optional_data, - origination_type=origination_type, - perm_ord_id=perm_ord_id, - trader_id=trader_id, - submit_ts=submit_ts, - ) - - return order_delete diff --git a/openapi/openapi_project/openapi_package/models/order_delete_optional_data.py b/openapi/openapi_project/openapi_package/models/order_delete_optional_data.py deleted file mode 100644 index 3448ed95a..000000000 --- a/openapi/openapi_project/openapi_package/models/order_delete_optional_data.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="OrderDeleteOptionalData") - - -@_attrs_define -class OrderDeleteOptionalData: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_delete_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_delete_optional_data.additional_properties = additional_properties - return order_delete_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/order_instruction.py b/openapi/openapi_project/openapi_package/models/order_instruction.py deleted file mode 100644 index ca3a086a4..000000000 --- a/openapi/openapi_project/openapi_package/models/order_instruction.py +++ /dev/null @@ -1,57 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.order_instruction_type import OrderInstructionType -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="OrderInstruction") - - -@_attrs_define -class OrderInstruction: - """ - Attributes: - type_ (Union[Unset, OrderInstructionType]): - value (Union[Unset, str]): - """ - - type_: Unset | OrderInstructionType = UNSET - value: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - type_: Unset | str = UNSET - if not isinstance(self.type_, Unset): - type_ = self.type_.value - - value = self.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if type_ is not UNSET: - field_dict["type"] = type_ - if value is not UNSET: - field_dict["value"] = value - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _type_ = d.pop("type", UNSET) - type_: Unset | OrderInstructionType - if isinstance(_type_, Unset): - type_ = UNSET - else: - type_ = OrderInstructionType(_type_) - - value = d.pop("value", UNSET) - - order_instruction = cls( - type_=type_, - value=value, - ) - - return order_instruction diff --git a/openapi/openapi_project/openapi_package/models/order_instruction_type.py b/openapi/openapi_project/openapi_package/models/order_instruction_type.py deleted file mode 100644 index 2dc45378a..000000000 --- a/openapi/openapi_project/openapi_package/models/order_instruction_type.py +++ /dev/null @@ -1,91 +0,0 @@ -from enum import Enum - - -class OrderInstructionType(str, Enum): - ORDER_INSTRUCTION_TYPE_ALL_OR_NONE = "ORDER_INSTRUCTION_TYPE_ALL_OR_NONE" - ORDER_INSTRUCTION_TYPE_AUCTION_ID = "ORDER_INSTRUCTION_TYPE_AUCTION_ID" - ORDER_INSTRUCTION_TYPE_AUTO_MATCH = "ORDER_INSTRUCTION_TYPE_AUTO_MATCH" - ORDER_INSTRUCTION_TYPE_AUTO_MATCH_PRICE = "ORDER_INSTRUCTION_TYPE_AUTO_MATCH_PRICE" - ORDER_INSTRUCTION_TYPE_BROKER_PERCENTAGE = ( - "ORDER_INSTRUCTION_TYPE_BROKER_PERCENTAGE" - ) - ORDER_INSTRUCTION_TYPE_CLIENT_ID = "ORDER_INSTRUCTION_TYPE_CLIENT_ID" - ORDER_INSTRUCTION_TYPE_COMMISSION = "ORDER_INSTRUCTION_TYPE_COMMISSION" - ORDER_INSTRUCTION_TYPE_COMPRESSION = "ORDER_INSTRUCTION_TYPE_COMPRESSION" - ORDER_INSTRUCTION_TYPE_CROSS_PRIORITIZATION = ( - "ORDER_INSTRUCTION_TYPE_CROSS_PRIORITIZATION" - ) - ORDER_INSTRUCTION_TYPE_DO_NOT_REDUCE = "ORDER_INSTRUCTION_TYPE_DO_NOT_REDUCE" - ORDER_INSTRUCTION_TYPE_DO_NOT_ROUTE = "ORDER_INSTRUCTION_TYPE_DO_NOT_ROUTE" - ORDER_INSTRUCTION_TYPE_DROP = "ORDER_INSTRUCTION_TYPE_DROP" - ORDER_INSTRUCTION_TYPE_EQUITY_BUY_CLEARING_FIRM = ( - "ORDER_INSTRUCTION_TYPE_EQUITY_BUY_CLEARING_FIRM" - ) - ORDER_INSTRUCTION_TYPE_EQUITY_EX_DESTINATION = ( - "ORDER_INSTRUCTION_TYPE_EQUITY_EX_DESTINATION" - ) - ORDER_INSTRUCTION_TYPE_EQUITY_PARTY_ID = "ORDER_INSTRUCTION_TYPE_EQUITY_PARTY_ID" - ORDER_INSTRUCTION_TYPE_EQUITY_SELL_CLEARING_FIRM = ( - "ORDER_INSTRUCTION_TYPE_EQUITY_SELL_CLEARING_FIRM" - ) - ORDER_INSTRUCTION_TYPE_EQUITY_TRADE_PRICE = ( - "ORDER_INSTRUCTION_TYPE_EQUITY_TRADE_PRICE" - ) - ORDER_INSTRUCTION_TYPE_EQUITY_TRADE_SIZE = ( - "ORDER_INSTRUCTION_TYPE_EQUITY_TRADE_SIZE" - ) - ORDER_INSTRUCTION_TYPE_EQUITY_TRADE_VENUE = ( - "ORDER_INSTRUCTION_TYPE_EQUITY_TRADE_VENUE" - ) - ORDER_INSTRUCTION_TYPE_EQUITY_TRANSACT_TS = ( - "ORDER_INSTRUCTION_TYPE_EQUITY_TRANSACT_TS" - ) - ORDER_INSTRUCTION_TYPE_FLEX_AUCTION_DURATION = ( - "ORDER_INSTRUCTION_TYPE_FLEX_AUCTION_DURATION" - ) - ORDER_INSTRUCTION_TYPE_FLEX_HEDGE_EXEC_INST = ( - "ORDER_INSTRUCTION_TYPE_FLEX_HEDGE_EXEC_INST" - ) - ORDER_INSTRUCTION_TYPE_FLEX_PRE_FACIL_PRICE = ( - "ORDER_INSTRUCTION_TYPE_FLEX_PRE_FACIL_PRICE" - ) - ORDER_INSTRUCTION_TYPE_FREQUENT_TRADER = "ORDER_INSTRUCTION_TYPE_FREQUENT_TRADER" - ORDER_INSTRUCTION_TYPE_FREQUENT_TRADER_ID = ( - "ORDER_INSTRUCTION_TYPE_FREQUENT_TRADER_ID" - ) - ORDER_INSTRUCTION_TYPE_GOOD_TILL_DATE = "ORDER_INSTRUCTION_TYPE_GOOD_TILL_DATE" - ORDER_INSTRUCTION_TYPE_HELD = "ORDER_INSTRUCTION_TYPE_HELD" - ORDER_INSTRUCTION_TYPE_INTERMARKET_SWEEP = ( - "ORDER_INSTRUCTION_TYPE_INTERMARKET_SWEEP" - ) - ORDER_INSTRUCTION_TYPE_LAST_PRIORITY = "ORDER_INSTRUCTION_TYPE_LAST_PRIORITY" - ORDER_INSTRUCTION_TYPE_MAX_FLOOR = "ORDER_INSTRUCTION_TYPE_MAX_FLOOR" - ORDER_INSTRUCTION_TYPE_MIN_QTY = "ORDER_INSTRUCTION_TYPE_MIN_QTY" - ORDER_INSTRUCTION_TYPE_NONE = "ORDER_INSTRUCTION_TYPE_NONE" - ORDER_INSTRUCTION_TYPE_NOT_HELD = "ORDER_INSTRUCTION_TYPE_NOT_HELD" - ORDER_INSTRUCTION_TYPE_NO_COA = "ORDER_INSTRUCTION_TYPE_NO_COA" - ORDER_INSTRUCTION_TYPE_ORDER_ORIGIN = "ORDER_INSTRUCTION_TYPE_ORDER_ORIGIN" - ORDER_INSTRUCTION_TYPE_O_R_S = "ORDER_INSTRUCTION_TYPE_O_R_S" - ORDER_INSTRUCTION_TYPE_PEG_DIFFERENCE = "ORDER_INSTRUCTION_TYPE_PEG_DIFFERENCE" - ORDER_INSTRUCTION_TYPE_PEG_TYPE = "ORDER_INSTRUCTION_TYPE_PEG_TYPE" - ORDER_INSTRUCTION_TYPE_PHLX_QCC = "ORDER_INSTRUCTION_TYPE_PHLX_QCC" - ORDER_INSTRUCTION_TYPE_PREFERRED_M_M = "ORDER_INSTRUCTION_TYPE_PREFERRED_M_M" - ORDER_INSTRUCTION_TYPE_REPRESENT = "ORDER_INSTRUCTION_TYPE_REPRESENT" - ORDER_INSTRUCTION_TYPE_ROUTE_STRATEGY = "ORDER_INSTRUCTION_TYPE_ROUTE_STRATEGY" - ORDER_INSTRUCTION_TYPE_ROUTING_FIRM_ID = "ORDER_INSTRUCTION_TYPE_ROUTING_FIRM_ID" - ORDER_INSTRUCTION_TYPE_ROUTING_INST = "ORDER_INSTRUCTION_TYPE_ROUTING_INST" - ORDER_INSTRUCTION_TYPE_SESSION_ELIGIBILITY = ( - "ORDER_INSTRUCTION_TYPE_SESSION_ELIGIBILITY" - ) - ORDER_INSTRUCTION_TYPE_SETTLEMENT_LIQUIDITY = ( - "ORDER_INSTRUCTION_TYPE_SETTLEMENT_LIQUIDITY" - ) - ORDER_INSTRUCTION_TYPE_SOLICITED = "ORDER_INSTRUCTION_TYPE_SOLICITED" - ORDER_INSTRUCTION_TYPE_SPX_COMBO = "ORDER_INSTRUCTION_TYPE_SPX_COMBO" - ORDER_INSTRUCTION_TYPE_STEP_UP_PX = "ORDER_INSTRUCTION_TYPE_STEP_UP_PX" - ORDER_INSTRUCTION_TYPE_STRATEGY_ID = "ORDER_INSTRUCTION_TYPE_STRATEGY_ID" - ORDER_INSTRUCTION_TYPE_SWEEP = "ORDER_INSTRUCTION_TYPE_SWEEP" - ORDER_INSTRUCTION_TYPE_TIED_HEDGE = "ORDER_INSTRUCTION_TYPE_TIED_HEDGE" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/order_market_condition.py b/openapi/openapi_project/openapi_package/models/order_market_condition.py deleted file mode 100644 index 70aaf1ff9..000000000 --- a/openapi/openapi_project/openapi_package/models/order_market_condition.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="OrderMarketCondition") - - -@_attrs_define -class OrderMarketCondition: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_market_condition = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_market_condition.additional_properties = additional_properties - return order_market_condition - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/order_optional_data.py b/openapi/openapi_project/openapi_package/models/order_optional_data.py deleted file mode 100644 index 089a5f2b5..000000000 --- a/openapi/openapi_project/openapi_package/models/order_optional_data.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="OrderOptionalData") - - -@_attrs_define -class OrderOptionalData: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_optional_data.additional_properties = additional_properties - return order_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/order_type.py b/openapi/openapi_project/openapi_package/models/order_type.py deleted file mode 100644 index f59ced1fa..000000000 --- a/openapi/openapi_project/openapi_package/models/order_type.py +++ /dev/null @@ -1,12 +0,0 @@ -from enum import Enum - - -class OrderType(str, Enum): - ORDER_TYPE_MULTI_LEG_ORDER = "ORDER_TYPE_MULTI_LEG_ORDER" - ORDER_TYPE_MULTI_LEG_ORDER_CROSS = "ORDER_TYPE_MULTI_LEG_ORDER_CROSS" - ORDER_TYPE_ORDER = "ORDER_TYPE_ORDER" - ORDER_TYPE_ORDER_CROSS = "ORDER_TYPE_ORDER_CROSS" - ORDER_TYPE_UNKNOWN = "ORDER_TYPE_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/order_update.py b/openapi/openapi_project/openapi_package/models/order_update.py deleted file mode 100644 index 5bb1caa6a..000000000 --- a/openapi/openapi_project/openapi_package/models/order_update.py +++ /dev/null @@ -1,623 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.exec_type import ExecType -from openapi_project.openapi_package.models.multi_leg_reporting_type import MultiLegReportingType -from openapi_project.openapi_package.models.ord_status import OrdStatus -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.origination_type import OriginationType -from openapi_project.openapi_package.models.position_effect import PositionEffect -from openapi_project.openapi_package.models.price_type import PriceType -from openapi_project.openapi_package.models.side import Side -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.header import Header - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.order_update_algo import OrderUpdateAlgo - from openapi_project.openapi_package.models.order_update_optional_data import OrderUpdateOptionalData - from openapi_project.openapi_package.models.security import Security - - -T = TypeVar("T", bound="OrderUpdate") - - -@_attrs_define -class OrderUpdate: - """ - Attributes: - account_id (Union[Unset, int]): - algo (Union[Unset, OrderUpdateAlgo]): - alloc_id (Union[Unset, str]): - aux_price (Union[Unset, float]): - avg_price (Union[Unset, float]): - clearing_info (Union[Unset, ClearingInfo]): - commission (Union[Unset, float]): - cum_qty (Union[Unset, float]): - cur_ord_id (Union[Unset, str]): - exec_broker (Union[Unset, str]): - exec_id (Union[Unset, str]): - exec_ref_id (Union[Unset, str]): - exec_type (Union[Unset, ExecType]): - fee1 (Union[Unset, float]): - fee2 (Union[Unset, float]): - header (Union[Unset, Header]): - incoming_cl_ord_id (Union[Unset, str]): - incoming_ord_id (Union[Unset, str]): - incoming_orig_cl_ord_id (Union[Unset, str]): - instructions (Union[Unset, list['OrderInstruction']]): - last_market (Union[Unset, str]): - last_price (Union[Unset, float]): - last_qty (Union[Unset, float]): - leaves_qty (Union[Unset, float]): - leg_id (Union[Unset, str]): - liquidity_flag (Union[Unset, str]): - multi_leg_reporting_type (Union[Unset, MultiLegReportingType]): - notes (Union[Unset, str]): - optional_data (Union[Unset, OrderUpdateOptionalData]): - order_flags (Union[Unset, int]): - ord_status (Union[Unset, OrdStatus]): - ord_type (Union[Unset, OrdType]): - origination_type (Union[Unset, OriginationType]): - orig_ord_id (Union[Unset, str]): - parent_ord_id (Union[Unset, str]): - perm_ord_id (Union[Unset, str]): - position_effect (Union[Unset, PositionEffect]): - price (Union[Unset, float]): - price_type (Union[Unset, PriceType]): - qty (Union[Unset, float]): - route (Union[Unset, str]): - security (Union[Unset, Security]): - side (Union[Unset, Side]): - source (Union[Unset, str]): - symbol (Union[Unset, str]): - tag (Union[Unset, str]): - text (Union[Unset, str]): - tif (Union[Unset, Tif]): - trader_id (Union[Unset, str]): - transact_ts (Union[Unset, str]): - working_qty (Union[Unset, float]): - """ - - account_id: Unset | int = UNSET - algo: Union[Unset, "OrderUpdateAlgo"] = UNSET - alloc_id: Unset | str = UNSET - aux_price: Unset | float = UNSET - avg_price: Unset | float = UNSET - clearing_info: Union[Unset, "ClearingInfo"] = UNSET - commission: Unset | float = UNSET - cum_qty: Unset | float = UNSET - cur_ord_id: Unset | str = UNSET - exec_broker: Unset | str = UNSET - exec_id: Unset | str = UNSET - exec_ref_id: Unset | str = UNSET - exec_type: Unset | ExecType = UNSET - fee1: Unset | float = UNSET - fee2: Unset | float = UNSET - header: Union[Unset, "Header"] = UNSET - incoming_cl_ord_id: Unset | str = UNSET - incoming_ord_id: Unset | str = UNSET - incoming_orig_cl_ord_id: Unset | str = UNSET - instructions: Unset | list["OrderInstruction"] = UNSET - last_market: Unset | str = UNSET - last_price: Unset | float = UNSET - last_qty: Unset | float = UNSET - leaves_qty: Unset | float = UNSET - leg_id: Unset | str = UNSET - liquidity_flag: Unset | str = UNSET - multi_leg_reporting_type: Unset | MultiLegReportingType = UNSET - notes: Unset | str = UNSET - optional_data: Union[Unset, "OrderUpdateOptionalData"] = UNSET - order_flags: Unset | int = UNSET - ord_status: Unset | OrdStatus = UNSET - ord_type: Unset | OrdType = UNSET - origination_type: Unset | OriginationType = UNSET - orig_ord_id: Unset | str = UNSET - parent_ord_id: Unset | str = UNSET - perm_ord_id: Unset | str = UNSET - position_effect: Unset | PositionEffect = UNSET - price: Unset | float = UNSET - price_type: Unset | PriceType = UNSET - qty: Unset | float = UNSET - route: Unset | str = UNSET - security: Union[Unset, "Security"] = UNSET - side: Unset | Side = UNSET - source: Unset | str = UNSET - symbol: Unset | str = UNSET - tag: Unset | str = UNSET - text: Unset | str = UNSET - tif: Unset | Tif = UNSET - trader_id: Unset | str = UNSET - transact_ts: Unset | str = UNSET - working_qty: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - algo: Unset | dict[str, Any] = UNSET - if not isinstance(self.algo, Unset): - algo = self.algo.to_dict() - - alloc_id = self.alloc_id - - aux_price = self.aux_price - - avg_price = self.avg_price - - clearing_info: Unset | dict[str, Any] = UNSET - if not isinstance(self.clearing_info, Unset): - clearing_info = self.clearing_info.to_dict() - - commission = self.commission - - cum_qty = self.cum_qty - - cur_ord_id = self.cur_ord_id - - exec_broker = self.exec_broker - - exec_id = self.exec_id - - exec_ref_id = self.exec_ref_id - - exec_type: Unset | str = UNSET - if not isinstance(self.exec_type, Unset): - exec_type = self.exec_type.value - - fee1 = self.fee1 - - fee2 = self.fee2 - - header: Unset | dict[str, Any] = UNSET - if not isinstance(self.header, Unset): - header = self.header.to_dict() - - incoming_cl_ord_id = self.incoming_cl_ord_id - - incoming_ord_id = self.incoming_ord_id - - incoming_orig_cl_ord_id = self.incoming_orig_cl_ord_id - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - last_market = self.last_market - - last_price = self.last_price - - last_qty = self.last_qty - - leaves_qty = self.leaves_qty - - leg_id = self.leg_id - - liquidity_flag = self.liquidity_flag - - multi_leg_reporting_type: Unset | str = UNSET - if not isinstance(self.multi_leg_reporting_type, Unset): - multi_leg_reporting_type = self.multi_leg_reporting_type.value - - notes = self.notes - - optional_data: Unset | dict[str, Any] = UNSET - if not isinstance(self.optional_data, Unset): - optional_data = self.optional_data.to_dict() - - order_flags = self.order_flags - - ord_status: Unset | str = UNSET - if not isinstance(self.ord_status, Unset): - ord_status = self.ord_status.value - - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value - - origination_type: Unset | str = UNSET - if not isinstance(self.origination_type, Unset): - origination_type = self.origination_type.value - - orig_ord_id = self.orig_ord_id - - parent_ord_id = self.parent_ord_id - - perm_ord_id = self.perm_ord_id - - position_effect: Unset | str = UNSET - if not isinstance(self.position_effect, Unset): - position_effect = self.position_effect.value - - price = self.price - - price_type: Unset | str = UNSET - if not isinstance(self.price_type, Unset): - price_type = self.price_type.value - - qty = self.qty - - route = self.route - - security: Unset | dict[str, Any] = UNSET - if not isinstance(self.security, Unset): - security = self.security.to_dict() - - side: Unset | str = UNSET - if not isinstance(self.side, Unset): - side = self.side.value - - source = self.source - - symbol = self.symbol - - tag = self.tag - - text = self.text - - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value - - trader_id = self.trader_id - - transact_ts = self.transact_ts - - working_qty = self.working_qty - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if algo is not UNSET: - field_dict["Algo"] = algo - if alloc_id is not UNSET: - field_dict["allocId"] = alloc_id - if aux_price is not UNSET: - field_dict["auxPrice"] = aux_price - if avg_price is not UNSET: - field_dict["avgPrice"] = avg_price - if clearing_info is not UNSET: - field_dict["clearingInfo"] = clearing_info - if commission is not UNSET: - field_dict["commission"] = commission - if cum_qty is not UNSET: - field_dict["cumQty"] = cum_qty - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if exec_broker is not UNSET: - field_dict["execBroker"] = exec_broker - if exec_id is not UNSET: - field_dict["execId"] = exec_id - if exec_ref_id is not UNSET: - field_dict["execRefId"] = exec_ref_id - if exec_type is not UNSET: - field_dict["execType"] = exec_type - if fee1 is not UNSET: - field_dict["fee1"] = fee1 - if fee2 is not UNSET: - field_dict["fee2"] = fee2 - if header is not UNSET: - field_dict["header"] = header - if incoming_cl_ord_id is not UNSET: - field_dict["incomingClOrdId"] = incoming_cl_ord_id - if incoming_ord_id is not UNSET: - field_dict["incomingOrdId"] = incoming_ord_id - if incoming_orig_cl_ord_id is not UNSET: - field_dict["incomingOrigClOrdId"] = incoming_orig_cl_ord_id - if instructions is not UNSET: - field_dict["instructions"] = instructions - if last_market is not UNSET: - field_dict["lastMarket"] = last_market - if last_price is not UNSET: - field_dict["lastPrice"] = last_price - if last_qty is not UNSET: - field_dict["lastQty"] = last_qty - if leaves_qty is not UNSET: - field_dict["leavesQty"] = leaves_qty - if leg_id is not UNSET: - field_dict["legId"] = leg_id - if liquidity_flag is not UNSET: - field_dict["liquidityFlag"] = liquidity_flag - if multi_leg_reporting_type is not UNSET: - field_dict["multiLegReportingType"] = multi_leg_reporting_type - if notes is not UNSET: - field_dict["Notes"] = notes - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if order_flags is not UNSET: - field_dict["orderFlags"] = order_flags - if ord_status is not UNSET: - field_dict["ordStatus"] = ord_status - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if origination_type is not UNSET: - field_dict["originationType"] = origination_type - if orig_ord_id is not UNSET: - field_dict["origOrdId"] = orig_ord_id - if parent_ord_id is not UNSET: - field_dict["parentOrdId"] = parent_ord_id - if perm_ord_id is not UNSET: - field_dict["permOrdId"] = perm_ord_id - if position_effect is not UNSET: - field_dict["positionEffect"] = position_effect - if price is not UNSET: - field_dict["price"] = price - if price_type is not UNSET: - field_dict["priceType"] = price_type - if qty is not UNSET: - field_dict["qty"] = qty - if route is not UNSET: - field_dict["route"] = route - if security is not UNSET: - field_dict["security"] = security - if side is not UNSET: - field_dict["side"] = side - if source is not UNSET: - field_dict["source"] = source - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tag is not UNSET: - field_dict["tag"] = tag - if text is not UNSET: - field_dict["text"] = text - if tif is not UNSET: - field_dict["tif"] = tif - if trader_id is not UNSET: - field_dict["traderId"] = trader_id - if transact_ts is not UNSET: - field_dict["transactTs"] = transact_ts - if working_qty is not UNSET: - field_dict["workingQty"] = working_qty - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.header import Header - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.order_update_algo import OrderUpdateAlgo - from openapi_project.openapi_package.models.order_update_optional_data import OrderUpdateOptionalData - from openapi_project.openapi_package.models.security import Security - - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - _algo = d.pop("Algo", UNSET) - algo: Unset | OrderUpdateAlgo - if isinstance(_algo, Unset): - algo = UNSET - else: - algo = OrderUpdateAlgo.from_dict(_algo) - - alloc_id = d.pop("allocId", UNSET) - - aux_price = d.pop("auxPrice", UNSET) - - avg_price = d.pop("avgPrice", UNSET) - - _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo - if isinstance(_clearing_info, Unset): - clearing_info = UNSET - else: - clearing_info = ClearingInfo.from_dict(_clearing_info) - - commission = d.pop("commission", UNSET) - - cum_qty = d.pop("cumQty", UNSET) - - cur_ord_id = d.pop("curOrdId", UNSET) - - exec_broker = d.pop("execBroker", UNSET) - - exec_id = d.pop("execId", UNSET) - - exec_ref_id = d.pop("execRefId", UNSET) - - _exec_type = d.pop("execType", UNSET) - exec_type: Unset | ExecType - if isinstance(_exec_type, Unset): - exec_type = UNSET - else: - exec_type = ExecType(_exec_type) - - fee1 = d.pop("fee1", UNSET) - - fee2 = d.pop("fee2", UNSET) - - _header = d.pop("header", UNSET) - header: Unset | Header - if isinstance(_header, Unset): - header = UNSET - else: - header = Header.from_dict(_header) - - incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) - - incoming_ord_id = d.pop("incomingOrdId", UNSET) - - incoming_orig_cl_ord_id = d.pop("incomingOrigClOrdId", UNSET) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - last_market = d.pop("lastMarket", UNSET) - - last_price = d.pop("lastPrice", UNSET) - - last_qty = d.pop("lastQty", UNSET) - - leaves_qty = d.pop("leavesQty", UNSET) - - leg_id = d.pop("legId", UNSET) - - liquidity_flag = d.pop("liquidityFlag", UNSET) - - _multi_leg_reporting_type = d.pop("multiLegReportingType", UNSET) - multi_leg_reporting_type: Unset | MultiLegReportingType - if isinstance(_multi_leg_reporting_type, Unset): - multi_leg_reporting_type = UNSET - else: - multi_leg_reporting_type = MultiLegReportingType(_multi_leg_reporting_type) - - notes = d.pop("Notes", UNSET) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | OrderUpdateOptionalData - if isinstance(_optional_data, Unset): - optional_data = UNSET - else: - optional_data = OrderUpdateOptionalData.from_dict(_optional_data) - - order_flags = d.pop("orderFlags", UNSET) - - _ord_status = d.pop("ordStatus", UNSET) - ord_status: Unset | OrdStatus - if isinstance(_ord_status, Unset): - ord_status = UNSET - else: - ord_status = OrdStatus(_ord_status) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) - - _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType - if isinstance(_origination_type, Unset): - origination_type = UNSET - else: - origination_type = OriginationType(_origination_type) - - orig_ord_id = d.pop("origOrdId", UNSET) - - parent_ord_id = d.pop("parentOrdId", UNSET) - - perm_ord_id = d.pop("permOrdId", UNSET) - - _position_effect = d.pop("positionEffect", UNSET) - position_effect: Unset | PositionEffect - if isinstance(_position_effect, Unset): - position_effect = UNSET - else: - position_effect = PositionEffect(_position_effect) - - price = d.pop("price", UNSET) - - _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType - if isinstance(_price_type, Unset): - price_type = UNSET - else: - price_type = PriceType(_price_type) - - qty = d.pop("qty", UNSET) - - route = d.pop("route", UNSET) - - _security = d.pop("security", UNSET) - security: Unset | Security - if isinstance(_security, Unset): - security = UNSET - else: - security = Security.from_dict(_security) - - _side = d.pop("side", UNSET) - side: Unset | Side - if isinstance(_side, Unset): - side = UNSET - else: - side = Side(_side) - - source = d.pop("source", UNSET) - - symbol = d.pop("symbol", UNSET) - - tag = d.pop("tag", UNSET) - - text = d.pop("text", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) - - trader_id = d.pop("traderId", UNSET) - - transact_ts = d.pop("transactTs", UNSET) - - working_qty = d.pop("workingQty", UNSET) - - order_update = cls( - account_id=account_id, - algo=algo, - alloc_id=alloc_id, - aux_price=aux_price, - avg_price=avg_price, - clearing_info=clearing_info, - commission=commission, - cum_qty=cum_qty, - cur_ord_id=cur_ord_id, - exec_broker=exec_broker, - exec_id=exec_id, - exec_ref_id=exec_ref_id, - exec_type=exec_type, - fee1=fee1, - fee2=fee2, - header=header, - incoming_cl_ord_id=incoming_cl_ord_id, - incoming_ord_id=incoming_ord_id, - incoming_orig_cl_ord_id=incoming_orig_cl_ord_id, - instructions=instructions, - last_market=last_market, - last_price=last_price, - last_qty=last_qty, - leaves_qty=leaves_qty, - leg_id=leg_id, - liquidity_flag=liquidity_flag, - multi_leg_reporting_type=multi_leg_reporting_type, - notes=notes, - optional_data=optional_data, - order_flags=order_flags, - ord_status=ord_status, - ord_type=ord_type, - origination_type=origination_type, - orig_ord_id=orig_ord_id, - parent_ord_id=parent_ord_id, - perm_ord_id=perm_ord_id, - position_effect=position_effect, - price=price, - price_type=price_type, - qty=qty, - route=route, - security=security, - side=side, - source=source, - symbol=symbol, - tag=tag, - text=text, - tif=tif, - trader_id=trader_id, - transact_ts=transact_ts, - working_qty=working_qty, - ) - - return order_update diff --git a/openapi/openapi_project/openapi_package/models/order_update_algo.py b/openapi/openapi_project/openapi_package/models/order_update_algo.py deleted file mode 100644 index e8f7ee213..000000000 --- a/openapi/openapi_project/openapi_package/models/order_update_algo.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="OrderUpdateAlgo") - - -@_attrs_define -class OrderUpdateAlgo: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_update_algo = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_update_algo.additional_properties = additional_properties - return order_update_algo - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/order_update_event.py b/openapi/openapi_project/openapi_package/models/order_update_event.py deleted file mode 100644 index 6ed63dbc8..000000000 --- a/openapi/openapi_project/openapi_package/models/order_update_event.py +++ /dev/null @@ -1,179 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.execution import Execution - from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request import MultiLegOrderCancelReplaceRequest, - - from openapi_project.openapi_package.models.order_cancel_reject import OrderCancelReject - from openapi_project.openapi_package.models.order_cancel_replace_request import OrderCancelReplaceRequest - from openapi_project.openapi_package.models.order_cancel_request import OrderCancelRequest - from openapi_project.openapi_package.models.order_delete import OrderDelete - from openapi_project.openapi_package.models.order_update import OrderUpdate - - -T = TypeVar("T", bound="OrderUpdateEvent") - - -@_attrs_define -class OrderUpdateEvent: - """ - Attributes: - order_cancel_request (Union[Unset, OrderCancelRequest]): - order_cancel_replace_request (Union[Unset, OrderCancelReplaceRequest]): - multi_leg_order_cancel_replace_request (Union[Unset, MultiLegOrderCancelReplaceRequest]): - execution (Union[Unset, Execution]): - order_update (Union[Unset, OrderUpdate]): - order_delete (Union[Unset, OrderDelete]): - order_cancel_reject (Union[Unset, OrderCancelReject]): - """ - - order_cancel_request: Union[Unset, "OrderCancelRequest"] = UNSET - order_cancel_replace_request: Union[Unset, "OrderCancelReplaceRequest"] = UNSET - multi_leg_order_cancel_replace_request: Union[ - Unset, "MultiLegOrderCancelReplaceRequest" - ] = UNSET - execution: Union[Unset, "Execution"] = UNSET - order_update: Union[Unset, "OrderUpdate"] = UNSET - order_delete: Union[Unset, "OrderDelete"] = UNSET - order_cancel_reject: Union[Unset, "OrderCancelReject"] = UNSET - - def to_dict(self) -> dict[str, Any]: - order_cancel_request: Unset | dict[str, Any] = UNSET - if not isinstance(self.order_cancel_request, Unset): - order_cancel_request = self.order_cancel_request.to_dict() - - order_cancel_replace_request: Unset | dict[str, Any] = UNSET - if not isinstance(self.order_cancel_replace_request, Unset): - order_cancel_replace_request = self.order_cancel_replace_request.to_dict() - - multi_leg_order_cancel_replace_request: Unset | dict[str, Any] = UNSET - if not isinstance(self.multi_leg_order_cancel_replace_request, Unset): - multi_leg_order_cancel_replace_request = ( - self.multi_leg_order_cancel_replace_request.to_dict() - ) - - execution: Unset | dict[str, Any] = UNSET - if not isinstance(self.execution, Unset): - execution = self.execution.to_dict() - - order_update: Unset | dict[str, Any] = UNSET - if not isinstance(self.order_update, Unset): - order_update = self.order_update.to_dict() - - order_delete: Unset | dict[str, Any] = UNSET - if not isinstance(self.order_delete, Unset): - order_delete = self.order_delete.to_dict() - - order_cancel_reject: Unset | dict[str, Any] = UNSET - if not isinstance(self.order_cancel_reject, Unset): - order_cancel_reject = self.order_cancel_reject.to_dict() - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if order_cancel_request is not UNSET: - field_dict["orderCancelRequest"] = order_cancel_request - if order_cancel_replace_request is not UNSET: - field_dict["orderCancelReplaceRequest"] = order_cancel_replace_request - if multi_leg_order_cancel_replace_request is not UNSET: - field_dict["multiLegOrderCancelReplaceRequest"] = ( - multi_leg_order_cancel_replace_request - ) - if execution is not UNSET: - field_dict["execution"] = execution - if order_update is not UNSET: - field_dict["orderUpdate"] = order_update - if order_delete is not UNSET: - field_dict["orderDelete"] = order_delete - if order_cancel_reject is not UNSET: - field_dict["orderCancelReject"] = order_cancel_reject - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.execution import Execution - from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request import MultiLegOrderCancelReplaceRequest, - - from openapi_project.openapi_package.models.order_cancel_reject import OrderCancelReject - from openapi_project.openapi_package.models.order_cancel_replace_request import OrderCancelReplaceRequest - from openapi_project.openapi_package.models.order_cancel_request import OrderCancelRequest - from openapi_project.openapi_package.models.order_delete import OrderDelete - from openapi_project.openapi_package.models.order_update import OrderUpdate - - d = dict(src_dict) - _order_cancel_request = d.pop("orderCancelRequest", UNSET) - order_cancel_request: Unset | OrderCancelRequest - if isinstance(_order_cancel_request, Unset): - order_cancel_request = UNSET - else: - order_cancel_request = OrderCancelRequest.from_dict(_order_cancel_request) - - _order_cancel_replace_request = d.pop("orderCancelReplaceRequest", UNSET) - order_cancel_replace_request: Unset | OrderCancelReplaceRequest - if isinstance(_order_cancel_replace_request, Unset): - order_cancel_replace_request = UNSET - else: - order_cancel_replace_request = OrderCancelReplaceRequest.from_dict( - _order_cancel_replace_request - ) - - _multi_leg_order_cancel_replace_request = d.pop( - "multiLegOrderCancelReplaceRequest", UNSET - ) - multi_leg_order_cancel_replace_request: ( - Unset | MultiLegOrderCancelReplaceRequest - ) - if isinstance(_multi_leg_order_cancel_replace_request, Unset): - multi_leg_order_cancel_replace_request = UNSET - else: - multi_leg_order_cancel_replace_request = ( - MultiLegOrderCancelReplaceRequest.from_dict( - _multi_leg_order_cancel_replace_request - ) - ) - - _execution = d.pop("execution", UNSET) - execution: Unset | Execution - if isinstance(_execution, Unset): - execution = UNSET - else: - execution = Execution.from_dict(_execution) - - _order_update = d.pop("orderUpdate", UNSET) - order_update: Unset | OrderUpdate - if isinstance(_order_update, Unset): - order_update = UNSET - else: - order_update = OrderUpdate.from_dict(_order_update) - - _order_delete = d.pop("orderDelete", UNSET) - order_delete: Unset | OrderDelete - if isinstance(_order_delete, Unset): - order_delete = UNSET - else: - order_delete = OrderDelete.from_dict(_order_delete) - - _order_cancel_reject = d.pop("orderCancelReject", UNSET) - order_cancel_reject: Unset | OrderCancelReject - if isinstance(_order_cancel_reject, Unset): - order_cancel_reject = UNSET - else: - order_cancel_reject = OrderCancelReject.from_dict(_order_cancel_reject) - - order_update_event = cls( - order_cancel_request=order_cancel_request, - order_cancel_replace_request=order_cancel_replace_request, - multi_leg_order_cancel_replace_request=multi_leg_order_cancel_replace_request, - execution=execution, - order_update=order_update, - order_delete=order_delete, - order_cancel_reject=order_cancel_reject, - ) - - return order_update_event diff --git a/openapi/openapi_project/openapi_package/models/order_update_optional_data.py b/openapi/openapi_project/openapi_package/models/order_update_optional_data.py deleted file mode 100644 index 9236dcba2..000000000 --- a/openapi/openapi_project/openapi_package/models/order_update_optional_data.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="OrderUpdateOptionalData") - - -@_attrs_define -class OrderUpdateOptionalData: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_update_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_update_optional_data.additional_properties = additional_properties - return order_update_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/origination_type.py b/openapi/openapi_project/openapi_package/models/origination_type.py deleted file mode 100644 index e8e7a27f4..000000000 --- a/openapi/openapi_project/openapi_package/models/origination_type.py +++ /dev/null @@ -1,39 +0,0 @@ -from enum import Enum - - -class OriginationType(str, Enum): - ORIGINATION_TYPE_ADMINISTRATIVE = "ORIGINATION_TYPE_ADMINISTRATIVE" - ORIGINATION_TYPE_API_CHILD_ORDER = "ORIGINATION_TYPE_API_CHILD_ORDER" - ORIGINATION_TYPE_API_ORDER = "ORIGINATION_TYPE_API_ORDER" - ORIGINATION_TYPE_API_ORDER_CANCEL_REPLACE_REQUEST = ( - "ORIGINATION_TYPE_API_ORDER_CANCEL_REPLACE_REQUEST" - ) - ORIGINATION_TYPE_API_ORDER_CANCEL_REQUEST = ( - "ORIGINATION_TYPE_API_ORDER_CANCEL_REQUEST" - ) - ORIGINATION_TYPE_API_PARENT_ORDER = "ORIGINATION_TYPE_API_PARENT_ORDER" - ORIGINATION_TYPE_FIX_FROM_STREET_CHILD_ORDER = ( - "ORIGINATION_TYPE_FIX_FROM_STREET_CHILD_ORDER" - ) - ORIGINATION_TYPE_FIX_FROM_STREET_DROP = "ORIGINATION_TYPE_FIX_FROM_STREET_DROP" - ORIGINATION_TYPE_FIX_FROM_STREET_DROP_ORDER_UPDATE = ( - "ORIGINATION_TYPE_FIX_FROM_STREET_DROP_ORDER_UPDATE" - ) - ORIGINATION_TYPE_FIX_FROM_STREET_ORDER = "ORIGINATION_TYPE_FIX_FROM_STREET_ORDER" - ORIGINATION_TYPE_FIX_FROM_STREET_ORDER_CANCEL_REPLACE_REQUEST = ( - "ORIGINATION_TYPE_FIX_FROM_STREET_ORDER_CANCEL_REPLACE_REQUEST" - ) - ORIGINATION_TYPE_FIX_FROM_STREET_ORDER_CANCEL_REQUEST = ( - "ORIGINATION_TYPE_FIX_FROM_STREET_ORDER_CANCEL_REQUEST" - ) - ORIGINATION_TYPE_FIX_FROM_STREET_ORDER_UPDATE = ( - "ORIGINATION_TYPE_FIX_FROM_STREET_ORDER_UPDATE" - ) - ORIGINATION_TYPE_FIX_FROM_STREET_PARENT_ORDER = ( - "ORIGINATION_TYPE_FIX_FROM_STREET_PARENT_ORDER" - ) - ORIGINATION_TYPE_ORDER_MANAGER = "ORIGINATION_TYPE_ORDER_MANAGER" - ORIGINATION_TYPE_UNKNOWN = "ORIGINATION_TYPE_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/position.py b/openapi/openapi_project/openapi_package/models/position.py deleted file mode 100644 index ec5a67fda..000000000 --- a/openapi/openapi_project/openapi_package/models/position.py +++ /dev/null @@ -1,193 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="Position") - - -@_attrs_define -class Position: - """ - Attributes: - account_id (Union[Unset, int]): - symbol (Union[Unset, str]): - avg_cost (Union[Unset, float]): - marked_cost (Union[Unset, float]): - net_qty (Union[Unset, float]): - notional_value (Union[Unset, float]): - opening_cost (Union[Unset, float]): - opening_qty (Union[Unset, float]): - realized_pn_l (Union[Unset, float]): - trading_avg_cost (Union[Unset, float]): - trading_buy_avg_price (Union[Unset, float]): - trading_buy_qty (Union[Unset, float]): - trading_net_qty (Union[Unset, float]): - trading_sell_avg_price (Union[Unset, float]): - trading_sell_qty (Union[Unset, float]): - trading_sell_qty_long (Union[Unset, float]): - trading_sell_qty_short (Union[Unset, float]): - transact_ts (Union[Unset, str]): - """ - - account_id: Unset | int = UNSET - symbol: Unset | str = UNSET - avg_cost: Unset | float = UNSET - marked_cost: Unset | float = UNSET - net_qty: Unset | float = UNSET - notional_value: Unset | float = UNSET - opening_cost: Unset | float = UNSET - opening_qty: Unset | float = UNSET - realized_pn_l: Unset | float = UNSET - trading_avg_cost: Unset | float = UNSET - trading_buy_avg_price: Unset | float = UNSET - trading_buy_qty: Unset | float = UNSET - trading_net_qty: Unset | float = UNSET - trading_sell_avg_price: Unset | float = UNSET - trading_sell_qty: Unset | float = UNSET - trading_sell_qty_long: Unset | float = UNSET - trading_sell_qty_short: Unset | float = UNSET - transact_ts: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - symbol = self.symbol - - avg_cost = self.avg_cost - - marked_cost = self.marked_cost - - net_qty = self.net_qty - - notional_value = self.notional_value - - opening_cost = self.opening_cost - - opening_qty = self.opening_qty - - realized_pn_l = self.realized_pn_l - - trading_avg_cost = self.trading_avg_cost - - trading_buy_avg_price = self.trading_buy_avg_price - - trading_buy_qty = self.trading_buy_qty - - trading_net_qty = self.trading_net_qty - - trading_sell_avg_price = self.trading_sell_avg_price - - trading_sell_qty = self.trading_sell_qty - - trading_sell_qty_long = self.trading_sell_qty_long - - trading_sell_qty_short = self.trading_sell_qty_short - - transact_ts = self.transact_ts - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if symbol is not UNSET: - field_dict["symbol"] = symbol - if avg_cost is not UNSET: - field_dict["avgCost"] = avg_cost - if marked_cost is not UNSET: - field_dict["markedCost"] = marked_cost - if net_qty is not UNSET: - field_dict["netQty"] = net_qty - if notional_value is not UNSET: - field_dict["notionalValue"] = notional_value - if opening_cost is not UNSET: - field_dict["openingCost"] = opening_cost - if opening_qty is not UNSET: - field_dict["openingQty"] = opening_qty - if realized_pn_l is not UNSET: - field_dict["realizedPnL"] = realized_pn_l - if trading_avg_cost is not UNSET: - field_dict["tradingAvgCost"] = trading_avg_cost - if trading_buy_avg_price is not UNSET: - field_dict["tradingBuyAvgPrice"] = trading_buy_avg_price - if trading_buy_qty is not UNSET: - field_dict["tradingBuyQty"] = trading_buy_qty - if trading_net_qty is not UNSET: - field_dict["tradingNetQty"] = trading_net_qty - if trading_sell_avg_price is not UNSET: - field_dict["tradingSellAvgPrice"] = trading_sell_avg_price - if trading_sell_qty is not UNSET: - field_dict["tradingSellQty"] = trading_sell_qty - if trading_sell_qty_long is not UNSET: - field_dict["tradingSellQtyLong"] = trading_sell_qty_long - if trading_sell_qty_short is not UNSET: - field_dict["tradingSellQtyShort"] = trading_sell_qty_short - if transact_ts is not UNSET: - field_dict["transactTs"] = transact_ts - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - symbol = d.pop("symbol", UNSET) - - avg_cost = d.pop("avgCost", UNSET) - - marked_cost = d.pop("markedCost", UNSET) - - net_qty = d.pop("netQty", UNSET) - - notional_value = d.pop("notionalValue", UNSET) - - opening_cost = d.pop("openingCost", UNSET) - - opening_qty = d.pop("openingQty", UNSET) - - realized_pn_l = d.pop("realizedPnL", UNSET) - - trading_avg_cost = d.pop("tradingAvgCost", UNSET) - - trading_buy_avg_price = d.pop("tradingBuyAvgPrice", UNSET) - - trading_buy_qty = d.pop("tradingBuyQty", UNSET) - - trading_net_qty = d.pop("tradingNetQty", UNSET) - - trading_sell_avg_price = d.pop("tradingSellAvgPrice", UNSET) - - trading_sell_qty = d.pop("tradingSellQty", UNSET) - - trading_sell_qty_long = d.pop("tradingSellQtyLong", UNSET) - - trading_sell_qty_short = d.pop("tradingSellQtyShort", UNSET) - - transact_ts = d.pop("transactTs", UNSET) - - position = cls( - account_id=account_id, - symbol=symbol, - avg_cost=avg_cost, - marked_cost=marked_cost, - net_qty=net_qty, - notional_value=notional_value, - opening_cost=opening_cost, - opening_qty=opening_qty, - realized_pn_l=realized_pn_l, - trading_avg_cost=trading_avg_cost, - trading_buy_avg_price=trading_buy_avg_price, - trading_buy_qty=trading_buy_qty, - trading_net_qty=trading_net_qty, - trading_sell_avg_price=trading_sell_avg_price, - trading_sell_qty=trading_sell_qty, - trading_sell_qty_long=trading_sell_qty_long, - trading_sell_qty_short=trading_sell_qty_short, - transact_ts=transact_ts, - ) - - return position diff --git a/openapi/openapi_project/openapi_package/models/position_analysis.py b/openapi/openapi_project/openapi_package/models/position_analysis.py deleted file mode 100644 index 6233406be..000000000 --- a/openapi/openapi_project/openapi_package/models/position_analysis.py +++ /dev/null @@ -1,74 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.position_theo import PositionTheo - from openapi_project.openapi_package.models.scenario_theo import ScenarioTheo - - -T = TypeVar("T", bound="PositionAnalysis") - - -@_attrs_define -class PositionAnalysis: - """ - Attributes: - position_theo (Union[Unset, PositionTheo]): - scenario_theos (Union[Unset, list['ScenarioTheo']]): - """ - - position_theo: Union[Unset, "PositionTheo"] = UNSET - scenario_theos: Unset | list["ScenarioTheo"] = UNSET - - def to_dict(self) -> dict[str, Any]: - position_theo: Unset | dict[str, Any] = UNSET - if not isinstance(self.position_theo, Unset): - position_theo = self.position_theo.to_dict() - - scenario_theos: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.scenario_theos, Unset): - scenario_theos = [] - for scenario_theos_item_data in self.scenario_theos: - scenario_theos_item = scenario_theos_item_data.to_dict() - scenario_theos.append(scenario_theos_item) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if position_theo is not UNSET: - field_dict["positionTheo"] = position_theo - if scenario_theos is not UNSET: - field_dict["scenarioTheos"] = scenario_theos - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.position_theo import PositionTheo - from openapi_project.openapi_package.models.scenario_theo import ScenarioTheo - - d = dict(src_dict) - _position_theo = d.pop("positionTheo", UNSET) - position_theo: Unset | PositionTheo - if isinstance(_position_theo, Unset): - position_theo = UNSET - else: - position_theo = PositionTheo.from_dict(_position_theo) - - scenario_theos = [] - _scenario_theos = d.pop("scenarioTheos", UNSET) - for scenario_theos_item_data in _scenario_theos or []: - scenario_theos_item = ScenarioTheo.from_dict(scenario_theos_item_data) - - scenario_theos.append(scenario_theos_item) - - position_analysis = cls( - position_theo=position_theo, - scenario_theos=scenario_theos, - ) - - return position_analysis diff --git a/openapi/openapi_project/openapi_package/models/position_effect.py b/openapi/openapi_project/openapi_package/models/position_effect.py deleted file mode 100644 index 0441467a8..000000000 --- a/openapi/openapi_project/openapi_package/models/position_effect.py +++ /dev/null @@ -1,11 +0,0 @@ -from enum import Enum - - -class PositionEffect(str, Enum): - POSITION_EFFECT_AUTO = "POSITION_EFFECT_AUTO" - POSITION_EFFECT_CLOSE = "POSITION_EFFECT_CLOSE" - POSITION_EFFECT_NONE = "POSITION_EFFECT_NONE" - POSITION_EFFECT_OPEN = "POSITION_EFFECT_OPEN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/position_source.py b/openapi/openapi_project/openapi_package/models/position_source.py deleted file mode 100644 index 881fcceaa..000000000 --- a/openapi/openapi_project/openapi_package/models/position_source.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class PositionSource(str, Enum): - POSITION_SOURCE_FROM_PORTFOLIO = "POSITION_SOURCE_FROM_PORTFOLIO" - POSITION_SOURCE_FROM_REQUEST = "POSITION_SOURCE_FROM_REQUEST" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/position_theo.py b/openapi/openapi_project/openapi_package/models/position_theo.py deleted file mode 100644 index 19fe85323..000000000 --- a/openapi/openapi_project/openapi_package/models/position_theo.py +++ /dev/null @@ -1,206 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.position_theo_leg import PositionTheoLeg - - -T = TypeVar("T", bound="PositionTheo") - - -@_attrs_define -class PositionTheo: - """ - Attributes: - as_of_ts (Union[Unset, str]): - delta (Union[Unset, float]): - gamma (Union[Unset, float]): - legs (Union[Unset, list['PositionTheoLeg']]): - max_loss (Union[Unset, float]): - max_loss_lsd (Union[Unset, list[float]]): - max_profit (Union[Unset, float]): - max_profit_lsd (Union[Unset, list[float]]): - prem (Union[Unset, float]): - price (Union[Unset, float]): - profit (Union[Unset, float]): - profit_probability (Union[Unset, list[float]]): - rho (Union[Unset, float]): - theta (Union[Unset, float]): - total_value (Union[Unset, float]): - vega (Union[Unset, float]): - volatility (Union[Unset, float]): - """ - - as_of_ts: Unset | str = UNSET - delta: Unset | float = UNSET - gamma: Unset | float = UNSET - legs: Unset | list["PositionTheoLeg"] = UNSET - max_loss: Unset | float = UNSET - max_loss_lsd: Unset | list[float] = UNSET - max_profit: Unset | float = UNSET - max_profit_lsd: Unset | list[float] = UNSET - prem: Unset | float = UNSET - price: Unset | float = UNSET - profit: Unset | float = UNSET - profit_probability: Unset | list[float] = UNSET - rho: Unset | float = UNSET - theta: Unset | float = UNSET - total_value: Unset | float = UNSET - vega: Unset | float = UNSET - volatility: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - as_of_ts = self.as_of_ts - - delta = self.delta - - gamma = self.gamma - - legs: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.legs, Unset): - legs = [] - for legs_item_data in self.legs: - legs_item = legs_item_data.to_dict() - legs.append(legs_item) - - max_loss = self.max_loss - - max_loss_lsd: Unset | list[float] = UNSET - if not isinstance(self.max_loss_lsd, Unset): - max_loss_lsd = self.max_loss_lsd - - max_profit = self.max_profit - - max_profit_lsd: Unset | list[float] = UNSET - if not isinstance(self.max_profit_lsd, Unset): - max_profit_lsd = self.max_profit_lsd - - prem = self.prem - - price = self.price - - profit = self.profit - - profit_probability: Unset | list[float] = UNSET - if not isinstance(self.profit_probability, Unset): - profit_probability = self.profit_probability - - rho = self.rho - - theta = self.theta - - total_value = self.total_value - - vega = self.vega - - volatility = self.volatility - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if as_of_ts is not UNSET: - field_dict["asOfTs"] = as_of_ts - if delta is not UNSET: - field_dict["delta"] = delta - if gamma is not UNSET: - field_dict["gamma"] = gamma - if legs is not UNSET: - field_dict["legs"] = legs - if max_loss is not UNSET: - field_dict["maxLoss"] = max_loss - if max_loss_lsd is not UNSET: - field_dict["maxLossLsd"] = max_loss_lsd - if max_profit is not UNSET: - field_dict["maxProfit"] = max_profit - if max_profit_lsd is not UNSET: - field_dict["maxProfitLsd"] = max_profit_lsd - if prem is not UNSET: - field_dict["prem"] = prem - if price is not UNSET: - field_dict["price"] = price - if profit is not UNSET: - field_dict["profit"] = profit - if profit_probability is not UNSET: - field_dict["profitProbability"] = profit_probability - if rho is not UNSET: - field_dict["rho"] = rho - if theta is not UNSET: - field_dict["theta"] = theta - if total_value is not UNSET: - field_dict["totalValue"] = total_value - if vega is not UNSET: - field_dict["vega"] = vega - if volatility is not UNSET: - field_dict["volatility"] = volatility - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.position_theo_leg import PositionTheoLeg - - d = dict(src_dict) - as_of_ts = d.pop("asOfTs", UNSET) - - delta = d.pop("delta", UNSET) - - gamma = d.pop("gamma", UNSET) - - legs = [] - _legs = d.pop("legs", UNSET) - for legs_item_data in _legs or []: - legs_item = PositionTheoLeg.from_dict(legs_item_data) - - legs.append(legs_item) - - max_loss = d.pop("maxLoss", UNSET) - - max_loss_lsd = cast(list[float], d.pop("maxLossLsd", UNSET)) - - max_profit = d.pop("maxProfit", UNSET) - - max_profit_lsd = cast(list[float], d.pop("maxProfitLsd", UNSET)) - - prem = d.pop("prem", UNSET) - - price = d.pop("price", UNSET) - - profit = d.pop("profit", UNSET) - - profit_probability = cast(list[float], d.pop("profitProbability", UNSET)) - - rho = d.pop("rho", UNSET) - - theta = d.pop("theta", UNSET) - - total_value = d.pop("totalValue", UNSET) - - vega = d.pop("vega", UNSET) - - volatility = d.pop("volatility", UNSET) - - position_theo = cls( - as_of_ts=as_of_ts, - delta=delta, - gamma=gamma, - legs=legs, - max_loss=max_loss, - max_loss_lsd=max_loss_lsd, - max_profit=max_profit, - max_profit_lsd=max_profit_lsd, - prem=prem, - price=price, - profit=profit, - profit_probability=profit_probability, - rho=rho, - theta=theta, - total_value=total_value, - vega=vega, - volatility=volatility, - ) - - return position_theo diff --git a/openapi/openapi_project/openapi_package/models/position_theo_leg.py b/openapi/openapi_project/openapi_package/models/position_theo_leg.py deleted file mode 100644 index 05f83b201..000000000 --- a/openapi/openapi_project/openapi_package/models/position_theo_leg.py +++ /dev/null @@ -1,154 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="PositionTheoLeg") - - -@_attrs_define -class PositionTheoLeg: - """ - Attributes: - delta (Union[Unset, float]): - gamma (Union[Unset, float]): - max_loss (Union[Unset, float]): - max_loss_lsd (Union[Unset, list[float]]): - max_profit (Union[Unset, float]): - max_profit_lsd (Union[Unset, list[float]]): - prem (Union[Unset, float]): - profit (Union[Unset, float]): - profit_probability (Union[Unset, list[float]]): - rho (Union[Unset, float]): - theta (Union[Unset, float]): - vega (Union[Unset, float]): - volatility (Union[Unset, float]): - """ - - delta: Unset | float = UNSET - gamma: Unset | float = UNSET - max_loss: Unset | float = UNSET - max_loss_lsd: Unset | list[float] = UNSET - max_profit: Unset | float = UNSET - max_profit_lsd: Unset | list[float] = UNSET - prem: Unset | float = UNSET - profit: Unset | float = UNSET - profit_probability: Unset | list[float] = UNSET - rho: Unset | float = UNSET - theta: Unset | float = UNSET - vega: Unset | float = UNSET - volatility: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - delta = self.delta - - gamma = self.gamma - - max_loss = self.max_loss - - max_loss_lsd: Unset | list[float] = UNSET - if not isinstance(self.max_loss_lsd, Unset): - max_loss_lsd = self.max_loss_lsd - - max_profit = self.max_profit - - max_profit_lsd: Unset | list[float] = UNSET - if not isinstance(self.max_profit_lsd, Unset): - max_profit_lsd = self.max_profit_lsd - - prem = self.prem - - profit = self.profit - - profit_probability: Unset | list[float] = UNSET - if not isinstance(self.profit_probability, Unset): - profit_probability = self.profit_probability - - rho = self.rho - - theta = self.theta - - vega = self.vega - - volatility = self.volatility - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if delta is not UNSET: - field_dict["delta"] = delta - if gamma is not UNSET: - field_dict["gamma"] = gamma - if max_loss is not UNSET: - field_dict["maxLoss"] = max_loss - if max_loss_lsd is not UNSET: - field_dict["maxLossLsd"] = max_loss_lsd - if max_profit is not UNSET: - field_dict["maxProfit"] = max_profit - if max_profit_lsd is not UNSET: - field_dict["maxProfitLsd"] = max_profit_lsd - if prem is not UNSET: - field_dict["prem"] = prem - if profit is not UNSET: - field_dict["profit"] = profit - if profit_probability is not UNSET: - field_dict["profitProbability"] = profit_probability - if rho is not UNSET: - field_dict["rho"] = rho - if theta is not UNSET: - field_dict["theta"] = theta - if vega is not UNSET: - field_dict["vega"] = vega - if volatility is not UNSET: - field_dict["volatility"] = volatility - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - delta = d.pop("delta", UNSET) - - gamma = d.pop("gamma", UNSET) - - max_loss = d.pop("maxLoss", UNSET) - - max_loss_lsd = cast(list[float], d.pop("maxLossLsd", UNSET)) - - max_profit = d.pop("maxProfit", UNSET) - - max_profit_lsd = cast(list[float], d.pop("maxProfitLsd", UNSET)) - - prem = d.pop("prem", UNSET) - - profit = d.pop("profit", UNSET) - - profit_probability = cast(list[float], d.pop("profitProbability", UNSET)) - - rho = d.pop("rho", UNSET) - - theta = d.pop("theta", UNSET) - - vega = d.pop("vega", UNSET) - - volatility = d.pop("volatility", UNSET) - - position_theo_leg = cls( - delta=delta, - gamma=gamma, - max_loss=max_loss, - max_loss_lsd=max_loss_lsd, - max_profit=max_profit, - max_profit_lsd=max_profit_lsd, - prem=prem, - profit=profit, - profit_probability=profit_probability, - rho=rho, - theta=theta, - vega=vega, - volatility=volatility, - ) - - return position_theo_leg diff --git a/openapi/openapi_project/openapi_package/models/price_type.py b/openapi/openapi_project/openapi_package/models/price_type.py deleted file mode 100644 index c277980ed..000000000 --- a/openapi/openapi_project/openapi_package/models/price_type.py +++ /dev/null @@ -1,14 +0,0 @@ -from enum import Enum - - -class PriceType(str, Enum): - PRICE_TYPE_CABINET = "PRICE_TYPE_CABINET" - PRICE_TYPE_D_A_C = "PRICE_TYPE_D_A_C" - PRICE_TYPE_FIXED_AMT = "PRICE_TYPE_FIXED_AMT" - PRICE_TYPE_PERCENTAGE = "PRICE_TYPE_PERCENTAGE" - PRICE_TYPE_PER_UNIT = "PRICE_TYPE_PER_UNIT" - PRICE_TYPE_UNKNOWN = "PRICE_TYPE_UNKNOWN" - PRICE_TYPE_YIELD = "PRICE_TYPE_YIELD" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/product_group.py b/openapi/openapi_project/openapi_package/models/product_group.py deleted file mode 100644 index aa90857b8..000000000 --- a/openapi/openapi_project/openapi_package/models/product_group.py +++ /dev/null @@ -1,19 +0,0 @@ -from enum import Enum - - -class ProductGroup(str, Enum): - PRODUCT_GROUP_AGRICULTURAL = "PRODUCT_GROUP_AGRICULTURAL" - PRODUCT_GROUP_ALTERNATIVE_MARKETS = "PRODUCT_GROUP_ALTERNATIVE_MARKETS" - PRODUCT_GROUP_CURRENCY = "PRODUCT_GROUP_CURRENCY" - PRODUCT_GROUP_ENERGY = "PRODUCT_GROUP_ENERGY" - PRODUCT_GROUP_EQUITIES = "PRODUCT_GROUP_EQUITIES" - PRODUCT_GROUP_FINANCIAL = "PRODUCT_GROUP_FINANCIAL" - PRODUCT_GROUP_INDEX = "PRODUCT_GROUP_INDEX" - PRODUCT_GROUP_INTEREST_RATE = "PRODUCT_GROUP_INTEREST_RATE" - PRODUCT_GROUP_METAL = "PRODUCT_GROUP_METAL" - PRODUCT_GROUP_REAL_ESTATE = "PRODUCT_GROUP_REAL_ESTATE" - PRODUCT_GROUP_UNKNOWN = "PRODUCT_GROUP_UNKNOWN" - PRODUCT_GROUP_WEATHER = "PRODUCT_GROUP_WEATHER" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/product_sub_group.py b/openapi/openapi_project/openapi_package/models/product_sub_group.py deleted file mode 100644 index 5acb9ee95..000000000 --- a/openapi/openapi_project/openapi_package/models/product_sub_group.py +++ /dev/null @@ -1,8 +0,0 @@ -from enum import Enum - - -class ProductSubGroup(str, Enum): - PRODUCT_SUB_GROUP_UNKNOWN = "PRODUCT_SUB_GROUP_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/put_call.py b/openapi/openapi_project/openapi_package/models/put_call.py deleted file mode 100644 index 680cfcf36..000000000 --- a/openapi/openapi_project/openapi_package/models/put_call.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class PutCall(str, Enum): - PUT_CALL_CALL = "PUT_CALL_CALL" - PUT_CALL_PUT = "PUT_CALL_PUT" - PUT_CALL_UNDEFINED = "PUT_CALL_UNDEFINED" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/risk_calculation_type.py b/openapi/openapi_project/openapi_package/models/risk_calculation_type.py deleted file mode 100644 index 1b51d3094..000000000 --- a/openapi/openapi_project/openapi_package/models/risk_calculation_type.py +++ /dev/null @@ -1,11 +0,0 @@ -from enum import Enum - - -class RiskCalculationType(str, Enum): - RISK_CALCULATION_TYPE_ACCOUNT = "RISK_CALCULATION_TYPE_ACCOUNT" - RISK_CALCULATION_TYPE_TRADING_FIRM = "RISK_CALCULATION_TYPE_TRADING_FIRM" - RISK_CALCULATION_TYPE_UNKNOWN = "RISK_CALCULATION_TYPE_UNKNOWN" - RISK_CALCULATION_TYPE_USER = "RISK_CALCULATION_TYPE_USER" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/risk_eval_mode.py b/openapi/openapi_project/openapi_package/models/risk_eval_mode.py deleted file mode 100644 index c44b177fd..000000000 --- a/openapi/openapi_project/openapi_package/models/risk_eval_mode.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class RiskEvalMode(str, Enum): - RISK_EVAL_MODE_END_OF_DAY = "RISK_EVAL_MODE_END_OF_DAY" - RISK_EVAL_MODE_REAL_TIME = "RISK_EVAL_MODE_REAL_TIME" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_account_group.py b/openapi/openapi_project/openapi_package/models/risk_radar_account_group.py deleted file mode 100644 index c6685b252..000000000 --- a/openapi/openapi_project/openapi_package/models/risk_radar_account_group.py +++ /dev/null @@ -1,114 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.risk_radar_product_group import RiskRadarProductGroup - from openapi_project.openapi_package.models.shock_value import ShockValue - - -T = TypeVar("T", bound="RiskRadarAccountGroup") - - -@_attrs_define -class RiskRadarAccountGroup: - """ - Attributes: - account_id (Union[Unset, int]): - currency (Union[Unset, Currency]): - nav (Union[Unset, float]): - product_groups (Union[Unset, list['RiskRadarProductGroup']]): - shock_values (Union[Unset, list['ShockValue']]): - """ - - account_id: Unset | int = UNSET - currency: Unset | Currency = UNSET - nav: Unset | float = UNSET - product_groups: Unset | list["RiskRadarProductGroup"] = UNSET - shock_values: Unset | list["ShockValue"] = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value - - nav = self.nav - - product_groups: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.product_groups, Unset): - product_groups = [] - for product_groups_item_data in self.product_groups: - product_groups_item = product_groups_item_data.to_dict() - product_groups.append(product_groups_item) - - shock_values: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.shock_values, Unset): - shock_values = [] - for shock_values_item_data in self.shock_values: - shock_values_item = shock_values_item_data.to_dict() - shock_values.append(shock_values_item) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if currency is not UNSET: - field_dict["currency"] = currency - if nav is not UNSET: - field_dict["nav"] = nav - if product_groups is not UNSET: - field_dict["productGroups"] = product_groups - if shock_values is not UNSET: - field_dict["shockValues"] = shock_values - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.risk_radar_product_group import RiskRadarProductGroup - from openapi_project.openapi_package.models.shock_value import ShockValue - - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) - - nav = d.pop("nav", UNSET) - - product_groups = [] - _product_groups = d.pop("productGroups", UNSET) - for product_groups_item_data in _product_groups or []: - product_groups_item = RiskRadarProductGroup.from_dict( - product_groups_item_data - ) - - product_groups.append(product_groups_item) - - shock_values = [] - _shock_values = d.pop("shockValues", UNSET) - for shock_values_item_data in _shock_values or []: - shock_values_item = ShockValue.from_dict(shock_values_item_data) - - shock_values.append(shock_values_item) - - risk_radar_account_group = cls( - account_id=account_id, - currency=currency, - nav=nav, - product_groups=product_groups, - shock_values=shock_values, - ) - - return risk_radar_account_group diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_class_group.py b/openapi/openapi_project/openapi_package/models/risk_radar_class_group.py deleted file mode 100644 index f42e4a45b..000000000 --- a/openapi/openapi_project/openapi_package/models/risk_radar_class_group.py +++ /dev/null @@ -1,178 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.risk_radar_position import RiskRadarPosition - from openapi_project.openapi_package.models.shock_value import ShockValue - - -T = TypeVar("T", bound="RiskRadarClassGroup") - - -@_attrs_define -class RiskRadarClassGroup: - """ - Attributes: - delta (Union[Unset, float]): - dollar_delta (Union[Unset, float]): - dollar_gamma (Union[Unset, float]): - gamma (Union[Unset, float]): - nav (Union[Unset, float]): - price (Union[Unset, float]): - rho (Union[Unset, float]): - shock_keys (Union[Unset, list[float]]): - shock_values (Union[Unset, list['ShockValue']]): - symbol (Union[Unset, str]): - theta (Union[Unset, float]): - vega (Union[Unset, float]): - positions (Union[Unset, list['RiskRadarPosition']]): - """ - - delta: Unset | float = UNSET - dollar_delta: Unset | float = UNSET - dollar_gamma: Unset | float = UNSET - gamma: Unset | float = UNSET - nav: Unset | float = UNSET - price: Unset | float = UNSET - rho: Unset | float = UNSET - shock_keys: Unset | list[float] = UNSET - shock_values: Unset | list["ShockValue"] = UNSET - symbol: Unset | str = UNSET - theta: Unset | float = UNSET - vega: Unset | float = UNSET - positions: Unset | list["RiskRadarPosition"] = UNSET - - def to_dict(self) -> dict[str, Any]: - delta = self.delta - - dollar_delta = self.dollar_delta - - dollar_gamma = self.dollar_gamma - - gamma = self.gamma - - nav = self.nav - - price = self.price - - rho = self.rho - - shock_keys: Unset | list[float] = UNSET - if not isinstance(self.shock_keys, Unset): - shock_keys = self.shock_keys - - shock_values: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.shock_values, Unset): - shock_values = [] - for shock_values_item_data in self.shock_values: - shock_values_item = shock_values_item_data.to_dict() - shock_values.append(shock_values_item) - - symbol = self.symbol - - theta = self.theta - - vega = self.vega - - positions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.positions, Unset): - positions = [] - for positions_item_data in self.positions: - positions_item = positions_item_data.to_dict() - positions.append(positions_item) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if delta is not UNSET: - field_dict["delta"] = delta - if dollar_delta is not UNSET: - field_dict["dollarDelta"] = dollar_delta - if dollar_gamma is not UNSET: - field_dict["dollarGamma"] = dollar_gamma - if gamma is not UNSET: - field_dict["gamma"] = gamma - if nav is not UNSET: - field_dict["nav"] = nav - if price is not UNSET: - field_dict["price"] = price - if rho is not UNSET: - field_dict["rho"] = rho - if shock_keys is not UNSET: - field_dict["shockKeys"] = shock_keys - if shock_values is not UNSET: - field_dict["shockValues"] = shock_values - if symbol is not UNSET: - field_dict["symbol"] = symbol - if theta is not UNSET: - field_dict["theta"] = theta - if vega is not UNSET: - field_dict["vega"] = vega - if positions is not UNSET: - field_dict["positions"] = positions - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.risk_radar_position import RiskRadarPosition - from openapi_project.openapi_package.models.shock_value import ShockValue - - d = dict(src_dict) - delta = d.pop("delta", UNSET) - - dollar_delta = d.pop("dollarDelta", UNSET) - - dollar_gamma = d.pop("dollarGamma", UNSET) - - gamma = d.pop("gamma", UNSET) - - nav = d.pop("nav", UNSET) - - price = d.pop("price", UNSET) - - rho = d.pop("rho", UNSET) - - shock_keys = cast(list[float], d.pop("shockKeys", UNSET)) - - shock_values = [] - _shock_values = d.pop("shockValues", UNSET) - for shock_values_item_data in _shock_values or []: - shock_values_item = ShockValue.from_dict(shock_values_item_data) - - shock_values.append(shock_values_item) - - symbol = d.pop("symbol", UNSET) - - theta = d.pop("theta", UNSET) - - vega = d.pop("vega", UNSET) - - positions = [] - _positions = d.pop("positions", UNSET) - for positions_item_data in _positions or []: - positions_item = RiskRadarPosition.from_dict(positions_item_data) - - positions.append(positions_item) - - risk_radar_class_group = cls( - delta=delta, - dollar_delta=dollar_delta, - dollar_gamma=dollar_gamma, - gamma=gamma, - nav=nav, - price=price, - rho=rho, - shock_keys=shock_keys, - shock_values=shock_values, - symbol=symbol, - theta=theta, - vega=vega, - positions=positions, - ) - - return risk_radar_class_group diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_data.py b/openapi/openapi_project/openapi_package/models/risk_radar_data.py deleted file mode 100644 index 42131b380..000000000 --- a/openapi/openapi_project/openapi_package/models/risk_radar_data.py +++ /dev/null @@ -1,67 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.risk_radar_account_group import RiskRadarAccountGroup - - -T = TypeVar("T", bound="RiskRadarData") - - -@_attrs_define -class RiskRadarData: - """ - Attributes: - risks_result (Union[Unset, list['RiskRadarAccountGroup']]): - shock_keys (Union[Unset, list[str]]): - """ - - risks_result: Unset | list["RiskRadarAccountGroup"] = UNSET - shock_keys: Unset | list[str] = UNSET - - def to_dict(self) -> dict[str, Any]: - risks_result: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.risks_result, Unset): - risks_result = [] - for risks_result_item_data in self.risks_result: - risks_result_item = risks_result_item_data.to_dict() - risks_result.append(risks_result_item) - - shock_keys: Unset | list[str] = UNSET - if not isinstance(self.shock_keys, Unset): - shock_keys = self.shock_keys - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if risks_result is not UNSET: - field_dict["risksResult"] = risks_result - if shock_keys is not UNSET: - field_dict["shockKeys"] = shock_keys - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.risk_radar_account_group import RiskRadarAccountGroup - - d = dict(src_dict) - risks_result = [] - _risks_result = d.pop("risksResult", UNSET) - for risks_result_item_data in _risks_result or []: - risks_result_item = RiskRadarAccountGroup.from_dict(risks_result_item_data) - - risks_result.append(risks_result_item) - - shock_keys = cast(list[str], d.pop("shockKeys", UNSET)) - - risk_radar_data = cls( - risks_result=risks_result, - shock_keys=shock_keys, - ) - - return risk_radar_data diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_position.py b/openapi/openapi_project/openapi_package/models/risk_radar_position.py deleted file mode 100644 index 23cc5fdbc..000000000 --- a/openapi/openapi_project/openapi_package/models/risk_radar_position.py +++ /dev/null @@ -1,182 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.shock_value import ShockValue - - -T = TypeVar("T", bound="RiskRadarPosition") - - -@_attrs_define -class RiskRadarPosition: - """ - Attributes: - delta (Union[Unset, float]): - dollar_delta (Union[Unset, float]): - dollar_gamma (Union[Unset, float]): - gamma (Union[Unset, float]): - nav (Union[Unset, float]): - price (Union[Unset, float]): - p_zero (Union[Unset, float]): - rho (Union[Unset, float]): - shock_values (Union[Unset, list['ShockValue']]): - symbol (Union[Unset, str]): - theta (Union[Unset, float]): - vega (Union[Unset, float]): - rpg_root (Union[Unset, str]): - qty (Union[Unset, float]): - implied_volatility (Union[Unset, float]): - """ - - delta: Unset | float = UNSET - dollar_delta: Unset | float = UNSET - dollar_gamma: Unset | float = UNSET - gamma: Unset | float = UNSET - nav: Unset | float = UNSET - price: Unset | float = UNSET - p_zero: Unset | float = UNSET - rho: Unset | float = UNSET - shock_values: Unset | list["ShockValue"] = UNSET - symbol: Unset | str = UNSET - theta: Unset | float = UNSET - vega: Unset | float = UNSET - rpg_root: Unset | str = UNSET - qty: Unset | float = UNSET - implied_volatility: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - delta = self.delta - - dollar_delta = self.dollar_delta - - dollar_gamma = self.dollar_gamma - - gamma = self.gamma - - nav = self.nav - - price = self.price - - p_zero = self.p_zero - - rho = self.rho - - shock_values: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.shock_values, Unset): - shock_values = [] - for shock_values_item_data in self.shock_values: - shock_values_item = shock_values_item_data.to_dict() - shock_values.append(shock_values_item) - - symbol = self.symbol - - theta = self.theta - - vega = self.vega - - rpg_root = self.rpg_root - - qty = self.qty - - implied_volatility = self.implied_volatility - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if delta is not UNSET: - field_dict["delta"] = delta - if dollar_delta is not UNSET: - field_dict["dollarDelta"] = dollar_delta - if dollar_gamma is not UNSET: - field_dict["dollarGamma"] = dollar_gamma - if gamma is not UNSET: - field_dict["gamma"] = gamma - if nav is not UNSET: - field_dict["nav"] = nav - if price is not UNSET: - field_dict["price"] = price - if p_zero is not UNSET: - field_dict["pZero"] = p_zero - if rho is not UNSET: - field_dict["rho"] = rho - if shock_values is not UNSET: - field_dict["shockValues"] = shock_values - if symbol is not UNSET: - field_dict["symbol"] = symbol - if theta is not UNSET: - field_dict["theta"] = theta - if vega is not UNSET: - field_dict["vega"] = vega - if rpg_root is not UNSET: - field_dict["rpgRoot"] = rpg_root - if qty is not UNSET: - field_dict["qty"] = qty - if implied_volatility is not UNSET: - field_dict["impliedVolatility"] = implied_volatility - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.shock_value import ShockValue - - d = dict(src_dict) - delta = d.pop("delta", UNSET) - - dollar_delta = d.pop("dollarDelta", UNSET) - - dollar_gamma = d.pop("dollarGamma", UNSET) - - gamma = d.pop("gamma", UNSET) - - nav = d.pop("nav", UNSET) - - price = d.pop("price", UNSET) - - p_zero = d.pop("pZero", UNSET) - - rho = d.pop("rho", UNSET) - - shock_values = [] - _shock_values = d.pop("shockValues", UNSET) - for shock_values_item_data in _shock_values or []: - shock_values_item = ShockValue.from_dict(shock_values_item_data) - - shock_values.append(shock_values_item) - - symbol = d.pop("symbol", UNSET) - - theta = d.pop("theta", UNSET) - - vega = d.pop("vega", UNSET) - - rpg_root = d.pop("rpgRoot", UNSET) - - qty = d.pop("qty", UNSET) - - implied_volatility = d.pop("impliedVolatility", UNSET) - - risk_radar_position = cls( - delta=delta, - dollar_delta=dollar_delta, - dollar_gamma=dollar_gamma, - gamma=gamma, - nav=nav, - price=price, - p_zero=p_zero, - rho=rho, - shock_values=shock_values, - symbol=symbol, - theta=theta, - vega=vega, - rpg_root=rpg_root, - qty=qty, - implied_volatility=implied_volatility, - ) - - return risk_radar_position diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_product_group.py b/openapi/openapi_project/openapi_package/models/risk_radar_product_group.py deleted file mode 100644 index d80c8d80d..000000000 --- a/openapi/openapi_project/openapi_package/models/risk_radar_product_group.py +++ /dev/null @@ -1,104 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.risk_radar_class_group import RiskRadarClassGroup - from openapi_project.openapi_package.models.shock_value import ShockValue - - -T = TypeVar("T", bound="RiskRadarProductGroup") - - -@_attrs_define -class RiskRadarProductGroup: - """ - Attributes: - group (Union[Unset, str]): - nav (Union[Unset, float]): - class_groups (Union[Unset, list['RiskRadarClassGroup']]): - product_id (Union[Unset, str]): - shock_values (Union[Unset, list['ShockValue']]): - """ - - group: Unset | str = UNSET - nav: Unset | float = UNSET - class_groups: Unset | list["RiskRadarClassGroup"] = UNSET - product_id: Unset | str = UNSET - shock_values: Unset | list["ShockValue"] = UNSET - - def to_dict(self) -> dict[str, Any]: - group = self.group - - nav = self.nav - - class_groups: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.class_groups, Unset): - class_groups = [] - for class_groups_item_data in self.class_groups: - class_groups_item = class_groups_item_data.to_dict() - class_groups.append(class_groups_item) - - product_id = self.product_id - - shock_values: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.shock_values, Unset): - shock_values = [] - for shock_values_item_data in self.shock_values: - shock_values_item = shock_values_item_data.to_dict() - shock_values.append(shock_values_item) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if group is not UNSET: - field_dict["group"] = group - if nav is not UNSET: - field_dict["nav"] = nav - if class_groups is not UNSET: - field_dict["classGroups"] = class_groups - if product_id is not UNSET: - field_dict["productId"] = product_id - if shock_values is not UNSET: - field_dict["shockValues"] = shock_values - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.risk_radar_class_group import RiskRadarClassGroup - from openapi_project.openapi_package.models.shock_value import ShockValue - - d = dict(src_dict) - group = d.pop("group", UNSET) - - nav = d.pop("nav", UNSET) - - class_groups = [] - _class_groups = d.pop("classGroups", UNSET) - for class_groups_item_data in _class_groups or []: - class_groups_item = RiskRadarClassGroup.from_dict(class_groups_item_data) - - class_groups.append(class_groups_item) - - product_id = d.pop("productId", UNSET) - - shock_values = [] - _shock_values = d.pop("shockValues", UNSET) - for shock_values_item_data in _shock_values or []: - shock_values_item = ShockValue.from_dict(shock_values_item_data) - - shock_values.append(shock_values_item) - - risk_radar_product_group = cls( - group=group, - nav=nav, - class_groups=class_groups, - product_id=product_id, - shock_values=shock_values, - ) - - return risk_radar_product_group diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_request.py b/openapi/openapi_project/openapi_package/models/risk_radar_request.py deleted file mode 100644 index ca7c62246..000000000 --- a/openapi/openapi_project/openapi_package/models/risk_radar_request.py +++ /dev/null @@ -1,193 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.position_source import PositionSource -from openapi_project.openapi_package.models.risk_eval_mode import RiskEvalMode -from openapi_project.openapi_package.models.risk_radar_scenario_order import RiskRadarScenarioOrder -from openapi_project.openapi_package.models.volatility_shock_skew import VolatilityShockSkew -from openapi_project.openapi_package.models.volatility_shock_type import VolatilityShockType -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.risk_radar_request_position_list import RiskRadarRequestPositionList - - -T = TypeVar("T", bound="RiskRadarRequest") - - -@_attrs_define -class RiskRadarRequest: - """ - Attributes: - account_ids (Union[Unset, list[int]]): - positions_by_account_id (Union[Unset, list['RiskRadarRequestPositionList']]): - source (Union[Unset, PositionSource]): - range_ (Union[Unset, float]): - timestep (Union[Unset, str]): - scenario_order (Union[Unset, RiskRadarScenarioOrder]): - eval_mode (Union[Unset, RiskEvalMode]): - implied_volatility (Union[Unset, float]): - volatility_shock_skew (Union[Unset, VolatilityShockSkew]): - volatility_shock_type (Union[Unset, VolatilityShockType]): - exclude_expired_contracts (Union[Unset, bool]): - """ - - account_ids: Unset | list[int] = UNSET - positions_by_account_id: Unset | list["RiskRadarRequestPositionList"] = UNSET - source: Unset | PositionSource = UNSET - range_: Unset | float = UNSET - timestep: Unset | str = UNSET - scenario_order: Unset | RiskRadarScenarioOrder = UNSET - eval_mode: Unset | RiskEvalMode = UNSET - implied_volatility: Unset | float = UNSET - volatility_shock_skew: Unset | VolatilityShockSkew = UNSET - volatility_shock_type: Unset | VolatilityShockType = UNSET - exclude_expired_contracts: Unset | bool = UNSET - - def to_dict(self) -> dict[str, Any]: - account_ids: Unset | list[int] = UNSET - if not isinstance(self.account_ids, Unset): - account_ids = self.account_ids - - positions_by_account_id: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.positions_by_account_id, Unset): - positions_by_account_id = [] - for positions_by_account_id_item_data in self.positions_by_account_id: - positions_by_account_id_item = ( - positions_by_account_id_item_data.to_dict() - ) - positions_by_account_id.append(positions_by_account_id_item) - - source: Unset | str = UNSET - if not isinstance(self.source, Unset): - source = self.source.value - - range_ = self.range_ - - timestep = self.timestep - - scenario_order: Unset | str = UNSET - if not isinstance(self.scenario_order, Unset): - scenario_order = self.scenario_order.value - - eval_mode: Unset | str = UNSET - if not isinstance(self.eval_mode, Unset): - eval_mode = self.eval_mode.value - - implied_volatility = self.implied_volatility - - volatility_shock_skew: Unset | str = UNSET - if not isinstance(self.volatility_shock_skew, Unset): - volatility_shock_skew = self.volatility_shock_skew.value - - volatility_shock_type: Unset | str = UNSET - if not isinstance(self.volatility_shock_type, Unset): - volatility_shock_type = self.volatility_shock_type.value - - exclude_expired_contracts = self.exclude_expired_contracts - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_ids is not UNSET: - field_dict["accountIds"] = account_ids - if positions_by_account_id is not UNSET: - field_dict["positionsByAccountId"] = positions_by_account_id - if source is not UNSET: - field_dict["source"] = source - if range_ is not UNSET: - field_dict["range"] = range_ - if timestep is not UNSET: - field_dict["timestep"] = timestep - if scenario_order is not UNSET: - field_dict["scenarioOrder"] = scenario_order - if eval_mode is not UNSET: - field_dict["evalMode"] = eval_mode - if implied_volatility is not UNSET: - field_dict["impliedVolatility"] = implied_volatility - if volatility_shock_skew is not UNSET: - field_dict["volatilityShockSkew"] = volatility_shock_skew - if volatility_shock_type is not UNSET: - field_dict["volatilityShockType"] = volatility_shock_type - if exclude_expired_contracts is not UNSET: - field_dict["excludeExpiredContracts"] = exclude_expired_contracts - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.risk_radar_request_position_list import RiskRadarRequestPositionList, - - - d = dict(src_dict) - account_ids = cast(list[int], d.pop("accountIds", UNSET)) - - positions_by_account_id = [] - _positions_by_account_id = d.pop("positionsByAccountId", UNSET) - for positions_by_account_id_item_data in _positions_by_account_id or []: - positions_by_account_id_item = RiskRadarRequestPositionList.from_dict( - positions_by_account_id_item_data - ) - - positions_by_account_id.append(positions_by_account_id_item) - - _source = d.pop("source", UNSET) - source: Unset | PositionSource - if isinstance(_source, Unset): - source = UNSET - else: - source = PositionSource(_source) - - range_ = d.pop("range", UNSET) - - timestep = d.pop("timestep", UNSET) - - _scenario_order = d.pop("scenarioOrder", UNSET) - scenario_order: Unset | RiskRadarScenarioOrder - if isinstance(_scenario_order, Unset): - scenario_order = UNSET - else: - scenario_order = RiskRadarScenarioOrder(_scenario_order) - - _eval_mode = d.pop("evalMode", UNSET) - eval_mode: Unset | RiskEvalMode - if isinstance(_eval_mode, Unset): - eval_mode = UNSET - else: - eval_mode = RiskEvalMode(_eval_mode) - - implied_volatility = d.pop("impliedVolatility", UNSET) - - _volatility_shock_skew = d.pop("volatilityShockSkew", UNSET) - volatility_shock_skew: Unset | VolatilityShockSkew - if isinstance(_volatility_shock_skew, Unset): - volatility_shock_skew = UNSET - else: - volatility_shock_skew = VolatilityShockSkew(_volatility_shock_skew) - - _volatility_shock_type = d.pop("volatilityShockType", UNSET) - volatility_shock_type: Unset | VolatilityShockType - if isinstance(_volatility_shock_type, Unset): - volatility_shock_type = UNSET - else: - volatility_shock_type = VolatilityShockType(_volatility_shock_type) - - exclude_expired_contracts = d.pop("excludeExpiredContracts", UNSET) - - risk_radar_request = cls( - account_ids=account_ids, - positions_by_account_id=positions_by_account_id, - source=source, - range_=range_, - timestep=timestep, - scenario_order=scenario_order, - eval_mode=eval_mode, - implied_volatility=implied_volatility, - volatility_shock_skew=volatility_shock_skew, - volatility_shock_type=volatility_shock_type, - exclude_expired_contracts=exclude_expired_contracts, - ) - - return risk_radar_request diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_request_position.py b/openapi/openapi_project/openapi_package/models/risk_radar_request_position.py deleted file mode 100644 index d747a8bbf..000000000 --- a/openapi/openapi_project/openapi_package/models/risk_radar_request_position.py +++ /dev/null @@ -1,58 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="RiskRadarRequestPosition") - - -@_attrs_define -class RiskRadarRequestPosition: - """ - Attributes: - is_simulated_position (Union[Unset, bool]): - qty (Union[Unset, float]): - symbol (Union[Unset, str]): - """ - - is_simulated_position: Unset | bool = UNSET - qty: Unset | float = UNSET - symbol: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - is_simulated_position = self.is_simulated_position - - qty = self.qty - - symbol = self.symbol - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if is_simulated_position is not UNSET: - field_dict["isSimulatedPosition"] = is_simulated_position - if qty is not UNSET: - field_dict["qty"] = qty - if symbol is not UNSET: - field_dict["symbol"] = symbol - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - is_simulated_position = d.pop("isSimulatedPosition", UNSET) - - qty = d.pop("qty", UNSET) - - symbol = d.pop("symbol", UNSET) - - risk_radar_request_position = cls( - is_simulated_position=is_simulated_position, - qty=qty, - symbol=symbol, - ) - - return risk_radar_request_position diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_request_position_list.py b/openapi/openapi_project/openapi_package/models/risk_radar_request_position_list.py deleted file mode 100644 index 532e0c659..000000000 --- a/openapi/openapi_project/openapi_package/models/risk_radar_request_position_list.py +++ /dev/null @@ -1,65 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.risk_radar_request_position import RiskRadarRequestPosition - - -T = TypeVar("T", bound="RiskRadarRequestPositionList") - - -@_attrs_define -class RiskRadarRequestPositionList: - """ - Attributes: - account_id (Union[Unset, int]): - positions (Union[Unset, list['RiskRadarRequestPosition']]): - """ - - account_id: Unset | int = UNSET - positions: Unset | list["RiskRadarRequestPosition"] = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - positions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.positions, Unset): - positions = [] - for positions_item_data in self.positions: - positions_item = positions_item_data.to_dict() - positions.append(positions_item) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if positions is not UNSET: - field_dict["positions"] = positions - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.risk_radar_request_position import RiskRadarRequestPosition - - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - positions = [] - _positions = d.pop("positions", UNSET) - for positions_item_data in _positions or []: - positions_item = RiskRadarRequestPosition.from_dict(positions_item_data) - - positions.append(positions_item) - - risk_radar_request_position_list = cls( - account_id=account_id, - positions=positions, - ) - - return risk_radar_request_position_list diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_response.py b/openapi/openapi_project/openapi_package/models/risk_radar_response.py deleted file mode 100644 index 9d5b30a0d..000000000 --- a/openapi/openapi_project/openapi_package/models/risk_radar_response.py +++ /dev/null @@ -1,79 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.risk_radar_data import RiskRadarData - - -T = TypeVar("T", bound="RiskRadarResponse") - - -@_attrs_define -class RiskRadarResponse: - """ - Attributes: - result (Union[Unset, RiskRadarData]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - result: Union[Unset, "RiskRadarData"] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - result: Unset | dict[str, Any] = UNSET - if not isinstance(self.result, Unset): - result = self.result.to_dict() - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if result is not UNSET: - field_dict["result"] = result - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.risk_radar_data import RiskRadarData - - d = dict(src_dict) - _result = d.pop("result", UNSET) - result: Unset | RiskRadarData - if isinstance(_result, Unset): - result = UNSET - else: - result = RiskRadarData.from_dict(_result) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - risk_radar_response = cls( - result=result, - error_message=error_message, - status_code=status_code, - ) - - return risk_radar_response diff --git a/openapi/openapi_project/openapi_package/models/risk_radar_scenario_order.py b/openapi/openapi_project/openapi_package/models/risk_radar_scenario_order.py deleted file mode 100644 index 99a247430..000000000 --- a/openapi/openapi_project/openapi_package/models/risk_radar_scenario_order.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class RiskRadarScenarioOrder(str, Enum): - RISK_RADAR_SCENARIO_ORDER_SHOCK_FIRST = "RISK_RADAR_SCENARIO_ORDER_SHOCK_FIRST" - RISK_RADAR_SCENARIO_ORDER_STEP_FIRST = "RISK_RADAR_SCENARIO_ORDER_STEP_FIRST" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/risk_reject.py b/openapi/openapi_project/openapi_package/models/risk_reject.py deleted file mode 100644 index 146b8eaa9..000000000 --- a/openapi/openapi_project/openapi_package/models/risk_reject.py +++ /dev/null @@ -1,137 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.risk_calculation_type import RiskCalculationType -from openapi_project.openapi_package.models.risk_reject_type import RiskRejectType -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="RiskReject") - - -@_attrs_define -class RiskReject: - """ - Attributes: - account_id (Union[Unset, int]): - guid (Union[Unset, str]): - id (Union[Unset, int]): - is_overridden (Union[Unset, bool]): - message (Union[Unset, str]): - order_id (Union[Unset, str]): - transact_ts (Union[Unset, str]): - calculation_type (Union[Unset, RiskCalculationType]): - reject_type (Union[Unset, RiskRejectType]): - user_id (Union[Unset, int]): - """ - - account_id: Unset | int = UNSET - guid: Unset | str = UNSET - id: Unset | int = UNSET - is_overridden: Unset | bool = UNSET - message: Unset | str = UNSET - order_id: Unset | str = UNSET - transact_ts: Unset | str = UNSET - calculation_type: Unset | RiskCalculationType = UNSET - reject_type: Unset | RiskRejectType = UNSET - user_id: Unset | int = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - guid = self.guid - - id = self.id - - is_overridden = self.is_overridden - - message = self.message - - order_id = self.order_id - - transact_ts = self.transact_ts - - calculation_type: Unset | str = UNSET - if not isinstance(self.calculation_type, Unset): - calculation_type = self.calculation_type.value - - reject_type: Unset | str = UNSET - if not isinstance(self.reject_type, Unset): - reject_type = self.reject_type.value - - user_id = self.user_id - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if guid is not UNSET: - field_dict["guid"] = guid - if id is not UNSET: - field_dict["id"] = id - if is_overridden is not UNSET: - field_dict["isOverridden"] = is_overridden - if message is not UNSET: - field_dict["message"] = message - if order_id is not UNSET: - field_dict["orderId"] = order_id - if transact_ts is not UNSET: - field_dict["transactTs"] = transact_ts - if calculation_type is not UNSET: - field_dict["calculationType"] = calculation_type - if reject_type is not UNSET: - field_dict["rejectType"] = reject_type - if user_id is not UNSET: - field_dict["userId"] = user_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - guid = d.pop("guid", UNSET) - - id = d.pop("id", UNSET) - - is_overridden = d.pop("isOverridden", UNSET) - - message = d.pop("message", UNSET) - - order_id = d.pop("orderId", UNSET) - - transact_ts = d.pop("transactTs", UNSET) - - _calculation_type = d.pop("calculationType", UNSET) - calculation_type: Unset | RiskCalculationType - if isinstance(_calculation_type, Unset): - calculation_type = UNSET - else: - calculation_type = RiskCalculationType(_calculation_type) - - _reject_type = d.pop("rejectType", UNSET) - reject_type: Unset | RiskRejectType - if isinstance(_reject_type, Unset): - reject_type = UNSET - else: - reject_type = RiskRejectType(_reject_type) - - user_id = d.pop("userId", UNSET) - - risk_reject = cls( - account_id=account_id, - guid=guid, - id=id, - is_overridden=is_overridden, - message=message, - order_id=order_id, - transact_ts=transact_ts, - calculation_type=calculation_type, - reject_type=reject_type, - user_id=user_id, - ) - - return risk_reject diff --git a/openapi/openapi_project/openapi_package/models/risk_reject_type.py b/openapi/openapi_project/openapi_package/models/risk_reject_type.py deleted file mode 100644 index eed836c58..000000000 --- a/openapi/openapi_project/openapi_package/models/risk_reject_type.py +++ /dev/null @@ -1,120 +0,0 @@ -from enum import Enum - - -class RiskRejectType(str, Enum): - RISK_REJECT_TYPE_ACCOUNT_INACTIVE = "RISK_REJECT_TYPE_ACCOUNT_INACTIVE" - RISK_REJECT_TYPE_ACCOUNT_IN_LIQUIDATION = "RISK_REJECT_TYPE_ACCOUNT_IN_LIQUIDATION" - RISK_REJECT_TYPE_ACCOUNT_MAX_LOSS = "RISK_REJECT_TYPE_ACCOUNT_MAX_LOSS" - RISK_REJECT_TYPE_ALLOW_CRYPTO_ORDER_MARKET = ( - "RISK_REJECT_TYPE_ALLOW_CRYPTO_ORDER_MARKET" - ) - RISK_REJECT_TYPE_ALLOW_EQ_ORDER_LONG_SALE = ( - "RISK_REJECT_TYPE_ALLOW_EQ_ORDER_LONG_SALE" - ) - RISK_REJECT_TYPE_ALLOW_EQ_ORDER_MARKET = "RISK_REJECT_TYPE_ALLOW_EQ_ORDER_MARKET" - RISK_REJECT_TYPE_ALLOW_FUT_ORDER_MARKET = "RISK_REJECT_TYPE_ALLOW_FUT_ORDER_MARKET" - RISK_REJECT_TYPE_ALLOW_LOCATE_ID_FOR_EASY_TO_BORROW = ( - "RISK_REJECT_TYPE_ALLOW_LOCATE_ID_FOR_EASY_TO_BORROW" - ) - RISK_REJECT_TYPE_ALLOW_OPT_ORDER_MARKET = "RISK_REJECT_TYPE_ALLOW_OPT_ORDER_MARKET" - RISK_REJECT_TYPE_ALLOW_OPT_ORDER_SELL_TO_OPEN = ( - "RISK_REJECT_TYPE_ALLOW_OPT_ORDER_SELL_TO_OPEN" - ) - RISK_REJECT_TYPE_ALLOW_ORDER_WASH_TRADES = ( - "RISK_REJECT_TYPE_ALLOW_ORDER_WASH_TRADES" - ) - RISK_REJECT_TYPE_BUYING_POWER = "RISK_REJECT_TYPE_BUYING_POWER" - RISK_REJECT_TYPE_CRYPTO_MAX_GROSS_NOTIONAL_DAY = ( - "RISK_REJECT_TYPE_CRYPTO_MAX_GROSS_NOTIONAL_DAY" - ) - RISK_REJECT_TYPE_CRYPTO_MAX_GROSS_QTY_DAY = ( - "RISK_REJECT_TYPE_CRYPTO_MAX_GROSS_QTY_DAY" - ) - RISK_REJECT_TYPE_CRYPTO_MAX_NET_POSITION = ( - "RISK_REJECT_TYPE_CRYPTO_MAX_NET_POSITION" - ) - RISK_REJECT_TYPE_CRYPTO_MAX_NET_QTY_DAY = "RISK_REJECT_TYPE_CRYPTO_MAX_NET_QTY_DAY" - RISK_REJECT_TYPE_CRYPTO_ORDER_MAX_NOTIONAL = ( - "RISK_REJECT_TYPE_CRYPTO_ORDER_MAX_NOTIONAL" - ) - RISK_REJECT_TYPE_CRYPTO_ORDER_MAX_QTY = "RISK_REJECT_TYPE_CRYPTO_ORDER_MAX_QTY" - RISK_REJECT_TYPE_CRYPTO_ORDER_WARN_NOTIONAL = ( - "RISK_REJECT_TYPE_CRYPTO_ORDER_WARN_NOTIONAL" - ) - RISK_REJECT_TYPE_CRYPTO_ORDER_WARN_QTY = "RISK_REJECT_TYPE_CRYPTO_ORDER_WARN_QTY" - RISK_REJECT_TYPE_CRYPTO_WARN_GROSS_NOTIONAL_DAY = ( - "RISK_REJECT_TYPE_CRYPTO_WARN_GROSS_NOTIONAL_DAY" - ) - RISK_REJECT_TYPE_CRYPTO_WARN_GROSS_QTY_DAY = ( - "RISK_REJECT_TYPE_CRYPTO_WARN_GROSS_QTY_DAY" - ) - RISK_REJECT_TYPE_CRYPTO_WARN_NET_POSITION = ( - "RISK_REJECT_TYPE_CRYPTO_WARN_NET_POSITION" - ) - RISK_REJECT_TYPE_CRYPTO_WARN_NET_QTY_DAY = ( - "RISK_REJECT_TYPE_CRYPTO_WARN_NET_QTY_DAY" - ) - RISK_REJECT_TYPE_EQ_MAX_GROSS_NOTIONAL_DAY = ( - "RISK_REJECT_TYPE_EQ_MAX_GROSS_NOTIONAL_DAY" - ) - RISK_REJECT_TYPE_EQ_MAX_GROSS_QTY_DAY = "RISK_REJECT_TYPE_EQ_MAX_GROSS_QTY_DAY" - RISK_REJECT_TYPE_EQ_MAX_NET_POSITION = "RISK_REJECT_TYPE_EQ_MAX_NET_POSITION" - RISK_REJECT_TYPE_EQ_MAX_NET_QTY_DAY = "RISK_REJECT_TYPE_EQ_MAX_NET_QTY_DAY" - RISK_REJECT_TYPE_EQ_ORDER_MAX_NOTIONAL = "RISK_REJECT_TYPE_EQ_ORDER_MAX_NOTIONAL" - RISK_REJECT_TYPE_EQ_ORDER_MAX_QTY = "RISK_REJECT_TYPE_EQ_ORDER_MAX_QTY" - RISK_REJECT_TYPE_EQ_ORDER_WARN_NOTIONAL = "RISK_REJECT_TYPE_EQ_ORDER_WARN_NOTIONAL" - RISK_REJECT_TYPE_EQ_ORDER_WARN_QTY = "RISK_REJECT_TYPE_EQ_ORDER_WARN_QTY" - RISK_REJECT_TYPE_EQ_WARN_GROSS_NOTIONAL_DAY = ( - "RISK_REJECT_TYPE_EQ_WARN_GROSS_NOTIONAL_DAY" - ) - RISK_REJECT_TYPE_EQ_WARN_GROSS_QTY_DAY = "RISK_REJECT_TYPE_EQ_WARN_GROSS_QTY_DAY" - RISK_REJECT_TYPE_EQ_WARN_NET_POSITION = "RISK_REJECT_TYPE_EQ_WARN_NET_POSITION" - RISK_REJECT_TYPE_EQ_WARN_NET_QTY_DAY = "RISK_REJECT_TYPE_EQ_WARN_NET_QTY_DAY" - RISK_REJECT_TYPE_FUT_MAX_GROSS_NOTIONAL_DAY = ( - "RISK_REJECT_TYPE_FUT_MAX_GROSS_NOTIONAL_DAY" - ) - RISK_REJECT_TYPE_FUT_MAX_GROSS_QTY_DAY = "RISK_REJECT_TYPE_FUT_MAX_GROSS_QTY_DAY" - RISK_REJECT_TYPE_FUT_MAX_NET_POSITION = "RISK_REJECT_TYPE_FUT_MAX_NET_POSITION" - RISK_REJECT_TYPE_FUT_MAX_NET_QTY_DAY = "RISK_REJECT_TYPE_FUT_MAX_NET_QTY_DAY" - RISK_REJECT_TYPE_FUT_ORDER_MAX_NOTIONAL = "RISK_REJECT_TYPE_FUT_ORDER_MAX_NOTIONAL" - RISK_REJECT_TYPE_FUT_ORDER_MAX_QTY = "RISK_REJECT_TYPE_FUT_ORDER_MAX_QTY" - RISK_REJECT_TYPE_FUT_ORDER_WARN_NOTIONAL = ( - "RISK_REJECT_TYPE_FUT_ORDER_WARN_NOTIONAL" - ) - RISK_REJECT_TYPE_FUT_ORDER_WARN_QTY = "RISK_REJECT_TYPE_FUT_ORDER_WARN_QTY" - RISK_REJECT_TYPE_FUT_WARN_GROSS_NOTIONAL_DAY = ( - "RISK_REJECT_TYPE_FUT_WARN_GROSS_NOTIONAL_DAY" - ) - RISK_REJECT_TYPE_FUT_WARN_GROSS_QTY_DAY = "RISK_REJECT_TYPE_FUT_WARN_GROSS_QTY_DAY" - RISK_REJECT_TYPE_FUT_WARN_NET_POSITION = "RISK_REJECT_TYPE_FUT_WARN_NET_POSITION" - RISK_REJECT_TYPE_FUT_WARN_NET_QTY_DAY = "RISK_REJECT_TYPE_FUT_WARN_NET_QTY_DAY" - RISK_REJECT_TYPE_GTC_ORDER_NOT_ALLOWED = "RISK_REJECT_TYPE_GTC_ORDER_NOT_ALLOWED" - RISK_REJECT_TYPE_HARD_TO_BORROW = "RISK_REJECT_TYPE_HARD_TO_BORROW" - RISK_REJECT_TYPE_INVALID_ORD_TYPE = "RISK_REJECT_TYPE_INVALID_ORD_TYPE" - RISK_REJECT_TYPE_INVALID_SIDE = "RISK_REJECT_TYPE_INVALID_SIDE" - RISK_REJECT_TYPE_OPT_MAX_GROSS_NOTIONAL_DAY = ( - "RISK_REJECT_TYPE_OPT_MAX_GROSS_NOTIONAL_DAY" - ) - RISK_REJECT_TYPE_OPT_MAX_GROSS_QTY_DAY = "RISK_REJECT_TYPE_OPT_MAX_GROSS_QTY_DAY" - RISK_REJECT_TYPE_OPT_MAX_NET_POSITION = "RISK_REJECT_TYPE_OPT_MAX_NET_POSITION" - RISK_REJECT_TYPE_OPT_MAX_NET_QTY_DAY = "RISK_REJECT_TYPE_OPT_MAX_NET_QTY_DAY" - RISK_REJECT_TYPE_OPT_ORDER_MAX_NOTIONAL = "RISK_REJECT_TYPE_OPT_ORDER_MAX_NOTIONAL" - RISK_REJECT_TYPE_OPT_ORDER_MAX_QTY = "RISK_REJECT_TYPE_OPT_ORDER_MAX_QTY" - RISK_REJECT_TYPE_OPT_ORDER_WARN_NOTIONAL = ( - "RISK_REJECT_TYPE_OPT_ORDER_WARN_NOTIONAL" - ) - RISK_REJECT_TYPE_OPT_ORDER_WARN_QTY = "RISK_REJECT_TYPE_OPT_ORDER_WARN_QTY" - RISK_REJECT_TYPE_OPT_WARN_GROSS_NOTIONAL_DAY = ( - "RISK_REJECT_TYPE_OPT_WARN_GROSS_NOTIONAL_DAY" - ) - RISK_REJECT_TYPE_OPT_WARN_GROSS_QTY_DAY = "RISK_REJECT_TYPE_OPT_WARN_GROSS_QTY_DAY" - RISK_REJECT_TYPE_OPT_WARN_NET_POSITION = "RISK_REJECT_TYPE_OPT_WARN_NET_POSITION" - RISK_REJECT_TYPE_OPT_WARN_NET_QTY_DAY = "RISK_REJECT_TYPE_OPT_WARN_NET_QTY_DAY" - RISK_REJECT_TYPE_ORDER_MAX_THRESHOLD_BREACHED = ( - "RISK_REJECT_TYPE_ORDER_MAX_THRESHOLD_BREACHED" - ) - RISK_REJECT_TYPE_RESTRICTED_SECURITY = "RISK_REJECT_TYPE_RESTRICTED_SECURITY" - RISK_REJECT_TYPE_SECURITY_NOT_SUPPORTED = "RISK_REJECT_TYPE_SECURITY_NOT_SUPPORTED" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/route.py b/openapi/openapi_project/openapi_package/models/route.py deleted file mode 100644 index 505e9f423..000000000 --- a/openapi/openapi_project/openapi_package/models/route.py +++ /dev/null @@ -1,178 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.models.order_type import OrderType -from openapi_project.openapi_package.models.route_type import RouteType -from openapi_project.openapi_package.models.security_type import SecurityType -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.route_property import RouteProperty - - -T = TypeVar("T", bound="Route") - - -@_attrs_define -class Route: - """ - Attributes: - id (Union[Unset, int]): - algo_schema (Union[Unset, str]): - currency (Union[Unset, Currency]): - is_enabled (Union[Unset, bool]): - name (Union[Unset, str]): - order_type (Union[Unset, OrderType]): - route_properties (Union[Unset, list['RouteProperty']]): - security_type (Union[Unset, SecurityType]): - type_ (Union[Unset, RouteType]): - ui_schema (Union[Unset, str]): - venue (Union[Unset, str]): - """ - - id: Unset | int = UNSET - algo_schema: Unset | str = UNSET - currency: Unset | Currency = UNSET - is_enabled: Unset | bool = UNSET - name: Unset | str = UNSET - order_type: Unset | OrderType = UNSET - route_properties: Unset | list["RouteProperty"] = UNSET - security_type: Unset | SecurityType = UNSET - type_: Unset | RouteType = UNSET - ui_schema: Unset | str = UNSET - venue: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - id = self.id - - algo_schema = self.algo_schema - - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value - - is_enabled = self.is_enabled - - name = self.name - - order_type: Unset | str = UNSET - if not isinstance(self.order_type, Unset): - order_type = self.order_type.value - - route_properties: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.route_properties, Unset): - route_properties = [] - for route_properties_item_data in self.route_properties: - route_properties_item = route_properties_item_data.to_dict() - route_properties.append(route_properties_item) - - security_type: Unset | str = UNSET - if not isinstance(self.security_type, Unset): - security_type = self.security_type.value - - type_: Unset | str = UNSET - if not isinstance(self.type_, Unset): - type_ = self.type_.value - - ui_schema = self.ui_schema - - venue = self.venue - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if id is not UNSET: - field_dict["id"] = id - if algo_schema is not UNSET: - field_dict["algoSchema"] = algo_schema - if currency is not UNSET: - field_dict["currency"] = currency - if is_enabled is not UNSET: - field_dict["isEnabled"] = is_enabled - if name is not UNSET: - field_dict["name"] = name - if order_type is not UNSET: - field_dict["orderType"] = order_type - if route_properties is not UNSET: - field_dict["routeProperties"] = route_properties - if security_type is not UNSET: - field_dict["securityType"] = security_type - if type_ is not UNSET: - field_dict["type"] = type_ - if ui_schema is not UNSET: - field_dict["uiSchema"] = ui_schema - if venue is not UNSET: - field_dict["venue"] = venue - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.route_property import RouteProperty - - d = dict(src_dict) - id = d.pop("id", UNSET) - - algo_schema = d.pop("algoSchema", UNSET) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) - - is_enabled = d.pop("isEnabled", UNSET) - - name = d.pop("name", UNSET) - - _order_type = d.pop("orderType", UNSET) - order_type: Unset | OrderType - if isinstance(_order_type, Unset): - order_type = UNSET - else: - order_type = OrderType(_order_type) - - route_properties = [] - _route_properties = d.pop("routeProperties", UNSET) - for route_properties_item_data in _route_properties or []: - route_properties_item = RouteProperty.from_dict(route_properties_item_data) - - route_properties.append(route_properties_item) - - _security_type = d.pop("securityType", UNSET) - security_type: Unset | SecurityType - if isinstance(_security_type, Unset): - security_type = UNSET - else: - security_type = SecurityType(_security_type) - - _type_ = d.pop("type", UNSET) - type_: Unset | RouteType - if isinstance(_type_, Unset): - type_ = UNSET - else: - type_ = RouteType(_type_) - - ui_schema = d.pop("uiSchema", UNSET) - - venue = d.pop("venue", UNSET) - - route = cls( - id=id, - algo_schema=algo_schema, - currency=currency, - is_enabled=is_enabled, - name=name, - order_type=order_type, - route_properties=route_properties, - security_type=security_type, - type_=type_, - ui_schema=ui_schema, - venue=venue, - ) - - return route diff --git a/openapi/openapi_project/openapi_package/models/route_applicability.py b/openapi/openapi_project/openapi_package/models/route_applicability.py deleted file mode 100644 index 53a16b748..000000000 --- a/openapi/openapi_project/openapi_package/models/route_applicability.py +++ /dev/null @@ -1,120 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.models.order_type import OrderType -from openapi_project.openapi_package.models.security_type import SecurityType -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="RouteApplicability") - - -@_attrs_define -class RouteApplicability: - """ - Attributes: - user_id (Union[Unset, int]): - account_id (Union[Unset, int]): - security_type (Union[Unset, SecurityType]): - currency (Union[Unset, Currency]): - exchange_id (Union[Unset, int]): - order_type (Union[Unset, OrderType]): - route_ids (Union[Unset, list[int]]): - """ - - user_id: Unset | int = UNSET - account_id: Unset | int = UNSET - security_type: Unset | SecurityType = UNSET - currency: Unset | Currency = UNSET - exchange_id: Unset | int = UNSET - order_type: Unset | OrderType = UNSET - route_ids: Unset | list[int] = UNSET - - def to_dict(self) -> dict[str, Any]: - user_id = self.user_id - - account_id = self.account_id - - security_type: Unset | str = UNSET - if not isinstance(self.security_type, Unset): - security_type = self.security_type.value - - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value - - exchange_id = self.exchange_id - - order_type: Unset | str = UNSET - if not isinstance(self.order_type, Unset): - order_type = self.order_type.value - - route_ids: Unset | list[int] = UNSET - if not isinstance(self.route_ids, Unset): - route_ids = self.route_ids - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if user_id is not UNSET: - field_dict["userId"] = user_id - if account_id is not UNSET: - field_dict["accountId"] = account_id - if security_type is not UNSET: - field_dict["securityType"] = security_type - if currency is not UNSET: - field_dict["currency"] = currency - if exchange_id is not UNSET: - field_dict["exchangeId"] = exchange_id - if order_type is not UNSET: - field_dict["orderType"] = order_type - if route_ids is not UNSET: - field_dict["routeIds"] = route_ids - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - user_id = d.pop("userId", UNSET) - - account_id = d.pop("accountId", UNSET) - - _security_type = d.pop("securityType", UNSET) - security_type: Unset | SecurityType - if isinstance(_security_type, Unset): - security_type = UNSET - else: - security_type = SecurityType(_security_type) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) - - exchange_id = d.pop("exchangeId", UNSET) - - _order_type = d.pop("orderType", UNSET) - order_type: Unset | OrderType - if isinstance(_order_type, Unset): - order_type = UNSET - else: - order_type = OrderType(_order_type) - - route_ids = cast(list[int], d.pop("routeIds", UNSET)) - - route_applicability = cls( - user_id=user_id, - account_id=account_id, - security_type=security_type, - currency=currency, - exchange_id=exchange_id, - order_type=order_type, - route_ids=route_ids, - ) - - return route_applicability diff --git a/openapi/openapi_project/openapi_package/models/route_property.py b/openapi/openapi_project/openapi_package/models/route_property.py deleted file mode 100644 index ab6d3ddbd..000000000 --- a/openapi/openapi_project/openapi_package/models/route_property.py +++ /dev/null @@ -1,66 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.route_property_type import RoutePropertyType -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="RouteProperty") - - -@_attrs_define -class RouteProperty: - """ - Attributes: - id (Union[Unset, int]): - type_ (Union[Unset, RoutePropertyType]): - value (Union[Unset, str]): - """ - - id: Unset | int = UNSET - type_: Unset | RoutePropertyType = UNSET - value: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - id = self.id - - type_: Unset | str = UNSET - if not isinstance(self.type_, Unset): - type_ = self.type_.value - - value = self.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if id is not UNSET: - field_dict["id"] = id - if type_ is not UNSET: - field_dict["type"] = type_ - if value is not UNSET: - field_dict["value"] = value - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - id = d.pop("id", UNSET) - - _type_ = d.pop("type", UNSET) - type_: Unset | RoutePropertyType - if isinstance(_type_, Unset): - type_ = UNSET - else: - type_ = RoutePropertyType(_type_) - - value = d.pop("value", UNSET) - - route_property = cls( - id=id, - type_=type_, - value=value, - ) - - return route_property diff --git a/openapi/openapi_project/openapi_package/models/route_property_type.py b/openapi/openapi_project/openapi_package/models/route_property_type.py deleted file mode 100644 index df376dcfa..000000000 --- a/openapi/openapi_project/openapi_package/models/route_property_type.py +++ /dev/null @@ -1,19 +0,0 @@ -from enum import Enum - - -class RoutePropertyType(str, Enum): - ROUTE_PROPERTY_TYPE_CONTINGENCY = "ROUTE_PROPERTY_TYPE_CONTINGENCY" - ROUTE_PROPERTY_TYPE_CROSS_TYPE = "ROUTE_PROPERTY_TYPE_CROSS_TYPE" - ROUTE_PROPERTY_TYPE_EQUITY_EX_DESTINATION = ( - "ROUTE_PROPERTY_TYPE_EQUITY_EX_DESTINATION" - ) - ROUTE_PROPERTY_TYPE_INSTRUCTION = "ROUTE_PROPERTY_TYPE_INSTRUCTION" - ROUTE_PROPERTY_TYPE_ORDER_TYPE = "ROUTE_PROPERTY_TYPE_ORDER_TYPE" - ROUTE_PROPERTY_TYPE_PERMISSION = "ROUTE_PROPERTY_TYPE_PERMISSION" - ROUTE_PROPERTY_TYPE_SESSION_ELIGIBILITY = "ROUTE_PROPERTY_TYPE_SESSION_ELIGIBILITY" - ROUTE_PROPERTY_TYPE_STRATEGY_ID = "ROUTE_PROPERTY_TYPE_STRATEGY_ID" - ROUTE_PROPERTY_TYPE_TIF = "ROUTE_PROPERTY_TYPE_TIF" - ROUTE_PROPERTY_TYPE_UNKNOWN = "ROUTE_PROPERTY_TYPE_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/route_type.py b/openapi/openapi_project/openapi_package/models/route_type.py deleted file mode 100644 index d8faa457c..000000000 --- a/openapi/openapi_project/openapi_package/models/route_type.py +++ /dev/null @@ -1,16 +0,0 @@ -from enum import Enum - - -class RouteType(str, Enum): - ROUTE_TYPE_ALGO = "ROUTE_TYPE_ALGO" - ROUTE_TYPE_AWAY = "ROUTE_TYPE_AWAY" - ROUTE_TYPE_BROKER = "ROUTE_TYPE_BROKER" - ROUTE_TYPE_CBOE = "ROUTE_TYPE_CBOE" - ROUTE_TYPE_DMA = "ROUTE_TYPE_DMA" - ROUTE_TYPE_MANUAL = "ROUTE_TYPE_MANUAL" - ROUTE_TYPE_P2P = "ROUTE_TYPE_P2P" - ROUTE_TYPE_PAR = "ROUTE_TYPE_PAR" - ROUTE_TYPE_STAGE = "ROUTE_TYPE_STAGE" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/routing_session_group.py b/openapi/openapi_project/openapi_package/models/routing_session_group.py deleted file mode 100644 index b1bbb4b14..000000000 --- a/openapi/openapi_project/openapi_package/models/routing_session_group.py +++ /dev/null @@ -1,66 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.routing_session_group_type import RoutingSessionGroupType -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="RoutingSessionGroup") - - -@_attrs_define -class RoutingSessionGroup: - """ - Attributes: - id (Union[Unset, int]): - name (Union[Unset, str]): - type_ (Union[Unset, RoutingSessionGroupType]): - """ - - id: Unset | int = UNSET - name: Unset | str = UNSET - type_: Unset | RoutingSessionGroupType = UNSET - - def to_dict(self) -> dict[str, Any]: - id = self.id - - name = self.name - - type_: Unset | str = UNSET - if not isinstance(self.type_, Unset): - type_ = self.type_.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if id is not UNSET: - field_dict["id"] = id - if name is not UNSET: - field_dict["name"] = name - if type_ is not UNSET: - field_dict["type"] = type_ - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - id = d.pop("id", UNSET) - - name = d.pop("name", UNSET) - - _type_ = d.pop("type", UNSET) - type_: Unset | RoutingSessionGroupType - if isinstance(_type_, Unset): - type_ = UNSET - else: - type_ = RoutingSessionGroupType(_type_) - - routing_session_group = cls( - id=id, - name=name, - type_=type_, - ) - - return routing_session_group diff --git a/openapi/openapi_project/openapi_package/models/routing_session_group_type.py b/openapi/openapi_project/openapi_package/models/routing_session_group_type.py deleted file mode 100644 index 1eba5b629..000000000 --- a/openapi/openapi_project/openapi_package/models/routing_session_group_type.py +++ /dev/null @@ -1,15 +0,0 @@ -from enum import Enum - - -class RoutingSessionGroupType(str, Enum): - ROUTING_SESSION_GROUP_TYPE_AWAY = "ROUTING_SESSION_GROUP_TYPE_AWAY" - ROUTING_SESSION_GROUP_TYPE_BROKER = "ROUTING_SESSION_GROUP_TYPE_BROKER" - ROUTING_SESSION_GROUP_TYPE_EXCHANGE = "ROUTING_SESSION_GROUP_TYPE_EXCHANGE" - ROUTING_SESSION_GROUP_TYPE_MANUAL = "ROUTING_SESSION_GROUP_TYPE_MANUAL" - ROUTING_SESSION_GROUP_TYPE_P2P = "ROUTING_SESSION_GROUP_TYPE_P2P" - ROUTING_SESSION_GROUP_TYPE_PAR = "ROUTING_SESSION_GROUP_TYPE_PAR" - ROUTING_SESSION_GROUP_TYPE_STAGE = "ROUTING_SESSION_GROUP_TYPE_STAGE" - ROUTING_SESSION_GROUP_TYPE_UNKNOWN = "ROUTING_SESSION_GROUP_TYPE_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/scenario.py b/openapi/openapi_project/openapi_package/models/scenario.py deleted file mode 100644 index 2a98a9612..000000000 --- a/openapi/openapi_project/openapi_package/models/scenario.py +++ /dev/null @@ -1,83 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.scenario_leg import ScenarioLeg - from openapi_project.openapi_package.models.scenario_position import ScenarioPosition - - -T = TypeVar("T", bound="Scenario") - - -@_attrs_define -class Scenario: - """ - Attributes: - price (Union[Unset, float]): - legs (Union[Unset, list['ScenarioLeg']]): - position (Union[Unset, ScenarioPosition]): - """ - - price: Unset | float = UNSET - legs: Unset | list["ScenarioLeg"] = UNSET - position: Union[Unset, "ScenarioPosition"] = UNSET - - def to_dict(self) -> dict[str, Any]: - price = self.price - - legs: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.legs, Unset): - legs = [] - for legs_item_data in self.legs: - legs_item = legs_item_data.to_dict() - legs.append(legs_item) - - position: Unset | dict[str, Any] = UNSET - if not isinstance(self.position, Unset): - position = self.position.to_dict() - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if price is not UNSET: - field_dict["price"] = price - if legs is not UNSET: - field_dict["legs"] = legs - if position is not UNSET: - field_dict["position"] = position - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.scenario_leg import ScenarioLeg - from openapi_project.openapi_package.models.scenario_position import ScenarioPosition - - d = dict(src_dict) - price = d.pop("price", UNSET) - - legs = [] - _legs = d.pop("legs", UNSET) - for legs_item_data in _legs or []: - legs_item = ScenarioLeg.from_dict(legs_item_data) - - legs.append(legs_item) - - _position = d.pop("position", UNSET) - position: Unset | ScenarioPosition - if isinstance(_position, Unset): - position = UNSET - else: - position = ScenarioPosition.from_dict(_position) - - scenario = cls( - price=price, - legs=legs, - position=position, - ) - - return scenario diff --git a/openapi/openapi_project/openapi_package/models/scenario_leg.py b/openapi/openapi_project/openapi_package/models/scenario_leg.py deleted file mode 100644 index 0792a2b50..000000000 --- a/openapi/openapi_project/openapi_package/models/scenario_leg.py +++ /dev/null @@ -1,112 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="ScenarioLeg") - - -@_attrs_define -class ScenarioLeg: - """ - Attributes: - delta (Union[Unset, float]): - gamma (Union[Unset, float]): - prem (Union[Unset, float]): - profit (Union[Unset, float]): - rho (Union[Unset, float]): - theta (Union[Unset, float]): - total_value (Union[Unset, float]): - vega (Union[Unset, float]): - volatility (Union[Unset, float]): - """ - - delta: Unset | float = UNSET - gamma: Unset | float = UNSET - prem: Unset | float = UNSET - profit: Unset | float = UNSET - rho: Unset | float = UNSET - theta: Unset | float = UNSET - total_value: Unset | float = UNSET - vega: Unset | float = UNSET - volatility: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - delta = self.delta - - gamma = self.gamma - - prem = self.prem - - profit = self.profit - - rho = self.rho - - theta = self.theta - - total_value = self.total_value - - vega = self.vega - - volatility = self.volatility - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if delta is not UNSET: - field_dict["delta"] = delta - if gamma is not UNSET: - field_dict["gamma"] = gamma - if prem is not UNSET: - field_dict["prem"] = prem - if profit is not UNSET: - field_dict["profit"] = profit - if rho is not UNSET: - field_dict["rho"] = rho - if theta is not UNSET: - field_dict["theta"] = theta - if total_value is not UNSET: - field_dict["totalValue"] = total_value - if vega is not UNSET: - field_dict["vega"] = vega - if volatility is not UNSET: - field_dict["volatility"] = volatility - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - delta = d.pop("delta", UNSET) - - gamma = d.pop("gamma", UNSET) - - prem = d.pop("prem", UNSET) - - profit = d.pop("profit", UNSET) - - rho = d.pop("rho", UNSET) - - theta = d.pop("theta", UNSET) - - total_value = d.pop("totalValue", UNSET) - - vega = d.pop("vega", UNSET) - - volatility = d.pop("volatility", UNSET) - - scenario_leg = cls( - delta=delta, - gamma=gamma, - prem=prem, - profit=profit, - rho=rho, - theta=theta, - total_value=total_value, - vega=vega, - volatility=volatility, - ) - - return scenario_leg diff --git a/openapi/openapi_project/openapi_package/models/scenario_position.py b/openapi/openapi_project/openapi_package/models/scenario_position.py deleted file mode 100644 index f56bd3eea..000000000 --- a/openapi/openapi_project/openapi_package/models/scenario_position.py +++ /dev/null @@ -1,112 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="ScenarioPosition") - - -@_attrs_define -class ScenarioPosition: - """ - Attributes: - delta (Union[Unset, float]): - gamma (Union[Unset, float]): - prem (Union[Unset, float]): - profit (Union[Unset, float]): - rho (Union[Unset, float]): - theta (Union[Unset, float]): - total_value (Union[Unset, float]): - vega (Union[Unset, float]): - volatility (Union[Unset, float]): - """ - - delta: Unset | float = UNSET - gamma: Unset | float = UNSET - prem: Unset | float = UNSET - profit: Unset | float = UNSET - rho: Unset | float = UNSET - theta: Unset | float = UNSET - total_value: Unset | float = UNSET - vega: Unset | float = UNSET - volatility: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - delta = self.delta - - gamma = self.gamma - - prem = self.prem - - profit = self.profit - - rho = self.rho - - theta = self.theta - - total_value = self.total_value - - vega = self.vega - - volatility = self.volatility - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if delta is not UNSET: - field_dict["delta"] = delta - if gamma is not UNSET: - field_dict["gamma"] = gamma - if prem is not UNSET: - field_dict["prem"] = prem - if profit is not UNSET: - field_dict["profit"] = profit - if rho is not UNSET: - field_dict["rho"] = rho - if theta is not UNSET: - field_dict["theta"] = theta - if total_value is not UNSET: - field_dict["totalValue"] = total_value - if vega is not UNSET: - field_dict["vega"] = vega - if volatility is not UNSET: - field_dict["volatility"] = volatility - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - delta = d.pop("delta", UNSET) - - gamma = d.pop("gamma", UNSET) - - prem = d.pop("prem", UNSET) - - profit = d.pop("profit", UNSET) - - rho = d.pop("rho", UNSET) - - theta = d.pop("theta", UNSET) - - total_value = d.pop("totalValue", UNSET) - - vega = d.pop("vega", UNSET) - - volatility = d.pop("volatility", UNSET) - - scenario_position = cls( - delta=delta, - gamma=gamma, - prem=prem, - profit=profit, - rho=rho, - theta=theta, - total_value=total_value, - vega=vega, - volatility=volatility, - ) - - return scenario_position diff --git a/openapi/openapi_project/openapi_package/models/scenario_theo.py b/openapi/openapi_project/openapi_package/models/scenario_theo.py deleted file mode 100644 index 16a8a4f35..000000000 --- a/openapi/openapi_project/openapi_package/models/scenario_theo.py +++ /dev/null @@ -1,74 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.scenario import Scenario - - -T = TypeVar("T", bound="ScenarioTheo") - - -@_attrs_define -class ScenarioTheo: - """ - Attributes: - as_of_ts (Union[Unset, str]): - as_of_eval_expiry (Union[Unset, bool]): - scenarios (Union[Unset, list['Scenario']]): - """ - - as_of_ts: Unset | str = UNSET - as_of_eval_expiry: Unset | bool = UNSET - scenarios: Unset | list["Scenario"] = UNSET - - def to_dict(self) -> dict[str, Any]: - as_of_ts = self.as_of_ts - - as_of_eval_expiry = self.as_of_eval_expiry - - scenarios: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.scenarios, Unset): - scenarios = [] - for scenarios_item_data in self.scenarios: - scenarios_item = scenarios_item_data.to_dict() - scenarios.append(scenarios_item) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if as_of_ts is not UNSET: - field_dict["asOfTs"] = as_of_ts - if as_of_eval_expiry is not UNSET: - field_dict["asOfEvalExpiry"] = as_of_eval_expiry - if scenarios is not UNSET: - field_dict["scenarios"] = scenarios - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.scenario import Scenario - - d = dict(src_dict) - as_of_ts = d.pop("asOfTs", UNSET) - - as_of_eval_expiry = d.pop("asOfEvalExpiry", UNSET) - - scenarios = [] - _scenarios = d.pop("scenarios", UNSET) - for scenarios_item_data in _scenarios or []: - scenarios_item = Scenario.from_dict(scenarios_item_data) - - scenarios.append(scenarios_item) - - scenario_theo = cls( - as_of_ts=as_of_ts, - as_of_eval_expiry=as_of_eval_expiry, - scenarios=scenarios, - ) - - return scenario_theo diff --git a/openapi/openapi_project/openapi_package/models/search_order_history_response.py b/openapi/openapi_project/openapi_package/models/search_order_history_response.py deleted file mode 100644 index 9640b2164..000000000 --- a/openapi/openapi_project/openapi_package/models/search_order_history_response.py +++ /dev/null @@ -1,82 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.generic_order import GenericOrder - - -T = TypeVar("T", bound="SearchOrderHistoryResponse") - - -@_attrs_define -class SearchOrderHistoryResponse: - """ - Attributes: - orders (Union[Unset, list['GenericOrder']]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - orders: Unset | list["GenericOrder"] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - orders: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.orders, Unset): - orders = [] - for orders_item_data in self.orders: - orders_item = orders_item_data.to_dict() - orders.append(orders_item) - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if orders is not UNSET: - field_dict["orders"] = orders - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.generic_order import GenericOrder - - d = dict(src_dict) - orders = [] - _orders = d.pop("orders", UNSET) - for orders_item_data in _orders or []: - orders_item = GenericOrder.from_dict(orders_item_data) - - orders.append(orders_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - search_order_history_response = cls( - orders=orders, - error_message=error_message, - status_code=status_code, - ) - - return search_order_history_response diff --git a/openapi/openapi_project/openapi_package/models/security.py b/openapi/openapi_project/openapi_package/models/security.py deleted file mode 100644 index 07d4c27b6..000000000 --- a/openapi/openapi_project/openapi_package/models/security.py +++ /dev/null @@ -1,215 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.crypto import Crypto - from openapi_project.openapi_package.models.flex_option import FlexOption - from openapi_project.openapi_package.models.future import Future - from openapi_project.openapi_package.models.future_root import FutureRoot - from openapi_project.openapi_package.models.future_spread import FutureSpread - from openapi_project.openapi_package.models.fx import Fx - from openapi_project.openapi_package.models.index import Index - from openapi_project.openapi_package.models.option import Option - from openapi_project.openapi_package.models.option_root import OptionRoot - from openapi_project.openapi_package.models.stock import Stock - - -T = TypeVar("T", bound="Security") - - -@_attrs_define -class Security: - """ - Attributes: - stock (Union[Unset, Stock]): - option (Union[Unset, Option]): - option_root (Union[Unset, OptionRoot]): - future (Union[Unset, Future]): - future_root (Union[Unset, FutureRoot]): - index (Union[Unset, Index]): - future_spread (Union[Unset, FutureSpread]): - fx (Union[Unset, Fx]): - crypto (Union[Unset, Crypto]): - flex_option (Union[Unset, FlexOption]): - """ - - stock: Union[Unset, "Stock"] = UNSET - option: Union[Unset, "Option"] = UNSET - option_root: Union[Unset, "OptionRoot"] = UNSET - future: Union[Unset, "Future"] = UNSET - future_root: Union[Unset, "FutureRoot"] = UNSET - index: Union[Unset, "Index"] = UNSET - future_spread: Union[Unset, "FutureSpread"] = UNSET - fx: Union[Unset, "Fx"] = UNSET - crypto: Union[Unset, "Crypto"] = UNSET - flex_option: Union[Unset, "FlexOption"] = UNSET - - def to_dict(self) -> dict[str, Any]: - stock: Unset | dict[str, Any] = UNSET - if not isinstance(self.stock, Unset): - stock = self.stock.to_dict() - - option: Unset | dict[str, Any] = UNSET - if not isinstance(self.option, Unset): - option = self.option.to_dict() - - option_root: Unset | dict[str, Any] = UNSET - if not isinstance(self.option_root, Unset): - option_root = self.option_root.to_dict() - - future: Unset | dict[str, Any] = UNSET - if not isinstance(self.future, Unset): - future = self.future.to_dict() - - future_root: Unset | dict[str, Any] = UNSET - if not isinstance(self.future_root, Unset): - future_root = self.future_root.to_dict() - - index: Unset | dict[str, Any] = UNSET - if not isinstance(self.index, Unset): - index = self.index.to_dict() - - future_spread: Unset | dict[str, Any] = UNSET - if not isinstance(self.future_spread, Unset): - future_spread = self.future_spread.to_dict() - - fx: Unset | dict[str, Any] = UNSET - if not isinstance(self.fx, Unset): - fx = self.fx.to_dict() - - crypto: Unset | dict[str, Any] = UNSET - if not isinstance(self.crypto, Unset): - crypto = self.crypto.to_dict() - - flex_option: Unset | dict[str, Any] = UNSET - if not isinstance(self.flex_option, Unset): - flex_option = self.flex_option.to_dict() - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if stock is not UNSET: - field_dict["stock"] = stock - if option is not UNSET: - field_dict["option"] = option - if option_root is not UNSET: - field_dict["optionRoot"] = option_root - if future is not UNSET: - field_dict["future"] = future - if future_root is not UNSET: - field_dict["futureRoot"] = future_root - if index is not UNSET: - field_dict["index"] = index - if future_spread is not UNSET: - field_dict["futureSpread"] = future_spread - if fx is not UNSET: - field_dict["fx"] = fx - if crypto is not UNSET: - field_dict["crypto"] = crypto - if flex_option is not UNSET: - field_dict["flexOption"] = flex_option - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.crypto import Crypto - from openapi_project.openapi_package.models.flex_option import FlexOption - from openapi_project.openapi_package.models.future import Future - from openapi_project.openapi_package.models.future_root import FutureRoot - from openapi_project.openapi_package.models.future_spread import FutureSpread - from openapi_project.openapi_package.models.fx import Fx - from openapi_project.openapi_package.models.index import Index - from openapi_project.openapi_package.models.option import Option - from openapi_project.openapi_package.models.option_root import OptionRoot - from openapi_project.openapi_package.models.stock import Stock - - d = dict(src_dict) - _stock = d.pop("stock", UNSET) - stock: Unset | Stock - if isinstance(_stock, Unset): - stock = UNSET - else: - stock = Stock.from_dict(_stock) - - _option = d.pop("option", UNSET) - option: Unset | Option - if isinstance(_option, Unset): - option = UNSET - else: - option = Option.from_dict(_option) - - _option_root = d.pop("optionRoot", UNSET) - option_root: Unset | OptionRoot - if isinstance(_option_root, Unset): - option_root = UNSET - else: - option_root = OptionRoot.from_dict(_option_root) - - _future = d.pop("future", UNSET) - future: Unset | Future - if isinstance(_future, Unset): - future = UNSET - else: - future = Future.from_dict(_future) - - _future_root = d.pop("futureRoot", UNSET) - future_root: Unset | FutureRoot - if isinstance(_future_root, Unset): - future_root = UNSET - else: - future_root = FutureRoot.from_dict(_future_root) - - _index = d.pop("index", UNSET) - index: Unset | Index - if isinstance(_index, Unset): - index = UNSET - else: - index = Index.from_dict(_index) - - _future_spread = d.pop("futureSpread", UNSET) - future_spread: Unset | FutureSpread - if isinstance(_future_spread, Unset): - future_spread = UNSET - else: - future_spread = FutureSpread.from_dict(_future_spread) - - _fx = d.pop("fx", UNSET) - fx: Unset | Fx - if isinstance(_fx, Unset): - fx = UNSET - else: - fx = Fx.from_dict(_fx) - - _crypto = d.pop("crypto", UNSET) - crypto: Unset | Crypto - if isinstance(_crypto, Unset): - crypto = UNSET - else: - crypto = Crypto.from_dict(_crypto) - - _flex_option = d.pop("flexOption", UNSET) - flex_option: Unset | FlexOption - if isinstance(_flex_option, Unset): - flex_option = UNSET - else: - flex_option = FlexOption.from_dict(_flex_option) - - security = cls( - stock=stock, - option=option, - option_root=option_root, - future=future, - future_root=future_root, - index=index, - future_spread=future_spread, - fx=fx, - crypto=crypto, - flex_option=flex_option, - ) - - return security diff --git a/openapi/openapi_project/openapi_package/models/security_category.py b/openapi/openapi_project/openapi_package/models/security_category.py deleted file mode 100644 index 2d7108ca9..000000000 --- a/openapi/openapi_project/openapi_package/models/security_category.py +++ /dev/null @@ -1,39 +0,0 @@ -from enum import Enum - - -class SecurityCategory(str, Enum): - SECURITY_CATEGORY_ADR = "SECURITY_CATEGORY_ADR" - SECURITY_CATEGORY_COMMON_STOCK = "SECURITY_CATEGORY_COMMON_STOCK" - SECURITY_CATEGORY_CONVERTIBLE = "SECURITY_CATEGORY_CONVERTIBLE" - SECURITY_CATEGORY_CORPORATE_BOND = "SECURITY_CATEGORY_CORPORATE_BOND" - SECURITY_CATEGORY_CRYPTO = "SECURITY_CATEGORY_CRYPTO" - SECURITY_CATEGORY_DEBENTURE = "SECURITY_CATEGORY_DEBENTURE" - SECURITY_CATEGORY_EQUITY_OPTION = "SECURITY_CATEGORY_EQUITY_OPTION" - SECURITY_CATEGORY_ETF = "SECURITY_CATEGORY_ETF" - SECURITY_CATEGORY_ETN = "SECURITY_CATEGORY_ETN" - SECURITY_CATEGORY_FLEX_OPTION = "SECURITY_CATEGORY_FLEX_OPTION" - SECURITY_CATEGORY_FUTURE = "SECURITY_CATEGORY_FUTURE" - SECURITY_CATEGORY_FUTURE_OPTION = "SECURITY_CATEGORY_FUTURE_OPTION" - SECURITY_CATEGORY_FUTURE_ROOT = "SECURITY_CATEGORY_FUTURE_ROOT" - SECURITY_CATEGORY_FUTURE_SPREAD = "SECURITY_CATEGORY_FUTURE_SPREAD" - SECURITY_CATEGORY_FX = "SECURITY_CATEGORY_FX" - SECURITY_CATEGORY_INDEX = "SECURITY_CATEGORY_INDEX" - SECURITY_CATEGORY_INDEX_OPTION = "SECURITY_CATEGORY_INDEX_OPTION" - SECURITY_CATEGORY_INSTALLMENT_RECEIPT = "SECURITY_CATEGORY_INSTALLMENT_RECEIPT" - SECURITY_CATEGORY_MUNICIPAL_BOND = "SECURITY_CATEGORY_MUNICIPAL_BOND" - SECURITY_CATEGORY_MUTUAL_FUND = "SECURITY_CATEGORY_MUTUAL_FUND" - SECURITY_CATEGORY_NOTE = "SECURITY_CATEGORY_NOTE" - SECURITY_CATEGORY_OPTION_ROOT = "SECURITY_CATEGORY_OPTION_ROOT" - SECURITY_CATEGORY_PREFERRED_STOCK = "SECURITY_CATEGORY_PREFERRED_STOCK" - SECURITY_CATEGORY_RIGHT = "SECURITY_CATEGORY_RIGHT" - SECURITY_CATEGORY_TEST = "SECURITY_CATEGORY_TEST" - SECURITY_CATEGORY_TREASURY_BILL = "SECURITY_CATEGORY_TREASURY_BILL" - SECURITY_CATEGORY_TRUST_UNIT = "SECURITY_CATEGORY_TRUST_UNIT" - SECURITY_CATEGORY_UNIT = "SECURITY_CATEGORY_UNIT" - SECURITY_CATEGORY_UNKNOWN = "SECURITY_CATEGORY_UNKNOWN" - SECURITY_CATEGORY_WARRANT = "SECURITY_CATEGORY_WARRANT" - SECURITY_CATEGORY_WHEN_DISTRIBUTED = "SECURITY_CATEGORY_WHEN_DISTRIBUTED" - SECURITY_CATEGORY_WHEN_ISSUED = "SECURITY_CATEGORY_WHEN_ISSUED" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/security_type.py b/openapi/openapi_project/openapi_package/models/security_type.py deleted file mode 100644 index 891a6dcbc..000000000 --- a/openapi/openapi_project/openapi_package/models/security_type.py +++ /dev/null @@ -1,19 +0,0 @@ -from enum import Enum - - -class SecurityType(str, Enum): - SECURITY_TYPE_BOND = "SECURITY_TYPE_BOND" - SECURITY_TYPE_CRYPTO = "SECURITY_TYPE_CRYPTO" - SECURITY_TYPE_FLEX_OPTION = "SECURITY_TYPE_FLEX_OPTION" - SECURITY_TYPE_FUTURE = "SECURITY_TYPE_FUTURE" - SECURITY_TYPE_FUTURE_ROOT = "SECURITY_TYPE_FUTURE_ROOT" - SECURITY_TYPE_FUTURE_SPREAD = "SECURITY_TYPE_FUTURE_SPREAD" - SECURITY_TYPE_FX = "SECURITY_TYPE_FX" - SECURITY_TYPE_INDEX = "SECURITY_TYPE_INDEX" - SECURITY_TYPE_OPTION = "SECURITY_TYPE_OPTION" - SECURITY_TYPE_OPTION_ROOT = "SECURITY_TYPE_OPTION_ROOT" - SECURITY_TYPE_STOCK = "SECURITY_TYPE_STOCK" - SECURITY_TYPE_UNKNOWN = "SECURITY_TYPE_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/settlement_deliverable_type.py b/openapi/openapi_project/openapi_package/models/settlement_deliverable_type.py deleted file mode 100644 index 0163027b4..000000000 --- a/openapi/openapi_project/openapi_package/models/settlement_deliverable_type.py +++ /dev/null @@ -1,11 +0,0 @@ -from enum import Enum - - -class SettlementDeliverableType(str, Enum): - SETTLEMENT_DELIVERABLE_TYPE_CASH = "SETTLEMENT_DELIVERABLE_TYPE_CASH" - SETTLEMENT_DELIVERABLE_TYPE_PHYSICAL = "SETTLEMENT_DELIVERABLE_TYPE_PHYSICAL" - SETTLEMENT_DELIVERABLE_TYPE_UNDEFINED = "SETTLEMENT_DELIVERABLE_TYPE_UNDEFINED" - SETTLEMENT_DELIVERABLE_TYPE_UNDERLYING = "SETTLEMENT_DELIVERABLE_TYPE_UNDERLYING" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/settlement_info.py b/openapi/openapi_project/openapi_package/models/settlement_info.py deleted file mode 100644 index eedbfd270..000000000 --- a/openapi/openapi_project/openapi_package/models/settlement_info.py +++ /dev/null @@ -1,66 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.settlement_deliverable_type import SettlementDeliverableType -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="SettlementInfo") - - -@_attrs_define -class SettlementInfo: - """ - Attributes: - amount (Union[Unset, float]): - symbol (Union[Unset, str]): - deliverable_type (Union[Unset, SettlementDeliverableType]): - """ - - amount: Unset | float = UNSET - symbol: Unset | str = UNSET - deliverable_type: Unset | SettlementDeliverableType = UNSET - - def to_dict(self) -> dict[str, Any]: - amount = self.amount - - symbol = self.symbol - - deliverable_type: Unset | str = UNSET - if not isinstance(self.deliverable_type, Unset): - deliverable_type = self.deliverable_type.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if amount is not UNSET: - field_dict["amount"] = amount - if symbol is not UNSET: - field_dict["symbol"] = symbol - if deliverable_type is not UNSET: - field_dict["deliverableType"] = deliverable_type - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - amount = d.pop("amount", UNSET) - - symbol = d.pop("symbol", UNSET) - - _deliverable_type = d.pop("deliverableType", UNSET) - deliverable_type: Unset | SettlementDeliverableType - if isinstance(_deliverable_type, Unset): - deliverable_type = UNSET - else: - deliverable_type = SettlementDeliverableType(_deliverable_type) - - settlement_info = cls( - amount=amount, - symbol=symbol, - deliverable_type=deliverable_type, - ) - - return settlement_info diff --git a/openapi/openapi_project/openapi_package/models/shock_value.py b/openapi/openapi_project/openapi_package/models/shock_value.py deleted file mode 100644 index 2c5af4b2e..000000000 --- a/openapi/openapi_project/openapi_package/models/shock_value.py +++ /dev/null @@ -1,98 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.shock_value_flags import ShockValueFlags - - -T = TypeVar("T", bound="ShockValue") - - -@_attrs_define -class ShockValue: - """ - Attributes: - delta (Union[Unset, float]): - dollar_delta (Union[Unset, float]): - pn_l (Union[Unset, float]): - nav (Union[Unset, float]): - volatility (Union[Unset, float]): - flags (Union[Unset, ShockValueFlags]): - """ - - delta: Unset | float = UNSET - dollar_delta: Unset | float = UNSET - pn_l: Unset | float = UNSET - nav: Unset | float = UNSET - volatility: Unset | float = UNSET - flags: Union[Unset, "ShockValueFlags"] = UNSET - - def to_dict(self) -> dict[str, Any]: - delta = self.delta - - dollar_delta = self.dollar_delta - - pn_l = self.pn_l - - nav = self.nav - - volatility = self.volatility - - flags: Unset | dict[str, Any] = UNSET - if not isinstance(self.flags, Unset): - flags = self.flags.to_dict() - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if delta is not UNSET: - field_dict["delta"] = delta - if dollar_delta is not UNSET: - field_dict["dollarDelta"] = dollar_delta - if pn_l is not UNSET: - field_dict["pnL"] = pn_l - if nav is not UNSET: - field_dict["nav"] = nav - if volatility is not UNSET: - field_dict["volatility"] = volatility - if flags is not UNSET: - field_dict["flags"] = flags - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.shock_value_flags import ShockValueFlags - - d = dict(src_dict) - delta = d.pop("delta", UNSET) - - dollar_delta = d.pop("dollarDelta", UNSET) - - pn_l = d.pop("pnL", UNSET) - - nav = d.pop("nav", UNSET) - - volatility = d.pop("volatility", UNSET) - - _flags = d.pop("flags", UNSET) - flags: Unset | ShockValueFlags - if isinstance(_flags, Unset): - flags = UNSET - else: - flags = ShockValueFlags.from_dict(_flags) - - shock_value = cls( - delta=delta, - dollar_delta=dollar_delta, - pn_l=pn_l, - nav=nav, - volatility=volatility, - flags=flags, - ) - - return shock_value diff --git a/openapi/openapi_project/openapi_package/models/shock_value_flags.py b/openapi/openapi_project/openapi_package/models/shock_value_flags.py deleted file mode 100644 index ef99a2b22..000000000 --- a/openapi/openapi_project/openapi_package/models/shock_value_flags.py +++ /dev/null @@ -1,58 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="ShockValueFlags") - - -@_attrs_define -class ShockValueFlags: - """ - Attributes: - expired (Union[Unset, bool]): - exercised (Union[Unset, bool]): - delivered (Union[Unset, bool]): - """ - - expired: Unset | bool = UNSET - exercised: Unset | bool = UNSET - delivered: Unset | bool = UNSET - - def to_dict(self) -> dict[str, Any]: - expired = self.expired - - exercised = self.exercised - - delivered = self.delivered - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if expired is not UNSET: - field_dict["expired"] = expired - if exercised is not UNSET: - field_dict["exercised"] = exercised - if delivered is not UNSET: - field_dict["delivered"] = delivered - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - expired = d.pop("expired", UNSET) - - exercised = d.pop("exercised", UNSET) - - delivered = d.pop("delivered", UNSET) - - shock_value_flags = cls( - expired=expired, - exercised=exercised, - delivered=delivered, - ) - - return shock_value_flags diff --git a/openapi/openapi_project/openapi_package/models/side.py b/openapi/openapi_project/openapi_package/models/side.py deleted file mode 100644 index c85e0bf27..000000000 --- a/openapi/openapi_project/openapi_package/models/side.py +++ /dev/null @@ -1,13 +0,0 @@ -from enum import Enum - - -class Side(str, Enum): - SIDE_BUY = "SIDE_BUY" - SIDE_CROSS = "SIDE_CROSS" - SIDE_NOT_SPECIFIED = "SIDE_NOT_SPECIFIED" - SIDE_SELL = "SIDE_SELL" - SIDE_SELL_SHORT = "SIDE_SELL_SHORT" - SIDE_SELL_SHORT_EXEMPT = "SIDE_SELL_SHORT_EXEMPT" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/spread_leg_side.py b/openapi/openapi_project/openapi_package/models/spread_leg_side.py deleted file mode 100644 index af9adc8ff..000000000 --- a/openapi/openapi_project/openapi_package/models/spread_leg_side.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class SpreadLegSide(str, Enum): - SPREAD_LEG_SIDE_BUY = "SPREAD_LEG_SIDE_BUY" - SPREAD_LEG_SIDE_SELL = "SPREAD_LEG_SIDE_SELL" - SPREAD_LEG_SIDE_UNKNOWN = "SPREAD_LEG_SIDE_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/spread_leg_type.py b/openapi/openapi_project/openapi_package/models/spread_leg_type.py deleted file mode 100644 index a6813e623..000000000 --- a/openapi/openapi_project/openapi_package/models/spread_leg_type.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class SpreadLegType(str, Enum): - SPREAD_LEG_TYPE_OUTRIGHT = "SPREAD_LEG_TYPE_OUTRIGHT" - SPREAD_LEG_TYPE_UNKNOWN = "SPREAD_LEG_TYPE_UNKNOWN" - SPREAD_LEG_TYPE_VOLATILITY = "SPREAD_LEG_TYPE_VOLATILITY" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/status.py b/openapi/openapi_project/openapi_package/models/status.py deleted file mode 100644 index 1aa10203b..000000000 --- a/openapi/openapi_project/openapi_package/models/status.py +++ /dev/null @@ -1,74 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.any_model import AnyModel - - -T = TypeVar("T", bound="Status") - - -@_attrs_define -class Status: - """ - Attributes: - code (Union[Unset, int]): - message (Union[Unset, str]): - details (Union[Unset, list['AnyModel']]): - """ - - code: Unset | int = UNSET - message: Unset | str = UNSET - details: Unset | list["AnyModel"] = UNSET - - def to_dict(self) -> dict[str, Any]: - code = self.code - - message = self.message - - details: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.details, Unset): - details = [] - for details_item_data in self.details: - details_item = details_item_data.to_dict() - details.append(details_item) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if code is not UNSET: - field_dict["code"] = code - if message is not UNSET: - field_dict["message"] = message - if details is not UNSET: - field_dict["details"] = details - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.any_model import AnyModel - - d = dict(src_dict) - code = d.pop("code", UNSET) - - message = d.pop("message", UNSET) - - details = [] - _details = d.pop("details", UNSET) - for details_item_data in _details or []: - details_item = AnyModel.from_dict(details_item_data) - - details.append(details_item) - - status = cls( - code=code, - message=message, - details=details, - ) - - return status diff --git a/openapi/openapi_project/openapi_package/models/status_code.py b/openapi/openapi_project/openapi_package/models/status_code.py deleted file mode 100644 index 3f7c54600..000000000 --- a/openapi/openapi_project/openapi_package/models/status_code.py +++ /dev/null @@ -1,19 +0,0 @@ -from enum import Enum - - -class StatusCode(str, Enum): - STATUS_CODE_DISCONNECTED = "STATUS_CODE_DISCONNECTED" - STATUS_CODE_ERROR = "STATUS_CODE_ERROR" - STATUS_CODE_NOT_AUTHORIZED = "STATUS_CODE_NOT_AUTHORIZED" - STATUS_CODE_NOT_CONNECTED = "STATUS_CODE_NOT_CONNECTED" - STATUS_CODE_NOT_FOUND = "STATUS_CODE_NOT_FOUND" - STATUS_CODE_NOT_UPDATED = "STATUS_CODE_NOT_UPDATED" - STATUS_CODE_OK = "STATUS_CODE_OK" - STATUS_CODE_PEER_ALREADY_EXISTS = "STATUS_CODE_PEER_ALREADY_EXISTS" - STATUS_CODE_SERVER_BUSY = "STATUS_CODE_SERVER_BUSY" - STATUS_CODE_SERVER_ERROR = "STATUS_CODE_SERVER_ERROR" - STATUS_CODE_TIMEOUT = "STATUS_CODE_TIMEOUT" - STATUS_CODE_VALIDATION_ERROR = "STATUS_CODE_VALIDATION_ERROR" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/stock.py b/openapi/openapi_project/openapi_package/models/stock.py deleted file mode 100644 index 0b385c53a..000000000 --- a/openapi/openapi_project/openapi_package/models/stock.py +++ /dev/null @@ -1,309 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.models.exchange_code import ExchangeCode -from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat -from openapi_project.openapi_package.models.security_category import SecurityCategory -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.date import Date - from openapi_project.openapi_package.models.stock_aliases import StockAliases - - -T = TypeVar("T", bound="Stock") - - -@_attrs_define -class Stock: - """ - Attributes: - aliases (Union[Unset, StockAliases]): - currency (Union[Unset, Currency]): - listed_dt (Union[Unset, Date]): - delisted_dt (Union[Unset, Date]): - description (Union[Unset, str]): - exchange_id (Union[Unset, int]): - id (Union[Unset, int]): - multiplier (Union[Unset, float]): - price_base_factor (Union[Unset, float]): - price_display_factor (Union[Unset, float]): - price_display_format (Union[Unset, NumericDisplayFormat]): - qty_display_factor (Union[Unset, float]): - qty_display_format (Union[Unset, NumericDisplayFormat]): - security_category (Union[Unset, SecurityCategory]): - symbol (Union[Unset, str]): - tick_rule (Union[Unset, str]): - tick_size (Union[Unset, float]): - tick_value (Union[Unset, float]): - traded_exchanges (Union[Unset, list[ExchangeCode]]): - category (Union[Unset, str]): - industry (Union[Unset, str]): - lot_size (Union[Unset, int]): - sector (Union[Unset, str]): - """ - - aliases: Union[Unset, "StockAliases"] = UNSET - currency: Unset | Currency = UNSET - listed_dt: Union[Unset, "Date"] = UNSET - delisted_dt: Union[Unset, "Date"] = UNSET - description: Unset | str = UNSET - exchange_id: Unset | int = UNSET - id: Unset | int = UNSET - multiplier: Unset | float = UNSET - price_base_factor: Unset | float = UNSET - price_display_factor: Unset | float = UNSET - price_display_format: Unset | NumericDisplayFormat = UNSET - qty_display_factor: Unset | float = UNSET - qty_display_format: Unset | NumericDisplayFormat = UNSET - security_category: Unset | SecurityCategory = UNSET - symbol: Unset | str = UNSET - tick_rule: Unset | str = UNSET - tick_size: Unset | float = UNSET - tick_value: Unset | float = UNSET - traded_exchanges: Unset | list[ExchangeCode] = UNSET - category: Unset | str = UNSET - industry: Unset | str = UNSET - lot_size: Unset | int = UNSET - sector: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = UNSET - if not isinstance(self.aliases, Unset): - aliases = self.aliases.to_dict() - - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value - - listed_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.listed_dt, Unset): - listed_dt = self.listed_dt.to_dict() - - delisted_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.delisted_dt, Unset): - delisted_dt = self.delisted_dt.to_dict() - - description = self.description - - exchange_id = self.exchange_id - - id = self.id - - multiplier = self.multiplier - - price_base_factor = self.price_base_factor - - price_display_factor = self.price_display_factor - - price_display_format: Unset | str = UNSET - if not isinstance(self.price_display_format, Unset): - price_display_format = self.price_display_format.value - - qty_display_factor = self.qty_display_factor - - qty_display_format: Unset | str = UNSET - if not isinstance(self.qty_display_format, Unset): - qty_display_format = self.qty_display_format.value - - security_category: Unset | str = UNSET - if not isinstance(self.security_category, Unset): - security_category = self.security_category.value - - symbol = self.symbol - - tick_rule = self.tick_rule - - tick_size = self.tick_size - - tick_value = self.tick_value - - traded_exchanges: Unset | list[str] = UNSET - if not isinstance(self.traded_exchanges, Unset): - traded_exchanges = [] - for traded_exchanges_item_data in self.traded_exchanges: - traded_exchanges_item = traded_exchanges_item_data.value - traded_exchanges.append(traded_exchanges_item) - - category = self.category - - industry = self.industry - - lot_size = self.lot_size - - sector = self.sector - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if aliases is not UNSET: - field_dict["aliases"] = aliases - if currency is not UNSET: - field_dict["currency"] = currency - if listed_dt is not UNSET: - field_dict["listedDt"] = listed_dt - if delisted_dt is not UNSET: - field_dict["delistedDt"] = delisted_dt - if description is not UNSET: - field_dict["description"] = description - if exchange_id is not UNSET: - field_dict["exchangeId"] = exchange_id - if id is not UNSET: - field_dict["id"] = id - if multiplier is not UNSET: - field_dict["multiplier"] = multiplier - if price_base_factor is not UNSET: - field_dict["priceBaseFactor"] = price_base_factor - if price_display_factor is not UNSET: - field_dict["priceDisplayFactor"] = price_display_factor - if price_display_format is not UNSET: - field_dict["priceDisplayFormat"] = price_display_format - if qty_display_factor is not UNSET: - field_dict["qtyDisplayFactor"] = qty_display_factor - if qty_display_format is not UNSET: - field_dict["qtyDisplayFormat"] = qty_display_format - if security_category is not UNSET: - field_dict["securityCategory"] = security_category - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tick_rule is not UNSET: - field_dict["tickRule"] = tick_rule - if tick_size is not UNSET: - field_dict["tickSize"] = tick_size - if tick_value is not UNSET: - field_dict["tickValue"] = tick_value - if traded_exchanges is not UNSET: - field_dict["tradedExchanges"] = traded_exchanges - if category is not UNSET: - field_dict["category"] = category - if industry is not UNSET: - field_dict["industry"] = industry - if lot_size is not UNSET: - field_dict["lotSize"] = lot_size - if sector is not UNSET: - field_dict["sector"] = sector - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.date import Date - from openapi_project.openapi_package.models.stock_aliases import StockAliases - - d = dict(src_dict) - _aliases = d.pop("aliases", UNSET) - aliases: Unset | StockAliases - if isinstance(_aliases, Unset): - aliases = UNSET - else: - aliases = StockAliases.from_dict(_aliases) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) - - _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date - if isinstance(_listed_dt, Unset): - listed_dt = UNSET - else: - listed_dt = Date.from_dict(_listed_dt) - - _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date - if isinstance(_delisted_dt, Unset): - delisted_dt = UNSET - else: - delisted_dt = Date.from_dict(_delisted_dt) - - description = d.pop("description", UNSET) - - exchange_id = d.pop("exchangeId", UNSET) - - id = d.pop("id", UNSET) - - multiplier = d.pop("multiplier", UNSET) - - price_base_factor = d.pop("priceBaseFactor", UNSET) - - price_display_factor = d.pop("priceDisplayFactor", UNSET) - - _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat - if isinstance(_price_display_format, Unset): - price_display_format = UNSET - else: - price_display_format = NumericDisplayFormat(_price_display_format) - - qty_display_factor = d.pop("qtyDisplayFactor", UNSET) - - _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat - if isinstance(_qty_display_format, Unset): - qty_display_format = UNSET - else: - qty_display_format = NumericDisplayFormat(_qty_display_format) - - _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory - if isinstance(_security_category, Unset): - security_category = UNSET - else: - security_category = SecurityCategory(_security_category) - - symbol = d.pop("symbol", UNSET) - - tick_rule = d.pop("tickRule", UNSET) - - tick_size = d.pop("tickSize", UNSET) - - tick_value = d.pop("tickValue", UNSET) - - traded_exchanges = [] - _traded_exchanges = d.pop("tradedExchanges", UNSET) - for traded_exchanges_item_data in _traded_exchanges or []: - traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) - - traded_exchanges.append(traded_exchanges_item) - - category = d.pop("category", UNSET) - - industry = d.pop("industry", UNSET) - - lot_size = d.pop("lotSize", UNSET) - - sector = d.pop("sector", UNSET) - - stock = cls( - aliases=aliases, - currency=currency, - listed_dt=listed_dt, - delisted_dt=delisted_dt, - description=description, - exchange_id=exchange_id, - id=id, - multiplier=multiplier, - price_base_factor=price_base_factor, - price_display_factor=price_display_factor, - price_display_format=price_display_format, - qty_display_factor=qty_display_factor, - qty_display_format=qty_display_format, - security_category=security_category, - symbol=symbol, - tick_rule=tick_rule, - tick_size=tick_size, - tick_value=tick_value, - traded_exchanges=traded_exchanges, - category=category, - industry=industry, - lot_size=lot_size, - sector=sector, - ) - - return stock diff --git a/openapi/openapi_project/openapi_package/models/stock_aliases.py b/openapi/openapi_project/openapi_package/models/stock_aliases.py deleted file mode 100644 index 063df1ec8..000000000 --- a/openapi/openapi_project/openapi_package/models/stock_aliases.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="StockAliases") - - -@_attrs_define -class StockAliases: - """ """ - - additional_properties: dict[str, None | str] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - field_dict: dict[str, Any] = {} - for prop_name, prop in self.additional_properties.items(): - field_dict[prop_name] = prop - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - stock_aliases = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> None | str: - if data is None: - return data - return cast(None | str, data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - stock_aliases.additional_properties = additional_properties - return stock_aliases - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> None | str: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: None | str) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi/openapi_project/openapi_package/models/tif.py b/openapi/openapi_project/openapi_package/models/tif.py deleted file mode 100644 index ef5cc26ce..000000000 --- a/openapi/openapi_project/openapi_package/models/tif.py +++ /dev/null @@ -1,17 +0,0 @@ -from enum import Enum - - -class Tif(str, Enum): - TIF_CLO = "TIF_CLO" - TIF_DAY = "TIF_DAY" - TIF_ETH = "TIF_ETH" - TIF_FOK = "TIF_FOK" - TIF_GTC = "TIF_GTC" - TIF_GTD = "TIF_GTD" - TIF_GTX = "TIF_GTX" - TIF_IOC = "TIF_IOC" - TIF_OPG = "TIF_OPG" - TIF_UNKNOWN = "TIF_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/time_of_day.py b/openapi/openapi_project/openapi_package/models/time_of_day.py deleted file mode 100644 index 055d8e5f1..000000000 --- a/openapi/openapi_project/openapi_package/models/time_of_day.py +++ /dev/null @@ -1,67 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="TimeOfDay") - - -@_attrs_define -class TimeOfDay: - """ - Attributes: - hours (Union[Unset, int]): - minutes (Union[Unset, int]): - seconds (Union[Unset, int]): - nanos (Union[Unset, int]): - """ - - hours: Unset | int = UNSET - minutes: Unset | int = UNSET - seconds: Unset | int = UNSET - nanos: Unset | int = UNSET - - def to_dict(self) -> dict[str, Any]: - hours = self.hours - - minutes = self.minutes - - seconds = self.seconds - - nanos = self.nanos - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if hours is not UNSET: - field_dict["hours"] = hours - if minutes is not UNSET: - field_dict["minutes"] = minutes - if seconds is not UNSET: - field_dict["seconds"] = seconds - if nanos is not UNSET: - field_dict["nanos"] = nanos - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - hours = d.pop("hours", UNSET) - - minutes = d.pop("minutes", UNSET) - - seconds = d.pop("seconds", UNSET) - - nanos = d.pop("nanos", UNSET) - - time_of_day = cls( - hours=hours, - minutes=minutes, - seconds=seconds, - nanos=nanos, - ) - - return time_of_day diff --git a/openapi/openapi_project/openapi_package/models/tims_class_group.py b/openapi/openapi_project/openapi_package/models/tims_class_group.py deleted file mode 100644 index a892e00c8..000000000 --- a/openapi/openapi_project/openapi_package/models/tims_class_group.py +++ /dev/null @@ -1,202 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.tims_position_group import TimsPositionGroup - - -T = TypeVar("T", bound="TimsClassGroup") - - -@_attrs_define -class TimsClassGroup: - """ - Attributes: - delta (Union[Unset, float]): - dollar_delta (Union[Unset, float]): - dollar_gamma (Union[Unset, float]): - gamma (Union[Unset, float]): - hc (Union[Unset, float]): - hc_min (Union[Unset, float]): - long_nav (Union[Unset, float]): - margin_req (Union[Unset, float]): - nav (Union[Unset, float]): - pn_l (Union[Unset, list[float]]): - positions (Union[Unset, list['TimsPositionGroup']]): - product_group (Union[Unset, str]): - rho (Union[Unset, float]): - short_nav (Union[Unset, float]): - symbol (Union[Unset, str]): - theta (Union[Unset, float]): - vega (Union[Unset, float]): - """ - - delta: Unset | float = UNSET - dollar_delta: Unset | float = UNSET - dollar_gamma: Unset | float = UNSET - gamma: Unset | float = UNSET - hc: Unset | float = UNSET - hc_min: Unset | float = UNSET - long_nav: Unset | float = UNSET - margin_req: Unset | float = UNSET - nav: Unset | float = UNSET - pn_l: Unset | list[float] = UNSET - positions: Unset | list["TimsPositionGroup"] = UNSET - product_group: Unset | str = UNSET - rho: Unset | float = UNSET - short_nav: Unset | float = UNSET - symbol: Unset | str = UNSET - theta: Unset | float = UNSET - vega: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - delta = self.delta - - dollar_delta = self.dollar_delta - - dollar_gamma = self.dollar_gamma - - gamma = self.gamma - - hc = self.hc - - hc_min = self.hc_min - - long_nav = self.long_nav - - margin_req = self.margin_req - - nav = self.nav - - pn_l: Unset | list[float] = UNSET - if not isinstance(self.pn_l, Unset): - pn_l = self.pn_l - - positions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.positions, Unset): - positions = [] - for positions_item_data in self.positions: - positions_item = positions_item_data.to_dict() - positions.append(positions_item) - - product_group = self.product_group - - rho = self.rho - - short_nav = self.short_nav - - symbol = self.symbol - - theta = self.theta - - vega = self.vega - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if delta is not UNSET: - field_dict["delta"] = delta - if dollar_delta is not UNSET: - field_dict["dollarDelta"] = dollar_delta - if dollar_gamma is not UNSET: - field_dict["dollarGamma"] = dollar_gamma - if gamma is not UNSET: - field_dict["gamma"] = gamma - if hc is not UNSET: - field_dict["hc"] = hc - if hc_min is not UNSET: - field_dict["hcMin"] = hc_min - if long_nav is not UNSET: - field_dict["longNav"] = long_nav - if margin_req is not UNSET: - field_dict["marginReq"] = margin_req - if nav is not UNSET: - field_dict["nav"] = nav - if pn_l is not UNSET: - field_dict["pnL"] = pn_l - if positions is not UNSET: - field_dict["positions"] = positions - if product_group is not UNSET: - field_dict["productGroup"] = product_group - if rho is not UNSET: - field_dict["rho"] = rho - if short_nav is not UNSET: - field_dict["shortNav"] = short_nav - if symbol is not UNSET: - field_dict["symbol"] = symbol - if theta is not UNSET: - field_dict["theta"] = theta - if vega is not UNSET: - field_dict["vega"] = vega - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.tims_position_group import TimsPositionGroup - - d = dict(src_dict) - delta = d.pop("delta", UNSET) - - dollar_delta = d.pop("dollarDelta", UNSET) - - dollar_gamma = d.pop("dollarGamma", UNSET) - - gamma = d.pop("gamma", UNSET) - - hc = d.pop("hc", UNSET) - - hc_min = d.pop("hcMin", UNSET) - - long_nav = d.pop("longNav", UNSET) - - margin_req = d.pop("marginReq", UNSET) - - nav = d.pop("nav", UNSET) - - pn_l = cast(list[float], d.pop("pnL", UNSET)) - - positions = [] - _positions = d.pop("positions", UNSET) - for positions_item_data in _positions or []: - positions_item = TimsPositionGroup.from_dict(positions_item_data) - - positions.append(positions_item) - - product_group = d.pop("productGroup", UNSET) - - rho = d.pop("rho", UNSET) - - short_nav = d.pop("shortNav", UNSET) - - symbol = d.pop("symbol", UNSET) - - theta = d.pop("theta", UNSET) - - vega = d.pop("vega", UNSET) - - tims_class_group = cls( - delta=delta, - dollar_delta=dollar_delta, - dollar_gamma=dollar_gamma, - gamma=gamma, - hc=hc, - hc_min=hc_min, - long_nav=long_nav, - margin_req=margin_req, - nav=nav, - pn_l=pn_l, - positions=positions, - product_group=product_group, - rho=rho, - short_nav=short_nav, - symbol=symbol, - theta=theta, - vega=vega, - ) - - return tims_class_group diff --git a/openapi/openapi_project/openapi_package/models/tims_margin_data.py b/openapi/openapi_project/openapi_package/models/tims_margin_data.py deleted file mode 100644 index 2526c84ac..000000000 --- a/openapi/openapi_project/openapi_package/models/tims_margin_data.py +++ /dev/null @@ -1,220 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.tims_class_group import TimsClassGroup - from openapi_project.openapi_package.models.tims_product_group import TimsProductGroup - - -T = TypeVar("T", bound="TimsMarginData") - - -@_attrs_define -class TimsMarginData: - """ - Attributes: - account_type (Union[Unset, str]): - class_group_count (Union[Unset, int]): - class_groups (Union[Unset, list['TimsClassGroup']]): - currency (Union[Unset, Currency]): - dollar_delta (Union[Unset, float]): - dollar_gamma (Union[Unset, float]): - long_nav (Union[Unset, float]): - margin_req (Union[Unset, float]): - nav (Union[Unset, float]): - porfolio_group_count (Union[Unset, int]): - position_group_count (Union[Unset, int]): - product_group_count (Union[Unset, int]): - product_groups (Union[Unset, list['TimsProductGroup']]): - rho (Union[Unset, float]): - short_nav (Union[Unset, float]): - theta (Union[Unset, float]): - vega (Union[Unset, float]): - """ - - account_type: Unset | str = UNSET - class_group_count: Unset | int = UNSET - class_groups: Unset | list["TimsClassGroup"] = UNSET - currency: Unset | Currency = UNSET - dollar_delta: Unset | float = UNSET - dollar_gamma: Unset | float = UNSET - long_nav: Unset | float = UNSET - margin_req: Unset | float = UNSET - nav: Unset | float = UNSET - porfolio_group_count: Unset | int = UNSET - position_group_count: Unset | int = UNSET - product_group_count: Unset | int = UNSET - product_groups: Unset | list["TimsProductGroup"] = UNSET - rho: Unset | float = UNSET - short_nav: Unset | float = UNSET - theta: Unset | float = UNSET - vega: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - account_type = self.account_type - - class_group_count = self.class_group_count - - class_groups: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.class_groups, Unset): - class_groups = [] - for class_groups_item_data in self.class_groups: - class_groups_item = class_groups_item_data.to_dict() - class_groups.append(class_groups_item) - - currency: Unset | str = UNSET - if not isinstance(self.currency, Unset): - currency = self.currency.value - - dollar_delta = self.dollar_delta - - dollar_gamma = self.dollar_gamma - - long_nav = self.long_nav - - margin_req = self.margin_req - - nav = self.nav - - porfolio_group_count = self.porfolio_group_count - - position_group_count = self.position_group_count - - product_group_count = self.product_group_count - - product_groups: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.product_groups, Unset): - product_groups = [] - for product_groups_item_data in self.product_groups: - product_groups_item = product_groups_item_data.to_dict() - product_groups.append(product_groups_item) - - rho = self.rho - - short_nav = self.short_nav - - theta = self.theta - - vega = self.vega - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_type is not UNSET: - field_dict["accountType"] = account_type - if class_group_count is not UNSET: - field_dict["classGroupCount"] = class_group_count - if class_groups is not UNSET: - field_dict["classGroups"] = class_groups - if currency is not UNSET: - field_dict["currency"] = currency - if dollar_delta is not UNSET: - field_dict["dollarDelta"] = dollar_delta - if dollar_gamma is not UNSET: - field_dict["dollarGamma"] = dollar_gamma - if long_nav is not UNSET: - field_dict["longNav"] = long_nav - if margin_req is not UNSET: - field_dict["marginReq"] = margin_req - if nav is not UNSET: - field_dict["nav"] = nav - if porfolio_group_count is not UNSET: - field_dict["porfolioGroupCount"] = porfolio_group_count - if position_group_count is not UNSET: - field_dict["positionGroupCount"] = position_group_count - if product_group_count is not UNSET: - field_dict["productGroupCount"] = product_group_count - if product_groups is not UNSET: - field_dict["productGroups"] = product_groups - if rho is not UNSET: - field_dict["rho"] = rho - if short_nav is not UNSET: - field_dict["shortNav"] = short_nav - if theta is not UNSET: - field_dict["theta"] = theta - if vega is not UNSET: - field_dict["vega"] = vega - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.tims_class_group import TimsClassGroup - from openapi_project.openapi_package.models.tims_product_group import TimsProductGroup - - d = dict(src_dict) - account_type = d.pop("accountType", UNSET) - - class_group_count = d.pop("classGroupCount", UNSET) - - class_groups = [] - _class_groups = d.pop("classGroups", UNSET) - for class_groups_item_data in _class_groups or []: - class_groups_item = TimsClassGroup.from_dict(class_groups_item_data) - - class_groups.append(class_groups_item) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency - if isinstance(_currency, Unset): - currency = UNSET - else: - currency = Currency(_currency) - - dollar_delta = d.pop("dollarDelta", UNSET) - - dollar_gamma = d.pop("dollarGamma", UNSET) - - long_nav = d.pop("longNav", UNSET) - - margin_req = d.pop("marginReq", UNSET) - - nav = d.pop("nav", UNSET) - - porfolio_group_count = d.pop("porfolioGroupCount", UNSET) - - position_group_count = d.pop("positionGroupCount", UNSET) - - product_group_count = d.pop("productGroupCount", UNSET) - - product_groups = [] - _product_groups = d.pop("productGroups", UNSET) - for product_groups_item_data in _product_groups or []: - product_groups_item = TimsProductGroup.from_dict(product_groups_item_data) - - product_groups.append(product_groups_item) - - rho = d.pop("rho", UNSET) - - short_nav = d.pop("shortNav", UNSET) - - theta = d.pop("theta", UNSET) - - vega = d.pop("vega", UNSET) - - tims_margin_data = cls( - account_type=account_type, - class_group_count=class_group_count, - class_groups=class_groups, - currency=currency, - dollar_delta=dollar_delta, - dollar_gamma=dollar_gamma, - long_nav=long_nav, - margin_req=margin_req, - nav=nav, - porfolio_group_count=porfolio_group_count, - position_group_count=position_group_count, - product_group_count=product_group_count, - product_groups=product_groups, - rho=rho, - short_nav=short_nav, - theta=theta, - vega=vega, - ) - - return tims_margin_data diff --git a/openapi/openapi_project/openapi_package/models/tims_position_group.py b/openapi/openapi_project/openapi_package/models/tims_position_group.py deleted file mode 100644 index 93ca7af4f..000000000 --- a/openapi/openapi_project/openapi_package/models/tims_position_group.py +++ /dev/null @@ -1,159 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="TimsPositionGroup") - - -@_attrs_define -class TimsPositionGroup: - """ - Attributes: - delta (Union[Unset, float]): - gamma (Union[Unset, float]): - hc_min (Union[Unset, float]): - hc_minval (Union[Unset, float]): - margin_req (Union[Unset, float]): - nav (Union[Unset, float]): - pn_l (Union[Unset, list[float]]): - price (Union[Unset, float]): - qty (Union[Unset, float]): - rho (Union[Unset, float]): - rpg_root (Union[Unset, str]): - symbol (Union[Unset, str]): - theta (Union[Unset, float]): - vega (Union[Unset, float]): - """ - - delta: Unset | float = UNSET - gamma: Unset | float = UNSET - hc_min: Unset | float = UNSET - hc_minval: Unset | float = UNSET - margin_req: Unset | float = UNSET - nav: Unset | float = UNSET - pn_l: Unset | list[float] = UNSET - price: Unset | float = UNSET - qty: Unset | float = UNSET - rho: Unset | float = UNSET - rpg_root: Unset | str = UNSET - symbol: Unset | str = UNSET - theta: Unset | float = UNSET - vega: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - delta = self.delta - - gamma = self.gamma - - hc_min = self.hc_min - - hc_minval = self.hc_minval - - margin_req = self.margin_req - - nav = self.nav - - pn_l: Unset | list[float] = UNSET - if not isinstance(self.pn_l, Unset): - pn_l = self.pn_l - - price = self.price - - qty = self.qty - - rho = self.rho - - rpg_root = self.rpg_root - - symbol = self.symbol - - theta = self.theta - - vega = self.vega - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if delta is not UNSET: - field_dict["delta"] = delta - if gamma is not UNSET: - field_dict["gamma"] = gamma - if hc_min is not UNSET: - field_dict["hcMin"] = hc_min - if hc_minval is not UNSET: - field_dict["hcMinval"] = hc_minval - if margin_req is not UNSET: - field_dict["marginReq"] = margin_req - if nav is not UNSET: - field_dict["nav"] = nav - if pn_l is not UNSET: - field_dict["pnL"] = pn_l - if price is not UNSET: - field_dict["price"] = price - if qty is not UNSET: - field_dict["qty"] = qty - if rho is not UNSET: - field_dict["rho"] = rho - if rpg_root is not UNSET: - field_dict["rpgRoot"] = rpg_root - if symbol is not UNSET: - field_dict["symbol"] = symbol - if theta is not UNSET: - field_dict["theta"] = theta - if vega is not UNSET: - field_dict["vega"] = vega - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - delta = d.pop("delta", UNSET) - - gamma = d.pop("gamma", UNSET) - - hc_min = d.pop("hcMin", UNSET) - - hc_minval = d.pop("hcMinval", UNSET) - - margin_req = d.pop("marginReq", UNSET) - - nav = d.pop("nav", UNSET) - - pn_l = cast(list[float], d.pop("pnL", UNSET)) - - price = d.pop("price", UNSET) - - qty = d.pop("qty", UNSET) - - rho = d.pop("rho", UNSET) - - rpg_root = d.pop("rpgRoot", UNSET) - - symbol = d.pop("symbol", UNSET) - - theta = d.pop("theta", UNSET) - - vega = d.pop("vega", UNSET) - - tims_position_group = cls( - delta=delta, - gamma=gamma, - hc_min=hc_min, - hc_minval=hc_minval, - margin_req=margin_req, - nav=nav, - pn_l=pn_l, - price=price, - qty=qty, - rho=rho, - rpg_root=rpg_root, - symbol=symbol, - theta=theta, - vega=vega, - ) - - return tims_position_group diff --git a/openapi/openapi_project/openapi_package/models/tims_product_group.py b/openapi/openapi_project/openapi_package/models/tims_product_group.py deleted file mode 100644 index 5997a224a..000000000 --- a/openapi/openapi_project/openapi_package/models/tims_product_group.py +++ /dev/null @@ -1,177 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="TimsProductGroup") - - -@_attrs_define -class TimsProductGroup: - """ - Attributes: - delta (Union[Unset, float]): - dollar_delta (Union[Unset, float]): - dollar_gamma (Union[Unset, float]): - gamma (Union[Unset, float]): - group (Union[Unset, str]): - hc (Union[Unset, float]): - hc_min (Union[Unset, float]): - long_nav (Union[Unset, float]): - margin_req (Union[Unset, float]): - nav (Union[Unset, float]): - pn_l_range (Union[Unset, list[float]]): - portfolio_group (Union[Unset, str]): - rho (Union[Unset, float]): - short_nav (Union[Unset, float]): - theta (Union[Unset, float]): - vega (Union[Unset, float]): - """ - - delta: Unset | float = UNSET - dollar_delta: Unset | float = UNSET - dollar_gamma: Unset | float = UNSET - gamma: Unset | float = UNSET - group: Unset | str = UNSET - hc: Unset | float = UNSET - hc_min: Unset | float = UNSET - long_nav: Unset | float = UNSET - margin_req: Unset | float = UNSET - nav: Unset | float = UNSET - pn_l_range: Unset | list[float] = UNSET - portfolio_group: Unset | str = UNSET - rho: Unset | float = UNSET - short_nav: Unset | float = UNSET - theta: Unset | float = UNSET - vega: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - delta = self.delta - - dollar_delta = self.dollar_delta - - dollar_gamma = self.dollar_gamma - - gamma = self.gamma - - group = self.group - - hc = self.hc - - hc_min = self.hc_min - - long_nav = self.long_nav - - margin_req = self.margin_req - - nav = self.nav - - pn_l_range: Unset | list[float] = UNSET - if not isinstance(self.pn_l_range, Unset): - pn_l_range = self.pn_l_range - - portfolio_group = self.portfolio_group - - rho = self.rho - - short_nav = self.short_nav - - theta = self.theta - - vega = self.vega - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if delta is not UNSET: - field_dict["delta"] = delta - if dollar_delta is not UNSET: - field_dict["dollarDelta"] = dollar_delta - if dollar_gamma is not UNSET: - field_dict["dollarGamma"] = dollar_gamma - if gamma is not UNSET: - field_dict["gamma"] = gamma - if group is not UNSET: - field_dict["group"] = group - if hc is not UNSET: - field_dict["hc"] = hc - if hc_min is not UNSET: - field_dict["hcMin"] = hc_min - if long_nav is not UNSET: - field_dict["longNav"] = long_nav - if margin_req is not UNSET: - field_dict["marginReq"] = margin_req - if nav is not UNSET: - field_dict["nav"] = nav - if pn_l_range is not UNSET: - field_dict["pnLRange"] = pn_l_range - if portfolio_group is not UNSET: - field_dict["portfolioGroup"] = portfolio_group - if rho is not UNSET: - field_dict["rho"] = rho - if short_nav is not UNSET: - field_dict["shortNav"] = short_nav - if theta is not UNSET: - field_dict["theta"] = theta - if vega is not UNSET: - field_dict["vega"] = vega - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - delta = d.pop("delta", UNSET) - - dollar_delta = d.pop("dollarDelta", UNSET) - - dollar_gamma = d.pop("dollarGamma", UNSET) - - gamma = d.pop("gamma", UNSET) - - group = d.pop("group", UNSET) - - hc = d.pop("hc", UNSET) - - hc_min = d.pop("hcMin", UNSET) - - long_nav = d.pop("longNav", UNSET) - - margin_req = d.pop("marginReq", UNSET) - - nav = d.pop("nav", UNSET) - - pn_l_range = cast(list[float], d.pop("pnLRange", UNSET)) - - portfolio_group = d.pop("portfolioGroup", UNSET) - - rho = d.pop("rho", UNSET) - - short_nav = d.pop("shortNav", UNSET) - - theta = d.pop("theta", UNSET) - - vega = d.pop("vega", UNSET) - - tims_product_group = cls( - delta=delta, - dollar_delta=dollar_delta, - dollar_gamma=dollar_gamma, - gamma=gamma, - group=group, - hc=hc, - hc_min=hc_min, - long_nav=long_nav, - margin_req=margin_req, - nav=nav, - pn_l_range=pn_l_range, - portfolio_group=portfolio_group, - rho=rho, - short_nav=short_nav, - theta=theta, - vega=vega, - ) - - return tims_product_group diff --git a/openapi/openapi_project/openapi_package/models/trade_confirm.py b/openapi/openapi_project/openapi_package/models/trade_confirm.py deleted file mode 100644 index c5b5e0731..000000000 --- a/openapi/openapi_project/openapi_package/models/trade_confirm.py +++ /dev/null @@ -1,935 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.capacity_code import CapacityCode -from openapi_project.openapi_package.models.clearing_range import ClearingRange -from openapi_project.openapi_package.models.cross_side_type import CrossSideType -from openapi_project.openapi_package.models.cross_type import CrossType -from openapi_project.openapi_package.models.exec_type import ExecType -from openapi_project.openapi_package.models.multi_leg_reporting_type import MultiLegReportingType -from openapi_project.openapi_package.models.option_exercise_style import OptionExerciseStyle -from openapi_project.openapi_package.models.option_settlement_type import OptionSettlementType -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.origination_type import OriginationType -from openapi_project.openapi_package.models.position_effect import PositionEffect -from openapi_project.openapi_package.models.price_type import PriceType -from openapi_project.openapi_package.models.put_call import PutCall -from openapi_project.openapi_package.models.security_type import SecurityType -from openapi_project.openapi_package.models.side import Side -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.date import Date - - -T = TypeVar("T", bound="TradeConfirm") - - -@_attrs_define -class TradeConfirm: - """ - Attributes: - account_id (Union[Unset, int]): - account_name (Union[Unset, str]): - alloc_id (Union[Unset, str]): - alloc_qty (Union[Unset, float]): - aux_price (Union[Unset, float]): - avg_price (Union[Unset, float]): - billing_code (Union[Unset, str]): - capacity (Union[Unset, CapacityCode]): - clearing_account (Union[Unset, str]): - clearing_range (Union[Unset, ClearingRange]): - client_id (Union[Unset, str]): - cmta (Union[Unset, str]): - commission (Union[Unset, float]): - cross_side_type (Union[Unset, CrossSideType]): - cross_type (Union[Unset, CrossType]): - cum_qty (Union[Unset, float]): - cur_ord_id (Union[Unset, str]): - deliver_to_compid (Union[Unset, str]): - deliver_to_subid (Union[Unset, str]): - description (Union[Unset, str]): - drop (Union[Unset, bool]): - efid (Union[Unset, str]): - exec_broker (Union[Unset, str]): - exec_id (Union[Unset, str]): - exec_ref_id (Union[Unset, str]): - exec_type (Union[Unset, ExecType]): - exercise_style (Union[Unset, OptionExerciseStyle]): - expiration_dt (Union[Unset, Date]): - fee1 (Union[Unset, float]): - fee2 (Union[Unset, float]): - frequent_trader_id (Union[Unset, str]): - give_up (Union[Unset, str]): - id (Union[Unset, int]): - incoming_cl_ord_id (Union[Unset, str]): - incoming_ord_id (Union[Unset, str]): - incoming_orig_clord_id (Union[Unset, str]): - last_market (Union[Unset, str]): - last_price (Union[Unset, float]): - last_qty (Union[Unset, float]): - leaves_qty (Union[Unset, float]): - leg_id (Union[Unset, str]): - liquidity_flag (Union[Unset, str]): - locate_id (Union[Unset, str]): - mpid (Union[Unset, str]): - multi_leg_reportingtype (Union[Unset, MultiLegReportingType]): - ord_type (Union[Unset, OrdType]): - origination_type (Union[Unset, OriginationType]): - orig_ord_id (Union[Unset, str]): - parent_ord_id (Union[Unset, str]): - perm_ord_id (Union[Unset, str]): - position_effect (Union[Unset, PositionEffect]): - price (Union[Unset, float]): - price_type (Union[Unset, PriceType]): - put_call (Union[Unset, PutCall]): - qty (Union[Unset, float]): - req_ord_id (Union[Unset, str]): - root (Union[Unset, str]): - route (Union[Unset, str]): - routing_session (Union[Unset, str]): - security_type (Union[Unset, SecurityType]): - settlement_type (Union[Unset, OptionSettlementType]): - side (Union[Unset, Side]): - source (Union[Unset, str]): - source_address (Union[Unset, str]): - strategy_id (Union[Unset, str]): - strike (Union[Unset, float]): - symbol (Union[Unset, str]): - tag (Union[Unset, str]): - tag1 (Union[Unset, str]): - target_comp_id (Union[Unset, str]): - target_sub_id (Union[Unset, str]): - text (Union[Unset, str]): - tif (Union[Unset, Tif]): - traded_dt (Union[Unset, Date]): - trader_id (Union[Unset, str]): - trading_firm_id (Union[Unset, int]): - transact_ts (Union[Unset, str]): - underlying (Union[Unset, str]): - user_id (Union[Unset, int]): - working_qty (Union[Unset, float]): - multiplier (Union[Unset, float]): - dac_delta (Union[Unset, float]): - dac_reference_price (Union[Unset, float]): - manual_fill_time (Union[Unset, str]): - """ - - account_id: Unset | int = UNSET - account_name: Unset | str = UNSET - alloc_id: Unset | str = UNSET - alloc_qty: Unset | float = UNSET - aux_price: Unset | float = UNSET - avg_price: Unset | float = UNSET - billing_code: Unset | str = UNSET - capacity: Unset | CapacityCode = UNSET - clearing_account: Unset | str = UNSET - clearing_range: Unset | ClearingRange = UNSET - client_id: Unset | str = UNSET - cmta: Unset | str = UNSET - commission: Unset | float = UNSET - cross_side_type: Unset | CrossSideType = UNSET - cross_type: Unset | CrossType = UNSET - cum_qty: Unset | float = UNSET - cur_ord_id: Unset | str = UNSET - deliver_to_compid: Unset | str = UNSET - deliver_to_subid: Unset | str = UNSET - description: Unset | str = UNSET - drop: Unset | bool = UNSET - efid: Unset | str = UNSET - exec_broker: Unset | str = UNSET - exec_id: Unset | str = UNSET - exec_ref_id: Unset | str = UNSET - exec_type: Unset | ExecType = UNSET - exercise_style: Unset | OptionExerciseStyle = UNSET - expiration_dt: Union[Unset, "Date"] = UNSET - fee1: Unset | float = UNSET - fee2: Unset | float = UNSET - frequent_trader_id: Unset | str = UNSET - give_up: Unset | str = UNSET - id: Unset | int = UNSET - incoming_cl_ord_id: Unset | str = UNSET - incoming_ord_id: Unset | str = UNSET - incoming_orig_clord_id: Unset | str = UNSET - last_market: Unset | str = UNSET - last_price: Unset | float = UNSET - last_qty: Unset | float = UNSET - leaves_qty: Unset | float = UNSET - leg_id: Unset | str = UNSET - liquidity_flag: Unset | str = UNSET - locate_id: Unset | str = UNSET - mpid: Unset | str = UNSET - multi_leg_reportingtype: Unset | MultiLegReportingType = UNSET - ord_type: Unset | OrdType = UNSET - origination_type: Unset | OriginationType = UNSET - orig_ord_id: Unset | str = UNSET - parent_ord_id: Unset | str = UNSET - perm_ord_id: Unset | str = UNSET - position_effect: Unset | PositionEffect = UNSET - price: Unset | float = UNSET - price_type: Unset | PriceType = UNSET - put_call: Unset | PutCall = UNSET - qty: Unset | float = UNSET - req_ord_id: Unset | str = UNSET - root: Unset | str = UNSET - route: Unset | str = UNSET - routing_session: Unset | str = UNSET - security_type: Unset | SecurityType = UNSET - settlement_type: Unset | OptionSettlementType = UNSET - side: Unset | Side = UNSET - source: Unset | str = UNSET - source_address: Unset | str = UNSET - strategy_id: Unset | str = UNSET - strike: Unset | float = UNSET - symbol: Unset | str = UNSET - tag: Unset | str = UNSET - tag1: Unset | str = UNSET - target_comp_id: Unset | str = UNSET - target_sub_id: Unset | str = UNSET - text: Unset | str = UNSET - tif: Unset | Tif = UNSET - traded_dt: Union[Unset, "Date"] = UNSET - trader_id: Unset | str = UNSET - trading_firm_id: Unset | int = UNSET - transact_ts: Unset | str = UNSET - underlying: Unset | str = UNSET - user_id: Unset | int = UNSET - working_qty: Unset | float = UNSET - multiplier: Unset | float = UNSET - dac_delta: Unset | float = UNSET - dac_reference_price: Unset | float = UNSET - manual_fill_time: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - account_name = self.account_name - - alloc_id = self.alloc_id - - alloc_qty = self.alloc_qty - - aux_price = self.aux_price - - avg_price = self.avg_price - - billing_code = self.billing_code - - capacity: Unset | str = UNSET - if not isinstance(self.capacity, Unset): - capacity = self.capacity.value - - clearing_account = self.clearing_account - - clearing_range: Unset | str = UNSET - if not isinstance(self.clearing_range, Unset): - clearing_range = self.clearing_range.value - - client_id = self.client_id - - cmta = self.cmta - - commission = self.commission - - cross_side_type: Unset | str = UNSET - if not isinstance(self.cross_side_type, Unset): - cross_side_type = self.cross_side_type.value - - cross_type: Unset | str = UNSET - if not isinstance(self.cross_type, Unset): - cross_type = self.cross_type.value - - cum_qty = self.cum_qty - - cur_ord_id = self.cur_ord_id - - deliver_to_compid = self.deliver_to_compid - - deliver_to_subid = self.deliver_to_subid - - description = self.description - - drop = self.drop - - efid = self.efid - - exec_broker = self.exec_broker - - exec_id = self.exec_id - - exec_ref_id = self.exec_ref_id - - exec_type: Unset | str = UNSET - if not isinstance(self.exec_type, Unset): - exec_type = self.exec_type.value - - exercise_style: Unset | str = UNSET - if not isinstance(self.exercise_style, Unset): - exercise_style = self.exercise_style.value - - expiration_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.expiration_dt, Unset): - expiration_dt = self.expiration_dt.to_dict() - - fee1 = self.fee1 - - fee2 = self.fee2 - - frequent_trader_id = self.frequent_trader_id - - give_up = self.give_up - - id = self.id - - incoming_cl_ord_id = self.incoming_cl_ord_id - - incoming_ord_id = self.incoming_ord_id - - incoming_orig_clord_id = self.incoming_orig_clord_id - - last_market = self.last_market - - last_price = self.last_price - - last_qty = self.last_qty - - leaves_qty = self.leaves_qty - - leg_id = self.leg_id - - liquidity_flag = self.liquidity_flag - - locate_id = self.locate_id - - mpid = self.mpid - - multi_leg_reportingtype: Unset | str = UNSET - if not isinstance(self.multi_leg_reportingtype, Unset): - multi_leg_reportingtype = self.multi_leg_reportingtype.value - - ord_type: Unset | str = UNSET - if not isinstance(self.ord_type, Unset): - ord_type = self.ord_type.value - - origination_type: Unset | str = UNSET - if not isinstance(self.origination_type, Unset): - origination_type = self.origination_type.value - - orig_ord_id = self.orig_ord_id - - parent_ord_id = self.parent_ord_id - - perm_ord_id = self.perm_ord_id - - position_effect: Unset | str = UNSET - if not isinstance(self.position_effect, Unset): - position_effect = self.position_effect.value - - price = self.price - - price_type: Unset | str = UNSET - if not isinstance(self.price_type, Unset): - price_type = self.price_type.value - - put_call: Unset | str = UNSET - if not isinstance(self.put_call, Unset): - put_call = self.put_call.value - - qty = self.qty - - req_ord_id = self.req_ord_id - - root = self.root - - route = self.route - - routing_session = self.routing_session - - security_type: Unset | str = UNSET - if not isinstance(self.security_type, Unset): - security_type = self.security_type.value - - settlement_type: Unset | str = UNSET - if not isinstance(self.settlement_type, Unset): - settlement_type = self.settlement_type.value - - side: Unset | str = UNSET - if not isinstance(self.side, Unset): - side = self.side.value - - source = self.source - - source_address = self.source_address - - strategy_id = self.strategy_id - - strike = self.strike - - symbol = self.symbol - - tag = self.tag - - tag1 = self.tag1 - - target_comp_id = self.target_comp_id - - target_sub_id = self.target_sub_id - - text = self.text - - tif: Unset | str = UNSET - if not isinstance(self.tif, Unset): - tif = self.tif.value - - traded_dt: Unset | dict[str, Any] = UNSET - if not isinstance(self.traded_dt, Unset): - traded_dt = self.traded_dt.to_dict() - - trader_id = self.trader_id - - trading_firm_id = self.trading_firm_id - - transact_ts = self.transact_ts - - underlying = self.underlying - - user_id = self.user_id - - working_qty = self.working_qty - - multiplier = self.multiplier - - dac_delta = self.dac_delta - - dac_reference_price = self.dac_reference_price - - manual_fill_time = self.manual_fill_time - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if account_name is not UNSET: - field_dict["accountName"] = account_name - if alloc_id is not UNSET: - field_dict["allocId"] = alloc_id - if alloc_qty is not UNSET: - field_dict["allocQty"] = alloc_qty - if aux_price is not UNSET: - field_dict["auxPrice"] = aux_price - if avg_price is not UNSET: - field_dict["avgPrice"] = avg_price - if billing_code is not UNSET: - field_dict["billingCode"] = billing_code - if capacity is not UNSET: - field_dict["capacity"] = capacity - if clearing_account is not UNSET: - field_dict["clearingAccount"] = clearing_account - if clearing_range is not UNSET: - field_dict["clearingRange"] = clearing_range - if client_id is not UNSET: - field_dict["clientId"] = client_id - if cmta is not UNSET: - field_dict["cmta"] = cmta - if commission is not UNSET: - field_dict["commission"] = commission - if cross_side_type is not UNSET: - field_dict["crossSideType"] = cross_side_type - if cross_type is not UNSET: - field_dict["crossType"] = cross_type - if cum_qty is not UNSET: - field_dict["cumQty"] = cum_qty - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if deliver_to_compid is not UNSET: - field_dict["deliverToCompid"] = deliver_to_compid - if deliver_to_subid is not UNSET: - field_dict["deliverToSubid"] = deliver_to_subid - if description is not UNSET: - field_dict["description"] = description - if drop is not UNSET: - field_dict["drop"] = drop - if efid is not UNSET: - field_dict["efid"] = efid - if exec_broker is not UNSET: - field_dict["execBroker"] = exec_broker - if exec_id is not UNSET: - field_dict["execId"] = exec_id - if exec_ref_id is not UNSET: - field_dict["execRefId"] = exec_ref_id - if exec_type is not UNSET: - field_dict["execType"] = exec_type - if exercise_style is not UNSET: - field_dict["exerciseStyle"] = exercise_style - if expiration_dt is not UNSET: - field_dict["expirationDt"] = expiration_dt - if fee1 is not UNSET: - field_dict["fee1"] = fee1 - if fee2 is not UNSET: - field_dict["fee2"] = fee2 - if frequent_trader_id is not UNSET: - field_dict["frequentTraderId"] = frequent_trader_id - if give_up is not UNSET: - field_dict["giveUp"] = give_up - if id is not UNSET: - field_dict["id"] = id - if incoming_cl_ord_id is not UNSET: - field_dict["incomingClOrdId"] = incoming_cl_ord_id - if incoming_ord_id is not UNSET: - field_dict["incomingOrdId"] = incoming_ord_id - if incoming_orig_clord_id is not UNSET: - field_dict["incomingOrigClordId"] = incoming_orig_clord_id - if last_market is not UNSET: - field_dict["lastMarket"] = last_market - if last_price is not UNSET: - field_dict["lastPrice"] = last_price - if last_qty is not UNSET: - field_dict["lastQty"] = last_qty - if leaves_qty is not UNSET: - field_dict["leavesQty"] = leaves_qty - if leg_id is not UNSET: - field_dict["legId"] = leg_id - if liquidity_flag is not UNSET: - field_dict["liquidityFlag"] = liquidity_flag - if locate_id is not UNSET: - field_dict["locateId"] = locate_id - if mpid is not UNSET: - field_dict["mpid"] = mpid - if multi_leg_reportingtype is not UNSET: - field_dict["multiLegReportingtype"] = multi_leg_reportingtype - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if origination_type is not UNSET: - field_dict["originationType"] = origination_type - if orig_ord_id is not UNSET: - field_dict["origOrdId"] = orig_ord_id - if parent_ord_id is not UNSET: - field_dict["parentOrdId"] = parent_ord_id - if perm_ord_id is not UNSET: - field_dict["permOrdId"] = perm_ord_id - if position_effect is not UNSET: - field_dict["positionEffect"] = position_effect - if price is not UNSET: - field_dict["price"] = price - if price_type is not UNSET: - field_dict["priceType"] = price_type - if put_call is not UNSET: - field_dict["putCall"] = put_call - if qty is not UNSET: - field_dict["qty"] = qty - if req_ord_id is not UNSET: - field_dict["reqOrdId"] = req_ord_id - if root is not UNSET: - field_dict["root"] = root - if route is not UNSET: - field_dict["route"] = route - if routing_session is not UNSET: - field_dict["routingSession"] = routing_session - if security_type is not UNSET: - field_dict["securityType"] = security_type - if settlement_type is not UNSET: - field_dict["settlementType"] = settlement_type - if side is not UNSET: - field_dict["side"] = side - if source is not UNSET: - field_dict["source"] = source - if source_address is not UNSET: - field_dict["sourceAddress"] = source_address - if strategy_id is not UNSET: - field_dict["strategyId"] = strategy_id - if strike is not UNSET: - field_dict["strike"] = strike - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tag is not UNSET: - field_dict["tag"] = tag - if tag1 is not UNSET: - field_dict["tag1"] = tag1 - if target_comp_id is not UNSET: - field_dict["targetCompId"] = target_comp_id - if target_sub_id is not UNSET: - field_dict["targetSubId"] = target_sub_id - if text is not UNSET: - field_dict["text"] = text - if tif is not UNSET: - field_dict["tif"] = tif - if traded_dt is not UNSET: - field_dict["tradedDt"] = traded_dt - if trader_id is not UNSET: - field_dict["traderId"] = trader_id - if trading_firm_id is not UNSET: - field_dict["tradingFirmId"] = trading_firm_id - if transact_ts is not UNSET: - field_dict["transactTs"] = transact_ts - if underlying is not UNSET: - field_dict["underlying"] = underlying - if user_id is not UNSET: - field_dict["userId"] = user_id - if working_qty is not UNSET: - field_dict["workingQty"] = working_qty - if multiplier is not UNSET: - field_dict["multiplier"] = multiplier - if dac_delta is not UNSET: - field_dict["dacDelta"] = dac_delta - if dac_reference_price is not UNSET: - field_dict["dacReferencePrice"] = dac_reference_price - if manual_fill_time is not UNSET: - field_dict["manualFillTime"] = manual_fill_time - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.date import Date - - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - account_name = d.pop("accountName", UNSET) - - alloc_id = d.pop("allocId", UNSET) - - alloc_qty = d.pop("allocQty", UNSET) - - aux_price = d.pop("auxPrice", UNSET) - - avg_price = d.pop("avgPrice", UNSET) - - billing_code = d.pop("billingCode", UNSET) - - _capacity = d.pop("capacity", UNSET) - capacity: Unset | CapacityCode - if isinstance(_capacity, Unset): - capacity = UNSET - else: - capacity = CapacityCode(_capacity) - - clearing_account = d.pop("clearingAccount", UNSET) - - _clearing_range = d.pop("clearingRange", UNSET) - clearing_range: Unset | ClearingRange - if isinstance(_clearing_range, Unset): - clearing_range = UNSET - else: - clearing_range = ClearingRange(_clearing_range) - - client_id = d.pop("clientId", UNSET) - - cmta = d.pop("cmta", UNSET) - - commission = d.pop("commission", UNSET) - - _cross_side_type = d.pop("crossSideType", UNSET) - cross_side_type: Unset | CrossSideType - if isinstance(_cross_side_type, Unset): - cross_side_type = UNSET - else: - cross_side_type = CrossSideType(_cross_side_type) - - _cross_type = d.pop("crossType", UNSET) - cross_type: Unset | CrossType - if isinstance(_cross_type, Unset): - cross_type = UNSET - else: - cross_type = CrossType(_cross_type) - - cum_qty = d.pop("cumQty", UNSET) - - cur_ord_id = d.pop("curOrdId", UNSET) - - deliver_to_compid = d.pop("deliverToCompid", UNSET) - - deliver_to_subid = d.pop("deliverToSubid", UNSET) - - description = d.pop("description", UNSET) - - drop = d.pop("drop", UNSET) - - efid = d.pop("efid", UNSET) - - exec_broker = d.pop("execBroker", UNSET) - - exec_id = d.pop("execId", UNSET) - - exec_ref_id = d.pop("execRefId", UNSET) - - _exec_type = d.pop("execType", UNSET) - exec_type: Unset | ExecType - if isinstance(_exec_type, Unset): - exec_type = UNSET - else: - exec_type = ExecType(_exec_type) - - _exercise_style = d.pop("exerciseStyle", UNSET) - exercise_style: Unset | OptionExerciseStyle - if isinstance(_exercise_style, Unset): - exercise_style = UNSET - else: - exercise_style = OptionExerciseStyle(_exercise_style) - - _expiration_dt = d.pop("expirationDt", UNSET) - expiration_dt: Unset | Date - if isinstance(_expiration_dt, Unset): - expiration_dt = UNSET - else: - expiration_dt = Date.from_dict(_expiration_dt) - - fee1 = d.pop("fee1", UNSET) - - fee2 = d.pop("fee2", UNSET) - - frequent_trader_id = d.pop("frequentTraderId", UNSET) - - give_up = d.pop("giveUp", UNSET) - - id = d.pop("id", UNSET) - - incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) - - incoming_ord_id = d.pop("incomingOrdId", UNSET) - - incoming_orig_clord_id = d.pop("incomingOrigClordId", UNSET) - - last_market = d.pop("lastMarket", UNSET) - - last_price = d.pop("lastPrice", UNSET) - - last_qty = d.pop("lastQty", UNSET) - - leaves_qty = d.pop("leavesQty", UNSET) - - leg_id = d.pop("legId", UNSET) - - liquidity_flag = d.pop("liquidityFlag", UNSET) - - locate_id = d.pop("locateId", UNSET) - - mpid = d.pop("mpid", UNSET) - - _multi_leg_reportingtype = d.pop("multiLegReportingtype", UNSET) - multi_leg_reportingtype: Unset | MultiLegReportingType - if isinstance(_multi_leg_reportingtype, Unset): - multi_leg_reportingtype = UNSET - else: - multi_leg_reportingtype = MultiLegReportingType(_multi_leg_reportingtype) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType - if isinstance(_ord_type, Unset): - ord_type = UNSET - else: - ord_type = OrdType(_ord_type) - - _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType - if isinstance(_origination_type, Unset): - origination_type = UNSET - else: - origination_type = OriginationType(_origination_type) - - orig_ord_id = d.pop("origOrdId", UNSET) - - parent_ord_id = d.pop("parentOrdId", UNSET) - - perm_ord_id = d.pop("permOrdId", UNSET) - - _position_effect = d.pop("positionEffect", UNSET) - position_effect: Unset | PositionEffect - if isinstance(_position_effect, Unset): - position_effect = UNSET - else: - position_effect = PositionEffect(_position_effect) - - price = d.pop("price", UNSET) - - _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType - if isinstance(_price_type, Unset): - price_type = UNSET - else: - price_type = PriceType(_price_type) - - _put_call = d.pop("putCall", UNSET) - put_call: Unset | PutCall - if isinstance(_put_call, Unset): - put_call = UNSET - else: - put_call = PutCall(_put_call) - - qty = d.pop("qty", UNSET) - - req_ord_id = d.pop("reqOrdId", UNSET) - - root = d.pop("root", UNSET) - - route = d.pop("route", UNSET) - - routing_session = d.pop("routingSession", UNSET) - - _security_type = d.pop("securityType", UNSET) - security_type: Unset | SecurityType - if isinstance(_security_type, Unset): - security_type = UNSET - else: - security_type = SecurityType(_security_type) - - _settlement_type = d.pop("settlementType", UNSET) - settlement_type: Unset | OptionSettlementType - if isinstance(_settlement_type, Unset): - settlement_type = UNSET - else: - settlement_type = OptionSettlementType(_settlement_type) - - _side = d.pop("side", UNSET) - side: Unset | Side - if isinstance(_side, Unset): - side = UNSET - else: - side = Side(_side) - - source = d.pop("source", UNSET) - - source_address = d.pop("sourceAddress", UNSET) - - strategy_id = d.pop("strategyId", UNSET) - - strike = d.pop("strike", UNSET) - - symbol = d.pop("symbol", UNSET) - - tag = d.pop("tag", UNSET) - - tag1 = d.pop("tag1", UNSET) - - target_comp_id = d.pop("targetCompId", UNSET) - - target_sub_id = d.pop("targetSubId", UNSET) - - text = d.pop("text", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif - if isinstance(_tif, Unset): - tif = UNSET - else: - tif = Tif(_tif) - - _traded_dt = d.pop("tradedDt", UNSET) - traded_dt: Unset | Date - if isinstance(_traded_dt, Unset): - traded_dt = UNSET - else: - traded_dt = Date.from_dict(_traded_dt) - - trader_id = d.pop("traderId", UNSET) - - trading_firm_id = d.pop("tradingFirmId", UNSET) - - transact_ts = d.pop("transactTs", UNSET) - - underlying = d.pop("underlying", UNSET) - - user_id = d.pop("userId", UNSET) - - working_qty = d.pop("workingQty", UNSET) - - multiplier = d.pop("multiplier", UNSET) - - dac_delta = d.pop("dacDelta", UNSET) - - dac_reference_price = d.pop("dacReferencePrice", UNSET) - - manual_fill_time = d.pop("manualFillTime", UNSET) - - trade_confirm = cls( - account_id=account_id, - account_name=account_name, - alloc_id=alloc_id, - alloc_qty=alloc_qty, - aux_price=aux_price, - avg_price=avg_price, - billing_code=billing_code, - capacity=capacity, - clearing_account=clearing_account, - clearing_range=clearing_range, - client_id=client_id, - cmta=cmta, - commission=commission, - cross_side_type=cross_side_type, - cross_type=cross_type, - cum_qty=cum_qty, - cur_ord_id=cur_ord_id, - deliver_to_compid=deliver_to_compid, - deliver_to_subid=deliver_to_subid, - description=description, - drop=drop, - efid=efid, - exec_broker=exec_broker, - exec_id=exec_id, - exec_ref_id=exec_ref_id, - exec_type=exec_type, - exercise_style=exercise_style, - expiration_dt=expiration_dt, - fee1=fee1, - fee2=fee2, - frequent_trader_id=frequent_trader_id, - give_up=give_up, - id=id, - incoming_cl_ord_id=incoming_cl_ord_id, - incoming_ord_id=incoming_ord_id, - incoming_orig_clord_id=incoming_orig_clord_id, - last_market=last_market, - last_price=last_price, - last_qty=last_qty, - leaves_qty=leaves_qty, - leg_id=leg_id, - liquidity_flag=liquidity_flag, - locate_id=locate_id, - mpid=mpid, - multi_leg_reportingtype=multi_leg_reportingtype, - ord_type=ord_type, - origination_type=origination_type, - orig_ord_id=orig_ord_id, - parent_ord_id=parent_ord_id, - perm_ord_id=perm_ord_id, - position_effect=position_effect, - price=price, - price_type=price_type, - put_call=put_call, - qty=qty, - req_ord_id=req_ord_id, - root=root, - route=route, - routing_session=routing_session, - security_type=security_type, - settlement_type=settlement_type, - side=side, - source=source, - source_address=source_address, - strategy_id=strategy_id, - strike=strike, - symbol=symbol, - tag=tag, - tag1=tag1, - target_comp_id=target_comp_id, - target_sub_id=target_sub_id, - text=text, - tif=tif, - traded_dt=traded_dt, - trader_id=trader_id, - trading_firm_id=trading_firm_id, - transact_ts=transact_ts, - underlying=underlying, - user_id=user_id, - working_qty=working_qty, - multiplier=multiplier, - dac_delta=dac_delta, - dac_reference_price=dac_reference_price, - manual_fill_time=manual_fill_time, - ) - - return trade_confirm diff --git a/openapi/openapi_project/openapi_package/models/trading_firm.py b/openapi/openapi_project/openapi_package/models/trading_firm.py deleted file mode 100644 index 4babd203a..000000000 --- a/openapi/openapi_project/openapi_package/models/trading_firm.py +++ /dev/null @@ -1,67 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="TradingFirm") - - -@_attrs_define -class TradingFirm: - """ - Attributes: - id (Union[Unset, int]): - eq_mpid (Union[Unset, str]): - name (Union[Unset, str]): - occ_clearing_number (Union[Unset, str]): - """ - - id: Unset | int = UNSET - eq_mpid: Unset | str = UNSET - name: Unset | str = UNSET - occ_clearing_number: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - id = self.id - - eq_mpid = self.eq_mpid - - name = self.name - - occ_clearing_number = self.occ_clearing_number - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if id is not UNSET: - field_dict["id"] = id - if eq_mpid is not UNSET: - field_dict["eqMpid"] = eq_mpid - if name is not UNSET: - field_dict["name"] = name - if occ_clearing_number is not UNSET: - field_dict["occClearingNumber"] = occ_clearing_number - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - id = d.pop("id", UNSET) - - eq_mpid = d.pop("eqMpid", UNSET) - - name = d.pop("name", UNSET) - - occ_clearing_number = d.pop("occClearingNumber", UNSET) - - trading_firm = cls( - id=id, - eq_mpid=eq_mpid, - name=name, - occ_clearing_number=occ_clearing_number, - ) - - return trading_firm diff --git a/openapi/openapi_project/openapi_package/models/trading_firm_slim.py b/openapi/openapi_project/openapi_package/models/trading_firm_slim.py deleted file mode 100644 index 5eeca4b4d..000000000 --- a/openapi/openapi_project/openapi_package/models/trading_firm_slim.py +++ /dev/null @@ -1,49 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="TradingFirmSlim") - - -@_attrs_define -class TradingFirmSlim: - """ - Attributes: - id (Union[Unset, int]): - name (Union[Unset, str]): - """ - - id: Unset | int = UNSET - name: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - id = self.id - - name = self.name - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if id is not UNSET: - field_dict["id"] = id - if name is not UNSET: - field_dict["name"] = name - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - id = d.pop("id", UNSET) - - name = d.pop("name", UNSET) - - trading_firm_slim = cls( - id=id, - name=name, - ) - - return trading_firm_slim diff --git a/openapi/openapi_project/openapi_package/models/trading_holiday.py b/openapi/openapi_project/openapi_package/models/trading_holiday.py deleted file mode 100644 index 4101a7635..000000000 --- a/openapi/openapi_project/openapi_package/models/trading_holiday.py +++ /dev/null @@ -1,97 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.country import Country -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.date import Date - - -T = TypeVar("T", bound="TradingHoliday") - - -@_attrs_define -class TradingHoliday: - """ - Attributes: - id (Union[Unset, int]): - country (Union[Unset, Country]): - date (Union[Unset, Date]): - description (Union[Unset, str]): - is_early_close (Union[Unset, bool]): - """ - - id: Unset | int = UNSET - country: Unset | Country = UNSET - date: Union[Unset, "Date"] = UNSET - description: Unset | str = UNSET - is_early_close: Unset | bool = UNSET - - def to_dict(self) -> dict[str, Any]: - id = self.id - - country: Unset | str = UNSET - if not isinstance(self.country, Unset): - country = self.country.value - - date: Unset | dict[str, Any] = UNSET - if not isinstance(self.date, Unset): - date = self.date.to_dict() - - description = self.description - - is_early_close = self.is_early_close - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if id is not UNSET: - field_dict["id"] = id - if country is not UNSET: - field_dict["country"] = country - if date is not UNSET: - field_dict["date"] = date - if description is not UNSET: - field_dict["description"] = description - if is_early_close is not UNSET: - field_dict["isEarlyClose"] = is_early_close - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.date import Date - - d = dict(src_dict) - id = d.pop("id", UNSET) - - _country = d.pop("country", UNSET) - country: Unset | Country - if isinstance(_country, Unset): - country = UNSET - else: - country = Country(_country) - - _date = d.pop("date", UNSET) - date: Unset | Date - if isinstance(_date, Unset): - date = UNSET - else: - date = Date.from_dict(_date) - - description = d.pop("description", UNSET) - - is_early_close = d.pop("isEarlyClose", UNSET) - - trading_holiday = cls( - id=id, - country=country, - date=date, - description=description, - is_early_close=is_early_close, - ) - - return trading_holiday diff --git a/openapi/openapi_project/openapi_package/models/trading_session.py b/openapi/openapi_project/openapi_package/models/trading_session.py deleted file mode 100644 index b7467aea1..000000000 --- a/openapi/openapi_project/openapi_package/models/trading_session.py +++ /dev/null @@ -1,105 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.time_of_day import TimeOfDay - - -T = TypeVar("T", bound="TradingSession") - - -@_attrs_define -class TradingSession: - """ - Attributes: - days_of_the_week (Union[Unset, str]): - end_time (Union[Unset, TimeOfDay]): - id (Union[Unset, int]): - name (Union[Unset, str]): - start_time (Union[Unset, TimeOfDay]): - trading_session_group_id (Union[Unset, int]): - """ - - days_of_the_week: Unset | str = UNSET - end_time: Union[Unset, "TimeOfDay"] = UNSET - id: Unset | int = UNSET - name: Unset | str = UNSET - start_time: Union[Unset, "TimeOfDay"] = UNSET - trading_session_group_id: Unset | int = UNSET - - def to_dict(self) -> dict[str, Any]: - days_of_the_week = self.days_of_the_week - - end_time: Unset | dict[str, Any] = UNSET - if not isinstance(self.end_time, Unset): - end_time = self.end_time.to_dict() - - id = self.id - - name = self.name - - start_time: Unset | dict[str, Any] = UNSET - if not isinstance(self.start_time, Unset): - start_time = self.start_time.to_dict() - - trading_session_group_id = self.trading_session_group_id - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if days_of_the_week is not UNSET: - field_dict["daysOfTheWeek"] = days_of_the_week - if end_time is not UNSET: - field_dict["endTime"] = end_time - if id is not UNSET: - field_dict["id"] = id - if name is not UNSET: - field_dict["name"] = name - if start_time is not UNSET: - field_dict["startTime"] = start_time - if trading_session_group_id is not UNSET: - field_dict["tradingSessionGroupId"] = trading_session_group_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.time_of_day import TimeOfDay - - d = dict(src_dict) - days_of_the_week = d.pop("daysOfTheWeek", UNSET) - - _end_time = d.pop("endTime", UNSET) - end_time: Unset | TimeOfDay - if isinstance(_end_time, Unset): - end_time = UNSET - else: - end_time = TimeOfDay.from_dict(_end_time) - - id = d.pop("id", UNSET) - - name = d.pop("name", UNSET) - - _start_time = d.pop("startTime", UNSET) - start_time: Unset | TimeOfDay - if isinstance(_start_time, Unset): - start_time = UNSET - else: - start_time = TimeOfDay.from_dict(_start_time) - - trading_session_group_id = d.pop("tradingSessionGroupId", UNSET) - - trading_session = cls( - days_of_the_week=days_of_the_week, - end_time=end_time, - id=id, - name=name, - start_time=start_time, - trading_session_group_id=trading_session_group_id, - ) - - return trading_session diff --git a/openapi/openapi_project/openapi_package/models/trading_session_group.py b/openapi/openapi_project/openapi_package/models/trading_session_group.py deleted file mode 100644 index 67e310e62..000000000 --- a/openapi/openapi_project/openapi_package/models/trading_session_group.py +++ /dev/null @@ -1,74 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.trading_session import TradingSession - - -T = TypeVar("T", bound="TradingSessionGroup") - - -@_attrs_define -class TradingSessionGroup: - """ - Attributes: - id (Union[Unset, int]): - name (Union[Unset, str]): - sessions (Union[Unset, list['TradingSession']]): - """ - - id: Unset | int = UNSET - name: Unset | str = UNSET - sessions: Unset | list["TradingSession"] = UNSET - - def to_dict(self) -> dict[str, Any]: - id = self.id - - name = self.name - - sessions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.sessions, Unset): - sessions = [] - for sessions_item_data in self.sessions: - sessions_item = sessions_item_data.to_dict() - sessions.append(sessions_item) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if id is not UNSET: - field_dict["id"] = id - if name is not UNSET: - field_dict["name"] = name - if sessions is not UNSET: - field_dict["sessions"] = sessions - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.trading_session import TradingSession - - d = dict(src_dict) - id = d.pop("id", UNSET) - - name = d.pop("name", UNSET) - - sessions = [] - _sessions = d.pop("sessions", UNSET) - for sessions_item_data in _sessions or []: - sessions_item = TradingSession.from_dict(sessions_item_data) - - sessions.append(sessions_item) - - trading_session_group = cls( - id=id, - name=name, - sessions=sessions, - ) - - return trading_session_group diff --git a/openapi/openapi_project/openapi_package/models/user.py b/openapi/openapi_project/openapi_package/models/user.py deleted file mode 100644 index cfed5394f..000000000 --- a/openapi/openapi_project/openapi_package/models/user.py +++ /dev/null @@ -1,242 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.user_location import UserLocation -from openapi_project.openapi_package.models.user_status import UserStatus -from openapi_project.openapi_package.models.user_type import UserType -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.user_permission import UserPermission - - -T = TypeVar("T", bound="User") - - -@_attrs_define -class User: - """ - Attributes: - domain (Union[Unset, str]): - email (Union[Unset, str]): - first_name (Union[Unset, str]): - id (Union[Unset, int]): - is_locked_out (Union[Unset, bool]): - last_name (Union[Unset, str]): - location (Union[Unset, UserLocation]): - phone_primary (Union[Unset, str]): - phone_secondary (Union[Unset, str]): - region (Union[Unset, str]): - region_code (Union[Unset, str]): - status (Union[Unset, UserStatus]): - trading_firm_id (Union[Unset, int]): - type_ (Union[Unset, UserType]): - user_name (Union[Unset, str]): - city (Union[Unset, str]): - permissions (Union[Unset, list['UserPermission']]): - setup_ticket (Union[Unset, str]): - large_trader_id (Union[Unset, str]): - """ - - domain: Unset | str = UNSET - email: Unset | str = UNSET - first_name: Unset | str = UNSET - id: Unset | int = UNSET - is_locked_out: Unset | bool = UNSET - last_name: Unset | str = UNSET - location: Unset | UserLocation = UNSET - phone_primary: Unset | str = UNSET - phone_secondary: Unset | str = UNSET - region: Unset | str = UNSET - region_code: Unset | str = UNSET - status: Unset | UserStatus = UNSET - trading_firm_id: Unset | int = UNSET - type_: Unset | UserType = UNSET - user_name: Unset | str = UNSET - city: Unset | str = UNSET - permissions: Unset | list["UserPermission"] = UNSET - setup_ticket: Unset | str = UNSET - large_trader_id: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - domain = self.domain - - email = self.email - - first_name = self.first_name - - id = self.id - - is_locked_out = self.is_locked_out - - last_name = self.last_name - - location: Unset | str = UNSET - if not isinstance(self.location, Unset): - location = self.location.value - - phone_primary = self.phone_primary - - phone_secondary = self.phone_secondary - - region = self.region - - region_code = self.region_code - - status: Unset | str = UNSET - if not isinstance(self.status, Unset): - status = self.status.value - - trading_firm_id = self.trading_firm_id - - type_: Unset | str = UNSET - if not isinstance(self.type_, Unset): - type_ = self.type_.value - - user_name = self.user_name - - city = self.city - - permissions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.permissions, Unset): - permissions = [] - for permissions_item_data in self.permissions: - permissions_item = permissions_item_data.to_dict() - permissions.append(permissions_item) - - setup_ticket = self.setup_ticket - - large_trader_id = self.large_trader_id - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if domain is not UNSET: - field_dict["domain"] = domain - if email is not UNSET: - field_dict["email"] = email - if first_name is not UNSET: - field_dict["firstName"] = first_name - if id is not UNSET: - field_dict["id"] = id - if is_locked_out is not UNSET: - field_dict["isLockedOut"] = is_locked_out - if last_name is not UNSET: - field_dict["lastName"] = last_name - if location is not UNSET: - field_dict["location"] = location - if phone_primary is not UNSET: - field_dict["phonePrimary"] = phone_primary - if phone_secondary is not UNSET: - field_dict["phoneSecondary"] = phone_secondary - if region is not UNSET: - field_dict["region"] = region - if region_code is not UNSET: - field_dict["regionCode"] = region_code - if status is not UNSET: - field_dict["status"] = status - if trading_firm_id is not UNSET: - field_dict["tradingFirmId"] = trading_firm_id - if type_ is not UNSET: - field_dict["type"] = type_ - if user_name is not UNSET: - field_dict["userName"] = user_name - if city is not UNSET: - field_dict["city"] = city - if permissions is not UNSET: - field_dict["permissions"] = permissions - if setup_ticket is not UNSET: - field_dict["setupTicket"] = setup_ticket - if large_trader_id is not UNSET: - field_dict["largeTraderId"] = large_trader_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.user_permission import UserPermission - - d = dict(src_dict) - domain = d.pop("domain", UNSET) - - email = d.pop("email", UNSET) - - first_name = d.pop("firstName", UNSET) - - id = d.pop("id", UNSET) - - is_locked_out = d.pop("isLockedOut", UNSET) - - last_name = d.pop("lastName", UNSET) - - _location = d.pop("location", UNSET) - location: Unset | UserLocation - if isinstance(_location, Unset): - location = UNSET - else: - location = UserLocation(_location) - - phone_primary = d.pop("phonePrimary", UNSET) - - phone_secondary = d.pop("phoneSecondary", UNSET) - - region = d.pop("region", UNSET) - - region_code = d.pop("regionCode", UNSET) - - _status = d.pop("status", UNSET) - status: Unset | UserStatus - if isinstance(_status, Unset): - status = UNSET - else: - status = UserStatus(_status) - - trading_firm_id = d.pop("tradingFirmId", UNSET) - - _type_ = d.pop("type", UNSET) - type_: Unset | UserType - if isinstance(_type_, Unset): - type_ = UNSET - else: - type_ = UserType(_type_) - - user_name = d.pop("userName", UNSET) - - city = d.pop("city", UNSET) - - permissions = [] - _permissions = d.pop("permissions", UNSET) - for permissions_item_data in _permissions or []: - permissions_item = UserPermission.from_dict(permissions_item_data) - - permissions.append(permissions_item) - - setup_ticket = d.pop("setupTicket", UNSET) - - large_trader_id = d.pop("largeTraderId", UNSET) - - user = cls( - domain=domain, - email=email, - first_name=first_name, - id=id, - is_locked_out=is_locked_out, - last_name=last_name, - location=location, - phone_primary=phone_primary, - phone_secondary=phone_secondary, - region=region, - region_code=region_code, - status=status, - trading_firm_id=trading_firm_id, - type_=type_, - user_name=user_name, - city=city, - permissions=permissions, - setup_ticket=setup_ticket, - large_trader_id=large_trader_id, - ) - - return user diff --git a/openapi/openapi_project/openapi_package/models/user_location.py b/openapi/openapi_project/openapi_package/models/user_location.py deleted file mode 100644 index 73fba2ea4..000000000 --- a/openapi/openapi_project/openapi_package/models/user_location.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class UserLocation(str, Enum): - USER_LOCATION_OFF_FLOOR = "USER_LOCATION_OFF_FLOOR" - USER_LOCATION_ON_FLOOR = "USER_LOCATION_ON_FLOOR" - USER_LOCATION_UNKNOWN = "USER_LOCATION_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/user_permission.py b/openapi/openapi_project/openapi_package/models/user_permission.py deleted file mode 100644 index 63974b6ac..000000000 --- a/openapi/openapi_project/openapi_package/models/user_permission.py +++ /dev/null @@ -1,66 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.claim_type import ClaimType -from openapi_project.openapi_package.types import UNSET, Unset - -T = TypeVar("T", bound="UserPermission") - - -@_attrs_define -class UserPermission: - """ - Attributes: - claim (Union[Unset, str]): - claim_type (Union[Unset, ClaimType]): - description (Union[Unset, str]): - """ - - claim: Unset | str = UNSET - claim_type: Unset | ClaimType = UNSET - description: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - claim = self.claim - - claim_type: Unset | str = UNSET - if not isinstance(self.claim_type, Unset): - claim_type = self.claim_type.value - - description = self.description - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if claim is not UNSET: - field_dict["claim"] = claim - if claim_type is not UNSET: - field_dict["claimType"] = claim_type - if description is not UNSET: - field_dict["description"] = description - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - claim = d.pop("claim", UNSET) - - _claim_type = d.pop("claimType", UNSET) - claim_type: Unset | ClaimType - if isinstance(_claim_type, Unset): - claim_type = UNSET - else: - claim_type = ClaimType(_claim_type) - - description = d.pop("description", UNSET) - - user_permission = cls( - claim=claim, - claim_type=claim_type, - description=description, - ) - - return user_permission diff --git a/openapi/openapi_project/openapi_package/models/user_status.py b/openapi/openapi_project/openapi_package/models/user_status.py deleted file mode 100644 index 88da2b504..000000000 --- a/openapi/openapi_project/openapi_package/models/user_status.py +++ /dev/null @@ -1,12 +0,0 @@ -from enum import Enum - - -class UserStatus(str, Enum): - USER_STATUS_ACTIVE = "USER_STATUS_ACTIVE" - USER_STATUS_DELETED = "USER_STATUS_DELETED" - USER_STATUS_DISABLED = "USER_STATUS_DISABLED" - USER_STATUS_UNKNOWN = "USER_STATUS_UNKNOWN" - USER_STATUS_VIEW_ONLY = "USER_STATUS_VIEW_ONLY" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/user_type.py b/openapi/openapi_project/openapi_package/models/user_type.py deleted file mode 100644 index 95a3da9d0..000000000 --- a/openapi/openapi_project/openapi_package/models/user_type.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class UserType(str, Enum): - USER_TYPE_API = "USER_TYPE_API" - USER_TYPE_GUI = "USER_TYPE_GUI" - USER_TYPE_UNKNOWN = "USER_TYPE_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/validate_risk_response.py b/openapi/openapi_project/openapi_package/models/validate_risk_response.py deleted file mode 100644 index e5d66abc8..000000000 --- a/openapi/openapi_project/openapi_package/models/validate_risk_response.py +++ /dev/null @@ -1,91 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.risk_reject import RiskReject - - -T = TypeVar("T", bound="ValidateRiskResponse") - - -@_attrs_define -class ValidateRiskResponse: - """ - Attributes: - is_valid (Union[Unset, bool]): - risk_rejects (Union[Unset, list['RiskReject']]): - error_message (Union[Unset, str]): - status_code (Union[Unset, StatusCode]): - """ - - is_valid: Unset | bool = UNSET - risk_rejects: Unset | list["RiskReject"] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - is_valid = self.is_valid - - risk_rejects: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.risk_rejects, Unset): - risk_rejects = [] - for risk_rejects_item_data in self.risk_rejects: - risk_rejects_item = risk_rejects_item_data.to_dict() - risk_rejects.append(risk_rejects_item) - - error_message = self.error_message - - status_code: Unset | str = UNSET - if not isinstance(self.status_code, Unset): - status_code = self.status_code.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if is_valid is not UNSET: - field_dict["isValid"] = is_valid - if risk_rejects is not UNSET: - field_dict["riskRejects"] = risk_rejects - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from openapi_project.openapi_package.models.risk_reject import RiskReject - - d = dict(src_dict) - is_valid = d.pop("isValid", UNSET) - - risk_rejects = [] - _risk_rejects = d.pop("riskRejects", UNSET) - for risk_rejects_item_data in _risk_rejects or []: - risk_rejects_item = RiskReject.from_dict(risk_rejects_item_data) - - risk_rejects.append(risk_rejects_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode - if isinstance(_status_code, Unset): - status_code = UNSET - else: - status_code = StatusCode(_status_code) - - validate_risk_response = cls( - is_valid=is_valid, - risk_rejects=risk_rejects, - error_message=error_message, - status_code=status_code, - ) - - return validate_risk_response diff --git a/openapi/openapi_project/openapi_package/models/volatility_shock_skew.py b/openapi/openapi_project/openapi_package/models/volatility_shock_skew.py deleted file mode 100644 index ba182d91a..000000000 --- a/openapi/openapi_project/openapi_package/models/volatility_shock_skew.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class VolatilityShockSkew(str, Enum): - VOLATILITY_SHOCK_SKEW_STICKY_DELTA = "VOLATILITY_SHOCK_SKEW_STICKY_DELTA" - VOLATILITY_SHOCK_SKEW_STICKY_STRIKE = "VOLATILITY_SHOCK_SKEW_STICKY_STRIKE" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/models/volatility_shock_type.py b/openapi/openapi_project/openapi_package/models/volatility_shock_type.py deleted file mode 100644 index 4757c0b0c..000000000 --- a/openapi/openapi_project/openapi_package/models/volatility_shock_type.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class VolatilityShockType(str, Enum): - VOLATILITY_SHOCK_TYPE_ABSOLUTE = "VOLATILITY_SHOCK_TYPE_ABSOLUTE" - VOLATILITY_SHOCK_TYPE_RELATIVE = "VOLATILITY_SHOCK_TYPE_RELATIVE" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi/openapi_project/openapi_package/py.typed b/openapi/openapi_project/openapi_package/py.typed deleted file mode 100644 index 1aad32711..000000000 --- a/openapi/openapi_project/openapi_package/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561 \ No newline at end of file diff --git a/openapi/openapi_project/openapi_package/types.py b/openapi/openapi_project/openapi_package/types.py deleted file mode 100644 index 571a13e74..000000000 --- a/openapi/openapi_project/openapi_package/types.py +++ /dev/null @@ -1,55 +0,0 @@ -"""Contains some shared types for properties""" - -from collections.abc import Mapping, MutableMapping -from http import HTTPStatus -from typing import IO, BinaryIO, Generic, Literal, TypeVar - -from attrs import define - - -class Unset: - def __bool__(self) -> Literal[False]: - return False - - -UNSET: Unset = Unset() - -# The types that `httpx.Client(files=)` can accept, copied from that library. -FileContent = IO[bytes] | bytes | str -FileTypes = ( - # (filename, file (or bytes), content_type) - tuple[str | None, FileContent, str | None] - | - # (filename, file (or bytes), content_type, headers) - tuple[str | None, FileContent, str | None, Mapping[str, str]] -) -RequestFiles = list[tuple[str, FileTypes]] - - -@define -class File: - """Contains information for file uploads""" - - payload: BinaryIO - file_name: str | None = None - mime_type: str | None = None - - def to_tuple(self) -> FileTypes: - """Return a tuple representation that httpx will accept for multipart/form-data""" - return self.file_name, self.payload, self.mime_type - - -T = TypeVar("T") - - -@define -class Response(Generic[T]): - """A response from an endpoint""" - - status_code: HTTPStatus - content: bytes - headers: MutableMapping[str, str] - parsed: T | None - - -__all__ = ["UNSET", "File", "FileTypes", "RequestFiles", "Response", "Unset"] diff --git a/openapi_project/openapi_package/__init__.py b/openapi_project/openapi_package/__init__.py index 4eeee1912..80fd8e99d 100644 --- a/openapi_project/openapi_package/__init__.py +++ b/openapi_project/openapi_package/__init__.py @@ -1,6 +1,6 @@ """A client library for accessing Silexx API""" -from .client import AuthenticatedClient, Client +from openapi_project.openapi_package.client import AuthenticatedClient, Client __all__ = ( "AuthenticatedClient", diff --git a/openapi_project/openapi_package/api/application_service/post_application_login.py b/openapi_project/openapi_package/api/application_service/post_application_login.py index 00c0ed4c7..261f7a2a7 100644 --- a/openapi_project/openapi_package/api/application_service/post_application_login.py +++ b/openapi_project/openapi_package/api/application_service/post_application_login.py @@ -3,12 +3,12 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.login_request import LoginRequest -from ...models.login_response import LoginResponse +from openapi_project.openapi_package.models.login_request import LoginRequest +from openapi_project.openapi_package.models.login_response import LoginResponse from typing import cast diff --git a/openapi_project/openapi_package/api/order_service/get_orders.py b/openapi_project/openapi_package/api/order_service/get_orders.py index ab002a494..e9dade5f9 100644 --- a/openapi_project/openapi_package/api/order_service/get_orders.py +++ b/openapi_project/openapi_package/api/order_service/get_orders.py @@ -3,11 +3,11 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.list_orders_response import ListOrdersResponse +from openapi_project.openapi_package.models.list_orders_response import ListOrdersResponse from typing import cast diff --git a/openapi_project/openapi_package/api/order_service/get_orders_searchhistory.py b/openapi_project/openapi_package/api/order_service/get_orders_searchhistory.py index 694c55921..bfac5f3f1 100644 --- a/openapi_project/openapi_package/api/order_service/get_orders_searchhistory.py +++ b/openapi_project/openapi_package/api/order_service/get_orders_searchhistory.py @@ -3,12 +3,12 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.search_order_history_response import SearchOrderHistoryResponse -from ...types import UNSET, Unset +from openapi_project.openapi_package.models.search_order_history_response import SearchOrderHistoryResponse +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast diff --git a/openapi_project/openapi_package/api/order_service/get_orders_tradeconfirms.py b/openapi_project/openapi_package/api/order_service/get_orders_tradeconfirms.py index 829fbe149..cabbc2bdf 100644 --- a/openapi_project/openapi_package/api/order_service/get_orders_tradeconfirms.py +++ b/openapi_project/openapi_package/api/order_service/get_orders_tradeconfirms.py @@ -3,12 +3,12 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.list_trade_confirms_response import ListTradeConfirmsResponse -from ...types import UNSET, Unset +from openapi_project.openapi_package.models.list_trade_confirms_response import ListTradeConfirmsResponse +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast diff --git a/openapi_project/openapi_package/api/order_service/post_orders_cancelorder.py b/openapi_project/openapi_package/api/order_service/post_orders_cancelorder.py index 78e51f414..3e33e58bd 100644 --- a/openapi_project/openapi_package/api/order_service/post_orders_cancelorder.py +++ b/openapi_project/openapi_package/api/order_service/post_orders_cancelorder.py @@ -3,12 +3,12 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.cancel_order_request import CancelOrderRequest -from ...models.cancel_order_response import CancelOrderResponse +from openapi_project.openapi_package.models.cancel_order_request import CancelOrderRequest +from openapi_project.openapi_package.models.cancel_order_response import CancelOrderResponse from typing import cast diff --git a/openapi_project/openapi_package/api/order_service/post_orders_createmultilegorder.py b/openapi_project/openapi_package/api/order_service/post_orders_createmultilegorder.py index 3518ab8d1..ed682be23 100644 --- a/openapi_project/openapi_package/api/order_service/post_orders_createmultilegorder.py +++ b/openapi_project/openapi_package/api/order_service/post_orders_createmultilegorder.py @@ -3,12 +3,12 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.create_multi_leg_order_request import CreateMultiLegOrderRequest -from ...models.create_multi_leg_order_response import CreateMultiLegOrderResponse +from openapi_project.openapi_package.models.create_multi_leg_order_request import CreateMultiLegOrderRequest +from openapi_project.openapi_package.models.create_multi_leg_order_response import CreateMultiLegOrderResponse from typing import cast diff --git a/openapi_project/openapi_package/api/order_service/post_orders_createmultilegordercross.py b/openapi_project/openapi_package/api/order_service/post_orders_createmultilegordercross.py index baf4e43b2..e9feefd18 100644 --- a/openapi_project/openapi_package/api/order_service/post_orders_createmultilegordercross.py +++ b/openapi_project/openapi_package/api/order_service/post_orders_createmultilegordercross.py @@ -3,16 +3,14 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors - -from ...models.create_multi_leg_order_cross_request import ( - CreateMultiLegOrderCrossRequest, -) -from ...models.create_multi_leg_order_cross_response import ( - CreateMultiLegOrderCrossResponse, -) +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.create_multi_leg_order_cross_request import CreateMultiLegOrderCrossRequest, + +from openapi_project.openapi_package.models.create_multi_leg_order_cross_response import CreateMultiLegOrderCrossResponse, + from typing import cast diff --git a/openapi_project/openapi_package/api/order_service/post_orders_createorder.py b/openapi_project/openapi_package/api/order_service/post_orders_createorder.py index 07ab5ff01..8ed7620c4 100644 --- a/openapi_project/openapi_package/api/order_service/post_orders_createorder.py +++ b/openapi_project/openapi_package/api/order_service/post_orders_createorder.py @@ -3,12 +3,12 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.create_order_request import CreateOrderRequest -from ...models.create_order_response import CreateOrderResponse +from openapi_project.openapi_package.models.create_order_request import CreateOrderRequest +from openapi_project.openapi_package.models.create_order_response import CreateOrderResponse from typing import cast diff --git a/openapi_project/openapi_package/api/order_service/post_orders_createordercross.py b/openapi_project/openapi_package/api/order_service/post_orders_createordercross.py index 63713fada..d0ba5b894 100644 --- a/openapi_project/openapi_package/api/order_service/post_orders_createordercross.py +++ b/openapi_project/openapi_package/api/order_service/post_orders_createordercross.py @@ -3,12 +3,12 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.create_order_cross_request import CreateOrderCrossRequest -from ...models.create_order_cross_response import CreateOrderCrossResponse +from openapi_project.openapi_package.models.create_order_cross_request import CreateOrderCrossRequest +from openapi_project.openapi_package.models.create_order_cross_response import CreateOrderCrossResponse from typing import cast diff --git a/openapi_project/openapi_package/api/order_service/post_orders_replacemultilegorder.py b/openapi_project/openapi_package/api/order_service/post_orders_replacemultilegorder.py index ce90bcb82..b29c8ce44 100644 --- a/openapi_project/openapi_package/api/order_service/post_orders_replacemultilegorder.py +++ b/openapi_project/openapi_package/api/order_service/post_orders_replacemultilegorder.py @@ -3,16 +3,14 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors - -from ...models.cancel_replace_multi_leg_order_request import ( - CancelReplaceMultiLegOrderRequest, -) -from ...models.cancel_replace_multi_leg_order_response import ( - CancelReplaceMultiLegOrderResponse, -) +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request import CancelReplaceMultiLegOrderRequest, + +from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_response import CancelReplaceMultiLegOrderResponse, + from typing import cast diff --git a/openapi_project/openapi_package/api/order_service/post_orders_replaceorder.py b/openapi_project/openapi_package/api/order_service/post_orders_replaceorder.py index 65c482272..86d3f065a 100644 --- a/openapi_project/openapi_package/api/order_service/post_orders_replaceorder.py +++ b/openapi_project/openapi_package/api/order_service/post_orders_replaceorder.py @@ -3,12 +3,12 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.cancel_replace_order_request import CancelReplaceOrderRequest -from ...models.cancel_replace_order_response import CancelReplaceOrderResponse +from openapi_project.openapi_package.models.cancel_replace_order_request import CancelReplaceOrderRequest +from openapi_project.openapi_package.models.cancel_replace_order_response import CancelReplaceOrderResponse from typing import cast diff --git a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegorder.py b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegorder.py index 6305e2063..025772e6b 100644 --- a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegorder.py +++ b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegorder.py @@ -3,12 +3,12 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.create_multi_leg_order_request import CreateMultiLegOrderRequest -from ...models.validate_risk_response import ValidateRiskResponse +from openapi_project.openapi_package.models.create_multi_leg_order_request import CreateMultiLegOrderRequest +from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse from typing import cast diff --git a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegordercross.py b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegordercross.py index 1cc1dbaec..76393160e 100644 --- a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegordercross.py +++ b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegordercross.py @@ -3,14 +3,13 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors - -from ...models.create_multi_leg_order_cross_request import ( - CreateMultiLegOrderCrossRequest, -) -from ...models.validate_risk_response import ValidateRiskResponse +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.create_multi_leg_order_cross_request import CreateMultiLegOrderCrossRequest, + +from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse from typing import cast diff --git a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createorder.py b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createorder.py index fdd131b23..0b6085fba 100644 --- a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createorder.py +++ b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createorder.py @@ -3,12 +3,12 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.create_order_request import CreateOrderRequest -from ...models.validate_risk_response import ValidateRiskResponse +from openapi_project.openapi_package.models.create_order_request import CreateOrderRequest +from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse from typing import cast diff --git a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createordercross.py b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createordercross.py index a574cbc60..43f123e89 100644 --- a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createordercross.py +++ b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createordercross.py @@ -3,12 +3,12 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.create_order_cross_request import CreateOrderCrossRequest -from ...models.validate_risk_response import ValidateRiskResponse +from openapi_project.openapi_package.models.create_order_cross_request import CreateOrderCrossRequest +from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse from typing import cast diff --git a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replacemultilegorder.py b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replacemultilegorder.py index 231026daf..3cee526ec 100644 --- a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replacemultilegorder.py +++ b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replacemultilegorder.py @@ -3,14 +3,13 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors - -from ...models.cancel_replace_multi_leg_order_request import ( - CancelReplaceMultiLegOrderRequest, -) -from ...models.validate_risk_response import ValidateRiskResponse +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request import CancelReplaceMultiLegOrderRequest, + +from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse from typing import cast diff --git a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replaceorder.py b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replaceorder.py index 831203bd5..a10bccb20 100644 --- a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replaceorder.py +++ b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replaceorder.py @@ -3,12 +3,12 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.cancel_replace_order_request import CancelReplaceOrderRequest -from ...models.validate_risk_response import ValidateRiskResponse +from openapi_project.openapi_package.models.cancel_replace_order_request import CancelReplaceOrderRequest +from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse from typing import cast diff --git a/openapi_project/openapi_package/api/portfolio_service/get_portfolio_positions.py b/openapi_project/openapi_package/api/portfolio_service/get_portfolio_positions.py index 2188e0beb..a4bb644e5 100644 --- a/openapi_project/openapi_package/api/portfolio_service/get_portfolio_positions.py +++ b/openapi_project/openapi_package/api/portfolio_service/get_portfolio_positions.py @@ -3,12 +3,12 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.list_positions_response import ListPositionsResponse -from ...types import UNSET, Unset +from openapi_project.openapi_package.models.list_positions_response import ListPositionsResponse +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast diff --git a/openapi_project/openapi_package/api/portfolio_service/post_portfolio_analyzepositions.py b/openapi_project/openapi_package/api/portfolio_service/post_portfolio_analyzepositions.py index 6e0ba4369..cb4946c30 100644 --- a/openapi_project/openapi_package/api/portfolio_service/post_portfolio_analyzepositions.py +++ b/openapi_project/openapi_package/api/portfolio_service/post_portfolio_analyzepositions.py @@ -3,12 +3,12 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.analyze_positions_request import AnalyzePositionsRequest -from ...models.analyze_positions_response import AnalyzePositionsResponse +from openapi_project.openapi_package.models.analyze_positions_request import AnalyzePositionsRequest +from openapi_project.openapi_package.models.analyze_positions_response import AnalyzePositionsResponse from typing import cast diff --git a/openapi_project/openapi_package/api/portfolio_service/post_portfolio_calculatemargins.py b/openapi_project/openapi_package/api/portfolio_service/post_portfolio_calculatemargins.py index 7f08dfec3..7fb58f59e 100644 --- a/openapi_project/openapi_package/api/portfolio_service/post_portfolio_calculatemargins.py +++ b/openapi_project/openapi_package/api/portfolio_service/post_portfolio_calculatemargins.py @@ -3,12 +3,12 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.calculate_margin_request import CalculateMarginRequest -from ...models.calculate_margin_response import CalculateMarginResponse +from openapi_project.openapi_package.models.calculate_margin_request import CalculateMarginRequest +from openapi_project.openapi_package.models.calculate_margin_response import CalculateMarginResponse from typing import cast diff --git a/openapi_project/openapi_package/api/portfolio_service/post_portfolio_riskradar.py b/openapi_project/openapi_package/api/portfolio_service/post_portfolio_riskradar.py index 33fc1e5ce..0dbf9cba6 100644 --- a/openapi_project/openapi_package/api/portfolio_service/post_portfolio_riskradar.py +++ b/openapi_project/openapi_package/api/portfolio_service/post_portfolio_riskradar.py @@ -3,12 +3,12 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.risk_radar_request import RiskRadarRequest -from ...models.risk_radar_response import RiskRadarResponse +from openapi_project.openapi_package.models.risk_radar_request import RiskRadarRequest +from openapi_project.openapi_package.models.risk_radar_response import RiskRadarResponse from typing import cast diff --git a/openapi_project/openapi_package/api/security_service/get_securities_exchanges.py b/openapi_project/openapi_package/api/security_service/get_securities_exchanges.py index 05d02833d..d1a0b432f 100644 --- a/openapi_project/openapi_package/api/security_service/get_securities_exchanges.py +++ b/openapi_project/openapi_package/api/security_service/get_securities_exchanges.py @@ -3,11 +3,11 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.list_exchanges_response import ListExchangesResponse +from openapi_project.openapi_package.models.list_exchanges_response import ListExchangesResponse from typing import cast diff --git a/openapi_project/openapi_package/api/security_service/post_securities_easytoborrowsecurities.py b/openapi_project/openapi_package/api/security_service/post_securities_easytoborrowsecurities.py index 5e07308a3..d616eed0e 100644 --- a/openapi_project/openapi_package/api/security_service/post_securities_easytoborrowsecurities.py +++ b/openapi_project/openapi_package/api/security_service/post_securities_easytoborrowsecurities.py @@ -3,16 +3,14 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors - -from ...models.list_easy_to_borrow_securities_request import ( - ListEasyToBorrowSecuritiesRequest, -) -from ...models.list_easy_to_borrow_securities_response import ( - ListEasyToBorrowSecuritiesResponse, -) +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.list_easy_to_borrow_securities_request import ListEasyToBorrowSecuritiesRequest, + +from openapi_project.openapi_package.models.list_easy_to_borrow_securities_response import ListEasyToBorrowSecuritiesResponse, + from typing import cast diff --git a/openapi_project/openapi_package/api/security_service/post_securities_flexoption.py b/openapi_project/openapi_package/api/security_service/post_securities_flexoption.py index 157a8d820..6345bd226 100644 --- a/openapi_project/openapi_package/api/security_service/post_securities_flexoption.py +++ b/openapi_project/openapi_package/api/security_service/post_securities_flexoption.py @@ -3,12 +3,12 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.create_flex_option_request import CreateFlexOptionRequest -from ...models.create_flex_option_response import CreateFlexOptionResponse +from openapi_project.openapi_package.models.create_flex_option_request import CreateFlexOptionRequest +from openapi_project.openapi_package.models.create_flex_option_response import CreateFlexOptionResponse from typing import cast diff --git a/openapi_project/openapi_package/api/security_service/post_securities_optionchains.py b/openapi_project/openapi_package/api/security_service/post_securities_optionchains.py index a8be05b0a..c9c764012 100644 --- a/openapi_project/openapi_package/api/security_service/post_securities_optionchains.py +++ b/openapi_project/openapi_package/api/security_service/post_securities_optionchains.py @@ -3,12 +3,12 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.list_option_chains_repsonse import ListOptionChainsRepsonse -from ...models.list_option_chains_request import ListOptionChainsRequest +from openapi_project.openapi_package.models.list_option_chains_repsonse import ListOptionChainsRepsonse +from openapi_project.openapi_package.models.list_option_chains_request import ListOptionChainsRequest from typing import cast diff --git a/openapi_project/openapi_package/api/security_service/post_securities_securities.py b/openapi_project/openapi_package/api/security_service/post_securities_securities.py index 8f41356c1..6c4edccf8 100644 --- a/openapi_project/openapi_package/api/security_service/post_securities_securities.py +++ b/openapi_project/openapi_package/api/security_service/post_securities_securities.py @@ -3,12 +3,12 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.list_securities_request import ListSecuritiesRequest -from ...models.list_securities_response import ListSecuritiesResponse +from openapi_project.openapi_package.models.list_securities_request import ListSecuritiesRequest +from openapi_project.openapi_package.models.list_securities_response import ListSecuritiesResponse from typing import cast diff --git a/openapi_project/openapi_package/api/user_data_service/get_userdata_accounts.py b/openapi_project/openapi_package/api/user_data_service/get_userdata_accounts.py index af9ed4fd3..f70cbd8da 100644 --- a/openapi_project/openapi_package/api/user_data_service/get_userdata_accounts.py +++ b/openapi_project/openapi_package/api/user_data_service/get_userdata_accounts.py @@ -3,11 +3,11 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.list_accounts_response import ListAccountsResponse +from openapi_project.openapi_package.models.list_accounts_response import ListAccountsResponse from typing import cast diff --git a/openapi_project/openapi_package/api/user_data_service/get_userdata_activeuser.py b/openapi_project/openapi_package/api/user_data_service/get_userdata_activeuser.py index 0bc350f89..a559dfe15 100644 --- a/openapi_project/openapi_package/api/user_data_service/get_userdata_activeuser.py +++ b/openapi_project/openapi_package/api/user_data_service/get_userdata_activeuser.py @@ -3,11 +3,11 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.get_active_user_response import GetActiveUserResponse +from openapi_project.openapi_package.models.get_active_user_response import GetActiveUserResponse from typing import cast diff --git a/openapi_project/openapi_package/api/user_data_service/get_userdata_affiliatedtradingfirms.py b/openapi_project/openapi_package/api/user_data_service/get_userdata_affiliatedtradingfirms.py index c8650eacd..1c5ce1ac7 100644 --- a/openapi_project/openapi_package/api/user_data_service/get_userdata_affiliatedtradingfirms.py +++ b/openapi_project/openapi_package/api/user_data_service/get_userdata_affiliatedtradingfirms.py @@ -3,13 +3,12 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.list_affiliated_trading_firms_response import ListAffiliatedTradingFirmsResponse, -from ...models.list_affiliated_trading_firms_response import ( - ListAffiliatedTradingFirmsResponse, -) from typing import cast diff --git a/openapi_project/openapi_package/api/user_data_service/get_userdata_p2paccounts.py b/openapi_project/openapi_package/api/user_data_service/get_userdata_p2paccounts.py index e2b47b578..b08b8cca9 100644 --- a/openapi_project/openapi_package/api/user_data_service/get_userdata_p2paccounts.py +++ b/openapi_project/openapi_package/api/user_data_service/get_userdata_p2paccounts.py @@ -3,11 +3,11 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.list_accounts_response import ListAccountsResponse +from openapi_project.openapi_package.models.list_accounts_response import ListAccountsResponse from typing import cast diff --git a/openapi_project/openapi_package/api/user_data_service/get_userdata_routes.py b/openapi_project/openapi_package/api/user_data_service/get_userdata_routes.py index 1acd9ac12..dff62b11d 100644 --- a/openapi_project/openapi_package/api/user_data_service/get_userdata_routes.py +++ b/openapi_project/openapi_package/api/user_data_service/get_userdata_routes.py @@ -3,11 +3,11 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.list_routes_response import ListRoutesResponse +from openapi_project.openapi_package.models.list_routes_response import ListRoutesResponse from typing import cast diff --git a/openapi_project/openapi_package/api/user_data_service/get_userdata_tradingfirms.py b/openapi_project/openapi_package/api/user_data_service/get_userdata_tradingfirms.py index c80823d2d..6986c5226 100644 --- a/openapi_project/openapi_package/api/user_data_service/get_userdata_tradingfirms.py +++ b/openapi_project/openapi_package/api/user_data_service/get_userdata_tradingfirms.py @@ -3,11 +3,11 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.list_trading_firms_response import ListTradingFirmsResponse +from openapi_project.openapi_package.models.list_trading_firms_response import ListTradingFirmsResponse from typing import cast diff --git a/openapi_project/openapi_package/api/utility_service/get_utility_serverinfo.py b/openapi_project/openapi_package/api/utility_service/get_utility_serverinfo.py index 7a85a32fb..61179a632 100644 --- a/openapi_project/openapi_package/api/utility_service/get_utility_serverinfo.py +++ b/openapi_project/openapi_package/api/utility_service/get_utility_serverinfo.py @@ -3,11 +3,11 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.get_server_info_response import GetServerInfoResponse +from openapi_project.openapi_package.models.get_server_info_response import GetServerInfoResponse from typing import cast diff --git a/openapi_project/openapi_package/api/utility_service/get_utility_servertime.py b/openapi_project/openapi_package/api/utility_service/get_utility_servertime.py index 692a0bcf2..a527d1b3a 100644 --- a/openapi_project/openapi_package/api/utility_service/get_utility_servertime.py +++ b/openapi_project/openapi_package/api/utility_service/get_utility_servertime.py @@ -3,11 +3,11 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.get_server_time_response import GetServerTimeResponse +from openapi_project.openapi_package.models.get_server_time_response import GetServerTimeResponse from typing import cast diff --git a/openapi_project/openapi_package/api/utility_service/get_utility_tradingholidays.py b/openapi_project/openapi_package/api/utility_service/get_utility_tradingholidays.py index 31d8cc7cf..508e57932 100644 --- a/openapi_project/openapi_package/api/utility_service/get_utility_tradingholidays.py +++ b/openapi_project/openapi_package/api/utility_service/get_utility_tradingholidays.py @@ -3,11 +3,11 @@ import httpx -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors -from ...models.get_trading_holidays_response import GetTradingHolidaysResponse +from openapi_project.openapi_package.models.get_trading_holidays_response import GetTradingHolidaysResponse from typing import cast diff --git a/openapi_project/openapi_package/models/__init__.py b/openapi_project/openapi_package/models/__init__.py index fb15fd046..8b56c7530 100644 --- a/openapi_project/openapi_package/models/__init__.py +++ b/openapi_project/openapi_package/models/__init__.py @@ -1,298 +1,276 @@ """Contains all the data models used in inputs/outputs""" -from .account import Account -from .account_script import AccountScript -from .account_status import AccountStatus -from .account_type import AccountType -from .analyze_position_item import AnalyzePositionItem -from .analyze_positions_request import AnalyzePositionsRequest -from .analyze_positions_response import AnalyzePositionsResponse -from .any_model import AnyModel -from .calculate_margin_request import CalculateMarginRequest -from .calculate_margin_request_position import CalculateMarginRequestPosition -from .calculate_margin_request_position_list import CalculateMarginRequestPositionList -from .calculate_margin_response import CalculateMarginResponse -from .cancel_order_request import CancelOrderRequest -from .cancel_order_request_optional_data import CancelOrderRequestOptionalData -from .cancel_order_response import CancelOrderResponse -from .cancel_replace_multi_leg_order_request import CancelReplaceMultiLegOrderRequest -from .cancel_replace_multi_leg_order_request_algo import ( - CancelReplaceMultiLegOrderRequestAlgo, -) -from .cancel_replace_multi_leg_order_request_market_condition import ( - CancelReplaceMultiLegOrderRequestMarketCondition, -) -from .cancel_replace_multi_leg_order_request_optional_data import ( - CancelReplaceMultiLegOrderRequestOptionalData, -) -from .cancel_replace_multi_leg_order_response import CancelReplaceMultiLegOrderResponse -from .cancel_replace_order_request import CancelReplaceOrderRequest -from .cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo -from .cancel_replace_order_request_market_condition import ( - CancelReplaceOrderRequestMarketCondition, -) -from .cancel_replace_order_request_optional_data import ( - CancelReplaceOrderRequestOptionalData, -) -from .cancel_replace_order_response import CancelReplaceOrderResponse -from .capacity_code import CapacityCode -from .claim_type import ClaimType -from .clearing_info import ClearingInfo -from .clearing_range import ClearingRange -from .country import Country -from .create_flex_option_request import CreateFlexOptionRequest -from .create_flex_option_response import CreateFlexOptionResponse -from .create_multi_leg_order_cross_allocation import CreateMultiLegOrderCrossAllocation -from .create_multi_leg_order_cross_allocation_optional_data import ( - CreateMultiLegOrderCrossAllocationOptionalData, -) -from .create_multi_leg_order_cross_request import CreateMultiLegOrderCrossRequest -from .create_multi_leg_order_cross_request_algo import ( - CreateMultiLegOrderCrossRequestAlgo, -) -from .create_multi_leg_order_cross_request_market_condition import ( - CreateMultiLegOrderCrossRequestMarketCondition, -) -from .create_multi_leg_order_cross_request_optional_data import ( - CreateMultiLegOrderCrossRequestOptionalData, -) -from .create_multi_leg_order_cross_response import CreateMultiLegOrderCrossResponse -from .create_multi_leg_order_leg import CreateMultiLegOrderLeg -from .create_multi_leg_order_leg_market_condition import ( - CreateMultiLegOrderLegMarketCondition, -) -from .create_multi_leg_order_leg_optional_data import CreateMultiLegOrderLegOptionalData -from .create_multi_leg_order_request import CreateMultiLegOrderRequest -from .create_multi_leg_order_request_algo import CreateMultiLegOrderRequestAlgo -from .create_multi_leg_order_request_market_condition import ( - CreateMultiLegOrderRequestMarketCondition, -) -from .create_multi_leg_order_request_optional_data import ( - CreateMultiLegOrderRequestOptionalData, -) -from .create_multi_leg_order_response import CreateMultiLegOrderResponse -from .create_order_cross_allocation import CreateOrderCrossAllocation -from .create_order_cross_allocation_optional_data import ( - CreateOrderCrossAllocationOptionalData, -) -from .create_order_cross_request import CreateOrderCrossRequest -from .create_order_cross_request_algo import CreateOrderCrossRequestAlgo -from .create_order_cross_request_market_condition import ( - CreateOrderCrossRequestMarketCondition, -) -from .create_order_cross_request_optional_data import ( - CreateOrderCrossRequestOptionalData, -) -from .create_order_cross_response import CreateOrderCrossResponse -from .create_order_request import CreateOrderRequest -from .create_order_request_algo import CreateOrderRequestAlgo -from .create_order_request_market_condition import CreateOrderRequestMarketCondition -from .create_order_request_optional_data import CreateOrderRequestOptionalData -from .create_order_response import CreateOrderResponse -from .cross_side_type import CrossSideType -from .cross_type import CrossType -from .crypto import Crypto -from .crypto_aliases import CryptoAliases -from .currency import Currency -from .cxl_rej_response_to import CxlRejResponseTo -from .date import Date -from .easy_to_borrow_security import EasyToBorrowSecurity -from .empty import Empty -from .exchange import Exchange -from .exchange_code import ExchangeCode -from .exec_type import ExecType -from .execution import Execution -from .execution_algo import ExecutionAlgo -from .execution_optional_data import ExecutionOptionalData -from .flex_option import FlexOption -from .flex_option_aliases import FlexOptionAliases -from .flex_settlement_type import FlexSettlementType -from .future import Future -from .future_aliases import FutureAliases -from .future_root import FutureRoot -from .future_root_aliases import FutureRootAliases -from .future_spread import FutureSpread -from .future_spread_aliases import FutureSpreadAliases -from .future_spread_leg import FutureSpreadLeg -from .fx import Fx -from .fx_aliases import FxAliases -from .generic_order import GenericOrder -from .get_active_user_response import GetActiveUserResponse -from .get_server_info_response import GetServerInfoResponse -from .get_server_info_response_system_settings import ( - GetServerInfoResponseSystemSettings, -) -from .get_server_time_response import GetServerTimeResponse -from .get_trading_holidays_response import GetTradingHolidaysResponse -from .header import Header -from .index import Index -from .index_aliases import IndexAliases -from .list_accounts_response import ListAccountsResponse -from .list_affiliated_trading_firms_response import ListAffiliatedTradingFirmsResponse -from .list_easy_to_borrow_securities_request import ListEasyToBorrowSecuritiesRequest -from .list_easy_to_borrow_securities_response import ListEasyToBorrowSecuritiesResponse -from .list_exchanges_response import ListExchangesResponse -from .list_option_chains_repsonse import ListOptionChainsRepsonse -from .list_option_chains_request import ListOptionChainsRequest -from .list_orders_response import ListOrdersResponse -from .list_positions_response import ListPositionsResponse -from .list_routes_response import ListRoutesResponse -from .list_securities_request import ListSecuritiesRequest -from .list_securities_response import ListSecuritiesResponse -from .list_trade_confirms_response import ListTradeConfirmsResponse -from .list_trading_firms_response import ListTradingFirmsResponse -from .login_request import LoginRequest -from .login_response import LoginResponse -from .login_response_system_settings import LoginResponseSystemSettings -from .login_status import LoginStatus -from .margin_data import MarginData -from .margin_data_type import MarginDataType -from .multi_leg_order import MultiLegOrder -from .multi_leg_order_algo import MultiLegOrderAlgo -from .multi_leg_order_cancel_replace_request import MultiLegOrderCancelReplaceRequest -from .multi_leg_order_cancel_replace_request_algo import ( - MultiLegOrderCancelReplaceRequestAlgo, -) -from .multi_leg_order_cancel_replace_request_market_condition import ( - MultiLegOrderCancelReplaceRequestMarketCondition, -) -from .multi_leg_order_cancel_replace_request_optional_data import ( - MultiLegOrderCancelReplaceRequestOptionalData, -) -from .multi_leg_order_cross import MultiLegOrderCross -from .multi_leg_order_cross_algo import MultiLegOrderCrossAlgo -from .multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation -from .multi_leg_order_cross_allocation_optional_data import ( - MultiLegOrderCrossAllocationOptionalData, -) -from .multi_leg_order_cross_market_condition import MultiLegOrderCrossMarketCondition -from .multi_leg_order_cross_optional_data import MultiLegOrderCrossOptionalData -from .multi_leg_order_leg import MultiLegOrderLeg -from .multi_leg_order_leg_market_condition import MultiLegOrderLegMarketCondition -from .multi_leg_order_leg_optional_data import MultiLegOrderLegOptionalData -from .multi_leg_order_market_condition import MultiLegOrderMarketCondition -from .multi_leg_order_optional_data import MultiLegOrderOptionalData -from .multi_leg_reporting_type import MultiLegReportingType -from .numeric_display_format import NumericDisplayFormat -from .option import Option -from .option_aliases import OptionAliases -from .option_chain import OptionChain -from .option_chain_option import OptionChainOption -from .option_chain_option_aliases import OptionChainOptionAliases -from .option_chain_options import OptionChainOptions -from .option_chain_roots import OptionChainRoots -from .option_exercise_style import OptionExerciseStyle -from .option_expiration_style import OptionExpirationStyle -from .option_root import OptionRoot -from .option_root_aliases import OptionRootAliases -from .option_series import OptionSeries -from .option_series_product_type import OptionSeriesProductType -from .option_series_type import OptionSeriesType -from .option_settlement_type import OptionSettlementType -from .ord_status import OrdStatus -from .ord_type import OrdType -from .order import Order -from .order_algo import OrderAlgo -from .order_cancel_reject import OrderCancelReject -from .order_cancel_reject_optional_data import OrderCancelRejectOptionalData -from .order_cancel_replace_request import OrderCancelReplaceRequest -from .order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo -from .order_cancel_replace_request_market_condition import ( - OrderCancelReplaceRequestMarketCondition, -) -from .order_cancel_replace_request_optional_data import ( - OrderCancelReplaceRequestOptionalData, -) -from .order_cancel_request import OrderCancelRequest -from .order_cancel_request_optional_data import OrderCancelRequestOptionalData -from .order_cross import OrderCross -from .order_cross_algo import OrderCrossAlgo -from .order_cross_allocation import OrderCrossAllocation -from .order_cross_allocation_optional_data import OrderCrossAllocationOptionalData -from .order_cross_market_condition import OrderCrossMarketCondition -from .order_cross_optional_data import OrderCrossOptionalData -from .order_delete import OrderDelete -from .order_delete_optional_data import OrderDeleteOptionalData -from .order_instruction import OrderInstruction -from .order_instruction_type import OrderInstructionType -from .order_market_condition import OrderMarketCondition -from .order_optional_data import OrderOptionalData -from .order_type import OrderType -from .order_update import OrderUpdate -from .order_update_algo import OrderUpdateAlgo -from .order_update_event import OrderUpdateEvent -from .order_update_optional_data import OrderUpdateOptionalData -from .origination_type import OriginationType -from .position import Position -from .position_analysis import PositionAnalysis -from .position_effect import PositionEffect -from .position_source import PositionSource -from .position_theo import PositionTheo -from .position_theo_leg import PositionTheoLeg -from .price_type import PriceType -from .product_group import ProductGroup -from .product_sub_group import ProductSubGroup -from .put_call import PutCall -from .risk_calculation_type import RiskCalculationType -from .risk_eval_mode import RiskEvalMode -from .risk_radar_account_group import RiskRadarAccountGroup -from .risk_radar_class_group import RiskRadarClassGroup -from .risk_radar_data import RiskRadarData -from .risk_radar_position import RiskRadarPosition -from .risk_radar_product_group import RiskRadarProductGroup -from .risk_radar_request import RiskRadarRequest -from .risk_radar_request_position import RiskRadarRequestPosition -from .risk_radar_request_position_list import RiskRadarRequestPositionList -from .risk_radar_response import RiskRadarResponse -from .risk_radar_scenario_order import RiskRadarScenarioOrder -from .risk_reject import RiskReject -from .risk_reject_type import RiskRejectType -from .route import Route -from .route_applicability import RouteApplicability -from .route_property import RouteProperty -from .route_property_type import RoutePropertyType -from .route_type import RouteType -from .routing_session_group import RoutingSessionGroup -from .routing_session_group_type import RoutingSessionGroupType -from .scenario import Scenario -from .scenario_leg import ScenarioLeg -from .scenario_position import ScenarioPosition -from .scenario_theo import ScenarioTheo -from .search_order_history_response import SearchOrderHistoryResponse -from .security import Security -from .security_category import SecurityCategory -from .security_type import SecurityType -from .settlement_deliverable_type import SettlementDeliverableType -from .settlement_info import SettlementInfo -from .shock_value import ShockValue -from .shock_value_flags import ShockValueFlags -from .side import Side -from .spread_leg_side import SpreadLegSide -from .spread_leg_type import SpreadLegType -from .status import Status -from .status_code import StatusCode -from .stock import Stock -from .stock_aliases import StockAliases -from .tif import Tif -from .time_of_day import TimeOfDay -from .tims_class_group import TimsClassGroup -from .tims_margin_data import TimsMarginData -from .tims_position_group import TimsPositionGroup -from .tims_product_group import TimsProductGroup -from .trade_confirm import TradeConfirm -from .trading_firm import TradingFirm -from .trading_firm_slim import TradingFirmSlim -from .trading_holiday import TradingHoliday -from .trading_session import TradingSession -from .trading_session_group import TradingSessionGroup -from .user import User -from .user_location import UserLocation -from .user_permission import UserPermission -from .user_status import UserStatus -from .user_type import UserType -from .validate_risk_response import ValidateRiskResponse -from .volatility_shock_skew import VolatilityShockSkew -from .volatility_shock_type import VolatilityShockType +from openapi_project.openapi_package.models.account import Account +from openapi_project.openapi_package.models.account_script import AccountScript +from openapi_project.openapi_package.models.account_status import AccountStatus +from openapi_project.openapi_package.models.account_type import AccountType +from openapi_project.openapi_package.models.analyze_position_item import AnalyzePositionItem +from openapi_project.openapi_package.models.analyze_positions_request import AnalyzePositionsRequest +from openapi_project.openapi_package.models.analyze_positions_response import AnalyzePositionsResponse +from openapi_project.openapi_package.models.any_model import AnyModel +from openapi_project.openapi_package.models.calculate_margin_request import CalculateMarginRequest +from openapi_project.openapi_package.models.calculate_margin_request_position import CalculateMarginRequestPosition +from openapi_project.openapi_package.models.calculate_margin_request_position_list import CalculateMarginRequestPositionList +from openapi_project.openapi_package.models.calculate_margin_response import CalculateMarginResponse +from openapi_project.openapi_package.models.cancel_order_request import CancelOrderRequest +from openapi_project.openapi_package.models.cancel_order_request_optional_data import CancelOrderRequestOptionalData +from openapi_project.openapi_package.models.cancel_order_response import CancelOrderResponse +from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request import CancelReplaceMultiLegOrderRequest +from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_algo import CancelReplaceMultiLegOrderRequestAlgo, + +from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_market_condition import CancelReplaceMultiLegOrderRequestMarketCondition, + +from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_optional_data import CancelReplaceMultiLegOrderRequestOptionalData, + +from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_response import CancelReplaceMultiLegOrderResponse +from openapi_project.openapi_package.models.cancel_replace_order_request import CancelReplaceOrderRequest +from openapi_project.openapi_package.models.cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo +from openapi_project.openapi_package.models.cancel_replace_order_request_market_condition import CancelReplaceOrderRequestMarketCondition, + +from openapi_project.openapi_package.models.cancel_replace_order_request_optional_data import CancelReplaceOrderRequestOptionalData, + +from openapi_project.openapi_package.models.cancel_replace_order_response import CancelReplaceOrderResponse +from openapi_project.openapi_package.models.capacity_code import CapacityCode +from openapi_project.openapi_package.models.claim_type import ClaimType +from openapi_project.openapi_package.models.clearing_info import ClearingInfo +from openapi_project.openapi_package.models.clearing_range import ClearingRange +from openapi_project.openapi_package.models.country import Country +from openapi_project.openapi_package.models.create_flex_option_request import CreateFlexOptionRequest +from openapi_project.openapi_package.models.create_flex_option_response import CreateFlexOptionResponse +from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation import CreateMultiLegOrderCrossAllocation +from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation_optional_data import CreateMultiLegOrderCrossAllocationOptionalData, + +from openapi_project.openapi_package.models.create_multi_leg_order_cross_request import CreateMultiLegOrderCrossRequest +from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_algo import CreateMultiLegOrderCrossRequestAlgo, + +from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_market_condition import CreateMultiLegOrderCrossRequestMarketCondition, + +from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_optional_data import CreateMultiLegOrderCrossRequestOptionalData, + +from openapi_project.openapi_package.models.create_multi_leg_order_cross_response import CreateMultiLegOrderCrossResponse +from openapi_project.openapi_package.models.create_multi_leg_order_leg import CreateMultiLegOrderLeg +from openapi_project.openapi_package.models.create_multi_leg_order_leg_market_condition import CreateMultiLegOrderLegMarketCondition, + +from openapi_project.openapi_package.models.create_multi_leg_order_leg_optional_data import CreateMultiLegOrderLegOptionalData +from openapi_project.openapi_package.models.create_multi_leg_order_request import CreateMultiLegOrderRequest +from openapi_project.openapi_package.models.create_multi_leg_order_request_algo import CreateMultiLegOrderRequestAlgo +from openapi_project.openapi_package.models.create_multi_leg_order_request_market_condition import CreateMultiLegOrderRequestMarketCondition, + +from openapi_project.openapi_package.models.create_multi_leg_order_request_optional_data import CreateMultiLegOrderRequestOptionalData, + +from openapi_project.openapi_package.models.create_multi_leg_order_response import CreateMultiLegOrderResponse +from openapi_project.openapi_package.models.create_order_cross_allocation import CreateOrderCrossAllocation +from openapi_project.openapi_package.models.create_order_cross_allocation_optional_data import CreateOrderCrossAllocationOptionalData, + +from openapi_project.openapi_package.models.create_order_cross_request import CreateOrderCrossRequest +from openapi_project.openapi_package.models.create_order_cross_request_algo import CreateOrderCrossRequestAlgo +from openapi_project.openapi_package.models.create_order_cross_request_market_condition import CreateOrderCrossRequestMarketCondition, + +from openapi_project.openapi_package.models.create_order_cross_request_optional_data import CreateOrderCrossRequestOptionalData, + +from openapi_project.openapi_package.models.create_order_cross_response import CreateOrderCrossResponse +from openapi_project.openapi_package.models.create_order_request import CreateOrderRequest +from openapi_project.openapi_package.models.create_order_request_algo import CreateOrderRequestAlgo +from openapi_project.openapi_package.models.create_order_request_market_condition import CreateOrderRequestMarketCondition +from openapi_project.openapi_package.models.create_order_request_optional_data import CreateOrderRequestOptionalData +from openapi_project.openapi_package.models.create_order_response import CreateOrderResponse +from openapi_project.openapi_package.models.cross_side_type import CrossSideType +from openapi_project.openapi_package.models.cross_type import CrossType +from openapi_project.openapi_package.models.crypto import Crypto +from openapi_project.openapi_package.models.crypto_aliases import CryptoAliases +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.models.cxl_rej_response_to import CxlRejResponseTo +from openapi_project.openapi_package.models.date import Date +from openapi_project.openapi_package.models.easy_to_borrow_security import EasyToBorrowSecurity +from openapi_project.openapi_package.models.empty import Empty +from openapi_project.openapi_package.models.exchange import Exchange +from openapi_project.openapi_package.models.exchange_code import ExchangeCode +from openapi_project.openapi_package.models.exec_type import ExecType +from openapi_project.openapi_package.models.execution import Execution +from openapi_project.openapi_package.models.execution_algo import ExecutionAlgo +from openapi_project.openapi_package.models.execution_optional_data import ExecutionOptionalData +from openapi_project.openapi_package.models.flex_option import FlexOption +from openapi_project.openapi_package.models.flex_option_aliases import FlexOptionAliases +from openapi_project.openapi_package.models.flex_settlement_type import FlexSettlementType +from openapi_project.openapi_package.models.future import Future +from openapi_project.openapi_package.models.future_aliases import FutureAliases +from openapi_project.openapi_package.models.future_root import FutureRoot +from openapi_project.openapi_package.models.future_root_aliases import FutureRootAliases +from openapi_project.openapi_package.models.future_spread import FutureSpread +from openapi_project.openapi_package.models.future_spread_aliases import FutureSpreadAliases +from openapi_project.openapi_package.models.future_spread_leg import FutureSpreadLeg +from openapi_project.openapi_package.models.fx import Fx +from openapi_project.openapi_package.models.fx_aliases import FxAliases +from openapi_project.openapi_package.models.generic_order import GenericOrder +from openapi_project.openapi_package.models.get_active_user_response import GetActiveUserResponse +from openapi_project.openapi_package.models.get_server_info_response import GetServerInfoResponse +from openapi_project.openapi_package.models.get_server_info_response_system_settings import GetServerInfoResponseSystemSettings, + +from openapi_project.openapi_package.models.get_server_time_response import GetServerTimeResponse +from openapi_project.openapi_package.models.get_trading_holidays_response import GetTradingHolidaysResponse +from openapi_project.openapi_package.models.header import Header +from openapi_project.openapi_package.models.index import Index +from openapi_project.openapi_package.models.index_aliases import IndexAliases +from openapi_project.openapi_package.models.list_accounts_response import ListAccountsResponse +from openapi_project.openapi_package.models.list_affiliated_trading_firms_response import ListAffiliatedTradingFirmsResponse +from openapi_project.openapi_package.models.list_easy_to_borrow_securities_request import ListEasyToBorrowSecuritiesRequest +from openapi_project.openapi_package.models.list_easy_to_borrow_securities_response import ListEasyToBorrowSecuritiesResponse +from openapi_project.openapi_package.models.list_exchanges_response import ListExchangesResponse +from openapi_project.openapi_package.models.list_option_chains_repsonse import ListOptionChainsRepsonse +from openapi_project.openapi_package.models.list_option_chains_request import ListOptionChainsRequest +from openapi_project.openapi_package.models.list_orders_response import ListOrdersResponse +from openapi_project.openapi_package.models.list_positions_response import ListPositionsResponse +from openapi_project.openapi_package.models.list_routes_response import ListRoutesResponse +from openapi_project.openapi_package.models.list_securities_request import ListSecuritiesRequest +from openapi_project.openapi_package.models.list_securities_response import ListSecuritiesResponse +from openapi_project.openapi_package.models.list_trade_confirms_response import ListTradeConfirmsResponse +from openapi_project.openapi_package.models.list_trading_firms_response import ListTradingFirmsResponse +from openapi_project.openapi_package.models.login_request import LoginRequest +from openapi_project.openapi_package.models.login_response import LoginResponse +from openapi_project.openapi_package.models.login_response_system_settings import LoginResponseSystemSettings +from openapi_project.openapi_package.models.login_status import LoginStatus +from openapi_project.openapi_package.models.margin_data import MarginData +from openapi_project.openapi_package.models.margin_data_type import MarginDataType +from openapi_project.openapi_package.models.multi_leg_order import MultiLegOrder +from openapi_project.openapi_package.models.multi_leg_order_algo import MultiLegOrderAlgo +from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request import MultiLegOrderCancelReplaceRequest +from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_algo import MultiLegOrderCancelReplaceRequestAlgo, + +from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_market_condition import MultiLegOrderCancelReplaceRequestMarketCondition, + +from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_optional_data import MultiLegOrderCancelReplaceRequestOptionalData, + +from openapi_project.openapi_package.models.multi_leg_order_cross import MultiLegOrderCross +from openapi_project.openapi_package.models.multi_leg_order_cross_algo import MultiLegOrderCrossAlgo +from openapi_project.openapi_package.models.multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation +from openapi_project.openapi_package.models.multi_leg_order_cross_allocation_optional_data import MultiLegOrderCrossAllocationOptionalData, + +from openapi_project.openapi_package.models.multi_leg_order_cross_market_condition import MultiLegOrderCrossMarketCondition +from openapi_project.openapi_package.models.multi_leg_order_cross_optional_data import MultiLegOrderCrossOptionalData +from openapi_project.openapi_package.models.multi_leg_order_leg import MultiLegOrderLeg +from openapi_project.openapi_package.models.multi_leg_order_leg_market_condition import MultiLegOrderLegMarketCondition +from openapi_project.openapi_package.models.multi_leg_order_leg_optional_data import MultiLegOrderLegOptionalData +from openapi_project.openapi_package.models.multi_leg_order_market_condition import MultiLegOrderMarketCondition +from openapi_project.openapi_package.models.multi_leg_order_optional_data import MultiLegOrderOptionalData +from openapi_project.openapi_package.models.multi_leg_reporting_type import MultiLegReportingType +from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat +from openapi_project.openapi_package.models.option import Option +from openapi_project.openapi_package.models.option_aliases import OptionAliases +from openapi_project.openapi_package.models.option_chain import OptionChain +from openapi_project.openapi_package.models.option_chain_option import OptionChainOption +from openapi_project.openapi_package.models.option_chain_option_aliases import OptionChainOptionAliases +from openapi_project.openapi_package.models.option_chain_options import OptionChainOptions +from openapi_project.openapi_package.models.option_chain_roots import OptionChainRoots +from openapi_project.openapi_package.models.option_exercise_style import OptionExerciseStyle +from openapi_project.openapi_package.models.option_expiration_style import OptionExpirationStyle +from openapi_project.openapi_package.models.option_root import OptionRoot +from openapi_project.openapi_package.models.option_root_aliases import OptionRootAliases +from openapi_project.openapi_package.models.option_series import OptionSeries +from openapi_project.openapi_package.models.option_series_product_type import OptionSeriesProductType +from openapi_project.openapi_package.models.option_series_type import OptionSeriesType +from openapi_project.openapi_package.models.option_settlement_type import OptionSettlementType +from openapi_project.openapi_package.models.ord_status import OrdStatus +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.order import Order +from openapi_project.openapi_package.models.order_algo import OrderAlgo +from openapi_project.openapi_package.models.order_cancel_reject import OrderCancelReject +from openapi_project.openapi_package.models.order_cancel_reject_optional_data import OrderCancelRejectOptionalData +from openapi_project.openapi_package.models.order_cancel_replace_request import OrderCancelReplaceRequest +from openapi_project.openapi_package.models.order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo +from openapi_project.openapi_package.models.order_cancel_replace_request_market_condition import OrderCancelReplaceRequestMarketCondition, + +from openapi_project.openapi_package.models.order_cancel_replace_request_optional_data import OrderCancelReplaceRequestOptionalData, + +from openapi_project.openapi_package.models.order_cancel_request import OrderCancelRequest +from openapi_project.openapi_package.models.order_cancel_request_optional_data import OrderCancelRequestOptionalData +from openapi_project.openapi_package.models.order_cross import OrderCross +from openapi_project.openapi_package.models.order_cross_algo import OrderCrossAlgo +from openapi_project.openapi_package.models.order_cross_allocation import OrderCrossAllocation +from openapi_project.openapi_package.models.order_cross_allocation_optional_data import OrderCrossAllocationOptionalData +from openapi_project.openapi_package.models.order_cross_market_condition import OrderCrossMarketCondition +from openapi_project.openapi_package.models.order_cross_optional_data import OrderCrossOptionalData +from openapi_project.openapi_package.models.order_delete import OrderDelete +from openapi_project.openapi_package.models.order_delete_optional_data import OrderDeleteOptionalData +from openapi_project.openapi_package.models.order_instruction import OrderInstruction +from openapi_project.openapi_package.models.order_instruction_type import OrderInstructionType +from openapi_project.openapi_package.models.order_market_condition import OrderMarketCondition +from openapi_project.openapi_package.models.order_optional_data import OrderOptionalData +from openapi_project.openapi_package.models.order_type import OrderType +from openapi_project.openapi_package.models.order_update import OrderUpdate +from openapi_project.openapi_package.models.order_update_algo import OrderUpdateAlgo +from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent +from openapi_project.openapi_package.models.order_update_optional_data import OrderUpdateOptionalData +from openapi_project.openapi_package.models.origination_type import OriginationType +from openapi_project.openapi_package.models.position import Position +from openapi_project.openapi_package.models.position_analysis import PositionAnalysis +from openapi_project.openapi_package.models.position_effect import PositionEffect +from openapi_project.openapi_package.models.position_source import PositionSource +from openapi_project.openapi_package.models.position_theo import PositionTheo +from openapi_project.openapi_package.models.position_theo_leg import PositionTheoLeg +from openapi_project.openapi_package.models.price_type import PriceType +from openapi_project.openapi_package.models.product_group import ProductGroup +from openapi_project.openapi_package.models.product_sub_group import ProductSubGroup +from openapi_project.openapi_package.models.put_call import PutCall +from openapi_project.openapi_package.models.risk_calculation_type import RiskCalculationType +from openapi_project.openapi_package.models.risk_eval_mode import RiskEvalMode +from openapi_project.openapi_package.models.risk_radar_account_group import RiskRadarAccountGroup +from openapi_project.openapi_package.models.risk_radar_class_group import RiskRadarClassGroup +from openapi_project.openapi_package.models.risk_radar_data import RiskRadarData +from openapi_project.openapi_package.models.risk_radar_position import RiskRadarPosition +from openapi_project.openapi_package.models.risk_radar_product_group import RiskRadarProductGroup +from openapi_project.openapi_package.models.risk_radar_request import RiskRadarRequest +from openapi_project.openapi_package.models.risk_radar_request_position import RiskRadarRequestPosition +from openapi_project.openapi_package.models.risk_radar_request_position_list import RiskRadarRequestPositionList +from openapi_project.openapi_package.models.risk_radar_response import RiskRadarResponse +from openapi_project.openapi_package.models.risk_radar_scenario_order import RiskRadarScenarioOrder +from openapi_project.openapi_package.models.risk_reject import RiskReject +from openapi_project.openapi_package.models.risk_reject_type import RiskRejectType +from openapi_project.openapi_package.models.route import Route +from openapi_project.openapi_package.models.route_applicability import RouteApplicability +from openapi_project.openapi_package.models.route_property import RouteProperty +from openapi_project.openapi_package.models.route_property_type import RoutePropertyType +from openapi_project.openapi_package.models.route_type import RouteType +from openapi_project.openapi_package.models.routing_session_group import RoutingSessionGroup +from openapi_project.openapi_package.models.routing_session_group_type import RoutingSessionGroupType +from openapi_project.openapi_package.models.scenario import Scenario +from openapi_project.openapi_package.models.scenario_leg import ScenarioLeg +from openapi_project.openapi_package.models.scenario_position import ScenarioPosition +from openapi_project.openapi_package.models.scenario_theo import ScenarioTheo +from openapi_project.openapi_package.models.search_order_history_response import SearchOrderHistoryResponse +from openapi_project.openapi_package.models.security import Security +from openapi_project.openapi_package.models.security_category import SecurityCategory +from openapi_project.openapi_package.models.security_type import SecurityType +from openapi_project.openapi_package.models.settlement_deliverable_type import SettlementDeliverableType +from openapi_project.openapi_package.models.settlement_info import SettlementInfo +from openapi_project.openapi_package.models.shock_value import ShockValue +from openapi_project.openapi_package.models.shock_value_flags import ShockValueFlags +from openapi_project.openapi_package.models.side import Side +from openapi_project.openapi_package.models.spread_leg_side import SpreadLegSide +from openapi_project.openapi_package.models.spread_leg_type import SpreadLegType +from openapi_project.openapi_package.models.status import Status +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.models.stock import Stock +from openapi_project.openapi_package.models.stock_aliases import StockAliases +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.models.time_of_day import TimeOfDay +from openapi_project.openapi_package.models.tims_class_group import TimsClassGroup +from openapi_project.openapi_package.models.tims_margin_data import TimsMarginData +from openapi_project.openapi_package.models.tims_position_group import TimsPositionGroup +from openapi_project.openapi_package.models.tims_product_group import TimsProductGroup +from openapi_project.openapi_package.models.trade_confirm import TradeConfirm +from openapi_project.openapi_package.models.trading_firm import TradingFirm +from openapi_project.openapi_package.models.trading_firm_slim import TradingFirmSlim +from openapi_project.openapi_package.models.trading_holiday import TradingHoliday +from openapi_project.openapi_package.models.trading_session import TradingSession +from openapi_project.openapi_package.models.trading_session_group import TradingSessionGroup +from openapi_project.openapi_package.models.user import User +from openapi_project.openapi_package.models.user_location import UserLocation +from openapi_project.openapi_package.models.user_permission import UserPermission +from openapi_project.openapi_package.models.user_status import UserStatus +from openapi_project.openapi_package.models.user_type import UserType +from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse +from openapi_project.openapi_package.models.volatility_shock_skew import VolatilityShockSkew +from openapi_project.openapi_package.models.volatility_shock_type import VolatilityShockType __all__ = ( "Account", diff --git a/openapi_project/openapi_package/models/account.py b/openapi_project/openapi_package/models/account.py index a291bd379..63bfad528 100644 --- a/openapi_project/openapi_package/models/account.py +++ b/openapi_project/openapi_package/models/account.py @@ -6,19 +6,19 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - -from ..models.account_status import AccountStatus -from ..models.account_type import AccountType -from ..models.capacity_code import CapacityCode -from ..models.clearing_range import ClearingRange -from ..models.currency import Currency -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset + +from openapi_project.openapi_package.models.account_status import AccountStatus +from openapi_project.openapi_package.models.account_type import AccountType +from openapi_project.openapi_package.models.capacity_code import CapacityCode +from openapi_project.openapi_package.models.clearing_range import ClearingRange +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.routing_session_group import RoutingSessionGroup - from ..models.account_script import AccountScript + from openapi_project.openapi_package.models.routing_session_group import RoutingSessionGroup + from openapi_project.openapi_package.models.account_script import AccountScript T = TypeVar("T", bound="Account") diff --git a/openapi_project/openapi_package/models/account_script.py b/openapi_project/openapi_package/models/account_script.py index 2ef3e2c43..3d9043bbb 100644 --- a/openapi_project/openapi_package/models/account_script.py +++ b/openapi_project/openapi_package/models/account_script.py @@ -6,9 +6,9 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="AccountScript") diff --git a/openapi_project/openapi_package/models/analyze_position_item.py b/openapi_project/openapi_package/models/analyze_position_item.py index 8e719cd42..70a13cd6e 100644 --- a/openapi_project/openapi_package/models/analyze_position_item.py +++ b/openapi_project/openapi_package/models/analyze_position_item.py @@ -6,9 +6,9 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="AnalyzePositionItem") diff --git a/openapi_project/openapi_package/models/analyze_positions_request.py b/openapi_project/openapi_package/models/analyze_positions_request.py index fa19c9f8c..111b4e00b 100644 --- a/openapi_project/openapi_package/models/analyze_positions_request.py +++ b/openapi_project/openapi_package/models/analyze_positions_request.py @@ -6,13 +6,13 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.analyze_position_item import AnalyzePositionItem + from openapi_project.openapi_package.models.analyze_position_item import AnalyzePositionItem T = TypeVar("T", bound="AnalyzePositionsRequest") diff --git a/openapi_project/openapi_package/models/analyze_positions_response.py b/openapi_project/openapi_package/models/analyze_positions_response.py index 364e442b1..5b6fda4f2 100644 --- a/openapi_project/openapi_package/models/analyze_positions_response.py +++ b/openapi_project/openapi_package/models/analyze_positions_response.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.position_analysis import PositionAnalysis + from openapi_project.openapi_package.models.position_analysis import PositionAnalysis T = TypeVar("T", bound="AnalyzePositionsResponse") diff --git a/openapi_project/openapi_package/models/any_model.py b/openapi_project/openapi_package/models/any_model.py index 55378f366..1d30ce01e 100644 --- a/openapi_project/openapi_package/models/any_model.py +++ b/openapi_project/openapi_package/models/any_model.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="AnyModel") diff --git a/openapi_project/openapi_package/models/calculate_margin_request.py b/openapi_project/openapi_package/models/calculate_margin_request.py index 454186870..2c253c509 100644 --- a/openapi_project/openapi_package/models/calculate_margin_request.py +++ b/openapi_project/openapi_package/models/calculate_margin_request.py @@ -6,18 +6,17 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.margin_data_type import MarginDataType -from ..models.position_source import PositionSource -from ..models.risk_eval_mode import RiskEvalMode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.margin_data_type import MarginDataType +from openapi_project.openapi_package.models.position_source import PositionSource +from openapi_project.openapi_package.models.risk_eval_mode import RiskEvalMode +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.calculate_margin_request_position_list import ( - CalculateMarginRequestPositionList, - ) + from openapi_project.openapi_package.models.calculate_margin_request_position_list import CalculateMarginRequestPositionList, + T = TypeVar("T", bound="CalculateMarginRequest") diff --git a/openapi_project/openapi_package/models/calculate_margin_request_position.py b/openapi_project/openapi_package/models/calculate_margin_request_position.py index 9775ea66a..6a752729d 100644 --- a/openapi_project/openapi_package/models/calculate_margin_request_position.py +++ b/openapi_project/openapi_package/models/calculate_margin_request_position.py @@ -6,9 +6,9 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="CalculateMarginRequestPosition") diff --git a/openapi_project/openapi_package/models/calculate_margin_request_position_list.py b/openapi_project/openapi_package/models/calculate_margin_request_position_list.py index 582b68f99..b43c9fe63 100644 --- a/openapi_project/openapi_package/models/calculate_margin_request_position_list.py +++ b/openapi_project/openapi_package/models/calculate_margin_request_position_list.py @@ -6,15 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.calculate_margin_request_position import ( - CalculateMarginRequestPosition, - ) + from openapi_project.openapi_package.models.calculate_margin_request_position import CalculateMarginRequestPosition, + T = TypeVar("T", bound="CalculateMarginRequestPositionList") diff --git a/openapi_project/openapi_package/models/calculate_margin_response.py b/openapi_project/openapi_package/models/calculate_margin_response.py index 0294e95b8..aa97a84db 100644 --- a/openapi_project/openapi_package/models/calculate_margin_response.py +++ b/openapi_project/openapi_package/models/calculate_margin_response.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.margin_data import MarginData + from openapi_project.openapi_package.models.margin_data import MarginData T = TypeVar("T", bound="CalculateMarginResponse") diff --git a/openapi_project/openapi_package/models/cancel_order_request.py b/openapi_project/openapi_package/models/cancel_order_request.py index 71fffa5f2..d347e3deb 100644 --- a/openapi_project/openapi_package/models/cancel_order_request.py +++ b/openapi_project/openapi_package/models/cancel_order_request.py @@ -6,16 +6,15 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.order_instruction import OrderInstruction - from ..models.cancel_order_request_optional_data import ( - CancelOrderRequestOptionalData, - ) + from openapi_project.openapi_package.models.cancel_order_request_optional_data import CancelOrderRequestOptionalData, + + from openapi_project.openapi_package.models.order_instruction import OrderInstruction T = TypeVar("T", bound="CancelOrderRequest") diff --git a/openapi_project/openapi_package/models/cancel_order_request_optional_data.py b/openapi_project/openapi_package/models/cancel_order_request_optional_data.py index 917018703..c4334574c 100644 --- a/openapi_project/openapi_package/models/cancel_order_request_optional_data.py +++ b/openapi_project/openapi_package/models/cancel_order_request_optional_data.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/cancel_order_response.py b/openapi_project/openapi_package/models/cancel_order_response.py index bc5b18a66..70831055f 100644 --- a/openapi_project/openapi_package/models/cancel_order_response.py +++ b/openapi_project/openapi_package/models/cancel_order_response.py @@ -6,10 +6,10 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="CancelOrderResponse") diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py index 94d5411de..1fa31aebb 100644 --- a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py +++ b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py @@ -6,25 +6,22 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.ord_type import OrdType -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.order_instruction import OrderInstruction - from ..models.cancel_replace_multi_leg_order_request_market_condition import ( - CancelReplaceMultiLegOrderRequestMarketCondition, - ) - from ..models.clearing_info import ClearingInfo - from ..models.cancel_replace_multi_leg_order_request_algo import ( - CancelReplaceMultiLegOrderRequestAlgo, - ) - from ..models.cancel_replace_multi_leg_order_request_optional_data import ( - CancelReplaceMultiLegOrderRequestOptionalData, - ) + from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_market_condition import CancelReplaceMultiLegOrderRequestMarketCondition, + + from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_algo import CancelReplaceMultiLegOrderRequestAlgo, + + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_optional_data import CancelReplaceMultiLegOrderRequestOptionalData, + T = TypeVar("T", bound="CancelReplaceMultiLegOrderRequest") diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py index 4d4943c55..d11700d2c 100644 --- a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py +++ b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py index 2939090e9..39a910643 100644 --- a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py +++ b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py index 19d18b172..471afa52c 100644 --- a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py +++ b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py index ddb2293dc..3c5681f6c 100644 --- a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py +++ b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py @@ -6,10 +6,10 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="CancelReplaceMultiLegOrderResponse") diff --git a/openapi_project/openapi_package/models/cancel_replace_order_request.py b/openapi_project/openapi_package/models/cancel_replace_order_request.py index 927a42067..b5672d71d 100644 --- a/openapi_project/openapi_package/models/cancel_replace_order_request.py +++ b/openapi_project/openapi_package/models/cancel_replace_order_request.py @@ -6,23 +6,21 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.ord_type import OrdType -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.cancel_replace_order_request_optional_data import ( - CancelReplaceOrderRequestOptionalData, - ) - from ..models.order_instruction import OrderInstruction - from ..models.cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo - from ..models.cancel_replace_order_request_market_condition import ( - CancelReplaceOrderRequestMarketCondition, - ) - from ..models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo + from openapi_project.openapi_package.models.cancel_replace_order_request_market_condition import CancelReplaceOrderRequestMarketCondition, + + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.cancel_replace_order_request_optional_data import CancelReplaceOrderRequestOptionalData, + T = TypeVar("T", bound="CancelReplaceOrderRequest") diff --git a/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py b/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py index 4817846e4..f7cdf0309 100644 --- a/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py +++ b/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py b/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py index 269e08944..65e766b2c 100644 --- a/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py +++ b/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py b/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py index 4119e4910..c7156af58 100644 --- a/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py +++ b/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/cancel_replace_order_response.py b/openapi_project/openapi_package/models/cancel_replace_order_response.py index 837bdcec4..9f90052c4 100644 --- a/openapi_project/openapi_package/models/cancel_replace_order_response.py +++ b/openapi_project/openapi_package/models/cancel_replace_order_response.py @@ -6,10 +6,10 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="CancelReplaceOrderResponse") diff --git a/openapi_project/openapi_package/models/clearing_info.py b/openapi_project/openapi_package/models/clearing_info.py index d558dd6d8..20bb7150e 100644 --- a/openapi_project/openapi_package/models/clearing_info.py +++ b/openapi_project/openapi_package/models/clearing_info.py @@ -6,11 +6,11 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.capacity_code import CapacityCode -from ..models.clearing_range import ClearingRange -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.capacity_code import CapacityCode +from openapi_project.openapi_package.models.clearing_range import ClearingRange +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="ClearingInfo") diff --git a/openapi_project/openapi_package/models/create_flex_option_request.py b/openapi_project/openapi_package/models/create_flex_option_request.py index 248f280bd..370b48988 100644 --- a/openapi_project/openapi_package/models/create_flex_option_request.py +++ b/openapi_project/openapi_package/models/create_flex_option_request.py @@ -6,17 +6,17 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.flex_settlement_type import FlexSettlementType -from ..models.option_exercise_style import OptionExerciseStyle -from ..models.option_series_product_type import OptionSeriesProductType -from ..models.put_call import PutCall -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.flex_settlement_type import FlexSettlementType +from openapi_project.openapi_package.models.option_exercise_style import OptionExerciseStyle +from openapi_project.openapi_package.models.option_series_product_type import OptionSeriesProductType +from openapi_project.openapi_package.models.put_call import PutCall +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.date import Date + from openapi_project.openapi_package.models.date import Date T = TypeVar("T", bound="CreateFlexOptionRequest") diff --git a/openapi_project/openapi_package/models/create_flex_option_response.py b/openapi_project/openapi_package/models/create_flex_option_response.py index 35ed80630..586fb83e2 100644 --- a/openapi_project/openapi_package/models/create_flex_option_response.py +++ b/openapi_project/openapi_package/models/create_flex_option_response.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.flex_option import FlexOption + from openapi_project.openapi_package.models.flex_option import FlexOption T = TypeVar("T", bound="CreateFlexOptionResponse") diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py index c3bbacc69..196dcf81a 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py @@ -6,19 +6,18 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.cross_side_type import CrossSideType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.cross_side_type import CrossSideType +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.order_instruction import OrderInstruction - from ..models.clearing_info import ClearingInfo - from ..models.create_multi_leg_order_cross_allocation_optional_data import ( - CreateMultiLegOrderCrossAllocationOptionalData, - ) - from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.create_multi_leg_order_leg import CreateMultiLegOrderLeg + from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation_optional_data import CreateMultiLegOrderCrossAllocationOptionalData, + T = TypeVar("T", bound="CreateMultiLegOrderCrossAllocation") diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py index 20160789e..a33751d11 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py index 64f5ecab2..1d35b3994 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py @@ -6,29 +6,25 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.cross_type import CrossType -from ..models.ord_type import OrdType -from ..models.price_type import PriceType -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.cross_type import CrossType +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.price_type import PriceType +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.create_multi_leg_order_cross_request_optional_data import ( - CreateMultiLegOrderCrossRequestOptionalData, - ) - from ..models.order_instruction import OrderInstruction - from ..models.create_multi_leg_order_cross_allocation import ( - CreateMultiLegOrderCrossAllocation, - ) - from ..models.create_multi_leg_order_cross_request_market_condition import ( - CreateMultiLegOrderCrossRequestMarketCondition, - ) - from ..models.create_multi_leg_order_cross_request_algo import ( - CreateMultiLegOrderCrossRequestAlgo, - ) + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_market_condition import CreateMultiLegOrderCrossRequestMarketCondition, + + from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_optional_data import CreateMultiLegOrderCrossRequestOptionalData, + + from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_algo import CreateMultiLegOrderCrossRequestAlgo, + + from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation import CreateMultiLegOrderCrossAllocation, + T = TypeVar("T", bound="CreateMultiLegOrderCrossRequest") diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py index df5deae47..9ccba7ba2 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py index 9895427a1..8b48a7804 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py index 95e7353d3..cd8d62e0c 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py index 70c212953..94ed8cd56 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.multi_leg_order_cross import MultiLegOrderCross + from openapi_project.openapi_package.models.multi_leg_order_cross import MultiLegOrderCross T = TypeVar("T", bound="CreateMultiLegOrderCrossResponse") diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_leg.py b/openapi_project/openapi_package/models/create_multi_leg_order_leg.py index 07eed36a9..9406bfd4a 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_leg.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_leg.py @@ -6,21 +6,19 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.position_effect import PositionEffect -from ..models.side import Side -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.position_effect import PositionEffect +from openapi_project.openapi_package.models.side import Side +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.create_multi_leg_order_leg_optional_data import ( - CreateMultiLegOrderLegOptionalData, - ) - from ..models.create_multi_leg_order_leg_market_condition import ( - CreateMultiLegOrderLegMarketCondition, - ) - from ..models.flex_option import FlexOption + from openapi_project.openapi_package.models.create_multi_leg_order_leg_market_condition import CreateMultiLegOrderLegMarketCondition, + + from openapi_project.openapi_package.models.flex_option import FlexOption + from openapi_project.openapi_package.models.create_multi_leg_order_leg_optional_data import CreateMultiLegOrderLegOptionalData, + T = TypeVar("T", bound="CreateMultiLegOrderLeg") diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py b/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py index 5bb6d177a..f0ee453a7 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py b/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py index bb108e37e..63405eab9 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_request.py b/openapi_project/openapi_package/models/create_multi_leg_order_request.py index 72cc496d3..bc6350e7d 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_request.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_request.py @@ -6,27 +6,24 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.ord_type import OrdType -from ..models.price_type import PriceType -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.price_type import PriceType +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.create_multi_leg_order_request_optional_data import ( - CreateMultiLegOrderRequestOptionalData, - ) - from ..models.create_multi_leg_order_leg import CreateMultiLegOrderLeg - from ..models.create_multi_leg_order_request_algo import ( - CreateMultiLegOrderRequestAlgo, - ) - from ..models.order_instruction import OrderInstruction - from ..models.create_multi_leg_order_request_market_condition import ( - CreateMultiLegOrderRequestMarketCondition, - ) - from ..models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.create_multi_leg_order_request_optional_data import CreateMultiLegOrderRequestOptionalData, + + from openapi_project.openapi_package.models.create_multi_leg_order_request_algo import CreateMultiLegOrderRequestAlgo, + + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.create_multi_leg_order_request_market_condition import CreateMultiLegOrderRequestMarketCondition, + + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.create_multi_leg_order_leg import CreateMultiLegOrderLeg T = TypeVar("T", bound="CreateMultiLegOrderRequest") diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py b/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py index 9461085e9..07bb1a8e6 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py b/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py index 6e6ee2f42..78acdb11a 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py b/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py index 500a545fe..5426c0ab7 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_response.py b/openapi_project/openapi_package/models/create_multi_leg_order_response.py index eb5f4939b..87e18f695 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_response.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_response.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.multi_leg_order import MultiLegOrder + from openapi_project.openapi_package.models.multi_leg_order import MultiLegOrder T = TypeVar("T", bound="CreateMultiLegOrderResponse") diff --git a/openapi_project/openapi_package/models/create_order_cross_allocation.py b/openapi_project/openapi_package/models/create_order_cross_allocation.py index 3774d4727..0ef3e40e2 100644 --- a/openapi_project/openapi_package/models/create_order_cross_allocation.py +++ b/openapi_project/openapi_package/models/create_order_cross_allocation.py @@ -6,20 +6,19 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.cross_side_type import CrossSideType -from ..models.position_effect import PositionEffect -from ..models.side import Side -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.cross_side_type import CrossSideType +from openapi_project.openapi_package.models.position_effect import PositionEffect +from openapi_project.openapi_package.models.side import Side +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.order_instruction import OrderInstruction - from ..models.clearing_info import ClearingInfo - from ..models.create_order_cross_allocation_optional_data import ( - CreateOrderCrossAllocationOptionalData, - ) + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.create_order_cross_allocation_optional_data import CreateOrderCrossAllocationOptionalData, + + from openapi_project.openapi_package.models.order_instruction import OrderInstruction T = TypeVar("T", bound="CreateOrderCrossAllocation") diff --git a/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py b/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py index 651c10e1e..69a7ffafc 100644 --- a/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py +++ b/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/create_order_cross_request.py b/openapi_project/openapi_package/models/create_order_cross_request.py index 788da0c23..deadf3a76 100644 --- a/openapi_project/openapi_package/models/create_order_cross_request.py +++ b/openapi_project/openapi_package/models/create_order_cross_request.py @@ -6,26 +6,24 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.cross_type import CrossType -from ..models.ord_type import OrdType -from ..models.price_type import PriceType -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.cross_type import CrossType +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.price_type import PriceType +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.create_order_cross_allocation import CreateOrderCrossAllocation - from ..models.create_order_cross_request_algo import CreateOrderCrossRequestAlgo - from ..models.order_instruction import OrderInstruction - from ..models.create_order_cross_request_optional_data import ( - CreateOrderCrossRequestOptionalData, - ) - from ..models.create_order_cross_request_market_condition import ( - CreateOrderCrossRequestMarketCondition, - ) - from ..models.flex_option import FlexOption + from openapi_project.openapi_package.models.create_order_cross_request_market_condition import CreateOrderCrossRequestMarketCondition, + + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.create_order_cross_request_optional_data import CreateOrderCrossRequestOptionalData, + + from openapi_project.openapi_package.models.flex_option import FlexOption + from openapi_project.openapi_package.models.create_order_cross_allocation import CreateOrderCrossAllocation + from openapi_project.openapi_package.models.create_order_cross_request_algo import CreateOrderCrossRequestAlgo T = TypeVar("T", bound="CreateOrderCrossRequest") diff --git a/openapi_project/openapi_package/models/create_order_cross_request_algo.py b/openapi_project/openapi_package/models/create_order_cross_request_algo.py index 98e5aaf36..693516ac8 100644 --- a/openapi_project/openapi_package/models/create_order_cross_request_algo.py +++ b/openapi_project/openapi_package/models/create_order_cross_request_algo.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py b/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py index 62e0bb6bd..f16be6888 100644 --- a/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py +++ b/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py b/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py index bf15703ed..06a735087 100644 --- a/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py +++ b/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/create_order_cross_response.py b/openapi_project/openapi_package/models/create_order_cross_response.py index fb9fdfcd0..c7835ce9d 100644 --- a/openapi_project/openapi_package/models/create_order_cross_response.py +++ b/openapi_project/openapi_package/models/create_order_cross_response.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.order_cross import OrderCross + from openapi_project.openapi_package.models.order_cross import OrderCross T = TypeVar("T", bound="CreateOrderCrossResponse") diff --git a/openapi_project/openapi_package/models/create_order_request.py b/openapi_project/openapi_package/models/create_order_request.py index 72aba571d..b7ec2ed16 100644 --- a/openapi_project/openapi_package/models/create_order_request.py +++ b/openapi_project/openapi_package/models/create_order_request.py @@ -6,27 +6,25 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - -from ..models.ord_type import OrdType -from ..models.position_effect import PositionEffect -from ..models.price_type import PriceType -from ..models.side import Side -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset + +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.position_effect import PositionEffect +from openapi_project.openapi_package.models.price_type import PriceType +from openapi_project.openapi_package.models.side import Side +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.order_instruction import OrderInstruction - from ..models.create_order_request_optional_data import ( - CreateOrderRequestOptionalData, - ) - from ..models.create_order_request_market_condition import ( - CreateOrderRequestMarketCondition, - ) - from ..models.create_order_request_algo import CreateOrderRequestAlgo - from ..models.clearing_info import ClearingInfo - from ..models.flex_option import FlexOption + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.create_order_request_market_condition import CreateOrderRequestMarketCondition, + + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.flex_option import FlexOption + from openapi_project.openapi_package.models.create_order_request_optional_data import CreateOrderRequestOptionalData, + + from openapi_project.openapi_package.models.create_order_request_algo import CreateOrderRequestAlgo T = TypeVar("T", bound="CreateOrderRequest") diff --git a/openapi_project/openapi_package/models/create_order_request_algo.py b/openapi_project/openapi_package/models/create_order_request_algo.py index 759f19df0..e3c864707 100644 --- a/openapi_project/openapi_package/models/create_order_request_algo.py +++ b/openapi_project/openapi_package/models/create_order_request_algo.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/create_order_request_market_condition.py b/openapi_project/openapi_package/models/create_order_request_market_condition.py index 7abbe4728..72be92d7d 100644 --- a/openapi_project/openapi_package/models/create_order_request_market_condition.py +++ b/openapi_project/openapi_package/models/create_order_request_market_condition.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/create_order_request_optional_data.py b/openapi_project/openapi_package/models/create_order_request_optional_data.py index 5905107a6..54d7e7972 100644 --- a/openapi_project/openapi_package/models/create_order_request_optional_data.py +++ b/openapi_project/openapi_package/models/create_order_request_optional_data.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/create_order_response.py b/openapi_project/openapi_package/models/create_order_response.py index f81573737..d7579f30f 100644 --- a/openapi_project/openapi_package/models/create_order_response.py +++ b/openapi_project/openapi_package/models/create_order_response.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.order import Order + from openapi_project.openapi_package.models.order import Order T = TypeVar("T", bound="CreateOrderResponse") diff --git a/openapi_project/openapi_package/models/crypto.py b/openapi_project/openapi_package/models/crypto.py index e41b10b80..9bdc251c4 100644 --- a/openapi_project/openapi_package/models/crypto.py +++ b/openapi_project/openapi_package/models/crypto.py @@ -6,18 +6,18 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.currency import Currency -from ..models.exchange_code import ExchangeCode -from ..models.numeric_display_format import NumericDisplayFormat -from ..models.security_category import SecurityCategory -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.models.exchange_code import ExchangeCode +from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat +from openapi_project.openapi_package.models.security_category import SecurityCategory +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.crypto_aliases import CryptoAliases - from ..models.date import Date + from openapi_project.openapi_package.models.crypto_aliases import CryptoAliases + from openapi_project.openapi_package.models.date import Date T = TypeVar("T", bound="Crypto") diff --git a/openapi_project/openapi_package/models/crypto_aliases.py b/openapi_project/openapi_package/models/crypto_aliases.py index 4d0e3443b..a9f4abe0e 100644 --- a/openapi_project/openapi_package/models/crypto_aliases.py +++ b/openapi_project/openapi_package/models/crypto_aliases.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/date.py b/openapi_project/openapi_package/models/date.py index 88e3416d8..f2b47ca29 100644 --- a/openapi_project/openapi_package/models/date.py +++ b/openapi_project/openapi_package/models/date.py @@ -6,9 +6,9 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="Date") diff --git a/openapi_project/openapi_package/models/easy_to_borrow_security.py b/openapi_project/openapi_package/models/easy_to_borrow_security.py index 23854d471..b5b5f85d2 100644 --- a/openapi_project/openapi_package/models/easy_to_borrow_security.py +++ b/openapi_project/openapi_package/models/easy_to_borrow_security.py @@ -6,9 +6,9 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="EasyToBorrowSecurity") diff --git a/openapi_project/openapi_package/models/empty.py b/openapi_project/openapi_package/models/empty.py index 793114dcf..b615a58ca 100644 --- a/openapi_project/openapi_package/models/empty.py +++ b/openapi_project/openapi_package/models/empty.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="Empty") diff --git a/openapi_project/openapi_package/models/exchange.py b/openapi_project/openapi_package/models/exchange.py index e0c39e522..e7f3562d3 100644 --- a/openapi_project/openapi_package/models/exchange.py +++ b/openapi_project/openapi_package/models/exchange.py @@ -6,9 +6,9 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="Exchange") diff --git a/openapi_project/openapi_package/models/execution.py b/openapi_project/openapi_package/models/execution.py index 9796f99c8..73734b333 100644 --- a/openapi_project/openapi_package/models/execution.py +++ b/openapi_project/openapi_package/models/execution.py @@ -6,27 +6,27 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - -from ..models.exec_type import ExecType -from ..models.multi_leg_reporting_type import MultiLegReportingType -from ..models.ord_status import OrdStatus -from ..models.ord_type import OrdType -from ..models.origination_type import OriginationType -from ..models.position_effect import PositionEffect -from ..models.price_type import PriceType -from ..models.side import Side -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset + +from openapi_project.openapi_package.models.exec_type import ExecType +from openapi_project.openapi_package.models.multi_leg_reporting_type import MultiLegReportingType +from openapi_project.openapi_package.models.ord_status import OrdStatus +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.origination_type import OriginationType +from openapi_project.openapi_package.models.position_effect import PositionEffect +from openapi_project.openapi_package.models.price_type import PriceType +from openapi_project.openapi_package.models.side import Side +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.execution_optional_data import ExecutionOptionalData - from ..models.order_instruction import OrderInstruction - from ..models.security import Security - from ..models.execution_algo import ExecutionAlgo - from ..models.header import Header - from ..models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.execution_algo import ExecutionAlgo + from openapi_project.openapi_package.models.execution_optional_data import ExecutionOptionalData + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.security import Security T = TypeVar("T", bound="Execution") diff --git a/openapi_project/openapi_package/models/execution_algo.py b/openapi_project/openapi_package/models/execution_algo.py index 4ef607baa..a3e0dff97 100644 --- a/openapi_project/openapi_package/models/execution_algo.py +++ b/openapi_project/openapi_package/models/execution_algo.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/execution_optional_data.py b/openapi_project/openapi_package/models/execution_optional_data.py index e0de3f038..c1df9d80b 100644 --- a/openapi_project/openapi_package/models/execution_optional_data.py +++ b/openapi_project/openapi_package/models/execution_optional_data.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/flex_option.py b/openapi_project/openapi_package/models/flex_option.py index a416a63bc..f3ede1761 100644 --- a/openapi_project/openapi_package/models/flex_option.py +++ b/openapi_project/openapi_package/models/flex_option.py @@ -6,22 +6,22 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - -from ..models.currency import Currency -from ..models.exchange_code import ExchangeCode -from ..models.numeric_display_format import NumericDisplayFormat -from ..models.option_exercise_style import OptionExerciseStyle -from ..models.option_series_product_type import OptionSeriesProductType -from ..models.option_settlement_type import OptionSettlementType -from ..models.put_call import PutCall -from ..models.security_category import SecurityCategory -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset + +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.models.exchange_code import ExchangeCode +from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat +from openapi_project.openapi_package.models.option_exercise_style import OptionExerciseStyle +from openapi_project.openapi_package.models.option_series_product_type import OptionSeriesProductType +from openapi_project.openapi_package.models.option_settlement_type import OptionSettlementType +from openapi_project.openapi_package.models.put_call import PutCall +from openapi_project.openapi_package.models.security_category import SecurityCategory +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.flex_option_aliases import FlexOptionAliases - from ..models.date import Date + from openapi_project.openapi_package.models.flex_option_aliases import FlexOptionAliases + from openapi_project.openapi_package.models.date import Date T = TypeVar("T", bound="FlexOption") diff --git a/openapi_project/openapi_package/models/flex_option_aliases.py b/openapi_project/openapi_package/models/flex_option_aliases.py index 20ad39503..6a6b28afa 100644 --- a/openapi_project/openapi_package/models/flex_option_aliases.py +++ b/openapi_project/openapi_package/models/flex_option_aliases.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/future.py b/openapi_project/openapi_package/models/future.py index c27e20f56..34df94e4c 100644 --- a/openapi_project/openapi_package/models/future.py +++ b/openapi_project/openapi_package/models/future.py @@ -6,19 +6,19 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.currency import Currency -from ..models.exchange_code import ExchangeCode -from ..models.numeric_display_format import NumericDisplayFormat -from ..models.security_category import SecurityCategory -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.models.exchange_code import ExchangeCode +from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat +from openapi_project.openapi_package.models.security_category import SecurityCategory +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.future_aliases import FutureAliases - from ..models.future_root import FutureRoot - from ..models.date import Date + from openapi_project.openapi_package.models.future_root import FutureRoot + from openapi_project.openapi_package.models.future_aliases import FutureAliases + from openapi_project.openapi_package.models.date import Date T = TypeVar("T", bound="Future") diff --git a/openapi_project/openapi_package/models/future_aliases.py b/openapi_project/openapi_package/models/future_aliases.py index e2c4b3fe9..d2d9b4744 100644 --- a/openapi_project/openapi_package/models/future_aliases.py +++ b/openapi_project/openapi_package/models/future_aliases.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/future_root.py b/openapi_project/openapi_package/models/future_root.py index d4b9c381a..363e3d31d 100644 --- a/openapi_project/openapi_package/models/future_root.py +++ b/openapi_project/openapi_package/models/future_root.py @@ -6,22 +6,22 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - -from ..models.currency import Currency -from ..models.exchange_code import ExchangeCode -from ..models.numeric_display_format import NumericDisplayFormat -from ..models.product_group import ProductGroup -from ..models.product_sub_group import ProductSubGroup -from ..models.security_category import SecurityCategory -from ..models.settlement_deliverable_type import SettlementDeliverableType -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset + +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.models.exchange_code import ExchangeCode +from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat +from openapi_project.openapi_package.models.product_group import ProductGroup +from openapi_project.openapi_package.models.product_sub_group import ProductSubGroup +from openapi_project.openapi_package.models.security_category import SecurityCategory +from openapi_project.openapi_package.models.settlement_deliverable_type import SettlementDeliverableType +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.future_root_aliases import FutureRootAliases - from ..models.date import Date - from ..models.trading_session_group import TradingSessionGroup + from openapi_project.openapi_package.models.future_root_aliases import FutureRootAliases + from openapi_project.openapi_package.models.trading_session_group import TradingSessionGroup + from openapi_project.openapi_package.models.date import Date T = TypeVar("T", bound="FutureRoot") diff --git a/openapi_project/openapi_package/models/future_root_aliases.py b/openapi_project/openapi_package/models/future_root_aliases.py index 150995a10..c9585d2a8 100644 --- a/openapi_project/openapi_package/models/future_root_aliases.py +++ b/openapi_project/openapi_package/models/future_root_aliases.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/future_spread.py b/openapi_project/openapi_package/models/future_spread.py index 7932e8712..f1d0b47dd 100644 --- a/openapi_project/openapi_package/models/future_spread.py +++ b/openapi_project/openapi_package/models/future_spread.py @@ -6,19 +6,19 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.currency import Currency -from ..models.exchange_code import ExchangeCode -from ..models.numeric_display_format import NumericDisplayFormat -from ..models.security_category import SecurityCategory -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.models.exchange_code import ExchangeCode +from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat +from openapi_project.openapi_package.models.security_category import SecurityCategory +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.future_spread_aliases import FutureSpreadAliases - from ..models.future_spread_leg import FutureSpreadLeg - from ..models.date import Date + from openapi_project.openapi_package.models.future_spread_leg import FutureSpreadLeg + from openapi_project.openapi_package.models.future_spread_aliases import FutureSpreadAliases + from openapi_project.openapi_package.models.date import Date T = TypeVar("T", bound="FutureSpread") diff --git a/openapi_project/openapi_package/models/future_spread_aliases.py b/openapi_project/openapi_package/models/future_spread_aliases.py index fe87693b8..9f563b8b1 100644 --- a/openapi_project/openapi_package/models/future_spread_aliases.py +++ b/openapi_project/openapi_package/models/future_spread_aliases.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/future_spread_leg.py b/openapi_project/openapi_package/models/future_spread_leg.py index 866dfd12b..cee4507d3 100644 --- a/openapi_project/openapi_package/models/future_spread_leg.py +++ b/openapi_project/openapi_package/models/future_spread_leg.py @@ -6,15 +6,15 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.spread_leg_side import SpreadLegSide -from ..models.spread_leg_type import SpreadLegType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.spread_leg_side import SpreadLegSide +from openapi_project.openapi_package.models.spread_leg_type import SpreadLegType +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.future import Future + from openapi_project.openapi_package.models.future import Future T = TypeVar("T", bound="FutureSpreadLeg") diff --git a/openapi_project/openapi_package/models/fx.py b/openapi_project/openapi_package/models/fx.py index 84029a087..c9661477f 100644 --- a/openapi_project/openapi_package/models/fx.py +++ b/openapi_project/openapi_package/models/fx.py @@ -6,18 +6,18 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.currency import Currency -from ..models.exchange_code import ExchangeCode -from ..models.numeric_display_format import NumericDisplayFormat -from ..models.security_category import SecurityCategory -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.models.exchange_code import ExchangeCode +from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat +from openapi_project.openapi_package.models.security_category import SecurityCategory +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.fx_aliases import FxAliases - from ..models.date import Date + from openapi_project.openapi_package.models.fx_aliases import FxAliases + from openapi_project.openapi_package.models.date import Date T = TypeVar("T", bound="Fx") diff --git a/openapi_project/openapi_package/models/fx_aliases.py b/openapi_project/openapi_package/models/fx_aliases.py index c22853ee0..b25e4755f 100644 --- a/openapi_project/openapi_package/models/fx_aliases.py +++ b/openapi_project/openapi_package/models/fx_aliases.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/generic_order.py b/openapi_project/openapi_package/models/generic_order.py index 1fc1fd48b..ff0b3780d 100644 --- a/openapi_project/openapi_package/models/generic_order.py +++ b/openapi_project/openapi_package/models/generic_order.py @@ -6,16 +6,16 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.order_cross import OrderCross - from ..models.multi_leg_order_cross import MultiLegOrderCross - from ..models.order import Order - from ..models.multi_leg_order import MultiLegOrder + from openapi_project.openapi_package.models.order import Order + from openapi_project.openapi_package.models.order_cross import OrderCross + from openapi_project.openapi_package.models.multi_leg_order_cross import MultiLegOrderCross + from openapi_project.openapi_package.models.multi_leg_order import MultiLegOrder T = TypeVar("T", bound="GenericOrder") diff --git a/openapi_project/openapi_package/models/get_active_user_response.py b/openapi_project/openapi_package/models/get_active_user_response.py index 4e7a49362..291bc1506 100644 --- a/openapi_project/openapi_package/models/get_active_user_response.py +++ b/openapi_project/openapi_package/models/get_active_user_response.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.user import User + from openapi_project.openapi_package.models.user import User T = TypeVar("T", bound="GetActiveUserResponse") diff --git a/openapi_project/openapi_package/models/get_server_info_response.py b/openapi_project/openapi_package/models/get_server_info_response.py index f0f106359..a5900bade 100644 --- a/openapi_project/openapi_package/models/get_server_info_response.py +++ b/openapi_project/openapi_package/models/get_server_info_response.py @@ -6,16 +6,15 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.get_server_info_response_system_settings import ( - GetServerInfoResponseSystemSettings, - ) + from openapi_project.openapi_package.models.get_server_info_response_system_settings import GetServerInfoResponseSystemSettings, + T = TypeVar("T", bound="GetServerInfoResponse") diff --git a/openapi_project/openapi_package/models/get_server_info_response_system_settings.py b/openapi_project/openapi_package/models/get_server_info_response_system_settings.py index b6011e23a..813ca1811 100644 --- a/openapi_project/openapi_package/models/get_server_info_response_system_settings.py +++ b/openapi_project/openapi_package/models/get_server_info_response_system_settings.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/get_server_time_response.py b/openapi_project/openapi_package/models/get_server_time_response.py index 5852d6dff..65afee073 100644 --- a/openapi_project/openapi_package/models/get_server_time_response.py +++ b/openapi_project/openapi_package/models/get_server_time_response.py @@ -6,10 +6,10 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="GetServerTimeResponse") diff --git a/openapi_project/openapi_package/models/get_trading_holidays_response.py b/openapi_project/openapi_package/models/get_trading_holidays_response.py index 0d8d46b63..327231be4 100644 --- a/openapi_project/openapi_package/models/get_trading_holidays_response.py +++ b/openapi_project/openapi_package/models/get_trading_holidays_response.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.trading_holiday import TradingHoliday + from openapi_project.openapi_package.models.trading_holiday import TradingHoliday T = TypeVar("T", bound="GetTradingHolidaysResponse") diff --git a/openapi_project/openapi_package/models/header.py b/openapi_project/openapi_package/models/header.py index fc700def2..1b22cb13c 100644 --- a/openapi_project/openapi_package/models/header.py +++ b/openapi_project/openapi_package/models/header.py @@ -6,9 +6,9 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="Header") diff --git a/openapi_project/openapi_package/models/index.py b/openapi_project/openapi_package/models/index.py index c7f983e9c..c260eeae9 100644 --- a/openapi_project/openapi_package/models/index.py +++ b/openapi_project/openapi_package/models/index.py @@ -6,18 +6,18 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.currency import Currency -from ..models.exchange_code import ExchangeCode -from ..models.numeric_display_format import NumericDisplayFormat -from ..models.security_category import SecurityCategory -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.models.exchange_code import ExchangeCode +from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat +from openapi_project.openapi_package.models.security_category import SecurityCategory +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.index_aliases import IndexAliases - from ..models.date import Date + from openapi_project.openapi_package.models.index_aliases import IndexAliases + from openapi_project.openapi_package.models.date import Date T = TypeVar("T", bound="Index") diff --git a/openapi_project/openapi_package/models/index_aliases.py b/openapi_project/openapi_package/models/index_aliases.py index 7ffb287b9..c755bf44a 100644 --- a/openapi_project/openapi_package/models/index_aliases.py +++ b/openapi_project/openapi_package/models/index_aliases.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/list_accounts_response.py b/openapi_project/openapi_package/models/list_accounts_response.py index f9a4d9b12..de7dddf29 100644 --- a/openapi_project/openapi_package/models/list_accounts_response.py +++ b/openapi_project/openapi_package/models/list_accounts_response.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.account import Account + from openapi_project.openapi_package.models.account import Account T = TypeVar("T", bound="ListAccountsResponse") diff --git a/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py b/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py index e49e07844..dbdec99ae 100644 --- a/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py +++ b/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.trading_firm_slim import TradingFirmSlim + from openapi_project.openapi_package.models.trading_firm_slim import TradingFirmSlim T = TypeVar("T", bound="ListAffiliatedTradingFirmsResponse") diff --git a/openapi_project/openapi_package/models/list_easy_to_borrow_securities_request.py b/openapi_project/openapi_package/models/list_easy_to_borrow_securities_request.py index 17392ee91..b8e4188f0 100644 --- a/openapi_project/openapi_package/models/list_easy_to_borrow_securities_request.py +++ b/openapi_project/openapi_package/models/list_easy_to_borrow_securities_request.py @@ -6,9 +6,9 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="ListEasyToBorrowSecuritiesRequest") diff --git a/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py b/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py index e4f90ad6f..7d5a4f0d1 100644 --- a/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py +++ b/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.easy_to_borrow_security import EasyToBorrowSecurity + from openapi_project.openapi_package.models.easy_to_borrow_security import EasyToBorrowSecurity T = TypeVar("T", bound="ListEasyToBorrowSecuritiesResponse") diff --git a/openapi_project/openapi_package/models/list_exchanges_response.py b/openapi_project/openapi_package/models/list_exchanges_response.py index bfe656757..ce18f8f68 100644 --- a/openapi_project/openapi_package/models/list_exchanges_response.py +++ b/openapi_project/openapi_package/models/list_exchanges_response.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.exchange import Exchange + from openapi_project.openapi_package.models.exchange import Exchange T = TypeVar("T", bound="ListExchangesResponse") diff --git a/openapi_project/openapi_package/models/list_option_chains_repsonse.py b/openapi_project/openapi_package/models/list_option_chains_repsonse.py index e209c038a..7cb006551 100644 --- a/openapi_project/openapi_package/models/list_option_chains_repsonse.py +++ b/openapi_project/openapi_package/models/list_option_chains_repsonse.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.option_chain import OptionChain + from openapi_project.openapi_package.models.option_chain import OptionChain T = TypeVar("T", bound="ListOptionChainsRepsonse") diff --git a/openapi_project/openapi_package/models/list_option_chains_request.py b/openapi_project/openapi_package/models/list_option_chains_request.py index 0e8e285a1..2623150e3 100644 --- a/openapi_project/openapi_package/models/list_option_chains_request.py +++ b/openapi_project/openapi_package/models/list_option_chains_request.py @@ -6,9 +6,9 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast diff --git a/openapi_project/openapi_package/models/list_orders_response.py b/openapi_project/openapi_package/models/list_orders_response.py index bec55729f..ed0d79409 100644 --- a/openapi_project/openapi_package/models/list_orders_response.py +++ b/openapi_project/openapi_package/models/list_orders_response.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.generic_order import GenericOrder + from openapi_project.openapi_package.models.generic_order import GenericOrder T = TypeVar("T", bound="ListOrdersResponse") diff --git a/openapi_project/openapi_package/models/list_positions_response.py b/openapi_project/openapi_package/models/list_positions_response.py index a5fe88197..e1a2ad5ba 100644 --- a/openapi_project/openapi_package/models/list_positions_response.py +++ b/openapi_project/openapi_package/models/list_positions_response.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.position import Position + from openapi_project.openapi_package.models.position import Position T = TypeVar("T", bound="ListPositionsResponse") diff --git a/openapi_project/openapi_package/models/list_routes_response.py b/openapi_project/openapi_package/models/list_routes_response.py index c5789d0b8..a4b5b7ac5 100644 --- a/openapi_project/openapi_package/models/list_routes_response.py +++ b/openapi_project/openapi_package/models/list_routes_response.py @@ -6,15 +6,15 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.route import Route - from ..models.route_applicability import RouteApplicability + from openapi_project.openapi_package.models.route import Route + from openapi_project.openapi_package.models.route_applicability import RouteApplicability T = TypeVar("T", bound="ListRoutesResponse") diff --git a/openapi_project/openapi_package/models/list_securities_request.py b/openapi_project/openapi_package/models/list_securities_request.py index 39f9d21c3..8f9a1841b 100644 --- a/openapi_project/openapi_package/models/list_securities_request.py +++ b/openapi_project/openapi_package/models/list_securities_request.py @@ -6,9 +6,9 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast diff --git a/openapi_project/openapi_package/models/list_securities_response.py b/openapi_project/openapi_package/models/list_securities_response.py index 46a6bbb11..bdf9969c3 100644 --- a/openapi_project/openapi_package/models/list_securities_response.py +++ b/openapi_project/openapi_package/models/list_securities_response.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.security import Security + from openapi_project.openapi_package.models.security import Security T = TypeVar("T", bound="ListSecuritiesResponse") diff --git a/openapi_project/openapi_package/models/list_trade_confirms_response.py b/openapi_project/openapi_package/models/list_trade_confirms_response.py index e81edf387..6e58b7ad0 100644 --- a/openapi_project/openapi_package/models/list_trade_confirms_response.py +++ b/openapi_project/openapi_package/models/list_trade_confirms_response.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.trade_confirm import TradeConfirm + from openapi_project.openapi_package.models.trade_confirm import TradeConfirm T = TypeVar("T", bound="ListTradeConfirmsResponse") diff --git a/openapi_project/openapi_package/models/list_trading_firms_response.py b/openapi_project/openapi_package/models/list_trading_firms_response.py index 642593708..416eb659c 100644 --- a/openapi_project/openapi_package/models/list_trading_firms_response.py +++ b/openapi_project/openapi_package/models/list_trading_firms_response.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.trading_firm import TradingFirm + from openapi_project.openapi_package.models.trading_firm import TradingFirm T = TypeVar("T", bound="ListTradingFirmsResponse") diff --git a/openapi_project/openapi_package/models/login_request.py b/openapi_project/openapi_package/models/login_request.py index 9ce26061c..54b75f9c3 100644 --- a/openapi_project/openapi_package/models/login_request.py +++ b/openapi_project/openapi_package/models/login_request.py @@ -6,9 +6,9 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="LoginRequest") diff --git a/openapi_project/openapi_package/models/login_response.py b/openapi_project/openapi_package/models/login_response.py index a97b07c32..8d0901e33 100644 --- a/openapi_project/openapi_package/models/login_response.py +++ b/openapi_project/openapi_package/models/login_response.py @@ -6,16 +6,16 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.login_status import LoginStatus -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.login_status import LoginStatus +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.login_response_system_settings import LoginResponseSystemSettings - from ..models.user import User + from openapi_project.openapi_package.models.user import User + from openapi_project.openapi_package.models.login_response_system_settings import LoginResponseSystemSettings T = TypeVar("T", bound="LoginResponse") diff --git a/openapi_project/openapi_package/models/login_response_system_settings.py b/openapi_project/openapi_package/models/login_response_system_settings.py index 3b807559a..98b0a2586 100644 --- a/openapi_project/openapi_package/models/login_response_system_settings.py +++ b/openapi_project/openapi_package/models/login_response_system_settings.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/margin_data.py b/openapi_project/openapi_package/models/margin_data.py index 6c9f61c77..7e5053af1 100644 --- a/openapi_project/openapi_package/models/margin_data.py +++ b/openapi_project/openapi_package/models/margin_data.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.tims_margin_data import TimsMarginData - from ..models.empty import Empty + from openapi_project.openapi_package.models.tims_margin_data import TimsMarginData + from openapi_project.openapi_package.models.empty import Empty T = TypeVar("T", bound="MarginData") diff --git a/openapi_project/openapi_package/models/multi_leg_order.py b/openapi_project/openapi_package/models/multi_leg_order.py index 7c2a8620b..07ffd5cb0 100644 --- a/openapi_project/openapi_package/models/multi_leg_order.py +++ b/openapi_project/openapi_package/models/multi_leg_order.py @@ -6,25 +6,25 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - -from ..models.ord_status import OrdStatus -from ..models.ord_type import OrdType -from ..models.origination_type import OriginationType -from ..models.price_type import PriceType -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset + +from openapi_project.openapi_package.models.ord_status import OrdStatus +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.origination_type import OriginationType +from openapi_project.openapi_package.models.price_type import PriceType +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.multi_leg_order_algo import MultiLegOrderAlgo - from ..models.multi_leg_order_optional_data import MultiLegOrderOptionalData - from ..models.order_update_event import OrderUpdateEvent - from ..models.order_instruction import OrderInstruction - from ..models.multi_leg_order_leg import MultiLegOrderLeg - from ..models.header import Header - from ..models.multi_leg_order_market_condition import MultiLegOrderMarketCondition - from ..models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.multi_leg_order_optional_data import MultiLegOrderOptionalData + from openapi_project.openapi_package.models.multi_leg_order_algo import MultiLegOrderAlgo + from openapi_project.openapi_package.models.multi_leg_order_leg import MultiLegOrderLeg + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.multi_leg_order_market_condition import MultiLegOrderMarketCondition T = TypeVar("T", bound="MultiLegOrder") diff --git a/openapi_project/openapi_package/models/multi_leg_order_algo.py b/openapi_project/openapi_package/models/multi_leg_order_algo.py index ad5cc6979..fd48d7730 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_algo.py +++ b/openapi_project/openapi_package/models/multi_leg_order_algo.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py index cacfca3ea..c7261f20c 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py @@ -6,29 +6,26 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - -from ..models.ord_type import OrdType -from ..models.origination_type import OriginationType -from ..models.price_type import PriceType -from ..models.side import Side -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset + +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.origination_type import OriginationType +from openapi_project.openapi_package.models.price_type import PriceType +from openapi_project.openapi_package.models.side import Side +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.multi_leg_order_cancel_replace_request_market_condition import ( - MultiLegOrderCancelReplaceRequestMarketCondition, - ) - from ..models.order_instruction import OrderInstruction - from ..models.multi_leg_order_cancel_replace_request_algo import ( - MultiLegOrderCancelReplaceRequestAlgo, - ) - from ..models.header import Header - from ..models.clearing_info import ClearingInfo - from ..models.multi_leg_order_cancel_replace_request_optional_data import ( - MultiLegOrderCancelReplaceRequestOptionalData, - ) + from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_optional_data import MultiLegOrderCancelReplaceRequestOptionalData, + + from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_market_condition import MultiLegOrderCancelReplaceRequestMarketCondition, + + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_algo import MultiLegOrderCancelReplaceRequestAlgo, + + from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.clearing_info import ClearingInfo T = TypeVar("T", bound="MultiLegOrderCancelReplaceRequest") diff --git a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py index d8c58d78f..8e15402fd 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py index 6f1689301..870320ac7 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py index 3b3d7f894..3b668b038 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross.py b/openapi_project/openapi_package/models/multi_leg_order_cross.py index e3406a8ea..592845f16 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross.py @@ -6,29 +6,27 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - -from ..models.cross_type import CrossType -from ..models.ord_status import OrdStatus -from ..models.ord_type import OrdType -from ..models.origination_type import OriginationType -from ..models.price_type import PriceType -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset + +from openapi_project.openapi_package.models.cross_type import CrossType +from openapi_project.openapi_package.models.ord_status import OrdStatus +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.origination_type import OriginationType +from openapi_project.openapi_package.models.price_type import PriceType +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.order_update_event import OrderUpdateEvent - from ..models.order_instruction import OrderInstruction - from ..models.multi_leg_order_cross_algo import MultiLegOrderCrossAlgo - from ..models.multi_leg_order_cross_market_condition import ( - MultiLegOrderCrossMarketCondition, - ) - from ..models.multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation - from ..models.header import Header - from ..models.multi_leg_order_cross_optional_data import ( - MultiLegOrderCrossOptionalData, - ) + from openapi_project.openapi_package.models.multi_leg_order_cross_algo import MultiLegOrderCrossAlgo + from openapi_project.openapi_package.models.multi_leg_order_cross_optional_data import MultiLegOrderCrossOptionalData, + + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation + from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent + from openapi_project.openapi_package.models.multi_leg_order_cross_market_condition import MultiLegOrderCrossMarketCondition, + T = TypeVar("T", bound="MultiLegOrderCross") diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py b/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py index 4802c7f97..32f374b7b 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py index caf827a0d..f26b1f5ae 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py @@ -6,20 +6,19 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.cross_side_type import CrossSideType -from ..models.ord_status import OrdStatus -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.cross_side_type import CrossSideType +from openapi_project.openapi_package.models.ord_status import OrdStatus +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.order_instruction import OrderInstruction - from ..models.clearing_info import ClearingInfo - from ..models.multi_leg_order_cross_allocation_optional_data import ( - MultiLegOrderCrossAllocationOptionalData, - ) - from ..models.multi_leg_order_leg import MultiLegOrderLeg + from openapi_project.openapi_package.models.multi_leg_order_leg import MultiLegOrderLeg + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.multi_leg_order_cross_allocation_optional_data import MultiLegOrderCrossAllocationOptionalData, + T = TypeVar("T", bound="MultiLegOrderCrossAllocation") diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py index 5e3f075d3..98af9b7cf 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py b/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py index 24f82a634..3a0cae696 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py index 063ad738a..95eb1fdaf 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/multi_leg_order_leg.py b/openapi_project/openapi_package/models/multi_leg_order_leg.py index 514892ebe..1e654bf7b 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_leg.py +++ b/openapi_project/openapi_package/models/multi_leg_order_leg.py @@ -6,20 +6,19 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.position_effect import PositionEffect -from ..models.side import Side -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.position_effect import PositionEffect +from openapi_project.openapi_package.models.side import Side +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.multi_leg_order_leg_optional_data import MultiLegOrderLegOptionalData - from ..models.multi_leg_order_leg_market_condition import ( - MultiLegOrderLegMarketCondition, - ) - from ..models.security import Security - from ..models.order_update_event import OrderUpdateEvent + from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent + from openapi_project.openapi_package.models.multi_leg_order_leg_optional_data import MultiLegOrderLegOptionalData + from openapi_project.openapi_package.models.security import Security + from openapi_project.openapi_package.models.multi_leg_order_leg_market_condition import MultiLegOrderLegMarketCondition, + T = TypeVar("T", bound="MultiLegOrderLeg") diff --git a/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py b/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py index e93e2e535..4681957cc 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py +++ b/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py index b2d6bb249..a098fce45 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py +++ b/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/multi_leg_order_market_condition.py b/openapi_project/openapi_package/models/multi_leg_order_market_condition.py index 833ee0c78..aeb0d4b6e 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_market_condition.py +++ b/openapi_project/openapi_package/models/multi_leg_order_market_condition.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/multi_leg_order_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_optional_data.py index 2b59e05f3..b02a0ec60 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_optional_data.py +++ b/openapi_project/openapi_package/models/multi_leg_order_optional_data.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/option.py b/openapi_project/openapi_package/models/option.py index 94ee344fe..89a1dc641 100644 --- a/openapi_project/openapi_package/models/option.py +++ b/openapi_project/openapi_package/models/option.py @@ -6,21 +6,21 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - -from ..models.currency import Currency -from ..models.exchange_code import ExchangeCode -from ..models.numeric_display_format import NumericDisplayFormat -from ..models.option_expiration_style import OptionExpirationStyle -from ..models.put_call import PutCall -from ..models.security_category import SecurityCategory -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset + +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.models.exchange_code import ExchangeCode +from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat +from openapi_project.openapi_package.models.option_expiration_style import OptionExpirationStyle +from openapi_project.openapi_package.models.put_call import PutCall +from openapi_project.openapi_package.models.security_category import SecurityCategory +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.option_aliases import OptionAliases - from ..models.date import Date - from ..models.option_root import OptionRoot + from openapi_project.openapi_package.models.option_aliases import OptionAliases + from openapi_project.openapi_package.models.date import Date + from openapi_project.openapi_package.models.option_root import OptionRoot T = TypeVar("T", bound="Option") diff --git a/openapi_project/openapi_package/models/option_aliases.py b/openapi_project/openapi_package/models/option_aliases.py index f075feb74..067b8a3d6 100644 --- a/openapi_project/openapi_package/models/option_aliases.py +++ b/openapi_project/openapi_package/models/option_aliases.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/option_chain.py b/openapi_project/openapi_package/models/option_chain.py index 9d0e0c6ea..bead52b54 100644 --- a/openapi_project/openapi_package/models/option_chain.py +++ b/openapi_project/openapi_package/models/option_chain.py @@ -6,16 +6,16 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.option_chain_roots import OptionChainRoots - from ..models.security import Security - from ..models.option_chain_options import OptionChainOptions - from ..models.option_series import OptionSeries + from openapi_project.openapi_package.models.option_chain_roots import OptionChainRoots + from openapi_project.openapi_package.models.option_chain_options import OptionChainOptions + from openapi_project.openapi_package.models.security import Security + from openapi_project.openapi_package.models.option_series import OptionSeries T = TypeVar("T", bound="OptionChain") diff --git a/openapi_project/openapi_package/models/option_chain_option.py b/openapi_project/openapi_package/models/option_chain_option.py index 986f5741d..5197f3c6b 100644 --- a/openapi_project/openapi_package/models/option_chain_option.py +++ b/openapi_project/openapi_package/models/option_chain_option.py @@ -6,16 +6,16 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.exchange_code import ExchangeCode -from ..models.put_call import PutCall -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.exchange_code import ExchangeCode +from openapi_project.openapi_package.models.put_call import PutCall +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.option_chain_option_aliases import OptionChainOptionAliases - from ..models.date import Date + from openapi_project.openapi_package.models.option_chain_option_aliases import OptionChainOptionAliases + from openapi_project.openapi_package.models.date import Date T = TypeVar("T", bound="OptionChainOption") diff --git a/openapi_project/openapi_package/models/option_chain_option_aliases.py b/openapi_project/openapi_package/models/option_chain_option_aliases.py index 5b49d38ab..24c78de95 100644 --- a/openapi_project/openapi_package/models/option_chain_option_aliases.py +++ b/openapi_project/openapi_package/models/option_chain_option_aliases.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/option_chain_options.py b/openapi_project/openapi_package/models/option_chain_options.py index cb22fc1a8..1fb9619ca 100644 --- a/openapi_project/openapi_package/models/option_chain_options.py +++ b/openapi_project/openapi_package/models/option_chain_options.py @@ -6,12 +6,12 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.option_chain_option import OptionChainOption + from openapi_project.openapi_package.models.option_chain_option import OptionChainOption T = TypeVar("T", bound="OptionChainOptions") diff --git a/openapi_project/openapi_package/models/option_chain_roots.py b/openapi_project/openapi_package/models/option_chain_roots.py index 49893e3f2..8537d42bc 100644 --- a/openapi_project/openapi_package/models/option_chain_roots.py +++ b/openapi_project/openapi_package/models/option_chain_roots.py @@ -6,12 +6,12 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.option_root import OptionRoot + from openapi_project.openapi_package.models.option_root import OptionRoot T = TypeVar("T", bound="OptionChainRoots") diff --git a/openapi_project/openapi_package/models/option_root.py b/openapi_project/openapi_package/models/option_root.py index 08926d486..4dce76327 100644 --- a/openapi_project/openapi_package/models/option_root.py +++ b/openapi_project/openapi_package/models/option_root.py @@ -6,24 +6,24 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - -from ..models.currency import Currency -from ..models.exchange_code import ExchangeCode -from ..models.numeric_display_format import NumericDisplayFormat -from ..models.option_exercise_style import OptionExerciseStyle -from ..models.option_series_product_type import OptionSeriesProductType -from ..models.option_series_type import OptionSeriesType -from ..models.option_settlement_type import OptionSettlementType -from ..models.security_category import SecurityCategory -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset + +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.models.exchange_code import ExchangeCode +from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat +from openapi_project.openapi_package.models.option_exercise_style import OptionExerciseStyle +from openapi_project.openapi_package.models.option_series_product_type import OptionSeriesProductType +from openapi_project.openapi_package.models.option_series_type import OptionSeriesType +from openapi_project.openapi_package.models.option_settlement_type import OptionSettlementType +from openapi_project.openapi_package.models.security_category import SecurityCategory +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.date import Date - from ..models.settlement_info import SettlementInfo - from ..models.trading_session_group import TradingSessionGroup - from ..models.option_root_aliases import OptionRootAliases + from openapi_project.openapi_package.models.trading_session_group import TradingSessionGroup + from openapi_project.openapi_package.models.settlement_info import SettlementInfo + from openapi_project.openapi_package.models.option_root_aliases import OptionRootAliases + from openapi_project.openapi_package.models.date import Date T = TypeVar("T", bound="OptionRoot") diff --git a/openapi_project/openapi_package/models/option_root_aliases.py b/openapi_project/openapi_package/models/option_root_aliases.py index 54f21378d..2df24a7ba 100644 --- a/openapi_project/openapi_package/models/option_root_aliases.py +++ b/openapi_project/openapi_package/models/option_root_aliases.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/option_series.py b/openapi_project/openapi_package/models/option_series.py index c2be2e350..89caa037d 100644 --- a/openapi_project/openapi_package/models/option_series.py +++ b/openapi_project/openapi_package/models/option_series.py @@ -6,19 +6,19 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - -from ..models.currency import Currency -from ..models.numeric_display_format import NumericDisplayFormat -from ..models.option_expiration_style import OptionExpirationStyle -from ..models.option_series_type import OptionSeriesType -from ..models.option_settlement_type import OptionSettlementType -from ..models.security_category import SecurityCategory -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset + +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat +from openapi_project.openapi_package.models.option_expiration_style import OptionExpirationStyle +from openapi_project.openapi_package.models.option_series_type import OptionSeriesType +from openapi_project.openapi_package.models.option_settlement_type import OptionSettlementType +from openapi_project.openapi_package.models.security_category import SecurityCategory +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.date import Date + from openapi_project.openapi_package.models.date import Date T = TypeVar("T", bound="OptionSeries") diff --git a/openapi_project/openapi_package/models/order.py b/openapi_project/openapi_package/models/order.py index 292da356f..6b4c82222 100644 --- a/openapi_project/openapi_package/models/order.py +++ b/openapi_project/openapi_package/models/order.py @@ -6,27 +6,27 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - -from ..models.ord_status import OrdStatus -from ..models.ord_type import OrdType -from ..models.origination_type import OriginationType -from ..models.position_effect import PositionEffect -from ..models.price_type import PriceType -from ..models.side import Side -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset + +from openapi_project.openapi_package.models.ord_status import OrdStatus +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.origination_type import OriginationType +from openapi_project.openapi_package.models.position_effect import PositionEffect +from openapi_project.openapi_package.models.price_type import PriceType +from openapi_project.openapi_package.models.side import Side +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.order_optional_data import OrderOptionalData - from ..models.order_update_event import OrderUpdateEvent - from ..models.order_instruction import OrderInstruction - from ..models.order_market_condition import OrderMarketCondition - from ..models.security import Security - from ..models.order_algo import OrderAlgo - from ..models.header import Header - from ..models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.order_optional_data import OrderOptionalData + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.order_market_condition import OrderMarketCondition + from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.order_algo import OrderAlgo + from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.security import Security T = TypeVar("T", bound="Order") diff --git a/openapi_project/openapi_package/models/order_algo.py b/openapi_project/openapi_package/models/order_algo.py index 69af1fda6..298a18451 100644 --- a/openapi_project/openapi_package/models/order_algo.py +++ b/openapi_project/openapi_package/models/order_algo.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/order_cancel_reject.py b/openapi_project/openapi_package/models/order_cancel_reject.py index 8e2e2900a..826787949 100644 --- a/openapi_project/openapi_package/models/order_cancel_reject.py +++ b/openapi_project/openapi_package/models/order_cancel_reject.py @@ -6,16 +6,16 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.cxl_rej_response_to import CxlRejResponseTo -from ..models.ord_status import OrdStatus -from ..models.origination_type import OriginationType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.cxl_rej_response_to import CxlRejResponseTo +from openapi_project.openapi_package.models.ord_status import OrdStatus +from openapi_project.openapi_package.models.origination_type import OriginationType +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.order_cancel_reject_optional_data import OrderCancelRejectOptionalData + from openapi_project.openapi_package.models.order_cancel_reject_optional_data import OrderCancelRejectOptionalData T = TypeVar("T", bound="OrderCancelReject") diff --git a/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py b/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py index ec1e21b05..5f998b411 100644 --- a/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py +++ b/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/order_cancel_replace_request.py b/openapi_project/openapi_package/models/order_cancel_replace_request.py index 163bc484d..35dcafc0c 100644 --- a/openapi_project/openapi_package/models/order_cancel_replace_request.py +++ b/openapi_project/openapi_package/models/order_cancel_replace_request.py @@ -6,27 +6,25 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - -from ..models.ord_type import OrdType -from ..models.origination_type import OriginationType -from ..models.price_type import PriceType -from ..models.side import Side -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset + +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.origination_type import OriginationType +from openapi_project.openapi_package.models.price_type import PriceType +from openapi_project.openapi_package.models.side import Side +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.order_instruction import OrderInstruction - from ..models.order_cancel_replace_request_optional_data import ( - OrderCancelReplaceRequestOptionalData, - ) - from ..models.order_cancel_replace_request_market_condition import ( - OrderCancelReplaceRequestMarketCondition, - ) - from ..models.header import Header - from ..models.clearing_info import ClearingInfo - from ..models.order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo + from openapi_project.openapi_package.models.order_cancel_replace_request_market_condition import OrderCancelReplaceRequestMarketCondition, + + from openapi_project.openapi_package.models.order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.order_cancel_replace_request_optional_data import OrderCancelReplaceRequestOptionalData, + T = TypeVar("T", bound="OrderCancelReplaceRequest") diff --git a/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py b/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py index a686ec89c..0005e8bb1 100644 --- a/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py +++ b/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py b/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py index 2dbdcd57d..b5f504ec1 100644 --- a/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py +++ b/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py b/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py index 02238ee23..0142ef858 100644 --- a/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py +++ b/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/order_cancel_request.py b/openapi_project/openapi_package/models/order_cancel_request.py index 480172412..407d6fecb 100644 --- a/openapi_project/openapi_package/models/order_cancel_request.py +++ b/openapi_project/openapi_package/models/order_cancel_request.py @@ -6,17 +6,16 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.origination_type import OriginationType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.origination_type import OriginationType +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.order_instruction import OrderInstruction - from ..models.order_cancel_request_optional_data import ( - OrderCancelRequestOptionalData, - ) + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.order_cancel_request_optional_data import OrderCancelRequestOptionalData, + T = TypeVar("T", bound="OrderCancelRequest") diff --git a/openapi_project/openapi_package/models/order_cancel_request_optional_data.py b/openapi_project/openapi_package/models/order_cancel_request_optional_data.py index 99bdfde4f..32e9a251d 100644 --- a/openapi_project/openapi_package/models/order_cancel_request_optional_data.py +++ b/openapi_project/openapi_package/models/order_cancel_request_optional_data.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/order_cross.py b/openapi_project/openapi_package/models/order_cross.py index 45e4392a8..cdd0cdfe5 100644 --- a/openapi_project/openapi_package/models/order_cross.py +++ b/openapi_project/openapi_package/models/order_cross.py @@ -6,26 +6,26 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - -from ..models.cross_type import CrossType -from ..models.ord_status import OrdStatus -from ..models.ord_type import OrdType -from ..models.origination_type import OriginationType -from ..models.price_type import PriceType -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset + +from openapi_project.openapi_package.models.cross_type import CrossType +from openapi_project.openapi_package.models.ord_status import OrdStatus +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.origination_type import OriginationType +from openapi_project.openapi_package.models.price_type import PriceType +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.order_cross_optional_data import OrderCrossOptionalData - from ..models.order_update_event import OrderUpdateEvent - from ..models.order_instruction import OrderInstruction - from ..models.order_cross_allocation import OrderCrossAllocation - from ..models.header import Header - from ..models.security import Security - from ..models.order_cross_market_condition import OrderCrossMarketCondition - from ..models.order_cross_algo import OrderCrossAlgo + from openapi_project.openapi_package.models.order_cross_allocation import OrderCrossAllocation + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.order_cross_algo import OrderCrossAlgo + from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent + from openapi_project.openapi_package.models.order_cross_market_condition import OrderCrossMarketCondition + from openapi_project.openapi_package.models.security import Security + from openapi_project.openapi_package.models.order_cross_optional_data import OrderCrossOptionalData T = TypeVar("T", bound="OrderCross") diff --git a/openapi_project/openapi_package/models/order_cross_algo.py b/openapi_project/openapi_package/models/order_cross_algo.py index 292407d5b..89a5a5e63 100644 --- a/openapi_project/openapi_package/models/order_cross_algo.py +++ b/openapi_project/openapi_package/models/order_cross_algo.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/order_cross_allocation.py b/openapi_project/openapi_package/models/order_cross_allocation.py index e28a43d20..0a4537720 100644 --- a/openapi_project/openapi_package/models/order_cross_allocation.py +++ b/openapi_project/openapi_package/models/order_cross_allocation.py @@ -6,21 +6,20 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.cross_side_type import CrossSideType -from ..models.ord_status import OrdStatus -from ..models.position_effect import PositionEffect -from ..models.side import Side -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.cross_side_type import CrossSideType +from openapi_project.openapi_package.models.ord_status import OrdStatus +from openapi_project.openapi_package.models.position_effect import PositionEffect +from openapi_project.openapi_package.models.side import Side +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.order_instruction import OrderInstruction - from ..models.order_cross_allocation_optional_data import ( - OrderCrossAllocationOptionalData, - ) - from ..models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.order_cross_allocation_optional_data import OrderCrossAllocationOptionalData, + + from openapi_project.openapi_package.models.order_instruction import OrderInstruction T = TypeVar("T", bound="OrderCrossAllocation") diff --git a/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py b/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py index 295135915..f3f6374de 100644 --- a/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py +++ b/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/order_cross_market_condition.py b/openapi_project/openapi_package/models/order_cross_market_condition.py index 3553187c3..5eb7d9749 100644 --- a/openapi_project/openapi_package/models/order_cross_market_condition.py +++ b/openapi_project/openapi_package/models/order_cross_market_condition.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/order_cross_optional_data.py b/openapi_project/openapi_package/models/order_cross_optional_data.py index ca3e15e75..83004bc55 100644 --- a/openapi_project/openapi_package/models/order_cross_optional_data.py +++ b/openapi_project/openapi_package/models/order_cross_optional_data.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/order_delete.py b/openapi_project/openapi_package/models/order_delete.py index 17bc9d681..7c066ce5d 100644 --- a/openapi_project/openapi_package/models/order_delete.py +++ b/openapi_project/openapi_package/models/order_delete.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.origination_type import OriginationType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.origination_type import OriginationType +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.order_delete_optional_data import OrderDeleteOptionalData + from openapi_project.openapi_package.models.order_delete_optional_data import OrderDeleteOptionalData T = TypeVar("T", bound="OrderDelete") diff --git a/openapi_project/openapi_package/models/order_delete_optional_data.py b/openapi_project/openapi_package/models/order_delete_optional_data.py index 8b9bbd37d..fc70a5e19 100644 --- a/openapi_project/openapi_package/models/order_delete_optional_data.py +++ b/openapi_project/openapi_package/models/order_delete_optional_data.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/order_instruction.py b/openapi_project/openapi_package/models/order_instruction.py index 3d872a7cf..12baff755 100644 --- a/openapi_project/openapi_package/models/order_instruction.py +++ b/openapi_project/openapi_package/models/order_instruction.py @@ -6,10 +6,10 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.order_instruction_type import OrderInstructionType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.order_instruction_type import OrderInstructionType +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="OrderInstruction") diff --git a/openapi_project/openapi_package/models/order_market_condition.py b/openapi_project/openapi_package/models/order_market_condition.py index e804ab9be..0cbc064c2 100644 --- a/openapi_project/openapi_package/models/order_market_condition.py +++ b/openapi_project/openapi_package/models/order_market_condition.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/order_optional_data.py b/openapi_project/openapi_package/models/order_optional_data.py index 7213979b3..f28efe4e8 100644 --- a/openapi_project/openapi_package/models/order_optional_data.py +++ b/openapi_project/openapi_package/models/order_optional_data.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/order_update.py b/openapi_project/openapi_package/models/order_update.py index 98b71f91d..93a09af11 100644 --- a/openapi_project/openapi_package/models/order_update.py +++ b/openapi_project/openapi_package/models/order_update.py @@ -6,27 +6,27 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - -from ..models.exec_type import ExecType -from ..models.multi_leg_reporting_type import MultiLegReportingType -from ..models.ord_status import OrdStatus -from ..models.ord_type import OrdType -from ..models.origination_type import OriginationType -from ..models.position_effect import PositionEffect -from ..models.price_type import PriceType -from ..models.side import Side -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset + +from openapi_project.openapi_package.models.exec_type import ExecType +from openapi_project.openapi_package.models.multi_leg_reporting_type import MultiLegReportingType +from openapi_project.openapi_package.models.ord_status import OrdStatus +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.origination_type import OriginationType +from openapi_project.openapi_package.models.position_effect import PositionEffect +from openapi_project.openapi_package.models.price_type import PriceType +from openapi_project.openapi_package.models.side import Side +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.order_update_algo import OrderUpdateAlgo - from ..models.order_instruction import OrderInstruction - from ..models.order_update_optional_data import OrderUpdateOptionalData - from ..models.security import Security - from ..models.header import Header - from ..models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.order_update_algo import OrderUpdateAlgo + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.order_update_optional_data import OrderUpdateOptionalData + from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.security import Security T = TypeVar("T", bound="OrderUpdate") diff --git a/openapi_project/openapi_package/models/order_update_algo.py b/openapi_project/openapi_package/models/order_update_algo.py index 2db8286c8..fca1af30f 100644 --- a/openapi_project/openapi_package/models/order_update_algo.py +++ b/openapi_project/openapi_package/models/order_update_algo.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/order_update_event.py b/openapi_project/openapi_package/models/order_update_event.py index b3f8aace8..481933241 100644 --- a/openapi_project/openapi_package/models/order_update_event.py +++ b/openapi_project/openapi_package/models/order_update_event.py @@ -6,21 +6,20 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.order_update import OrderUpdate - from ..models.order_delete import OrderDelete - from ..models.execution import Execution - from ..models.order_cancel_reject import OrderCancelReject - from ..models.multi_leg_order_cancel_replace_request import ( - MultiLegOrderCancelReplaceRequest, - ) - from ..models.order_cancel_request import OrderCancelRequest - from ..models.order_cancel_replace_request import OrderCancelReplaceRequest + from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request import MultiLegOrderCancelReplaceRequest, + + from openapi_project.openapi_package.models.order_update import OrderUpdate + from openapi_project.openapi_package.models.execution import Execution + from openapi_project.openapi_package.models.order_cancel_reject import OrderCancelReject + from openapi_project.openapi_package.models.order_cancel_replace_request import OrderCancelReplaceRequest + from openapi_project.openapi_package.models.order_delete import OrderDelete + from openapi_project.openapi_package.models.order_cancel_request import OrderCancelRequest T = TypeVar("T", bound="OrderUpdateEvent") diff --git a/openapi_project/openapi_package/models/order_update_optional_data.py b/openapi_project/openapi_package/models/order_update_optional_data.py index 51b5d35ec..0dc26cab8 100644 --- a/openapi_project/openapi_package/models/order_update_optional_data.py +++ b/openapi_project/openapi_package/models/order_update_optional_data.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/position.py b/openapi_project/openapi_package/models/position.py index 747be0ace..72c15bcf9 100644 --- a/openapi_project/openapi_package/models/position.py +++ b/openapi_project/openapi_package/models/position.py @@ -6,9 +6,9 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="Position") diff --git a/openapi_project/openapi_package/models/position_analysis.py b/openapi_project/openapi_package/models/position_analysis.py index 3cb817239..64f16f607 100644 --- a/openapi_project/openapi_package/models/position_analysis.py +++ b/openapi_project/openapi_package/models/position_analysis.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.position_theo import PositionTheo - from ..models.scenario_theo import ScenarioTheo + from openapi_project.openapi_package.models.position_theo import PositionTheo + from openapi_project.openapi_package.models.scenario_theo import ScenarioTheo T = TypeVar("T", bound="PositionAnalysis") diff --git a/openapi_project/openapi_package/models/position_theo.py b/openapi_project/openapi_package/models/position_theo.py index fb83c4d75..aa920a3df 100644 --- a/openapi_project/openapi_package/models/position_theo.py +++ b/openapi_project/openapi_package/models/position_theo.py @@ -6,13 +6,13 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.position_theo_leg import PositionTheoLeg + from openapi_project.openapi_package.models.position_theo_leg import PositionTheoLeg T = TypeVar("T", bound="PositionTheo") diff --git a/openapi_project/openapi_package/models/position_theo_leg.py b/openapi_project/openapi_package/models/position_theo_leg.py index ee0a7fd90..483117f62 100644 --- a/openapi_project/openapi_package/models/position_theo_leg.py +++ b/openapi_project/openapi_package/models/position_theo_leg.py @@ -6,9 +6,9 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast diff --git a/openapi_project/openapi_package/models/risk_radar_account_group.py b/openapi_project/openapi_package/models/risk_radar_account_group.py index bccdb691e..05f592fb0 100644 --- a/openapi_project/openapi_package/models/risk_radar_account_group.py +++ b/openapi_project/openapi_package/models/risk_radar_account_group.py @@ -6,15 +6,15 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.currency import Currency -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.shock_value import ShockValue - from ..models.risk_radar_product_group import RiskRadarProductGroup + from openapi_project.openapi_package.models.risk_radar_product_group import RiskRadarProductGroup + from openapi_project.openapi_package.models.shock_value import ShockValue T = TypeVar("T", bound="RiskRadarAccountGroup") diff --git a/openapi_project/openapi_package/models/risk_radar_class_group.py b/openapi_project/openapi_package/models/risk_radar_class_group.py index c34719463..47b538312 100644 --- a/openapi_project/openapi_package/models/risk_radar_class_group.py +++ b/openapi_project/openapi_package/models/risk_radar_class_group.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.shock_value import ShockValue - from ..models.risk_radar_position import RiskRadarPosition + from openapi_project.openapi_package.models.shock_value import ShockValue + from openapi_project.openapi_package.models.risk_radar_position import RiskRadarPosition T = TypeVar("T", bound="RiskRadarClassGroup") diff --git a/openapi_project/openapi_package/models/risk_radar_data.py b/openapi_project/openapi_package/models/risk_radar_data.py index 58894b001..40f588b67 100644 --- a/openapi_project/openapi_package/models/risk_radar_data.py +++ b/openapi_project/openapi_package/models/risk_radar_data.py @@ -6,13 +6,13 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.risk_radar_account_group import RiskRadarAccountGroup + from openapi_project.openapi_package.models.risk_radar_account_group import RiskRadarAccountGroup T = TypeVar("T", bound="RiskRadarData") diff --git a/openapi_project/openapi_package/models/risk_radar_position.py b/openapi_project/openapi_package/models/risk_radar_position.py index 1eabf0567..a25b548ba 100644 --- a/openapi_project/openapi_package/models/risk_radar_position.py +++ b/openapi_project/openapi_package/models/risk_radar_position.py @@ -6,13 +6,13 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.shock_value import ShockValue + from openapi_project.openapi_package.models.shock_value import ShockValue T = TypeVar("T", bound="RiskRadarPosition") diff --git a/openapi_project/openapi_package/models/risk_radar_product_group.py b/openapi_project/openapi_package/models/risk_radar_product_group.py index 1eeb321dd..a6470cd00 100644 --- a/openapi_project/openapi_package/models/risk_radar_product_group.py +++ b/openapi_project/openapi_package/models/risk_radar_product_group.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.shock_value import ShockValue - from ..models.risk_radar_class_group import RiskRadarClassGroup + from openapi_project.openapi_package.models.shock_value import ShockValue + from openapi_project.openapi_package.models.risk_radar_class_group import RiskRadarClassGroup T = TypeVar("T", bound="RiskRadarProductGroup") diff --git a/openapi_project/openapi_package/models/risk_radar_request.py b/openapi_project/openapi_package/models/risk_radar_request.py index a6c0c8e81..80f3c404e 100644 --- a/openapi_project/openapi_package/models/risk_radar_request.py +++ b/openapi_project/openapi_package/models/risk_radar_request.py @@ -6,18 +6,18 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - -from ..models.position_source import PositionSource -from ..models.risk_eval_mode import RiskEvalMode -from ..models.risk_radar_scenario_order import RiskRadarScenarioOrder -from ..models.volatility_shock_skew import VolatilityShockSkew -from ..models.volatility_shock_type import VolatilityShockType -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset + +from openapi_project.openapi_package.models.position_source import PositionSource +from openapi_project.openapi_package.models.risk_eval_mode import RiskEvalMode +from openapi_project.openapi_package.models.risk_radar_scenario_order import RiskRadarScenarioOrder +from openapi_project.openapi_package.models.volatility_shock_skew import VolatilityShockSkew +from openapi_project.openapi_package.models.volatility_shock_type import VolatilityShockType +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.risk_radar_request_position_list import RiskRadarRequestPositionList + from openapi_project.openapi_package.models.risk_radar_request_position_list import RiskRadarRequestPositionList T = TypeVar("T", bound="RiskRadarRequest") diff --git a/openapi_project/openapi_package/models/risk_radar_request_position.py b/openapi_project/openapi_package/models/risk_radar_request_position.py index 7afbefe05..100e12e1a 100644 --- a/openapi_project/openapi_package/models/risk_radar_request_position.py +++ b/openapi_project/openapi_package/models/risk_radar_request_position.py @@ -6,9 +6,9 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="RiskRadarRequestPosition") diff --git a/openapi_project/openapi_package/models/risk_radar_request_position_list.py b/openapi_project/openapi_package/models/risk_radar_request_position_list.py index fd48a44eb..0c5838907 100644 --- a/openapi_project/openapi_package/models/risk_radar_request_position_list.py +++ b/openapi_project/openapi_package/models/risk_radar_request_position_list.py @@ -6,13 +6,13 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.risk_radar_request_position import RiskRadarRequestPosition + from openapi_project.openapi_package.models.risk_radar_request_position import RiskRadarRequestPosition T = TypeVar("T", bound="RiskRadarRequestPositionList") diff --git a/openapi_project/openapi_package/models/risk_radar_response.py b/openapi_project/openapi_package/models/risk_radar_response.py index 215972ada..e159a3dbd 100644 --- a/openapi_project/openapi_package/models/risk_radar_response.py +++ b/openapi_project/openapi_package/models/risk_radar_response.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.risk_radar_data import RiskRadarData + from openapi_project.openapi_package.models.risk_radar_data import RiskRadarData T = TypeVar("T", bound="RiskRadarResponse") diff --git a/openapi_project/openapi_package/models/risk_reject.py b/openapi_project/openapi_package/models/risk_reject.py index 77ee51658..c76e2ac8d 100644 --- a/openapi_project/openapi_package/models/risk_reject.py +++ b/openapi_project/openapi_package/models/risk_reject.py @@ -6,11 +6,11 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.risk_calculation_type import RiskCalculationType -from ..models.risk_reject_type import RiskRejectType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.risk_calculation_type import RiskCalculationType +from openapi_project.openapi_package.models.risk_reject_type import RiskRejectType +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="RiskReject") diff --git a/openapi_project/openapi_package/models/route.py b/openapi_project/openapi_package/models/route.py index b5592b2db..8cb0513b2 100644 --- a/openapi_project/openapi_package/models/route.py +++ b/openapi_project/openapi_package/models/route.py @@ -6,17 +6,17 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.currency import Currency -from ..models.order_type import OrderType -from ..models.route_type import RouteType -from ..models.security_type import SecurityType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.models.order_type import OrderType +from openapi_project.openapi_package.models.route_type import RouteType +from openapi_project.openapi_package.models.security_type import SecurityType +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.route_property import RouteProperty + from openapi_project.openapi_package.models.route_property import RouteProperty T = TypeVar("T", bound="Route") diff --git a/openapi_project/openapi_package/models/route_applicability.py b/openapi_project/openapi_package/models/route_applicability.py index b6f847478..e319d15bf 100644 --- a/openapi_project/openapi_package/models/route_applicability.py +++ b/openapi_project/openapi_package/models/route_applicability.py @@ -6,12 +6,12 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.currency import Currency -from ..models.order_type import OrderType -from ..models.security_type import SecurityType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.models.order_type import OrderType +from openapi_project.openapi_package.models.security_type import SecurityType +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast diff --git a/openapi_project/openapi_package/models/route_property.py b/openapi_project/openapi_package/models/route_property.py index 943b19d27..0ac617caf 100644 --- a/openapi_project/openapi_package/models/route_property.py +++ b/openapi_project/openapi_package/models/route_property.py @@ -6,10 +6,10 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.route_property_type import RoutePropertyType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.route_property_type import RoutePropertyType +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="RouteProperty") diff --git a/openapi_project/openapi_package/models/routing_session_group.py b/openapi_project/openapi_package/models/routing_session_group.py index d55fddf82..34d2f267e 100644 --- a/openapi_project/openapi_package/models/routing_session_group.py +++ b/openapi_project/openapi_package/models/routing_session_group.py @@ -6,10 +6,10 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.routing_session_group_type import RoutingSessionGroupType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.routing_session_group_type import RoutingSessionGroupType +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="RoutingSessionGroup") diff --git a/openapi_project/openapi_package/models/scenario.py b/openapi_project/openapi_package/models/scenario.py index 7f2d018f2..88b211c95 100644 --- a/openapi_project/openapi_package/models/scenario.py +++ b/openapi_project/openapi_package/models/scenario.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.scenario_position import ScenarioPosition - from ..models.scenario_leg import ScenarioLeg + from openapi_project.openapi_package.models.scenario_position import ScenarioPosition + from openapi_project.openapi_package.models.scenario_leg import ScenarioLeg T = TypeVar("T", bound="Scenario") diff --git a/openapi_project/openapi_package/models/scenario_leg.py b/openapi_project/openapi_package/models/scenario_leg.py index 9667e090a..a68d680d0 100644 --- a/openapi_project/openapi_package/models/scenario_leg.py +++ b/openapi_project/openapi_package/models/scenario_leg.py @@ -6,9 +6,9 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="ScenarioLeg") diff --git a/openapi_project/openapi_package/models/scenario_position.py b/openapi_project/openapi_package/models/scenario_position.py index 76eef35e0..799aee014 100644 --- a/openapi_project/openapi_package/models/scenario_position.py +++ b/openapi_project/openapi_package/models/scenario_position.py @@ -6,9 +6,9 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="ScenarioPosition") diff --git a/openapi_project/openapi_package/models/scenario_theo.py b/openapi_project/openapi_package/models/scenario_theo.py index fce5beab9..aed5e8df4 100644 --- a/openapi_project/openapi_package/models/scenario_theo.py +++ b/openapi_project/openapi_package/models/scenario_theo.py @@ -6,13 +6,13 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.scenario import Scenario + from openapi_project.openapi_package.models.scenario import Scenario T = TypeVar("T", bound="ScenarioTheo") diff --git a/openapi_project/openapi_package/models/search_order_history_response.py b/openapi_project/openapi_package/models/search_order_history_response.py index 97f60a426..3ab516668 100644 --- a/openapi_project/openapi_package/models/search_order_history_response.py +++ b/openapi_project/openapi_package/models/search_order_history_response.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.generic_order import GenericOrder + from openapi_project.openapi_package.models.generic_order import GenericOrder T = TypeVar("T", bound="SearchOrderHistoryResponse") diff --git a/openapi_project/openapi_package/models/security.py b/openapi_project/openapi_package/models/security.py index 899a773bf..def135952 100644 --- a/openapi_project/openapi_package/models/security.py +++ b/openapi_project/openapi_package/models/security.py @@ -6,22 +6,22 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.future_root import FutureRoot - from ..models.option_root import OptionRoot - from ..models.future import Future - from ..models.future_spread import FutureSpread - from ..models.fx import Fx - from ..models.option import Option - from ..models.stock import Stock - from ..models.crypto import Crypto - from ..models.index import Index - from ..models.flex_option import FlexOption + from openapi_project.openapi_package.models.index import Index + from openapi_project.openapi_package.models.future_root import FutureRoot + from openapi_project.openapi_package.models.option import Option + from openapi_project.openapi_package.models.stock import Stock + from openapi_project.openapi_package.models.future import Future + from openapi_project.openapi_package.models.fx import Fx + from openapi_project.openapi_package.models.crypto import Crypto + from openapi_project.openapi_package.models.flex_option import FlexOption + from openapi_project.openapi_package.models.future_spread import FutureSpread + from openapi_project.openapi_package.models.option_root import OptionRoot T = TypeVar("T", bound="Security") diff --git a/openapi_project/openapi_package/models/settlement_info.py b/openapi_project/openapi_package/models/settlement_info.py index 9380bb6b0..33cdac094 100644 --- a/openapi_project/openapi_package/models/settlement_info.py +++ b/openapi_project/openapi_package/models/settlement_info.py @@ -6,10 +6,10 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.settlement_deliverable_type import SettlementDeliverableType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.settlement_deliverable_type import SettlementDeliverableType +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="SettlementInfo") diff --git a/openapi_project/openapi_package/models/shock_value.py b/openapi_project/openapi_package/models/shock_value.py index 535f649d8..e46b7f5f6 100644 --- a/openapi_project/openapi_package/models/shock_value.py +++ b/openapi_project/openapi_package/models/shock_value.py @@ -6,13 +6,13 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.shock_value_flags import ShockValueFlags + from openapi_project.openapi_package.models.shock_value_flags import ShockValueFlags T = TypeVar("T", bound="ShockValue") diff --git a/openapi_project/openapi_package/models/shock_value_flags.py b/openapi_project/openapi_package/models/shock_value_flags.py index cbe112070..81619005f 100644 --- a/openapi_project/openapi_package/models/shock_value_flags.py +++ b/openapi_project/openapi_package/models/shock_value_flags.py @@ -6,9 +6,9 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="ShockValueFlags") diff --git a/openapi_project/openapi_package/models/status.py b/openapi_project/openapi_package/models/status.py index 091d1168b..24f966b83 100644 --- a/openapi_project/openapi_package/models/status.py +++ b/openapi_project/openapi_package/models/status.py @@ -6,13 +6,13 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.any_model import AnyModel + from openapi_project.openapi_package.models.any_model import AnyModel T = TypeVar("T", bound="Status") diff --git a/openapi_project/openapi_package/models/stock.py b/openapi_project/openapi_package/models/stock.py index 355db8982..7ed305919 100644 --- a/openapi_project/openapi_package/models/stock.py +++ b/openapi_project/openapi_package/models/stock.py @@ -6,18 +6,18 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.currency import Currency -from ..models.exchange_code import ExchangeCode -from ..models.numeric_display_format import NumericDisplayFormat -from ..models.security_category import SecurityCategory -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.models.exchange_code import ExchangeCode +from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat +from openapi_project.openapi_package.models.security_category import SecurityCategory +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.stock_aliases import StockAliases - from ..models.date import Date + from openapi_project.openapi_package.models.stock_aliases import StockAliases + from openapi_project.openapi_package.models.date import Date T = TypeVar("T", bound="Stock") diff --git a/openapi_project/openapi_package/models/stock_aliases.py b/openapi_project/openapi_package/models/stock_aliases.py index dbff0a0ab..46376c056 100644 --- a/openapi_project/openapi_package/models/stock_aliases.py +++ b/openapi_project/openapi_package/models/stock_aliases.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast, Union diff --git a/openapi_project/openapi_package/models/time_of_day.py b/openapi_project/openapi_package/models/time_of_day.py index da3f91e76..1c547e247 100644 --- a/openapi_project/openapi_package/models/time_of_day.py +++ b/openapi_project/openapi_package/models/time_of_day.py @@ -6,9 +6,9 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="TimeOfDay") diff --git a/openapi_project/openapi_package/models/tims_class_group.py b/openapi_project/openapi_package/models/tims_class_group.py index 2f8d822bf..410ab7002 100644 --- a/openapi_project/openapi_package/models/tims_class_group.py +++ b/openapi_project/openapi_package/models/tims_class_group.py @@ -6,13 +6,13 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.tims_position_group import TimsPositionGroup + from openapi_project.openapi_package.models.tims_position_group import TimsPositionGroup T = TypeVar("T", bound="TimsClassGroup") diff --git a/openapi_project/openapi_package/models/tims_margin_data.py b/openapi_project/openapi_package/models/tims_margin_data.py index b06cba47f..76561e035 100644 --- a/openapi_project/openapi_package/models/tims_margin_data.py +++ b/openapi_project/openapi_package/models/tims_margin_data.py @@ -6,15 +6,15 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.currency import Currency -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.currency import Currency +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.tims_class_group import TimsClassGroup - from ..models.tims_product_group import TimsProductGroup + from openapi_project.openapi_package.models.tims_product_group import TimsProductGroup + from openapi_project.openapi_package.models.tims_class_group import TimsClassGroup T = TypeVar("T", bound="TimsMarginData") diff --git a/openapi_project/openapi_package/models/tims_position_group.py b/openapi_project/openapi_package/models/tims_position_group.py index c1092fb8f..6a1cf0c90 100644 --- a/openapi_project/openapi_package/models/tims_position_group.py +++ b/openapi_project/openapi_package/models/tims_position_group.py @@ -6,9 +6,9 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast diff --git a/openapi_project/openapi_package/models/tims_product_group.py b/openapi_project/openapi_package/models/tims_product_group.py index 7eeabd8f0..78d91c275 100644 --- a/openapi_project/openapi_package/models/tims_product_group.py +++ b/openapi_project/openapi_package/models/tims_product_group.py @@ -6,9 +6,9 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast diff --git a/openapi_project/openapi_package/models/trade_confirm.py b/openapi_project/openapi_package/models/trade_confirm.py index ffdef7e4d..55a668bf8 100644 --- a/openapi_project/openapi_package/models/trade_confirm.py +++ b/openapi_project/openapi_package/models/trade_confirm.py @@ -6,29 +6,29 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - -from ..models.capacity_code import CapacityCode -from ..models.clearing_range import ClearingRange -from ..models.cross_side_type import CrossSideType -from ..models.cross_type import CrossType -from ..models.exec_type import ExecType -from ..models.multi_leg_reporting_type import MultiLegReportingType -from ..models.option_exercise_style import OptionExerciseStyle -from ..models.option_settlement_type import OptionSettlementType -from ..models.ord_type import OrdType -from ..models.origination_type import OriginationType -from ..models.position_effect import PositionEffect -from ..models.price_type import PriceType -from ..models.put_call import PutCall -from ..models.security_type import SecurityType -from ..models.side import Side -from ..models.tif import Tif -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset + +from openapi_project.openapi_package.models.capacity_code import CapacityCode +from openapi_project.openapi_package.models.clearing_range import ClearingRange +from openapi_project.openapi_package.models.cross_side_type import CrossSideType +from openapi_project.openapi_package.models.cross_type import CrossType +from openapi_project.openapi_package.models.exec_type import ExecType +from openapi_project.openapi_package.models.multi_leg_reporting_type import MultiLegReportingType +from openapi_project.openapi_package.models.option_exercise_style import OptionExerciseStyle +from openapi_project.openapi_package.models.option_settlement_type import OptionSettlementType +from openapi_project.openapi_package.models.ord_type import OrdType +from openapi_project.openapi_package.models.origination_type import OriginationType +from openapi_project.openapi_package.models.position_effect import PositionEffect +from openapi_project.openapi_package.models.price_type import PriceType +from openapi_project.openapi_package.models.put_call import PutCall +from openapi_project.openapi_package.models.security_type import SecurityType +from openapi_project.openapi_package.models.side import Side +from openapi_project.openapi_package.models.tif import Tif +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.date import Date + from openapi_project.openapi_package.models.date import Date T = TypeVar("T", bound="TradeConfirm") diff --git a/openapi_project/openapi_package/models/trading_firm.py b/openapi_project/openapi_package/models/trading_firm.py index 4fa827e10..face14eaa 100644 --- a/openapi_project/openapi_package/models/trading_firm.py +++ b/openapi_project/openapi_package/models/trading_firm.py @@ -6,9 +6,9 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="TradingFirm") diff --git a/openapi_project/openapi_package/models/trading_firm_slim.py b/openapi_project/openapi_package/models/trading_firm_slim.py index 29ec69551..2dfc0d009 100644 --- a/openapi_project/openapi_package/models/trading_firm_slim.py +++ b/openapi_project/openapi_package/models/trading_firm_slim.py @@ -6,9 +6,9 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="TradingFirmSlim") diff --git a/openapi_project/openapi_package/models/trading_holiday.py b/openapi_project/openapi_package/models/trading_holiday.py index f60d5f5d3..90d2bddad 100644 --- a/openapi_project/openapi_package/models/trading_holiday.py +++ b/openapi_project/openapi_package/models/trading_holiday.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.country import Country -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.country import Country +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.date import Date + from openapi_project.openapi_package.models.date import Date T = TypeVar("T", bound="TradingHoliday") diff --git a/openapi_project/openapi_package/models/trading_session.py b/openapi_project/openapi_package/models/trading_session.py index 439446273..a3629b47c 100644 --- a/openapi_project/openapi_package/models/trading_session.py +++ b/openapi_project/openapi_package/models/trading_session.py @@ -6,13 +6,13 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.time_of_day import TimeOfDay + from openapi_project.openapi_package.models.time_of_day import TimeOfDay T = TypeVar("T", bound="TradingSession") diff --git a/openapi_project/openapi_package/models/trading_session_group.py b/openapi_project/openapi_package/models/trading_session_group.py index ee64a1ae2..8af0c6dff 100644 --- a/openapi_project/openapi_package/models/trading_session_group.py +++ b/openapi_project/openapi_package/models/trading_session_group.py @@ -6,13 +6,13 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.trading_session import TradingSession + from openapi_project.openapi_package.models.trading_session import TradingSession T = TypeVar("T", bound="TradingSessionGroup") diff --git a/openapi_project/openapi_package/models/user.py b/openapi_project/openapi_package/models/user.py index d67643b63..c70efe50c 100644 --- a/openapi_project/openapi_package/models/user.py +++ b/openapi_project/openapi_package/models/user.py @@ -6,16 +6,16 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.user_location import UserLocation -from ..models.user_status import UserStatus -from ..models.user_type import UserType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.user_location import UserLocation +from openapi_project.openapi_package.models.user_status import UserStatus +from openapi_project.openapi_package.models.user_type import UserType +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.user_permission import UserPermission + from openapi_project.openapi_package.models.user_permission import UserPermission T = TypeVar("T", bound="User") diff --git a/openapi_project/openapi_package/models/user_permission.py b/openapi_project/openapi_package/models/user_permission.py index d076485d4..3fb492f4c 100644 --- a/openapi_project/openapi_package/models/user_permission.py +++ b/openapi_project/openapi_package/models/user_permission.py @@ -6,10 +6,10 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.claim_type import ClaimType -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.claim_type import ClaimType +from openapi_project.openapi_package.types import UNSET, Unset T = TypeVar("T", bound="UserPermission") diff --git a/openapi_project/openapi_package/models/validate_risk_response.py b/openapi_project/openapi_package/models/validate_risk_response.py index c2ebc076f..5752fa2fa 100644 --- a/openapi_project/openapi_package/models/validate_risk_response.py +++ b/openapi_project/openapi_package/models/validate_risk_response.py @@ -6,14 +6,14 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset +from openapi_project.openapi_package.types import UNSET, Unset -from ..models.status_code import StatusCode -from ..types import UNSET, Unset +from openapi_project.openapi_package.models.status_code import StatusCode +from openapi_project.openapi_package.types import UNSET, Unset from typing import cast if TYPE_CHECKING: - from ..models.risk_reject import RiskReject + from openapi_project.openapi_package.models.risk_reject import RiskReject T = TypeVar("T", bound="ValidateRiskResponse") diff --git a/replace_imports.py b/replace_imports.py index e7578cc68..48ec7a63b 100644 --- a/replace_imports.py +++ b/replace_imports.py @@ -43,7 +43,9 @@ def package_components_for_file( try: # Get the relative path from import_root to file_dir rel_path = file_dir.relative_to(import_root) - return list(rel_path.parts) + # The import_root becomes the base package, so we include it in the path + import_root_name = import_root.name + return [import_root_name] + list(rel_path.parts) except ValueError: # File is not under the import_root return None From 203ba11160ab610a8fc3f8406a81fd30a1f11f60 Mon Sep 17 00:00:00 2001 From: Itay Bavly Date: Wed, 20 Aug 2025 15:18:42 -0400 Subject: [PATCH 10/16] fix --- fix_builtin_shadowing.py | 131 ++++++++++++++++++ .../post_orders_createmultilegordercross.py | 6 +- .../post_orders_replacemultilegorder.py | 6 +- ...s_validaterisk_createmultilegordercross.py | 3 +- ...rders_validaterisk_replacemultilegorder.py | 3 +- .../post_securities_easytoborrowsecurities.py | 6 +- .../get_userdata_affiliatedtradingfirms.py | 3 +- .../openapi_package/models/__init__.py | 66 +++------ .../openapi_package/models/account.py | 12 +- .../models/calculate_margin_request.py | 5 +- .../calculate_margin_request_position_list.py | 5 +- .../models/cancel_order_request.py | 3 +- .../cancel_replace_multi_leg_order_request.py | 11 +- .../models/cancel_replace_order_request.py | 8 +- ...create_multi_leg_order_cross_allocation.py | 5 +- .../create_multi_leg_order_cross_request.py | 14 +- .../models/create_multi_leg_order_leg.py | 8 +- .../models/create_multi_leg_order_request.py | 9 +- .../models/create_order_cross_allocation.py | 3 +- .../models/create_order_cross_request.py | 6 +- .../models/create_order_request.py | 6 +- .../openapi_package/models/crypto.py | 12 +- .../openapi_package/models/exchange.py | 12 +- .../openapi_package/models/flex_option.py | 12 +- .../openapi_package/models/future.py | 12 +- .../openapi_package/models/future_root.py | 12 +- .../openapi_package/models/future_spread.py | 12 +- openapi_project/openapi_package/models/fx.py | 12 +- .../models/get_server_info_response.py | 5 +- .../openapi_package/models/index.py | 12 +- .../openapi_package/models/multi_leg_order.py | 12 +- .../multi_leg_order_cancel_replace_request.py | 9 +- .../models/multi_leg_order_cross.py | 20 ++- .../multi_leg_order_cross_allocation.py | 17 +-- .../models/multi_leg_order_leg.py | 17 +-- .../openapi_package/models/option.py | 12 +- .../models/option_chain_option.py | 12 +- .../openapi_package/models/option_root.py | 12 +- .../openapi_package/models/order.py | 12 +- .../models/order_cancel_replace_request.py | 8 +- .../models/order_cancel_request.py | 5 +- .../openapi_package/models/order_cross.py | 12 +- .../models/order_cross_allocation.py | 15 +- .../models/order_update_event.py | 3 +- .../openapi_package/models/risk_reject.py | 12 +- .../openapi_package/models/route.py | 12 +- .../openapi_package/models/route_property.py | 12 +- .../models/routing_session_group.py | 12 +- .../openapi_package/models/stock.py | 12 +- .../openapi_package/models/trade_confirm.py | 12 +- .../openapi_package/models/trading_firm.py | 12 +- .../models/trading_firm_slim.py | 12 +- .../openapi_package/models/trading_holiday.py | 12 +- .../openapi_package/models/trading_session.py | 12 +- .../models/trading_session_group.py | 12 +- .../openapi_package/models/user.py | 12 +- 56 files changed, 384 insertions(+), 346 deletions(-) create mode 100644 fix_builtin_shadowing.py diff --git a/fix_builtin_shadowing.py b/fix_builtin_shadowing.py new file mode 100644 index 000000000..9bf321b6e --- /dev/null +++ b/fix_builtin_shadowing.py @@ -0,0 +1,131 @@ +#!/usr/bin/env python3 +import argparse +import re +import sys +from pathlib import Path + + +def fix_builtin_shadowing_in_file(file_path: Path, write: bool = False) -> bool: + """ + Fix builtin shadowing issues in a Python file. + Currently handles: id -> id_ + Also fixes trailing commas in imports. + """ + try: + content = file_path.read_text(encoding="utf-8") + except Exception as e: + print(f"[skip] {file_path}: {e}", file=sys.stderr) + return False + + original_content = content + + # Fix id shadowing - look for id = assignments but not id_ = (already fixed) + # Use regex to match id = but not id_ = or id. (attribute access) + content = re.sub(r"\bid\s*=\s*(?!_)", "id_ =", content) + + # Also fix id in function parameters and type hints + # Match id: but not id_: (already fixed) + content = re.sub(r"\bid:\s*(?!_)", "id_: ", content) + + # Fix id in class attributes + # Match id: but not id_: in class definitions + content = re.sub(r"\bid:\s*(?!_)", "id_: ", content) + + # Fix id in return type hints + # Match -> id but not -> id_ + content = re.sub(r"->\s*id\b(?!_)", "-> id_", content) + + # Fix id in import statements (less common but possible) + # Match import id but not import id_ + content = re.sub(r"import\s+id\b(?!_)", "import id_", content) + content = re.sub( + r"from\s+\S+\s+import\s+.*\bid\b(?!_)", + lambda m: m.group(0).replace(" id", " id_"), + content, + ) + + # Fix id in constructor calls (e.g., id=id, -> id_=id_,) + content = re.sub(r"\bid\s*=\s*id\b(?!_)", "id_=id_", content) + + # Fix id in field_dict assignments (e.g., if id is not UNSET: -> if id_ is not UNSET:) + content = re.sub(r"\bid\s+is\s+not\s+UNSET(?!_)", "id_ is not UNSET", content) + content = re.sub(r"\bid\s+is\s+UNSET(?!_)", "id_ is UNSET", content) + + # Fix spacing issues that might have been created + content = re.sub(r"id_\s*=\s*self\.id", "id_ = self.id_", content) + content = re.sub(r'id_\s*=\s*d\.pop\("id"', 'id_ = d.pop("id"', content) + content = re.sub(r"id_\s*=\s*id,", "id_=id_,", content) + + # Fix id in docstrings (e.g., id (Unset | int): -> id_ (Unset | int):) + content = re.sub( + r"\bid\s+\(Unset\s*\|\s*int\):(?!_)", "id_ (Unset | int):", content + ) + content = re.sub( + r"\bid\s+\(Unset\s*\|\s*str\):(?!_)", "id_ (Unset | str):", content + ) + + # Fix trailing commas in import statements + # Pattern: import SomeClass, followed by newline or whitespace + content = re.sub(r"import\s+([A-Za-z_][A-Za-z0-9_]*)\s*,\s*$", r"import \1", content, flags=re.MULTILINE) + + if content != original_content: + if write: + file_path.write_text(content, encoding="utf-8") + print(f"[fixed] {file_path}") + else: + print(f"[would fix] {file_path}") + return True + + return False + + +def main(): + ap = argparse.ArgumentParser( + description="Fix builtin shadowing issues in Python files." + ) + ap.add_argument("root", type=Path, help="Folder to process") + ap.add_argument( + "--write", action="store_true", help="Apply changes in-place (default: dry-run)" + ) + ap.add_argument( + "--include-glob", + default="**/*.py", + help="Glob of files to include (default: **/*.py)", + ) + ap.add_argument( + "--exclude", + action="append", + default=[".venv", "venv", "__pycache__", ".git", "site-packages"], + help="Directories to skip (repeatable)", + ) + args = ap.parse_args() + + root = args.root.resolve() + if not root.exists(): + print(f"Root not found: {root}", file=sys.stderr) + sys.exit(2) + + changed = 0 + for path in root.glob(args.include_glob): + if not path.is_file(): + continue + # Exclusions + p = path + skip = False + for ex in args.exclude: + if ex and ex in p.parts: + skip = True + break + if skip: + continue + if fix_builtin_shadowing_in_file(path, args.write): + changed += 1 + + if not args.write: + print(f"\nDry-run complete. Files to change: {changed}") + else: + print(f"Fixed files: {changed}") + + +if __name__ == "__main__": + main() diff --git a/openapi_project/openapi_package/api/order_service/post_orders_createmultilegordercross.py b/openapi_project/openapi_package/api/order_service/post_orders_createmultilegordercross.py index e9feefd18..52a72d36b 100644 --- a/openapi_project/openapi_package/api/order_service/post_orders_createmultilegordercross.py +++ b/openapi_project/openapi_package/api/order_service/post_orders_createmultilegordercross.py @@ -7,10 +7,8 @@ from openapi_project.openapi_package.types import Response, UNSET from openapi_project.openapi_package import errors -from openapi_project.openapi_package.models.create_multi_leg_order_cross_request import CreateMultiLegOrderCrossRequest, - -from openapi_project.openapi_package.models.create_multi_leg_order_cross_response import CreateMultiLegOrderCrossResponse, - +from openapi_project.openapi_package.models.create_multi_leg_order_cross_request import CreateMultiLegOrderCrossRequest +from openapi_project.openapi_package.models.create_multi_leg_order_cross_response import CreateMultiLegOrderCrossResponse from typing import cast diff --git a/openapi_project/openapi_package/api/order_service/post_orders_replacemultilegorder.py b/openapi_project/openapi_package/api/order_service/post_orders_replacemultilegorder.py index b29c8ce44..99069f998 100644 --- a/openapi_project/openapi_package/api/order_service/post_orders_replacemultilegorder.py +++ b/openapi_project/openapi_package/api/order_service/post_orders_replacemultilegorder.py @@ -7,10 +7,8 @@ from openapi_project.openapi_package.types import Response, UNSET from openapi_project.openapi_package import errors -from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request import CancelReplaceMultiLegOrderRequest, - -from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_response import CancelReplaceMultiLegOrderResponse, - +from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request import CancelReplaceMultiLegOrderRequest +from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_response import CancelReplaceMultiLegOrderResponse from typing import cast diff --git a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegordercross.py b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegordercross.py index 76393160e..db0a36576 100644 --- a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegordercross.py +++ b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegordercross.py @@ -7,8 +7,7 @@ from openapi_project.openapi_package.types import Response, UNSET from openapi_project.openapi_package import errors -from openapi_project.openapi_package.models.create_multi_leg_order_cross_request import CreateMultiLegOrderCrossRequest, - +from openapi_project.openapi_package.models.create_multi_leg_order_cross_request import CreateMultiLegOrderCrossRequest from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse from typing import cast diff --git a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replacemultilegorder.py b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replacemultilegorder.py index 3cee526ec..623c67ec0 100644 --- a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replacemultilegorder.py +++ b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replacemultilegorder.py @@ -7,8 +7,7 @@ from openapi_project.openapi_package.types import Response, UNSET from openapi_project.openapi_package import errors -from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request import CancelReplaceMultiLegOrderRequest, - +from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request import CancelReplaceMultiLegOrderRequest from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse from typing import cast diff --git a/openapi_project/openapi_package/api/security_service/post_securities_easytoborrowsecurities.py b/openapi_project/openapi_package/api/security_service/post_securities_easytoborrowsecurities.py index d616eed0e..1abdbd058 100644 --- a/openapi_project/openapi_package/api/security_service/post_securities_easytoborrowsecurities.py +++ b/openapi_project/openapi_package/api/security_service/post_securities_easytoborrowsecurities.py @@ -7,10 +7,8 @@ from openapi_project.openapi_package.types import Response, UNSET from openapi_project.openapi_package import errors -from openapi_project.openapi_package.models.list_easy_to_borrow_securities_request import ListEasyToBorrowSecuritiesRequest, - -from openapi_project.openapi_package.models.list_easy_to_borrow_securities_response import ListEasyToBorrowSecuritiesResponse, - +from openapi_project.openapi_package.models.list_easy_to_borrow_securities_request import ListEasyToBorrowSecuritiesRequest +from openapi_project.openapi_package.models.list_easy_to_borrow_securities_response import ListEasyToBorrowSecuritiesResponse from typing import cast diff --git a/openapi_project/openapi_package/api/user_data_service/get_userdata_affiliatedtradingfirms.py b/openapi_project/openapi_package/api/user_data_service/get_userdata_affiliatedtradingfirms.py index 1c5ce1ac7..2794d5315 100644 --- a/openapi_project/openapi_package/api/user_data_service/get_userdata_affiliatedtradingfirms.py +++ b/openapi_project/openapi_package/api/user_data_service/get_userdata_affiliatedtradingfirms.py @@ -7,8 +7,7 @@ from openapi_project.openapi_package.types import Response, UNSET from openapi_project.openapi_package import errors -from openapi_project.openapi_package.models.list_affiliated_trading_firms_response import ListAffiliatedTradingFirmsResponse, - +from openapi_project.openapi_package.models.list_affiliated_trading_firms_response import ListAffiliatedTradingFirmsResponse from typing import cast diff --git a/openapi_project/openapi_package/models/__init__.py b/openapi_project/openapi_package/models/__init__.py index 8b56c7530..9a23ee025 100644 --- a/openapi_project/openapi_package/models/__init__.py +++ b/openapi_project/openapi_package/models/__init__.py @@ -16,19 +16,14 @@ from openapi_project.openapi_package.models.cancel_order_request_optional_data import CancelOrderRequestOptionalData from openapi_project.openapi_package.models.cancel_order_response import CancelOrderResponse from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request import CancelReplaceMultiLegOrderRequest -from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_algo import CancelReplaceMultiLegOrderRequestAlgo, - -from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_market_condition import CancelReplaceMultiLegOrderRequestMarketCondition, - -from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_optional_data import CancelReplaceMultiLegOrderRequestOptionalData, - +from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_algo import CancelReplaceMultiLegOrderRequestAlgo +from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_market_condition import CancelReplaceMultiLegOrderRequestMarketCondition +from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_optional_data import CancelReplaceMultiLegOrderRequestOptionalData from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_response import CancelReplaceMultiLegOrderResponse from openapi_project.openapi_package.models.cancel_replace_order_request import CancelReplaceOrderRequest from openapi_project.openapi_package.models.cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo -from openapi_project.openapi_package.models.cancel_replace_order_request_market_condition import CancelReplaceOrderRequestMarketCondition, - -from openapi_project.openapi_package.models.cancel_replace_order_request_optional_data import CancelReplaceOrderRequestOptionalData, - +from openapi_project.openapi_package.models.cancel_replace_order_request_market_condition import CancelReplaceOrderRequestMarketCondition +from openapi_project.openapi_package.models.cancel_replace_order_request_optional_data import CancelReplaceOrderRequestOptionalData from openapi_project.openapi_package.models.cancel_replace_order_response import CancelReplaceOrderResponse from openapi_project.openapi_package.models.capacity_code import CapacityCode from openapi_project.openapi_package.models.claim_type import ClaimType @@ -38,36 +33,26 @@ from openapi_project.openapi_package.models.create_flex_option_request import CreateFlexOptionRequest from openapi_project.openapi_package.models.create_flex_option_response import CreateFlexOptionResponse from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation import CreateMultiLegOrderCrossAllocation -from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation_optional_data import CreateMultiLegOrderCrossAllocationOptionalData, - +from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation_optional_data import CreateMultiLegOrderCrossAllocationOptionalData from openapi_project.openapi_package.models.create_multi_leg_order_cross_request import CreateMultiLegOrderCrossRequest -from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_algo import CreateMultiLegOrderCrossRequestAlgo, - -from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_market_condition import CreateMultiLegOrderCrossRequestMarketCondition, - -from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_optional_data import CreateMultiLegOrderCrossRequestOptionalData, - +from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_algo import CreateMultiLegOrderCrossRequestAlgo +from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_market_condition import CreateMultiLegOrderCrossRequestMarketCondition +from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_optional_data import CreateMultiLegOrderCrossRequestOptionalData from openapi_project.openapi_package.models.create_multi_leg_order_cross_response import CreateMultiLegOrderCrossResponse from openapi_project.openapi_package.models.create_multi_leg_order_leg import CreateMultiLegOrderLeg -from openapi_project.openapi_package.models.create_multi_leg_order_leg_market_condition import CreateMultiLegOrderLegMarketCondition, - +from openapi_project.openapi_package.models.create_multi_leg_order_leg_market_condition import CreateMultiLegOrderLegMarketCondition from openapi_project.openapi_package.models.create_multi_leg_order_leg_optional_data import CreateMultiLegOrderLegOptionalData from openapi_project.openapi_package.models.create_multi_leg_order_request import CreateMultiLegOrderRequest from openapi_project.openapi_package.models.create_multi_leg_order_request_algo import CreateMultiLegOrderRequestAlgo -from openapi_project.openapi_package.models.create_multi_leg_order_request_market_condition import CreateMultiLegOrderRequestMarketCondition, - -from openapi_project.openapi_package.models.create_multi_leg_order_request_optional_data import CreateMultiLegOrderRequestOptionalData, - +from openapi_project.openapi_package.models.create_multi_leg_order_request_market_condition import CreateMultiLegOrderRequestMarketCondition +from openapi_project.openapi_package.models.create_multi_leg_order_request_optional_data import CreateMultiLegOrderRequestOptionalData from openapi_project.openapi_package.models.create_multi_leg_order_response import CreateMultiLegOrderResponse from openapi_project.openapi_package.models.create_order_cross_allocation import CreateOrderCrossAllocation -from openapi_project.openapi_package.models.create_order_cross_allocation_optional_data import CreateOrderCrossAllocationOptionalData, - +from openapi_project.openapi_package.models.create_order_cross_allocation_optional_data import CreateOrderCrossAllocationOptionalData from openapi_project.openapi_package.models.create_order_cross_request import CreateOrderCrossRequest from openapi_project.openapi_package.models.create_order_cross_request_algo import CreateOrderCrossRequestAlgo -from openapi_project.openapi_package.models.create_order_cross_request_market_condition import CreateOrderCrossRequestMarketCondition, - -from openapi_project.openapi_package.models.create_order_cross_request_optional_data import CreateOrderCrossRequestOptionalData, - +from openapi_project.openapi_package.models.create_order_cross_request_market_condition import CreateOrderCrossRequestMarketCondition +from openapi_project.openapi_package.models.create_order_cross_request_optional_data import CreateOrderCrossRequestOptionalData from openapi_project.openapi_package.models.create_order_cross_response import CreateOrderCrossResponse from openapi_project.openapi_package.models.create_order_request import CreateOrderRequest from openapi_project.openapi_package.models.create_order_request_algo import CreateOrderRequestAlgo @@ -104,8 +89,7 @@ from openapi_project.openapi_package.models.generic_order import GenericOrder from openapi_project.openapi_package.models.get_active_user_response import GetActiveUserResponse from openapi_project.openapi_package.models.get_server_info_response import GetServerInfoResponse -from openapi_project.openapi_package.models.get_server_info_response_system_settings import GetServerInfoResponseSystemSettings, - +from openapi_project.openapi_package.models.get_server_info_response_system_settings import GetServerInfoResponseSystemSettings from openapi_project.openapi_package.models.get_server_time_response import GetServerTimeResponse from openapi_project.openapi_package.models.get_trading_holidays_response import GetTradingHolidaysResponse from openapi_project.openapi_package.models.header import Header @@ -134,17 +118,13 @@ from openapi_project.openapi_package.models.multi_leg_order import MultiLegOrder from openapi_project.openapi_package.models.multi_leg_order_algo import MultiLegOrderAlgo from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request import MultiLegOrderCancelReplaceRequest -from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_algo import MultiLegOrderCancelReplaceRequestAlgo, - -from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_market_condition import MultiLegOrderCancelReplaceRequestMarketCondition, - -from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_optional_data import MultiLegOrderCancelReplaceRequestOptionalData, - +from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_algo import MultiLegOrderCancelReplaceRequestAlgo +from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_market_condition import MultiLegOrderCancelReplaceRequestMarketCondition +from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_optional_data import MultiLegOrderCancelReplaceRequestOptionalData from openapi_project.openapi_package.models.multi_leg_order_cross import MultiLegOrderCross from openapi_project.openapi_package.models.multi_leg_order_cross_algo import MultiLegOrderCrossAlgo from openapi_project.openapi_package.models.multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation -from openapi_project.openapi_package.models.multi_leg_order_cross_allocation_optional_data import MultiLegOrderCrossAllocationOptionalData, - +from openapi_project.openapi_package.models.multi_leg_order_cross_allocation_optional_data import MultiLegOrderCrossAllocationOptionalData from openapi_project.openapi_package.models.multi_leg_order_cross_market_condition import MultiLegOrderCrossMarketCondition from openapi_project.openapi_package.models.multi_leg_order_cross_optional_data import MultiLegOrderCrossOptionalData from openapi_project.openapi_package.models.multi_leg_order_leg import MultiLegOrderLeg @@ -177,10 +157,8 @@ from openapi_project.openapi_package.models.order_cancel_reject_optional_data import OrderCancelRejectOptionalData from openapi_project.openapi_package.models.order_cancel_replace_request import OrderCancelReplaceRequest from openapi_project.openapi_package.models.order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo -from openapi_project.openapi_package.models.order_cancel_replace_request_market_condition import OrderCancelReplaceRequestMarketCondition, - -from openapi_project.openapi_package.models.order_cancel_replace_request_optional_data import OrderCancelReplaceRequestOptionalData, - +from openapi_project.openapi_package.models.order_cancel_replace_request_market_condition import OrderCancelReplaceRequestMarketCondition +from openapi_project.openapi_package.models.order_cancel_replace_request_optional_data import OrderCancelReplaceRequestOptionalData from openapi_project.openapi_package.models.order_cancel_request import OrderCancelRequest from openapi_project.openapi_package.models.order_cancel_request_optional_data import OrderCancelRequestOptionalData from openapi_project.openapi_package.models.order_cross import OrderCross diff --git a/openapi_project/openapi_package/models/account.py b/openapi_project/openapi_package/models/account.py index 63bfad528..8ff1bc746 100644 --- a/openapi_project/openapi_package/models/account.py +++ b/openapi_project/openapi_package/models/account.py @@ -28,7 +28,7 @@ class Account: """ Attributes: - id (Unset | int): + id_ (Unset | int): billing_code (Unset | str): cti_code (Unset | str): currency (Unset | Currency): @@ -58,7 +58,7 @@ class Account: clearing_script (Unset | AccountScript): """ - id: Unset | int = UNSET + id_: Unset | int = UNSET billing_code: Unset | str = UNSET cti_code: Unset | str = UNSET currency: Unset | Currency = UNSET @@ -88,7 +88,7 @@ class Account: clearing_script: Unset | AccountScript = UNSET def to_dict(self) -> dict[str, Any]: - id = self.id + id_ = self.id___ billing_code = self.billing_code @@ -182,7 +182,7 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if billing_code is not UNSET: field_dict["billingCode"] = billing_code @@ -244,7 +244,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) billing_code = d.pop("billingCode", UNSET) @@ -347,7 +347,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) account = cls( - id=id, + id_=id_, billing_code=billing_code, cti_code=cti_code, currency=currency, diff --git a/openapi_project/openapi_package/models/calculate_margin_request.py b/openapi_project/openapi_package/models/calculate_margin_request.py index 2c253c509..2d560e9c2 100644 --- a/openapi_project/openapi_package/models/calculate_margin_request.py +++ b/openapi_project/openapi_package/models/calculate_margin_request.py @@ -15,10 +15,7 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.calculate_margin_request_position_list import CalculateMarginRequestPositionList, - - - + from openapi_project.openapi_package.models.calculate_margin_request_position_list import CalculateMarginRequestPositionList T = TypeVar("T", bound="CalculateMarginRequest") diff --git a/openapi_project/openapi_package/models/calculate_margin_request_position_list.py b/openapi_project/openapi_package/models/calculate_margin_request_position_list.py index b43c9fe63..15a9adca9 100644 --- a/openapi_project/openapi_package/models/calculate_margin_request_position_list.py +++ b/openapi_project/openapi_package/models/calculate_margin_request_position_list.py @@ -12,10 +12,7 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.calculate_margin_request_position import CalculateMarginRequestPosition, - - - + from openapi_project.openapi_package.models.calculate_margin_request_position import CalculateMarginRequestPosition T = TypeVar("T", bound="CalculateMarginRequestPositionList") diff --git a/openapi_project/openapi_package/models/cancel_order_request.py b/openapi_project/openapi_package/models/cancel_order_request.py index d347e3deb..d7ecd182a 100644 --- a/openapi_project/openapi_package/models/cancel_order_request.py +++ b/openapi_project/openapi_package/models/cancel_order_request.py @@ -12,8 +12,7 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.cancel_order_request_optional_data import CancelOrderRequestOptionalData, - + from openapi_project.openapi_package.models.cancel_order_request_optional_data import CancelOrderRequestOptionalData from openapi_project.openapi_package.models.order_instruction import OrderInstruction diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py index 1fa31aebb..e358d80bf 100644 --- a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py +++ b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py @@ -14,16 +14,11 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_market_condition import CancelReplaceMultiLegOrderRequestMarketCondition, - - from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_algo import CancelReplaceMultiLegOrderRequestAlgo, - + from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_market_condition import CancelReplaceMultiLegOrderRequestMarketCondition + from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_algo import CancelReplaceMultiLegOrderRequestAlgo from openapi_project.openapi_package.models.order_instruction import OrderInstruction from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_optional_data import CancelReplaceMultiLegOrderRequestOptionalData, - - - + from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_optional_data import CancelReplaceMultiLegOrderRequestOptionalData T = TypeVar("T", bound="CancelReplaceMultiLegOrderRequest") diff --git a/openapi_project/openapi_package/models/cancel_replace_order_request.py b/openapi_project/openapi_package/models/cancel_replace_order_request.py index b5672d71d..651fc5022 100644 --- a/openapi_project/openapi_package/models/cancel_replace_order_request.py +++ b/openapi_project/openapi_package/models/cancel_replace_order_request.py @@ -15,14 +15,10 @@ if TYPE_CHECKING: from openapi_project.openapi_package.models.cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo - from openapi_project.openapi_package.models.cancel_replace_order_request_market_condition import CancelReplaceOrderRequestMarketCondition, - + from openapi_project.openapi_package.models.cancel_replace_order_request_market_condition import CancelReplaceOrderRequestMarketCondition from openapi_project.openapi_package.models.order_instruction import OrderInstruction from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.cancel_replace_order_request_optional_data import CancelReplaceOrderRequestOptionalData, - - - + from openapi_project.openapi_package.models.cancel_replace_order_request_optional_data import CancelReplaceOrderRequestOptionalData T = TypeVar("T", bound="CancelReplaceOrderRequest") diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py index 196dcf81a..24359b3f5 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py @@ -16,10 +16,7 @@ from openapi_project.openapi_package.models.clearing_info import ClearingInfo from openapi_project.openapi_package.models.order_instruction import OrderInstruction from openapi_project.openapi_package.models.create_multi_leg_order_leg import CreateMultiLegOrderLeg - from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation_optional_data import CreateMultiLegOrderCrossAllocationOptionalData, - - - + from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation_optional_data import CreateMultiLegOrderCrossAllocationOptionalData T = TypeVar("T", bound="CreateMultiLegOrderCrossAllocation") diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py index 1d35b3994..c332930e7 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py @@ -17,16 +17,10 @@ if TYPE_CHECKING: from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_market_condition import CreateMultiLegOrderCrossRequestMarketCondition, - - from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_optional_data import CreateMultiLegOrderCrossRequestOptionalData, - - from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_algo import CreateMultiLegOrderCrossRequestAlgo, - - from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation import CreateMultiLegOrderCrossAllocation, - - - + from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_market_condition import CreateMultiLegOrderCrossRequestMarketCondition + from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_optional_data import CreateMultiLegOrderCrossRequestOptionalData + from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_algo import CreateMultiLegOrderCrossRequestAlgo + from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation import CreateMultiLegOrderCrossAllocation T = TypeVar("T", bound="CreateMultiLegOrderCrossRequest") diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_leg.py b/openapi_project/openapi_package/models/create_multi_leg_order_leg.py index 9406bfd4a..a8e1c351b 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_leg.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_leg.py @@ -14,13 +14,9 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.create_multi_leg_order_leg_market_condition import CreateMultiLegOrderLegMarketCondition, - + from openapi_project.openapi_package.models.create_multi_leg_order_leg_market_condition import CreateMultiLegOrderLegMarketCondition from openapi_project.openapi_package.models.flex_option import FlexOption - from openapi_project.openapi_package.models.create_multi_leg_order_leg_optional_data import CreateMultiLegOrderLegOptionalData, - - - + from openapi_project.openapi_package.models.create_multi_leg_order_leg_optional_data import CreateMultiLegOrderLegOptionalData T = TypeVar("T", bound="CreateMultiLegOrderLeg") diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_request.py b/openapi_project/openapi_package/models/create_multi_leg_order_request.py index bc6350e7d..b26a5282b 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_request.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_request.py @@ -15,13 +15,10 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.create_multi_leg_order_request_optional_data import CreateMultiLegOrderRequestOptionalData, - - from openapi_project.openapi_package.models.create_multi_leg_order_request_algo import CreateMultiLegOrderRequestAlgo, - + from openapi_project.openapi_package.models.create_multi_leg_order_request_optional_data import CreateMultiLegOrderRequestOptionalData + from openapi_project.openapi_package.models.create_multi_leg_order_request_algo import CreateMultiLegOrderRequestAlgo from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.create_multi_leg_order_request_market_condition import CreateMultiLegOrderRequestMarketCondition, - + from openapi_project.openapi_package.models.create_multi_leg_order_request_market_condition import CreateMultiLegOrderRequestMarketCondition from openapi_project.openapi_package.models.clearing_info import ClearingInfo from openapi_project.openapi_package.models.create_multi_leg_order_leg import CreateMultiLegOrderLeg diff --git a/openapi_project/openapi_package/models/create_order_cross_allocation.py b/openapi_project/openapi_package/models/create_order_cross_allocation.py index 0ef3e40e2..ad6a648be 100644 --- a/openapi_project/openapi_package/models/create_order_cross_allocation.py +++ b/openapi_project/openapi_package/models/create_order_cross_allocation.py @@ -16,8 +16,7 @@ if TYPE_CHECKING: from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.create_order_cross_allocation_optional_data import CreateOrderCrossAllocationOptionalData, - + from openapi_project.openapi_package.models.create_order_cross_allocation_optional_data import CreateOrderCrossAllocationOptionalData from openapi_project.openapi_package.models.order_instruction import OrderInstruction diff --git a/openapi_project/openapi_package/models/create_order_cross_request.py b/openapi_project/openapi_package/models/create_order_cross_request.py index deadf3a76..5e9c33b45 100644 --- a/openapi_project/openapi_package/models/create_order_cross_request.py +++ b/openapi_project/openapi_package/models/create_order_cross_request.py @@ -16,11 +16,9 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.create_order_cross_request_market_condition import CreateOrderCrossRequestMarketCondition, - + from openapi_project.openapi_package.models.create_order_cross_request_market_condition import CreateOrderCrossRequestMarketCondition from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.create_order_cross_request_optional_data import CreateOrderCrossRequestOptionalData, - + from openapi_project.openapi_package.models.create_order_cross_request_optional_data import CreateOrderCrossRequestOptionalData from openapi_project.openapi_package.models.flex_option import FlexOption from openapi_project.openapi_package.models.create_order_cross_allocation import CreateOrderCrossAllocation from openapi_project.openapi_package.models.create_order_cross_request_algo import CreateOrderCrossRequestAlgo diff --git a/openapi_project/openapi_package/models/create_order_request.py b/openapi_project/openapi_package/models/create_order_request.py index b7ec2ed16..9364ff507 100644 --- a/openapi_project/openapi_package/models/create_order_request.py +++ b/openapi_project/openapi_package/models/create_order_request.py @@ -18,12 +18,10 @@ if TYPE_CHECKING: from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.create_order_request_market_condition import CreateOrderRequestMarketCondition, - + from openapi_project.openapi_package.models.create_order_request_market_condition import CreateOrderRequestMarketCondition from openapi_project.openapi_package.models.clearing_info import ClearingInfo from openapi_project.openapi_package.models.flex_option import FlexOption - from openapi_project.openapi_package.models.create_order_request_optional_data import CreateOrderRequestOptionalData, - + from openapi_project.openapi_package.models.create_order_request_optional_data import CreateOrderRequestOptionalData from openapi_project.openapi_package.models.create_order_request_algo import CreateOrderRequestAlgo diff --git a/openapi_project/openapi_package/models/crypto.py b/openapi_project/openapi_package/models/crypto.py index 9bdc251c4..f9b524e2a 100644 --- a/openapi_project/openapi_package/models/crypto.py +++ b/openapi_project/openapi_package/models/crypto.py @@ -33,7 +33,7 @@ class Crypto: delisted_dt (Unset | Date): description (Unset | str): exchange_id (Unset | int): - id (Unset | int): + id_ (Unset | int): multiplier (Unset | float): price_base_factor (Unset | float): price_display_factor (Unset | float): @@ -55,7 +55,7 @@ class Crypto: delisted_dt: Unset | Date = UNSET description: Unset | str = UNSET exchange_id: Unset | int = UNSET - id: Unset | int = UNSET + id_: Unset | int = UNSET multiplier: Unset | float = UNSET price_base_factor: Unset | float = UNSET price_display_factor: Unset | float = UNSET @@ -91,7 +91,7 @@ def to_dict(self) -> dict[str, Any]: exchange_id = self.exchange_id - id = self.id + id_ = self.id___ multiplier = self.multiplier @@ -155,7 +155,7 @@ def to_dict(self) -> dict[str, Any]: field_dict["description"] = description if exchange_id is not UNSET: field_dict["exchangeId"] = exchange_id - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if multiplier is not UNSET: field_dict["multiplier"] = multiplier @@ -213,7 +213,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: exchange_id = d.pop("exchangeId", UNSET) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) multiplier = d.pop("multiplier", UNSET) @@ -271,7 +271,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: delisted_dt=delisted_dt, description=description, exchange_id=exchange_id, - id=id, + id_=id_, multiplier=multiplier, price_base_factor=price_base_factor, price_display_factor=price_display_factor, diff --git a/openapi_project/openapi_package/models/exchange.py b/openapi_project/openapi_package/models/exchange.py index e7f3562d3..a11ced036 100644 --- a/openapi_project/openapi_package/models/exchange.py +++ b/openapi_project/openapi_package/models/exchange.py @@ -21,7 +21,7 @@ class Exchange: country (Unset | str): description (Unset | str): display_name (Unset | str): - id (Unset | int): + id_ (Unset | int): mic (Unset | str): microsoft_timezone (Unset | str): name (Unset | str): @@ -37,7 +37,7 @@ class Exchange: country: Unset | str = UNSET description: Unset | str = UNSET display_name: Unset | str = UNSET - id: Unset | int = UNSET + id_: Unset | int = UNSET mic: Unset | str = UNSET microsoft_timezone: Unset | str = UNSET name: Unset | str = UNSET @@ -56,7 +56,7 @@ def to_dict(self) -> dict[str, Any]: display_name = self.display_name - id = self.id + id_ = self.id___ mic = self.mic @@ -87,7 +87,7 @@ def to_dict(self) -> dict[str, Any]: field_dict["Description"] = description if display_name is not UNSET: field_dict["DisplayName"] = display_name - if id is not UNSET: + if id_ is not UNSET: field_dict["Id"] = id if mic is not UNSET: field_dict["MIC"] = mic @@ -121,7 +121,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: display_name = d.pop("DisplayName", UNSET) - id = d.pop("Id", UNSET) + id_ =d.pop("Id", UNSET) mic = d.pop("MIC", UNSET) @@ -147,7 +147,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: country=country, description=description, display_name=display_name, - id=id, + id_=id_, mic=mic, microsoft_timezone=microsoft_timezone, name=name, diff --git a/openapi_project/openapi_package/models/flex_option.py b/openapi_project/openapi_package/models/flex_option.py index f3ede1761..3962fdc71 100644 --- a/openapi_project/openapi_package/models/flex_option.py +++ b/openapi_project/openapi_package/models/flex_option.py @@ -37,7 +37,7 @@ class FlexOption: delisted_dt (Unset | Date): description (Unset | str): exchange_id (Unset | int): - id (Unset | int): + id_ (Unset | int): multiplier (Unset | float): price_base_factor (Unset | float): price_display_factor (Unset | float): @@ -72,7 +72,7 @@ class FlexOption: delisted_dt: Unset | Date = UNSET description: Unset | str = UNSET exchange_id: Unset | int = UNSET - id: Unset | int = UNSET + id_: Unset | int = UNSET multiplier: Unset | float = UNSET price_base_factor: Unset | float = UNSET price_display_factor: Unset | float = UNSET @@ -121,7 +121,7 @@ def to_dict(self) -> dict[str, Any]: exchange_id = self.exchange_id - id = self.id + id_ = self.id___ multiplier = self.multiplier @@ -225,7 +225,7 @@ def to_dict(self) -> dict[str, Any]: field_dict["description"] = description if exchange_id is not UNSET: field_dict["exchangeId"] = exchange_id - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if multiplier is not UNSET: field_dict["multiplier"] = multiplier @@ -311,7 +311,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: exchange_id = d.pop("exchangeId", UNSET) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) multiplier = d.pop("multiplier", UNSET) @@ -418,7 +418,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: delisted_dt=delisted_dt, description=description, exchange_id=exchange_id, - id=id, + id_=id_, multiplier=multiplier, price_base_factor=price_base_factor, price_display_factor=price_display_factor, diff --git a/openapi_project/openapi_package/models/future.py b/openapi_project/openapi_package/models/future.py index 34df94e4c..7b0b097cf 100644 --- a/openapi_project/openapi_package/models/future.py +++ b/openapi_project/openapi_package/models/future.py @@ -34,7 +34,7 @@ class Future: delisted_dt (Unset | Date): description (Unset | str): exchange_id (Unset | int): - id (Unset | int): + id_ (Unset | int): multiplier (Unset | float): price_base_factor (Unset | float): price_display_factor (Unset | float): @@ -61,7 +61,7 @@ class Future: delisted_dt: Unset | Date = UNSET description: Unset | str = UNSET exchange_id: Unset | int = UNSET - id: Unset | int = UNSET + id_: Unset | int = UNSET multiplier: Unset | float = UNSET price_base_factor: Unset | float = UNSET price_display_factor: Unset | float = UNSET @@ -102,7 +102,7 @@ def to_dict(self) -> dict[str, Any]: exchange_id = self.exchange_id - id = self.id + id_ = self.id___ multiplier = self.multiplier @@ -190,7 +190,7 @@ def to_dict(self) -> dict[str, Any]: field_dict["description"] = description if exchange_id is not UNSET: field_dict["exchangeId"] = exchange_id - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if multiplier is not UNSET: field_dict["multiplier"] = multiplier @@ -258,7 +258,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: exchange_id = d.pop("exchangeId", UNSET) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) multiplier = d.pop("multiplier", UNSET) @@ -346,7 +346,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: delisted_dt=delisted_dt, description=description, exchange_id=exchange_id, - id=id, + id_=id_, multiplier=multiplier, price_base_factor=price_base_factor, price_display_factor=price_display_factor, diff --git a/openapi_project/openapi_package/models/future_root.py b/openapi_project/openapi_package/models/future_root.py index 363e3d31d..bbf4854f5 100644 --- a/openapi_project/openapi_package/models/future_root.py +++ b/openapi_project/openapi_package/models/future_root.py @@ -37,7 +37,7 @@ class FutureRoot: delisted_dt (Unset | Date): description (Unset | str): exchange_id (Unset | int): - id (Unset | int): + id_ (Unset | int): multiplier (Unset | float): price_base_factor (Unset | float): price_display_factor (Unset | float): @@ -64,7 +64,7 @@ class FutureRoot: delisted_dt: Unset | Date = UNSET description: Unset | str = UNSET exchange_id: Unset | int = UNSET - id: Unset | int = UNSET + id_: Unset | int = UNSET multiplier: Unset | float = UNSET price_base_factor: Unset | float = UNSET price_display_factor: Unset | float = UNSET @@ -105,7 +105,7 @@ def to_dict(self) -> dict[str, Any]: exchange_id = self.exchange_id - id = self.id + id_ = self.id___ multiplier = self.multiplier @@ -189,7 +189,7 @@ def to_dict(self) -> dict[str, Any]: field_dict["description"] = description if exchange_id is not UNSET: field_dict["exchangeId"] = exchange_id - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if multiplier is not UNSET: field_dict["multiplier"] = multiplier @@ -259,7 +259,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: exchange_id = d.pop("exchangeId", UNSET) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) multiplier = d.pop("multiplier", UNSET) @@ -342,7 +342,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: delisted_dt=delisted_dt, description=description, exchange_id=exchange_id, - id=id, + id_=id_, multiplier=multiplier, price_base_factor=price_base_factor, price_display_factor=price_display_factor, diff --git a/openapi_project/openapi_package/models/future_spread.py b/openapi_project/openapi_package/models/future_spread.py index f1d0b47dd..90d8e8836 100644 --- a/openapi_project/openapi_package/models/future_spread.py +++ b/openapi_project/openapi_package/models/future_spread.py @@ -34,7 +34,7 @@ class FutureSpread: delisted_dt (Unset | Date): description (Unset | str): exchange_id (Unset | int): - id (Unset | int): + id_ (Unset | int): multiplier (Unset | float): price_base_factor (Unset | float): price_display_factor (Unset | float): @@ -63,7 +63,7 @@ class FutureSpread: delisted_dt: Unset | Date = UNSET description: Unset | str = UNSET exchange_id: Unset | int = UNSET - id: Unset | int = UNSET + id_: Unset | int = UNSET multiplier: Unset | float = UNSET price_base_factor: Unset | float = UNSET price_display_factor: Unset | float = UNSET @@ -106,7 +106,7 @@ def to_dict(self) -> dict[str, Any]: exchange_id = self.exchange_id - id = self.id + id_ = self.id___ multiplier = self.multiplier @@ -201,7 +201,7 @@ def to_dict(self) -> dict[str, Any]: field_dict["description"] = description if exchange_id is not UNSET: field_dict["exchangeId"] = exchange_id - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if multiplier is not UNSET: field_dict["multiplier"] = multiplier @@ -275,7 +275,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: exchange_id = d.pop("exchangeId", UNSET) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) multiplier = d.pop("multiplier", UNSET) @@ -369,7 +369,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: delisted_dt=delisted_dt, description=description, exchange_id=exchange_id, - id=id, + id_=id_, multiplier=multiplier, price_base_factor=price_base_factor, price_display_factor=price_display_factor, diff --git a/openapi_project/openapi_package/models/fx.py b/openapi_project/openapi_package/models/fx.py index c9661477f..a40011061 100644 --- a/openapi_project/openapi_package/models/fx.py +++ b/openapi_project/openapi_package/models/fx.py @@ -33,7 +33,7 @@ class Fx: delisted_dt (Unset | Date): description (Unset | str): exchange_id (Unset | int): - id (Unset | int): + id_ (Unset | int): multiplier (Unset | float): price_base_factor (Unset | float): price_display_factor (Unset | float): @@ -55,7 +55,7 @@ class Fx: delisted_dt: Unset | Date = UNSET description: Unset | str = UNSET exchange_id: Unset | int = UNSET - id: Unset | int = UNSET + id_: Unset | int = UNSET multiplier: Unset | float = UNSET price_base_factor: Unset | float = UNSET price_display_factor: Unset | float = UNSET @@ -91,7 +91,7 @@ def to_dict(self) -> dict[str, Any]: exchange_id = self.exchange_id - id = self.id + id_ = self.id___ multiplier = self.multiplier @@ -155,7 +155,7 @@ def to_dict(self) -> dict[str, Any]: field_dict["description"] = description if exchange_id is not UNSET: field_dict["exchangeId"] = exchange_id - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if multiplier is not UNSET: field_dict["multiplier"] = multiplier @@ -213,7 +213,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: exchange_id = d.pop("exchangeId", UNSET) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) multiplier = d.pop("multiplier", UNSET) @@ -271,7 +271,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: delisted_dt=delisted_dt, description=description, exchange_id=exchange_id, - id=id, + id_=id_, multiplier=multiplier, price_base_factor=price_base_factor, price_display_factor=price_display_factor, diff --git a/openapi_project/openapi_package/models/get_server_info_response.py b/openapi_project/openapi_package/models/get_server_info_response.py index a5900bade..41bf10c7c 100644 --- a/openapi_project/openapi_package/models/get_server_info_response.py +++ b/openapi_project/openapi_package/models/get_server_info_response.py @@ -13,10 +13,7 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.get_server_info_response_system_settings import GetServerInfoResponseSystemSettings, - - - + from openapi_project.openapi_package.models.get_server_info_response_system_settings import GetServerInfoResponseSystemSettings T = TypeVar("T", bound="GetServerInfoResponse") diff --git a/openapi_project/openapi_package/models/index.py b/openapi_project/openapi_package/models/index.py index c260eeae9..960e47bb4 100644 --- a/openapi_project/openapi_package/models/index.py +++ b/openapi_project/openapi_package/models/index.py @@ -33,7 +33,7 @@ class Index: delisted_dt (Unset | Date): description (Unset | str): exchange_id (Unset | int): - id (Unset | int): + id_ (Unset | int): multiplier (Unset | float): price_base_factor (Unset | float): price_display_factor (Unset | float): @@ -54,7 +54,7 @@ class Index: delisted_dt: Unset | Date = UNSET description: Unset | str = UNSET exchange_id: Unset | int = UNSET - id: Unset | int = UNSET + id_: Unset | int = UNSET multiplier: Unset | float = UNSET price_base_factor: Unset | float = UNSET price_display_factor: Unset | float = UNSET @@ -89,7 +89,7 @@ def to_dict(self) -> dict[str, Any]: exchange_id = self.exchange_id - id = self.id + id_ = self.id___ multiplier = self.multiplier @@ -147,7 +147,7 @@ def to_dict(self) -> dict[str, Any]: field_dict["description"] = description if exchange_id is not UNSET: field_dict["exchangeId"] = exchange_id - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if multiplier is not UNSET: field_dict["multiplier"] = multiplier @@ -203,7 +203,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: exchange_id = d.pop("exchangeId", UNSET) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) multiplier = d.pop("multiplier", UNSET) @@ -256,7 +256,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: delisted_dt=delisted_dt, description=description, exchange_id=exchange_id, - id=id, + id_=id_, multiplier=multiplier, price_base_factor=price_base_factor, price_display_factor=price_display_factor, diff --git a/openapi_project/openapi_package/models/multi_leg_order.py b/openapi_project/openapi_package/models/multi_leg_order.py index 07ffd5cb0..8875a0d4f 100644 --- a/openapi_project/openapi_package/models/multi_leg_order.py +++ b/openapi_project/openapi_package/models/multi_leg_order.py @@ -40,7 +40,7 @@ class MultiLegOrder: clearing_info (Unset | ClearingInfo): cur_ord_id (Unset | str): header (Unset | Header): - id (Unset | str): + id_ (Unset | str): incoming_cl_ord_id (Unset | str): incoming_ord_id (Unset | str): instructions (Unset | list[OrderInstruction]): @@ -85,7 +85,7 @@ class MultiLegOrder: clearing_info: Unset | ClearingInfo = UNSET cur_ord_id: Unset | str = UNSET header: Unset | Header = UNSET - id: Unset | str = UNSET + id_: Unset | str = UNSET incoming_cl_ord_id: Unset | str = UNSET incoming_ord_id: Unset | str = UNSET instructions: Unset | list[OrderInstruction] = UNSET @@ -144,7 +144,7 @@ def to_dict(self) -> dict[str, Any]: UNSET if isinstance(self.header, Unset) else self.header.to_dict() ) - id = self.id + id_ = self.id___ incoming_cl_ord_id = self.incoming_cl_ord_id @@ -266,7 +266,7 @@ def to_dict(self) -> dict[str, Any]: field_dict["curOrdId"] = cur_ord_id if header is not UNSET: field_dict["header"] = header - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if incoming_cl_ord_id is not UNSET: field_dict["incomingClOrdId"] = incoming_cl_ord_id @@ -369,7 +369,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: UNSET if isinstance(_header, Unset) else Header.from_dict(_header) ) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) @@ -490,7 +490,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: clearing_info=clearing_info, cur_ord_id=cur_ord_id, header=header, - id=id, + id_=id_, incoming_cl_ord_id=incoming_cl_ord_id, incoming_ord_id=incoming_ord_id, instructions=instructions, diff --git a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py index c7261f20c..9e9a68990 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py @@ -17,13 +17,10 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_optional_data import MultiLegOrderCancelReplaceRequestOptionalData, - - from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_market_condition import MultiLegOrderCancelReplaceRequestMarketCondition, - + from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_optional_data import MultiLegOrderCancelReplaceRequestOptionalData + from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_market_condition import MultiLegOrderCancelReplaceRequestMarketCondition from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_algo import MultiLegOrderCancelReplaceRequestAlgo, - + from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_algo import MultiLegOrderCancelReplaceRequestAlgo from openapi_project.openapi_package.models.header import Header from openapi_project.openapi_package.models.clearing_info import ClearingInfo diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross.py b/openapi_project/openapi_package/models/multi_leg_order_cross.py index 592845f16..e79303cb4 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross.py @@ -19,16 +19,12 @@ if TYPE_CHECKING: from openapi_project.openapi_package.models.multi_leg_order_cross_algo import MultiLegOrderCrossAlgo - from openapi_project.openapi_package.models.multi_leg_order_cross_optional_data import MultiLegOrderCrossOptionalData, - + from openapi_project.openapi_package.models.multi_leg_order_cross_optional_data import MultiLegOrderCrossOptionalData from openapi_project.openapi_package.models.order_instruction import OrderInstruction from openapi_project.openapi_package.models.multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation from openapi_project.openapi_package.models.header import Header from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent - from openapi_project.openapi_package.models.multi_leg_order_cross_market_condition import MultiLegOrderCrossMarketCondition, - - - + from openapi_project.openapi_package.models.multi_leg_order_cross_market_condition import MultiLegOrderCrossMarketCondition T = TypeVar("T", bound="MultiLegOrderCross") @@ -42,7 +38,7 @@ class MultiLegOrderCross: cross_type (Unset | CrossType): cur_ord_id (Unset | str): header (Unset | Header): - id (Unset | str): + id_ (Unset | str): incoming_cl_ord_id (Unset | str): incoming_ord_id (Unset | str): instructions (Unset | list[OrderInstruction]): @@ -79,7 +75,7 @@ class MultiLegOrderCross: cross_type: Unset | CrossType = UNSET cur_ord_id: Unset | str = UNSET header: Unset | Header = UNSET - id: Unset | str = UNSET + id_: Unset | str = UNSET incoming_cl_ord_id: Unset | str = UNSET incoming_ord_id: Unset | str = UNSET instructions: Unset | list[OrderInstruction] = UNSET @@ -133,7 +129,7 @@ def to_dict(self) -> dict[str, Any]: UNSET if isinstance(self.header, Unset) else self.header.to_dict() ) - id = self.id + id_ = self.id___ incoming_cl_ord_id = self.incoming_cl_ord_id @@ -234,7 +230,7 @@ def to_dict(self) -> dict[str, Any]: field_dict["curOrdId"] = cur_ord_id if header is not UNSET: field_dict["header"] = header - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if incoming_cl_ord_id is not UNSET: field_dict["incomingClOrdId"] = incoming_cl_ord_id @@ -328,7 +324,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: UNSET if isinstance(_header, Unset) else Header.from_dict(_header) ) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) @@ -428,7 +424,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: cross_type=cross_type, cur_ord_id=cur_ord_id, header=header, - id=id, + id_=id_, incoming_cl_ord_id=incoming_cl_ord_id, incoming_ord_id=incoming_ord_id, instructions=instructions, diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py index f26b1f5ae..49c000c3b 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py @@ -17,10 +17,7 @@ from openapi_project.openapi_package.models.multi_leg_order_leg import MultiLegOrderLeg from openapi_project.openapi_package.models.clearing_info import ClearingInfo from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.multi_leg_order_cross_allocation_optional_data import MultiLegOrderCrossAllocationOptionalData, - - - + from openapi_project.openapi_package.models.multi_leg_order_cross_allocation_optional_data import MultiLegOrderCrossAllocationOptionalData T = TypeVar("T", bound="MultiLegOrderCrossAllocation") @@ -30,7 +27,7 @@ class MultiLegOrderCrossAllocation: Attributes: account_id (Unset | int): clearing_info (Unset | ClearingInfo): - id (Unset | str): + id_ (Unset | str): instructions (Unset | list[OrderInstruction]): legs (Unset | list[MultiLegOrderLeg]): optional_data (Unset | MultiLegOrderCrossAllocationOptionalData): @@ -50,7 +47,7 @@ class MultiLegOrderCrossAllocation: account_id: Unset | int = UNSET clearing_info: Unset | ClearingInfo = UNSET - id: Unset | str = UNSET + id_: Unset | str = UNSET instructions: Unset | list[OrderInstruction] = UNSET legs: Unset | list[MultiLegOrderLeg] = UNSET optional_data: Unset | MultiLegOrderCrossAllocationOptionalData = UNSET @@ -76,7 +73,7 @@ def to_dict(self) -> dict[str, Any]: else self.clearing_info.to_dict() ) - id = self.id + id_ = self.id___ instructions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.instructions, Unset): @@ -133,7 +130,7 @@ def to_dict(self) -> dict[str, Any]: field_dict["accountId"] = account_id if clearing_info is not UNSET: field_dict["clearingInfo"] = clearing_info - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if instructions is not UNSET: field_dict["instructions"] = instructions @@ -180,7 +177,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: else ClearingInfo.from_dict(_clearing_info) ) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) instructions = [] _instructions = d.pop("instructions", UNSET) @@ -236,7 +233,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: multi_leg_order_cross_allocation = cls( account_id=account_id, clearing_info=clearing_info, - id=id, + id_=id_, instructions=instructions, legs=legs, optional_data=optional_data, diff --git a/openapi_project/openapi_package/models/multi_leg_order_leg.py b/openapi_project/openapi_package/models/multi_leg_order_leg.py index 1e654bf7b..d21008296 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_leg.py +++ b/openapi_project/openapi_package/models/multi_leg_order_leg.py @@ -17,10 +17,7 @@ from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent from openapi_project.openapi_package.models.multi_leg_order_leg_optional_data import MultiLegOrderLegOptionalData from openapi_project.openapi_package.models.security import Security - from openapi_project.openapi_package.models.multi_leg_order_leg_market_condition import MultiLegOrderLegMarketCondition, - - - + from openapi_project.openapi_package.models.multi_leg_order_leg_market_condition import MultiLegOrderLegMarketCondition T = TypeVar("T", bound="MultiLegOrderLeg") @@ -28,7 +25,7 @@ class MultiLegOrderLeg: """ Attributes: - id (Unset | str): + id_ (Unset | str): market_condition (Unset | MultiLegOrderLegMarketCondition): optional_data (Unset | MultiLegOrderLegOptionalData): order_updates (Unset | list[OrderUpdateEvent]): @@ -48,7 +45,7 @@ class MultiLegOrderLeg: transact_ts (Unset | str): """ - id: Unset | str = UNSET + id_: Unset | str = UNSET market_condition: Unset | MultiLegOrderLegMarketCondition = UNSET optional_data: Unset | MultiLegOrderLegOptionalData = UNSET order_updates: Unset | list[OrderUpdateEvent] = UNSET @@ -68,7 +65,7 @@ class MultiLegOrderLeg: transact_ts: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - id = self.id + id_ = self.id___ market_condition: Unset | dict[str, Any] = ( UNSET @@ -126,7 +123,7 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if market_condition is not UNSET: field_dict["marketCondition"] = market_condition @@ -168,7 +165,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) _market_condition = d.pop("marketCondition", UNSET) market_condition: Unset | MultiLegOrderLegMarketCondition = ( @@ -229,7 +226,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: transact_ts = d.pop("transactTs", UNSET) multi_leg_order_leg = cls( - id=id, + id_=id_, market_condition=market_condition, optional_data=optional_data, order_updates=order_updates, diff --git a/openapi_project/openapi_package/models/option.py b/openapi_project/openapi_package/models/option.py index 89a1dc641..9703f625e 100644 --- a/openapi_project/openapi_package/models/option.py +++ b/openapi_project/openapi_package/models/option.py @@ -36,7 +36,7 @@ class Option: delisted_dt (Unset | Date): description (Unset | str): exchange_id (Unset | int): - id (Unset | int): + id_ (Unset | int): multiplier (Unset | float): price_base_factor (Unset | float): price_display_factor (Unset | float): @@ -65,7 +65,7 @@ class Option: delisted_dt: Unset | Date = UNSET description: Unset | str = UNSET exchange_id: Unset | int = UNSET - id: Unset | int = UNSET + id_: Unset | int = UNSET multiplier: Unset | float = UNSET price_base_factor: Unset | float = UNSET price_display_factor: Unset | float = UNSET @@ -108,7 +108,7 @@ def to_dict(self) -> dict[str, Any]: exchange_id = self.exchange_id - id = self.id + id_ = self.id___ multiplier = self.multiplier @@ -202,7 +202,7 @@ def to_dict(self) -> dict[str, Any]: field_dict["description"] = description if exchange_id is not UNSET: field_dict["exchangeId"] = exchange_id - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if multiplier is not UNSET: field_dict["multiplier"] = multiplier @@ -274,7 +274,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: exchange_id = d.pop("exchangeId", UNSET) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) multiplier = d.pop("multiplier", UNSET) @@ -369,7 +369,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: delisted_dt=delisted_dt, description=description, exchange_id=exchange_id, - id=id, + id_=id_, multiplier=multiplier, price_base_factor=price_base_factor, price_display_factor=price_display_factor, diff --git a/openapi_project/openapi_package/models/option_chain_option.py b/openapi_project/openapi_package/models/option_chain_option.py index 5197f3c6b..ca7b644e9 100644 --- a/openapi_project/openapi_package/models/option_chain_option.py +++ b/openapi_project/openapi_package/models/option_chain_option.py @@ -30,7 +30,7 @@ class OptionChainOption: delisted_dt (Unset | Date): description (Unset | str): exchange_id (Unset | int): - id (Unset | int): + id_ (Unset | int): tick_rule (Unset | str): tick_size (Unset | float): tick_value (Unset | float): @@ -46,7 +46,7 @@ class OptionChainOption: delisted_dt: Unset | Date = UNSET description: Unset | str = UNSET exchange_id: Unset | int = UNSET - id: Unset | int = UNSET + id_: Unset | int = UNSET tick_rule: Unset | str = UNSET tick_size: Unset | float = UNSET tick_value: Unset | float = UNSET @@ -73,7 +73,7 @@ def to_dict(self) -> dict[str, Any]: exchange_id = self.exchange_id - id = self.id + id_ = self.id___ tick_rule = self.tick_rule @@ -119,7 +119,7 @@ def to_dict(self) -> dict[str, Any]: field_dict["description"] = description if exchange_id is not UNSET: field_dict["exchangeId"] = exchange_id - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if tick_rule is not UNSET: field_dict["tickRule"] = tick_rule @@ -164,7 +164,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: exchange_id = d.pop("exchangeId", UNSET) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) tick_rule = d.pop("tickRule", UNSET) @@ -206,7 +206,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: delisted_dt=delisted_dt, description=description, exchange_id=exchange_id, - id=id, + id_=id_, tick_rule=tick_rule, tick_size=tick_size, tick_value=tick_value, diff --git a/openapi_project/openapi_package/models/option_root.py b/openapi_project/openapi_package/models/option_root.py index 4dce76327..b14666a68 100644 --- a/openapi_project/openapi_package/models/option_root.py +++ b/openapi_project/openapi_package/models/option_root.py @@ -39,7 +39,7 @@ class OptionRoot: delisted_dt (Unset | Date): description (Unset | str): exchange_id (Unset | int): - id (Unset | int): + id_ (Unset | int): multiplier (Unset | float): price_base_factor (Unset | float): price_display_factor (Unset | float): @@ -70,7 +70,7 @@ class OptionRoot: delisted_dt: Unset | Date = UNSET description: Unset | str = UNSET exchange_id: Unset | int = UNSET - id: Unset | int = UNSET + id_: Unset | int = UNSET multiplier: Unset | float = UNSET price_base_factor: Unset | float = UNSET price_display_factor: Unset | float = UNSET @@ -115,7 +115,7 @@ def to_dict(self) -> dict[str, Any]: exchange_id = self.exchange_id - id = self.id + id_ = self.id___ multiplier = self.multiplier @@ -214,7 +214,7 @@ def to_dict(self) -> dict[str, Any]: field_dict["description"] = description if exchange_id is not UNSET: field_dict["exchangeId"] = exchange_id - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if multiplier is not UNSET: field_dict["multiplier"] = multiplier @@ -292,7 +292,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: exchange_id = d.pop("exchangeId", UNSET) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) multiplier = d.pop("multiplier", UNSET) @@ -393,7 +393,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: delisted_dt=delisted_dt, description=description, exchange_id=exchange_id, - id=id, + id_=id_, multiplier=multiplier, price_base_factor=price_base_factor, price_display_factor=price_display_factor, diff --git a/openapi_project/openapi_package/models/order.py b/openapi_project/openapi_package/models/order.py index 6b4c82222..3ae8cb1ea 100644 --- a/openapi_project/openapi_package/models/order.py +++ b/openapi_project/openapi_package/models/order.py @@ -42,7 +42,7 @@ class Order: clearing_info (Unset | ClearingInfo): cur_ord_id (Unset | str): header (Unset | Header): - id (Unset | str): + id_ (Unset | str): incoming_cl_ord_id (Unset | str): incoming_ord_id (Unset | str): instructions (Unset | list[OrderInstruction]): @@ -90,7 +90,7 @@ class Order: clearing_info: Unset | ClearingInfo = UNSET cur_ord_id: Unset | str = UNSET header: Unset | Header = UNSET - id: Unset | str = UNSET + id_: Unset | str = UNSET incoming_cl_ord_id: Unset | str = UNSET incoming_ord_id: Unset | str = UNSET instructions: Unset | list[OrderInstruction] = UNSET @@ -152,7 +152,7 @@ def to_dict(self) -> dict[str, Any]: UNSET if isinstance(self.header, Unset) else self.header.to_dict() ) - id = self.id + id_ = self.id___ incoming_cl_ord_id = self.incoming_cl_ord_id @@ -281,7 +281,7 @@ def to_dict(self) -> dict[str, Any]: field_dict["curOrdId"] = cur_ord_id if header is not UNSET: field_dict["header"] = header - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if incoming_cl_ord_id is not UNSET: field_dict["incomingClOrdId"] = incoming_cl_ord_id @@ -390,7 +390,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: UNSET if isinstance(_header, Unset) else Header.from_dict(_header) ) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) @@ -521,7 +521,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: clearing_info=clearing_info, cur_ord_id=cur_ord_id, header=header, - id=id, + id_=id_, incoming_cl_ord_id=incoming_cl_ord_id, incoming_ord_id=incoming_ord_id, instructions=instructions, diff --git a/openapi_project/openapi_package/models/order_cancel_replace_request.py b/openapi_project/openapi_package/models/order_cancel_replace_request.py index 35dcafc0c..b9b15513f 100644 --- a/openapi_project/openapi_package/models/order_cancel_replace_request.py +++ b/openapi_project/openapi_package/models/order_cancel_replace_request.py @@ -17,16 +17,12 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_cancel_replace_request_market_condition import OrderCancelReplaceRequestMarketCondition, - + from openapi_project.openapi_package.models.order_cancel_replace_request_market_condition import OrderCancelReplaceRequestMarketCondition from openapi_project.openapi_package.models.order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo from openapi_project.openapi_package.models.order_instruction import OrderInstruction from openapi_project.openapi_package.models.header import Header from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.order_cancel_replace_request_optional_data import OrderCancelReplaceRequestOptionalData, - - - + from openapi_project.openapi_package.models.order_cancel_replace_request_optional_data import OrderCancelReplaceRequestOptionalData T = TypeVar("T", bound="OrderCancelReplaceRequest") diff --git a/openapi_project/openapi_package/models/order_cancel_request.py b/openapi_project/openapi_package/models/order_cancel_request.py index 407d6fecb..93bace420 100644 --- a/openapi_project/openapi_package/models/order_cancel_request.py +++ b/openapi_project/openapi_package/models/order_cancel_request.py @@ -14,10 +14,7 @@ if TYPE_CHECKING: from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.order_cancel_request_optional_data import OrderCancelRequestOptionalData, - - - + from openapi_project.openapi_package.models.order_cancel_request_optional_data import OrderCancelRequestOptionalData T = TypeVar("T", bound="OrderCancelRequest") diff --git a/openapi_project/openapi_package/models/order_cross.py b/openapi_project/openapi_package/models/order_cross.py index cdd0cdfe5..2de700740 100644 --- a/openapi_project/openapi_package/models/order_cross.py +++ b/openapi_project/openapi_package/models/order_cross.py @@ -41,7 +41,7 @@ class OrderCross: cross_type (Unset | CrossType): cur_ord_id (Unset | str): header (Unset | Header): - id (Unset | str): + id_ (Unset | str): incoming_cl_ord_id (Unset | str): incoming_ord_id (Unset | str): instructions (Unset | list[OrderInstruction]): @@ -80,7 +80,7 @@ class OrderCross: cross_type: Unset | CrossType = UNSET cur_ord_id: Unset | str = UNSET header: Unset | Header = UNSET - id: Unset | str = UNSET + id_: Unset | str = UNSET incoming_cl_ord_id: Unset | str = UNSET incoming_ord_id: Unset | str = UNSET instructions: Unset | list[OrderInstruction] = UNSET @@ -136,7 +136,7 @@ def to_dict(self) -> dict[str, Any]: UNSET if isinstance(self.header, Unset) else self.header.to_dict() ) - id = self.id + id_ = self.id___ incoming_cl_ord_id = self.incoming_cl_ord_id @@ -243,7 +243,7 @@ def to_dict(self) -> dict[str, Any]: field_dict["curOrdId"] = cur_ord_id if header is not UNSET: field_dict["header"] = header - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if incoming_cl_ord_id is not UNSET: field_dict["incomingClOrdId"] = incoming_cl_ord_id @@ -337,7 +337,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: UNSET if isinstance(_header, Unset) else Header.from_dict(_header) ) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) @@ -444,7 +444,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: cross_type=cross_type, cur_ord_id=cur_ord_id, header=header, - id=id, + id_=id_, incoming_cl_ord_id=incoming_cl_ord_id, incoming_ord_id=incoming_ord_id, instructions=instructions, diff --git a/openapi_project/openapi_package/models/order_cross_allocation.py b/openapi_project/openapi_package/models/order_cross_allocation.py index 0a4537720..7c9f6a4d4 100644 --- a/openapi_project/openapi_package/models/order_cross_allocation.py +++ b/openapi_project/openapi_package/models/order_cross_allocation.py @@ -17,8 +17,7 @@ if TYPE_CHECKING: from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.order_cross_allocation_optional_data import OrderCrossAllocationOptionalData, - + from openapi_project.openapi_package.models.order_cross_allocation_optional_data import OrderCrossAllocationOptionalData from openapi_project.openapi_package.models.order_instruction import OrderInstruction @@ -31,7 +30,7 @@ class OrderCrossAllocation: Attributes: account_id (Unset | int): clearing_info (Unset | ClearingInfo): - id (Unset | str): + id_ (Unset | str): incoming_ord_id (Unset | str): instructions (Unset | list[OrderInstruction]): optional_data (Unset | OrderCrossAllocationOptionalData): @@ -51,7 +50,7 @@ class OrderCrossAllocation: account_id: Unset | int = UNSET clearing_info: Unset | ClearingInfo = UNSET - id: Unset | str = UNSET + id_: Unset | str = UNSET incoming_ord_id: Unset | str = UNSET instructions: Unset | list[OrderInstruction] = UNSET optional_data: Unset | OrderCrossAllocationOptionalData = UNSET @@ -77,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: else self.clearing_info.to_dict() ) - id = self.id + id_ = self.id___ incoming_ord_id = self.incoming_ord_id @@ -133,7 +132,7 @@ def to_dict(self) -> dict[str, Any]: field_dict["accountId"] = account_id if clearing_info is not UNSET: field_dict["clearingInfo"] = clearing_info - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if incoming_ord_id is not UNSET: field_dict["incomingOrdId"] = incoming_ord_id @@ -180,7 +179,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: else ClearingInfo.from_dict(_clearing_info) ) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) incoming_ord_id = d.pop("incomingOrdId", UNSET) @@ -237,7 +236,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: order_cross_allocation = cls( account_id=account_id, clearing_info=clearing_info, - id=id, + id_=id_, incoming_ord_id=incoming_ord_id, instructions=instructions, optional_data=optional_data, diff --git a/openapi_project/openapi_package/models/order_update_event.py b/openapi_project/openapi_package/models/order_update_event.py index 481933241..b190c5136 100644 --- a/openapi_project/openapi_package/models/order_update_event.py +++ b/openapi_project/openapi_package/models/order_update_event.py @@ -12,8 +12,7 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request import MultiLegOrderCancelReplaceRequest, - + from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request import MultiLegOrderCancelReplaceRequest from openapi_project.openapi_package.models.order_update import OrderUpdate from openapi_project.openapi_package.models.execution import Execution from openapi_project.openapi_package.models.order_cancel_reject import OrderCancelReject diff --git a/openapi_project/openapi_package/models/risk_reject.py b/openapi_project/openapi_package/models/risk_reject.py index c76e2ac8d..7fdc863a7 100644 --- a/openapi_project/openapi_package/models/risk_reject.py +++ b/openapi_project/openapi_package/models/risk_reject.py @@ -22,7 +22,7 @@ class RiskReject: Attributes: account_id (Unset | int): guid (Unset | str): - id (Unset | int): + id_ (Unset | int): is_overridden (Unset | bool): message (Unset | str): order_id (Unset | str): @@ -34,7 +34,7 @@ class RiskReject: account_id: Unset | int = UNSET guid: Unset | str = UNSET - id: Unset | int = UNSET + id_: Unset | int = UNSET is_overridden: Unset | bool = UNSET message: Unset | str = UNSET order_id: Unset | str = UNSET @@ -48,7 +48,7 @@ def to_dict(self) -> dict[str, Any]: guid = self.guid - id = self.id + id_ = self.id___ is_overridden = self.is_overridden @@ -77,7 +77,7 @@ def to_dict(self) -> dict[str, Any]: field_dict["accountId"] = account_id if guid is not UNSET: field_dict["guid"] = guid - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if is_overridden is not UNSET: field_dict["isOverridden"] = is_overridden @@ -103,7 +103,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: guid = d.pop("guid", UNSET) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) is_overridden = d.pop("isOverridden", UNSET) @@ -130,7 +130,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: risk_reject = cls( account_id=account_id, guid=guid, - id=id, + id_=id_, is_overridden=is_overridden, message=message, order_id=order_id, diff --git a/openapi_project/openapi_package/models/route.py b/openapi_project/openapi_package/models/route.py index 8cb0513b2..48eb17893 100644 --- a/openapi_project/openapi_package/models/route.py +++ b/openapi_project/openapi_package/models/route.py @@ -26,7 +26,7 @@ class Route: """ Attributes: - id (Unset | int): + id_ (Unset | int): algo_schema (Unset | str): currency (Unset | Currency): is_enabled (Unset | bool): @@ -39,7 +39,7 @@ class Route: venue (Unset | str): """ - id: Unset | int = UNSET + id_: Unset | int = UNSET algo_schema: Unset | str = UNSET currency: Unset | Currency = UNSET is_enabled: Unset | bool = UNSET @@ -52,7 +52,7 @@ class Route: venue: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - id = self.id + id_ = self.id___ algo_schema = self.algo_schema @@ -90,7 +90,7 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if algo_schema is not UNSET: field_dict["algoSchema"] = algo_schema @@ -118,7 +118,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) algo_schema = d.pop("algoSchema", UNSET) @@ -158,7 +158,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: venue = d.pop("venue", UNSET) route = cls( - id=id, + id_=id_, algo_schema=algo_schema, currency=currency, is_enabled=is_enabled, diff --git a/openapi_project/openapi_package/models/route_property.py b/openapi_project/openapi_package/models/route_property.py index 0ac617caf..aa7edcb19 100644 --- a/openapi_project/openapi_package/models/route_property.py +++ b/openapi_project/openapi_package/models/route_property.py @@ -19,17 +19,17 @@ class RouteProperty: """ Attributes: - id (Unset | int): + id_ (Unset | int): type_ (Unset | RoutePropertyType): value (Unset | str): """ - id: Unset | int = UNSET + id_: Unset | int = UNSET type_: Unset | RoutePropertyType = UNSET value: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - id = self.id + id_ = self.id___ type_: Unset | str = ( UNSET if isinstance(self.type_, Unset) else self.type_.value @@ -40,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if type_ is not UNSET: field_dict["type"] = type_ @@ -52,7 +52,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) type_: Unset | RoutePropertyType = ( @@ -62,7 +62,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: value = d.pop("value", UNSET) route_property = cls( - id=id, + id_=id_, type_=type_, value=value, ) diff --git a/openapi_project/openapi_package/models/routing_session_group.py b/openapi_project/openapi_package/models/routing_session_group.py index 34d2f267e..21ec28871 100644 --- a/openapi_project/openapi_package/models/routing_session_group.py +++ b/openapi_project/openapi_package/models/routing_session_group.py @@ -19,17 +19,17 @@ class RoutingSessionGroup: """ Attributes: - id (Unset | int): + id_ (Unset | int): name (Unset | str): type_ (Unset | RoutingSessionGroupType): """ - id: Unset | int = UNSET + id_: Unset | int = UNSET name: Unset | str = UNSET type_: Unset | RoutingSessionGroupType = UNSET def to_dict(self) -> dict[str, Any]: - id = self.id + id_ = self.id___ name = self.name @@ -40,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if name is not UNSET: field_dict["name"] = name @@ -52,7 +52,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) name = d.pop("name", UNSET) @@ -62,7 +62,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) routing_session_group = cls( - id=id, + id_=id_, name=name, type_=type_, ) diff --git a/openapi_project/openapi_package/models/stock.py b/openapi_project/openapi_package/models/stock.py index 7ed305919..b4d4aa24c 100644 --- a/openapi_project/openapi_package/models/stock.py +++ b/openapi_project/openapi_package/models/stock.py @@ -33,7 +33,7 @@ class Stock: delisted_dt (Unset | Date): description (Unset | str): exchange_id (Unset | int): - id (Unset | int): + id_ (Unset | int): multiplier (Unset | float): price_base_factor (Unset | float): price_display_factor (Unset | float): @@ -58,7 +58,7 @@ class Stock: delisted_dt: Unset | Date = UNSET description: Unset | str = UNSET exchange_id: Unset | int = UNSET - id: Unset | int = UNSET + id_: Unset | int = UNSET multiplier: Unset | float = UNSET price_base_factor: Unset | float = UNSET price_display_factor: Unset | float = UNSET @@ -97,7 +97,7 @@ def to_dict(self) -> dict[str, Any]: exchange_id = self.exchange_id - id = self.id + id_ = self.id___ multiplier = self.multiplier @@ -163,7 +163,7 @@ def to_dict(self) -> dict[str, Any]: field_dict["description"] = description if exchange_id is not UNSET: field_dict["exchangeId"] = exchange_id - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if multiplier is not UNSET: field_dict["multiplier"] = multiplier @@ -227,7 +227,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: exchange_id = d.pop("exchangeId", UNSET) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) multiplier = d.pop("multiplier", UNSET) @@ -288,7 +288,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: delisted_dt=delisted_dt, description=description, exchange_id=exchange_id, - id=id, + id_=id_, multiplier=multiplier, price_base_factor=price_base_factor, price_display_factor=price_display_factor, diff --git a/openapi_project/openapi_package/models/trade_confirm.py b/openapi_project/openapi_package/models/trade_confirm.py index 55a668bf8..80943d2a8 100644 --- a/openapi_project/openapi_package/models/trade_confirm.py +++ b/openapi_project/openapi_package/models/trade_confirm.py @@ -70,7 +70,7 @@ class TradeConfirm: fee2 (Unset | float): frequent_trader_id (Unset | str): give_up (Unset | str): - id (Unset | int): + id_ (Unset | int): incoming_cl_ord_id (Unset | str): incoming_ord_id (Unset | str): incoming_orig_clord_id (Unset | str): @@ -156,7 +156,7 @@ class TradeConfirm: fee2: Unset | float = UNSET frequent_trader_id: Unset | str = UNSET give_up: Unset | str = UNSET - id: Unset | int = UNSET + id_: Unset | int = UNSET incoming_cl_ord_id: Unset | str = UNSET incoming_ord_id: Unset | str = UNSET incoming_orig_clord_id: Unset | str = UNSET @@ -296,7 +296,7 @@ def to_dict(self) -> dict[str, Any]: give_up = self.give_up - id = self.id + id_ = self.id___ incoming_cl_ord_id = self.incoming_cl_ord_id @@ -493,7 +493,7 @@ def to_dict(self) -> dict[str, Any]: field_dict["frequentTraderId"] = frequent_trader_id if give_up is not UNSET: field_dict["giveUp"] = give_up - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if incoming_cl_ord_id is not UNSET: field_dict["incomingClOrdId"] = incoming_cl_ord_id @@ -696,7 +696,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: give_up = d.pop("giveUp", UNSET) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) @@ -870,7 +870,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: fee2=fee2, frequent_trader_id=frequent_trader_id, give_up=give_up, - id=id, + id_=id_, incoming_cl_ord_id=incoming_cl_ord_id, incoming_ord_id=incoming_ord_id, incoming_orig_clord_id=incoming_orig_clord_id, diff --git a/openapi_project/openapi_package/models/trading_firm.py b/openapi_project/openapi_package/models/trading_firm.py index face14eaa..d10a9995e 100644 --- a/openapi_project/openapi_package/models/trading_firm.py +++ b/openapi_project/openapi_package/models/trading_firm.py @@ -18,19 +18,19 @@ class TradingFirm: """ Attributes: - id (Unset | int): + id_ (Unset | int): eq_mpid (Unset | str): name (Unset | str): occ_clearing_number (Unset | str): """ - id: Unset | int = UNSET + id_: Unset | int = UNSET eq_mpid: Unset | str = UNSET name: Unset | str = UNSET occ_clearing_number: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - id = self.id + id_ = self.id___ eq_mpid = self.eq_mpid @@ -41,7 +41,7 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if eq_mpid is not UNSET: field_dict["eqMpid"] = eq_mpid @@ -55,7 +55,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) eq_mpid = d.pop("eqMpid", UNSET) @@ -64,7 +64,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: occ_clearing_number = d.pop("occClearingNumber", UNSET) trading_firm = cls( - id=id, + id_=id_, eq_mpid=eq_mpid, name=name, occ_clearing_number=occ_clearing_number, diff --git a/openapi_project/openapi_package/models/trading_firm_slim.py b/openapi_project/openapi_package/models/trading_firm_slim.py index 2dfc0d009..f14222d56 100644 --- a/openapi_project/openapi_package/models/trading_firm_slim.py +++ b/openapi_project/openapi_package/models/trading_firm_slim.py @@ -18,22 +18,22 @@ class TradingFirmSlim: """ Attributes: - id (Unset | int): + id_ (Unset | int): name (Unset | str): """ - id: Unset | int = UNSET + id_: Unset | int = UNSET name: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - id = self.id + id_ = self.id___ name = self.name field_dict: dict[str, Any] = {} field_dict.update({}) - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if name is not UNSET: field_dict["name"] = name @@ -43,12 +43,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) name = d.pop("name", UNSET) trading_firm_slim = cls( - id=id, + id_=id_, name=name, ) diff --git a/openapi_project/openapi_package/models/trading_holiday.py b/openapi_project/openapi_package/models/trading_holiday.py index 90d2bddad..da5e93984 100644 --- a/openapi_project/openapi_package/models/trading_holiday.py +++ b/openapi_project/openapi_package/models/trading_holiday.py @@ -23,21 +23,21 @@ class TradingHoliday: """ Attributes: - id (Unset | int): + id_ (Unset | int): country (Unset | Country): date (Unset | Date): description (Unset | str): is_early_close (Unset | bool): """ - id: Unset | int = UNSET + id_: Unset | int = UNSET country: Unset | Country = UNSET date: Unset | Date = UNSET description: Unset | str = UNSET is_early_close: Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: - id = self.id + id_ = self.id___ country: Unset | str = ( UNSET if isinstance(self.country, Unset) else self.country.value @@ -54,7 +54,7 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if country is not UNSET: field_dict["country"] = country @@ -70,7 +70,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) _country = d.pop("country", UNSET) country: Unset | Country = ( @@ -87,7 +87,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: is_early_close = d.pop("isEarlyClose", UNSET) trading_holiday = cls( - id=id, + id_=id_, country=country, date=date, description=description, diff --git a/openapi_project/openapi_package/models/trading_session.py b/openapi_project/openapi_package/models/trading_session.py index a3629b47c..98cfe43d0 100644 --- a/openapi_project/openapi_package/models/trading_session.py +++ b/openapi_project/openapi_package/models/trading_session.py @@ -24,7 +24,7 @@ class TradingSession: Attributes: days_of_the_week (Unset | str): end_time (Unset | TimeOfDay): - id (Unset | int): + id_ (Unset | int): name (Unset | str): start_time (Unset | TimeOfDay): trading_session_group_id (Unset | int): @@ -32,7 +32,7 @@ class TradingSession: days_of_the_week: Unset | str = UNSET end_time: Unset | TimeOfDay = UNSET - id: Unset | int = UNSET + id_: Unset | int = UNSET name: Unset | str = UNSET start_time: Unset | TimeOfDay = UNSET trading_session_group_id: Unset | int = UNSET @@ -44,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: UNSET if isinstance(self.end_time, Unset) else self.end_time.to_dict() ) - id = self.id + id_ = self.id___ name = self.name @@ -61,7 +61,7 @@ def to_dict(self) -> dict[str, Any]: field_dict["daysOfTheWeek"] = days_of_the_week if end_time is not UNSET: field_dict["endTime"] = end_time - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if name is not UNSET: field_dict["name"] = name @@ -82,7 +82,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: UNSET if isinstance(_end_time, Unset) else TimeOfDay.from_dict(_end_time) ) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) name = d.pop("name", UNSET) @@ -98,7 +98,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: trading_session = cls( days_of_the_week=days_of_the_week, end_time=end_time, - id=id, + id_=id_, name=name, start_time=start_time, trading_session_group_id=trading_session_group_id, diff --git a/openapi_project/openapi_package/models/trading_session_group.py b/openapi_project/openapi_package/models/trading_session_group.py index 8af0c6dff..c5d1c46e4 100644 --- a/openapi_project/openapi_package/models/trading_session_group.py +++ b/openapi_project/openapi_package/models/trading_session_group.py @@ -22,17 +22,17 @@ class TradingSessionGroup: """ Attributes: - id (Unset | int): + id_ (Unset | int): name (Unset | str): sessions (Unset | list[TradingSession]): """ - id: Unset | int = UNSET + id_: Unset | int = UNSET name: Unset | str = UNSET sessions: Unset | list[TradingSession] = UNSET def to_dict(self) -> dict[str, Any]: - id = self.id + id_ = self.id___ name = self.name @@ -46,7 +46,7 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if name is not UNSET: field_dict["name"] = name @@ -58,7 +58,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) name = d.pop("name", UNSET) @@ -70,7 +70,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: sessions.append(sessions_item) trading_session_group = cls( - id=id, + id_=id_, name=name, sessions=sessions, ) diff --git a/openapi_project/openapi_package/models/user.py b/openapi_project/openapi_package/models/user.py index c70efe50c..825463449 100644 --- a/openapi_project/openapi_package/models/user.py +++ b/openapi_project/openapi_package/models/user.py @@ -28,7 +28,7 @@ class User: domain (Unset | str): email (Unset | str): first_name (Unset | str): - id (Unset | int): + id_ (Unset | int): is_locked_out (Unset | bool): last_name (Unset | str): location (Unset | UserLocation): @@ -49,7 +49,7 @@ class User: domain: Unset | str = UNSET email: Unset | str = UNSET first_name: Unset | str = UNSET - id: Unset | int = UNSET + id_: Unset | int = UNSET is_locked_out: Unset | bool = UNSET last_name: Unset | str = UNSET location: Unset | UserLocation = UNSET @@ -73,7 +73,7 @@ def to_dict(self) -> dict[str, Any]: first_name = self.first_name - id = self.id + id_ = self.id___ is_locked_out = self.is_locked_out @@ -125,7 +125,7 @@ def to_dict(self) -> dict[str, Any]: field_dict["email"] = email if first_name is not UNSET: field_dict["firstName"] = first_name - if id is not UNSET: + if id_ is not UNSET: field_dict["id"] = id if is_locked_out is not UNSET: field_dict["isLockedOut"] = is_locked_out @@ -169,7 +169,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: first_name = d.pop("firstName", UNSET) - id = d.pop("id", UNSET) + id_ = d.pop("id", UNSET) is_locked_out = d.pop("isLockedOut", UNSET) @@ -219,7 +219,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: domain=domain, email=email, first_name=first_name, - id=id, + id_=id_, is_locked_out=is_locked_out, last_name=last_name, location=location, From 47b366a720e90c0da68b43071deb02072928661c Mon Sep 17 00:00:00 2001 From: Itay Bavly Date: Thu, 21 Aug 2025 13:31:06 -0400 Subject: [PATCH 11/16] regen --- fix_builtin_shadowing.py | 11 ++++++++--- openapi_project/openapi_package/models/account.py | 2 +- .../openapi_package/models/cancel_order_request.py | 4 +--- .../cancel_replace_multi_leg_order_request.py | 6 +++--- .../models/cancel_replace_order_request.py | 8 +++++--- .../create_multi_leg_order_cross_allocation.py | 6 ++++-- .../models/create_multi_leg_order_cross_request.py | 2 +- .../models/create_multi_leg_order_leg.py | 4 +++- .../models/create_multi_leg_order_request.py | 4 ++-- .../models/create_order_cross_allocation.py | 2 +- .../models/create_order_cross_request.py | 8 +++----- .../openapi_package/models/create_order_request.py | 6 +++--- openapi_project/openapi_package/models/crypto.py | 4 ++-- openapi_project/openapi_package/models/exchange.py | 2 +- .../openapi_package/models/execution.py | 6 +++--- .../openapi_package/models/flex_option.py | 2 +- openapi_project/openapi_package/models/future.py | 2 +- .../openapi_package/models/future_root.py | 4 ++-- .../openapi_package/models/future_spread.py | 4 ++-- openapi_project/openapi_package/models/fx.py | 4 ++-- .../openapi_package/models/generic_order.py | 4 ++-- openapi_project/openapi_package/models/index.py | 2 +- .../openapi_package/models/list_routes_response.py | 2 +- .../openapi_package/models/multi_leg_order.py | 12 ++++++------ .../multi_leg_order_cancel_replace_request.py | 4 ++-- .../models/multi_leg_order_cross.py | 14 ++++++++------ .../models/multi_leg_order_cross_allocation.py | 6 ++++-- .../openapi_package/models/multi_leg_order_leg.py | 2 +- openapi_project/openapi_package/models/option.py | 4 ++-- .../openapi_package/models/option_chain.py | 2 +- .../openapi_package/models/option_chain_option.py | 2 +- .../openapi_package/models/option_root.py | 2 +- openapi_project/openapi_package/models/order.py | 10 +++++----- .../models/order_cancel_replace_request.py | 8 +++++--- .../openapi_package/models/order_cross.py | 12 ++++++------ .../models/order_cross_allocation.py | 6 +++--- .../openapi_package/models/order_update.py | 6 +++--- .../openapi_package/models/order_update_event.py | 8 ++++---- .../openapi_package/models/position_analysis.py | 2 +- .../models/risk_radar_product_group.py | 2 +- .../openapi_package/models/risk_reject.py | 2 +- openapi_project/openapi_package/models/route.py | 2 +- .../openapi_package/models/route_property.py | 2 +- .../models/routing_session_group.py | 2 +- openapi_project/openapi_package/models/scenario.py | 2 +- openapi_project/openapi_package/models/security.py | 12 ++++++------ openapi_project/openapi_package/models/stock.py | 4 ++-- .../openapi_package/models/trade_confirm.py | 2 +- .../openapi_package/models/trading_firm.py | 2 +- .../openapi_package/models/trading_firm_slim.py | 2 +- .../openapi_package/models/trading_holiday.py | 2 +- .../openapi_package/models/trading_session.py | 2 +- .../models/trading_session_group.py | 2 +- openapi_project/openapi_package/models/user.py | 8 ++------ 54 files changed, 128 insertions(+), 119 deletions(-) diff --git a/fix_builtin_shadowing.py b/fix_builtin_shadowing.py index 9bf321b6e..cc41e74f7 100644 --- a/fix_builtin_shadowing.py +++ b/fix_builtin_shadowing.py @@ -52,9 +52,9 @@ def fix_builtin_shadowing_in_file(file_path: Path, write: bool = False) -> bool: content = re.sub(r"\bid\s+is\s+UNSET(?!_)", "id_ is UNSET", content) # Fix spacing issues that might have been created - content = re.sub(r"id_\s*=\s*self\.id", "id_ = self.id_", content) + content = re.sub(r"id_\s*=\s*self\.id\b(?!_)", "id_ = self.id_", content) content = re.sub(r'id_\s*=\s*d\.pop\("id"', 'id_ = d.pop("id"', content) - content = re.sub(r"id_\s*=\s*id,", "id_=id_,", content) + content = re.sub(r"id_\s*=\s*id\b(?!_)", "id_=id_", content) # Fix id in docstrings (e.g., id (Unset | int): -> id_ (Unset | int):) content = re.sub( @@ -66,7 +66,12 @@ def fix_builtin_shadowing_in_file(file_path: Path, write: bool = False) -> bool: # Fix trailing commas in import statements # Pattern: import SomeClass, followed by newline or whitespace - content = re.sub(r"import\s+([A-Za-z_][A-Za-z0-9_]*)\s*,\s*$", r"import \1", content, flags=re.MULTILINE) + content = re.sub( + r"import\s+([A-Za-z_][A-Za-z0-9_]*)\s*,\s*$", + r"import \1", + content, + flags=re.MULTILINE, + ) if content != original_content: if write: diff --git a/openapi_project/openapi_package/models/account.py b/openapi_project/openapi_package/models/account.py index 8ff1bc746..4f658eb65 100644 --- a/openapi_project/openapi_package/models/account.py +++ b/openapi_project/openapi_package/models/account.py @@ -88,7 +88,7 @@ class Account: clearing_script: Unset | AccountScript = UNSET def to_dict(self) -> dict[str, Any]: - id_ = self.id___ + id_ = self.id_ billing_code = self.billing_code diff --git a/openapi_project/openapi_package/models/cancel_order_request.py b/openapi_project/openapi_package/models/cancel_order_request.py index d7ecd182a..d912ab3ef 100644 --- a/openapi_project/openapi_package/models/cancel_order_request.py +++ b/openapi_project/openapi_package/models/cancel_order_request.py @@ -12,10 +12,8 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.cancel_order_request_optional_data import CancelOrderRequestOptionalData from openapi_project.openapi_package.models.order_instruction import OrderInstruction - - + from openapi_project.openapi_package.models.cancel_order_request_optional_data import CancelOrderRequestOptionalData T = TypeVar("T", bound="CancelOrderRequest") diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py index e358d80bf..dcc49bbe4 100644 --- a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py +++ b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py @@ -14,11 +14,11 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_market_condition import CancelReplaceMultiLegOrderRequestMarketCondition - from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_algo import CancelReplaceMultiLegOrderRequestAlgo - from openapi_project.openapi_package.models.order_instruction import OrderInstruction from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.order_instruction import OrderInstruction from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_optional_data import CancelReplaceMultiLegOrderRequestOptionalData + from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_algo import CancelReplaceMultiLegOrderRequestAlgo + from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_market_condition import CancelReplaceMultiLegOrderRequestMarketCondition T = TypeVar("T", bound="CancelReplaceMultiLegOrderRequest") diff --git a/openapi_project/openapi_package/models/cancel_replace_order_request.py b/openapi_project/openapi_package/models/cancel_replace_order_request.py index 651fc5022..36a3fc000 100644 --- a/openapi_project/openapi_package/models/cancel_replace_order_request.py +++ b/openapi_project/openapi_package/models/cancel_replace_order_request.py @@ -14,11 +14,13 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo - from openapi_project.openapi_package.models.cancel_replace_order_request_market_condition import CancelReplaceOrderRequestMarketCondition from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.clearing_info import ClearingInfo + from openapi_project.openapi_package.models.cancel_replace_order_request_market_condition import CancelReplaceOrderRequestMarketCondition from openapi_project.openapi_package.models.cancel_replace_order_request_optional_data import CancelReplaceOrderRequestOptionalData + from openapi_project.openapi_package.models.cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + + T = TypeVar("T", bound="CancelReplaceOrderRequest") diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py index 24359b3f5..a23c71e3d 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py @@ -13,10 +13,12 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.order_instruction import OrderInstruction from openapi_project.openapi_package.models.create_multi_leg_order_leg import CreateMultiLegOrderLeg + from openapi_project.openapi_package.models.order_instruction import OrderInstruction from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation_optional_data import CreateMultiLegOrderCrossAllocationOptionalData + from openapi_project.openapi_package.models.clearing_info import ClearingInfo + + T = TypeVar("T", bound="CreateMultiLegOrderCrossAllocation") diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py index c332930e7..4c68a0767 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py @@ -19,8 +19,8 @@ from openapi_project.openapi_package.models.order_instruction import OrderInstruction from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_market_condition import CreateMultiLegOrderCrossRequestMarketCondition from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_optional_data import CreateMultiLegOrderCrossRequestOptionalData - from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_algo import CreateMultiLegOrderCrossRequestAlgo from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation import CreateMultiLegOrderCrossAllocation + from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_algo import CreateMultiLegOrderCrossRequestAlgo T = TypeVar("T", bound="CreateMultiLegOrderCrossRequest") diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_leg.py b/openapi_project/openapi_package/models/create_multi_leg_order_leg.py index a8e1c351b..035ef6e5e 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_leg.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_leg.py @@ -14,9 +14,11 @@ from typing import cast if TYPE_CHECKING: + from openapi_project.openapi_package.models.create_multi_leg_order_leg_optional_data import CreateMultiLegOrderLegOptionalData from openapi_project.openapi_package.models.create_multi_leg_order_leg_market_condition import CreateMultiLegOrderLegMarketCondition from openapi_project.openapi_package.models.flex_option import FlexOption - from openapi_project.openapi_package.models.create_multi_leg_order_leg_optional_data import CreateMultiLegOrderLegOptionalData + + T = TypeVar("T", bound="CreateMultiLegOrderLeg") diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_request.py b/openapi_project/openapi_package/models/create_multi_leg_order_request.py index b26a5282b..29d2b97fc 100644 --- a/openapi_project/openapi_package/models/create_multi_leg_order_request.py +++ b/openapi_project/openapi_package/models/create_multi_leg_order_request.py @@ -15,12 +15,12 @@ from typing import cast if TYPE_CHECKING: + from openapi_project.openapi_package.models.order_instruction import OrderInstruction from openapi_project.openapi_package.models.create_multi_leg_order_request_optional_data import CreateMultiLegOrderRequestOptionalData from openapi_project.openapi_package.models.create_multi_leg_order_request_algo import CreateMultiLegOrderRequestAlgo - from openapi_project.openapi_package.models.order_instruction import OrderInstruction from openapi_project.openapi_package.models.create_multi_leg_order_request_market_condition import CreateMultiLegOrderRequestMarketCondition - from openapi_project.openapi_package.models.clearing_info import ClearingInfo from openapi_project.openapi_package.models.create_multi_leg_order_leg import CreateMultiLegOrderLeg + from openapi_project.openapi_package.models.clearing_info import ClearingInfo T = TypeVar("T", bound="CreateMultiLegOrderRequest") diff --git a/openapi_project/openapi_package/models/create_order_cross_allocation.py b/openapi_project/openapi_package/models/create_order_cross_allocation.py index ad6a648be..7c029274d 100644 --- a/openapi_project/openapi_package/models/create_order_cross_allocation.py +++ b/openapi_project/openapi_package/models/create_order_cross_allocation.py @@ -15,9 +15,9 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo from openapi_project.openapi_package.models.create_order_cross_allocation_optional_data import CreateOrderCrossAllocationOptionalData from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.clearing_info import ClearingInfo T = TypeVar("T", bound="CreateOrderCrossAllocation") diff --git a/openapi_project/openapi_package/models/create_order_cross_request.py b/openapi_project/openapi_package/models/create_order_cross_request.py index 5e9c33b45..25e6487a6 100644 --- a/openapi_project/openapi_package/models/create_order_cross_request.py +++ b/openapi_project/openapi_package/models/create_order_cross_request.py @@ -16,14 +16,12 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.create_order_cross_request_market_condition import CreateOrderCrossRequestMarketCondition from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.create_order_cross_request_optional_data import CreateOrderCrossRequestOptionalData - from openapi_project.openapi_package.models.flex_option import FlexOption from openapi_project.openapi_package.models.create_order_cross_allocation import CreateOrderCrossAllocation from openapi_project.openapi_package.models.create_order_cross_request_algo import CreateOrderCrossRequestAlgo - - + from openapi_project.openapi_package.models.flex_option import FlexOption + from openapi_project.openapi_package.models.create_order_cross_request_market_condition import CreateOrderCrossRequestMarketCondition + from openapi_project.openapi_package.models.create_order_cross_request_optional_data import CreateOrderCrossRequestOptionalData T = TypeVar("T", bound="CreateOrderCrossRequest") diff --git a/openapi_project/openapi_package/models/create_order_request.py b/openapi_project/openapi_package/models/create_order_request.py index 9364ff507..d50740a90 100644 --- a/openapi_project/openapi_package/models/create_order_request.py +++ b/openapi_project/openapi_package/models/create_order_request.py @@ -17,12 +17,12 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_instruction import OrderInstruction from openapi_project.openapi_package.models.create_order_request_market_condition import CreateOrderRequestMarketCondition - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.flex_option import FlexOption + from openapi_project.openapi_package.models.order_instruction import OrderInstruction from openapi_project.openapi_package.models.create_order_request_optional_data import CreateOrderRequestOptionalData from openapi_project.openapi_package.models.create_order_request_algo import CreateOrderRequestAlgo + from openapi_project.openapi_package.models.flex_option import FlexOption + from openapi_project.openapi_package.models.clearing_info import ClearingInfo T = TypeVar("T", bound="CreateOrderRequest") diff --git a/openapi_project/openapi_package/models/crypto.py b/openapi_project/openapi_package/models/crypto.py index f9b524e2a..6485c5f3e 100644 --- a/openapi_project/openapi_package/models/crypto.py +++ b/openapi_project/openapi_package/models/crypto.py @@ -16,8 +16,8 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.crypto_aliases import CryptoAliases from openapi_project.openapi_package.models.date import Date + from openapi_project.openapi_package.models.crypto_aliases import CryptoAliases T = TypeVar("T", bound="Crypto") @@ -91,7 +91,7 @@ def to_dict(self) -> dict[str, Any]: exchange_id = self.exchange_id - id_ = self.id___ + id_ = self.id_ multiplier = self.multiplier diff --git a/openapi_project/openapi_package/models/exchange.py b/openapi_project/openapi_package/models/exchange.py index a11ced036..ce815ccba 100644 --- a/openapi_project/openapi_package/models/exchange.py +++ b/openapi_project/openapi_package/models/exchange.py @@ -56,7 +56,7 @@ def to_dict(self) -> dict[str, Any]: display_name = self.display_name - id_ = self.id___ + id_ = self.id_ mic = self.mic diff --git a/openapi_project/openapi_package/models/execution.py b/openapi_project/openapi_package/models/execution.py index 73734b333..970b95ae1 100644 --- a/openapi_project/openapi_package/models/execution.py +++ b/openapi_project/openapi_package/models/execution.py @@ -21,12 +21,12 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.execution_algo import ExecutionAlgo - from openapi_project.openapi_package.models.execution_optional_data import ExecutionOptionalData from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.security import Security from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.execution_optional_data import ExecutionOptionalData + from openapi_project.openapi_package.models.execution_algo import ExecutionAlgo from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.security import Security T = TypeVar("T", bound="Execution") diff --git a/openapi_project/openapi_package/models/flex_option.py b/openapi_project/openapi_package/models/flex_option.py index 3962fdc71..8053990a3 100644 --- a/openapi_project/openapi_package/models/flex_option.py +++ b/openapi_project/openapi_package/models/flex_option.py @@ -121,7 +121,7 @@ def to_dict(self) -> dict[str, Any]: exchange_id = self.exchange_id - id_ = self.id___ + id_ = self.id_ multiplier = self.multiplier diff --git a/openapi_project/openapi_package/models/future.py b/openapi_project/openapi_package/models/future.py index 7b0b097cf..e57334762 100644 --- a/openapi_project/openapi_package/models/future.py +++ b/openapi_project/openapi_package/models/future.py @@ -102,7 +102,7 @@ def to_dict(self) -> dict[str, Any]: exchange_id = self.exchange_id - id_ = self.id___ + id_ = self.id_ multiplier = self.multiplier diff --git a/openapi_project/openapi_package/models/future_root.py b/openapi_project/openapi_package/models/future_root.py index bbf4854f5..37d5cb1d9 100644 --- a/openapi_project/openapi_package/models/future_root.py +++ b/openapi_project/openapi_package/models/future_root.py @@ -19,8 +19,8 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.future_root_aliases import FutureRootAliases from openapi_project.openapi_package.models.trading_session_group import TradingSessionGroup + from openapi_project.openapi_package.models.future_root_aliases import FutureRootAliases from openapi_project.openapi_package.models.date import Date @@ -105,7 +105,7 @@ def to_dict(self) -> dict[str, Any]: exchange_id = self.exchange_id - id_ = self.id___ + id_ = self.id_ multiplier = self.multiplier diff --git a/openapi_project/openapi_package/models/future_spread.py b/openapi_project/openapi_package/models/future_spread.py index 90d8e8836..62c0324b4 100644 --- a/openapi_project/openapi_package/models/future_spread.py +++ b/openapi_project/openapi_package/models/future_spread.py @@ -16,8 +16,8 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.future_spread_leg import FutureSpreadLeg from openapi_project.openapi_package.models.future_spread_aliases import FutureSpreadAliases + from openapi_project.openapi_package.models.future_spread_leg import FutureSpreadLeg from openapi_project.openapi_package.models.date import Date @@ -106,7 +106,7 @@ def to_dict(self) -> dict[str, Any]: exchange_id = self.exchange_id - id_ = self.id___ + id_ = self.id_ multiplier = self.multiplier diff --git a/openapi_project/openapi_package/models/fx.py b/openapi_project/openapi_package/models/fx.py index a40011061..233ffa33c 100644 --- a/openapi_project/openapi_package/models/fx.py +++ b/openapi_project/openapi_package/models/fx.py @@ -16,8 +16,8 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.fx_aliases import FxAliases from openapi_project.openapi_package.models.date import Date + from openapi_project.openapi_package.models.fx_aliases import FxAliases T = TypeVar("T", bound="Fx") @@ -91,7 +91,7 @@ def to_dict(self) -> dict[str, Any]: exchange_id = self.exchange_id - id_ = self.id___ + id_ = self.id_ multiplier = self.multiplier diff --git a/openapi_project/openapi_package/models/generic_order.py b/openapi_project/openapi_package/models/generic_order.py index ff0b3780d..64eb84072 100644 --- a/openapi_project/openapi_package/models/generic_order.py +++ b/openapi_project/openapi_package/models/generic_order.py @@ -12,10 +12,10 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.order import Order + from openapi_project.openapi_package.models.multi_leg_order import MultiLegOrder from openapi_project.openapi_package.models.order_cross import OrderCross + from openapi_project.openapi_package.models.order import Order from openapi_project.openapi_package.models.multi_leg_order_cross import MultiLegOrderCross - from openapi_project.openapi_package.models.multi_leg_order import MultiLegOrder T = TypeVar("T", bound="GenericOrder") diff --git a/openapi_project/openapi_package/models/index.py b/openapi_project/openapi_package/models/index.py index 960e47bb4..a109e1a59 100644 --- a/openapi_project/openapi_package/models/index.py +++ b/openapi_project/openapi_package/models/index.py @@ -89,7 +89,7 @@ def to_dict(self) -> dict[str, Any]: exchange_id = self.exchange_id - id_ = self.id___ + id_ = self.id_ multiplier = self.multiplier diff --git a/openapi_project/openapi_package/models/list_routes_response.py b/openapi_project/openapi_package/models/list_routes_response.py index a4b5b7ac5..70d5abb02 100644 --- a/openapi_project/openapi_package/models/list_routes_response.py +++ b/openapi_project/openapi_package/models/list_routes_response.py @@ -13,8 +13,8 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.route import Route from openapi_project.openapi_package.models.route_applicability import RouteApplicability + from openapi_project.openapi_package.models.route import Route T = TypeVar("T", bound="ListRoutesResponse") diff --git a/openapi_project/openapi_package/models/multi_leg_order.py b/openapi_project/openapi_package/models/multi_leg_order.py index 8875a0d4f..59a2043a8 100644 --- a/openapi_project/openapi_package/models/multi_leg_order.py +++ b/openapi_project/openapi_package/models/multi_leg_order.py @@ -17,14 +17,14 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.multi_leg_order_optional_data import MultiLegOrderOptionalData - from openapi_project.openapi_package.models.multi_leg_order_algo import MultiLegOrderAlgo - from openapi_project.openapi_package.models.multi_leg_order_leg import MultiLegOrderLeg + from openapi_project.openapi_package.models.multi_leg_order_market_condition import MultiLegOrderMarketCondition + from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent from openapi_project.openapi_package.models.order_instruction import OrderInstruction from openapi_project.openapi_package.models.header import Header - from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent + from openapi_project.openapi_package.models.multi_leg_order_optional_data import MultiLegOrderOptionalData + from openapi_project.openapi_package.models.multi_leg_order_leg import MultiLegOrderLeg + from openapi_project.openapi_package.models.multi_leg_order_algo import MultiLegOrderAlgo from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.multi_leg_order_market_condition import MultiLegOrderMarketCondition T = TypeVar("T", bound="MultiLegOrder") @@ -144,7 +144,7 @@ def to_dict(self) -> dict[str, Any]: UNSET if isinstance(self.header, Unset) else self.header.to_dict() ) - id_ = self.id___ + id_ = self.id_ incoming_cl_ord_id = self.incoming_cl_ord_id diff --git a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py index 9e9a68990..a42d3e14d 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py @@ -17,11 +17,11 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_optional_data import MultiLegOrderCancelReplaceRequestOptionalData - from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_market_condition import MultiLegOrderCancelReplaceRequestMarketCondition from openapi_project.openapi_package.models.order_instruction import OrderInstruction from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_algo import MultiLegOrderCancelReplaceRequestAlgo + from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_optional_data import MultiLegOrderCancelReplaceRequestOptionalData from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_market_condition import MultiLegOrderCancelReplaceRequestMarketCondition from openapi_project.openapi_package.models.clearing_info import ClearingInfo diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross.py b/openapi_project/openapi_package/models/multi_leg_order_cross.py index e79303cb4..f32046c2b 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross.py @@ -18,13 +18,15 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.multi_leg_order_cross_algo import MultiLegOrderCrossAlgo - from openapi_project.openapi_package.models.multi_leg_order_cross_optional_data import MultiLegOrderCrossOptionalData - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation - from openapi_project.openapi_package.models.header import Header from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent + from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.multi_leg_order_cross_optional_data import MultiLegOrderCrossOptionalData + from openapi_project.openapi_package.models.multi_leg_order_cross_algo import MultiLegOrderCrossAlgo from openapi_project.openapi_package.models.multi_leg_order_cross_market_condition import MultiLegOrderCrossMarketCondition + from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation + + T = TypeVar("T", bound="MultiLegOrderCross") @@ -129,7 +131,7 @@ def to_dict(self) -> dict[str, Any]: UNSET if isinstance(self.header, Unset) else self.header.to_dict() ) - id_ = self.id___ + id_ = self.id_ incoming_cl_ord_id = self.incoming_cl_ord_id diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py index 49c000c3b..1af9fb964 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py +++ b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py @@ -14,10 +14,12 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.multi_leg_order_leg import MultiLegOrderLeg from openapi_project.openapi_package.models.clearing_info import ClearingInfo from openapi_project.openapi_package.models.order_instruction import OrderInstruction from openapi_project.openapi_package.models.multi_leg_order_cross_allocation_optional_data import MultiLegOrderCrossAllocationOptionalData + from openapi_project.openapi_package.models.multi_leg_order_leg import MultiLegOrderLeg + + T = TypeVar("T", bound="MultiLegOrderCrossAllocation") @@ -73,7 +75,7 @@ def to_dict(self) -> dict[str, Any]: else self.clearing_info.to_dict() ) - id_ = self.id___ + id_ = self.id_ instructions: Unset | list[dict[str, Any]] = UNSET if not isinstance(self.instructions, Unset): diff --git a/openapi_project/openapi_package/models/multi_leg_order_leg.py b/openapi_project/openapi_package/models/multi_leg_order_leg.py index d21008296..af2db0cfd 100644 --- a/openapi_project/openapi_package/models/multi_leg_order_leg.py +++ b/openapi_project/openapi_package/models/multi_leg_order_leg.py @@ -65,7 +65,7 @@ class MultiLegOrderLeg: transact_ts: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - id_ = self.id___ + id_ = self.id_ market_condition: Unset | dict[str, Any] = ( UNSET diff --git a/openapi_project/openapi_package/models/option.py b/openapi_project/openapi_package/models/option.py index 9703f625e..70a69e1d1 100644 --- a/openapi_project/openapi_package/models/option.py +++ b/openapi_project/openapi_package/models/option.py @@ -19,8 +19,8 @@ if TYPE_CHECKING: from openapi_project.openapi_package.models.option_aliases import OptionAliases - from openapi_project.openapi_package.models.date import Date from openapi_project.openapi_package.models.option_root import OptionRoot + from openapi_project.openapi_package.models.date import Date T = TypeVar("T", bound="Option") @@ -108,7 +108,7 @@ def to_dict(self) -> dict[str, Any]: exchange_id = self.exchange_id - id_ = self.id___ + id_ = self.id_ multiplier = self.multiplier diff --git a/openapi_project/openapi_package/models/option_chain.py b/openapi_project/openapi_package/models/option_chain.py index bead52b54..d77daa0ff 100644 --- a/openapi_project/openapi_package/models/option_chain.py +++ b/openapi_project/openapi_package/models/option_chain.py @@ -12,9 +12,9 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.option_chain_roots import OptionChainRoots from openapi_project.openapi_package.models.option_chain_options import OptionChainOptions from openapi_project.openapi_package.models.security import Security + from openapi_project.openapi_package.models.option_chain_roots import OptionChainRoots from openapi_project.openapi_package.models.option_series import OptionSeries diff --git a/openapi_project/openapi_package/models/option_chain_option.py b/openapi_project/openapi_package/models/option_chain_option.py index ca7b644e9..e8a310a8f 100644 --- a/openapi_project/openapi_package/models/option_chain_option.py +++ b/openapi_project/openapi_package/models/option_chain_option.py @@ -73,7 +73,7 @@ def to_dict(self) -> dict[str, Any]: exchange_id = self.exchange_id - id_ = self.id___ + id_ = self.id_ tick_rule = self.tick_rule diff --git a/openapi_project/openapi_package/models/option_root.py b/openapi_project/openapi_package/models/option_root.py index b14666a68..73e8e7f0d 100644 --- a/openapi_project/openapi_package/models/option_root.py +++ b/openapi_project/openapi_package/models/option_root.py @@ -115,7 +115,7 @@ def to_dict(self) -> dict[str, Any]: exchange_id = self.exchange_id - id_ = self.id___ + id_ = self.id_ multiplier = self.multiplier diff --git a/openapi_project/openapi_package/models/order.py b/openapi_project/openapi_package/models/order.py index 3ae8cb1ea..ede301b16 100644 --- a/openapi_project/openapi_package/models/order.py +++ b/openapi_project/openapi_package/models/order.py @@ -19,14 +19,14 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_optional_data import OrderOptionalData + from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.order_market_condition import OrderMarketCondition + from openapi_project.openapi_package.models.security import Security from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.order_market_condition import OrderMarketCondition + from openapi_project.openapi_package.models.order_optional_data import OrderOptionalData from openapi_project.openapi_package.models.order_algo import OrderAlgo - from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.security import Security T = TypeVar("T", bound="Order") @@ -152,7 +152,7 @@ def to_dict(self) -> dict[str, Any]: UNSET if isinstance(self.header, Unset) else self.header.to_dict() ) - id_ = self.id___ + id_ = self.id_ incoming_cl_ord_id = self.incoming_cl_ord_id diff --git a/openapi_project/openapi_package/models/order_cancel_replace_request.py b/openapi_project/openapi_package/models/order_cancel_replace_request.py index b9b15513f..54ad04607 100644 --- a/openapi_project/openapi_package/models/order_cancel_replace_request.py +++ b/openapi_project/openapi_package/models/order_cancel_replace_request.py @@ -17,12 +17,14 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_cancel_replace_request_market_condition import OrderCancelReplaceRequestMarketCondition - from openapi_project.openapi_package.models.order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.order_cancel_replace_request_optional_data import OrderCancelReplaceRequestOptionalData + from openapi_project.openapi_package.models.order_cancel_replace_request_market_condition import OrderCancelReplaceRequestMarketCondition from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.order_cancel_replace_request_optional_data import OrderCancelReplaceRequestOptionalData + + T = TypeVar("T", bound="OrderCancelReplaceRequest") diff --git a/openapi_project/openapi_package/models/order_cross.py b/openapi_project/openapi_package/models/order_cross.py index 2de700740..ba9fc477c 100644 --- a/openapi_project/openapi_package/models/order_cross.py +++ b/openapi_project/openapi_package/models/order_cross.py @@ -18,14 +18,14 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_cross_allocation import OrderCrossAllocation - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.header import Header - from openapi_project.openapi_package.models.order_cross_algo import OrderCrossAlgo from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent + from openapi_project.openapi_package.models.order_instruction import OrderInstruction from openapi_project.openapi_package.models.order_cross_market_condition import OrderCrossMarketCondition - from openapi_project.openapi_package.models.security import Security from openapi_project.openapi_package.models.order_cross_optional_data import OrderCrossOptionalData + from openapi_project.openapi_package.models.security import Security + from openapi_project.openapi_package.models.order_cross_allocation import OrderCrossAllocation + from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.order_cross_algo import OrderCrossAlgo T = TypeVar("T", bound="OrderCross") @@ -136,7 +136,7 @@ def to_dict(self) -> dict[str, Any]: UNSET if isinstance(self.header, Unset) else self.header.to_dict() ) - id_ = self.id___ + id_ = self.id_ incoming_cl_ord_id = self.incoming_cl_ord_id diff --git a/openapi_project/openapi_package/models/order_cross_allocation.py b/openapi_project/openapi_package/models/order_cross_allocation.py index 7c9f6a4d4..7b512a3c2 100644 --- a/openapi_project/openapi_package/models/order_cross_allocation.py +++ b/openapi_project/openapi_package/models/order_cross_allocation.py @@ -16,9 +16,9 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.order_cross_allocation_optional_data import OrderCrossAllocationOptionalData from openapi_project.openapi_package.models.order_instruction import OrderInstruction + from openapi_project.openapi_package.models.order_cross_allocation_optional_data import OrderCrossAllocationOptionalData + from openapi_project.openapi_package.models.clearing_info import ClearingInfo T = TypeVar("T", bound="OrderCrossAllocation") @@ -76,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: else self.clearing_info.to_dict() ) - id_ = self.id___ + id_ = self.id_ incoming_ord_id = self.incoming_ord_id diff --git a/openapi_project/openapi_package/models/order_update.py b/openapi_project/openapi_package/models/order_update.py index 93a09af11..fe44f3d3c 100644 --- a/openapi_project/openapi_package/models/order_update.py +++ b/openapi_project/openapi_package/models/order_update.py @@ -21,12 +21,12 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_update_algo import OrderUpdateAlgo - from openapi_project.openapi_package.models.order_instruction import OrderInstruction from openapi_project.openapi_package.models.order_update_optional_data import OrderUpdateOptionalData + from openapi_project.openapi_package.models.security import Security + from openapi_project.openapi_package.models.order_instruction import OrderInstruction from openapi_project.openapi_package.models.header import Header + from openapi_project.openapi_package.models.order_update_algo import OrderUpdateAlgo from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.security import Security T = TypeVar("T", bound="OrderUpdate") diff --git a/openapi_project/openapi_package/models/order_update_event.py b/openapi_project/openapi_package/models/order_update_event.py index b190c5136..88afe5b3d 100644 --- a/openapi_project/openapi_package/models/order_update_event.py +++ b/openapi_project/openapi_package/models/order_update_event.py @@ -12,13 +12,13 @@ from typing import cast if TYPE_CHECKING: + from openapi_project.openapi_package.models.order_cancel_reject import OrderCancelReject + from openapi_project.openapi_package.models.order_cancel_request import OrderCancelRequest from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request import MultiLegOrderCancelReplaceRequest - from openapi_project.openapi_package.models.order_update import OrderUpdate + from openapi_project.openapi_package.models.order_delete import OrderDelete from openapi_project.openapi_package.models.execution import Execution - from openapi_project.openapi_package.models.order_cancel_reject import OrderCancelReject + from openapi_project.openapi_package.models.order_update import OrderUpdate from openapi_project.openapi_package.models.order_cancel_replace_request import OrderCancelReplaceRequest - from openapi_project.openapi_package.models.order_delete import OrderDelete - from openapi_project.openapi_package.models.order_cancel_request import OrderCancelRequest T = TypeVar("T", bound="OrderUpdateEvent") diff --git a/openapi_project/openapi_package/models/position_analysis.py b/openapi_project/openapi_package/models/position_analysis.py index 64f16f607..e6a2aa483 100644 --- a/openapi_project/openapi_package/models/position_analysis.py +++ b/openapi_project/openapi_package/models/position_analysis.py @@ -12,8 +12,8 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.position_theo import PositionTheo from openapi_project.openapi_package.models.scenario_theo import ScenarioTheo + from openapi_project.openapi_package.models.position_theo import PositionTheo T = TypeVar("T", bound="PositionAnalysis") diff --git a/openapi_project/openapi_package/models/risk_radar_product_group.py b/openapi_project/openapi_package/models/risk_radar_product_group.py index a6470cd00..01272726c 100644 --- a/openapi_project/openapi_package/models/risk_radar_product_group.py +++ b/openapi_project/openapi_package/models/risk_radar_product_group.py @@ -12,8 +12,8 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.shock_value import ShockValue from openapi_project.openapi_package.models.risk_radar_class_group import RiskRadarClassGroup + from openapi_project.openapi_package.models.shock_value import ShockValue T = TypeVar("T", bound="RiskRadarProductGroup") diff --git a/openapi_project/openapi_package/models/risk_reject.py b/openapi_project/openapi_package/models/risk_reject.py index 7fdc863a7..29f1db93a 100644 --- a/openapi_project/openapi_package/models/risk_reject.py +++ b/openapi_project/openapi_package/models/risk_reject.py @@ -48,7 +48,7 @@ def to_dict(self) -> dict[str, Any]: guid = self.guid - id_ = self.id___ + id_ = self.id_ is_overridden = self.is_overridden diff --git a/openapi_project/openapi_package/models/route.py b/openapi_project/openapi_package/models/route.py index 48eb17893..dcd9dfc87 100644 --- a/openapi_project/openapi_package/models/route.py +++ b/openapi_project/openapi_package/models/route.py @@ -52,7 +52,7 @@ class Route: venue: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - id_ = self.id___ + id_ = self.id_ algo_schema = self.algo_schema diff --git a/openapi_project/openapi_package/models/route_property.py b/openapi_project/openapi_package/models/route_property.py index aa7edcb19..3209bc386 100644 --- a/openapi_project/openapi_package/models/route_property.py +++ b/openapi_project/openapi_package/models/route_property.py @@ -29,7 +29,7 @@ class RouteProperty: value: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - id_ = self.id___ + id_ = self.id_ type_: Unset | str = ( UNSET if isinstance(self.type_, Unset) else self.type_.value diff --git a/openapi_project/openapi_package/models/routing_session_group.py b/openapi_project/openapi_package/models/routing_session_group.py index 21ec28871..cacd39f90 100644 --- a/openapi_project/openapi_package/models/routing_session_group.py +++ b/openapi_project/openapi_package/models/routing_session_group.py @@ -29,7 +29,7 @@ class RoutingSessionGroup: type_: Unset | RoutingSessionGroupType = UNSET def to_dict(self) -> dict[str, Any]: - id_ = self.id___ + id_ = self.id_ name = self.name diff --git a/openapi_project/openapi_package/models/scenario.py b/openapi_project/openapi_package/models/scenario.py index 88b211c95..1386436d5 100644 --- a/openapi_project/openapi_package/models/scenario.py +++ b/openapi_project/openapi_package/models/scenario.py @@ -12,8 +12,8 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.scenario_position import ScenarioPosition from openapi_project.openapi_package.models.scenario_leg import ScenarioLeg + from openapi_project.openapi_package.models.scenario_position import ScenarioPosition T = TypeVar("T", bound="Scenario") diff --git a/openapi_project/openapi_package/models/security.py b/openapi_project/openapi_package/models/security.py index def135952..30c99864d 100644 --- a/openapi_project/openapi_package/models/security.py +++ b/openapi_project/openapi_package/models/security.py @@ -12,16 +12,16 @@ from typing import cast if TYPE_CHECKING: + from openapi_project.openapi_package.models.option_root import OptionRoot + from openapi_project.openapi_package.models.future import Future from openapi_project.openapi_package.models.index import Index - from openapi_project.openapi_package.models.future_root import FutureRoot - from openapi_project.openapi_package.models.option import Option from openapi_project.openapi_package.models.stock import Stock - from openapi_project.openapi_package.models.future import Future + from openapi_project.openapi_package.models.future_root import FutureRoot from openapi_project.openapi_package.models.fx import Fx - from openapi_project.openapi_package.models.crypto import Crypto - from openapi_project.openapi_package.models.flex_option import FlexOption from openapi_project.openapi_package.models.future_spread import FutureSpread - from openapi_project.openapi_package.models.option_root import OptionRoot + from openapi_project.openapi_package.models.flex_option import FlexOption + from openapi_project.openapi_package.models.option import Option + from openapi_project.openapi_package.models.crypto import Crypto T = TypeVar("T", bound="Security") diff --git a/openapi_project/openapi_package/models/stock.py b/openapi_project/openapi_package/models/stock.py index b4d4aa24c..1cf6f8e21 100644 --- a/openapi_project/openapi_package/models/stock.py +++ b/openapi_project/openapi_package/models/stock.py @@ -16,8 +16,8 @@ from typing import cast if TYPE_CHECKING: - from openapi_project.openapi_package.models.stock_aliases import StockAliases from openapi_project.openapi_package.models.date import Date + from openapi_project.openapi_package.models.stock_aliases import StockAliases T = TypeVar("T", bound="Stock") @@ -97,7 +97,7 @@ def to_dict(self) -> dict[str, Any]: exchange_id = self.exchange_id - id_ = self.id___ + id_ = self.id_ multiplier = self.multiplier diff --git a/openapi_project/openapi_package/models/trade_confirm.py b/openapi_project/openapi_package/models/trade_confirm.py index 80943d2a8..4ff0fdd1a 100644 --- a/openapi_project/openapi_package/models/trade_confirm.py +++ b/openapi_project/openapi_package/models/trade_confirm.py @@ -296,7 +296,7 @@ def to_dict(self) -> dict[str, Any]: give_up = self.give_up - id_ = self.id___ + id_ = self.id_ incoming_cl_ord_id = self.incoming_cl_ord_id diff --git a/openapi_project/openapi_package/models/trading_firm.py b/openapi_project/openapi_package/models/trading_firm.py index d10a9995e..45909f3d1 100644 --- a/openapi_project/openapi_package/models/trading_firm.py +++ b/openapi_project/openapi_package/models/trading_firm.py @@ -30,7 +30,7 @@ class TradingFirm: occ_clearing_number: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - id_ = self.id___ + id_ = self.id_ eq_mpid = self.eq_mpid diff --git a/openapi_project/openapi_package/models/trading_firm_slim.py b/openapi_project/openapi_package/models/trading_firm_slim.py index f14222d56..f65ed9b8e 100644 --- a/openapi_project/openapi_package/models/trading_firm_slim.py +++ b/openapi_project/openapi_package/models/trading_firm_slim.py @@ -26,7 +26,7 @@ class TradingFirmSlim: name: Unset | str = UNSET def to_dict(self) -> dict[str, Any]: - id_ = self.id___ + id_ = self.id_ name = self.name diff --git a/openapi_project/openapi_package/models/trading_holiday.py b/openapi_project/openapi_package/models/trading_holiday.py index da5e93984..973e1df3b 100644 --- a/openapi_project/openapi_package/models/trading_holiday.py +++ b/openapi_project/openapi_package/models/trading_holiday.py @@ -37,7 +37,7 @@ class TradingHoliday: is_early_close: Unset | bool = UNSET def to_dict(self) -> dict[str, Any]: - id_ = self.id___ + id_ = self.id_ country: Unset | str = ( UNSET if isinstance(self.country, Unset) else self.country.value diff --git a/openapi_project/openapi_package/models/trading_session.py b/openapi_project/openapi_package/models/trading_session.py index 98cfe43d0..7017bef05 100644 --- a/openapi_project/openapi_package/models/trading_session.py +++ b/openapi_project/openapi_package/models/trading_session.py @@ -44,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: UNSET if isinstance(self.end_time, Unset) else self.end_time.to_dict() ) - id_ = self.id___ + id_ = self.id_ name = self.name diff --git a/openapi_project/openapi_package/models/trading_session_group.py b/openapi_project/openapi_package/models/trading_session_group.py index c5d1c46e4..7150fa503 100644 --- a/openapi_project/openapi_package/models/trading_session_group.py +++ b/openapi_project/openapi_package/models/trading_session_group.py @@ -32,7 +32,7 @@ class TradingSessionGroup: sessions: Unset | list[TradingSession] = UNSET def to_dict(self) -> dict[str, Any]: - id_ = self.id___ + id_ = self.id_ name = self.name diff --git a/openapi_project/openapi_package/models/user.py b/openapi_project/openapi_package/models/user.py index 825463449..04a303b4a 100644 --- a/openapi_project/openapi_package/models/user.py +++ b/openapi_project/openapi_package/models/user.py @@ -1,18 +1,14 @@ from __future__ import annotations from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator +from typing import TYPE_CHECKING, Any, BinaryIO, Generator, TextIO, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - from openapi_project.openapi_package.models.user_location import UserLocation from openapi_project.openapi_package.models.user_status import UserStatus from openapi_project.openapi_package.models.user_type import UserType from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast if TYPE_CHECKING: from openapi_project.openapi_package.models.user_permission import UserPermission @@ -73,7 +69,7 @@ def to_dict(self) -> dict[str, Any]: first_name = self.first_name - id_ = self.id___ + id_ = self.id_ is_locked_out = self.is_locked_out From 4d0b98f7651083132fccbe7e6d225cac001d0d23 Mon Sep 17 00:00:00 2001 From: Itay Bavly Date: Thu, 11 Sep 2025 11:02:24 -0400 Subject: [PATCH 12/16] preprocess td --- openapi/openapi.cleaned.yaml | 8323 +++++++++++++++++ openapi/openapiv3.yaml | 8260 ++++++++++++++++ openapi/preprocess_td.py | 108 + openapi_project/README.md | 2 +- openapi_project/openapi_package/__init__.py | 2 +- .../openapi_package/api/__init__.py | 2 +- .../api/application_service/__init__.py | 1 - .../post_application_login.py | 157 - .../openapi_package/api/index/__init__.py | 1 + .../api/index/index_at_time_price.py | 264 + .../api/index/index_history_eod.py | 241 + .../api/index/index_history_ohlc.py | 300 + .../api/index/index_history_price.py | 292 + .../api/index/index_list_dates.py | 210 + .../api/index/index_list_symbols.py | 196 + .../api/index/index_snapshot_ohlc.py | 214 + .../api/index/index_snapshot_price.py | 214 + .../openapi_package/api/option/__init__.py | 1 + .../api/option/option_at_time_quote.py | 309 + .../api/option/option_at_time_trade.py | 325 + .../api/option/option_history_eod.py | 318 + .../api/option/option_history_greeks_all.py | 401 + .../api/option/option_history_greeks_eod.py | 370 + .../option_history_greeks_first_order.py | 405 + ...ption_history_greeks_implied_volatility.py | 397 + .../option_history_greeks_second_order.py | 405 + .../option_history_greeks_third_order.py | 405 + .../api/option/option_history_ohlc.py | 325 + .../option/option_history_open_interest.py | 294 + .../api/option/option_history_quote.py | 325 + .../api/option/option_history_trade.py | 316 + .../option/option_history_trade_greeks_all.py | 376 + ...option_history_trade_greeks_first_order.py | 376 + ...history_trade_greeks_implied_volatility.py | 376 + ...ption_history_trade_greeks_second_order.py | 376 + ...option_history_trade_greeks_third_order.py | 376 + .../api/option/option_history_trade_quote.py | 343 + .../api/option/option_list_contracts.py | 260 + .../api/option/option_list_dates.py | 276 + .../api/option/option_list_expirations.py | 214 + .../api/option/option_list_strikes.py | 228 + .../api/option/option_list_symbols.py | 196 + .../api/option/option_snapshot_greeks_all.py | 349 + .../option_snapshot_greeks_first_order.py | 353 + ...tion_snapshot_greeks_implied_volatility.py | 345 + .../option_snapshot_greeks_second_order.py | 353 + .../option_snapshot_greeks_third_order.py | 353 + .../api/option/option_snapshot_ohlc.py | 262 + .../option/option_snapshot_open_interest.py | 286 + .../api/option/option_snapshot_quote.py | 274 + .../api/option/option_snapshot_trade.py | 270 + .../api/order_service/__init__.py | 1 - .../api/order_service/get_orders.py | 125 - .../order_service/get_orders_searchhistory.py | 248 - .../order_service/get_orders_tradeconfirms.py | 218 - .../order_service/post_orders_cancelorder.py | 157 - .../post_orders_createmultilegorder.py | 157 - .../post_orders_createmultilegordercross.py | 157 - .../order_service/post_orders_createorder.py | 157 - .../post_orders_createordercross.py | 157 - .../post_orders_replacemultilegorder.py | 157 - .../order_service/post_orders_replaceorder.py | 157 - ...orders_validaterisk_createmultilegorder.py | 157 - ...s_validaterisk_createmultilegordercross.py | 157 - .../post_orders_validaterisk_createorder.py | 157 - ...st_orders_validaterisk_createordercross.py | 157 - ...rders_validaterisk_replacemultilegorder.py | 157 - .../post_orders_validaterisk_replaceorder.py | 157 - .../api/portfolio_service/__init__.py | 1 - .../get_portfolio_positions.py | 203 - .../post_portfolio_analyzepositions.py | 157 - .../post_portfolio_calculatemargins.py | 157 - .../post_portfolio_riskradar.py | 157 - .../api/security_service/__init__.py | 1 - .../get_securities_exchanges.py | 125 - .../post_securities_easytoborrowsecurities.py | 157 - .../post_securities_flexoption.py | 157 - .../post_securities_optionchains.py | 157 - .../post_securities_securities.py | 157 - .../openapi_package/api/stock/__init__.py | 1 + .../api/stock/stock_at_time_quote.py | 314 + .../api/stock/stock_at_time_trade.py | 318 + .../api/stock/stock_history_eod.py | 265 + .../api/stock/stock_history_ohlc.py | 306 + .../api/stock/stock_history_quote.py | 302 + .../api/stock/stock_history_trade.py | 186 + .../api/stock/stock_history_trade_quote.py | 203 + .../api/stock/stock_list_dates.py | 224 + .../api/stock/stock_list_symbols.py | 196 + .../api/stock/stock_snapshot_ohlc.py | 260 + .../api/stock/stock_snapshot_quote.py | 256 + .../api/stock/stock_snapshot_trade.py | 252 + .../api/user_data_service/__init__.py | 1 - .../get_userdata_accounts.py | 125 - .../get_userdata_activeuser.py | 125 - .../get_userdata_affiliatedtradingfirms.py | 125 - .../get_userdata_p2paccounts.py | 125 - .../user_data_service/get_userdata_routes.py | 125 - .../get_userdata_tradingfirms.py | 125 - .../api/utility_service/__init__.py | 1 - .../utility_service/get_utility_serverinfo.py | 125 - .../utility_service/get_utility_servertime.py | 125 - .../get_utility_tradingholidays.py | 125 - openapi_project/openapi_package/client.py | 33 +- openapi_project/openapi_package/errors.py | 4 +- .../openapi_package/models/__init__.py | 844 +- .../openapi_package/models/account.py | 380 - .../openapi_package/models/account_script.py | 55 - .../openapi_package/models/account_status.py | 11 - .../openapi_package/models/account_type.py | 10 - .../models/analyze_position_item.py | 73 - .../models/analyze_positions_request.py | 140 - .../models/analyze_positions_response.py | 81 - .../models/calculate_margin_request.py | 122 - .../calculate_margin_request_position.py | 64 - .../calculate_margin_request_position_list.py | 69 - .../models/calculate_margin_response.py | 84 - .../models/cancel_order_request.py | 95 - .../cancel_order_request_optional_data.py | 68 - .../models/cancel_order_response.py | 79 - .../cancel_replace_multi_leg_order_request.py | 223 - ...el_replace_multi_leg_order_request_algo.py | 70 - ...ulti_leg_order_request_market_condition.py | 70 - ...e_multi_leg_order_request_optional_data.py | 70 - ...cancel_replace_multi_leg_order_response.py | 79 - .../models/cancel_replace_order_request.py | 205 - .../cancel_replace_order_request_algo.py | 68 - ..._replace_order_request_market_condition.py | 70 - ...cel_replace_order_request_optional_data.py | 70 - .../models/cancel_replace_order_response.py | 79 - .../openapi_package/models/capacity_code.py | 10 - .../openapi_package/models/claim_type.py | 11 - .../openapi_package/models/clearing_info.py | 224 - .../openapi_package/models/clearing_range.py | 21 - .../openapi_package/models/country.py | 14 - .../models/create_flex_option_request.py | 188 - .../models/create_flex_option_response.py | 81 - ...create_multi_leg_order_cross_allocation.py | 153 - ...eg_order_cross_allocation_optional_data.py | 70 - .../create_multi_leg_order_cross_request.py | 265 - ...eate_multi_leg_order_cross_request_algo.py | 70 - ...eg_order_cross_request_market_condition.py | 70 - ...i_leg_order_cross_request_optional_data.py | 70 - .../create_multi_leg_order_cross_response.py | 83 - .../models/create_multi_leg_order_leg.py | 152 - ...te_multi_leg_order_leg_market_condition.py | 70 - ...reate_multi_leg_order_leg_optional_data.py | 70 - .../models/create_multi_leg_order_request.py | 276 - .../create_multi_leg_order_request_algo.py | 70 - ...ulti_leg_order_request_market_condition.py | 70 - ...e_multi_leg_order_request_optional_data.py | 70 - .../models/create_multi_leg_order_response.py | 83 - .../models/create_order_cross_allocation.py | 161 - ...te_order_cross_allocation_optional_data.py | 70 - .../models/create_order_cross_request.py | 289 - .../models/create_order_cross_request_algo.py | 68 - ...te_order_cross_request_market_condition.py | 70 - ...reate_order_cross_request_optional_data.py | 70 - .../models/create_order_cross_response.py | 81 - .../models/create_order_request.py | 312 - .../models/create_order_request_algo.py | 68 - .../create_order_request_market_condition.py | 70 - .../create_order_request_optional_data.py | 68 - .../models/create_order_response.py | 79 - .../openapi_package/models/cross_side_type.py | 10 - .../openapi_package/models/cross_type.py | 20 - .../openapi_package/models/crypto.py | 290 - .../openapi_package/models/crypto_aliases.py | 68 - .../openapi_package/models/currency.py | 180 - .../models/cxl_rej_response_to.py | 14 - .../openapi_package/models/date.py | 64 - .../models/easy_to_borrow_security.py | 55 - .../openapi_package/models/empty.py | 29 - .../openapi_package/models/exchange.py | 163 - .../openapi_package/models/exchange_code.py | 72 - .../openapi_package/models/exec_type.py | 30 - .../openapi_package/models/execution.py | 624 -- .../openapi_package/models/execution_algo.py | 68 - .../models/execution_optional_data.py | 68 - .../openapi_package/models/flex_option.py | 450 - .../models/flex_option_aliases.py | 68 - .../models/flex_settlement_type.py | 12 - .../openapi_package/models/future.py | 370 - .../openapi_package/models/future_aliases.py | 68 - .../openapi_package/models/future_root.py | 366 - .../models/future_root_aliases.py | 68 - .../openapi_package/models/future_spread.py | 395 - .../models/future_spread_aliases.py | 68 - .../models/future_spread_leg.py | 114 - openapi_project/openapi_package/models/fx.py | 290 - .../openapi_package/models/fx_aliases.py | 68 - .../openapi_package/models/generic_order.py | 110 - .../models/get_active_user_response.py | 79 - .../models/get_server_info_response.py | 135 - ...et_server_info_response_system_settings.py | 70 - .../models/get_server_time_response.py | 70 - .../models/get_trading_holidays_response.py | 84 - .../openapi_package/models/header.py | 109 - .../openapi_package/models/index.py | 274 - .../openapi_package/models/index_aliases.py | 68 - .../models/index_at_time_price_format.py | 9 + .../index_at_time_price_response_200.py | 183 + .../models/index_history_eod_format.py | 9 + .../models/index_history_eod_response_200.py | 249 + .../models/index_history_ohlc_format.py | 9 + .../models/index_history_ohlc_interval.py | 21 + .../models/index_history_ohlc_response_200.py | 161 + .../models/index_history_price_format.py | 9 + .../models/index_history_price_interval.py | 21 + .../index_history_price_response_200.py | 95 + .../models/index_list_dates_format.py | 9 + .../models/index_list_dates_response_200.py | 95 + .../models/index_list_symbols_format.py | 9 + ....py => index_list_symbols_response_200.py} | 58 +- .../models/index_snapshot_ohlc_format.py | 9 + .../index_snapshot_ohlc_response_200.py | 161 + .../models/index_snapshot_price_format.py | 9 + .../index_snapshot_price_response_200.py | 106 + .../models/list_accounts_response.py | 84 - .../list_affiliated_trading_firms_response.py | 86 - .../list_easy_to_borrow_securities_request.py | 55 - ...list_easy_to_borrow_securities_response.py | 84 - .../models/list_exchanges_response.py | 84 - .../models/list_option_chains_repsonse.py | 84 - .../models/list_option_chains_request.py | 49 - .../models/list_orders_response.py | 84 - .../models/list_positions_response.py | 84 - .../models/list_routes_response.py | 106 - .../models/list_securities_request.py | 49 - .../models/list_securities_response.py | 84 - .../models/list_trade_confirms_response.py | 84 - .../models/list_trading_firms_response.py | 84 - .../openapi_package/models/login_request.py | 82 - .../openapi_package/models/login_response.py | 203 - .../models/login_response_system_settings.py | 68 - .../openapi_package/models/login_status.py | 19 - .../openapi_package/models/margin_data.py | 79 - .../models/margin_data_type.py | 10 - .../openapi_package/models/multi_leg_order.py | 532 -- .../models/multi_leg_order_algo.py | 68 - .../multi_leg_order_cancel_replace_request.py | 348 - ...i_leg_order_cancel_replace_request_algo.py | 70 - ...cancel_replace_request_market_condition.py | 70 - ...er_cancel_replace_request_optional_data.py | 70 - .../models/multi_leg_order_cross.py | 460 - .../models/multi_leg_order_cross_algo.py | 68 - .../multi_leg_order_cross_allocation.py | 256 - ...eg_order_cross_allocation_optional_data.py | 70 - .../multi_leg_order_cross_market_condition.py | 70 - .../multi_leg_order_cross_optional_data.py | 70 - .../models/multi_leg_order_leg.py | 249 - .../multi_leg_order_leg_market_condition.py | 70 - .../multi_leg_order_leg_optional_data.py | 68 - .../multi_leg_order_market_condition.py | 68 - .../models/multi_leg_order_optional_data.py | 68 - .../models/multi_leg_reporting_type.py | 10 - .../models/numeric_display_format.py | 32 - .../openapi_package/models/option.py | 395 - .../openapi_package/models/option_aliases.py | 68 - .../models/option_at_time_quote_format.py | 9 + .../option_at_time_quote_response_200.py | 216 + .../models/option_at_time_quote_right.py | 9 + .../models/option_at_time_trade_format.py | 9 + .../option_at_time_trade_response_200.py | 227 + .../models/option_at_time_trade_right.py | 9 + .../openapi_package/models/option_chain.py | 125 - .../models/option_chain_option.py | 220 - .../models/option_chain_option_aliases.py | 68 - .../models/option_chain_options.py | 68 - .../models/option_chain_roots.py | 68 - .../models/option_exercise_style.py | 11 - .../models/option_expiration_style.py | 19 - .../models/option_history_eod_format.py | 9 + .../models/option_history_eod_response_200.py | 293 + .../models/option_history_eod_right.py | 9 + .../option_history_greeks_all_format.py | 9 + .../option_history_greeks_all_interval.py | 21 + .../option_history_greeks_all_rate_type.py | 18 + .../option_history_greeks_all_response_200.py | 414 + .../models/option_history_greeks_all_right.py | 9 + .../option_history_greeks_eod_format.py | 9 + .../option_history_greeks_eod_rate_type.py | 18 + .../option_history_greeks_eod_response_200.py | 546 ++ .../models/option_history_greeks_eod_right.py | 9 + ...ption_history_greeks_first_order_format.py | 9 + ...ion_history_greeks_first_order_interval.py | 21 + ...on_history_greeks_first_order_rate_type.py | 18 + ...history_greeks_first_order_response_200.py | 260 + ...option_history_greeks_first_order_right.py | 9 + ...istory_greeks_implied_volatility_format.py | 9 + ...tory_greeks_implied_volatility_interval.py | 21 + ...ory_greeks_implied_volatility_rate_type.py | 18 + ..._greeks_implied_volatility_response_200.py | 227 + ...history_greeks_implied_volatility_right.py | 9 + ...tion_history_greeks_second_order_format.py | 9 + ...on_history_greeks_second_order_interval.py | 21 + ...n_history_greeks_second_order_rate_type.py | 18 + ...istory_greeks_second_order_response_200.py | 249 + ...ption_history_greeks_second_order_right.py | 9 + ...ption_history_greeks_third_order_format.py | 9 + ...ion_history_greeks_third_order_interval.py | 21 + ...on_history_greeks_third_order_rate_type.py | 18 + ...history_greeks_third_order_response_200.py | 238 + ...option_history_greeks_third_order_right.py | 9 + .../models/option_history_ohlc_format.py | 9 + .../models/option_history_ohlc_interval.py | 21 + .../option_history_ohlc_response_200.py | 205 + .../models/option_history_ohlc_right.py | 9 + .../option_history_open_interest_format.py | 9 + ...tion_history_open_interest_response_200.py | 139 + .../option_history_open_interest_right.py | 9 + .../models/option_history_quote_format.py | 9 + .../models/option_history_quote_interval.py | 21 + .../option_history_quote_response_200.py | 216 + .../models/option_history_quote_right.py | 9 + .../models/option_history_trade_format.py | 9 + .../option_history_trade_greeks_all_format.py | 9 + ...tion_history_trade_greeks_all_rate_type.py | 18 + ...n_history_trade_greeks_all_response_200.py | 491 + .../option_history_trade_greeks_all_right.py | 9 + ...history_trade_greeks_first_order_format.py | 9 + ...tory_trade_greeks_first_order_rate_type.py | 18 + ...y_trade_greeks_first_order_response_200.py | 337 + ..._history_trade_greeks_first_order_right.py | 9 + ..._trade_greeks_implied_volatility_format.py | 9 + ...ade_greeks_implied_volatility_rate_type.py | 18 + ..._greeks_implied_volatility_response_200.py | 271 + ...y_trade_greeks_implied_volatility_right.py | 9 + ...istory_trade_greeks_second_order_format.py | 9 + ...ory_trade_greeks_second_order_rate_type.py | 18 + ..._trade_greeks_second_order_response_200.py | 326 + ...history_trade_greeks_second_order_right.py | 9 + ...history_trade_greeks_third_order_format.py | 9 + ...tory_trade_greeks_third_order_rate_type.py | 18 + ...y_trade_greeks_third_order_response_200.py | 315 + ..._history_trade_greeks_third_order_right.py | 9 + .../option_history_trade_quote_format.py | 9 + ...option_history_trade_quote_response_200.py | 326 + .../option_history_trade_quote_right.py | 9 + .../option_history_trade_response_200.py | 227 + .../models/option_history_trade_right.py | 9 + .../models/option_list_contracts_format.py | 9 + .../option_list_contracts_request_type.py | 8 + .../option_list_contracts_response_200.py | 117 + .../models/option_list_dates_format.py | 9 + .../models/option_list_dates_request_type.py | 8 + .../models/option_list_dates_response_200.py | 128 + .../models/option_list_dates_right.py | 9 + .../models/option_list_expirations_format.py | 9 + .../option_list_expirations_response_200.py | 95 + .../models/option_list_strikes_format.py | 9 + .../option_list_strikes_response_200.py | 95 + .../models/option_list_symbols_format.py | 9 + .../option_list_symbols_response_200.py | 84 + .../openapi_package/models/option_root.py | 421 - .../models/option_root_aliases.py | 68 - .../openapi_package/models/option_series.py | 239 - .../models/option_series_product_type.py | 9 - .../models/option_series_type.py | 13 - .../models/option_settlement_type.py | 12 - .../option_snapshot_greeks_all_format.py | 9 + .../option_snapshot_greeks_all_rate_type.py | 18 + ...option_snapshot_greeks_all_response_200.py | 414 + .../option_snapshot_greeks_all_right.py | 9 + ...tion_snapshot_greeks_first_order_format.py | 9 + ...n_snapshot_greeks_first_order_rate_type.py | 18 + ...napshot_greeks_first_order_response_200.py | 260 + ...ption_snapshot_greeks_first_order_right.py | 9 + ...apshot_greeks_implied_volatility_format.py | 9 + ...hot_greeks_implied_volatility_rate_type.py | 18 + ..._greeks_implied_volatility_response_200.py | 194 + ...napshot_greeks_implied_volatility_right.py | 9 + ...ion_snapshot_greeks_second_order_format.py | 9 + ..._snapshot_greeks_second_order_rate_type.py | 18 + ...apshot_greeks_second_order_response_200.py | 249 + ...tion_snapshot_greeks_second_order_right.py | 9 + ...tion_snapshot_greeks_third_order_format.py | 9 + ...n_snapshot_greeks_third_order_rate_type.py | 18 + ...napshot_greeks_third_order_response_200.py | 238 + ...ption_snapshot_greeks_third_order_right.py | 9 + .../models/option_snapshot_ohlc_format.py | 9 + .../option_snapshot_ohlc_response_200.py | 194 + .../models/option_snapshot_ohlc_right.py | 9 + .../option_snapshot_open_interest_format.py | 9 + ...ion_snapshot_open_interest_response_200.py | 139 + .../option_snapshot_open_interest_right.py | 9 + .../models/option_snapshot_quote_format.py | 9 + .../option_snapshot_quote_response_200.py | 216 + .../models/option_snapshot_quote_right.py | 9 + .../models/option_snapshot_trade_format.py | 9 + .../option_snapshot_trade_response_200.py | 227 + .../models/option_snapshot_trade_right.py | 9 + .../openapi_package/models/ord_status.py | 30 - .../openapi_package/models/ord_type.py | 14 - .../openapi_package/models/order.py | 566 -- .../openapi_package/models/order_algo.py | 68 - .../models/order_cancel_reject.py | 193 - .../order_cancel_reject_optional_data.py | 68 - .../models/order_cancel_replace_request.py | 328 - .../order_cancel_replace_request_algo.py | 68 - ...cancel_replace_request_market_condition.py | 70 - ...er_cancel_replace_request_optional_data.py | 70 - .../models/order_cancel_request.py | 177 - .../order_cancel_request_optional_data.py | 68 - .../openapi_package/models/order_cross.py | 480 - .../models/order_cross_algo.py | 68 - .../models/order_cross_allocation.py | 257 - .../order_cross_allocation_optional_data.py | 70 - .../models/order_cross_market_condition.py | 68 - .../models/order_cross_optional_data.py | 68 - .../openapi_package/models/order_delete.py | 114 - .../models/order_delete_optional_data.py | 68 - .../models/order_instruction.py | 61 - .../models/order_instruction_type.py | 91 - .../models/order_market_condition.py | 68 - .../models/order_optional_data.py | 68 - .../openapi_package/models/order_type.py | 12 - .../openapi_package/models/order_update.py | 606 -- .../models/order_update_algo.py | 68 - .../models/order_update_event.py | 179 - .../models/order_update_optional_data.py | 68 - .../models/origination_type.py | 39 - .../openapi_package/models/position.py | 199 - .../models/position_analysis.py | 79 - .../openapi_package/models/position_effect.py | 11 - .../openapi_package/models/position_source.py | 9 - .../openapi_package/models/position_theo.py | 210 - .../models/position_theo_leg.py | 161 - .../openapi_package/models/price_type.py | 14 - .../openapi_package/models/product_group.py | 19 - .../models/product_sub_group.py | 8 - .../openapi_package/models/put_call.py | 10 - .../models/risk_calculation_type.py | 11 - .../openapi_package/models/risk_eval_mode.py | 9 - .../models/risk_radar_account_group.py | 115 - .../models/risk_radar_class_group.py | 181 - .../openapi_package/models/risk_radar_data.py | 71 - .../models/risk_radar_position.py | 186 - .../models/risk_radar_product_group.py | 107 - .../models/risk_radar_request.py | 198 - .../models/risk_radar_request_position.py | 64 - .../risk_radar_request_position_list.py | 69 - .../models/risk_radar_response.py | 79 - .../models/risk_radar_scenario_order.py | 9 - .../openapi_package/models/risk_reject.py | 143 - .../models/risk_reject_type.py | 120 - .../openapi_package/models/route.py | 174 - .../models/route_applicability.py | 121 - .../openapi_package/models/route_property.py | 70 - .../models/route_property_type.py | 19 - .../openapi_package/models/route_type.py | 16 - .../models/routing_session_group.py | 70 - .../models/routing_session_group_type.py | 15 - .../openapi_package/models/scenario.py | 86 - .../openapi_package/models/scenario_leg.py | 118 - .../models/scenario_position.py | 118 - .../openapi_package/models/scenario_theo.py | 78 - .../models/search_order_history_response.py | 84 - .../openapi_package/models/security.py | 198 - .../models/security_category.py | 39 - .../openapi_package/models/security_type.py | 19 - .../models/settlement_deliverable_type.py | 11 - .../openapi_package/models/settlement_info.py | 74 - .../openapi_package/models/shock_value.py | 100 - .../models/shock_value_flags.py | 64 - .../openapi_package/models/side.py | 13 - .../openapi_package/models/spread_leg_side.py | 10 - .../openapi_package/models/spread_leg_type.py | 10 - .../openapi_package/models/status.py | 78 - .../openapi_package/models/status_code.py | 19 - .../openapi_package/models/stock.py | 310 - .../openapi_package/models/stock_aliases.py | 68 - .../models/stock_at_time_quote_format.py | 9 + .../stock_at_time_quote_response_200.py | 172 + .../models/stock_at_time_quote_venue.py | 8 + .../models/stock_at_time_trade_format.py | 9 + .../stock_at_time_trade_response_200.py | 183 + .../models/stock_at_time_trade_venue.py | 8 + .../models/stock_history_eod_format.py | 9 + .../models/stock_history_eod_response_200.py | 249 + .../models/stock_history_ohlc_format.py | 9 + .../models/stock_history_ohlc_interval.py | 21 + .../models/stock_history_ohlc_response_200.py | 161 + .../models/stock_history_ohlc_venue.py | 8 + .../models/stock_history_quote_format.py | 9 + .../models/stock_history_quote_interval.py | 21 + .../stock_history_quote_response_200.py | 172 + .../models/stock_history_quote_venue.py | 8 + .../models/stock_history_trade_format.py | 9 + .../stock_history_trade_quote_format.py | 9 + .../models/stock_history_trade_quote_venue.py | 8 + .../models/stock_history_trade_venue.py | 8 + .../models/stock_list_dates_format.py | 9 + .../models/stock_list_dates_request_type.py | 8 + .../models/stock_list_dates_response_200.py | 95 + .../models/stock_list_symbols_format.py | 9 + .../models/stock_list_symbols_response_200.py | 84 + .../models/stock_snapshot_ohlc_format.py | 9 + .../stock_snapshot_ohlc_response_200.py | 161 + .../models/stock_snapshot_ohlc_venue.py | 8 + .../models/stock_snapshot_quote_format.py | 9 + .../stock_snapshot_quote_response_200.py | 183 + .../models/stock_snapshot_quote_venue.py | 8 + .../models/stock_snapshot_trade_format.py | 9 + .../stock_snapshot_trade_response_200.py | 139 + .../models/stock_snapshot_trade_venue.py | 8 + openapi_project/openapi_package/models/tif.py | 17 - .../openapi_package/models/time_of_day.py | 73 - .../models/tims_class_group.py | 206 - .../models/tims_margin_data.py | 221 - .../models/tims_position_group.py | 166 - .../models/tims_product_group.py | 184 - .../openapi_package/models/trade_confirm.py | 927 -- .../openapi_package/models/trading_firm.py | 73 - .../models/trading_firm_slim.py | 55 - .../openapi_package/models/trading_holiday.py | 97 - .../openapi_package/models/trading_session.py | 107 - .../models/trading_session_group.py | 78 - .../openapi_package/models/user.py | 236 - .../openapi_package/models/user_location.py | 10 - .../openapi_package/models/user_permission.py | 70 - .../openapi_package/models/user_status.py | 12 - .../openapi_package/models/user_type.py | 10 - .../models/validate_risk_response.py | 93 - .../models/volatility_shock_skew.py | 9 - .../models/volatility_shock_type.py | 9 - openapi_project/openapi_package/types.py | 12 +- 527 files changed, 45122 insertions(+), 33897 deletions(-) create mode 100644 openapi/openapi.cleaned.yaml create mode 100644 openapi/openapiv3.yaml create mode 100644 openapi/preprocess_td.py delete mode 100644 openapi_project/openapi_package/api/application_service/__init__.py delete mode 100644 openapi_project/openapi_package/api/application_service/post_application_login.py create mode 100644 openapi_project/openapi_package/api/index/__init__.py create mode 100644 openapi_project/openapi_package/api/index/index_at_time_price.py create mode 100644 openapi_project/openapi_package/api/index/index_history_eod.py create mode 100644 openapi_project/openapi_package/api/index/index_history_ohlc.py create mode 100644 openapi_project/openapi_package/api/index/index_history_price.py create mode 100644 openapi_project/openapi_package/api/index/index_list_dates.py create mode 100644 openapi_project/openapi_package/api/index/index_list_symbols.py create mode 100644 openapi_project/openapi_package/api/index/index_snapshot_ohlc.py create mode 100644 openapi_project/openapi_package/api/index/index_snapshot_price.py create mode 100644 openapi_project/openapi_package/api/option/__init__.py create mode 100644 openapi_project/openapi_package/api/option/option_at_time_quote.py create mode 100644 openapi_project/openapi_package/api/option/option_at_time_trade.py create mode 100644 openapi_project/openapi_package/api/option/option_history_eod.py create mode 100644 openapi_project/openapi_package/api/option/option_history_greeks_all.py create mode 100644 openapi_project/openapi_package/api/option/option_history_greeks_eod.py create mode 100644 openapi_project/openapi_package/api/option/option_history_greeks_first_order.py create mode 100644 openapi_project/openapi_package/api/option/option_history_greeks_implied_volatility.py create mode 100644 openapi_project/openapi_package/api/option/option_history_greeks_second_order.py create mode 100644 openapi_project/openapi_package/api/option/option_history_greeks_third_order.py create mode 100644 openapi_project/openapi_package/api/option/option_history_ohlc.py create mode 100644 openapi_project/openapi_package/api/option/option_history_open_interest.py create mode 100644 openapi_project/openapi_package/api/option/option_history_quote.py create mode 100644 openapi_project/openapi_package/api/option/option_history_trade.py create mode 100644 openapi_project/openapi_package/api/option/option_history_trade_greeks_all.py create mode 100644 openapi_project/openapi_package/api/option/option_history_trade_greeks_first_order.py create mode 100644 openapi_project/openapi_package/api/option/option_history_trade_greeks_implied_volatility.py create mode 100644 openapi_project/openapi_package/api/option/option_history_trade_greeks_second_order.py create mode 100644 openapi_project/openapi_package/api/option/option_history_trade_greeks_third_order.py create mode 100644 openapi_project/openapi_package/api/option/option_history_trade_quote.py create mode 100644 openapi_project/openapi_package/api/option/option_list_contracts.py create mode 100644 openapi_project/openapi_package/api/option/option_list_dates.py create mode 100644 openapi_project/openapi_package/api/option/option_list_expirations.py create mode 100644 openapi_project/openapi_package/api/option/option_list_strikes.py create mode 100644 openapi_project/openapi_package/api/option/option_list_symbols.py create mode 100644 openapi_project/openapi_package/api/option/option_snapshot_greeks_all.py create mode 100644 openapi_project/openapi_package/api/option/option_snapshot_greeks_first_order.py create mode 100644 openapi_project/openapi_package/api/option/option_snapshot_greeks_implied_volatility.py create mode 100644 openapi_project/openapi_package/api/option/option_snapshot_greeks_second_order.py create mode 100644 openapi_project/openapi_package/api/option/option_snapshot_greeks_third_order.py create mode 100644 openapi_project/openapi_package/api/option/option_snapshot_ohlc.py create mode 100644 openapi_project/openapi_package/api/option/option_snapshot_open_interest.py create mode 100644 openapi_project/openapi_package/api/option/option_snapshot_quote.py create mode 100644 openapi_project/openapi_package/api/option/option_snapshot_trade.py delete mode 100644 openapi_project/openapi_package/api/order_service/__init__.py delete mode 100644 openapi_project/openapi_package/api/order_service/get_orders.py delete mode 100644 openapi_project/openapi_package/api/order_service/get_orders_searchhistory.py delete mode 100644 openapi_project/openapi_package/api/order_service/get_orders_tradeconfirms.py delete mode 100644 openapi_project/openapi_package/api/order_service/post_orders_cancelorder.py delete mode 100644 openapi_project/openapi_package/api/order_service/post_orders_createmultilegorder.py delete mode 100644 openapi_project/openapi_package/api/order_service/post_orders_createmultilegordercross.py delete mode 100644 openapi_project/openapi_package/api/order_service/post_orders_createorder.py delete mode 100644 openapi_project/openapi_package/api/order_service/post_orders_createordercross.py delete mode 100644 openapi_project/openapi_package/api/order_service/post_orders_replacemultilegorder.py delete mode 100644 openapi_project/openapi_package/api/order_service/post_orders_replaceorder.py delete mode 100644 openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegorder.py delete mode 100644 openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegordercross.py delete mode 100644 openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createorder.py delete mode 100644 openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createordercross.py delete mode 100644 openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replacemultilegorder.py delete mode 100644 openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replaceorder.py delete mode 100644 openapi_project/openapi_package/api/portfolio_service/__init__.py delete mode 100644 openapi_project/openapi_package/api/portfolio_service/get_portfolio_positions.py delete mode 100644 openapi_project/openapi_package/api/portfolio_service/post_portfolio_analyzepositions.py delete mode 100644 openapi_project/openapi_package/api/portfolio_service/post_portfolio_calculatemargins.py delete mode 100644 openapi_project/openapi_package/api/portfolio_service/post_portfolio_riskradar.py delete mode 100644 openapi_project/openapi_package/api/security_service/__init__.py delete mode 100644 openapi_project/openapi_package/api/security_service/get_securities_exchanges.py delete mode 100644 openapi_project/openapi_package/api/security_service/post_securities_easytoborrowsecurities.py delete mode 100644 openapi_project/openapi_package/api/security_service/post_securities_flexoption.py delete mode 100644 openapi_project/openapi_package/api/security_service/post_securities_optionchains.py delete mode 100644 openapi_project/openapi_package/api/security_service/post_securities_securities.py create mode 100644 openapi_project/openapi_package/api/stock/__init__.py create mode 100644 openapi_project/openapi_package/api/stock/stock_at_time_quote.py create mode 100644 openapi_project/openapi_package/api/stock/stock_at_time_trade.py create mode 100644 openapi_project/openapi_package/api/stock/stock_history_eod.py create mode 100644 openapi_project/openapi_package/api/stock/stock_history_ohlc.py create mode 100644 openapi_project/openapi_package/api/stock/stock_history_quote.py create mode 100644 openapi_project/openapi_package/api/stock/stock_history_trade.py create mode 100644 openapi_project/openapi_package/api/stock/stock_history_trade_quote.py create mode 100644 openapi_project/openapi_package/api/stock/stock_list_dates.py create mode 100644 openapi_project/openapi_package/api/stock/stock_list_symbols.py create mode 100644 openapi_project/openapi_package/api/stock/stock_snapshot_ohlc.py create mode 100644 openapi_project/openapi_package/api/stock/stock_snapshot_quote.py create mode 100644 openapi_project/openapi_package/api/stock/stock_snapshot_trade.py delete mode 100644 openapi_project/openapi_package/api/user_data_service/__init__.py delete mode 100644 openapi_project/openapi_package/api/user_data_service/get_userdata_accounts.py delete mode 100644 openapi_project/openapi_package/api/user_data_service/get_userdata_activeuser.py delete mode 100644 openapi_project/openapi_package/api/user_data_service/get_userdata_affiliatedtradingfirms.py delete mode 100644 openapi_project/openapi_package/api/user_data_service/get_userdata_p2paccounts.py delete mode 100644 openapi_project/openapi_package/api/user_data_service/get_userdata_routes.py delete mode 100644 openapi_project/openapi_package/api/user_data_service/get_userdata_tradingfirms.py delete mode 100644 openapi_project/openapi_package/api/utility_service/__init__.py delete mode 100644 openapi_project/openapi_package/api/utility_service/get_utility_serverinfo.py delete mode 100644 openapi_project/openapi_package/api/utility_service/get_utility_servertime.py delete mode 100644 openapi_project/openapi_package/api/utility_service/get_utility_tradingholidays.py delete mode 100644 openapi_project/openapi_package/models/account.py delete mode 100644 openapi_project/openapi_package/models/account_script.py delete mode 100644 openapi_project/openapi_package/models/account_status.py delete mode 100644 openapi_project/openapi_package/models/account_type.py delete mode 100644 openapi_project/openapi_package/models/analyze_position_item.py delete mode 100644 openapi_project/openapi_package/models/analyze_positions_request.py delete mode 100644 openapi_project/openapi_package/models/analyze_positions_response.py delete mode 100644 openapi_project/openapi_package/models/calculate_margin_request.py delete mode 100644 openapi_project/openapi_package/models/calculate_margin_request_position.py delete mode 100644 openapi_project/openapi_package/models/calculate_margin_request_position_list.py delete mode 100644 openapi_project/openapi_package/models/calculate_margin_response.py delete mode 100644 openapi_project/openapi_package/models/cancel_order_request.py delete mode 100644 openapi_project/openapi_package/models/cancel_order_request_optional_data.py delete mode 100644 openapi_project/openapi_package/models/cancel_order_response.py delete mode 100644 openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py delete mode 100644 openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py delete mode 100644 openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py delete mode 100644 openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py delete mode 100644 openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py delete mode 100644 openapi_project/openapi_package/models/cancel_replace_order_request.py delete mode 100644 openapi_project/openapi_package/models/cancel_replace_order_request_algo.py delete mode 100644 openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py delete mode 100644 openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py delete mode 100644 openapi_project/openapi_package/models/cancel_replace_order_response.py delete mode 100644 openapi_project/openapi_package/models/capacity_code.py delete mode 100644 openapi_project/openapi_package/models/claim_type.py delete mode 100644 openapi_project/openapi_package/models/clearing_info.py delete mode 100644 openapi_project/openapi_package/models/clearing_range.py delete mode 100644 openapi_project/openapi_package/models/country.py delete mode 100644 openapi_project/openapi_package/models/create_flex_option_request.py delete mode 100644 openapi_project/openapi_package/models/create_flex_option_response.py delete mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py delete mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py delete mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py delete mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py delete mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py delete mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py delete mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py delete mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_leg.py delete mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py delete mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py delete mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_request.py delete mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py delete mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py delete mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py delete mode 100644 openapi_project/openapi_package/models/create_multi_leg_order_response.py delete mode 100644 openapi_project/openapi_package/models/create_order_cross_allocation.py delete mode 100644 openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py delete mode 100644 openapi_project/openapi_package/models/create_order_cross_request.py delete mode 100644 openapi_project/openapi_package/models/create_order_cross_request_algo.py delete mode 100644 openapi_project/openapi_package/models/create_order_cross_request_market_condition.py delete mode 100644 openapi_project/openapi_package/models/create_order_cross_request_optional_data.py delete mode 100644 openapi_project/openapi_package/models/create_order_cross_response.py delete mode 100644 openapi_project/openapi_package/models/create_order_request.py delete mode 100644 openapi_project/openapi_package/models/create_order_request_algo.py delete mode 100644 openapi_project/openapi_package/models/create_order_request_market_condition.py delete mode 100644 openapi_project/openapi_package/models/create_order_request_optional_data.py delete mode 100644 openapi_project/openapi_package/models/create_order_response.py delete mode 100644 openapi_project/openapi_package/models/cross_side_type.py delete mode 100644 openapi_project/openapi_package/models/cross_type.py delete mode 100644 openapi_project/openapi_package/models/crypto.py delete mode 100644 openapi_project/openapi_package/models/crypto_aliases.py delete mode 100644 openapi_project/openapi_package/models/currency.py delete mode 100644 openapi_project/openapi_package/models/cxl_rej_response_to.py delete mode 100644 openapi_project/openapi_package/models/date.py delete mode 100644 openapi_project/openapi_package/models/easy_to_borrow_security.py delete mode 100644 openapi_project/openapi_package/models/empty.py delete mode 100644 openapi_project/openapi_package/models/exchange.py delete mode 100644 openapi_project/openapi_package/models/exchange_code.py delete mode 100644 openapi_project/openapi_package/models/exec_type.py delete mode 100644 openapi_project/openapi_package/models/execution.py delete mode 100644 openapi_project/openapi_package/models/execution_algo.py delete mode 100644 openapi_project/openapi_package/models/execution_optional_data.py delete mode 100644 openapi_project/openapi_package/models/flex_option.py delete mode 100644 openapi_project/openapi_package/models/flex_option_aliases.py delete mode 100644 openapi_project/openapi_package/models/flex_settlement_type.py delete mode 100644 openapi_project/openapi_package/models/future.py delete mode 100644 openapi_project/openapi_package/models/future_aliases.py delete mode 100644 openapi_project/openapi_package/models/future_root.py delete mode 100644 openapi_project/openapi_package/models/future_root_aliases.py delete mode 100644 openapi_project/openapi_package/models/future_spread.py delete mode 100644 openapi_project/openapi_package/models/future_spread_aliases.py delete mode 100644 openapi_project/openapi_package/models/future_spread_leg.py delete mode 100644 openapi_project/openapi_package/models/fx.py delete mode 100644 openapi_project/openapi_package/models/fx_aliases.py delete mode 100644 openapi_project/openapi_package/models/generic_order.py delete mode 100644 openapi_project/openapi_package/models/get_active_user_response.py delete mode 100644 openapi_project/openapi_package/models/get_server_info_response.py delete mode 100644 openapi_project/openapi_package/models/get_server_info_response_system_settings.py delete mode 100644 openapi_project/openapi_package/models/get_server_time_response.py delete mode 100644 openapi_project/openapi_package/models/get_trading_holidays_response.py delete mode 100644 openapi_project/openapi_package/models/header.py delete mode 100644 openapi_project/openapi_package/models/index.py delete mode 100644 openapi_project/openapi_package/models/index_aliases.py create mode 100644 openapi_project/openapi_package/models/index_at_time_price_format.py create mode 100644 openapi_project/openapi_package/models/index_at_time_price_response_200.py create mode 100644 openapi_project/openapi_package/models/index_history_eod_format.py create mode 100644 openapi_project/openapi_package/models/index_history_eod_response_200.py create mode 100644 openapi_project/openapi_package/models/index_history_ohlc_format.py create mode 100644 openapi_project/openapi_package/models/index_history_ohlc_interval.py create mode 100644 openapi_project/openapi_package/models/index_history_ohlc_response_200.py create mode 100644 openapi_project/openapi_package/models/index_history_price_format.py create mode 100644 openapi_project/openapi_package/models/index_history_price_interval.py create mode 100644 openapi_project/openapi_package/models/index_history_price_response_200.py create mode 100644 openapi_project/openapi_package/models/index_list_dates_format.py create mode 100644 openapi_project/openapi_package/models/index_list_dates_response_200.py create mode 100644 openapi_project/openapi_package/models/index_list_symbols_format.py rename openapi_project/openapi_package/models/{any_model.py => index_list_symbols_response_200.py} (59%) create mode 100644 openapi_project/openapi_package/models/index_snapshot_ohlc_format.py create mode 100644 openapi_project/openapi_package/models/index_snapshot_ohlc_response_200.py create mode 100644 openapi_project/openapi_package/models/index_snapshot_price_format.py create mode 100644 openapi_project/openapi_package/models/index_snapshot_price_response_200.py delete mode 100644 openapi_project/openapi_package/models/list_accounts_response.py delete mode 100644 openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py delete mode 100644 openapi_project/openapi_package/models/list_easy_to_borrow_securities_request.py delete mode 100644 openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py delete mode 100644 openapi_project/openapi_package/models/list_exchanges_response.py delete mode 100644 openapi_project/openapi_package/models/list_option_chains_repsonse.py delete mode 100644 openapi_project/openapi_package/models/list_option_chains_request.py delete mode 100644 openapi_project/openapi_package/models/list_orders_response.py delete mode 100644 openapi_project/openapi_package/models/list_positions_response.py delete mode 100644 openapi_project/openapi_package/models/list_routes_response.py delete mode 100644 openapi_project/openapi_package/models/list_securities_request.py delete mode 100644 openapi_project/openapi_package/models/list_securities_response.py delete mode 100644 openapi_project/openapi_package/models/list_trade_confirms_response.py delete mode 100644 openapi_project/openapi_package/models/list_trading_firms_response.py delete mode 100644 openapi_project/openapi_package/models/login_request.py delete mode 100644 openapi_project/openapi_package/models/login_response.py delete mode 100644 openapi_project/openapi_package/models/login_response_system_settings.py delete mode 100644 openapi_project/openapi_package/models/login_status.py delete mode 100644 openapi_project/openapi_package/models/margin_data.py delete mode 100644 openapi_project/openapi_package/models/margin_data_type.py delete mode 100644 openapi_project/openapi_package/models/multi_leg_order.py delete mode 100644 openapi_project/openapi_package/models/multi_leg_order_algo.py delete mode 100644 openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py delete mode 100644 openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py delete mode 100644 openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py delete mode 100644 openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py delete mode 100644 openapi_project/openapi_package/models/multi_leg_order_cross.py delete mode 100644 openapi_project/openapi_package/models/multi_leg_order_cross_algo.py delete mode 100644 openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py delete mode 100644 openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py delete mode 100644 openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py delete mode 100644 openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py delete mode 100644 openapi_project/openapi_package/models/multi_leg_order_leg.py delete mode 100644 openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py delete mode 100644 openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py delete mode 100644 openapi_project/openapi_package/models/multi_leg_order_market_condition.py delete mode 100644 openapi_project/openapi_package/models/multi_leg_order_optional_data.py delete mode 100644 openapi_project/openapi_package/models/multi_leg_reporting_type.py delete mode 100644 openapi_project/openapi_package/models/numeric_display_format.py delete mode 100644 openapi_project/openapi_package/models/option.py delete mode 100644 openapi_project/openapi_package/models/option_aliases.py create mode 100644 openapi_project/openapi_package/models/option_at_time_quote_format.py create mode 100644 openapi_project/openapi_package/models/option_at_time_quote_response_200.py create mode 100644 openapi_project/openapi_package/models/option_at_time_quote_right.py create mode 100644 openapi_project/openapi_package/models/option_at_time_trade_format.py create mode 100644 openapi_project/openapi_package/models/option_at_time_trade_response_200.py create mode 100644 openapi_project/openapi_package/models/option_at_time_trade_right.py delete mode 100644 openapi_project/openapi_package/models/option_chain.py delete mode 100644 openapi_project/openapi_package/models/option_chain_option.py delete mode 100644 openapi_project/openapi_package/models/option_chain_option_aliases.py delete mode 100644 openapi_project/openapi_package/models/option_chain_options.py delete mode 100644 openapi_project/openapi_package/models/option_chain_roots.py delete mode 100644 openapi_project/openapi_package/models/option_exercise_style.py delete mode 100644 openapi_project/openapi_package/models/option_expiration_style.py create mode 100644 openapi_project/openapi_package/models/option_history_eod_format.py create mode 100644 openapi_project/openapi_package/models/option_history_eod_response_200.py create mode 100644 openapi_project/openapi_package/models/option_history_eod_right.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_all_format.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_all_interval.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_all_rate_type.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_all_response_200.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_all_right.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_eod_format.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_eod_rate_type.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_eod_response_200.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_eod_right.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_first_order_format.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_first_order_interval.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_first_order_rate_type.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_first_order_response_200.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_first_order_right.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_implied_volatility_format.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_implied_volatility_interval.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_implied_volatility_rate_type.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_implied_volatility_response_200.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_implied_volatility_right.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_second_order_format.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_second_order_interval.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_second_order_rate_type.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_second_order_response_200.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_second_order_right.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_third_order_format.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_third_order_interval.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_third_order_rate_type.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_third_order_response_200.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_third_order_right.py create mode 100644 openapi_project/openapi_package/models/option_history_ohlc_format.py create mode 100644 openapi_project/openapi_package/models/option_history_ohlc_interval.py create mode 100644 openapi_project/openapi_package/models/option_history_ohlc_response_200.py create mode 100644 openapi_project/openapi_package/models/option_history_ohlc_right.py create mode 100644 openapi_project/openapi_package/models/option_history_open_interest_format.py create mode 100644 openapi_project/openapi_package/models/option_history_open_interest_response_200.py create mode 100644 openapi_project/openapi_package/models/option_history_open_interest_right.py create mode 100644 openapi_project/openapi_package/models/option_history_quote_format.py create mode 100644 openapi_project/openapi_package/models/option_history_quote_interval.py create mode 100644 openapi_project/openapi_package/models/option_history_quote_response_200.py create mode 100644 openapi_project/openapi_package/models/option_history_quote_right.py create mode 100644 openapi_project/openapi_package/models/option_history_trade_format.py create mode 100644 openapi_project/openapi_package/models/option_history_trade_greeks_all_format.py create mode 100644 openapi_project/openapi_package/models/option_history_trade_greeks_all_rate_type.py create mode 100644 openapi_project/openapi_package/models/option_history_trade_greeks_all_response_200.py create mode 100644 openapi_project/openapi_package/models/option_history_trade_greeks_all_right.py create mode 100644 openapi_project/openapi_package/models/option_history_trade_greeks_first_order_format.py create mode 100644 openapi_project/openapi_package/models/option_history_trade_greeks_first_order_rate_type.py create mode 100644 openapi_project/openapi_package/models/option_history_trade_greeks_first_order_response_200.py create mode 100644 openapi_project/openapi_package/models/option_history_trade_greeks_first_order_right.py create mode 100644 openapi_project/openapi_package/models/option_history_trade_greeks_implied_volatility_format.py create mode 100644 openapi_project/openapi_package/models/option_history_trade_greeks_implied_volatility_rate_type.py create mode 100644 openapi_project/openapi_package/models/option_history_trade_greeks_implied_volatility_response_200.py create mode 100644 openapi_project/openapi_package/models/option_history_trade_greeks_implied_volatility_right.py create mode 100644 openapi_project/openapi_package/models/option_history_trade_greeks_second_order_format.py create mode 100644 openapi_project/openapi_package/models/option_history_trade_greeks_second_order_rate_type.py create mode 100644 openapi_project/openapi_package/models/option_history_trade_greeks_second_order_response_200.py create mode 100644 openapi_project/openapi_package/models/option_history_trade_greeks_second_order_right.py create mode 100644 openapi_project/openapi_package/models/option_history_trade_greeks_third_order_format.py create mode 100644 openapi_project/openapi_package/models/option_history_trade_greeks_third_order_rate_type.py create mode 100644 openapi_project/openapi_package/models/option_history_trade_greeks_third_order_response_200.py create mode 100644 openapi_project/openapi_package/models/option_history_trade_greeks_third_order_right.py create mode 100644 openapi_project/openapi_package/models/option_history_trade_quote_format.py create mode 100644 openapi_project/openapi_package/models/option_history_trade_quote_response_200.py create mode 100644 openapi_project/openapi_package/models/option_history_trade_quote_right.py create mode 100644 openapi_project/openapi_package/models/option_history_trade_response_200.py create mode 100644 openapi_project/openapi_package/models/option_history_trade_right.py create mode 100644 openapi_project/openapi_package/models/option_list_contracts_format.py create mode 100644 openapi_project/openapi_package/models/option_list_contracts_request_type.py create mode 100644 openapi_project/openapi_package/models/option_list_contracts_response_200.py create mode 100644 openapi_project/openapi_package/models/option_list_dates_format.py create mode 100644 openapi_project/openapi_package/models/option_list_dates_request_type.py create mode 100644 openapi_project/openapi_package/models/option_list_dates_response_200.py create mode 100644 openapi_project/openapi_package/models/option_list_dates_right.py create mode 100644 openapi_project/openapi_package/models/option_list_expirations_format.py create mode 100644 openapi_project/openapi_package/models/option_list_expirations_response_200.py create mode 100644 openapi_project/openapi_package/models/option_list_strikes_format.py create mode 100644 openapi_project/openapi_package/models/option_list_strikes_response_200.py create mode 100644 openapi_project/openapi_package/models/option_list_symbols_format.py create mode 100644 openapi_project/openapi_package/models/option_list_symbols_response_200.py delete mode 100644 openapi_project/openapi_package/models/option_root.py delete mode 100644 openapi_project/openapi_package/models/option_root_aliases.py delete mode 100644 openapi_project/openapi_package/models/option_series.py delete mode 100644 openapi_project/openapi_package/models/option_series_product_type.py delete mode 100644 openapi_project/openapi_package/models/option_series_type.py delete mode 100644 openapi_project/openapi_package/models/option_settlement_type.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_greeks_all_format.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_greeks_all_rate_type.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_greeks_all_response_200.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_greeks_all_right.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_greeks_first_order_format.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_greeks_first_order_rate_type.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_greeks_first_order_response_200.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_greeks_first_order_right.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_greeks_implied_volatility_format.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_greeks_implied_volatility_rate_type.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_greeks_implied_volatility_response_200.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_greeks_implied_volatility_right.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_greeks_second_order_format.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_greeks_second_order_rate_type.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_greeks_second_order_response_200.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_greeks_second_order_right.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_greeks_third_order_format.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_greeks_third_order_rate_type.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_greeks_third_order_response_200.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_greeks_third_order_right.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_ohlc_format.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_ohlc_response_200.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_ohlc_right.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_open_interest_format.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_open_interest_response_200.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_open_interest_right.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_quote_format.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_quote_response_200.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_quote_right.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_trade_format.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_trade_response_200.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_trade_right.py delete mode 100644 openapi_project/openapi_package/models/ord_status.py delete mode 100644 openapi_project/openapi_package/models/ord_type.py delete mode 100644 openapi_project/openapi_package/models/order.py delete mode 100644 openapi_project/openapi_package/models/order_algo.py delete mode 100644 openapi_project/openapi_package/models/order_cancel_reject.py delete mode 100644 openapi_project/openapi_package/models/order_cancel_reject_optional_data.py delete mode 100644 openapi_project/openapi_package/models/order_cancel_replace_request.py delete mode 100644 openapi_project/openapi_package/models/order_cancel_replace_request_algo.py delete mode 100644 openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py delete mode 100644 openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py delete mode 100644 openapi_project/openapi_package/models/order_cancel_request.py delete mode 100644 openapi_project/openapi_package/models/order_cancel_request_optional_data.py delete mode 100644 openapi_project/openapi_package/models/order_cross.py delete mode 100644 openapi_project/openapi_package/models/order_cross_algo.py delete mode 100644 openapi_project/openapi_package/models/order_cross_allocation.py delete mode 100644 openapi_project/openapi_package/models/order_cross_allocation_optional_data.py delete mode 100644 openapi_project/openapi_package/models/order_cross_market_condition.py delete mode 100644 openapi_project/openapi_package/models/order_cross_optional_data.py delete mode 100644 openapi_project/openapi_package/models/order_delete.py delete mode 100644 openapi_project/openapi_package/models/order_delete_optional_data.py delete mode 100644 openapi_project/openapi_package/models/order_instruction.py delete mode 100644 openapi_project/openapi_package/models/order_instruction_type.py delete mode 100644 openapi_project/openapi_package/models/order_market_condition.py delete mode 100644 openapi_project/openapi_package/models/order_optional_data.py delete mode 100644 openapi_project/openapi_package/models/order_type.py delete mode 100644 openapi_project/openapi_package/models/order_update.py delete mode 100644 openapi_project/openapi_package/models/order_update_algo.py delete mode 100644 openapi_project/openapi_package/models/order_update_event.py delete mode 100644 openapi_project/openapi_package/models/order_update_optional_data.py delete mode 100644 openapi_project/openapi_package/models/origination_type.py delete mode 100644 openapi_project/openapi_package/models/position.py delete mode 100644 openapi_project/openapi_package/models/position_analysis.py delete mode 100644 openapi_project/openapi_package/models/position_effect.py delete mode 100644 openapi_project/openapi_package/models/position_source.py delete mode 100644 openapi_project/openapi_package/models/position_theo.py delete mode 100644 openapi_project/openapi_package/models/position_theo_leg.py delete mode 100644 openapi_project/openapi_package/models/price_type.py delete mode 100644 openapi_project/openapi_package/models/product_group.py delete mode 100644 openapi_project/openapi_package/models/product_sub_group.py delete mode 100644 openapi_project/openapi_package/models/put_call.py delete mode 100644 openapi_project/openapi_package/models/risk_calculation_type.py delete mode 100644 openapi_project/openapi_package/models/risk_eval_mode.py delete mode 100644 openapi_project/openapi_package/models/risk_radar_account_group.py delete mode 100644 openapi_project/openapi_package/models/risk_radar_class_group.py delete mode 100644 openapi_project/openapi_package/models/risk_radar_data.py delete mode 100644 openapi_project/openapi_package/models/risk_radar_position.py delete mode 100644 openapi_project/openapi_package/models/risk_radar_product_group.py delete mode 100644 openapi_project/openapi_package/models/risk_radar_request.py delete mode 100644 openapi_project/openapi_package/models/risk_radar_request_position.py delete mode 100644 openapi_project/openapi_package/models/risk_radar_request_position_list.py delete mode 100644 openapi_project/openapi_package/models/risk_radar_response.py delete mode 100644 openapi_project/openapi_package/models/risk_radar_scenario_order.py delete mode 100644 openapi_project/openapi_package/models/risk_reject.py delete mode 100644 openapi_project/openapi_package/models/risk_reject_type.py delete mode 100644 openapi_project/openapi_package/models/route.py delete mode 100644 openapi_project/openapi_package/models/route_applicability.py delete mode 100644 openapi_project/openapi_package/models/route_property.py delete mode 100644 openapi_project/openapi_package/models/route_property_type.py delete mode 100644 openapi_project/openapi_package/models/route_type.py delete mode 100644 openapi_project/openapi_package/models/routing_session_group.py delete mode 100644 openapi_project/openapi_package/models/routing_session_group_type.py delete mode 100644 openapi_project/openapi_package/models/scenario.py delete mode 100644 openapi_project/openapi_package/models/scenario_leg.py delete mode 100644 openapi_project/openapi_package/models/scenario_position.py delete mode 100644 openapi_project/openapi_package/models/scenario_theo.py delete mode 100644 openapi_project/openapi_package/models/search_order_history_response.py delete mode 100644 openapi_project/openapi_package/models/security.py delete mode 100644 openapi_project/openapi_package/models/security_category.py delete mode 100644 openapi_project/openapi_package/models/security_type.py delete mode 100644 openapi_project/openapi_package/models/settlement_deliverable_type.py delete mode 100644 openapi_project/openapi_package/models/settlement_info.py delete mode 100644 openapi_project/openapi_package/models/shock_value.py delete mode 100644 openapi_project/openapi_package/models/shock_value_flags.py delete mode 100644 openapi_project/openapi_package/models/side.py delete mode 100644 openapi_project/openapi_package/models/spread_leg_side.py delete mode 100644 openapi_project/openapi_package/models/spread_leg_type.py delete mode 100644 openapi_project/openapi_package/models/status.py delete mode 100644 openapi_project/openapi_package/models/status_code.py delete mode 100644 openapi_project/openapi_package/models/stock.py delete mode 100644 openapi_project/openapi_package/models/stock_aliases.py create mode 100644 openapi_project/openapi_package/models/stock_at_time_quote_format.py create mode 100644 openapi_project/openapi_package/models/stock_at_time_quote_response_200.py create mode 100644 openapi_project/openapi_package/models/stock_at_time_quote_venue.py create mode 100644 openapi_project/openapi_package/models/stock_at_time_trade_format.py create mode 100644 openapi_project/openapi_package/models/stock_at_time_trade_response_200.py create mode 100644 openapi_project/openapi_package/models/stock_at_time_trade_venue.py create mode 100644 openapi_project/openapi_package/models/stock_history_eod_format.py create mode 100644 openapi_project/openapi_package/models/stock_history_eod_response_200.py create mode 100644 openapi_project/openapi_package/models/stock_history_ohlc_format.py create mode 100644 openapi_project/openapi_package/models/stock_history_ohlc_interval.py create mode 100644 openapi_project/openapi_package/models/stock_history_ohlc_response_200.py create mode 100644 openapi_project/openapi_package/models/stock_history_ohlc_venue.py create mode 100644 openapi_project/openapi_package/models/stock_history_quote_format.py create mode 100644 openapi_project/openapi_package/models/stock_history_quote_interval.py create mode 100644 openapi_project/openapi_package/models/stock_history_quote_response_200.py create mode 100644 openapi_project/openapi_package/models/stock_history_quote_venue.py create mode 100644 openapi_project/openapi_package/models/stock_history_trade_format.py create mode 100644 openapi_project/openapi_package/models/stock_history_trade_quote_format.py create mode 100644 openapi_project/openapi_package/models/stock_history_trade_quote_venue.py create mode 100644 openapi_project/openapi_package/models/stock_history_trade_venue.py create mode 100644 openapi_project/openapi_package/models/stock_list_dates_format.py create mode 100644 openapi_project/openapi_package/models/stock_list_dates_request_type.py create mode 100644 openapi_project/openapi_package/models/stock_list_dates_response_200.py create mode 100644 openapi_project/openapi_package/models/stock_list_symbols_format.py create mode 100644 openapi_project/openapi_package/models/stock_list_symbols_response_200.py create mode 100644 openapi_project/openapi_package/models/stock_snapshot_ohlc_format.py create mode 100644 openapi_project/openapi_package/models/stock_snapshot_ohlc_response_200.py create mode 100644 openapi_project/openapi_package/models/stock_snapshot_ohlc_venue.py create mode 100644 openapi_project/openapi_package/models/stock_snapshot_quote_format.py create mode 100644 openapi_project/openapi_package/models/stock_snapshot_quote_response_200.py create mode 100644 openapi_project/openapi_package/models/stock_snapshot_quote_venue.py create mode 100644 openapi_project/openapi_package/models/stock_snapshot_trade_format.py create mode 100644 openapi_project/openapi_package/models/stock_snapshot_trade_response_200.py create mode 100644 openapi_project/openapi_package/models/stock_snapshot_trade_venue.py delete mode 100644 openapi_project/openapi_package/models/tif.py delete mode 100644 openapi_project/openapi_package/models/time_of_day.py delete mode 100644 openapi_project/openapi_package/models/tims_class_group.py delete mode 100644 openapi_project/openapi_package/models/tims_margin_data.py delete mode 100644 openapi_project/openapi_package/models/tims_position_group.py delete mode 100644 openapi_project/openapi_package/models/tims_product_group.py delete mode 100644 openapi_project/openapi_package/models/trade_confirm.py delete mode 100644 openapi_project/openapi_package/models/trading_firm.py delete mode 100644 openapi_project/openapi_package/models/trading_firm_slim.py delete mode 100644 openapi_project/openapi_package/models/trading_holiday.py delete mode 100644 openapi_project/openapi_package/models/trading_session.py delete mode 100644 openapi_project/openapi_package/models/trading_session_group.py delete mode 100644 openapi_project/openapi_package/models/user.py delete mode 100644 openapi_project/openapi_package/models/user_location.py delete mode 100644 openapi_project/openapi_package/models/user_permission.py delete mode 100644 openapi_project/openapi_package/models/user_status.py delete mode 100644 openapi_project/openapi_package/models/user_type.py delete mode 100644 openapi_project/openapi_package/models/validate_risk_response.py delete mode 100644 openapi_project/openapi_package/models/volatility_shock_skew.py delete mode 100644 openapi_project/openapi_package/models/volatility_shock_type.py diff --git a/openapi/openapi.cleaned.yaml b/openapi/openapi.cleaned.yaml new file mode 100644 index 000000000..dbc16d4b8 --- /dev/null +++ b/openapi/openapi.cleaned.yaml @@ -0,0 +1,8323 @@ +openapi: 3.1.0 + +info: + title: Theta Data v3 + description: Real-time and historic stock, options, and index data! + version: 3.0.0 + x-java-package: net.thetadata.generated + +servers: +- url: 'https://localhost:25503/v3' + description: dev + +security: [] + + +paths: +# +# STOCK ENDPOINTS +# + /stock/list/symbols: + x-min-subscription: free + get: + summary: Symbols + operationId: stock_list_symbols + tags: + - Stock + - List + description: | + A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also include: root, ticker, and underlying. This endpoint returns all traded symbols for stocks. This endpoint is updated overnight. + x-sample-urls: + - url: http://localhost:25503/v3/stock/list/symbols + description: "List all stock symbols" + parameters: + - $ref: "#/components/parameters/format" + responses: + '200': + description: List all stock symbols + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + required: + - symbol + example: + symbol: + - A + - AA + - AAA + - AAAA + - AAAP + /stock/list/dates/{request_type}: + x-min-subscription: free + get: + summary: Dates + operationId: stock_list_dates + tags: + - Stock + - List + description: | + Lists all dates of data that are available for a stock with a given request type and symbol. This endpoint is updated overnight. + x-sample-urls: + - url: http://localhost:25503/v3/stock/list/dates/quote?symbol=AAPL + description: "List all dates for a stock quote for a given symbol" + - url: http://localhost:25503/v3/stock/list/dates/trade?symbol=AAPL,SPY + description: "List all dates for a stock trade for multiple symbols" + - url: http://localhost:25503/v3/stock/list/dates/trade?symbol=* + description: "List all dates for a stock trade for all symbols" + parameters: + - $ref: "#/components/parameters/request_type" + - $ref: "#/components/parameters/multi_symbol" + - $ref: "#/components/parameters/format" + responses: + '200': + description: List all dates for a stock quote for a given symbol + content: + application/json: + schema: + type: object + properties: + date: + type: array + items: + type: string + symbol: + type: array + items: + type: string + required: + - date + - symbol + example: + date: + - '2016-08-19' + - '2016-08-18' + - '2016-08-17' + - '2016-08-16' + - '2016-08-23' + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + /stock/snapshot/ohlc: + x-min-subscription: value + get: + summary: Open High Low Close + operationId: stock_snapshot_ohlc + tags: + - Stock + - Snapshot + description: |2 + + Provides a real-time Open, High, Low, Close for the current day. + * Returns a real-time session OHLC from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks). + * Returns a 15-minute delayed session OHLC from the [UTP & CTA feeds](/Articles/Data-And-Requests/The-SIPs) if the account has the stocks value subscription. + * ThetaData resets its snapshot cache at midnight ET every day. This endpoint may not work on a weekend where there were no eligible messages sent over exchange feeds. We recommend using historic requests during the weekend. + x-sample-urls: + - url: http://localhost:25503/v3/stock/snapshot/ohlc?symbol=* + description: "Returns OHLC for stocks for all symbols" + - url: http://localhost:25503/v3/stock/snapshot/ohlc?symbol=AAPL&venue=nqb + description: "Returns OHLC for a given stock trade from the Nasdaq Basic feed" + parameters: + - $ref: "#/components/parameters/multi_symbol" + - $ref: "#/components/parameters/venue" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns OHLC for stocks for all symbols + content: + application/json: + schema: + type: object + properties: + volume: + type: array + items: + type: integer + symbol: + type: array + items: + type: string + high: + type: array + items: + type: number + low: + type: array + items: + type: number + count: + type: array + items: + type: integer + close: + type: array + items: + type: number + open: + type: array + items: + type: number + timestamp: + type: array + items: + type: string + required: + - volume + - symbol + - high + - low + - count + - close + - open + - timestamp + example: + volume: + - 119656 + - 57048 + - 9 + - 3648 + - 992620 + symbol: + - CVCO + - IFRX + - KLXY + - HCOW + - SCS + high: + - 492.0 + - 0.9199 + - 0.0 + - 23.6976 + - 16.32 + low: + - 480.5477 + - 0.8529 + - 0.0 + - 23.56 + - 16.155 + count: + - 7684 + - 138 + - 6 + - 44 + - 7690 + close: + - 485.11 + - 0.8929 + - 0.0 + - 23.6616 + - 16.18 + open: + - 492.0 + - 0.89 + - 0.0 + - 23.56 + - 16.2 + timestamp: + - '2025-08-20T16:10:04.43' + - '2025-08-20T16:11:13.962' + - '2025-08-20T16:04:10.564' + - '2025-08-20T16:04:07.554' + - '2025-08-20T16:22:32.726' + /stock/snapshot/trade: + x-min-subscription: standard + get: + summary: Trade + operationId: stock_snapshot_trade + tags: + - Stock + - Snapshot + description: |2 + + Returns a real-time last trade from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks). + + - ThetaData resets its snapshot cache at midnight ET every day. This endpoint may not work on a weekend where there were no eligible messages sent over exchange feeds. We recommend using historic requests during the weekend. + x-sample-urls: + - url: http://localhost:25503/v3/stock/snapshot/trade?symbol=AAPL + description: "Returns last trade for stocks for a given symbol" + parameters: + - $ref: "#/components/parameters/multi_symbol" + - $ref: "#/components/parameters/venue" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns last trade for stocks for a given symbol + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + sequence: + type: array + items: + type: integer + condition: + type: array + items: + type: integer + size: + type: array + items: + type: integer + price: + type: array + items: + type: number + timestamp: + type: array + items: + type: string + required: + - symbol + - sequence + - condition + - size + - price + - timestamp + example: + symbol: + - AAPL + sequence: + - 63539137 + condition: + - 1 + size: + - 23 + price: + - 225.75 + timestamp: + - '2025-08-20T16:36:05.549' + /stock/snapshot/quote: + x-min-subscription: value + get: + summary: Quote + operationId: stock_snapshot_quote + tags: + - Stock + - Snapshot + description: | + * Returns a real-time last BBO quote from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks). + * Returns a 15-minute delayed NBBO quote from the [UTP & CTA feeds](/Articles/Data-And-Requests/The-SIPs) account has the [stocks value subscription](https://www.thetadata.net/subscribe.html#stocks) subscription. + - ThetaData resets its snapshot cache at midnight ET every day. This endpoint may not work on a weekend where there were no eligible messages sent over exchange feeds. We recommend using historic requests during the weekend. + x-sample-urls: + - url: http://localhost:25503/v3/stock/snapshot/quote?symbol=* + description: "Returns last quote for stocks for all symbols" + - url: + http://localhost:25503/v3/stock/snapshot/quote?symbol=AAPL&venue=nqb + description: "Returns OHLC for a given stock trade from the Nasdaq Basic feed" + parameters: + - $ref: "#/components/parameters/multi_symbol" + - $ref: "#/components/parameters/venue" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns last quote for stocks for all symbols + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + ask_size: + type: array + items: + type: integer + bid_size: + type: array + items: + type: integer + ask_exchange: + type: array + items: + type: integer + ask_condition: + type: array + items: + type: integer + bid_exchange: + type: array + items: + type: integer + ask: + type: array + items: + type: number + bid: + type: array + items: + type: number + bid_condition: + type: array + items: + type: integer + timestamp: + type: array + items: + type: string + required: + - symbol + - ask_size + - bid_size + - ask_exchange + - ask_condition + - bid_exchange + - ask + - bid + - bid_condition + - timestamp + example: + symbol: + - CVCO + - KLXY + - IFRX + - SCS + - BBC + ask_size: + - 3 + - 200 + - 45 + - 100 + - 2800 + bid_size: + - 1 + - 200 + - 100 + - 100 + - 100 + ask_exchange: + - 29 + - 29 + - 29 + - 29 + - 29 + ask_condition: + - 0 + - 0 + - 0 + - 0 + - 0 + bid_exchange: + - 29 + - 29 + - 29 + - 29 + - 29 + ask: + - 494.33 + - 37.18 + - 0.95 + - 17.6 + - 24.06 + bid: + - 475.75 + - 12.4 + - 0.751 + - 14.64 + - 13.29 + bid_condition: + - 0 + - 0 + - 0 + - 0 + - 0 + timestamp: + - '2025-08-20T16:03:05.142' + - '2025-08-20T16:10:05.032' + - '2025-08-20T16:21:05.781' + - '2025-08-20T16:19:55.101' + - '2025-08-20T16:33:50.877' + /stock/history/eod: + x-min-subscription: free + get: + summary: End of Day + operationId: stock_history_eod + tags: + - Stock + - History + description: |2 + + Since [the equity SIPs](/Articles/Data-And-Requests/The-SIPs.html) only generate a partial EOD report, Theta Data generates a national EOD report at 17:15 ET each day. ``created`` represents the datetime the report was generated and ``last_trade`` represents the datetime of the last trade. The quote in the response represents the last NBBO reported by [CTA or UTP](/Articles/Data-And-Requests/The-SIPs.html) at the time of report generation. You can read more about EOD & OHLC data [here](/Articles/Data-And-Requests/OHLC-EOD.html). Theta Data plans to avail SIP EOD reports in the near future. + x-sample-urls: + - url: + http://localhost:25503/v3/stock/history/eod?symbol=AAPL&start_date=20240101&end_date=20240131 + description: "Returns EOD report for a given symbol between specified dates + (inclusive)" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/start_date" + - $ref: "#/components/parameters/end_date" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns EOD report for a given symbol between specified + dates (inclusive) + content: + application/json: + schema: + type: object + properties: + ask_size: + type: array + items: + type: integer + last_trade: + type: array + items: + type: string + created: + type: array + items: + type: string + ask_condition: + type: array + items: + type: integer + count: + type: array + items: + type: integer + volume: + type: array + items: + type: integer + high: + type: array + items: + type: number + low: + type: array + items: + type: number + bid_size: + type: array + items: + type: integer + ask_exchange: + type: array + items: + type: integer + bid_exchange: + type: array + items: + type: integer + ask: + type: array + items: + type: number + bid: + type: array + items: + type: number + bid_condition: + type: array + items: + type: integer + close: + type: array + items: + type: number + open: + type: array + items: + type: number + required: + - ask_size + - last_trade + - created + - ask_condition + - count + - volume + - high + - low + - bid_size + - ask_exchange + - bid_exchange + - ask + - bid + - bid_condition + - close + - open + example: + ask_size: + - 2 + - 2 + - 2 + - 3 + - 1 + last_trade: + - '2024-01-02T17:17:51.877' + - '2024-01-03T17:16:28.586' + - '2024-01-04T17:17:02.445' + - '2024-01-05T17:16:49.821' + - '2024-01-08T17:17:01.484' + created: + - '2024-01-02T17:17:53.606' + - '2024-01-03T17:16:29.883' + - '2024-01-04T17:17:06.02' + - '2024-01-05T17:16:57.032' + - '2024-01-08T17:17:01.83' + ask_condition: + - 0 + - 0 + - 0 + - 0 + - 0 + count: + - 1003582 + - 654127 + - 709246 + - 679405 + - 665626 + volume: + - 80680243 + - 58308345 + - 71197269 + - 61949135 + - 59029146 + high: + - 188.44 + - 185.88 + - 183.0872 + - 182.76 + - 185.6 + low: + - 183.885 + - 183.43 + - 180.88 + - 180.17 + - 181.5 + bid_size: + - 2 + - 5 + - 8 + - 3 + - 4 + ask_exchange: + - 1 + - 1 + - 7 + - 7 + - 65 + bid_exchange: + - 7 + - 7 + - 60 + - 1 + - 1 + ask: + - 18.536 + - 18.41 + - 1.8179 + - 18.105 + - 18.537 + bid: + - 18.534 + - 18.405 + - 1.8176 + - 18.103 + - 18.528 + bid_condition: + - 0 + - 0 + - 0 + - 0 + - 0 + close: + - 185.64 + - 184.25 + - 181.91 + - 181.18 + - 185.56 + open: + - 187.03 + - 184.2 + - 182.0 + - 181.9 + - 182.0 + /stock/history/ohlc: + x-min-subscription: value + get: + summary: Open High Low Close + operationId: stock_history_ohlc + tags: + - Stock + - History + description: | + Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. Time timestamp of the bar represents the opening time of the bar. For a trade to be part of the bar: ``bar time`` <= ``trade time`` < ``bar timestamp + ivl``, where ivl is the specified interval size in milliseconds. Set the ``venue`` parameter to ``nqb`` to access current-day real-time historic data from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks). + x-sample-urls: + - url: + http://localhost:25503/v3/stock/history/ohlc?symbol=AAPL&date=20240102&interval=1m + description: "Returns OHLC for a given symbol between specified dates (inclusive) + with a one minute interval" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/interval" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/venue" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns OHLC for a given symbol between specified dates + (inclusive) with a one minute interval + content: + application/json: + schema: + type: object + properties: + volume: + type: array + items: + type: integer + high: + type: array + items: + type: number + low: + type: array + items: + type: number + vwap: + type: array + items: + type: number + count: + type: array + items: + type: integer + close: + type: array + items: + type: number + open: + type: array + items: + type: number + timestamp: + type: array + items: + type: string + required: + - volume + - high + - low + - vwap + - count + - close + - open + - timestamp + example: + volume: + - 3256708 + - 809707 + - 687086 + - 485275 + - 415948 + high: + - 188.05 + - 188.12 + - 188.44 + - 188.31 + - 188.15 + low: + - 186.35 + - 187.63 + - 187.73 + - 187.81 + - 187.67 + vwap: + - 187.25 + - 187.38 + - 187.48 + - 187.53 + - 187.55 + count: + - 37886 + - 7481 + - 7103 + - 6245 + - 5942 + close: + - 187.83 + - 187.765 + - 188.2984 + - 188.16 + - 187.73 + open: + - 187.15 + - 187.83 + - 187.77 + - 188.305 + - 188.15 + timestamp: + - '2024-01-02T09:30:00' + - '2024-01-02T09:31:00' + - '2024-01-02T09:32:00' + - '2024-01-02T09:33:00' + - '2024-01-02T09:34:00' + /stock/history/trade: + x-min-subscription: standard + get: + summary: Trade + operationId: stock_history_trade + tags: + - Stock + - History + description: | + Returns every trade reported by [UTP & CTA](/Articles/Data-And-Requests/The-SIPs). Set the ``venue`` parameter to ``nqb`` to access current-day real-time historic data from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks). + x-sample-urls: + - url: + http://localhost:25503/v3/stock/history/trade?symbol=AAPL&date=20240102 + description: "Returns every trade for a given symbol between specified dates + (inclusive) with a one minute interval" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/venue" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns every trade for a given symbol between specified + dates (inclusive) with a one minute interval + content: {} + /stock/history/quote: + x-min-subscription: value + get: + summary: Quote + operationId: stock_history_quote + tags: + - Stock + - History + description: | + Returns every NBBO quote reported by [UTP and CTA](/Articles/Data-And-Requests/The-SIPs). If the ``interval`` parameter is specified, the quote for each interval represents the last quote prior to the interval's timestamp. Set the ``venue`` parameter to ``nqb`` to access current-day real-time historic data from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks). + x-sample-urls: + - url: + http://localhost:25503/v3/stock/history/quote?symbol=AAPL&date=20240102&interval=1m + description: "Returns every quote for a given symbol between specified dates + (inclusive) with a one minute interval" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/interval" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/venue" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns every quote for a given symbol between specified + dates (inclusive) with a one minute interval + content: + application/json: + schema: + type: object + properties: + ask_size: + type: array + items: + type: integer + bid_size: + type: array + items: + type: integer + ask_exchange: + type: array + items: + type: integer + ask_condition: + type: array + items: + type: integer + bid_exchange: + type: array + items: + type: integer + ask: + type: array + items: + type: number + bid: + type: array + items: + type: number + bid_condition: + type: array + items: + type: integer + timestamp: + type: array + items: + type: string + required: + - ask_size + - bid_size + - ask_exchange + - ask_condition + - bid_exchange + - ask + - bid + - bid_condition + - timestamp + example: + ask_size: + - 1 + - 4 + - 1 + - 2 + - 2 + bid_size: + - 30 + - 2 + - 2 + - 2 + - 5 + ask_exchange: + - 1 + - 1 + - 73 + - 73 + - 7 + ask_condition: + - 0 + - 0 + - 0 + - 0 + - 0 + bid_exchange: + - 7 + - 1 + - 60 + - 60 + - 1 + ask: + - 187.2 + - 187.86 + - 187.77 + - 188.32 + - 188.16 + bid: + - 187.1 + - 187.83 + - 187.74 + - 188.29 + - 188.14 + bid_condition: + - 0 + - 0 + - 0 + - 0 + - 0 + timestamp: + - '2024-01-02T09:30:00' + - '2024-01-02T09:31:00' + - '2024-01-02T09:32:00' + - '2024-01-02T09:33:00' + - '2024-01-02T09:34:00' + /stock/history/trade_quote: + x-min-subscription: standard + get: + summary: Trade Quote + operationId: stock_history_trade_quote + tags: + - Stock + - History + description: | + Returns every trade reported by [UTP & CTA](/Articles/Data-And-Requests/The-SIPs) paired with the last BBO quote reported by [UTP or CTA](/Articles/Data-And-Requests/The-SIPs) at the time of trade. A quote is matched with a trade if its timestamp ``<=`` the trade timestamp. If you prefer to match quotes with timestamps that are ``<`` the trade timestamp, specify the ``exclusive`` parameter to ``true``. Set the ``venue`` parameter to ``nqb`` to access current-day real-time historic data from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks). + x-sample-urls: + - url: + http://localhost:25503/v3/stock/history/trade_quote?symbol=AAPL&date=20240102 + description: "Returns every trade quote for a given symbol between specified + dates (inclusive)" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/exclusive" + - $ref: "#/components/parameters/venue" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns every trade quote for a given symbol between + specified dates (inclusive) + content: {} + /stock/at_time/trade: + x-min-subscription: standard + get: + summary: Trade + operationId: stock_at_time_trade + tags: + - Stock + - At-Time + description: | + #### Real-time request: + - Returns a real-time session from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs.html#nasdaq-basic) if the account has a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks). + - Returns a 15-minute delayed session from the [UTP & CTA feeds](/Articles/Data-And-Requests/The-SIPs.html#equities-cta-utp) account has the [stocks value subscription](https://www.thetadata.net/subscribe.html#stocks) subscription. + + #### Historical request: + Returns the last trade reported by [UTP & CTA feeds](/Articles/Data-And-Requests/The-SIPs.html#equities-cta-utp) at a specified millisecond of the day. + Trade condition mappings can be found [here](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html). + x-sample-urls: + - url: + http://localhost:25503/v3/stock/at_time/trade?symbol=SPY&start_date=20240116&end_date=20240116&time_of_day=09:30:00.100 + description: "Returns the last trade for a given symbol and specified time + of day" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/start_date" + - $ref: "#/components/parameters/end_date" + - $ref: "#/components/parameters/time_of_day" + - $ref: "#/components/parameters/venue" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns the last trade for a given symbol and specified + time of day + content: + application/json: + schema: + type: object + properties: + sequence: + type: array + items: + type: integer + condition: + type: array + items: + type: integer + size: + type: array + items: + type: integer + price: + type: array + items: + type: number + ext_condition2: + type: array + items: + type: integer + ext_condition1: + type: array + items: + type: integer + ext_condition4: + type: array + items: + type: integer + exchange: + type: array + items: + type: integer + ext_condition3: + type: array + items: + type: integer + timestamp: + type: array + items: + type: string + required: + - sequence + - condition + - size + - price + - ext_condition2 + - ext_condition1 + - ext_condition4 + - exchange + - ext_condition3 + - timestamp + example: + sequence: + - 405549 + condition: + - 115 + size: + - 1 + price: + - 475.28 + ext_condition2: + - 255 + ext_condition1: + - 255 + ext_condition4: + - 115 + exchange: + - 57 + ext_condition3: + - 255 + timestamp: + - '2024-01-16T09:30:00.088' + /stock/at_time/quote: + x-min-subscription: value + get: + summary: Quote + operationId: stock_at_time_quote + tags: + - Stock + - At-Time + description: | + #### Real-time request: + - Subscription tier standard or higher will default to NQB. + - Real-time last BBO quote at-time_of_day-time from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs.html#nasdaq-basic) if the account has a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks). + - 15-minute delayed NBBO quote at-time_of_day-time from the [UTP & CTA feeds](/Articles/Data-And-Requests/The-SIPs.html#equities-cta-utp) account has the [stocks value subscription](https://www.thetadata.net/subscribe.html#stocks) subscription. + + #### Historical request: + Returns the last NBBO quote reported by [UTP & CTA feeds](/Articles/Data-And-Requests/The-SIPs.html#equities-cta-utp) at a specified millisecond of the day. + x-sample-urls: + - url: + http://localhost:25503/v3/stock/at_time/quote?symbol=SPY&start_date=20240116&end_date=20240116&time_of_day=09:30:00.100 + description: "Returns the last quote for a given symbol between specified + dates (inclusive) with a one minute interval" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/start_date" + - $ref: "#/components/parameters/end_date" + - $ref: "#/components/parameters/time_of_day" + - $ref: "#/components/parameters/venue" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns the last quote for a given symbol between + specified dates (inclusive) with a one minute interval + content: + application/json: + schema: + type: object + properties: + ask_size: + type: array + items: + type: integer + bid_size: + type: array + items: + type: integer + ask_exchange: + type: array + items: + type: integer + ask_condition: + type: array + items: + type: integer + bid_exchange: + type: array + items: + type: integer + ask: + type: array + items: + type: number + bid: + type: array + items: + type: number + bid_condition: + type: array + items: + type: integer + timestamp: + type: array + items: + type: string + required: + - ask_size + - bid_size + - ask_exchange + - ask_condition + - bid_exchange + - ask + - bid + - bid_condition + - timestamp + example: + ask_size: + - 8 + bid_size: + - 15 + ask_exchange: + - 7 + ask_condition: + - 0 + bid_exchange: + - 1 + ask: + - 475.28 + bid: + - 475.28 + bid_condition: + - 0 + timestamp: + - '2024-01-16T09:30:00.1' + /option/list/symbols: + x-min-subscription: free + get: + summary: Symbols + operationId: option_list_symbols + tags: + - Option + - List + description: | + A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also include: root, ticker, and underlying. This endpoint returns all traded symbols for options. This endpoint is updated overnight. + x-sample-urls: + - url: http://localhost:25503/v3/option/list/symbols + description: "List all symbols for options" + parameters: + - $ref: "#/components/parameters/format" + responses: + '200': + description: List all symbols for options + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + required: + - symbol + example: + symbol: + - A + - AA + - AAAP + - AAAU + - AABA + /option/list/dates/{request_type}: + x-min-subscription: free + get: + summary: Dates + operationId: option_list_dates + tags: + - Option + - List + description: | + Lists all dates of data that are available for an option with a given symbol, request type, and expiration. + This endpoint is updated overnight. + x-sample-urls: + - url: + http://localhost:25503/v3/option/list/dates/quote?symbol=AAPL&expiration=20220930 + description: "List all dates for an option quote for a given symbol and expiration + date" + - url: + http://localhost:25503/v3/option/list/dates/trade?symbol=AAPL&expiration=20220930 + description: "List all dates for an option trade for a given symbol with any + expiration date" + parameters: + - $ref: "#/components/parameters/request_type" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration_no_star" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/format" + responses: + '200': + description: List all dates for an option quote for a given symbol and + expiration date + content: + application/json: + schema: + type: object + properties: + date: + type: array + items: + type: string + symbol: + type: array + items: + type: string + strike: + type: array + items: + type: number + expiration: + type: array + items: + type: string + right: + type: array + items: + type: string + required: + - date + - symbol + - strike + - expiration + - right + example: + date: + - '2022-09-16' + - '2022-09-19' + - '2022-09-12' + - '2022-09-13' + - '2022-09-14' + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + strike: + - 80.0 + - 80.0 + - 80.0 + - 80.0 + - 80.0 + expiration: + - '2022-09-30' + - '2022-09-30' + - '2022-09-30' + - '2022-09-30' + - '2022-09-30' + right: + - CALL + - CALL + - CALL + - CALL + - CALL + /option/list/expirations: + x-min-subscription: free + get: + summary: Expirations + operationId: option_list_expirations + tags: + - Option + - List + description: | + Lists all dates of expirations that are available for an option with a given symbol. + This endpoint is updated overnight. + x-sample-urls: + - url: http://localhost:25503/v3/option/list/expirations?symbol=AAPL + description: "List all expirations for an option with a given symbol" + parameters: + - $ref: "#/components/parameters/multi_symbol" + - $ref: "#/components/parameters/format" + responses: + '200': + description: List all expirations for an option with a given symbol + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + expiration: + type: array + items: + type: string + required: + - symbol + - expiration + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + expiration: + - '2012-06-01' + - '2012-06-08' + - '2012-06-16' + - '2012-06-22' + - '2012-06-29' + /option/list/strikes: + x-min-subscription: free + get: + summary: Strikes + operationId: option_list_strikes + tags: + - Option + - List + description: | + Lists all strikes that are available for an option with a given symbol and expiration date. + This endpoint is updated overnight. + x-sample-urls: + - url: + http://localhost:25503/v3/option/list/strikes?symbol=AAPL&expiration=20220930 + description: "List all strikes for an option with a given symbol and expiration + date" + parameters: + - $ref: "#/components/parameters/multi_symbol" + - $ref: "#/components/parameters/expiration_no_star" + - $ref: "#/components/parameters/format" + responses: + '200': + description: List all strikes for an option with a given symbol and + expiration date + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + strike: + type: array + items: + type: number + required: + - symbol + - strike + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + strike: + - 80.0 + - 128.0 + - 160.0 + - 144.0 + - 240.0 + /option/list/contracts/{request_type}: + x-min-subscription: value + get: + summary: Contracts + operationId: option_list_contracts + tags: + - Option + - List + description: | + Lists all contracts that were traded or quoted on a particular date. + + If the ``symbol`` parameter is specified, the returned contracts will be filtered to match the symbol. + Multiple symbols can be specified by separating them with commas such as ``symbol=AAPL,SPY,AMD`` + This endpoint is updated real-time. + x-sample-urls: + - url: http://localhost:25503/v3/option/list/contracts/trade?date=20220930 + description: "List all contracts for an option trade with a given date" + - url: + http://localhost:25503/v3/option/list/contracts/quote?symbol=AAPL&date=20220930 + description: "List all contracts for an option quote with a given symbol and + date" + parameters: + - $ref: "#/components/parameters/request_type" + - $ref: "#/components/parameters/opt_multi_symbol" + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/format" + responses: + '200': + description: List all contracts for an option trade with a given date + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + strike: + type: array + items: + type: number + expiration: + type: array + items: + type: string + right: + type: array + items: + type: string + required: + - symbol + - strike + - expiration + - right + example: + symbol: + - ABNB + - AAPL + - AAL + - ABNB + - AAPL + strike: + - 260.0 + - 260.0 + - 14.5 + - 80.0 + - 80.0 + expiration: + - '2023-06-16' + - '2023-06-16' + - '2022-09-30' + - '2022-11-04' + - '2022-11-04' + right: + - CALL + - CALL + - CALL + - PUT + - PUT + /option/snapshot/ohlc: + x-min-subscription: value + get: + summary: Open High Low Close + operationId: option_snapshot_ohlc + tags: + - Option + - Snapshot + description: | + - Retrieve a real-time last ohlc of an option contract for the trading day. + - You might need to change the default expiration date to a different date if it is past the current date. + x-sample-urls: + - url: + http://localhost:25503/v3/option/snapshot/ohlc?symbol=AAPL&expiration=20260116&right=call&strike=275.000 + description: "Returns OHLC for a given option contract" + - url: + http://localhost:25503/v3/option/snapshot/ohlc?symbol=AAPL&expiration=* + description: "Returns OHLC for all option contracts" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns OHLC for a given option contract + content: + application/json: + schema: + type: object + properties: + volume: + type: array + items: + type: integer + symbol: + type: array + items: + type: string + high: + type: array + items: + type: number + low: + type: array + items: + type: number + strike: + type: array + items: + type: number + count: + type: array + items: + type: integer + expiration: + type: array + items: + type: string + right: + type: array + items: + type: string + close: + type: array + items: + type: number + open: + type: array + items: + type: number + timestamp: + type: array + items: + type: string + required: + - volume + - symbol + - high + - low + - strike + - count + - expiration + - right + - close + - open + - timestamp + example: + volume: + - 202 + symbol: + - AAPL + high: + - 1.78 + low: + - 1.51 + strike: + - 275.0 + count: + - 29 + expiration: + - '2026-01-16' + right: + - CALL + close: + - 1.51 + open: + - 1.78 + timestamp: + - '2025-08-20T15:25:31.03' + /option/snapshot/trade: + x-min-subscription: standard + get: + summary: Trade + operationId: option_snapshot_trade + tags: + - Option + - Snapshot + description: | + - Retrieve the real-time last trade of an option contract. + - You might need to change the default expiration date to a different date if it is past the current date. + - This endpoint will return no data if the market was closed for the day. Theta Data resets the snapshot cache at midnight ET every night. + x-sample-urls: + - url: + http://localhost:25503/v3/option/snapshot/trade?symbol=AAPL&expiration=2026-01-16&right=call&strike=275.000 + description: "Returns last trade for an option contract" + - url: + http://localhost:25503/v3/option/snapshot/trade?symbol=AAPL&expiration=2026-01-16 + description: "Returns last trade for all option contracts with an expiration + of 2026-01-16" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration_no_star" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns last NBBO quote for an option contract + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + strike: + type: array + items: + type: number + right: + type: array + items: + type: string + sequence: + type: array + items: + type: integer + condition: + type: array + items: + type: integer + size: + type: array + items: + type: integer + price: + type: array + items: + type: number + ext_condition2: + type: array + items: + type: integer + ext_condition1: + type: array + items: + type: integer + expiration: + type: array + items: + type: string + ext_condition4: + type: array + items: + type: integer + exchange: + type: array + items: + type: integer + ext_condition3: + type: array + items: + type: integer + timestamp: + type: array + items: + type: string + required: + - symbol + - strike + - right + - sequence + - condition + - size + - price + - ext_condition2 + - ext_condition1 + - expiration + - ext_condition4 + - exchange + - ext_condition3 + - timestamp + example: + symbol: + - AAPL + strike: + - 220.0 + right: + - CALL + sequence: + - 18902138 + condition: + - 130 + size: + - 2 + price: + - 3.9 + ext_condition2: + - 255 + ext_condition1: + - 255 + expiration: + - '2024-11-08' + ext_condition4: + - 255 + exchange: + - 22 + ext_condition3: + - 255 + timestamp: + - '2024-11-04T09:30:00.471' + /option/snapshot/quote: + x-min-subscription: value + get: + summary: Quote + operationId: option_snapshot_quote + tags: + - Option + - Snapshot + description: |2 + + - Retrieve a real-time last NBBO quote of an option contract. + - You might need to change the default expiration date to a different date if it is past the current date. + - This endpoint will return no data if the market was closed for the day. Theta Data resets the snapshot cache at midnight ET every night. + x-sample-urls: + - url: + http://localhost:25503/v3/option/snapshot/quote?symbol=AAPL&expiration=20260116&right=call&strike=275.000 + description: "Returns last NBBO quote for an option contract" + - url: + http://localhost:25503/v3/option/snapshot/quote?symbol=AAPL&expiration=* + description: "Returns last NBBO quote for all option contracts" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns last NBBO quote for an option contract + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + ask_size: + type: array + items: + type: integer + ask_condition: + type: array + items: + type: integer + strike: + type: array + items: + type: number + right: + type: array + items: + type: string + bid_size: + type: array + items: + type: integer + ask_exchange: + type: array + items: + type: integer + bid_exchange: + type: array + items: + type: integer + ask: + type: array + items: + type: number + expiration: + type: array + items: + type: string + bid: + type: array + items: + type: number + bid_condition: + type: array + items: + type: integer + timestamp: + type: array + items: + type: string + required: + - symbol + - ask_size + - ask_condition + - strike + - right + - bid_size + - ask_exchange + - bid_exchange + - ask + - expiration + - bid + - bid_condition + - timestamp + example: + symbol: + - AAPL + ask_size: + - 25 + ask_condition: + - 50 + strike: + - 275.0 + right: + - CALL + bid_size: + - 5 + ask_exchange: + - 6 + bid_exchange: + - 6 + ask: + - 1.5 + expiration: + - '2026-01-16' + bid: + - 1.47 + bid_condition: + - 50 + timestamp: + - '2025-08-20T15:59:59.805' + /option/snapshot/open_interest: + x-min-subscription: value + get: + summary: Open Interest + operationId: option_snapshot_open_interest + tags: + - Option + - Snapshot + description: | + - Retrieve the last open interest message of an option contract. + - Open interest is reported around 06:30 ET every morning by OPRA and reflects the open interest at the of the previous trading day. + - You might need to change the default expiration date to a different date if it is past the current date. + - This endpoint will return no data if the market was closed for the day. Theta Data resets the snapshot cache at midnight ET every night. + x-sample-urls: + - url: + http://localhost:25503/v3/option/snapshot/open_interest?symbol=AAPL&expiration=20260116&right=call&strike=275.00 + description: "Returns open interest for an option contract" + - url: + http://localhost:25503/v3/option/snapshot/open_interest?symbol=AAPL&expiration=* + description: "Returns open interest for all option contracts" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns open interest for an option contract + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + strike: + type: array + items: + type: number + open_interest: + type: array + items: + type: integer + expiration: + type: array + items: + type: string + right: + type: array + items: + type: string + timestamp: + type: array + items: + type: string + required: + - symbol + - strike + - open_interest + - expiration + - right + - timestamp + example: + symbol: + - AAPL + strike: + - 275.0 + open_interest: + - 8066 + expiration: + - '2026-01-16' + right: + - CALL + timestamp: + - '2025-08-20T06:30:13' + /option/snapshot/greeks/implied_volatility: + x-min-subscription: standard + get: + summary: Implied Volatility + operationId: option_snapshot_greeks_implied_volatility + tags: + - Option + - Snapshot + description: | + Returns implied volatilies calculated using the national best bid, mid, and ask price + of the option respectively. The underlying price represents whatever the last underlying price was at the + ``underlying_timestamp`` field. You can read more about how Thetadata calculates greeks + [here](/Articles/Data-And-Requests/Option-Greeks.html). + x-sample-urls: + - url: + http://localhost:25503/v3/option/snapshot/greeks/implied_volatility?symbol=AAPL&expiration=20260116&strike=275.000&right=call + description: "Returns implied volatility for an option contract" + - url: + http://localhost:25503/v3/option/snapshot/greeks/implied_volatility?symbol=AAPL&expiration=* + description: "Returns implied volatility for all option contracts" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/stock_price" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns implied volatility for an option contract + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + underlying_price: + type: array + items: + type: number + strike: + type: array + items: + type: number + ask: + type: array + items: + type: number + expiration: + type: array + items: + type: string + right: + type: array + items: + type: string + implied_vol: + type: array + items: + type: number + bid: + type: array + items: + type: number + underlying_timestamp: + type: array + items: + type: string + iv_error: + type: array + items: + type: number + timestamp: + type: array + items: + type: string + required: + - symbol + - underlying_price + - strike + - ask + - expiration + - right + - implied_vol + - bid + - underlying_timestamp + - iv_error + - timestamp + example: + symbol: + - AAPL + underlying_price: + - 225.74 + strike: + - 275.0 + ask: + - 1.5 + expiration: + - '2026-01-16' + right: + - CALL + implied_vol: + - 0.2142 + bid: + - 1.47 + underlying_timestamp: + - '2025-08-20T16:36:52.257' + iv_error: + - -0.0003 + timestamp: + - '2025-08-20T15:59:59.805' + /option/snapshot/greeks/all: + x-min-subscription: professional + get: + summary: All Greeks + operationId: option_snapshot_greeks_all + tags: + - Option + - Snapshot + description: | + - Retrieve a real-time last greeks calculation for all option contracts that lie on a provided expiration. + - You might need to change the default expiration date to a different date if it is past the current date. Some quotes are omitted in the example to reduce the space of the sample output. + - Make `expiration` * if you want to get the snapshot for every expiration chain for the underlying. + > This endpoint will return no data if the market was closed for the day. Theta Data resets the snapshot cache at midnight ET every night. + x-sample-urls: + - url: + http://localhost:25503/v3/option/snapshot/greeks/all?symbol=AAPL&expiration=2026-05-15&strike=170.00&right=call + description: "Returns all greeks for an option contract" + - url: + http://localhost:25503/v3/option/snapshot/greeks/all?symbol=AAPL&expiration=* + description: "Returns all greeks for all option contracts" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/stock_price" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns all greeks for an option contract + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + dual_delta: + type: array + items: + type: number + color: + type: array + items: + type: number + zomma: + type: array + items: + type: number + delta: + type: array + items: + type: number + implied_vol: + type: array + items: + type: number + theta: + type: array + items: + type: number + d1: + type: array + items: + type: number + speed: + type: array + items: + type: number + d2: + type: array + items: + type: number + epsilon: + type: array + items: + type: number + lambda: + type: array + items: + type: number + vomma: + type: array + items: + type: number + underlying_timestamp: + type: array + items: + type: string + timestamp: + type: array + items: + type: string + underlying_price: + type: array + items: + type: number + strike: + type: array + items: + type: number + vera: + type: array + items: + type: number + right: + type: array + items: + type: string + veta: + type: array + items: + type: number + iv_error: + type: array + items: + type: number + ultima: + type: array + items: + type: number + charm: + type: array + items: + type: number + ask: + type: array + items: + type: number + rho: + type: array + items: + type: number + expiration: + type: array + items: + type: string + vanna: + type: array + items: + type: number + dual_gamma: + type: array + items: + type: number + bid: + type: array + items: + type: number + vega: + type: array + items: + type: number + gamma: + type: array + items: + type: number + required: + - symbol + - dual_delta + - color + - zomma + - delta + - implied_vol + - theta + - d1 + - speed + - d2 + - epsilon + - lambda + - vomma + - underlying_timestamp + - timestamp + - underlying_price + - strike + - vera + - right + - veta + - iv_error + - ultima + - charm + - ask + - rho + - expiration + - vanna + - dual_gamma + - bid + - vega + - gamma + example: + symbol: + - AAPL + dual_delta: + - -0.8302 + color: + - -0.0816 + zomma: + - 0.0 + delta: + - 0.9085 + implied_vol: + - 0.3075 + theta: + - -0.0352 + d1: + - 1.3319 + speed: + - 0.0 + d2: + - 1.0689 + epsilon: + - -150.0314 + lambda: + - 3.2071 + vomma: + - 146.8562 + underlying_timestamp: + - '2025-08-20T16:36:52.257' + timestamp: + - '2025-08-20T15:59:59.677' + underlying_price: + - 225.74 + strike: + - 170.0 + vera: + - 0.0 + right: + - CALL + veta: + - 22.9525 + iv_error: + - 0.0 + ultima: + - -100.0 + charm: + - 0.0925 + ask: + - 64.25 + rho: + - 103.2513 + expiration: + - '2026-05-15' + vanna: + - -0.571 + dual_gamma: + - 0.0003 + bid: + - 63.65 + vega: + - 31.7235 + gamma: + - 0.0027 + /option/snapshot/greeks/first_order: + x-min-subscription: standard + get: + summary: First Order Greeks + operationId: option_snapshot_greeks_first_order + tags: + - Option + - Snapshot + description: | + - Retrieve a real-time last greeks calculation for all option contracts that lie on a provided expiration. + - You might need to change the default expiration date to a different date if it is past the current date. Some quotes are omitted in the example to reduce the space of the sample output. + - Make `expiration` * if you want to get the snapshot for every expiration chain for the underlying. + > This endpoint will return no data if the market was closed for the day. Theta Data resets the snapshot cache at midnight ET every night. + x-sample-urls: + - url: + http://localhost:25503/v3/option/snapshot/greeks/first_order?symbol=AAPL&expiration=20260116&strike=275.000&right=call + description: "Returns first order greeks for an option contract" + - url: + http://localhost:25503/v3/option/snapshot/greeks/first_order?symbol=AAPL&expiration=* + description: "Returns first order greeks for all option contracts" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/stock_price" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns first order greeks for an option contract + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + underlying_price: + type: array + items: + type: number + strike: + type: array + items: + type: number + delta: + type: array + items: + type: number + right: + type: array + items: + type: string + implied_vol: + type: array + items: + type: number + theta: + type: array + items: + type: number + iv_error: + type: array + items: + type: number + epsilon: + type: array + items: + type: number + lambda: + type: array + items: + type: number + ask: + type: array + items: + type: number + rho: + type: array + items: + type: number + expiration: + type: array + items: + type: string + bid: + type: array + items: + type: number + underlying_timestamp: + type: array + items: + type: string + vega: + type: array + items: + type: number + timestamp: + type: array + items: + type: string + required: + - symbol + - underlying_price + - strike + - delta + - right + - implied_vol + - theta + - iv_error + - epsilon + - lambda + - ask + - rho + - expiration + - bid + - underlying_timestamp + - vega + - timestamp + example: + symbol: + - AAPL + underlying_price: + - 225.74 + strike: + - 275.0 + delta: + - 0.106 + right: + - CALL + implied_vol: + - 0.2142 + theta: + - -0.0217 + iv_error: + - -0.0003 + epsilon: + - -9.7049 + lambda: + - 16.1782 + ask: + - 1.5 + rho: + - 9.105 + expiration: + - '2026-01-16' + bid: + - 1.47 + underlying_timestamp: + - '2025-08-20T16:37:06.988' + vega: + - 26.3226 + timestamp: + - '2025-08-20T15:59:59.805' + /option/snapshot/greeks/second_order: + x-min-subscription: professional + get: + summary: Second Order Greeks + operationId: option_snapshot_greeks_second_order + tags: + - Option + - Snapshot + description: | + - Retrieve a real-time last second order greeks calculation for all option contracts that lie on a provided expiration. + - You might need to change the default expiration date to a different date if it is past the current date. Some quotes are omitted in the example to reduce the space of the sample output. + - Make `expiration` * if you want to get the snapshot for every expiration chain for the underlying. + > This endpoint will return no data if the market was closed for the day. Theta Data resets the snapshot cache at midnight ET every night. + x-sample-urls: + - url: + http://localhost:25503/v3/option/snapshot/greeks/second_order?symbol=AAPL&expiration=20260116&strike=275.00 + description: "Returns second order greeks for an option contract" + - url: + http://localhost:25503/v3/option/snapshot/greeks/second_order?symbol=AAPL&expiration=* + description: "Returns second order greeks for all option contracts" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/stock_price" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns second order greeks for an option contract + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + underlying_price: + type: array + items: + type: number + strike: + type: array + items: + type: number + right: + type: array + items: + type: string + veta: + type: array + items: + type: number + implied_vol: + type: array + items: + type: number + iv_error: + type: array + items: + type: number + charm: + type: array + items: + type: number + ask: + type: array + items: + type: number + expiration: + type: array + items: + type: string + vanna: + type: array + items: + type: number + vomma: + type: array + items: + type: number + bid: + type: array + items: + type: number + underlying_timestamp: + type: array + items: + type: string + gamma: + type: array + items: + type: number + timestamp: + type: array + items: + type: string + required: + - symbol + - underlying_price + - strike + - right + - veta + - implied_vol + - iv_error + - charm + - ask + - expiration + - vanna + - vomma + - bid + - underlying_timestamp + - gamma + - timestamp + example: + symbol: + - AAPL + - AAPL + underlying_price: + - 225.74 + - 225.74 + strike: + - 275.0 + - 275.0 + right: + - CALL + - PUT + veta: + - 18.8522 + - 18.2234 + implied_vol: + - 0.2142 + - 0.3106 + iv_error: + - -0.0003 + - 0.0 + charm: + - -0.3716 + - -0.421 + ask: + - 1.5 + - 49.7 + expiration: + - '2026-01-16' + - '2026-01-16' + vanna: + - 1.1833 + - 0.932 + vomma: + - 212.267 + - 108.3415 + bid: + - 1.47 + - 48.75 + underlying_timestamp: + - '2025-08-20T16:37:06.988' + - '2025-08-20T16:37:06.988' + gamma: + - 0.0059 + - 0.0064 + timestamp: + - '2025-08-20T15:59:59.805' + - '2025-08-20T15:59:59.839' + /option/snapshot/greeks/third_order: + x-min-subscription: professional + get: + summary: Third Order Greeks + operationId: option_snapshot_greeks_third_order + tags: + - Option + - Snapshot + description: | + - Retrieve a real-time last third order greeks calculation for all option contracts that lie on a provided expiration. + - You might need to change the default expiration date to a different date if it is past the current date. Some quotes are omitted in the example to reduce the space of the sample output. + - Make `expiration` * if you want to get the snapshot for every expiration chain for the underlying. + > This endpoint will return no data if the market was closed for the day. Theta Data resets the snapshot cache at midnight ET every night. + x-sample-urls: + - url: + http://localhost:25503/v3/option/snapshot/greeks/third_order?symbol=AAPL&expiration=20260116&strike=275.00 + description: "Returns third order greeks for an option contract" + - url: + http://localhost:25503/v3/option/snapshot/greeks/third_order?symbol=AAPL&expiration=* + description: "Returns third order greeks for all option contracts" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/stock_price" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns third order greeks for an option contract + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + underlying_price: + type: array + items: + type: number + color: + type: array + items: + type: number + strike: + type: array + items: + type: number + zomma: + type: array + items: + type: number + right: + type: array + items: + type: string + implied_vol: + type: array + items: + type: number + iv_error: + type: array + items: + type: number + speed: + type: array + items: + type: number + ultima: + type: array + items: + type: number + ask: + type: array + items: + type: number + expiration: + type: array + items: + type: string + bid: + type: array + items: + type: number + underlying_timestamp: + type: array + items: + type: string + timestamp: + type: array + items: + type: string + required: + - symbol + - underlying_price + - color + - strike + - zomma + - right + - implied_vol + - iv_error + - speed + - ultima + - ask + - expiration + - bid + - underlying_timestamp + - timestamp + example: + symbol: + - AAPL + - AAPL + underlying_price: + - 225.74 + - 225.74 + color: + - -0.3832 + - -1.8378 + strike: + - 275.0 + - 275.0 + zomma: + - 0.0 + - 0.0 + right: + - CALL + - PUT + implied_vol: + - 0.2142 + - 0.3106 + iv_error: + - -0.0003 + - 0.0 + speed: + - 0.0 + - 0.0 + ultima: + - -100.0 + - -100.0 + ask: + - 1.5 + - 49.7 + expiration: + - '2026-01-16' + - '2026-01-16' + bid: + - 1.47 + - 48.75 + underlying_timestamp: + - '2025-08-20T16:37:06.988' + - '2025-08-20T16:37:06.988' + timestamp: + - '2025-08-20T15:59:59.805' + - '2025-08-20T15:59:59.839' + /option/history/eod: + x-min-subscription: free + get: + summary: End of Day + operationId: option_history_eod + tags: + - Option + - History + description: | + - Since [OPRA](/Articles/Data-And-Requests/The-SIPs.html) does not provide a national EOD report for options, Thetadata generates a national EOD report at 17:15 ET each day. + - ``created`` represents the datetime the report was generated and ``last_trade`` represents the datetime of the last trade. + - The quote in the response represents the last NBBO reported by OPRA at the time of report generation. + - You can read more about EOD & OHLC data [here](/Articles/Data-And-Requests/OHLC-EOD.html). + > The quote fields (bid / ask info) may not be available prior to 2023-12-01. We will expose further history for the EOD quote in the near future. + x-sample-urls: + - url: + http://localhost:25503/v3/option/history/eod?symbol=AAPL&expiration=20241115&strike=170.000&right=call&start_date=20241104&end_date=20241104 + description: "Returns EOD report for an option contract" + - url: + http://localhost:25503/v3/option/history/eod?symbol=AAPL&expiration=*&start_date=20241104&end_date=20241104 + description: "Returns EOD report for all option contracts" + parameters: + - $ref: "#/components/parameters/start_date" + - $ref: "#/components/parameters/end_date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns EOD report for an option contract + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + ask_size: + type: array + items: + type: integer + last_trade: + type: array + items: + type: string + created: + type: array + items: + type: string + ask_condition: + type: array + items: + type: integer + strike: + type: array + items: + type: number + count: + type: array + items: + type: integer + right: + type: array + items: + type: string + volume: + type: array + items: + type: integer + high: + type: array + items: + type: number + low: + type: array + items: + type: number + bid_size: + type: array + items: + type: integer + ask_exchange: + type: array + items: + type: integer + bid_exchange: + type: array + items: + type: integer + ask: + type: array + items: + type: number + expiration: + type: array + items: + type: string + bid: + type: array + items: + type: number + bid_condition: + type: array + items: + type: integer + close: + type: array + items: + type: number + open: + type: array + items: + type: number + required: + - symbol + - ask_size + - last_trade + - created + - ask_condition + - strike + - count + - right + - volume + - high + - low + - bid_size + - ask_exchange + - bid_exchange + - ask + - expiration + - bid + - bid_condition + - close + - open + example: + symbol: + - AAPL + ask_size: + - 15 + last_trade: + - '2024-11-04T15:48:12.005' + created: + - '2024-11-04T17:16:56.205' + ask_condition: + - 50 + strike: + - 170.0 + count: + - 3 + right: + - CALL + volume: + - 10 + high: + - 52.75 + low: + - 52.4 + bid_size: + - 70 + ask_exchange: + - 47 + bid_exchange: + - 60 + ask: + - 52.45 + expiration: + - '2024-11-15' + bid: + - 52.05 + bid_condition: + - 50 + close: + - 52.4 + open: + - 52.54 + /option/history/ohlc: + x-min-subscription: value + get: + summary: Open High Low Close + operationId: option_history_ohlc + tags: + - Option + - History + description: | + - Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. + - Time timestamp of the bar represents the opening time of the bar. For a trade to be part of the bar: ``bar timestamp`` <= ``trade time`` < ``bar timestamp + interval``. + x-sample-urls: + - url: + http://localhost:25503/v3/option/history/ohlc?symbol=AAPL&expiration=20231103&strike=170.000&right=call&date=20231103&interval=1m + description: "Returns OHLC for an option contract" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration_no_star" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/interval" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns OHLC for an option contract + content: + application/json: + schema: + type: object + properties: + volume: + type: array + items: + type: integer + symbol: + type: array + items: + type: string + high: + type: array + items: + type: number + low: + type: array + items: + type: number + strike: + type: array + items: + type: number + vwap: + type: array + items: + type: number + count: + type: array + items: + type: integer + expiration: + type: array + items: + type: string + right: + type: array + items: + type: string + close: + type: array + items: + type: number + open: + type: array + items: + type: number + timestamp: + type: array + items: + type: string + required: + - volume + - symbol + - high + - low + - strike + - vwap + - count + - expiration + - right + - close + - open + - timestamp + example: + volume: + - 147 + - 39 + - 45 + - 142 + - 29 + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + high: + - 7.05 + - 4.65 + - 5.2 + - 5.05 + - 5.05 + low: + - 3.6 + - 3.65 + - 4.65 + - 4.48 + - 4.5 + strike: + - 170.0 + - 170.0 + - 170.0 + - 170.0 + - 170.0 + vwap: + - 4.39 + - 4.31 + - 4.45 + - 4.53 + - 4.56 + count: + - 24 + - 19 + - 14 + - 23 + - 11 + expiration: + - '2023-11-03' + - '2023-11-03' + - '2023-11-03' + - '2023-11-03' + - '2023-11-03' + right: + - CALL + - CALL + - CALL + - CALL + - CALL + close: + - 4.0 + - 4.65 + - 5.0 + - 4.49 + - 4.73 + open: + - 4.48 + - 3.85 + - 4.75 + - 4.95 + - 4.5 + timestamp: + - '2023-11-03T09:30:00' + - '2023-11-03T09:31:00' + - '2023-11-03T09:32:00' + - '2023-11-03T09:33:00' + - '2023-11-03T09:34:00' + /option/history/trade: + x-min-subscription: standard + get: + summary: Trade + operationId: option_history_trade + tags: + - Option + - History + description: | + - Returns every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - Trade condition mappings can be found [here](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html). + - Extended trade conditions are not reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) for options, so they can be ignored. + x-sample-urls: + - url: + http://localhost:25503/v3/option/history/trade?symbol=AAPL&expiration=20241108&strike=220.000&right=call&date=20241104 + description: "Returns every trade for an option contract" + - url: + http://localhost:25503/v3/option/history/trade?symbol=AAPL&expiration=*&date=20241104 + description: "Returns every trade for all option contracts" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + # - $ref: "#/components/parameters/interval" # NOT CURRENTLY SUPPORTED IN v2 + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns every trade for an option contract + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + strike: + type: array + items: + type: number + right: + type: array + items: + type: string + sequence: + type: array + items: + type: integer + condition: + type: array + items: + type: integer + size: + type: array + items: + type: integer + price: + type: array + items: + type: number + ext_condition2: + type: array + items: + type: integer + ext_condition1: + type: array + items: + type: integer + expiration: + type: array + items: + type: string + ext_condition4: + type: array + items: + type: integer + exchange: + type: array + items: + type: integer + ext_condition3: + type: array + items: + type: integer + timestamp: + type: array + items: + type: string + required: + - symbol + - strike + - right + - sequence + - condition + - size + - price + - ext_condition2 + - ext_condition1 + - expiration + - ext_condition4 + - exchange + - ext_condition3 + - timestamp + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + strike: + - 220.0 + - 220.0 + - 220.0 + - 220.0 + - 220.0 + right: + - CALL + - CALL + - CALL + - CALL + - CALL + sequence: + - 18902138 + - 19368856 + - 19403970 + - 19598457 + - 19598464 + condition: + - 130 + - 130 + - 130 + - 18 + - 18 + size: + - 2 + - 1 + - 1 + - 1 + - 1 + price: + - 3.9 + - 4.25 + - 4.22 + - 4.15 + - 4.15 + ext_condition2: + - 255 + - 255 + - 255 + - 255 + - 255 + ext_condition1: + - 255 + - 255 + - 255 + - 255 + - 255 + expiration: + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + ext_condition4: + - 255 + - 255 + - 255 + - 255 + - 255 + exchange: + - 22 + - 6 + - 6 + - 5 + - 5 + ext_condition3: + - 255 + - 255 + - 255 + - 255 + - 255 + timestamp: + - '2024-11-04T09:30:00.471' + - '2024-11-04T09:30:01.626' + - '2024-11-04T09:30:01.698' + - '2024-11-04T09:30:02.064' + - '2024-11-04T09:30:02.064' + /option/history/quote: + x-min-subscription: value + get: + summary: Quote + operationId: option_history_quote + tags: + - Option + - History + description: | + - Returns every NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - If the ``interval`` parameter is specified, the quote for each interval represents the last quote at the interval's timestamp. + x-sample-urls: + - url: + http://localhost:25503/v3/option/history/quote?symbol=AAPL&expiration=20241108&strike=220.000&right=call&date=20241104&interval=1m + description: "Returns every quote for an option contract" + - url: + http://localhost:25503/v3/option/history/quote?symbol=AAPL&expiration=*&date=20241104&interval=1m + description: "Returns every quote for all option contracts" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/interval" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns every quote for an option contract + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + ask_size: + type: array + items: + type: integer + ask_condition: + type: array + items: + type: integer + strike: + type: array + items: + type: number + right: + type: array + items: + type: string + bid_size: + type: array + items: + type: integer + ask_exchange: + type: array + items: + type: integer + bid_exchange: + type: array + items: + type: integer + ask: + type: array + items: + type: number + expiration: + type: array + items: + type: string + bid: + type: array + items: + type: number + bid_condition: + type: array + items: + type: integer + timestamp: + type: array + items: + type: string + required: + - symbol + - ask_size + - ask_condition + - strike + - right + - bid_size + - ask_exchange + - bid_exchange + - ask + - expiration + - bid + - bid_condition + - timestamp + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + ask_size: + - 0 + - 424 + - 221 + - 45 + - 121 + ask_condition: + - 50 + - 50 + - 50 + - 50 + - 50 + strike: + - 220.0 + - 220.0 + - 220.0 + - 220.0 + - 220.0 + right: + - CALL + - CALL + - CALL + - CALL + - CALL + bid_size: + - 0 + - 598 + - 58 + - 394 + - 194 + ask_exchange: + - 42 + - 9 + - 11 + - 47 + - 11 + bid_exchange: + - 42 + - 5 + - 46 + - 43 + - 11 + ask: + - 0.0 + - 4.7 + - 4.4 + - 4.0 + - 4.3 + expiration: + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + bid: + - 0.0 + - 4.55 + - 4.3 + - 3.9 + - 4.15 + bid_condition: + - 50 + - 50 + - 50 + - 50 + - 50 + timestamp: + - '2024-11-04T09:30:00' + - '2024-11-04T09:31:00' + - '2024-11-04T09:32:00' + - '2024-11-04T09:33:00' + - '2024-11-04T09:34:00' + /option/history/trade_quote: + x-min-subscription: standard + get: + summary: Trade Quote + operationId: option_history_trade_quote + tags: + - Option + - History + description: | + - Returns every [trade](/operations/option_history_trade.html) reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) paired with the last NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) at the time of trade. + - A quote is matched with a trade if its timestamp ``<=`` the trade timestamp. + - To match trades with quotes timestamps that are ``<`` the trade timestamp, specify the ``exclusive``parameter to ``true``. After thorough testing, we have determined that using ``exclusive=true`` might yield better results for various applications. + x-sample-urls: + - url: + http://localhost:25503/v3/option/history/trade_quote?symbol=AAPL&expiration=20241108&strike=220.000&right=call&date=20241104 + description: "Returns every trade quote for an option contract" + - url: + http://localhost:25503/v3/option/history/trade_quote?symbol=AAPL&expiration=*&date=20241104 + description: "Returns every trade quote for all option contracts" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/exclusive" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns every trade quote for an option contract + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + ask_size: + type: array + items: + type: integer + trade_timestamp: + type: array + items: + type: string + ask_condition: + type: array + items: + type: integer + strike: + type: array + items: + type: number + right: + type: array + items: + type: string + sequence: + type: array + items: + type: integer + condition: + type: array + items: + type: integer + size: + type: array + items: + type: integer + bid_size: + type: array + items: + type: integer + ask_exchange: + type: array + items: + type: integer + price: + type: array + items: + type: number + ext_condition2: + type: array + items: + type: integer + bid_exchange: + type: array + items: + type: integer + ask: + type: array + items: + type: number + quote_timestamp: + type: array + items: + type: string + ext_condition1: + type: array + items: + type: integer + expiration: + type: array + items: + type: string + ext_condition4: + type: array + items: + type: integer + exchange: + type: array + items: + type: integer + ext_condition3: + type: array + items: + type: integer + bid: + type: array + items: + type: number + bid_condition: + type: array + items: + type: integer + required: + - symbol + - ask_size + - trade_timestamp + - ask_condition + - strike + - right + - sequence + - condition + - size + - bid_size + - ask_exchange + - price + - ext_condition2 + - bid_exchange + - ask + - quote_timestamp + - ext_condition1 + - expiration + - ext_condition4 + - exchange + - ext_condition3 + - bid + - bid_condition + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + ask_size: + - 14 + - 35 + - 59 + - 81 + - 81 + trade_timestamp: + - '2024-11-04T09:30:00.471' + - '2024-11-04T09:30:01.626' + - '2024-11-04T09:30:01.698' + - '2024-11-04T09:30:02.064' + - '2024-11-04T09:30:02.064' + ask_condition: + - 50 + - 50 + - 50 + - 50 + - 50 + strike: + - 220.0 + - 220.0 + - 220.0 + - 220.0 + - 220.0 + right: + - CALL + - CALL + - CALL + - CALL + - CALL + sequence: + - 18902138 + - 19368856 + - 19403970 + - 19598457 + - 19598464 + condition: + - 130 + - 130 + - 130 + - 18 + - 18 + size: + - 2 + - 1 + - 1 + - 1 + - 1 + bid_size: + - 14 + - 93 + - 59 + - 31 + - 31 + ask_exchange: + - 47 + - 73 + - 69 + - 11 + - 11 + price: + - 3.9 + - 4.25 + - 4.22 + - 4.15 + - 4.15 + ext_condition2: + - 255 + - 255 + - 255 + - 255 + - 255 + bid_exchange: + - 47 + - 76 + - 69 + - 69 + - 69 + ask: + - 4.05 + - 4.3 + - 4.3 + - 4.3 + - 4.3 + quote_timestamp: + - '2024-11-04T09:30:00.396' + - '2024-11-04T09:30:01.594' + - '2024-11-04T09:30:01.643' + - '2024-11-04T09:30:02.039' + - '2024-11-04T09:30:02.039' + ext_condition1: + - 255 + - 255 + - 255 + - 255 + - 255 + expiration: + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + ext_condition4: + - 255 + - 255 + - 255 + - 255 + - 255 + exchange: + - 22 + - 6 + - 6 + - 5 + - 5 + ext_condition3: + - 255 + - 255 + - 255 + - 255 + - 255 + bid: + - 3.9 + - 4.15 + - 4.15 + - 4.15 + - 4.15 + bid_condition: + - 50 + - 50 + - 50 + - 50 + - 50 + /option/history/open_interest: + x-min-subscription: value + get: + summary: Open Interest + operationId: option_history_open_interest + tags: + - Option + - History + description: | + - Open Interest is normally reported once per day by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) at approximately 06:30 ET. + - A new open interest message might not be sent by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) if there is no open interest for the option contract. + - The reported open interest represents the open interest at the end of the previous trading day. + x-sample-urls: + - url: + http://localhost:25503/v3/option/history/open_interest?symbol=AAPL&expiration=20241108&strike=220.000&right=call&date=20241104 + description: "Returns open interest for an option contract" + - url: + http://localhost:25503/v3/option/history/open_interest?symbol=AAPL&expiration=*&date=20241104 + description: "Returns open interest for all option contracts" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns open interest for an option contract + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + strike: + type: array + items: + type: number + open_interest: + type: array + items: + type: integer + expiration: + type: array + items: + type: string + right: + type: array + items: + type: string + timestamp: + type: array + items: + type: string + required: + - symbol + - strike + - open_interest + - expiration + - right + - timestamp + example: + symbol: + - AAPL + strike: + - 220.0 + open_interest: + - 2732 + expiration: + - '2024-11-08' + right: + - CALL + timestamp: + - '2024-11-04T06:30:04' + /option/history/greeks/eod: + x-min-subscription: standard + get: + summary: End of Day Greeks + operationId: option_history_greeks_eod + tags: + - Option + - History + description: | + - Returns the data for all contracts that share the same provided symbol and expiration. + - Uses Theta Data's EOD reports that get generated at 17:15 ET each day. The closing option price and closing underlying price are used for the greeks calculation. + - **Set `expiration` to ``*`` if you want to retrieve data for every option that shares the same ``symbol``. (note: Any ``expiration=*`` must be requested day by day)** + > The quote fields (bid / ask info) may not be available prior to 2023-12-01. We are working to expose this over the coming months. Obtaining the quote at the end of the day requires much more processing than the trades, so we initially generated our history for trades. + x-sample-urls: + - url: + http://localhost:25503/v3/option/history/greeks/eod?symbol=AAPL&expiration=20241108&strike=220.000&right=call&start_date=20241104&end_date=20241104 + description: "Returns EOD report for an option contract" + - url: + http://localhost:25503/v3/option/history/greeks/eod?symbol=AAPL&expiration=*&start_date=20241104&end_date=20241104 + description: "Returns EOD report for all option contracts" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/start_date" + - $ref: "#/components/parameters/end_date" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns EOD report for an option contract + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + ask_size: + type: array + items: + type: integer + dual_delta: + type: array + items: + type: number + color: + type: array + items: + type: number + zomma: + type: array + items: + type: number + delta: + type: array + items: + type: number + implied_vol: + type: array + items: + type: number + theta: + type: array + items: + type: number + d1: + type: array + items: + type: number + speed: + type: array + items: + type: number + d2: + type: array + items: + type: number + epsilon: + type: array + items: + type: number + high: + type: array + items: + type: number + lambda: + type: array + items: + type: number + low: + type: array + items: + type: number + ask_exchange: + type: array + items: + type: integer + bid_exchange: + type: array + items: + type: integer + vomma: + type: array + items: + type: number + bid_condition: + type: array + items: + type: integer + underlying_timestamp: + type: array + items: + type: string + close: + type: array + items: + type: number + timestamp: + type: array + items: + type: string + underlying_price: + type: array + items: + type: number + ask_condition: + type: array + items: + type: integer + strike: + type: array + items: + type: number + count: + type: array + items: + type: integer + vera: + type: array + items: + type: number + right: + type: array + items: + type: string + veta: + type: array + items: + type: number + iv_error: + type: array + items: + type: number + ultima: + type: array + items: + type: number + volume: + type: array + items: + type: integer + charm: + type: array + items: + type: number + bid_size: + type: array + items: + type: integer + ask: + type: array + items: + type: number + rho: + type: array + items: + type: number + expiration: + type: array + items: + type: string + vanna: + type: array + items: + type: number + dual_gamma: + type: array + items: + type: number + bid: + type: array + items: + type: number + open: + type: array + items: + type: number + vega: + type: array + items: + type: number + gamma: + type: array + items: + type: number + required: + - symbol + - ask_size + - dual_delta + - color + - zomma + - delta + - implied_vol + - theta + - d1 + - speed + - d2 + - epsilon + - high + - lambda + - low + - ask_exchange + - bid_exchange + - vomma + - bid_condition + - underlying_timestamp + - close + - timestamp + - underlying_price + - ask_condition + - strike + - count + - vera + - right + - veta + - iv_error + - ultima + - volume + - charm + - bid_size + - ask + - rho + - expiration + - vanna + - dual_gamma + - bid + - open + - vega + - gamma + example: + symbol: + - AAPL + ask_size: + - 12 + dual_delta: + - -0.5945 + color: + - -0.0163 + zomma: + - 0.0 + delta: + - 0.6083 + implied_vol: + - 0.3334 + theta: + - -0.3892 + d1: + - 0.275 + speed: + - 0.0 + d2: + - 0.2401 + epsilon: + - -1.4791 + high: + - 4.85 + lambda: + - 32.3623 + low: + - 3.35 + ask_exchange: + - 5 + bid_exchange: + - 11 + vomma: + - 1.7667 + bid_condition: + - 50 + underlying_timestamp: + - '2024-11-04T17:15:28.71' + close: + - 4.15 + timestamp: + - '2024-11-04T15:59:59.828' + underlying_price: + - 221.87 + ask_condition: + - 50 + strike: + - 220.0 + count: + - 1511 + vera: + - 0.0 + right: + - CALL + veta: + - 0.0149 + iv_error: + - 0.0001 + ultima: + - -15.6407 + volume: + - 7425 + charm: + - 3.6779 + bid_size: + - 9 + ask: + - 4.25 + rho: + - 1.4334 + expiration: + - '2024-11-08' + vanna: + - -0.2765 + dual_gamma: + - 0.0 + bid: + - 4.1 + open: + - 3.9 + vega: + - 8.9221 + gamma: + - 0.0495 + /option/history/greeks/all: + x-min-subscription: professional + get: + summary: All Greeks + operationId: option_history_greeks_all + tags: + - Option + - History + description: | + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculated using the option and underlying midpoint price. If an interval size is specified (*highly recommended*), the option quote used in the calculation follows the same rules as the [quote](/operations/option_history_quote.html) endpoint. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html). + x-sample-urls: + - url: + http://localhost:25503/v3/option/history/greeks/all?symbol=AAPL&expiration=20241108&date=20241104&interval=10m + description: "Returns all greeks for an option contract" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration_no_star" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/interval" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns all greeks for an option contract + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + dual_delta: + type: array + items: + type: number + color: + type: array + items: + type: number + zomma: + type: array + items: + type: number + delta: + type: array + items: + type: number + implied_vol: + type: array + items: + type: number + theta: + type: array + items: + type: number + d1: + type: array + items: + type: number + speed: + type: array + items: + type: number + d2: + type: array + items: + type: number + epsilon: + type: array + items: + type: number + lambda: + type: array + items: + type: number + vomma: + type: array + items: + type: number + underlying_timestamp: + type: array + items: + type: string + timestamp: + type: array + items: + type: string + underlying_price: + type: array + items: + type: number + strike: + type: array + items: + type: number + vera: + type: array + items: + type: number + right: + type: array + items: + type: string + veta: + type: array + items: + type: number + iv_error: + type: array + items: + type: number + ultima: + type: array + items: + type: number + charm: + type: array + items: + type: number + ask: + type: array + items: + type: number + rho: + type: array + items: + type: number + expiration: + type: array + items: + type: string + vanna: + type: array + items: + type: number + dual_gamma: + type: array + items: + type: number + bid: + type: array + items: + type: number + vega: + type: array + items: + type: number + gamma: + type: array + items: + type: number + required: + - symbol + - dual_delta + - color + - zomma + - delta + - implied_vol + - theta + - d1 + - speed + - d2 + - epsilon + - lambda + - vomma + - underlying_timestamp + - timestamp + - underlying_price + - strike + - vera + - right + - veta + - iv_error + - ultima + - charm + - ask + - rho + - expiration + - vanna + - dual_gamma + - bid + - vega + - gamma + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + dual_delta: + - 0.0 + - -0.0021 + - -0.002 + - -0.0021 + - 0.0 + color: + - 0.0 + - -0.0005 + - -0.0005 + - -0.0005 + - 0.0 + zomma: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + delta: + - 0.0 + - 0.0026 + - 0.0025 + - 0.0025 + - 0.0 + implied_vol: + - 0.25 + - 0.5874 + - 0.5749 + - 0.5625 + - 0.25 + theta: + - 0.0 + - -0.0138 + - -0.013 + - -0.0129 + - 0.0 + d1: + - -6.5422 + - -2.7911 + - -2.805 + - -2.8027 + - -6.3404 + speed: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + d2: + - -6.5683 + - -2.8526 + - -2.8652 + - -2.8616 + - -6.3666 + epsilon: + - 0.0 + - -0.0063 + - -0.006 + - -0.0061 + - 0.0 + lambda: + - 261.9304 + - 55.3974 + - 56.7822 + - 57.99 + - 254.5285 + vomma: + - 0.0 + - 2.5389 + - 2.5262 + - 2.6034 + - 0.0 + underlying_timestamp: + - '2024-11-04T09:30:00' + - '2024-11-04T09:40:00' + - '2024-11-04T09:50:00' + - '2024-11-04T10:00:00' + - '2024-11-04T10:10:00' + timestamp: + - '2024-11-04T09:30:00' + - '2024-11-04T09:40:00' + - '2024-11-04T09:50:00' + - '2024-11-04T10:00:00' + - '2024-11-04T10:10:00' + underlying_price: + - 221.0 + - 220.56 + - 221.2 + - 222.06 + - 222.17 + strike: + - 262.5 + - 262.5 + - 262.5 + - 262.5 + - 262.5 + vera: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + right: + - CALL + - CALL + - CALL + - CALL + - CALL + veta: + - 0.0 + - 0.0136 + - 0.0133 + - 0.0136 + - 0.0 + iv_error: + - 100.0 + - 0.0455 + - -0.0199 + - -0.0299 + - 100.0 + ultima: + - 0.0001 + - 21.4427 + - 22.1272 + - 23.2345 + - 0.0004 + charm: + - 0.0 + - -1.0623 + - -1.0265 + - -1.0319 + - 0.0 + ask: + - 0.0 + - 0.02 + - 0.02 + - 0.02 + - 0.01 + rho: + - 0.0 + - 0.0062 + - 0.0059 + - 0.006 + - 0.0 + expiration: + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + vanna: + - 0.0 + - 0.0393 + - 0.0388 + - 0.0399 + - 0.0 + dual_gamma: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + bid: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + vega: + - 0.0 + - 0.1873 + - 0.1807 + - 0.1825 + - 0.0 + gamma: + - 0.0 + - 0.0005 + - 0.0005 + - 0.0006 + - 0.0 + /option/history/trade_greeks/all: + x-min-subscription: professional + get: + summary: All Trade Greeks + operationId: option_history_trade_greeks_all + tags: + - Option + - History + description: | + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html). + x-sample-urls: + - url: + http://localhost:25503/v3/option/history/trade_greeks/all?symbol=AAPL&expiration=20231117&date=20231110 + description: "Returns all trade greeks for an option contract" + - url: + http://localhost:25503/v3/option/history/trade_greeks/all?symbol=AAPL&expiration=*&date=20231110 + description: "Returns all trade greeks for an full chain of option contracts" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns all trade greeks for an option contract + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + dual_delta: + type: array + items: + type: number + color: + type: array + items: + type: number + zomma: + type: array + items: + type: number + delta: + type: array + items: + type: number + implied_vol: + type: array + items: + type: number + theta: + type: array + items: + type: number + d1: + type: array + items: + type: number + speed: + type: array + items: + type: number + d2: + type: array + items: + type: number + epsilon: + type: array + items: + type: number + lambda: + type: array + items: + type: number + price: + type: array + items: + type: number + ext_condition2: + type: array + items: + type: integer + ext_condition1: + type: array + items: + type: integer + ext_condition4: + type: array + items: + type: integer + vomma: + type: array + items: + type: number + ext_condition3: + type: array + items: + type: integer + underlying_timestamp: + type: array + items: + type: string + timestamp: + type: array + items: + type: string + underlying_price: + type: array + items: + type: number + strike: + type: array + items: + type: number + vera: + type: array + items: + type: number + right: + type: array + items: + type: string + veta: + type: array + items: + type: number + iv_error: + type: array + items: + type: number + ultima: + type: array + items: + type: number + sequence: + type: array + items: + type: integer + condition: + type: array + items: + type: integer + size: + type: array + items: + type: integer + charm: + type: array + items: + type: number + rho: + type: array + items: + type: number + expiration: + type: array + items: + type: string + exchange: + type: array + items: + type: integer + vanna: + type: array + items: + type: number + dual_gamma: + type: array + items: + type: number + vega: + type: array + items: + type: number + gamma: + type: array + items: + type: number + required: + - symbol + - dual_delta + - color + - zomma + - delta + - implied_vol + - theta + - d1 + - speed + - d2 + - epsilon + - lambda + - price + - ext_condition2 + - ext_condition1 + - ext_condition4 + - vomma + - ext_condition3 + - underlying_timestamp + - timestamp + - underlying_price + - strike + - vera + - right + - veta + - iv_error + - ultima + - sequence + - condition + - size + - charm + - rho + - expiration + - exchange + - vanna + - dual_gamma + - vega + - gamma + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + dual_delta: + - -0.2213 + - -0.2213 + - -0.2093 + - -0.2182 + - -0.2231 + color: + - -0.0129 + - -0.0129 + - -0.0118 + - -0.0126 + - -0.013 + zomma: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + delta: + - 0.2289 + - 0.2289 + - 0.2162 + - 0.2256 + - 0.2308 + implied_vol: + - 0.1762 + - 0.1762 + - 0.1669 + - 0.1738 + - 0.1777 + theta: + - -0.1031 + - -0.1031 + - -0.0947 + - -0.1009 + - -0.1044 + d1: + - -0.7424 + - -0.7424 + - -0.7849 + - -0.7531 + - -0.736 + speed: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + d2: + - -0.7668 + - -0.7668 + - -0.8081 + - -0.7772 + - -0.7607 + epsilon: + - -0.8073 + - -0.8073 + - -0.7625 + - -0.7958 + - -0.814 + lambda: + - 71.4109 + - 71.4109 + - 76.6064 + - 72.7109 + - 70.6522 + price: + - 0.59 + - 0.59 + - 0.52 + - 0.57 + - 0.6 + ext_condition2: + - 255 + - 255 + - 255 + - 255 + - 255 + ext_condition1: + - 255 + - 255 + - 255 + - 255 + - 255 + ext_condition4: + - 255 + - 255 + - 255 + - 255 + - 255 + vomma: + - 24.9086 + - 24.9086 + - 28.3594 + - 25.765 + - 24.4114 + ext_condition3: + - 255 + - 255 + - 255 + - 255 + - 255 + underlying_timestamp: + - '2023-11-10T09:30:00' + - '2023-11-10T09:30:00' + - '2023-11-10T09:30:00' + - '2023-11-10T09:30:00' + - '2023-11-10T09:30:00' + timestamp: + - '2023-11-10T09:30:00.004' + - '2023-11-10T09:30:00.154' + - '2023-11-10T09:30:00.22' + - '2023-11-10T09:30:00.221' + - '2023-11-10T09:30:00.452' + underlying_price: + - 183.89 + - 183.89 + - 183.89 + - 183.89 + - 183.89 + strike: + - 187.5 + - 187.5 + - 187.5 + - 187.5 + - 187.5 + vera: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + right: + - CALL + - CALL + - CALL + - CALL + - CALL + veta: + - 0.3553 + - 0.3553 + - 0.3755 + - 0.3605 + - 0.3523 + iv_error: + - -0.0008 + - -0.0008 + - -0.0018 + - 0.0012 + - 0.0013 + ultima: + - -100.0 + - -100.0 + - -100.0 + - -100.0 + - -100.0 + sequence: + - -1391330475 + - -1391317465 + - -1391313694 + - -1391313652 + - -1391297309 + condition: + - 18 + - 18 + - 18 + - 130 + - 18 + size: + - 1 + - 1 + - 8 + - 1 + - 6 + charm: + - -6.7146 + - -6.7146 + - -6.8508 + - -6.7516 + - -6.692 + rho: + - 0.796 + - 0.796 + - 0.7526 + - 0.7849 + - 0.8025 + expiration: + - '2023-11-17' + - '2023-11-17' + - '2023-11-17' + - '2023-11-17' + - '2023-11-17' + exchange: + - 9 + - 47 + - 6 + - 6 + - 31 + vanna: + - 1.3174 + - 1.3174 + - 1.4186 + - 1.3432 + - 1.3022 + dual_gamma: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + vega: + - 7.7122 + - 7.7122 + - 7.4656 + - 7.6504 + - 7.7484 + gamma: + - 0.0674 + - 0.0674 + - 0.0689 + - 0.0678 + - 0.0672 + /option/history/greeks/first_order: + x-min-subscription: standard + get: + summary: First Order Greeks + operationId: option_history_greeks_first_order + tags: + - Option + - History + description: | + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculated using the option and underlying midpoint price. If an interval size is specified (*highly recommended*), the option quote used in the calculation follows the same rules as the [quote](/operations/option_history_quote.html) endpoint. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html). + x-sample-urls: + - url: + http://localhost:25503/v3/option/history/greeks/first_order?symbol=AAPL&expiration=20241108&date=20241104&interval=5m + description: "Returns first order greeks for an option contract" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration_no_star" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/interval" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns first order greeks for an option contract + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + underlying_price: + type: array + items: + type: number + strike: + type: array + items: + type: number + delta: + type: array + items: + type: number + right: + type: array + items: + type: string + implied_vol: + type: array + items: + type: number + theta: + type: array + items: + type: number + iv_error: + type: array + items: + type: number + epsilon: + type: array + items: + type: number + lambda: + type: array + items: + type: number + ask: + type: array + items: + type: number + rho: + type: array + items: + type: number + expiration: + type: array + items: + type: string + bid: + type: array + items: + type: number + underlying_timestamp: + type: array + items: + type: string + vega: + type: array + items: + type: number + timestamp: + type: array + items: + type: string + required: + - symbol + - underlying_price + - strike + - delta + - right + - implied_vol + - theta + - iv_error + - epsilon + - lambda + - ask + - rho + - expiration + - bid + - underlying_timestamp + - vega + - timestamp + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + underlying_price: + - 221.0 + - 220.66 + - 220.56 + - 220.86 + - 221.2 + strike: + - 262.5 + - 262.5 + - 262.5 + - 262.5 + - 262.5 + delta: + - 0.0 + - 0.0026 + - 0.0026 + - 0.0025 + - 0.0025 + right: + - CALL + - CALL + - CALL + - CALL + - CALL + implied_vol: + - 0.25 + - 0.5874 + - 0.5874 + - 0.5812 + - 0.5749 + theta: + - 0.0 + - -0.0141 + - -0.0138 + - -0.0133 + - -0.013 + iv_error: + - 100.0 + - 0.0721 + - 0.0455 + - 0.0075 + - -0.0199 + epsilon: + - 0.0 + - -0.0064 + - -0.0063 + - -0.0061 + - -0.006 + lambda: + - 261.9304 + - 55.293 + - 55.3974 + - 56.1024 + - 56.7822 + ask: + - 0.0 + - 0.02 + - 0.02 + - 0.02 + - 0.02 + rho: + - 0.0 + - 0.0063 + - 0.0062 + - 0.006 + - 0.0059 + expiration: + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + bid: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + underlying_timestamp: + - '2024-11-04T09:30:00' + - '2024-11-04T09:35:00' + - '2024-11-04T09:40:00' + - '2024-11-04T09:45:00' + - '2024-11-04T09:50:00' + vega: + - 0.0 + - 0.1913 + - 0.1873 + - 0.1832 + - 0.1807 + timestamp: + - '2024-11-04T09:30:00' + - '2024-11-04T09:35:00' + - '2024-11-04T09:40:00' + - '2024-11-04T09:45:00' + - '2024-11-04T09:50:00' + /option/history/trade_greeks/first_order: + x-min-subscription: professional + get: + summary: First Order Trade Greeks + operationId: option_history_trade_greeks_first_order + tags: + - Option + - History + description: | + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html). + x-sample-urls: + - url: + http://localhost:25503/v3/option/history/trade_greeks/first_order?symbol=AAPL&expiration=20241108&date=20241104 + description: "Returns first order trade greeks for an option contract" + - url: + http://localhost:25503/v3/option/history/trade_greeks/first_order?symbol=AAPL&expiration=*&date=20241104 + description: "Returns first order trade greeks for an full chain of option + contracts" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns first order trade greeks for an option contract + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + underlying_price: + type: array + items: + type: number + strike: + type: array + items: + type: number + delta: + type: array + items: + type: number + right: + type: array + items: + type: string + implied_vol: + type: array + items: + type: number + theta: + type: array + items: + type: number + iv_error: + type: array + items: + type: number + epsilon: + type: array + items: + type: number + sequence: + type: array + items: + type: integer + condition: + type: array + items: + type: integer + lambda: + type: array + items: + type: number + size: + type: array + items: + type: integer + price: + type: array + items: + type: number + ext_condition2: + type: array + items: + type: integer + rho: + type: array + items: + type: number + ext_condition1: + type: array + items: + type: integer + expiration: + type: array + items: + type: string + ext_condition4: + type: array + items: + type: integer + exchange: + type: array + items: + type: integer + ext_condition3: + type: array + items: + type: integer + underlying_timestamp: + type: array + items: + type: string + vega: + type: array + items: + type: number + timestamp: + type: array + items: + type: string + required: + - symbol + - underlying_price + - strike + - delta + - right + - implied_vol + - theta + - iv_error + - epsilon + - sequence + - condition + - lambda + - size + - price + - ext_condition2 + - rho + - ext_condition1 + - expiration + - ext_condition4 + - exchange + - ext_condition3 + - underlying_timestamp + - vega + - timestamp + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + underlying_price: + - 221.33 + - 221.22 + - 221.18 + - 221.16 + - 221.19 + strike: + - 262.5 + - 140.0 + - 140.0 + - 140.0 + - 140.0 + delta: + - 0.0025 + - 0.9976 + - 1.0 + - 0.9976 + - 0.9993 + right: + - CALL + - CALL + - CALL + - CALL + - CALL + implied_vol: + - 0.5749 + - 1.5937 + - 0.0 + - 1.5937 + - 1.3968 + theta: + - -0.0134 + - -0.052 + - 0.0 + - -0.0522 + - -0.0279 + iv_error: + - 0.0132 + - 0.0 + - 0.0011 + - 0.0 + - 0.0 + epsilon: + - -0.0062 + - -2.4186 + - 0.0 + - -2.4179 + - -2.4223 + sequence: + - 156249981 + - 546105677 + - 548097371 + - 548397162 + - 550463381 + condition: + - 125 + - 131 + - 130 + - 130 + - 131 + lambda: + - 56.6408 + - 2.7139 + - 0.0 + - 2.7152 + - 2.7198 + size: + - 1 + - 2 + - 3 + - 3 + - 1 + price: + - 0.01 + - 81.32 + - 81.16 + - 81.26 + - 81.27 + ext_condition2: + - 255 + - 255 + - 255 + - 255 + - 255 + rho: + - 0.0061 + - 1.5274 + - 0.0 + - 1.5274 + - 1.5317 + ext_condition1: + - 255 + - 255 + - 255 + - 255 + - 255 + expiration: + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + ext_condition4: + - 255 + - 255 + - 255 + - 255 + - 255 + exchange: + - 9 + - 5 + - 7 + - 6 + - 5 + ext_condition3: + - 255 + - 255 + - 255 + - 255 + - 255 + underlying_timestamp: + - '2024-11-04T09:53:54' + - '2024-11-04T11:47:14' + - '2024-11-04T11:47:56' + - '2024-11-04T11:48:03' + - '2024-11-04T11:48:51' + vega: + - 0.1858 + - 0.169 + - 0.0 + - 0.1697 + - 0.0544 + timestamp: + - '2024-11-04T09:53:54.069' + - '2024-11-04T11:47:14.764' + - '2024-11-04T11:47:56.669' + - '2024-11-04T11:48:03.852' + - '2024-11-04T11:48:51.11' + /option/history/greeks/second_order: + x-min-subscription: professional + get: + summary: Second Order Greeks + operationId: option_history_greeks_second_order + tags: + - Option + - History + description: | + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculated using the option and underlying midpoint price. If an interval size is specified (*highly recommended*), the option quote used in the calculation follows the same rules as the [quote](/operations/option_history_quote.html) endpoint. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html). + x-sample-urls: + - url: + http://localhost:25503/v3/option/history/greeks/second_order?symbol=AAPL&expiration=20241108&date=20241104&interval=1h + description: "Returns second order greeks for an option contract" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration_no_star" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/interval" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns second order greeks for an option contract + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + underlying_price: + type: array + items: + type: number + strike: + type: array + items: + type: number + right: + type: array + items: + type: string + veta: + type: array + items: + type: number + implied_vol: + type: array + items: + type: number + iv_error: + type: array + items: + type: number + charm: + type: array + items: + type: number + ask: + type: array + items: + type: number + expiration: + type: array + items: + type: string + vanna: + type: array + items: + type: number + vomma: + type: array + items: + type: number + bid: + type: array + items: + type: number + underlying_timestamp: + type: array + items: + type: string + gamma: + type: array + items: + type: number + timestamp: + type: array + items: + type: string + required: + - symbol + - underlying_price + - strike + - right + - veta + - implied_vol + - iv_error + - charm + - ask + - expiration + - vanna + - vomma + - bid + - underlying_timestamp + - gamma + - timestamp + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + underlying_price: + - 221.0 + - 221.73 + - 221.49 + - 221.11 + - 222.03 + strike: + - 262.5 + - 262.5 + - 262.5 + - 262.5 + - 262.5 + right: + - CALL + - CALL + - CALL + - CALL + - CALL + veta: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + implied_vol: + - 0.25 + - 0.25 + - 0.25 + - 0.25 + - 0.25 + iv_error: + - 100.0 + - 100.0 + - 100.0 + - 100.0 + - 100.0 + charm: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + ask: + - 0.0 + - 0.01 + - 0.01 + - 0.01 + - 0.01 + expiration: + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + vanna: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + vomma: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + bid: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + underlying_timestamp: + - '2024-11-04T09:30:00' + - '2024-11-04T10:30:00' + - '2024-11-04T11:30:00' + - '2024-11-04T12:30:00' + - '2024-11-04T13:30:00' + gamma: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + timestamp: + - '2024-11-04T09:30:00' + - '2024-11-04T10:30:00' + - '2024-11-04T11:30:00' + - '2024-11-04T12:30:00' + - '2024-11-04T13:30:00' + /option/history/trade_greeks/second_order: + x-min-subscription: professional + get: + summary: Second Order Trade Greeks + operationId: option_history_trade_greeks_second_order + tags: + - Option + - History + description: | + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html). + x-sample-urls: + - url: + http://localhost:25503/v3/option/history/trade_greeks/second_order?symbol=AAPL&expiration=20241108&date=20241104 + description: "Returns second order trade greeks for an option contract" + - url: + http://localhost:25503/v3/option/history/trade_greeks/second_order?symbol=AAPL&expiration=*&date=20241104 + description: "Returns second order trade greeks for an full chain of option + contracts" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns second order trade greeks for an option contract + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + underlying_price: + type: array + items: + type: number + strike: + type: array + items: + type: number + right: + type: array + items: + type: string + veta: + type: array + items: + type: number + implied_vol: + type: array + items: + type: number + iv_error: + type: array + items: + type: number + sequence: + type: array + items: + type: integer + condition: + type: array + items: + type: integer + size: + type: array + items: + type: integer + charm: + type: array + items: + type: number + price: + type: array + items: + type: number + ext_condition2: + type: array + items: + type: integer + ext_condition1: + type: array + items: + type: integer + expiration: + type: array + items: + type: string + ext_condition4: + type: array + items: + type: integer + exchange: + type: array + items: + type: integer + vanna: + type: array + items: + type: number + vomma: + type: array + items: + type: number + ext_condition3: + type: array + items: + type: integer + underlying_timestamp: + type: array + items: + type: string + gamma: + type: array + items: + type: number + timestamp: + type: array + items: + type: string + required: + - symbol + - underlying_price + - strike + - right + - veta + - implied_vol + - iv_error + - sequence + - condition + - size + - charm + - price + - ext_condition2 + - ext_condition1 + - expiration + - ext_condition4 + - exchange + - vanna + - vomma + - ext_condition3 + - underlying_timestamp + - gamma + - timestamp + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + underlying_price: + - 221.33 + - 221.22 + - 221.18 + - 221.16 + - 221.19 + strike: + - 262.5 + - 140.0 + - 140.0 + - 140.0 + - 140.0 + right: + - CALL + - CALL + - CALL + - CALL + - CALL + veta: + - 0.0137 + - 0.0063 + - 0.0 + - 0.0064 + - 0.0025 + implied_vol: + - 0.5749 + - 1.5937 + - 0.0 + - 1.5937 + - 1.3968 + iv_error: + - 0.0132 + - 0.0 + - 0.0011 + - 0.0 + - 0.0 + sequence: + - 156249981 + - 546105677 + - 548097371 + - 548397162 + - 550463381 + condition: + - 125 + - 131 + - 130 + - 130 + - 131 + size: + - 1 + - 2 + - 3 + - 3 + - 1 + charm: + - -1.0514 + - 0.8843 + - 0.0 + - 0.8879 + - 0.3271 + price: + - 0.01 + - 81.32 + - 81.16 + - 81.26 + - 81.27 + ext_condition2: + - 255 + - 255 + - 255 + - 255 + - 255 + ext_condition1: + - 255 + - 255 + - 255 + - 255 + - 255 + expiration: + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + ext_condition4: + - 255 + - 255 + - 255 + - 255 + - 255 + exchange: + - 9 + - 5 + - 7 + - 6 + - 5 + vanna: + - 0.0398 + - -0.0121 + - 0.0 + - -0.0122 + - -0.0051 + vomma: + - 2.5798 + - 0.7986 + - 0.0 + - 0.8011 + - 0.3817 + ext_condition3: + - 255 + - 255 + - 255 + - 255 + - 255 + underlying_timestamp: + - '2024-11-04T09:53:54' + - '2024-11-04T11:47:14' + - '2024-11-04T11:47:56' + - '2024-11-04T11:48:03' + - '2024-11-04T11:48:51' + gamma: + - 0.0006 + - 0.0001 + - 0.0 + - 0.0001 + - 0.0 + timestamp: + - '2024-11-04T09:53:54.069' + - '2024-11-04T11:47:14.764' + - '2024-11-04T11:47:56.669' + - '2024-11-04T11:48:03.852' + - '2024-11-04T11:48:51.11' + /option/history/greeks/third_order: + x-min-subscription: professional + get: + summary: Third Order Greeks + operationId: option_history_greeks_third_order + tags: + - Option + - History + description: | + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculated using the option and underlying midpoint price. If an interval size is specified (*highly recommended*), the option quote used in the calculation follows the same rules as the [quote](/operations/option_history_quote.html) endpoint. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html). + x-sample-urls: + - url: + http://localhost:25503/v3/option/history/greeks/third_order?symbol=AAPL&expiration=20241108&date=20241104&interval=1h + description: "Returns third order greeks for an option contract" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration_no_star" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/interval" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns third order greeks for an option contract + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + underlying_price: + type: array + items: + type: number + color: + type: array + items: + type: number + strike: + type: array + items: + type: number + zomma: + type: array + items: + type: number + right: + type: array + items: + type: string + implied_vol: + type: array + items: + type: number + iv_error: + type: array + items: + type: number + speed: + type: array + items: + type: number + ultima: + type: array + items: + type: number + ask: + type: array + items: + type: number + expiration: + type: array + items: + type: string + bid: + type: array + items: + type: number + underlying_timestamp: + type: array + items: + type: string + timestamp: + type: array + items: + type: string + required: + - symbol + - underlying_price + - color + - strike + - zomma + - right + - implied_vol + - iv_error + - speed + - ultima + - ask + - expiration + - bid + - underlying_timestamp + - timestamp + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + underlying_price: + - 221.0 + - 221.73 + - 221.49 + - 221.11 + - 222.03 + color: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + strike: + - 262.5 + - 262.5 + - 262.5 + - 262.5 + - 262.5 + zomma: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + right: + - CALL + - CALL + - CALL + - CALL + - CALL + implied_vol: + - 0.25 + - 0.25 + - 0.25 + - 0.25 + - 0.25 + iv_error: + - 100.0 + - 100.0 + - 100.0 + - 100.0 + - 100.0 + speed: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + ultima: + - 0.0001 + - 0.0002 + - 0.0002 + - 0.0001 + - 0.0003 + ask: + - 0.0 + - 0.01 + - 0.01 + - 0.01 + - 0.01 + expiration: + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + bid: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + underlying_timestamp: + - '2024-11-04T09:30:00' + - '2024-11-04T10:30:00' + - '2024-11-04T11:30:00' + - '2024-11-04T12:30:00' + - '2024-11-04T13:30:00' + timestamp: + - '2024-11-04T09:30:00' + - '2024-11-04T10:30:00' + - '2024-11-04T11:30:00' + - '2024-11-04T12:30:00' + - '2024-11-04T13:30:00' + /option/history/trade_greeks/third_order: + x-min-subscription: professional + get: + summary: Third Order Trade Greeks + operationId: option_history_trade_greeks_third_order + tags: + - Option + - History + description: | + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html). + x-sample-urls: + - url: + http://localhost:25503/v3/option/history/trade_greeks/third_order?symbol=AAPL&expiration=20241108&date=20241104 + description: "Returns third order trade greeks for an option contract" + - url: + http://localhost:25503/v3/option/history/trade_greeks/third_order?symbol=AAPL&expiration=*&date=20241104 + description: "Returns third order trade greeks for an full chain of option + contracts" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns third order trade greeks for an option contract + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + underlying_price: + type: array + items: + type: number + color: + type: array + items: + type: number + strike: + type: array + items: + type: number + zomma: + type: array + items: + type: number + right: + type: array + items: + type: string + implied_vol: + type: array + items: + type: number + iv_error: + type: array + items: + type: number + speed: + type: array + items: + type: number + ultima: + type: array + items: + type: number + sequence: + type: array + items: + type: integer + condition: + type: array + items: + type: integer + size: + type: array + items: + type: integer + price: + type: array + items: + type: number + ext_condition2: + type: array + items: + type: integer + ext_condition1: + type: array + items: + type: integer + expiration: + type: array + items: + type: string + ext_condition4: + type: array + items: + type: integer + exchange: + type: array + items: + type: integer + ext_condition3: + type: array + items: + type: integer + underlying_timestamp: + type: array + items: + type: string + timestamp: + type: array + items: + type: string + required: + - symbol + - underlying_price + - color + - strike + - zomma + - right + - implied_vol + - iv_error + - speed + - ultima + - sequence + - condition + - size + - price + - ext_condition2 + - ext_condition1 + - expiration + - ext_condition4 + - exchange + - ext_condition3 + - underlying_timestamp + - timestamp + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + underlying_price: + - 221.33 + - 221.22 + - 221.18 + - 221.16 + - 221.19 + color: + - -0.0005 + - -0.0013 + - 0.0 + - -0.0013 + - -0.0003 + strike: + - 262.5 + - 140.0 + - 140.0 + - 140.0 + - 140.0 + zomma: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + right: + - CALL + - CALL + - CALL + - CALL + - CALL + implied_vol: + - 0.5749 + - 1.5937 + - 0.0 + - 1.5937 + - 1.3968 + iv_error: + - 0.0132 + - 0.0 + - 0.0011 + - 0.0 + - 0.0 + speed: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + ultima: + - 22.3494 + - 2.2683 + - 0.0 + - 2.2709 + - 1.8578 + sequence: + - 156249981 + - 546105677 + - 548097371 + - 548397162 + - 550463381 + condition: + - 125 + - 131 + - 130 + - 130 + - 131 + size: + - 1 + - 2 + - 3 + - 3 + - 1 + price: + - 0.01 + - 81.32 + - 81.16 + - 81.26 + - 81.27 + ext_condition2: + - 255 + - 255 + - 255 + - 255 + - 255 + ext_condition1: + - 255 + - 255 + - 255 + - 255 + - 255 + expiration: + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + ext_condition4: + - 255 + - 255 + - 255 + - 255 + - 255 + exchange: + - 9 + - 5 + - 7 + - 6 + - 5 + ext_condition3: + - 255 + - 255 + - 255 + - 255 + - 255 + underlying_timestamp: + - '2024-11-04T09:53:54' + - '2024-11-04T11:47:14' + - '2024-11-04T11:47:56' + - '2024-11-04T11:48:03' + - '2024-11-04T11:48:51' + timestamp: + - '2024-11-04T09:53:54.069' + - '2024-11-04T11:47:14.764' + - '2024-11-04T11:47:56.669' + - '2024-11-04T11:48:03.852' + - '2024-11-04T11:48:51.11' + /option/history/greeks/implied_volatility: + x-min-subscription: standard + get: + summary: Implied Volatility + operationId: option_history_greeks_implied_volatility + tags: + - Option + - History + description: | + - Returns implied volatilies calculated using the national best bid, mid, and ask price of the option respectively. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html). + x-sample-urls: + - url: + http://localhost:25503/v3/option/history/greeks/implied_volatility?symbol=AAPL&expiration=20241108&strike=220.000&right=call&date=20241104&interval=5m + description: "Returns 5m interval implied volatility for an option contract" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration_no_star" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/interval" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns 5m interval implied volatility for an option + contract + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + underlying_price: + type: array + items: + type: number + strike: + type: array + items: + type: number + right: + type: array + items: + type: string + implied_vol: + type: array + items: + type: number + iv_error: + type: array + items: + type: number + bid_implied_vol: + type: array + items: + type: number + ask: + type: array + items: + type: number + midpoint: + type: array + items: + type: number + expiration: + type: array + items: + type: string + ask_implied_vol: + type: array + items: + type: number + bid: + type: array + items: + type: number + underlying_timestamp: + type: array + items: + type: string + timestamp: + type: array + items: + type: string + required: + - symbol + - underlying_price + - strike + - right + - implied_vol + - iv_error + - bid_implied_vol + - ask + - midpoint + - expiration + - ask_implied_vol + - bid + - underlying_timestamp + - timestamp + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + underlying_price: + - 221.0 + - 220.66 + - 220.56 + - 220.86 + - 221.2 + strike: + - 220.0 + - 220.0 + - 220.0 + - 220.0 + - 220.0 + right: + - CALL + - CALL + - CALL + - CALL + - CALL + implied_vol: + - 0.0 + - 0.3693 + - 0.3698 + - 0.3574 + - 0.3474 + iv_error: + - 100.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + bid_implied_vol: + - 0.0 + - 0.364 + - 0.3643 + - 0.3518 + - 0.3417 + ask: + - 0.0 + - 3.85 + - 3.8 + - 3.85 + - 3.95 + midpoint: + - 0.0 + - 3.8 + - 3.75 + - 3.8 + - 3.9 + expiration: + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + ask_implied_vol: + - 0.0 + - 0.3747 + - 0.3752 + - 0.3627 + - 0.3527 + bid: + - 0.0 + - 3.75 + - 3.7 + - 3.75 + - 3.85 + underlying_timestamp: + - '2024-11-04T09:30:00' + - '2024-11-04T09:35:00' + - '2024-11-04T09:40:00' + - '2024-11-04T09:45:00' + - '2024-11-04T09:50:00' + timestamp: + - '2024-11-04T09:30:00' + - '2024-11-04T09:35:00' + - '2024-11-04T09:40:00' + - '2024-11-04T09:45:00' + - '2024-11-04T09:50:00' + /option/history/trade_greeks/implied_volatility: + x-min-subscription: professional + get: + summary: Trade Implied Volatility + operationId: option_history_trade_greeks_implied_volatility + tags: + - Option + - History + description: | + - Returns implied volatilies calculated using the trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html). + x-sample-urls: + - url: + http://localhost:25503/v3/option/history/trade_greeks/implied_volatility?symbol=AAPL&expiration=20241108&strike=220.000&right=call&date=20241104 + description: "Returns implied volatility for an option contract" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns implied volatility for an option contract + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + underlying_price: + type: array + items: + type: number + strike: + type: array + items: + type: number + right: + type: array + items: + type: string + implied_vol: + type: array + items: + type: number + iv_error: + type: array + items: + type: number + sequence: + type: array + items: + type: integer + condition: + type: array + items: + type: integer + size: + type: array + items: + type: integer + price: + type: array + items: + type: number + ext_condition2: + type: array + items: + type: integer + ext_condition1: + type: array + items: + type: integer + expiration: + type: array + items: + type: string + ext_condition4: + type: array + items: + type: integer + exchange: + type: array + items: + type: integer + ext_condition3: + type: array + items: + type: integer + underlying_timestamp: + type: array + items: + type: string + timestamp: + type: array + items: + type: string + required: + - symbol + - underlying_price + - strike + - right + - implied_vol + - iv_error + - sequence + - condition + - size + - price + - ext_condition2 + - ext_condition1 + - expiration + - ext_condition4 + - exchange + - ext_condition3 + - underlying_timestamp + - timestamp + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + underlying_price: + - 221.0 + - 221.17 + - 221.17 + - 221.37 + - 221.37 + strike: + - 220.0 + - 220.0 + - 220.0 + - 220.0 + - 220.0 + right: + - CALL + - CALL + - CALL + - CALL + - CALL + implied_vol: + - 0.3598 + - 0.3876 + - 0.3842 + - 0.364 + - 0.364 + iv_error: + - 0.0002 + - 0.0 + - -0.0002 + - -0.0001 + - -0.0001 + sequence: + - 18902138 + - 19368856 + - 19403970 + - 19598457 + - 19598464 + condition: + - 130 + - 130 + - 130 + - 18 + - 18 + size: + - 2 + - 1 + - 1 + - 1 + - 1 + price: + - 3.9 + - 4.25 + - 4.22 + - 4.15 + - 4.15 + ext_condition2: + - 255 + - 255 + - 255 + - 255 + - 255 + ext_condition1: + - 255 + - 255 + - 255 + - 255 + - 255 + expiration: + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + ext_condition4: + - 255 + - 255 + - 255 + - 255 + - 255 + exchange: + - 22 + - 6 + - 6 + - 5 + - 5 + ext_condition3: + - 255 + - 255 + - 255 + - 255 + - 255 + underlying_timestamp: + - '2024-11-04T09:30:00' + - '2024-11-04T09:30:01' + - '2024-11-04T09:30:01' + - '2024-11-04T09:30:02' + - '2024-11-04T09:30:02' + timestamp: + - '2024-11-04T09:30:00.471' + - '2024-11-04T09:30:01.626' + - '2024-11-04T09:30:01.698' + - '2024-11-04T09:30:02.064' + - '2024-11-04T09:30:02.064' + /option/at_time/trade: + x-min-subscription: standard + get: + summary: Trade + operationId: option_at_time_trade + tags: + - Option + - At-Time + description: | + - Returns the last trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) at a specified millisecond of the day. + - Trade condition mappings can be found [here](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html). + - Extended trade conditions are not reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) for options, so they can be ignored. + - The ``time_of_day``parameter represents the 00:00:00.000 ET that the trade should be provided for. + x-sample-urls: + - url: + http://localhost:25503/v3/option/at_time/trade?symbol=AAPL&expiration=20241108&strike=220.000&right=call&start_date=20241104&end_date=20241104&time_of_day=09:30:01.000 + description: "Returns the last trade for an option contract" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/start_date" + - $ref: "#/components/parameters/end_date" + - $ref: "#/components/parameters/time_of_day" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns the last trade for an option contract + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + strike: + type: array + items: + type: number + right: + type: array + items: + type: string + sequence: + type: array + items: + type: integer + condition: + type: array + items: + type: integer + size: + type: array + items: + type: integer + price: + type: array + items: + type: number + ext_condition2: + type: array + items: + type: integer + ext_condition1: + type: array + items: + type: integer + expiration: + type: array + items: + type: string + ext_condition4: + type: array + items: + type: integer + exchange: + type: array + items: + type: integer + ext_condition3: + type: array + items: + type: integer + timestamp: + type: array + items: + type: string + required: + - symbol + - strike + - right + - sequence + - condition + - size + - price + - ext_condition2 + - ext_condition1 + - expiration + - ext_condition4 + - exchange + - ext_condition3 + - timestamp + example: + symbol: + - AAPL + strike: + - 220.0 + right: + - CALL + sequence: + - 18902138 + condition: + - 130 + size: + - 2 + price: + - 3.9 + ext_condition2: + - 255 + ext_condition1: + - 255 + expiration: + - '2024-11-08' + ext_condition4: + - 255 + exchange: + - 22 + ext_condition3: + - 255 + timestamp: + - '2024-11-04T09:30:00.471' + /option/at_time/quote: + x-min-subscription: value + get: + summary: Quote + operationId: option_at_time_quote + tags: + - Option + - At-Time + description: | + - Returns the last NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) at a specified millisecond of the day. + - The ``time_of_day``parameter represents the 00:00:00.000 ET that the quote should be provided for. + x-sample-urls: + - url: + http://localhost:25503/v3/option/at_time/quote?symbol=AAPL&expiration=20241108&strike=220.000&right=call&start_date=20241104&end_date=20241104&time_of_day=09:30:01.000 + description: "Returns the last quote for an option contract" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/start_date" + - $ref: "#/components/parameters/end_date" + - $ref: "#/components/parameters/time_of_day" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns the last quote for an option contract + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + ask_size: + type: array + items: + type: integer + ask_condition: + type: array + items: + type: integer + strike: + type: array + items: + type: number + right: + type: array + items: + type: string + bid_size: + type: array + items: + type: integer + ask_exchange: + type: array + items: + type: integer + bid_exchange: + type: array + items: + type: integer + ask: + type: array + items: + type: number + expiration: + type: array + items: + type: string + bid: + type: array + items: + type: number + bid_condition: + type: array + items: + type: integer + timestamp: + type: array + items: + type: string + required: + - symbol + - ask_size + - ask_condition + - strike + - right + - bid_size + - ask_exchange + - bid_exchange + - ask + - expiration + - bid + - bid_condition + - timestamp + example: + symbol: + - AAPL + ask_size: + - 14 + ask_condition: + - 50 + strike: + - 220.0 + right: + - CALL + bid_size: + - 129 + ask_exchange: + - 47 + bid_exchange: + - 69 + ask: + - 4.1 + expiration: + - '2024-11-08' + bid: + - 3.95 + bid_condition: + - 50 + timestamp: + - '2024-11-04T09:30:00.91' + /index/list/symbols: + x-min-subscription: free + get: + summary: Symbols + operationId: index_list_symbols + tags: + - Index + - List + description: | + A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also include: root, ticker, and underlying. This endpoint returns all traded symbols for options. This endpoint is updated overnight. + x-sample-urls: + - url: http://localhost:25503/v3/index/list/symbols + description: "List all symbols for indices" + parameters: + - $ref: "#/components/parameters/format" + responses: + '200': + description: List all symbols for indices + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + required: + - symbol + example: + symbol: + - AASGI + - AASUS + - ACNAC + - ACNIT + - ACNRE + /index/list/dates: + x-min-subscription: free + get: + summary: Dates + operationId: index_list_dates + tags: + - Index + - List + description: | + Lists all dates of data that are available for a index with a given request type and symbol. This endpoint is updated overnight. + x-sample-urls: + - url: http://localhost:25503/v3/index/list/dates?symbol=SPX + description: "List all dates for a index for a given symbol" + parameters: + - $ref: "#/components/parameters/multi_symbol" + - $ref: "#/components/parameters/format" + responses: + '200': + description: List all dates for a index for a given symbol + content: + application/json: + schema: + type: object + properties: + date: + type: array + items: + type: string + symbol: + type: array + items: + type: string + required: + - date + - symbol + example: + date: + - '2023-04-20' + - '2023-04-21' + - '2023-04-17' + - '2023-04-18' + - '2023-04-19' + symbol: + - SPX + - SPX + - SPX + - SPX + - SPX + /index/snapshot/ohlc: + x-min-subscription: standard + get: + summary: Open High Low Close + operationId: index_snapshot_ohlc + tags: + - Index + - Snapshot + description: | + - Retrieves the real-time current day OHLC. + - [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) typically generate a price report every second for popular indices like SPX. + x-sample-urls: + - url: http://localhost:25503/v3/index/snapshot/ohlc?symbol=SPX + description: "Returns OHLC for a given index price change" + parameters: + - $ref: "#/components/parameters/multi_symbol" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns OHLC for a given index price change + content: + application/json: + schema: + type: object + properties: + volume: + type: array + items: + type: integer + symbol: + type: array + items: + type: string + high: + type: array + items: + type: number + low: + type: array + items: + type: number + count: + type: array + items: + type: integer + close: + type: array + items: + type: number + open: + type: array + items: + type: number + timestamp: + type: array + items: + type: string + required: + - volume + - symbol + - high + - low + - count + - close + - open + - timestamp + example: + volume: + - 0 + symbol: + - SPX + high: + - 6408.4 + low: + - 6343.86 + count: + - 0 + close: + - 6395.78 + open: + - 6406.62 + timestamp: + - '2025-08-20T16:02:06' + /index/snapshot/price: + x-min-subscription: standard + get: + summary: Price + operationId: index_snapshot_price + tags: + - Index + - Snapshot + description: | + - Retrieves a real-time last index price. + - [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) typically generate a price report every second for popular indices like SPX. + x-sample-urls: + - url: http://localhost:25503/v3/index/snapshot/price?symbol=SPX + description: "Returns last index price" + parameters: + - $ref: "#/components/parameters/multi_symbol" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns last index price + content: + application/json: + schema: + type: object + properties: + symbol: + type: array + items: + type: string + price: + type: array + items: + type: number + timestamp: + type: array + items: + type: string + required: + - symbol + - price + - timestamp + example: + symbol: + - SPX + price: + - 6395.78 + timestamp: + - '2025-08-20T16:02:06' + /index/history/eod: + x-min-subscription: free + get: + summary: End of Day + operationId: index_history_eod + tags: + - Index + - History + description: | + - Since [the indices feeds](/Articles/Data-And-Requests/The-SIPs.html) do not provide a national EOD report, Theta Data generates a national EOD report at 17:15 each day. + x-sample-urls: + - url: + http://localhost:25503/v3/index/history/eod?symbol=SPX&start_date=20241104&end_date=20241108 + description: "Returns EOD report for a given symbol between specified dates + (inclusive)" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/start_date" + - $ref: "#/components/parameters/end_date" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns EOD report for a given symbol between specified + dates (inclusive) + content: + application/json: + schema: + type: object + properties: + ask_size: + type: array + items: + type: integer + last_trade: + type: array + items: + type: string + created: + type: array + items: + type: string + ask_condition: + type: array + items: + type: integer + count: + type: array + items: + type: integer + volume: + type: array + items: + type: integer + high: + type: array + items: + type: number + low: + type: array + items: + type: number + bid_size: + type: array + items: + type: integer + ask_exchange: + type: array + items: + type: integer + bid_exchange: + type: array + items: + type: integer + ask: + type: array + items: + type: number + bid: + type: array + items: + type: number + bid_condition: + type: array + items: + type: integer + close: + type: array + items: + type: number + open: + type: array + items: + type: number + required: + - ask_size + - last_trade + - created + - ask_condition + - count + - volume + - high + - low + - bid_size + - ask_exchange + - bid_exchange + - ask + - bid + - bid_condition + - close + - open + example: + ask_size: + - 0 + - 0 + - 0 + - 0 + - 0 + last_trade: + - '2024-11-04T16:03:03' + - '2024-11-05T16:02:30' + - '2024-11-06T16:01:37' + - '2024-11-07T16:02:49' + - '2024-11-08T16:01:15' + created: + - '2024-11-04T17:19:50.198' + - '2024-11-05T17:15:03.061' + - '2024-11-06T17:16:28.297' + - '2024-11-07T17:17:17.218' + - '2024-11-08T17:21:08.187' + ask_condition: + - 0 + - 0 + - 0 + - 0 + - 0 + count: + - 0 + - 0 + - 0 + - 0 + - 0 + volume: + - 0 + - 0 + - 0 + - 0 + - 0 + high: + - 5741.43 + - 5783.44 + - 5936.14 + - 5983.84 + - 6012.45 + low: + - 5696.51 + - 5722.1 + - 5864.89 + - 5947.21 + - 5976.76 + bid_size: + - 0 + - 0 + - 0 + - 0 + - 0 + ask_exchange: + - 0 + - 0 + - 0 + - 0 + - 0 + bid_exchange: + - 0 + - 0 + - 0 + - 0 + - 0 + ask: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + bid: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + bid_condition: + - 0 + - 0 + - 0 + - 0 + - 0 + close: + - 5712.69 + - 5782.76 + - 5929.04 + - 5973.1 + - 5995.54 + open: + - 5725.15 + - 5722.43 + - 5864.89 + - 5947.21 + - 5976.76 + /index/history/ohlc: + x-min-subscription: standard + get: + summary: Open High Low Close + operationId: index_history_ohlc + tags: + - Index + - History + description: | + - Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. + - Time timestamp of the bar represents the opening time of the bar. For a trade to be part of the bar: ``bar timestamp`` <= ``trade time`` < ``bar timestamp + interval``. + - [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) typically generate a price report every second for popular indices like SPX. + x-sample-urls: + - url: + http://localhost:25503/v3/index/history/ohlc?symbol=SPX&start_date=20241104&end_date=20241104&interval=1m + description: "Returns OHLC for a given symbol between specified dates (inclusive) + with a one minute interval" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/start_date" + - $ref: "#/components/parameters/end_date" + - $ref: "#/components/parameters/interval" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns OHLC for a given symbol between specified dates + (inclusive) with a one minute interval + content: + application/json: + schema: + type: object + properties: + volume: + type: array + items: + type: integer + high: + type: array + items: + type: number + low: + type: array + items: + type: number + vwap: + type: array + items: + type: number + count: + type: array + items: + type: integer + close: + type: array + items: + type: number + open: + type: array + items: + type: number + timestamp: + type: array + items: + type: string + required: + - volume + - high + - low + - vwap + - count + - close + - open + - timestamp + example: + volume: + - 0 + - 0 + - 0 + - 0 + - 0 + high: + - 5731.27 + - 5730.4 + - 5729.2 + - 5726.71 + - 5723.33 + low: + - 5725.15 + - 5724.53 + - 5723.55 + - 5723.13 + - 5717.35 + vwap: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + count: + - 0 + - 0 + - 0 + - 0 + - 0 + close: + - 5728.56 + - 5725.42 + - 5726.54 + - 5723.13 + - 5717.64 + open: + - 5725.15 + - 5728.9 + - 5725.48 + - 5726.57 + - 5722.88 + timestamp: + - '2024-11-04T09:30:00' + - '2024-11-04T09:31:00' + - '2024-11-04T09:32:00' + - '2024-11-04T09:33:00' + - '2024-11-04T09:34:00' + /index/history/price: + x-min-subscription: value + get: + summary: Price + operationId: index_history_price + tags: + - Index + - History + description: | + - Retrieves historical indices price reports. [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) typically generate a price report every second for popular indices like SPX. + - When the ``interval`` parameter is specified, the returned data represents the price at the exact time of each timestamp. If the timestamp in the response is 10:30:00, the price field represents the price at that exact time of the day. + - A price update from the exchange is omitted if the price remained the same from the previous update. + x-sample-urls: + - url: + http://localhost:25503/v3/index/history/price?symbol=SPX&date=20241104&interval=1m + description: "Returns historical index price reports" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/interval" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns historical index price reports + content: + application/json: + schema: + type: object + properties: + price: + type: array + items: + type: number + timestamp: + type: array + items: + type: string + required: + - price + - timestamp + example: + price: + - 0.0 + - 5728.56 + - 5725.48 + - 5726.57 + - 5722.88 + timestamp: + - '2024-11-04T09:30:00' + - '2024-11-04T09:31:00' + - '2024-11-04T09:32:00' + - '2024-11-04T09:33:00' + - '2024-11-04T09:34:00' + /index/at_time/price: + x-min-subscription: value + get: + summary: Price + operationId: index_at_time_price + tags: + - Index + - At-Time + description: | + - Retrieves historical indices price reports. [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) typically generate a price report every second for popular indices like SPX. + - The ``time_of_day`` parameter represents the 00:00:00.000 ET that the price should be provided for. + x-sample-urls: + - url: + http://localhost:25503/v3/index/at_time/price?symbol=SPX&start_date=20241104&end_date=20241108&time_of_day=09:30:01.000 + description: "Returns specific at time historical index price reports" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/start_date" + - $ref: "#/components/parameters/end_date" + - $ref: "#/components/parameters/time_of_day" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns specific at time historical index price reports + content: + application/json: + schema: + type: object + properties: + sequence: + type: array + items: + type: integer + condition: + type: array + items: + type: integer + size: + type: array + items: + type: integer + price: + type: array + items: + type: number + ext_condition2: + type: array + items: + type: integer + ext_condition1: + type: array + items: + type: integer + ext_condition4: + type: array + items: + type: integer + exchange: + type: array + items: + type: integer + ext_condition3: + type: array + items: + type: integer + timestamp: + type: array + items: + type: string + required: + - sequence + - condition + - size + - price + - ext_condition2 + - ext_condition1 + - ext_condition4 + - exchange + - ext_condition3 + - timestamp + example: + sequence: + - 0 + - 0 + - 0 + - 0 + - 0 + condition: + - 0 + - 0 + - 0 + - 0 + - 0 + size: + - 0 + - 0 + - 0 + - 0 + - 0 + price: + - 5725.15 + - 5722.43 + - 5864.89 + - 5947.21 + - 5976.76 + ext_condition2: + - 255 + - 255 + - 255 + - 255 + - 255 + ext_condition1: + - 255 + - 255 + - 255 + - 255 + - 255 + ext_condition4: + - 255 + - 255 + - 255 + - 255 + - 255 + exchange: + - 5 + - 5 + - 5 + - 5 + - 5 + ext_condition3: + - 255 + - 255 + - 255 + - 255 + - 255 + timestamp: + - '2024-11-04T09:30:01' + - '2024-11-05T09:30:01' + - '2024-11-06T09:30:01' + - '2024-11-07T09:30:01' + - '2024-11-08T09:30:01' +components: + parameters: + # required parameters + single_symbol: + name: symbol + in: query + description: The stock or index symbol, or underlying symbol for options. + required: true + schema: + type: string + + multi_symbol: + name: symbol + in: query + description: The stock or index symbol, or underlying symbol for options. + Specify '*' for all symbols or a comma separated list when appropriate. + required: true + schema: + type: array + items: + type: string + + opt_multi_symbol: + name: symbol + in: query + description: The stock or index symbol, or underlying symbol for options. + required: false + schema: + type: array + items: + type: string + + date: + name: date + in: query + description: The date to fetch data for. + required: true + schema: + type: string + format: date + + end_date: + name: end_date + in: query + description: The end date (inclusive). + required: true + schema: + type: string + format: date + + start_date: + name: start_date + in: query + description: The start date (inclusive). + required: true + schema: + type: string + format: date + + opt_end_date: + name: end_date + in: query + description: The end date (inclusive). + required: false + schema: + type: string + format: date + + opt_start_date: + name: start_date + in: query + description: The start date (inclusive). + required: false + schema: + type: string + format: date + + time_of_day: + name: time_of_day + in: query + description: The time of the day to fetch data for; assumed to be + America/New_York. + required: true + schema: + type: string + format: time + + expiration: + name: expiration + in: query + description: The expiration of the contract in `YYYY-MM-DD` or `YYYYMMDD` + format, or `*` for all expirations. + required: true + schema: + type: string + format: date + + expiration_no_star: + name: expiration + in: query + description: The expiration of the contract in `YYYY-MM-DD` or `YYYYMMDD` + format. + required: true + schema: + type: string + format: date + + strike: + name: strike + in: query + description: The strike price of the contract in dollars (ie `100.00` for + `$100.00`), or `*` for all strikes. + required: false + schema: + type: string + default: "*" + + interval: + name: interval + in: query + description: The size of the time interval must be one of the available + options listed below. + required: true + schema: + type: string + enum: + - tick + - 10ms + - 100ms + - 500ms + - 1s + - 5s + - 10s + - 15s + - 30s + - 1m + - 5m + - 10m + - 15m + - 30m + - 1h + default: 1s + + security_type: + name: security_type + in: path + description: The security type. + required: true + schema: + type: string + enum: + - stock + - option + - index + + request_type: + name: request_type + in: path + description: The request type. + required: true + schema: + type: string + enum: + - trade + - quote + + + # non-required parameters + annual_dividend: + name: annual_dividend + in: query + description: The annualized expected dividend amount to be used in Greeks + calculations. + required: false + schema: + type: number + format: float + + end_time: + name: end_time + in: query + description: The end time (inclusive) in the specified day. + required: false + schema: + type: string + format: time + default: "16:00:00" + + exclusive: + name: exclusive + in: query + description: If you prefer to match quotes with timestamps that are < the + trade timestamp. + required: false + schema: + type: boolean + default: true + + format: + name: format + in: query + description: The format of the data when returned to the user. + required: false + schema: + type: string + enum: + - csv + - json + - ndjson + default: ndjson + + rate_type: + name: rate_type + in: query + description: The interest rate type to be used in a Greeks calculation. + required: false + schema: + type: string + enum: + - sofr + - treasury_m1 + - treasury_m3 + - treasury_m6 + - treasury_y1 + - treasury_y2 + - treasury_y3 + - treasury_y5 + - treasury_y7 + - treasury_y10 + - treasury_y20 + - treasury_y30 + default: sofr + + rate_value: + name: rate_value + in: query + description: The interest rate, as a percent, to be used in a Greeks + calculation. + required: false + schema: + type: number + format: float + example: 5.0 + + right: + name: right + in: query + description: The right (call or put) of the contract. + required: false + schema: + type: string + enum: + - call + - put + - both + default: both + + start_time: + name: start_time + in: query + description: The start time (inclusive) in the specified day. + required: false + schema: + type: string + format: time + default: "09:30:00" + + stock_price: + name: stock_price + in: query + description: The underlying stock price to be used in the Greeks + calculation. + required: false + schema: + type: number + format: float + + venue: + name: venue + in: query + description: Used to specify the venue of the real time or historic + request. ``nqb`` = Nasdaq Basic; ``utp_cta`` = merged UTP & CTA. + required: false + schema: + type: string + enum: + - nqb + - utp_cta + default: nqb + + responses: + 200_OK: + description: "" + content: + text/csv: + schema: + type: string + + diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml new file mode 100644 index 000000000..85f3672d8 --- /dev/null +++ b/openapi/openapiv3.yaml @@ -0,0 +1,8260 @@ +openapi: 3.1.0 + +info: + title: Theta Data v3 + description: Real-time and historic stock, options, and index data! + version: 3.0.0 + x-java-package: net.thetadata.generated + +servers: + - url: 'https://localhost:25503/v3' + description: dev + +security: [] + + +paths: +# +# STOCK ENDPOINTS +# + /stock/list/symbols: + x-min-subscription: free + get: + summary: Symbols + operationId: stock_list_symbols + tags: + - Stock + - List + description: | + A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also include: root, ticker, and underlying. This endpoint returns all traded symbols for stocks. This endpoint is updated overnight. + x-sample-urls: + - url: http://localhost:25503/v3/stock/list/symbols + description: "List all stock symbols" + parameters: + - $ref: "#/components/parameters/format" + responses: + '200': + description: List all stock symbols + content: + text/csv: + schema: + type: array + items: &id001 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + example: "symbol\r\nA\r\nAA\r\nAAA\r\nAAAA\r\nAAAP\r\n" + application/json: + schema: &id002 + type: array + items: *id001 + example: + symbol: + - A + - AA + - AAA + - AAAA + - AAAP + application/x-ndjson: + schema: *id002 + example: '{"symbol":"A"} + + {"symbol":"AA"} + + {"symbol":"AAA"} + + {"symbol":"AAAA"} + + {"symbol":"AAAP"}' + + /stock/list/dates/{request_type}: + x-min-subscription: free + get: + summary: Dates + operationId: stock_list_dates + tags: + - Stock + - List + description: | + Lists all dates of data that are available for a stock with a given request type and symbol. This endpoint is updated overnight. + x-sample-urls: + - url: http://localhost:25503/v3/stock/list/dates/quote?symbol=AAPL + description: "List all dates for a stock quote for a given symbol" + - url: http://localhost:25503/v3/stock/list/dates/trade?symbol=AAPL,SPY + description: "List all dates for a stock trade for multiple symbols" + - url: http://localhost:25503/v3/stock/list/dates/trade?symbol=* + description: "List all dates for a stock trade for all symbols" + parameters: + - $ref: "#/components/parameters/request_type" + - $ref: "#/components/parameters/multi_symbol" + - $ref: "#/components/parameters/format" + responses: + '200': + description: List all dates for a stock quote for a given symbol + content: + text/csv: + schema: + type: array + items: &id003 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + date: + type: string + format: date + description: The date formated as YYYY-MM-DD. + example: "symbol,date\r\nAAPL,2016-08-19\r\nAAPL,2016-08-18\r\nAAPL,2016-08-17\r\nAAPL,2016-08-16\r\nAAPL,2016-08-23\r\ + \n" + application/json: + schema: &id004 + type: array + items: *id003 + example: + date: + - '2016-08-19' + - '2016-08-18' + - '2016-08-17' + - '2016-08-16' + - '2016-08-23' + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + application/x-ndjson: + schema: *id004 + example: '{"date":"2016-08-19","symbol":"AAPL"} + + {"date":"2016-08-18","symbol":"AAPL"} + + {"date":"2016-08-17","symbol":"AAPL"} + + {"date":"2016-08-16","symbol":"AAPL"} + + {"date":"2016-08-23","symbol":"AAPL"}' + + /stock/snapshot/ohlc: + x-min-subscription: value + get: + summary: Open High Low Close + operationId: stock_snapshot_ohlc + tags: + - Stock + - Snapshot + description: | + + Provides a real-time Open, High, Low, Close for the current day. + * Returns a real-time session OHLC from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks). + * Returns a 15-minute delayed session OHLC from the [UTP & CTA feeds](/Articles/Data-And-Requests/The-SIPs) if the account has the stocks value subscription. + * ThetaData resets its snapshot cache at midnight ET every day. This endpoint may not work on a weekend where there were no eligible messages sent over exchange feeds. We recommend using historic requests during the weekend. + x-sample-urls: + - url: http://localhost:25503/v3/stock/snapshot/ohlc?symbol=* + description: "Returns OHLC for stocks for all symbols" + - url: http://localhost:25503/v3/stock/snapshot/ohlc?symbol=AAPL&venue=nqb + description: "Returns OHLC for a given stock trade from the Nasdaq Basic feed" + parameters: + - $ref: "#/components/parameters/multi_symbol" + - $ref: "#/components/parameters/venue" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns OHLC for stocks for all symbols + content: + text/csv: + schema: + type: array + items: &id005 + type: object + properties: + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + open: + type: number + description: The opening trade price. + high: + type: number + description: The highest traded price. + low: + type: number + description: The lowest traded price. + close: + type: number + description: The closing traded price. + volume: + type: integer + description: The amount of contracts / shares traded. + count: + type: integer + description: The amount of trades. + example: "timestamp,symbol,open,high,low,close,volume,count\r\n2025-08-20T16:10:04.43,CVCO,492.0000,492.0000,480.5477,485.1100,119656,7684\r\ + \n2025-08-20T16:11:13.962,IFRX,0.8900,0.9199,0.8529,0.8929,57048,138\r\n2025-08-20T16:04:10.564,KLXY,0.0000,0.0000,0.0000,0.0000,9,6\r\ + \n2025-08-20T16:04:07.554,HCOW,23.5600,23.6976,23.5600,23.6616,3648,44\r\n2025-08-20T16:22:32.726,SCS,16.2000,16.3200,16.1550,16.1800,992620,7690\r\ + \n" + application/json: + schema: &id006 + type: array + items: *id005 + example: + volume: + - 119656 + - 57048 + - 9 + - 3648 + - 992620 + symbol: + - CVCO + - IFRX + - KLXY + - HCOW + - SCS + high: + - 492.0 + - 0.9199 + - 0.0 + - 23.6976 + - 16.32 + low: + - 480.5477 + - 0.8529 + - 0.0 + - 23.56 + - 16.155 + count: + - 7684 + - 138 + - 6 + - 44 + - 7690 + close: + - 485.11 + - 0.8929 + - 0.0 + - 23.6616 + - 16.18 + open: + - 492.0 + - 0.89 + - 0.0 + - 23.56 + - 16.2 + timestamp: + - '2025-08-20T16:10:04.43' + - '2025-08-20T16:11:13.962' + - '2025-08-20T16:04:10.564' + - '2025-08-20T16:04:07.554' + - '2025-08-20T16:22:32.726' + application/x-ndjson: + schema: *id006 + example: '{"volume":119656,"symbol":"CVCO","high":492.0000,"low":480.5477,"count":7684,"close":485.1100,"open":492.0000,"timestamp":"2025-08-20T16:10:04.43"} + + {"volume":57048,"symbol":"IFRX","high":0.9199,"low":0.8529,"count":138,"close":0.8929,"open":0.8900,"timestamp":"2025-08-20T16:11:13.962"} + + {"volume":9,"symbol":"KLXY","high":0.0000,"low":0.0000,"count":6,"close":0.0000,"open":0.0000,"timestamp":"2025-08-20T16:04:10.564"} + + {"volume":3648,"symbol":"HCOW","high":23.6976,"low":23.5600,"count":44,"close":23.6616,"open":23.5600,"timestamp":"2025-08-20T16:04:07.554"} + + {"volume":992620,"symbol":"SCS","high":16.3200,"low":16.1550,"count":7690,"close":16.1800,"open":16.2000,"timestamp":"2025-08-20T16:22:32.726"}' + + /stock/snapshot/trade: + x-min-subscription: standard + get: + summary: Trade + operationId: stock_snapshot_trade + tags: + - Stock + - Snapshot + description: | + + Returns a real-time last trade from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks). + + - ThetaData resets its snapshot cache at midnight ET every day. This endpoint may not work on a weekend where there were no eligible messages sent over exchange feeds. We recommend using historic requests during the weekend. + x-sample-urls: + - url: http://localhost:25503/v3/stock/snapshot/trade?symbol=AAPL + description: "Returns last trade for stocks for a given symbol" + parameters: + - $ref: "#/components/parameters/multi_symbol" + - $ref: "#/components/parameters/venue" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns last trade for stocks for a given symbol + content: + text/csv: + schema: + type: array + items: &id007 + type: object + properties: + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + sequence: + type: integer + description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences). + size: + type: integer + description: The amount of contracts / shares traded. + condition: + type: integer + description: The trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html). + price: + type: number + description: The trade price. + example: "timestamp,symbol,sequence,size,condition,price\r\n2025-08-20T16:36:05.549,AAPL,63539137,23,1,225.7500\r\ + \n" + application/json: + schema: &id008 + type: array + items: *id007 + example: + symbol: + - AAPL + sequence: + - 63539137 + condition: + - 1 + size: + - 23 + price: + - 225.75 + timestamp: + - '2025-08-20T16:36:05.549' + application/x-ndjson: + schema: *id008 + example: '{"symbol":"AAPL","sequence":63539137,"condition":1,"size":23,"price":225.7500,"timestamp":"2025-08-20T16:36:05.549"}' + + /stock/snapshot/quote: + x-min-subscription: value + get: + summary: Quote + operationId: stock_snapshot_quote + tags: + - Stock + - Snapshot + description: | + * Returns a real-time last BBO quote from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks). + * Returns a 15-minute delayed NBBO quote from the [UTP & CTA feeds](/Articles/Data-And-Requests/The-SIPs) account has the [stocks value subscription](https://www.thetadata.net/subscribe.html#stocks) subscription. + - ThetaData resets its snapshot cache at midnight ET every day. This endpoint may not work on a weekend where there were no eligible messages sent over exchange feeds. We recommend using historic requests during the weekend. + x-sample-urls: + - url: http://localhost:25503/v3/stock/snapshot/quote?symbol=* + description: "Returns last quote for stocks for all symbols" + - url: http://localhost:25503/v3/stock/snapshot/quote?symbol=AAPL&venue=nqb + description: "Returns OHLC for a given stock trade from the Nasdaq Basic feed" + parameters: + - $ref: "#/components/parameters/multi_symbol" + - $ref: "#/components/parameters/venue" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns last quote for stocks for all symbols + content: + text/csv: + schema: + type: array + items: &id009 + type: object + properties: + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + bid_size: + type: integer + description: The last NBBO bid size. + bid_exchange: + type: integer + description: The last NBBO bid [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html). + bid: + type: number + description: The last NBBO bid price. + bid_condition: + type: integer + description: The last NBBO bid [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html). + ask_size: + type: integer + description: The last NBBO ask size. + ask_exchange: + type: integer + description: The last NBBO ask [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html). + ask: + type: number + description: The last NBBO ask price. + ask_condition: + type: integer + description: The last NBBO ask [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html). + example: "timestamp,symbol,bid_size,bid_exchange,bid,bid_condition,ask_size,ask_exchange,ask,ask_condition\r\ + \n2025-08-20T16:03:05.142,CVCO,1,29,475.75,0,3,29,494.33,0\r\n2025-08-20T16:10:05.032,KLXY,200,29,12.40,0,200,29,37.18,0\r\ + \n2025-08-20T16:21:05.781,IFRX,100,29,0.7510,0,45,29,0.9500,0\r\n2025-08-20T16:19:55.101,SCS,100,29,14.64,0,100,29,17.60,0\r\ + \n2025-08-20T16:33:50.877,BBC,100,29,13.29,0,2800,29,24.06,0\r\n" + application/json: + schema: &id010 + type: array + items: *id009 + example: + symbol: + - CVCO + - KLXY + - IFRX + - SCS + - BBC + ask_size: + - 3 + - 200 + - 45 + - 100 + - 2800 + bid_size: + - 1 + - 200 + - 100 + - 100 + - 100 + ask_exchange: + - 29 + - 29 + - 29 + - 29 + - 29 + ask_condition: + - 0 + - 0 + - 0 + - 0 + - 0 + bid_exchange: + - 29 + - 29 + - 29 + - 29 + - 29 + ask: + - 494.33 + - 37.18 + - 0.95 + - 17.6 + - 24.06 + bid: + - 475.75 + - 12.4 + - 0.751 + - 14.64 + - 13.29 + bid_condition: + - 0 + - 0 + - 0 + - 0 + - 0 + timestamp: + - '2025-08-20T16:03:05.142' + - '2025-08-20T16:10:05.032' + - '2025-08-20T16:21:05.781' + - '2025-08-20T16:19:55.101' + - '2025-08-20T16:33:50.877' + application/x-ndjson: + schema: *id010 + example: '{"symbol":"CVCO","ask_size":3,"bid_size":1,"ask_exchange":29,"ask_condition":0,"bid_exchange":29,"ask":494.33,"bid":475.75,"bid_condition":0,"timestamp":"2025-08-20T16:03:05.142"} + + {"symbol":"KLXY","ask_size":200,"bid_size":200,"ask_exchange":29,"ask_condition":0,"bid_exchange":29,"ask":37.18,"bid":12.40,"bid_condition":0,"timestamp":"2025-08-20T16:10:05.032"} + + {"symbol":"IFRX","ask_size":45,"bid_size":100,"ask_exchange":29,"ask_condition":0,"bid_exchange":29,"ask":0.9500,"bid":0.7510,"bid_condition":0,"timestamp":"2025-08-20T16:21:05.781"} + + {"symbol":"SCS","ask_size":100,"bid_size":100,"ask_exchange":29,"ask_condition":0,"bid_exchange":29,"ask":17.60,"bid":14.64,"bid_condition":0,"timestamp":"2025-08-20T16:19:55.101"} + + {"symbol":"BBC","ask_size":2800,"bid_size":100,"ask_exchange":29,"ask_condition":0,"bid_exchange":29,"ask":24.06,"bid":13.29,"bid_condition":0,"timestamp":"2025-08-20T16:33:50.877"}' + + /stock/history/eod: + x-min-subscription: free + get: + summary: End of Day + operationId: stock_history_eod + tags: + - Stock + - History + description: | + + Since [the equity SIPs](/Articles/Data-And-Requests/The-SIPs.html) only generate a partial EOD report, Theta Data generates a national EOD report at 17:15 ET each day. ``created`` represents the datetime the report was generated and ``last_trade`` represents the datetime of the last trade. The quote in the response represents the last NBBO reported by [CTA or UTP](/Articles/Data-And-Requests/The-SIPs.html) at the time of report generation. You can read more about EOD & OHLC data [here](/Articles/Data-And-Requests/OHLC-EOD.html). Theta Data plans to avail SIP EOD reports in the near future. + x-sample-urls: + - url: http://localhost:25503/v3/stock/history/eod?symbol=AAPL&start_date=20240101&end_date=20240131 + description: "Returns EOD report for a given symbol between specified dates (inclusive)" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/start_date" + - $ref: "#/components/parameters/end_date" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns EOD report for a given symbol between specified dates (inclusive) + content: + text/csv: + schema: + type: array + items: &id011 + type: object + properties: + created: + type: string + format: date-time + description: The date formated as YYYY-MM-DDTHH:mm:ss.SSS format. + last_trade: + type: string + format: date-time + description: The last trade date formated as YYYY-MM-DDTHH:mm:ss.SSS format. + open: + type: number + description: The opening trade price. + high: + type: number + description: The highest traded price. + low: + type: number + description: The lowest traded price. + close: + type: number + description: The closing traded price. + volume: + type: integer + description: The amount of contracts / shares traded. + count: + type: integer + description: The amount of trades. + bid_size: + type: integer + description: The last NBBO bid size. + bid_exchange: + type: integer + description: The last NBBO bid [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html). + bid: + type: number + description: The last NBBO bid price. + bid_condition: + type: integer + description: The last NBBO bid [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html). + ask_size: + type: integer + description: The last NBBO ask size. + ask_exchange: + type: integer + description: The last NBBO ask [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html). + ask: + type: number + description: The last NBBO ask price. + ask_condition: + type: integer + description: The last NBBO ask [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html). + example: "created,last_trade,open,high,low,close,volume,count,bid_size,bid_exchange,bid,bid_condition,ask_size,ask_exchange,ask,ask_condition\r\ + \n2024-01-02T17:17:53.606,2024-01-02T17:17:51.877,187.030,188.440,183.885,185.640,80680243,1003582,2,7,18.534,0,2,1,18.536,0\r\ + \n2024-01-03T17:16:29.883,2024-01-03T17:16:28.586,184.200,185.880,183.430,184.250,58308345,654127,5,7,18.405,0,2,1,18.410,0\r\ + \n2024-01-04T17:17:06.02,2024-01-04T17:17:02.445,182.0000,183.0872,180.8800,181.9100,71197269,709246,8,60,1.8176,0,2,7,1.8179,0\r\ + \n2024-01-05T17:16:57.032,2024-01-05T17:16:49.821,181.900,182.760,180.170,181.180,61949135,679405,3,1,18.103,0,3,7,18.105,0\r\ + \n2024-01-08T17:17:01.83,2024-01-08T17:17:01.484,182.000,185.600,181.500,185.560,59029146,665626,4,1,18.528,0,1,65,18.537,0\r\ + \n" + application/json: + schema: &id012 + type: array + items: *id011 + example: + ask_size: + - 2 + - 2 + - 2 + - 3 + - 1 + last_trade: + - '2024-01-02T17:17:51.877' + - '2024-01-03T17:16:28.586' + - '2024-01-04T17:17:02.445' + - '2024-01-05T17:16:49.821' + - '2024-01-08T17:17:01.484' + created: + - '2024-01-02T17:17:53.606' + - '2024-01-03T17:16:29.883' + - '2024-01-04T17:17:06.02' + - '2024-01-05T17:16:57.032' + - '2024-01-08T17:17:01.83' + ask_condition: + - 0 + - 0 + - 0 + - 0 + - 0 + count: + - 1003582 + - 654127 + - 709246 + - 679405 + - 665626 + volume: + - 80680243 + - 58308345 + - 71197269 + - 61949135 + - 59029146 + high: + - 188.44 + - 185.88 + - 183.0872 + - 182.76 + - 185.6 + low: + - 183.885 + - 183.43 + - 180.88 + - 180.17 + - 181.5 + bid_size: + - 2 + - 5 + - 8 + - 3 + - 4 + ask_exchange: + - 1 + - 1 + - 7 + - 7 + - 65 + bid_exchange: + - 7 + - 7 + - 60 + - 1 + - 1 + ask: + - 18.536 + - 18.41 + - 1.8179 + - 18.105 + - 18.537 + bid: + - 18.534 + - 18.405 + - 1.8176 + - 18.103 + - 18.528 + bid_condition: + - 0 + - 0 + - 0 + - 0 + - 0 + close: + - 185.64 + - 184.25 + - 181.91 + - 181.18 + - 185.56 + open: + - 187.03 + - 184.2 + - 182.0 + - 181.9 + - 182.0 + application/x-ndjson: + schema: *id012 + example: '{"ask_size":2,"last_trade":"2024-01-02T17:17:51.877","created":"2024-01-02T17:17:53.606","ask_condition":0,"count":1003582,"volume":80680243,"high":188.440,"low":183.885,"bid_size":2,"ask_exchange":1,"bid_exchange":7,"ask":18.536,"bid":18.534,"bid_condition":0,"close":185.640,"open":187.030} + + {"ask_size":2,"last_trade":"2024-01-03T17:16:28.586","created":"2024-01-03T17:16:29.883","ask_condition":0,"count":654127,"volume":58308345,"high":185.880,"low":183.430,"bid_size":5,"ask_exchange":1,"bid_exchange":7,"ask":18.410,"bid":18.405,"bid_condition":0,"close":184.250,"open":184.200} + + {"ask_size":2,"last_trade":"2024-01-04T17:17:02.445","created":"2024-01-04T17:17:06.02","ask_condition":0,"count":709246,"volume":71197269,"high":183.0872,"low":180.8800,"bid_size":8,"ask_exchange":7,"bid_exchange":60,"ask":1.8179,"bid":1.8176,"bid_condition":0,"close":181.9100,"open":182.0000} + + {"ask_size":3,"last_trade":"2024-01-05T17:16:49.821","created":"2024-01-05T17:16:57.032","ask_condition":0,"count":679405,"volume":61949135,"high":182.760,"low":180.170,"bid_size":3,"ask_exchange":7,"bid_exchange":1,"ask":18.105,"bid":18.103,"bid_condition":0,"close":181.180,"open":181.900} + + {"ask_size":1,"last_trade":"2024-01-08T17:17:01.484","created":"2024-01-08T17:17:01.83","ask_condition":0,"count":665626,"volume":59029146,"high":185.600,"low":181.500,"bid_size":4,"ask_exchange":65,"bid_exchange":1,"ask":18.537,"bid":18.528,"bid_condition":0,"close":185.560,"open":182.000}' + + /stock/history/ohlc: + x-min-subscription: value + get: + summary: Open High Low Close + operationId: stock_history_ohlc + tags: + - Stock + - History + description: | + Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. Time timestamp of the bar represents the opening time of the bar. For a trade to be part of the bar: ``bar time`` <= ``trade time`` < ``bar timestamp + ivl``, where ivl is the specified interval size in milliseconds. Set the ``venue`` parameter to ``nqb`` to access current-day real-time historic data from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks). + x-sample-urls: + - url: http://localhost:25503/v3/stock/history/ohlc?symbol=AAPL&date=20240102&interval=1m + description: "Returns OHLC for a given symbol between specified dates (inclusive) with a one minute interval" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/interval" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/venue" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns OHLC for a given symbol between specified dates (inclusive) with a one minute interval + content: + text/csv: + schema: + type: array + items: &id013 + type: object + properties: + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + open: + type: number + description: The opening trade price. + high: + type: number + description: The highest traded price. + low: + type: number + description: The lowest traded price. + close: + type: number + description: The closing traded price. + volume: + type: integer + description: The amount of contracts / shares traded. + count: + type: integer + description: The amount of trades. + vwap: + type: number + description: The volume weighted average price of the given interval. + example: "timestamp,open,high,low,close,volume,count,vwap\r\n2024-01-02T09:30:00,187.1500,188.050,186.350,187.830,3256708,37886,187.25\r\ + \n2024-01-02T09:31:00,187.830,188.120,187.630,187.765,809707,7481,187.38\r\n2024-01-02T09:32:00,187.770,188.440,187.730,188.2984,687086,7103,187.48\r\ + \n2024-01-02T09:33:00,188.3050,188.310,187.810,188.160,485275,6245,187.53\r\n2024-01-02T09:34:00,188.150,188.150,187.670,187.730,415948,5942,187.55\r\ + \n" + application/json: + schema: &id014 + type: array + items: *id013 + example: + volume: + - 3256708 + - 809707 + - 687086 + - 485275 + - 415948 + high: + - 188.05 + - 188.12 + - 188.44 + - 188.31 + - 188.15 + low: + - 186.35 + - 187.63 + - 187.73 + - 187.81 + - 187.67 + vwap: + - 187.25 + - 187.38 + - 187.48 + - 187.53 + - 187.55 + count: + - 37886 + - 7481 + - 7103 + - 6245 + - 5942 + close: + - 187.83 + - 187.765 + - 188.2984 + - 188.16 + - 187.73 + open: + - 187.15 + - 187.83 + - 187.77 + - 188.305 + - 188.15 + timestamp: + - '2024-01-02T09:30:00' + - '2024-01-02T09:31:00' + - '2024-01-02T09:32:00' + - '2024-01-02T09:33:00' + - '2024-01-02T09:34:00' + application/x-ndjson: + schema: *id014 + example: '{"volume":3256708,"high":188.050,"low":186.350,"vwap":187.25,"count":37886,"close":187.830,"open":187.1500,"timestamp":"2024-01-02T09:30:00"} + + {"volume":809707,"high":188.120,"low":187.630,"vwap":187.38,"count":7481,"close":187.765,"open":187.830,"timestamp":"2024-01-02T09:31:00"} + + {"volume":687086,"high":188.440,"low":187.730,"vwap":187.48,"count":7103,"close":188.2984,"open":187.770,"timestamp":"2024-01-02T09:32:00"} + + {"volume":485275,"high":188.310,"low":187.810,"vwap":187.53,"count":6245,"close":188.160,"open":188.3050,"timestamp":"2024-01-02T09:33:00"} + + {"volume":415948,"high":188.150,"low":187.670,"vwap":187.55,"count":5942,"close":187.730,"open":188.150,"timestamp":"2024-01-02T09:34:00"}' + + /stock/history/trade: + x-min-subscription: standard + get: + summary: Trade + operationId: stock_history_trade + tags: + - Stock + - History + description: | + Returns every trade reported by [UTP & CTA](/Articles/Data-And-Requests/The-SIPs). Set the ``venue`` parameter to ``nqb`` to access current-day real-time historic data from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks). + x-sample-urls: + - url: http://localhost:25503/v3/stock/history/trade?symbol=AAPL&date=20240102 + description: "Returns every trade for a given symbol between specified dates (inclusive) with a one minute interval" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/venue" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns every trade for a given symbol between specified dates (inclusive) with a one minute interval + content: + text/csv: + schema: + type: array + items: &id015 + type: object + properties: + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + sequence: + type: integer + description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences). + ext_condition1: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition2: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition3: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition4: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + condition: + type: integer + description: The trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html). + size: + type: integer + description: The amount of contracts / shares traded. + exchange: + type: integer + description: The [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html) the trade was executed. + price: + type: number + description: The trade price. + example: "timestamp,sequence,ext_condition1,ext_condition2,ext_condition3,ext_condition4,condition,size,exchange,price\r\ + \n2024-01-02T09:30:00.011,14920,32,95,1,115,1,2,7,187.1800\r\n2024-01-02T09:30:00.014,8931,32,255,1,115,1,1,1,187.1800\r\ + \n2024-01-02T09:30:00.014,8932,32,255,1,115,1,5,1,187.1800\r\n2024-01-02T09:30:00.014,8933,32,255,1,115,1,3,1,187.1900\r\ + \n2024-01-02T09:30:00.014,8934,32,255,1,115,1,91,1,187.1900\r\n" + application/x-ndjson: + schema: + type: array + items: *id015 + example: '{"sequence":14920,"condition":1,"size":2,"price":187.1800,"ext_condition2":95,"ext_condition1":32,"ext_condition4":115,"exchange":7,"ext_condition3":1,"timestamp":"2024-01-02T09:30:00.011"} + + {"sequence":8931,"condition":1,"size":1,"price":187.1800,"ext_condition2":255,"ext_condition1":32,"ext_condition4":115,"exchange":1,"ext_condition3":1,"timestamp":"2024-01-02T09:30:00.014"} + + {"sequence":8932,"condition":1,"size":5,"price":187.1800,"ext_condition2":255,"ext_condition1":32,"ext_condition4":115,"exchange":1,"ext_condition3":1,"timestamp":"2024-01-02T09:30:00.014"} + + {"sequence":8933,"condition":1,"size":3,"price":187.1900,"ext_condition2":255,"ext_condition1":32,"ext_condition4":115,"exchange":1,"ext_condition3":1,"timestamp":"2024-01-02T09:30:00.014"} + + {"sequence":8934,"condition":1,"size":91,"price":187.1900,"ext_condition2":255,"ext_condition1":32,"ext_condition4":115,"exchange":1,"ext_condition3":1,"timestamp":"2024-01-02T09:30:00.014"}' + + /stock/history/quote: + x-min-subscription: value + get: + summary: Quote + operationId: stock_history_quote + tags: + - Stock + - History + description: | + Returns every NBBO quote reported by [UTP and CTA](/Articles/Data-And-Requests/The-SIPs). If the ``interval`` parameter is specified, the quote for each interval represents the last quote prior to the interval's timestamp. Set the ``venue`` parameter to ``nqb`` to access current-day real-time historic data from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks). + x-sample-urls: + - url: http://localhost:25503/v3/stock/history/quote?symbol=AAPL&date=20240102&interval=1m + description: "Returns every quote for a given symbol between specified dates (inclusive) with a one minute interval" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/interval" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/venue" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns every quote for a given symbol between specified dates (inclusive) with a one minute interval + content: + text/csv: + schema: + type: array + items: &id016 + type: object + properties: + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + bid_size: + type: integer + description: The last NBBO bid size. + bid_exchange: + type: integer + description: The last NBBO bid [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html). + bid: + type: number + description: The last NBBO bid price. + bid_condition: + type: integer + description: The last NBBO bid [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html). + ask_size: + type: integer + description: The last NBBO ask size. + ask_exchange: + type: integer + description: The last NBBO ask [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html). + ask: + type: number + description: The last NBBO ask price. + ask_condition: + type: integer + description: The last NBBO ask [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html). + example: "timestamp,bid_size,bid_exchange,bid,bid_condition,ask_size,ask_exchange,ask,ask_condition\r\n2024-01-02T09:30:00,30,7,187.10,0,1,1,187.20,0\r\ + \n2024-01-02T09:31:00,2,1,187.83,0,4,1,187.86,0\r\n2024-01-02T09:32:00,2,60,187.74,0,1,73,187.77,0\r\n2024-01-02T09:33:00,2,60,188.29,0,2,73,188.32,0\r\ + \n2024-01-02T09:34:00,5,1,188.14,0,2,7,188.16,0\r\n" + application/json: + schema: &id017 + type: array + items: *id016 + example: + ask_size: + - 1 + - 4 + - 1 + - 2 + - 2 + bid_size: + - 30 + - 2 + - 2 + - 2 + - 5 + ask_exchange: + - 1 + - 1 + - 73 + - 73 + - 7 + ask_condition: + - 0 + - 0 + - 0 + - 0 + - 0 + bid_exchange: + - 7 + - 1 + - 60 + - 60 + - 1 + ask: + - 187.2 + - 187.86 + - 187.77 + - 188.32 + - 188.16 + bid: + - 187.1 + - 187.83 + - 187.74 + - 188.29 + - 188.14 + bid_condition: + - 0 + - 0 + - 0 + - 0 + - 0 + timestamp: + - '2024-01-02T09:30:00' + - '2024-01-02T09:31:00' + - '2024-01-02T09:32:00' + - '2024-01-02T09:33:00' + - '2024-01-02T09:34:00' + application/x-ndjson: + schema: *id017 + example: '{"ask_size":1,"bid_size":30,"ask_exchange":1,"ask_condition":0,"bid_exchange":7,"ask":187.20,"bid":187.10,"bid_condition":0,"timestamp":"2024-01-02T09:30:00"} + + {"ask_size":4,"bid_size":2,"ask_exchange":1,"ask_condition":0,"bid_exchange":1,"ask":187.86,"bid":187.83,"bid_condition":0,"timestamp":"2024-01-02T09:31:00"} + + {"ask_size":1,"bid_size":2,"ask_exchange":73,"ask_condition":0,"bid_exchange":60,"ask":187.77,"bid":187.74,"bid_condition":0,"timestamp":"2024-01-02T09:32:00"} + + {"ask_size":2,"bid_size":2,"ask_exchange":73,"ask_condition":0,"bid_exchange":60,"ask":188.32,"bid":188.29,"bid_condition":0,"timestamp":"2024-01-02T09:33:00"} + + {"ask_size":2,"bid_size":5,"ask_exchange":7,"ask_condition":0,"bid_exchange":1,"ask":188.16,"bid":188.14,"bid_condition":0,"timestamp":"2024-01-02T09:34:00"}' + + /stock/history/trade_quote: + x-min-subscription: standard + get: + summary: Trade Quote + operationId: stock_history_trade_quote + tags: + - Stock + - History + description: | + Returns every trade reported by [UTP & CTA](/Articles/Data-And-Requests/The-SIPs) paired with the last BBO quote reported by [UTP or CTA](/Articles/Data-And-Requests/The-SIPs) at the time of trade. A quote is matched with a trade if its timestamp ``<=`` the trade timestamp. If you prefer to match quotes with timestamps that are ``<`` the trade timestamp, specify the ``exclusive`` parameter to ``true``. Set the ``venue`` parameter to ``nqb`` to access current-day real-time historic data from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks). + x-sample-urls: + - url: http://localhost:25503/v3/stock/history/trade_quote?symbol=AAPL&date=20240102 + description: "Returns every trade quote for a given symbol between specified dates (inclusive)" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/exclusive" + - $ref: "#/components/parameters/venue" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns every trade quote for a given symbol between specified dates (inclusive) + content: + text/csv: + schema: + type: array + items: &id018 + type: object + properties: + trade_timestamp: + type: string + format: date-time + description: The trade date formated as YYYY-MM-DDTHH:mm:ss.SSS format. + quote_timestamp: + type: string + format: date-time + description: The quote date formated as YYYY-MM-DDTHH:mm:ss.SSS format. + sequence: + type: integer + description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences). + ext_condition1: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition2: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition3: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition4: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + condition: + type: integer + description: The trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html). + size: + type: integer + description: The amount of contracts / shares traded. + exchange: + type: integer + description: The [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html) the trade was executed. + price: + type: number + description: The trade price. + bid_size: + type: integer + description: The last NBBO bid size. + bid_exchange: + type: integer + description: The last NBBO bid [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html). + bid: + type: number + description: The last NBBO bid price. + bid_condition: + type: integer + description: The last NBBO bid [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html). + ask_size: + type: integer + description: The last NBBO ask size. + ask_exchange: + type: integer + description: The last NBBO ask [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html). + ask: + type: number + description: The last NBBO ask price. + ask_condition: + type: integer + description: The last NBBO ask [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html). + example: "trade_timestamp,quote_timestamp,sequence,ext_condition1,ext_condition2,ext_condition3,ext_condition4,condition,size,exchange,price,bid_size,bid_exchange,bid,bid_condition,ask_size,ask_exchange,ask,ask_condition\r\ + \n2023-01-03T09:30:00.002,2023-01-03T09:30:00.001,562,32,255,255,115,115,1,60,130.3300,4,7,130.2600,0,1,7,130.4000,0\r\ + \n2023-01-03T09:30:00.003,2023-01-03T09:30:00.002,563,32,255,255,115,115,24,60,130.3300,4,7,130.2600,0,1,7,130.4000,0\r\ + \n2023-01-03T09:30:00.003,2023-01-03T09:30:00.002,564,32,255,255,115,115,40,60,130.3300,4,7,130.2600,0,1,7,130.4000,0\r\ + \n2023-01-03T09:30:00.036,2023-01-03T09:30:00.017,6081,32,95,1,115,1,19,1,130.2500,4,7,130.2600,0,1,1,130.3900,0\r\ + \n2023-01-03T09:30:00.057,2023-01-03T09:30:00.017,6082,32,255,1,115,1,30,1,130.2500,4,7,130.2600,0,1,1,130.3900,0\r\ + \n" + application/x-ndjson: + schema: + type: array + items: *id018 + example: '{"ask_size":1,"trade_timestamp":"2023-01-03T09:30:00.002","ask_condition":0,"sequence":562,"condition":115,"size":1,"bid_size":4,"ask_exchange":7,"price":130.3300,"ext_condition2":255,"bid_exchange":7,"ask":130.4000,"quote_timestamp":"2023-01-03T09:30:00.001","ext_condition1":32,"ext_condition4":115,"exchange":60,"ext_condition3":255,"bid":130.2600,"bid_condition":0} + + {"ask_size":1,"trade_timestamp":"2023-01-03T09:30:00.003","ask_condition":0,"sequence":563,"condition":115,"size":24,"bid_size":4,"ask_exchange":7,"price":130.3300,"ext_condition2":255,"bid_exchange":7,"ask":130.4000,"quote_timestamp":"2023-01-03T09:30:00.002","ext_condition1":32,"ext_condition4":115,"exchange":60,"ext_condition3":255,"bid":130.2600,"bid_condition":0} + + {"ask_size":1,"trade_timestamp":"2023-01-03T09:30:00.003","ask_condition":0,"sequence":564,"condition":115,"size":40,"bid_size":4,"ask_exchange":7,"price":130.3300,"ext_condition2":255,"bid_exchange":7,"ask":130.4000,"quote_timestamp":"2023-01-03T09:30:00.002","ext_condition1":32,"ext_condition4":115,"exchange":60,"ext_condition3":255,"bid":130.2600,"bid_condition":0} + + {"ask_size":1,"trade_timestamp":"2023-01-03T09:30:00.036","ask_condition":0,"sequence":6081,"condition":1,"size":19,"bid_size":4,"ask_exchange":1,"price":130.2500,"ext_condition2":95,"bid_exchange":7,"ask":130.3900,"quote_timestamp":"2023-01-03T09:30:00.017","ext_condition1":32,"ext_condition4":115,"exchange":1,"ext_condition3":1,"bid":130.2600,"bid_condition":0} + + {"ask_size":1,"trade_timestamp":"2023-01-03T09:30:00.057","ask_condition":0,"sequence":6082,"condition":1,"size":30,"bid_size":4,"ask_exchange":1,"price":130.2500,"ext_condition2":255,"bid_exchange":7,"ask":130.3900,"quote_timestamp":"2023-01-03T09:30:00.017","ext_condition1":32,"ext_condition4":115,"exchange":1,"ext_condition3":1,"bid":130.2600,"bid_condition":0}' + + /stock/at_time/trade: + x-min-subscription: standard + get: + summary: Trade + operationId: stock_at_time_trade + tags: + - Stock + - At-Time + description: | + #### Real-time request: + - Returns a real-time session from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs.html#nasdaq-basic) if the account has a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks). + - Returns a 15-minute delayed session from the [UTP & CTA feeds](/Articles/Data-And-Requests/The-SIPs.html#equities-cta-utp) account has the [stocks value subscription](https://www.thetadata.net/subscribe.html#stocks) subscription. + + #### Historical request: + Returns the last trade reported by [UTP & CTA feeds](/Articles/Data-And-Requests/The-SIPs.html#equities-cta-utp) at a specified millisecond of the day. + Trade condition mappings can be found [here](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html). + x-sample-urls: + - url: http://localhost:25503/v3/stock/at_time/trade?symbol=SPY&start_date=20240116&end_date=20240116&time_of_day=09:30:00.100 + description: "Returns the last trade for a given symbol and specified time of day" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/start_date" + - $ref: "#/components/parameters/end_date" + - $ref: "#/components/parameters/time_of_day" + - $ref: "#/components/parameters/venue" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns the last trade for a given symbol and specified time of day + content: + text/csv: + schema: + type: array + items: &id019 + type: object + properties: + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + sequence: + type: integer + description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences). + ext_condition1: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition2: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition3: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition4: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + condition: + type: integer + description: The trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html). + size: + type: integer + description: The amount of contracts / shares traded. + exchange: + type: integer + description: The [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html) the trade was executed. + price: + type: number + description: The trade price. + example: "timestamp,sequence,ext_condition1,ext_condition2,ext_condition3,ext_condition4,condition,size,exchange,price\r\ + \n2024-01-16T09:30:00.088,405549,255,255,255,115,115,1,57,475.280\r\n" + application/json: + schema: &id020 + type: array + items: *id019 + example: + sequence: + - 405549 + condition: + - 115 + size: + - 1 + price: + - 475.28 + ext_condition2: + - 255 + ext_condition1: + - 255 + ext_condition4: + - 115 + exchange: + - 57 + ext_condition3: + - 255 + timestamp: + - '2024-01-16T09:30:00.088' + application/x-ndjson: + schema: *id020 + example: '{"sequence":405549,"condition":115,"size":1,"price":475.280,"ext_condition2":255,"ext_condition1":255,"ext_condition4":115,"exchange":57,"ext_condition3":255,"timestamp":"2024-01-16T09:30:00.088"}' + + /stock/at_time/quote: + x-min-subscription: value + get: + summary: Quote + operationId: stock_at_time_quote + tags: + - Stock + - At-Time + description: | + #### Real-time request: + - Subscription tier standard or higher will default to NQB. + - Real-time last BBO quote at-time_of_day-time from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs.html#nasdaq-basic) if the account has a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks). + - 15-minute delayed NBBO quote at-time_of_day-time from the [UTP & CTA feeds](/Articles/Data-And-Requests/The-SIPs.html#equities-cta-utp) account has the [stocks value subscription](https://www.thetadata.net/subscribe.html#stocks) subscription. + + #### Historical request: + Returns the last NBBO quote reported by [UTP & CTA feeds](/Articles/Data-And-Requests/The-SIPs.html#equities-cta-utp) at a specified millisecond of the day. + x-sample-urls: + - url: http://localhost:25503/v3/stock/at_time/quote?symbol=SPY&start_date=20240116&end_date=20240116&time_of_day=09:30:00.100 + description: "Returns the last quote for a given symbol between specified dates (inclusive) with a one minute interval" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/start_date" + - $ref: "#/components/parameters/end_date" + - $ref: "#/components/parameters/time_of_day" + - $ref: "#/components/parameters/venue" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns the last quote for a given symbol between specified dates (inclusive) with a one minute interval + content: + text/csv: + schema: + type: array + items: &id021 + type: object + properties: + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + bid_size: + type: integer + description: The last NBBO bid size. + bid_exchange: + type: integer + description: The last NBBO bid [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html). + bid: + type: number + description: The last NBBO bid price. + bid_condition: + type: integer + description: The last NBBO bid [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html). + ask_size: + type: integer + description: The last NBBO ask size. + ask_exchange: + type: integer + description: The last NBBO ask [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html). + ask: + type: number + description: The last NBBO ask price. + ask_condition: + type: integer + description: The last NBBO ask [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html). + example: "timestamp,bid_size,bid_exchange,bid,bid_condition,ask_size,ask_exchange,ask,ask_condition\r\n2024-01-16T09:30:00.1,15,1,475.28,0,8,7,475.28,0\r\ + \n" + application/json: + schema: &id022 + type: array + items: *id021 + example: + ask_size: + - 8 + bid_size: + - 15 + ask_exchange: + - 7 + ask_condition: + - 0 + bid_exchange: + - 1 + ask: + - 475.28 + bid: + - 475.28 + bid_condition: + - 0 + timestamp: + - '2024-01-16T09:30:00.1' + application/x-ndjson: + schema: *id022 + example: '{"ask_size":8,"bid_size":15,"ask_exchange":7,"ask_condition":0,"bid_exchange":1,"ask":475.28,"bid":475.28,"bid_condition":0,"timestamp":"2024-01-16T09:30:00.1"}' + +# +# OPTIONS ENDPOINTS +# + + /option/list/symbols: + x-min-subscription: free + get: + summary: Symbols + operationId: option_list_symbols + tags: + - Option + - List + description: | + A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also include: root, ticker, and underlying. This endpoint returns all traded symbols for options. This endpoint is updated overnight. + x-sample-urls: + - url: http://localhost:25503/v3/option/list/symbols + description: "List all symbols for options" + parameters: + - $ref: "#/components/parameters/format" + responses: + '200': + description: List all symbols for options + content: + text/csv: + schema: + type: array + items: &id023 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + example: "symbol\r\nA\r\nAA\r\nAAAP\r\nAAAU\r\nAABA\r\n" + application/json: + schema: &id024 + type: array + items: *id023 + example: + symbol: + - A + - AA + - AAAP + - AAAU + - AABA + application/x-ndjson: + schema: *id024 + example: '{"symbol":"A"} + + {"symbol":"AA"} + + {"symbol":"AAAP"} + + {"symbol":"AAAU"} + + {"symbol":"AABA"}' + + /option/list/dates/{request_type}: + x-min-subscription: free + get: + summary: Dates + operationId: option_list_dates + tags: + - Option + - List + description: | + Lists all dates of data that are available for an option with a given symbol, request type, and expiration. + This endpoint is updated overnight. + x-sample-urls: + - url: http://localhost:25503/v3/option/list/dates/quote?symbol=AAPL&expiration=20220930 + description: "List all dates for an option quote for a given symbol and expiration date" + - url: http://localhost:25503/v3/option/list/dates/trade?symbol=AAPL&expiration=20220930 + description: "List all dates for an option trade for a given symbol with any expiration date" + parameters: + - $ref: "#/components/parameters/request_type" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration_no_star" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/format" + responses: + '200': + description: List all dates for an option quote for a given symbol and expiration date + content: + text/csv: + schema: + type: array + items: &id025 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + date: + type: string + format: date + description: The date formated as YYYY-MM-DD. + example: "symbol,expiration,strike,right,date\r\nAAPL,2022-09-30,80.000,CALL,2022-09-16\r\nAAPL,2022-09-30,80.000,CALL,2022-09-19\r\ + \nAAPL,2022-09-30,80.000,CALL,2022-09-12\r\nAAPL,2022-09-30,80.000,CALL,2022-09-13\r\nAAPL,2022-09-30,80.000,CALL,2022-09-14\r\ + \n" + application/json: + schema: &id026 + type: array + items: *id025 + example: + date: + - '2022-09-16' + - '2022-09-19' + - '2022-09-12' + - '2022-09-13' + - '2022-09-14' + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + strike: + - 80.0 + - 80.0 + - 80.0 + - 80.0 + - 80.0 + expiration: + - '2022-09-30' + - '2022-09-30' + - '2022-09-30' + - '2022-09-30' + - '2022-09-30' + right: + - CALL + - CALL + - CALL + - CALL + - CALL + application/x-ndjson: + schema: *id026 + example: '{"date":"2022-09-16","symbol":"AAPL","strike":80.000,"expiration":"2022-09-30","right":"CALL"} + + {"date":"2022-09-19","symbol":"AAPL","strike":80.000,"expiration":"2022-09-30","right":"CALL"} + + {"date":"2022-09-12","symbol":"AAPL","strike":80.000,"expiration":"2022-09-30","right":"CALL"} + + {"date":"2022-09-13","symbol":"AAPL","strike":80.000,"expiration":"2022-09-30","right":"CALL"} + + {"date":"2022-09-14","symbol":"AAPL","strike":80.000,"expiration":"2022-09-30","right":"CALL"}' + + /option/list/expirations: + x-min-subscription: free + get: + summary: Expirations + operationId: option_list_expirations + tags: + - Option + - List + description: | + Lists all dates of expirations that are available for an option with a given symbol. + This endpoint is updated overnight. + x-sample-urls: + - url: http://localhost:25503/v3/option/list/expirations?symbol=AAPL + description: "List all expirations for an option with a given symbol" + parameters: + - $ref: "#/components/parameters/multi_symbol" + - $ref: "#/components/parameters/format" + responses: + '200': + description: List all expirations for an option with a given symbol + content: + text/csv: + schema: + type: array + items: &id027 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + example: "symbol,expiration\r\nAAPL,2012-06-01\r\nAAPL,2012-06-08\r\nAAPL,2012-06-16\r\nAAPL,2012-06-22\r\n\ + AAPL,2012-06-29\r\n" + application/json: + schema: &id028 + type: array + items: *id027 + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + expiration: + - '2012-06-01' + - '2012-06-08' + - '2012-06-16' + - '2012-06-22' + - '2012-06-29' + application/x-ndjson: + schema: *id028 + example: '{"symbol":"AAPL","expiration":"2012-06-01"} + + {"symbol":"AAPL","expiration":"2012-06-08"} + + {"symbol":"AAPL","expiration":"2012-06-16"} + + {"symbol":"AAPL","expiration":"2012-06-22"} + + {"symbol":"AAPL","expiration":"2012-06-29"}' + + /option/list/strikes: + x-min-subscription: free + get: + summary: Strikes + operationId: option_list_strikes + tags: + - Option + - List + description: | + Lists all strikes that are available for an option with a given symbol and expiration date. + This endpoint is updated overnight. + x-sample-urls: + - url: http://localhost:25503/v3/option/list/strikes?symbol=AAPL&expiration=20220930 + description: "List all strikes for an option with a given symbol and expiration date" + parameters: + - $ref: "#/components/parameters/multi_symbol" + - $ref: "#/components/parameters/expiration_no_star" + - $ref: "#/components/parameters/format" + responses: + '200': + description: List all strikes for an option with a given symbol and expiration date + content: + text/csv: + schema: + type: array + items: &id029 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + example: "symbol,strike\r\nAAPL,80.000\r\nAAPL,128.000\r\nAAPL,160.000\r\nAAPL,144.000\r\nAAPL,240.000\r\n" + application/json: + schema: &id030 + type: array + items: *id029 + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + strike: + - 80.0 + - 128.0 + - 160.0 + - 144.0 + - 240.0 + application/x-ndjson: + schema: *id030 + example: '{"symbol":"AAPL","strike":80.000} + + {"symbol":"AAPL","strike":128.000} + + {"symbol":"AAPL","strike":160.000} + + {"symbol":"AAPL","strike":144.000} + + {"symbol":"AAPL","strike":240.000}' + + /option/list/contracts/{request_type}: + x-min-subscription: value + get: + summary: Contracts + operationId: option_list_contracts + tags: + - Option + - List + description: | + Lists all contracts that were traded or quoted on a particular date. + + If the ``symbol`` parameter is specified, the returned contracts will be filtered to match the symbol. + Multiple symbols can be specified by separating them with commas such as ``symbol=AAPL,SPY,AMD`` + This endpoint is updated real-time. + x-sample-urls: + - url: http://localhost:25503/v3/option/list/contracts/trade?date=20220930 + description: "List all contracts for an option trade with a given date" + - url: http://localhost:25503/v3/option/list/contracts/quote?symbol=AAPL&date=20220930 + description: "List all contracts for an option quote with a given symbol and date" + parameters: + - $ref: "#/components/parameters/request_type" + - $ref: "#/components/parameters/opt_multi_symbol" + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/format" + responses: + '200': + description: List all contracts for an option trade with a given date + content: + text/csv: + schema: + type: array + items: &id031 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + example: "symbol,expiration,strike,right\r\nABNB,2023-06-16,260.000,CALL\r\nAAPL,2023-06-16,260.000,CALL\r\n\ + AAL,2022-09-30,14.500,CALL\r\nABNB,2022-11-04,80.000,PUT\r\nAAPL,2022-11-04,80.000,PUT\r\n" + application/json: + schema: &id032 + type: array + items: *id031 + example: + symbol: + - ABNB + - AAPL + - AAL + - ABNB + - AAPL + strike: + - 260.0 + - 260.0 + - 14.5 + - 80.0 + - 80.0 + expiration: + - '2023-06-16' + - '2023-06-16' + - '2022-09-30' + - '2022-11-04' + - '2022-11-04' + right: + - CALL + - CALL + - CALL + - PUT + - PUT + application/x-ndjson: + schema: *id032 + example: '{"symbol":"ABNB","strike":260.000,"expiration":"2023-06-16","right":"CALL"} + + {"symbol":"AAPL","strike":260.000,"expiration":"2023-06-16","right":"CALL"} + + {"symbol":"AAL","strike":14.500,"expiration":"2022-09-30","right":"CALL"} + + {"symbol":"ABNB","strike":80.000,"expiration":"2022-11-04","right":"PUT"} + + {"symbol":"AAPL","strike":80.000,"expiration":"2022-11-04","right":"PUT"}' + + /option/snapshot/ohlc: + x-min-subscription: value + get: + summary: Open High Low Close + operationId: option_snapshot_ohlc + tags: + - Option + - Snapshot + description: | + - Retrieve a real-time last ohlc of an option contract for the trading day. + - You might need to change the default expiration date to a different date if it is past the current date. + x-sample-urls: + - url: http://localhost:25503/v3/option/snapshot/ohlc?symbol=AAPL&expiration=20260116&right=call&strike=275.000 + description: "Returns OHLC for a given option contract" + - url: http://localhost:25503/v3/option/snapshot/ohlc?symbol=AAPL&expiration=* + description: "Returns OHLC for all option contracts" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns OHLC for a given option contract + content: + text/csv: + schema: + type: array + items: &id033 + type: object + properties: + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + open: + type: number + description: The opening trade price. + high: + type: number + description: The highest traded price. + low: + type: number + description: The lowest traded price. + close: + type: number + description: The closing traded price. + volume: + type: integer + description: The amount of contracts / shares traded. + count: + type: integer + description: The amount of trades. + example: "timestamp,symbol,expiration,strike,right,open,high,low,close,volume,count\r\n2025-08-20T15:25:31.03,AAPL,2026-01-16,275.000,CALL,1.78,1.78,1.51,1.51,202,29\r\ + \n" + application/json: + schema: &id034 + type: array + items: *id033 + example: + volume: + - 202 + symbol: + - AAPL + high: + - 1.78 + low: + - 1.51 + strike: + - 275.0 + count: + - 29 + expiration: + - '2026-01-16' + right: + - CALL + close: + - 1.51 + open: + - 1.78 + timestamp: + - '2025-08-20T15:25:31.03' + application/x-ndjson: + schema: *id034 + example: '{"volume":202,"symbol":"AAPL","high":1.78,"low":1.51,"strike":275.000,"count":29,"expiration":"2026-01-16","right":"CALL","close":1.51,"open":1.78,"timestamp":"2025-08-20T15:25:31.03"}' + + /option/snapshot/trade: + x-min-subscription: standard + get: + summary: Trade + operationId: option_snapshot_trade + tags: + - Option + - Snapshot + description: | + - Retrieve the real-time last trade of an option contract. + - You might need to change the default expiration date to a different date if it is past the current date. + - This endpoint will return no data if the market was closed for the day. Theta Data resets the snapshot cache at midnight ET every night. + x-sample-urls: + - url: http://localhost:25503/v3/option/snapshot/trade?symbol=AAPL&expiration=2026-01-16&right=call&strike=275.000 + description: "Returns last trade for an option contract" + - url: http://localhost:25503/v3/option/snapshot/trade?symbol=AAPL&expiration=2026-01-16 + description: "Returns last trade for all option contracts with an expiration of 2026-01-16" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration_no_star" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns last NBBO quote for an option contract + content: + text/csv: + schema: + type: array + items: &id035 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + sequence: + type: integer + description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences). + ext_condition1: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition2: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition3: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition4: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + condition: + type: integer + description: The trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html). + size: + type: integer + description: The amount of contracts / shares traded. + exchange: + type: integer + description: The [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html) the trade was executed. + price: + type: number + description: The trade price. + example: "symbol,expiration,strike,right,timestamp,sequence,ext_condition1,ext_condition2,ext_condition3,ext_condition4,condition,size,exchange,price\r\ + \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:00.471,18902138,255,255,255,255,130,2,22,3.90\r\n" + application/json: + schema: &id036 + type: array + items: *id035 + example: + symbol: + - AAPL + strike: + - 220.0 + right: + - CALL + sequence: + - 18902138 + condition: + - 130 + size: + - 2 + price: + - 3.9 + ext_condition2: + - 255 + ext_condition1: + - 255 + expiration: + - '2024-11-08' + ext_condition4: + - 255 + exchange: + - 22 + ext_condition3: + - 255 + timestamp: + - '2024-11-04T09:30:00.471' + application/x-ndjson: + schema: *id036 + example: '{"symbol":"AAPL","strike":220.000,"right":"CALL","sequence":18902138,"condition":130,"size":2,"price":3.90,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":22,"ext_condition3":255,"timestamp":"2024-11-04T09:30:00.471"}' + + /option/snapshot/quote: + x-min-subscription: value + get: + summary: Quote + operationId: option_snapshot_quote + tags: + - Option + - Snapshot + description: | + + - Retrieve a real-time last NBBO quote of an option contract. + - You might need to change the default expiration date to a different date if it is past the current date. + - This endpoint will return no data if the market was closed for the day. Theta Data resets the snapshot cache at midnight ET every night. + x-sample-urls: + - url: http://localhost:25503/v3/option/snapshot/quote?symbol=AAPL&expiration=20260116&right=call&strike=275.000 + description: "Returns last NBBO quote for an option contract" + - url: http://localhost:25503/v3/option/snapshot/quote?symbol=AAPL&expiration=* + description: "Returns last NBBO quote for all option contracts" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns last NBBO quote for an option contract + content: + text/csv: + schema: + type: array + items: &id104 + type: object + properties: + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + bid_size: + type: integer + description: The last NBBO bid size. + bid_exchange: + type: integer + description: The last NBBO bid [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html). + bid: + type: number + description: The last NBBO bid price. + bid_condition: + type: integer + description: The last NBBO bid [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html). + ask_size: + type: integer + description: The last NBBO ask size. + ask_exchange: + type: integer + description: The last NBBO ask [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html). + ask: + type: number + description: The last NBBO ask price. + ask_condition: + type: integer + description: The last NBBO ask [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html). + example: "timestamp,symbol,expiration,strike,right,bid_size,bid_exchange,bid,bid_condition,ask_size,ask_exchange,ask,ask_condition\r\ + \n2025-08-20T15:59:59.805,AAPL,2026-01-16,275.000,CALL,5,6,1.47,50,25,6,1.50,50\r\n" + application/json: + schema: &id105 + type: array + items: *id104 + example: + symbol: + - AAPL + ask_size: + - 25 + ask_condition: + - 50 + strike: + - 275.0 + right: + - CALL + bid_size: + - 5 + ask_exchange: + - 6 + bid_exchange: + - 6 + ask: + - 1.5 + expiration: + - '2026-01-16' + bid: + - 1.47 + bid_condition: + - 50 + timestamp: + - '2025-08-20T15:59:59.805' + application/x-ndjson: + schema: *id105 + example: '{"symbol":"AAPL","ask_size":25,"ask_condition":50,"strike":275.000,"right":"CALL","bid_size":5,"ask_exchange":6,"bid_exchange":6,"ask":1.50,"expiration":"2026-01-16","bid":1.47,"bid_condition":50,"timestamp":"2025-08-20T15:59:59.805"}' + + /option/snapshot/open_interest: + x-min-subscription: value + get: + summary: Open Interest + operationId: option_snapshot_open_interest + tags: + - Option + - Snapshot + description: | + - Retrieve the last open interest message of an option contract. + - Open interest is reported around 06:30 ET every morning by OPRA and reflects the open interest at the of the previous trading day. + - You might need to change the default expiration date to a different date if it is past the current date. + - This endpoint will return no data if the market was closed for the day. Theta Data resets the snapshot cache at midnight ET every night. + x-sample-urls: + - url: http://localhost:25503/v3/option/snapshot/open_interest?symbol=AAPL&expiration=20260116&right=call&strike=275.00 + description: "Returns open interest for an option contract" + - url: http://localhost:25503/v3/option/snapshot/open_interest?symbol=AAPL&expiration=* + description: "Returns open interest for all option contracts" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns open interest for an option contract + content: + text/csv: + schema: + type: array + items: &id037 + type: object + properties: + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + open_interest: + type: integer + description: The total amount of outstanding contracts. + example: "timestamp,symbol,expiration,strike,right,open_interest\r\n2025-08-20T06:30:13,AAPL,2026-01-16,275.000,CALL,8066\r\ + \n" + application/json: + schema: &id038 + type: array + items: *id037 + example: + symbol: + - AAPL + strike: + - 275.0 + open_interest: + - 8066 + expiration: + - '2026-01-16' + right: + - CALL + timestamp: + - '2025-08-20T06:30:13' + application/x-ndjson: + schema: *id038 + example: '{"symbol":"AAPL","strike":275.000,"open_interest":8066,"expiration":"2026-01-16","right":"CALL","timestamp":"2025-08-20T06:30:13"}' + + /option/snapshot/greeks/implied_volatility: + x-min-subscription: standard + get: + summary: Implied Volatility + operationId: option_snapshot_greeks_implied_volatility + tags: + - Option + - Snapshot + description: | + Returns implied volatilies calculated using the national best bid, mid, and ask price + of the option respectively. The underlying price represents whatever the last underlying price was at the + ``underlying_timestamp`` field. You can read more about how Thetadata calculates greeks + [here](/Articles/Data-And-Requests/Option-Greeks.html). + x-sample-urls: + - url: http://localhost:25503/v3/option/snapshot/greeks/implied_volatility?symbol=AAPL&expiration=20260116&strike=275.000&right=call + description: "Returns implied volatility for an option contract" + - url: http://localhost:25503/v3/option/snapshot/greeks/implied_volatility?symbol=AAPL&expiration=* + description: "Returns implied volatility for all option contracts" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/stock_price" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns implied volatility for an option contract + content: + text/csv: + schema: + type: array + items: &id039 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + bid: + type: number + description: The last NBBO bid price. + ask: + type: number + description: The last NBBO ask price. + implied_vol: + type: number + description: The implied volatiltiy calculated using the trade price. + iv_error: + type: string + description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the + actual value reported in the quote. This value will increase as the strike price recedes from the + underlying price.' + underlying_timestamp: + type: string + format: date-time + description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format. + underlying_price: + type: number + description: The midpoint of the underlying at the time of the option trade. + example: "symbol,expiration,strike,right,timestamp,bid,ask,implied_vol,iv_error,underlying_timestamp,underlying_price\r\ + \nAAPL,2026-01-16,275.000,CALL,2025-08-20T15:59:59.805,1.47,1.50,0.2142,-0.0003,2025-08-20T16:36:52.257,225.74\r\ + \n" + application/json: + schema: &id040 + type: array + items: *id039 + example: + symbol: + - AAPL + underlying_price: + - 225.74 + strike: + - 275.0 + ask: + - 1.5 + expiration: + - '2026-01-16' + right: + - CALL + implied_vol: + - 0.2142 + bid: + - 1.47 + underlying_timestamp: + - '2025-08-20T16:36:52.257' + iv_error: + - -0.0003 + timestamp: + - '2025-08-20T15:59:59.805' + application/x-ndjson: + schema: *id040 + example: '{"symbol":"AAPL","underlying_price":225.74,"strike":275.000,"ask":1.50,"expiration":"2026-01-16","right":"CALL","implied_vol":0.2142,"bid":1.47,"underlying_timestamp":"2025-08-20T16:36:52.257","iv_error":-0.0003,"timestamp":"2025-08-20T15:59:59.805"}' + + # /option/snapshot/trade_greeks/implied_volatility: + # x-min-subscription: professional + # get: + # operationId: option_snapshot_trade_greeks_implied_volatility + # tags: + # - Option + # - Snapshot + # description: "" + # parameters: + # - $ref: "#/components/parameters/single_symbol" + # - $ref: "#/components/parameters/expiration" + # - $ref: "#/components/parameters/strike" + # - $ref: "#/components/parameters/right" + # - $ref: "#/components/parameters/annual_dividend" + # - $ref: "#/components/parameters/rate_type" + # - $ref: "#/components/parameters/rate_value" + # - $ref: "#/components/parameters/stock_price" + # - $ref: "#/components/parameters/format" + # responses: + # "200": + # $ref: "#/components/responses/200_OK" + + /option/snapshot/greeks/all: + x-min-subscription: professional + get: + summary: All Greeks + operationId: option_snapshot_greeks_all + tags: + - Option + - Snapshot + description: | + - Retrieve a real-time last greeks calculation for all option contracts that lie on a provided expiration. + - You might need to change the default expiration date to a different date if it is past the current date. Some quotes are omitted in the example to reduce the space of the sample output. + - Make `expiration` * if you want to get the snapshot for every expiration chain for the underlying. + > This endpoint will return no data if the market was closed for the day. Theta Data resets the snapshot cache at midnight ET every night. + x-sample-urls: + - url: http://localhost:25503/v3/option/snapshot/greeks/all?symbol=AAPL&expiration=2026-05-15&strike=170.00&right=call + description: "Returns all greeks for an option contract" + - url: http://localhost:25503/v3/option/snapshot/greeks/all?symbol=AAPL&expiration=* + description: "Returns all greeks for all option contracts" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/stock_price" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns all greeks for an option contract + content: + text/csv: + schema: + type: array + items: &id041 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + bid: + type: number + description: The last NBBO bid price. + ask: + type: number + description: The last NBBO ask price. + delta: + type: number + description: The delta. + theta: + type: string + description: The Theta. + vega: + type: number + description: The vega. + rho: + type: number + description: The rho. + epsilon: + type: string + description: The epsilon. + lambda: + type: number + description: The lambda. + gamma: + type: number + description: The gamma. + vanna: + type: string + description: The vanna. + charm: + type: number + description: The charm. + vomma: + type: number + description: The vomma. + veta: + type: number + description: The veta. + vera: + type: number + description: The vera. + speed: + type: number + description: The speed. + zomma: + type: number + description: The zomma. + color: + type: string + description: The color. + ultima: + type: string + description: The ultima. + d1: + type: number + description: The d1. + d2: + type: number + description: The d2. + dual_delta: + type: string + description: The dual delta. + dual_gamma: + type: number + description: The dual gamma. + implied_vol: + type: number + description: The implied volatiltiy calculated using the trade price. + iv_error: + type: number + description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the + actual value reported in the quote. This value will increase as the strike price recedes from the + underlying price.' + underlying_timestamp: + type: string + format: date-time + description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format. + underlying_price: + type: number + description: The midpoint of the underlying at the time of the option trade. + example: "symbol,expiration,strike,right,timestamp,bid,ask,delta,theta,vega,rho,epsilon,lambda,gamma,vanna,charm,vomma,veta,vera,speed,zomma,color,ultima,d1,d2,dual_delta,dual_gamma,implied_vol,iv_error,underlying_timestamp,underlying_price\r\ + \nAAPL,2026-05-15,170.000,CALL,2025-08-20T15:59:59.677,63.65,64.25,0.9085,-0.0352,31.7235,103.2513,-150.0314,3.2071,0.0027,-0.5710,0.0925,146.8562,22.9525,0.0000,0.0000,0.0000,-0.0816,-100.0000,1.3319,1.0689,-0.8302,0.0003,0.3075,0.0000,2025-08-20T16:36:52.257,225.74\r\ + \n" + application/json: + schema: &id042 + type: array + items: *id041 + example: + symbol: + - AAPL + dual_delta: + - -0.8302 + color: + - -0.0816 + zomma: + - 0.0 + delta: + - 0.9085 + implied_vol: + - 0.3075 + theta: + - -0.0352 + d1: + - 1.3319 + speed: + - 0.0 + d2: + - 1.0689 + epsilon: + - -150.0314 + lambda: + - 3.2071 + vomma: + - 146.8562 + underlying_timestamp: + - '2025-08-20T16:36:52.257' + timestamp: + - '2025-08-20T15:59:59.677' + underlying_price: + - 225.74 + strike: + - 170.0 + vera: + - 0.0 + right: + - CALL + veta: + - 22.9525 + iv_error: + - 0.0 + ultima: + - -100.0 + charm: + - 0.0925 + ask: + - 64.25 + rho: + - 103.2513 + expiration: + - '2026-05-15' + vanna: + - -0.571 + dual_gamma: + - 0.0003 + bid: + - 63.65 + vega: + - 31.7235 + gamma: + - 0.0027 + application/x-ndjson: + schema: *id042 + example: '{"symbol":"AAPL","dual_delta":-0.8302,"color":-0.0816,"zomma":0.0000,"delta":0.9085,"implied_vol":0.3075,"theta":-0.0352,"d1":1.3319,"speed":0.0000,"d2":1.0689,"epsilon":-150.0314,"lambda":3.2071,"vomma":146.8562,"underlying_timestamp":"2025-08-20T16:36:52.257","timestamp":"2025-08-20T15:59:59.677","underlying_price":225.74,"strike":170.000,"vera":0.0000,"right":"CALL","veta":22.9525,"iv_error":0.0000,"ultima":-100.0000,"charm":0.0925,"ask":64.25,"rho":103.2513,"expiration":"2026-05-15","vanna":-0.5710,"dual_gamma":0.0003,"bid":63.65,"vega":31.7235,"gamma":0.0027}' + + # /option/snapshot/trade_greeks/all: + # x-min-subscription: professional + # get: + # operationId: option_snapshot_trade_greeks_all + # tags: + # - Option + # - Snapshot + # description: "" + # parameters: + # - $ref: "#/components/parameters/single_symbol" + # - $ref: "#/components/parameters/expiration" + # - $ref: "#/components/parameters/strike" + # - $ref: "#/components/parameters/right" + # - $ref: "#/components/parameters/annual_dividend" + # - $ref: "#/components/parameters/rate_type" + # - $ref: "#/components/parameters/rate_value" + # - $ref: "#/components/parameters/stock_price" + # - $ref: "#/components/parameters/format" + # responses: + # "200": + # $ref: "#/components/responses/200_OK" + + /option/snapshot/greeks/first_order: + x-min-subscription: standard + get: + summary: First Order Greeks + operationId: option_snapshot_greeks_first_order + tags: + - Option + - Snapshot + description: | + - Retrieve a real-time last greeks calculation for all option contracts that lie on a provided expiration. + - You might need to change the default expiration date to a different date if it is past the current date. Some quotes are omitted in the example to reduce the space of the sample output. + - Make `expiration` * if you want to get the snapshot for every expiration chain for the underlying. + > This endpoint will return no data if the market was closed for the day. Theta Data resets the snapshot cache at midnight ET every night. + x-sample-urls: + - url: http://localhost:25503/v3/option/snapshot/greeks/first_order?symbol=AAPL&expiration=20260116&strike=275.000&right=call + description: "Returns first order greeks for an option contract" + - url: http://localhost:25503/v3/option/snapshot/greeks/first_order?symbol=AAPL&expiration=* + description: "Returns first order greeks for all option contracts" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/stock_price" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns first order greeks for an option contract + content: + text/csv: + schema: + type: array + items: &id043 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + bid: + type: number + description: The last NBBO bid price. + ask: + type: number + description: The last NBBO ask price. + delta: + type: number + description: The delta. + theta: + type: string + description: The Theta. + vega: + type: number + description: The vega. + rho: + type: number + description: The rho. + epsilon: + type: string + description: The epsilon. + lambda: + type: number + description: The lambda. + implied_vol: + type: number + description: The implied volatiltiy calculated using the trade price. + iv_error: + type: string + description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the + actual value reported in the quote. This value will increase as the strike price recedes from the + underlying price.' + underlying_timestamp: + type: string + format: date-time + description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format. + underlying_price: + type: number + description: The midpoint of the underlying at the time of the option trade. + example: "symbol,expiration,strike,right,timestamp,bid,ask,delta,theta,vega,rho,epsilon,lambda,implied_vol,iv_error,underlying_timestamp,underlying_price\r\ + \nAAPL,2026-01-16,275.000,CALL,2025-08-20T15:59:59.805,1.47,1.50,0.1060,-0.0217,26.3226,9.1050,-9.7049,16.1782,0.2142,-0.0003,2025-08-20T16:37:06.988,225.74\r\ + \n" + application/json: + schema: &id044 + type: array + items: *id043 + example: + symbol: + - AAPL + underlying_price: + - 225.74 + strike: + - 275.0 + delta: + - 0.106 + right: + - CALL + implied_vol: + - 0.2142 + theta: + - -0.0217 + iv_error: + - -0.0003 + epsilon: + - -9.7049 + lambda: + - 16.1782 + ask: + - 1.5 + rho: + - 9.105 + expiration: + - '2026-01-16' + bid: + - 1.47 + underlying_timestamp: + - '2025-08-20T16:37:06.988' + vega: + - 26.3226 + timestamp: + - '2025-08-20T15:59:59.805' + application/x-ndjson: + schema: *id044 + example: '{"symbol":"AAPL","underlying_price":225.74,"strike":275.000,"delta":0.1060,"right":"CALL","implied_vol":0.2142,"theta":-0.0217,"iv_error":-0.0003,"epsilon":-9.7049,"lambda":16.1782,"ask":1.50,"rho":9.1050,"expiration":"2026-01-16","bid":1.47,"underlying_timestamp":"2025-08-20T16:37:06.988","vega":26.3226,"timestamp":"2025-08-20T15:59:59.805"}' + + # /option/snapshot/trade_greeks/first_order: + # x-min-subscription: professional + # get: + # operationId: option_snapshot_trade_greeks_first_order + # tags: + # - Option + # - Snapshot + # description: "" + # parameters: + # - $ref: "#/components/parameters/single_symbol" + # - $ref: "#/components/parameters/expiration" + # - $ref: "#/components/parameters/strike" + # - $ref: "#/components/parameters/right" + # - $ref: "#/components/parameters/annual_dividend" + # - $ref: "#/components/parameters/rate_type" + # - $ref: "#/components/parameters/rate_value" + # - $ref: "#/components/parameters/stock_price" + # - $ref: "#/components/parameters/format" + # responses: + # "200": + # $ref: "#/components/responses/200_OK" + + /option/snapshot/greeks/second_order: + x-min-subscription: professional + get: + summary: Second Order Greeks + operationId: option_snapshot_greeks_second_order + tags: + - Option + - Snapshot + description: | + - Retrieve a real-time last second order greeks calculation for all option contracts that lie on a provided expiration. + - You might need to change the default expiration date to a different date if it is past the current date. Some quotes are omitted in the example to reduce the space of the sample output. + - Make `expiration` * if you want to get the snapshot for every expiration chain for the underlying. + > This endpoint will return no data if the market was closed for the day. Theta Data resets the snapshot cache at midnight ET every night. + x-sample-urls: + - url: http://localhost:25503/v3/option/snapshot/greeks/second_order?symbol=AAPL&expiration=20260116&strike=275.00 + description: "Returns second order greeks for an option contract" + - url: http://localhost:25503/v3/option/snapshot/greeks/second_order?symbol=AAPL&expiration=* + description: "Returns second order greeks for all option contracts" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/stock_price" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns second order greeks for an option contract + content: + text/csv: + schema: + type: array + items: &id045 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + bid: + type: number + description: The last NBBO bid price. + ask: + type: number + description: The last NBBO ask price. + gamma: + type: number + description: The gamma. + vanna: + type: number + description: The vanna. + charm: + type: string + description: The charm. + vomma: + type: number + description: The vomma. + veta: + type: number + description: The veta. + implied_vol: + type: number + description: The implied volatiltiy calculated using the trade price. + iv_error: + type: string + description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the + actual value reported in the quote. This value will increase as the strike price recedes from the + underlying price.' + underlying_timestamp: + type: string + format: date-time + description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format. + underlying_price: + type: number + description: The midpoint of the underlying at the time of the option trade. + example: "symbol,expiration,strike,right,timestamp,bid,ask,gamma,vanna,charm,vomma,veta,implied_vol,iv_error,underlying_timestamp,underlying_price\r\ + \nAAPL,2026-01-16,275.000,CALL,2025-08-20T15:59:59.805,1.47,1.50,0.0059,1.1833,-0.3716,212.2670,18.8522,0.2142,-0.0003,2025-08-20T16:37:06.988,225.74\r\ + \nAAPL,2026-01-16,275.000,PUT,2025-08-20T15:59:59.839,48.75,49.70,0.0064,0.9320,-0.4210,108.3415,18.2234,0.3106,0.0000,2025-08-20T16:37:06.988,225.74\r\ + \n" + application/json: + schema: &id046 + type: array + items: *id045 + example: + symbol: + - AAPL + - AAPL + underlying_price: + - 225.74 + - 225.74 + strike: + - 275.0 + - 275.0 + right: + - CALL + - PUT + veta: + - 18.8522 + - 18.2234 + implied_vol: + - 0.2142 + - 0.3106 + iv_error: + - -0.0003 + - 0.0 + charm: + - -0.3716 + - -0.421 + ask: + - 1.5 + - 49.7 + expiration: + - '2026-01-16' + - '2026-01-16' + vanna: + - 1.1833 + - 0.932 + vomma: + - 212.267 + - 108.3415 + bid: + - 1.47 + - 48.75 + underlying_timestamp: + - '2025-08-20T16:37:06.988' + - '2025-08-20T16:37:06.988' + gamma: + - 0.0059 + - 0.0064 + timestamp: + - '2025-08-20T15:59:59.805' + - '2025-08-20T15:59:59.839' + application/x-ndjson: + schema: *id046 + example: '{"symbol":"AAPL","underlying_price":225.74,"strike":275.000,"right":"CALL","veta":18.8522,"implied_vol":0.2142,"iv_error":-0.0003,"charm":-0.3716,"ask":1.50,"expiration":"2026-01-16","vanna":1.1833,"vomma":212.2670,"bid":1.47,"underlying_timestamp":"2025-08-20T16:37:06.988","gamma":0.0059,"timestamp":"2025-08-20T15:59:59.805"} + + {"symbol":"AAPL","underlying_price":225.74,"strike":275.000,"right":"PUT","veta":18.2234,"implied_vol":0.3106,"iv_error":0.0000,"charm":-0.4210,"ask":49.70,"expiration":"2026-01-16","vanna":0.9320,"vomma":108.3415,"bid":48.75,"underlying_timestamp":"2025-08-20T16:37:06.988","gamma":0.0064,"timestamp":"2025-08-20T15:59:59.839"}' + + # /option/snapshot/trade_greeks/second_order: + # x-min-subscription: professional + # get: + # operationId: option_snapshot_trade_greeks_second_order + # tags: + # - Option + # - Snapshot + # description: "" + # parameters: + # - $ref: "#/components/parameters/single_symbol" + # - $ref: "#/components/parameters/expiration" + # - $ref: "#/components/parameters/strike" + # - $ref: "#/components/parameters/right" + # - $ref: "#/components/parameters/annual_dividend" + # - $ref: "#/components/parameters/rate_type" + # - $ref: "#/components/parameters/rate_value" + # - $ref: "#/components/parameters/stock_price" + # - $ref: "#/components/parameters/format" + # responses: + # "200": + # $ref: "#/components/responses/200_OK" + + /option/snapshot/greeks/third_order: + x-min-subscription: professional + get: + summary: Third Order Greeks + operationId: option_snapshot_greeks_third_order + tags: + - Option + - Snapshot + description: | + - Retrieve a real-time last third order greeks calculation for all option contracts that lie on a provided expiration. + - You might need to change the default expiration date to a different date if it is past the current date. Some quotes are omitted in the example to reduce the space of the sample output. + - Make `expiration` * if you want to get the snapshot for every expiration chain for the underlying. + > This endpoint will return no data if the market was closed for the day. Theta Data resets the snapshot cache at midnight ET every night. + x-sample-urls: + - url: http://localhost:25503/v3/option/snapshot/greeks/third_order?symbol=AAPL&expiration=20260116&strike=275.00 + description: "Returns third order greeks for an option contract" + - url: http://localhost:25503/v3/option/snapshot/greeks/third_order?symbol=AAPL&expiration=* + description: "Returns third order greeks for all option contracts" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/stock_price" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns third order greeks for an option contract + content: + text/csv: + schema: + type: array + items: &id047 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + bid: + type: number + description: The last NBBO bid price. + ask: + type: number + description: The last NBBO ask price. + speed: + type: number + description: The speed. + zomma: + type: number + description: The zomma. + color: + type: string + description: The color. + ultima: + type: string + description: The ultima. + implied_vol: + type: number + description: The implied volatiltiy calculated using the trade price. + iv_error: + type: string + description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the + actual value reported in the quote. This value will increase as the strike price recedes from the + underlying price.' + underlying_timestamp: + type: string + format: date-time + description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format. + underlying_price: + type: number + description: The midpoint of the underlying at the time of the option trade. + example: "symbol,expiration,strike,right,timestamp,bid,ask,speed,zomma,color,ultima,implied_vol,iv_error,underlying_timestamp,underlying_price\r\ + \nAAPL,2026-01-16,275.000,CALL,2025-08-20T15:59:59.805,1.47,1.50,0.0000,0.0000,-0.3832,-100.0000,0.2142,-0.0003,2025-08-20T16:37:06.988,225.74\r\ + \nAAPL,2026-01-16,275.000,PUT,2025-08-20T15:59:59.839,48.75,49.70,0.0000,0.0000,-1.8378,-100.0000,0.3106,0.0000,2025-08-20T16:37:06.988,225.74\r\ + \n" + application/json: + schema: &id048 + type: array + items: *id047 + example: + symbol: + - AAPL + - AAPL + underlying_price: + - 225.74 + - 225.74 + color: + - -0.3832 + - -1.8378 + strike: + - 275.0 + - 275.0 + zomma: + - 0.0 + - 0.0 + right: + - CALL + - PUT + implied_vol: + - 0.2142 + - 0.3106 + iv_error: + - -0.0003 + - 0.0 + speed: + - 0.0 + - 0.0 + ultima: + - -100.0 + - -100.0 + ask: + - 1.5 + - 49.7 + expiration: + - '2026-01-16' + - '2026-01-16' + bid: + - 1.47 + - 48.75 + underlying_timestamp: + - '2025-08-20T16:37:06.988' + - '2025-08-20T16:37:06.988' + timestamp: + - '2025-08-20T15:59:59.805' + - '2025-08-20T15:59:59.839' + application/x-ndjson: + schema: *id048 + example: '{"symbol":"AAPL","underlying_price":225.74,"color":-0.3832,"strike":275.000,"zomma":0.0000,"right":"CALL","implied_vol":0.2142,"iv_error":-0.0003,"speed":0.0000,"ultima":-100.0000,"ask":1.50,"expiration":"2026-01-16","bid":1.47,"underlying_timestamp":"2025-08-20T16:37:06.988","timestamp":"2025-08-20T15:59:59.805"} + + {"symbol":"AAPL","underlying_price":225.74,"color":-1.8378,"strike":275.000,"zomma":0.0000,"right":"PUT","implied_vol":0.3106,"iv_error":0.0000,"speed":0.0000,"ultima":-100.0000,"ask":49.70,"expiration":"2026-01-16","bid":48.75,"underlying_timestamp":"2025-08-20T16:37:06.988","timestamp":"2025-08-20T15:59:59.839"}' + + # /option/snapshot/trade_greeks/third_order: + # x-min-subscription: professional + # get: + # operationId: option_snapshot_trade_greeks_third_order + # tags: + # - Option + # - Snapshot + # description: "" + # parameters: + # - $ref: "#/components/parameters/single_symbol" + # - $ref: "#/components/parameters/expiration" + # - $ref: "#/components/parameters/strike" + # - $ref: "#/components/parameters/right" + # - $ref: "#/components/parameters/annual_dividend" + # - $ref: "#/components/parameters/rate_type" + # - $ref: "#/components/parameters/rate_value" + # - $ref: "#/components/parameters/stock_price" + # - $ref: "#/components/parameters/format" + # responses: + # "200": + # $ref: "#/components/responses/200_OK" + + /option/history/eod: + x-min-subscription: free + get: + summary: End of Day + operationId: option_history_eod + tags: + - Option + - History + description: | + - Since [OPRA](/Articles/Data-And-Requests/The-SIPs.html) does not provide a national EOD report for options, Thetadata generates a national EOD report at 17:15 ET each day. + - ``created`` represents the datetime the report was generated and ``last_trade`` represents the datetime of the last trade. + - The quote in the response represents the last NBBO reported by OPRA at the time of report generation. + - You can read more about EOD & OHLC data [here](/Articles/Data-And-Requests/OHLC-EOD.html). + > The quote fields (bid / ask info) may not be available prior to 2023-12-01. We will expose further history for the EOD quote in the near future. + x-sample-urls: + - url: http://localhost:25503/v3/option/history/eod?symbol=AAPL&expiration=20241115&strike=170.000&right=call&start_date=20241104&end_date=20241104 + description: "Returns EOD report for an option contract" + - url: http://localhost:25503/v3/option/history/eod?symbol=AAPL&expiration=*&start_date=20241104&end_date=20241104 + description: "Returns EOD report for all option contracts" + parameters: + - $ref: "#/components/parameters/start_date" + - $ref: "#/components/parameters/end_date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns EOD report for an option contract + content: + text/csv: + schema: + type: array + items: &id049 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + created: + type: string + format: date-time + description: The date formated as YYYY-MM-DDTHH:mm:ss.SSS format. + last_trade: + type: string + format: date-time + description: The last trade date formated as YYYY-MM-DDTHH:mm:ss.SSS format. + open: + type: number + description: The opening trade price. + high: + type: number + description: The highest traded price. + low: + type: number + description: The lowest traded price. + close: + type: number + description: The closing traded price. + volume: + type: integer + description: The amount of contracts / shares traded. + count: + type: integer + description: The amount of trades. + bid_size: + type: integer + description: The last NBBO bid size. + bid_exchange: + type: integer + description: The last NBBO bid [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html). + bid: + type: number + description: The last NBBO bid price. + bid_condition: + type: integer + description: The last NBBO bid [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html). + ask_size: + type: integer + description: The last NBBO ask size. + ask_exchange: + type: integer + description: The last NBBO ask [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html). + ask: + type: number + description: The last NBBO ask price. + ask_condition: + type: integer + description: The last NBBO ask [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html). + example: "symbol,expiration,strike,right,created,last_trade,open,high,low,close,volume,count,bid_size,bid_exchange,bid,bid_condition,ask_size,ask_exchange,ask,ask_condition\r\ + \nAAPL,2024-11-15,170.000,CALL,2024-11-04T17:16:56.205,2024-11-04T15:48:12.005,52.54,52.75,52.40,52.40,10,3,70,60,52.05,50,15,47,52.45,50\r\ + \n" + application/json: + schema: &id050 + type: array + items: *id049 + example: + symbol: + - AAPL + ask_size: + - 15 + last_trade: + - '2024-11-04T15:48:12.005' + created: + - '2024-11-04T17:16:56.205' + ask_condition: + - 50 + strike: + - 170.0 + count: + - 3 + right: + - CALL + volume: + - 10 + high: + - 52.75 + low: + - 52.4 + bid_size: + - 70 + ask_exchange: + - 47 + bid_exchange: + - 60 + ask: + - 52.45 + expiration: + - '2024-11-15' + bid: + - 52.05 + bid_condition: + - 50 + close: + - 52.4 + open: + - 52.54 + application/x-ndjson: + schema: *id050 + example: '{"symbol":"AAPL","ask_size":15,"last_trade":"2024-11-04T15:48:12.005","created":"2024-11-04T17:16:56.205","ask_condition":50,"strike":170.000,"count":3,"right":"CALL","volume":10,"high":52.75,"low":52.40,"bid_size":70,"ask_exchange":47,"bid_exchange":60,"ask":52.45,"expiration":"2024-11-15","bid":52.05,"bid_condition":50,"close":52.40,"open":52.54}' + + /option/history/ohlc: + x-min-subscription: value + get: + summary: Open High Low Close + operationId: option_history_ohlc + tags: + - Option + - History + description: | + - Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. + - Time timestamp of the bar represents the opening time of the bar. For a trade to be part of the bar: ``bar timestamp`` <= ``trade time`` < ``bar timestamp + interval``. + x-sample-urls: + - url: http://localhost:25503/v3/option/history/ohlc?symbol=AAPL&expiration=20231103&strike=170.000&right=call&date=20231103&interval=1m + description: "Returns OHLC for an option contract" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration_no_star" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/interval" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns OHLC for an option contract + content: + text/csv: + schema: + type: array + items: &id051 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + open: + type: number + description: The opening trade price. + high: + type: number + description: The highest traded price. + low: + type: number + description: The lowest traded price. + close: + type: number + description: The closing traded price. + volume: + type: integer + description: The amount of contracts / shares traded. + count: + type: integer + description: The amount of trades. + vwap: + type: number + description: The volume weighted average price of the given interval. + example: "symbol,expiration,strike,right,timestamp,open,high,low,close,volume,count,vwap\r\nAAPL,2023-11-03,170.000,CALL,2023-11-03T09:30:00,4.48,7.05,3.60,4.00,147,24,4.39\r\ + \nAAPL,2023-11-03,170.000,CALL,2023-11-03T09:31:00,3.85,4.65,3.65,4.65,39,19,4.31\r\nAAPL,2023-11-03,170.000,CALL,2023-11-03T09:32:00,4.75,5.20,4.65,5.00,45,14,4.45\r\ + \nAAPL,2023-11-03,170.000,CALL,2023-11-03T09:33:00,4.95,5.05,4.48,4.49,142,23,4.53\r\nAAPL,2023-11-03,170.000,CALL,2023-11-03T09:34:00,4.50,5.05,4.50,4.73,29,11,4.56\r\ + \n" + application/json: + schema: &id052 + type: array + items: *id051 + example: + volume: + - 147 + - 39 + - 45 + - 142 + - 29 + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + high: + - 7.05 + - 4.65 + - 5.2 + - 5.05 + - 5.05 + low: + - 3.6 + - 3.65 + - 4.65 + - 4.48 + - 4.5 + strike: + - 170.0 + - 170.0 + - 170.0 + - 170.0 + - 170.0 + vwap: + - 4.39 + - 4.31 + - 4.45 + - 4.53 + - 4.56 + count: + - 24 + - 19 + - 14 + - 23 + - 11 + expiration: + - '2023-11-03' + - '2023-11-03' + - '2023-11-03' + - '2023-11-03' + - '2023-11-03' + right: + - CALL + - CALL + - CALL + - CALL + - CALL + close: + - 4.0 + - 4.65 + - 5.0 + - 4.49 + - 4.73 + open: + - 4.48 + - 3.85 + - 4.75 + - 4.95 + - 4.5 + timestamp: + - '2023-11-03T09:30:00' + - '2023-11-03T09:31:00' + - '2023-11-03T09:32:00' + - '2023-11-03T09:33:00' + - '2023-11-03T09:34:00' + application/x-ndjson: + schema: *id052 + example: '{"volume":147,"symbol":"AAPL","high":7.05,"low":3.60,"strike":170.000,"vwap":4.39,"count":24,"expiration":"2023-11-03","right":"CALL","close":4.00,"open":4.48,"timestamp":"2023-11-03T09:30:00"} + + {"volume":39,"symbol":"AAPL","high":4.65,"low":3.65,"strike":170.000,"vwap":4.31,"count":19,"expiration":"2023-11-03","right":"CALL","close":4.65,"open":3.85,"timestamp":"2023-11-03T09:31:00"} + + {"volume":45,"symbol":"AAPL","high":5.20,"low":4.65,"strike":170.000,"vwap":4.45,"count":14,"expiration":"2023-11-03","right":"CALL","close":5.00,"open":4.75,"timestamp":"2023-11-03T09:32:00"} + + {"volume":142,"symbol":"AAPL","high":5.05,"low":4.48,"strike":170.000,"vwap":4.53,"count":23,"expiration":"2023-11-03","right":"CALL","close":4.49,"open":4.95,"timestamp":"2023-11-03T09:33:00"} + + {"volume":29,"symbol":"AAPL","high":5.05,"low":4.50,"strike":170.000,"vwap":4.56,"count":11,"expiration":"2023-11-03","right":"CALL","close":4.73,"open":4.50,"timestamp":"2023-11-03T09:34:00"}' + + /option/history/trade: + x-min-subscription: standard + get: + summary: Trade + operationId: option_history_trade + tags: + - Option + - History + description: | + - Returns every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - Trade condition mappings can be found [here](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html). + - Extended trade conditions are not reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) for options, so they can be ignored. + x-sample-urls: + - url: http://localhost:25503/v3/option/history/trade?symbol=AAPL&expiration=20241108&strike=220.000&right=call&date=20241104 + description: "Returns every trade for an option contract" + - url: http://localhost:25503/v3/option/history/trade?symbol=AAPL&expiration=*&date=20241104 + description: "Returns every trade for all option contracts" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + # - $ref: "#/components/parameters/interval" # NOT CURRENTLY SUPPORTED IN v2 + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns every trade for an option contract + content: + text/csv: + schema: + type: array + items: &id053 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + sequence: + type: integer + description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences). + ext_condition1: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition2: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition3: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition4: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + condition: + type: integer + description: The trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html). + size: + type: integer + description: The amount of contracts / shares traded. + exchange: + type: integer + description: The [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html) the trade was executed. + price: + type: number + description: The trade price. + example: "symbol,expiration,strike,right,timestamp,sequence,ext_condition1,ext_condition2,ext_condition3,ext_condition4,condition,size,exchange,price\r\ + \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:00.471,18902138,255,255,255,255,130,2,22,3.90\r\nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:01.626,19368856,255,255,255,255,130,1,6,4.25\r\ + \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:01.698,19403970,255,255,255,255,130,1,6,4.22\r\nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:02.064,19598457,255,255,255,255,18,1,5,4.15\r\ + \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:02.064,19598464,255,255,255,255,18,1,5,4.15\r\n" + application/json: + schema: &id054 + type: array + items: *id053 + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + strike: + - 220.0 + - 220.0 + - 220.0 + - 220.0 + - 220.0 + right: + - CALL + - CALL + - CALL + - CALL + - CALL + sequence: + - 18902138 + - 19368856 + - 19403970 + - 19598457 + - 19598464 + condition: + - 130 + - 130 + - 130 + - 18 + - 18 + size: + - 2 + - 1 + - 1 + - 1 + - 1 + price: + - 3.9 + - 4.25 + - 4.22 + - 4.15 + - 4.15 + ext_condition2: + - 255 + - 255 + - 255 + - 255 + - 255 + ext_condition1: + - 255 + - 255 + - 255 + - 255 + - 255 + expiration: + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + ext_condition4: + - 255 + - 255 + - 255 + - 255 + - 255 + exchange: + - 22 + - 6 + - 6 + - 5 + - 5 + ext_condition3: + - 255 + - 255 + - 255 + - 255 + - 255 + timestamp: + - '2024-11-04T09:30:00.471' + - '2024-11-04T09:30:01.626' + - '2024-11-04T09:30:01.698' + - '2024-11-04T09:30:02.064' + - '2024-11-04T09:30:02.064' + application/x-ndjson: + schema: *id054 + example: '{"symbol":"AAPL","strike":220.000,"right":"CALL","sequence":18902138,"condition":130,"size":2,"price":3.90,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":22,"ext_condition3":255,"timestamp":"2024-11-04T09:30:00.471"} + + {"symbol":"AAPL","strike":220.000,"right":"CALL","sequence":19368856,"condition":130,"size":1,"price":4.25,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":6,"ext_condition3":255,"timestamp":"2024-11-04T09:30:01.626"} + + {"symbol":"AAPL","strike":220.000,"right":"CALL","sequence":19403970,"condition":130,"size":1,"price":4.22,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":6,"ext_condition3":255,"timestamp":"2024-11-04T09:30:01.698"} + + {"symbol":"AAPL","strike":220.000,"right":"CALL","sequence":19598457,"condition":18,"size":1,"price":4.15,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":5,"ext_condition3":255,"timestamp":"2024-11-04T09:30:02.064"} + + {"symbol":"AAPL","strike":220.000,"right":"CALL","sequence":19598464,"condition":18,"size":1,"price":4.15,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":5,"ext_condition3":255,"timestamp":"2024-11-04T09:30:02.064"}' + + /option/history/quote: + x-min-subscription: value + get: + summary: Quote + operationId: option_history_quote + tags: + - Option + - History + description: | + - Returns every NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - If the ``interval`` parameter is specified, the quote for each interval represents the last quote at the interval's timestamp. + x-sample-urls: + - url: http://localhost:25503/v3/option/history/quote?symbol=AAPL&expiration=20241108&strike=220.000&right=call&date=20241104&interval=1m + description: "Returns every quote for an option contract" + - url: http://localhost:25503/v3/option/history/quote?symbol=AAPL&expiration=*&date=20241104&interval=1m + description: "Returns every quote for all option contracts" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/interval" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns every quote for an option contract + content: + text/csv: + schema: + type: array + items: &id055 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + bid_size: + type: integer + description: The last NBBO bid size. + bid_exchange: + type: integer + description: The last NBBO bid [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html). + bid: + type: number + description: The last NBBO bid price. + bid_condition: + type: integer + description: The last NBBO bid [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html). + ask_size: + type: integer + description: The last NBBO ask size. + ask_exchange: + type: integer + description: The last NBBO ask [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html). + ask: + type: number + description: The last NBBO ask price. + ask_condition: + type: integer + description: The last NBBO ask [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html). + example: "symbol,expiration,strike,right,timestamp,bid_size,bid_exchange,bid,bid_condition,ask_size,ask_exchange,ask,ask_condition\r\ + \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:00,0,42,0.00,50,0,42,0.00,50\r\nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:31:00,598,5,4.55,50,424,9,4.70,50\r\ + \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:32:00,58,46,4.30,50,221,11,4.40,50\r\nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:33:00,394,43,3.90,50,45,47,4.00,50\r\ + \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:34:00,194,11,4.15,50,121,11,4.30,50\r\n" + application/json: + schema: &id056 + type: array + items: *id055 + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + ask_size: + - 0 + - 424 + - 221 + - 45 + - 121 + ask_condition: + - 50 + - 50 + - 50 + - 50 + - 50 + strike: + - 220.0 + - 220.0 + - 220.0 + - 220.0 + - 220.0 + right: + - CALL + - CALL + - CALL + - CALL + - CALL + bid_size: + - 0 + - 598 + - 58 + - 394 + - 194 + ask_exchange: + - 42 + - 9 + - 11 + - 47 + - 11 + bid_exchange: + - 42 + - 5 + - 46 + - 43 + - 11 + ask: + - 0.0 + - 4.7 + - 4.4 + - 4.0 + - 4.3 + expiration: + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + bid: + - 0.0 + - 4.55 + - 4.3 + - 3.9 + - 4.15 + bid_condition: + - 50 + - 50 + - 50 + - 50 + - 50 + timestamp: + - '2024-11-04T09:30:00' + - '2024-11-04T09:31:00' + - '2024-11-04T09:32:00' + - '2024-11-04T09:33:00' + - '2024-11-04T09:34:00' + application/x-ndjson: + schema: *id056 + example: '{"symbol":"AAPL","ask_size":0,"ask_condition":50,"strike":220.000,"right":"CALL","bid_size":0,"ask_exchange":42,"bid_exchange":42,"ask":0.00,"expiration":"2024-11-08","bid":0.00,"bid_condition":50,"timestamp":"2024-11-04T09:30:00"} + + {"symbol":"AAPL","ask_size":424,"ask_condition":50,"strike":220.000,"right":"CALL","bid_size":598,"ask_exchange":9,"bid_exchange":5,"ask":4.70,"expiration":"2024-11-08","bid":4.55,"bid_condition":50,"timestamp":"2024-11-04T09:31:00"} + + {"symbol":"AAPL","ask_size":221,"ask_condition":50,"strike":220.000,"right":"CALL","bid_size":58,"ask_exchange":11,"bid_exchange":46,"ask":4.40,"expiration":"2024-11-08","bid":4.30,"bid_condition":50,"timestamp":"2024-11-04T09:32:00"} + + {"symbol":"AAPL","ask_size":45,"ask_condition":50,"strike":220.000,"right":"CALL","bid_size":394,"ask_exchange":47,"bid_exchange":43,"ask":4.00,"expiration":"2024-11-08","bid":3.90,"bid_condition":50,"timestamp":"2024-11-04T09:33:00"} + + {"symbol":"AAPL","ask_size":121,"ask_condition":50,"strike":220.000,"right":"CALL","bid_size":194,"ask_exchange":11,"bid_exchange":11,"ask":4.30,"expiration":"2024-11-08","bid":4.15,"bid_condition":50,"timestamp":"2024-11-04T09:34:00"}' + + /option/history/trade_quote: + x-min-subscription: standard + get: + summary: Trade Quote + operationId: option_history_trade_quote + tags: + - Option + - History + description: | + - Returns every [trade](/operations/option_history_trade.html) reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) paired with the last NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) at the time of trade. + - A quote is matched with a trade if its timestamp ``<=`` the trade timestamp. + - To match trades with quotes timestamps that are ``<`` the trade timestamp, specify the ``exclusive``parameter to ``true``. After thorough testing, we have determined that using ``exclusive=true`` might yield better results for various applications. + x-sample-urls: + - url: http://localhost:25503/v3/option/history/trade_quote?symbol=AAPL&expiration=20241108&strike=220.000&right=call&date=20241104 + description: "Returns every trade quote for an option contract" + - url: http://localhost:25503/v3/option/history/trade_quote?symbol=AAPL&expiration=*&date=20241104 + description: "Returns every trade quote for all option contracts" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/exclusive" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns every trade quote for an option contract + content: + text/csv: + schema: + type: array + items: &id057 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + trade_timestamp: + type: string + format: date-time + description: The trade date formated as YYYY-MM-DDTHH:mm:ss.SSS format. + quote_timestamp: + type: string + format: date-time + description: The quote date formated as YYYY-MM-DDTHH:mm:ss.SSS format. + sequence: + type: integer + description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences). + ext_condition1: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition2: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition3: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition4: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + condition: + type: integer + description: The trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html). + size: + type: integer + description: The amount of contracts / shares traded. + exchange: + type: integer + description: The [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html) the trade was executed. + price: + type: number + description: The trade price. + bid_size: + type: integer + description: The last NBBO bid size. + bid_exchange: + type: integer + description: The last NBBO bid [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html). + bid: + type: number + description: The last NBBO bid price. + bid_condition: + type: integer + description: The last NBBO bid [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html). + ask_size: + type: integer + description: The last NBBO ask size. + ask_exchange: + type: integer + description: The last NBBO ask [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html). + ask: + type: number + description: The last NBBO ask price. + ask_condition: + type: integer + description: The last NBBO ask [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html). + example: "symbol,expiration,strike,right,trade_timestamp,quote_timestamp,sequence,ext_condition1,ext_condition2,ext_condition3,ext_condition4,condition,size,exchange,price,bid_size,bid_exchange,bid,bid_condition,ask_size,ask_exchange,ask,ask_condition\r\ + \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:00.471,2024-11-04T09:30:00.396,18902138,255,255,255,255,130,2,22,3.90,14,47,3.90,50,14,47,4.05,50\r\ + \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:01.626,2024-11-04T09:30:01.594,19368856,255,255,255,255,130,1,6,4.25,93,76,4.15,50,35,73,4.30,50\r\ + \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:01.698,2024-11-04T09:30:01.643,19403970,255,255,255,255,130,1,6,4.22,59,69,4.15,50,59,69,4.30,50\r\ + \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:02.064,2024-11-04T09:30:02.039,19598457,255,255,255,255,18,1,5,4.15,31,69,4.15,50,81,11,4.30,50\r\ + \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:02.064,2024-11-04T09:30:02.039,19598464,255,255,255,255,18,1,5,4.15,31,69,4.15,50,81,11,4.30,50\r\ + \n" + application/json: + schema: &id058 + type: array + items: *id057 + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + ask_size: + - 14 + - 35 + - 59 + - 81 + - 81 + trade_timestamp: + - '2024-11-04T09:30:00.471' + - '2024-11-04T09:30:01.626' + - '2024-11-04T09:30:01.698' + - '2024-11-04T09:30:02.064' + - '2024-11-04T09:30:02.064' + ask_condition: + - 50 + - 50 + - 50 + - 50 + - 50 + strike: + - 220.0 + - 220.0 + - 220.0 + - 220.0 + - 220.0 + right: + - CALL + - CALL + - CALL + - CALL + - CALL + sequence: + - 18902138 + - 19368856 + - 19403970 + - 19598457 + - 19598464 + condition: + - 130 + - 130 + - 130 + - 18 + - 18 + size: + - 2 + - 1 + - 1 + - 1 + - 1 + bid_size: + - 14 + - 93 + - 59 + - 31 + - 31 + ask_exchange: + - 47 + - 73 + - 69 + - 11 + - 11 + price: + - 3.9 + - 4.25 + - 4.22 + - 4.15 + - 4.15 + ext_condition2: + - 255 + - 255 + - 255 + - 255 + - 255 + bid_exchange: + - 47 + - 76 + - 69 + - 69 + - 69 + ask: + - 4.05 + - 4.3 + - 4.3 + - 4.3 + - 4.3 + quote_timestamp: + - '2024-11-04T09:30:00.396' + - '2024-11-04T09:30:01.594' + - '2024-11-04T09:30:01.643' + - '2024-11-04T09:30:02.039' + - '2024-11-04T09:30:02.039' + ext_condition1: + - 255 + - 255 + - 255 + - 255 + - 255 + expiration: + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + ext_condition4: + - 255 + - 255 + - 255 + - 255 + - 255 + exchange: + - 22 + - 6 + - 6 + - 5 + - 5 + ext_condition3: + - 255 + - 255 + - 255 + - 255 + - 255 + bid: + - 3.9 + - 4.15 + - 4.15 + - 4.15 + - 4.15 + bid_condition: + - 50 + - 50 + - 50 + - 50 + - 50 + application/x-ndjson: + schema: *id058 + example: '{"symbol":"AAPL","ask_size":14,"trade_timestamp":"2024-11-04T09:30:00.471","ask_condition":50,"strike":220.000,"right":"CALL","sequence":18902138,"condition":130,"size":2,"bid_size":14,"ask_exchange":47,"price":3.90,"ext_condition2":255,"bid_exchange":47,"ask":4.05,"quote_timestamp":"2024-11-04T09:30:00.396","ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":22,"ext_condition3":255,"bid":3.90,"bid_condition":50} + + {"symbol":"AAPL","ask_size":35,"trade_timestamp":"2024-11-04T09:30:01.626","ask_condition":50,"strike":220.000,"right":"CALL","sequence":19368856,"condition":130,"size":1,"bid_size":93,"ask_exchange":73,"price":4.25,"ext_condition2":255,"bid_exchange":76,"ask":4.30,"quote_timestamp":"2024-11-04T09:30:01.594","ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":6,"ext_condition3":255,"bid":4.15,"bid_condition":50} + + {"symbol":"AAPL","ask_size":59,"trade_timestamp":"2024-11-04T09:30:01.698","ask_condition":50,"strike":220.000,"right":"CALL","sequence":19403970,"condition":130,"size":1,"bid_size":59,"ask_exchange":69,"price":4.22,"ext_condition2":255,"bid_exchange":69,"ask":4.30,"quote_timestamp":"2024-11-04T09:30:01.643","ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":6,"ext_condition3":255,"bid":4.15,"bid_condition":50} + + {"symbol":"AAPL","ask_size":81,"trade_timestamp":"2024-11-04T09:30:02.064","ask_condition":50,"strike":220.000,"right":"CALL","sequence":19598457,"condition":18,"size":1,"bid_size":31,"ask_exchange":11,"price":4.15,"ext_condition2":255,"bid_exchange":69,"ask":4.30,"quote_timestamp":"2024-11-04T09:30:02.039","ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":5,"ext_condition3":255,"bid":4.15,"bid_condition":50} + + {"symbol":"AAPL","ask_size":81,"trade_timestamp":"2024-11-04T09:30:02.064","ask_condition":50,"strike":220.000,"right":"CALL","sequence":19598464,"condition":18,"size":1,"bid_size":31,"ask_exchange":11,"price":4.15,"ext_condition2":255,"bid_exchange":69,"ask":4.30,"quote_timestamp":"2024-11-04T09:30:02.039","ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":5,"ext_condition3":255,"bid":4.15,"bid_condition":50}' + + /option/history/open_interest: + x-min-subscription: value + get: + summary: Open Interest + operationId: option_history_open_interest + tags: + - Option + - History + description: | + - Open Interest is normally reported once per day by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) at approximately 06:30 ET. + - A new open interest message might not be sent by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) if there is no open interest for the option contract. + - The reported open interest represents the open interest at the end of the previous trading day. + x-sample-urls: + - url: http://localhost:25503/v3/option/history/open_interest?symbol=AAPL&expiration=20241108&strike=220.000&right=call&date=20241104 + description: "Returns open interest for an option contract" + - url: http://localhost:25503/v3/option/history/open_interest?symbol=AAPL&expiration=*&date=20241104 + description: "Returns open interest for all option contracts" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns open interest for an option contract + content: + text/csv: + schema: + type: array + items: &id059 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + open_interest: + type: integer + description: The total amount of outstanding contracts. + example: "symbol,expiration,strike,right,timestamp,open_interest\r\nAAPL,2024-11-08,220.000,CALL,2024-11-04T06:30:04,2732\r\ + \n" + application/json: + schema: &id060 + type: array + items: *id059 + example: + symbol: + - AAPL + strike: + - 220.0 + open_interest: + - 2732 + expiration: + - '2024-11-08' + right: + - CALL + timestamp: + - '2024-11-04T06:30:04' + application/x-ndjson: + schema: *id060 + example: '{"symbol":"AAPL","strike":220.000,"open_interest":2732,"expiration":"2024-11-08","right":"CALL","timestamp":"2024-11-04T06:30:04"}' + + /option/history/greeks/eod: + x-min-subscription: standard + get: + summary: End of Day Greeks + operationId: option_history_greeks_eod + tags: + - Option + - History + description: | + - Returns the data for all contracts that share the same provided symbol and expiration. + - Uses Theta Data's EOD reports that get generated at 17:15 ET each day. The closing option price and closing underlying price are used for the greeks calculation. + - **Set `expiration` to ``*`` if you want to retrieve data for every option that shares the same ``symbol``. (note: Any ``expiration=*`` must be requested day by day)** + > The quote fields (bid / ask info) may not be available prior to 2023-12-01. We are working to expose this over the coming months. Obtaining the quote at the end of the day requires much more processing than the trades, so we initially generated our history for trades. + x-sample-urls: + - url: http://localhost:25503/v3/option/history/greeks/eod?symbol=AAPL&expiration=20241108&strike=220.000&right=call&start_date=20241104&end_date=20241104 + description: "Returns EOD report for an option contract" + - url: http://localhost:25503/v3/option/history/greeks/eod?symbol=AAPL&expiration=*&start_date=20241104&end_date=20241104 + description: "Returns EOD report for all option contracts" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/start_date" + - $ref: "#/components/parameters/end_date" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns EOD report for an option contract + content: + text/csv: + schema: + type: array + items: &id061 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + open: + type: number + description: The opening trade price. + high: + type: number + description: The highest traded price. + low: + type: number + description: The lowest traded price. + close: + type: number + description: The closing traded price. + volume: + type: integer + description: The amount of contracts / shares traded. + count: + type: integer + description: The amount of trades. + bid_size: + type: integer + description: The last NBBO bid size. + bid_exchange: + type: integer + description: The last NBBO bid [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html). + bid: + type: number + description: The last NBBO bid price. + bid_condition: + type: integer + description: The last NBBO bid [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html). + ask_size: + type: integer + description: The last NBBO ask size. + ask_exchange: + type: integer + description: The last NBBO ask [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html). + ask: + type: number + description: The last NBBO ask price. + ask_condition: + type: integer + description: The last NBBO ask [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html). + delta: + type: number + description: The delta. + theta: + type: string + description: The Theta. + vega: + type: number + description: The vega. + rho: + type: number + description: The rho. + epsilon: + type: string + description: The epsilon. + lambda: + type: number + description: The lambda. + gamma: + type: number + description: The gamma. + vanna: + type: string + description: The vanna. + charm: + type: number + description: The charm. + vomma: + type: number + description: The vomma. + veta: + type: number + description: The veta. + vera: + type: number + description: The vera. + speed: + type: number + description: The speed. + zomma: + type: number + description: The zomma. + color: + type: string + description: The color. + ultima: + type: string + description: The ultima. + d1: + type: number + description: The d1. + d2: + type: number + description: The d2. + dual_delta: + type: string + description: The dual delta. + dual_gamma: + type: number + description: The dual gamma. + implied_vol: + type: number + description: The implied volatiltiy calculated using the trade price. + iv_error: + type: number + description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the + actual value reported in the quote. This value will increase as the strike price recedes from the + underlying price.' + underlying_timestamp: + type: string + format: date-time + description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format. + underlying_price: + type: number + description: The midpoint of the underlying at the time of the option trade. + example: "symbol,expiration,strike,right,timestamp,open,high,low,close,volume,count,bid_size,bid_exchange,bid,bid_condition,ask_size,ask_exchange,ask,ask_condition,delta,theta,vega,rho,epsilon,lambda,gamma,vanna,charm,vomma,veta,vera,speed,zomma,color,ultima,d1,d2,dual_delta,dual_gamma,implied_vol,iv_error,underlying_timestamp,underlying_price\r\ + \nAAPL,2024-11-08,220.000,CALL,2024-11-04T15:59:59.828,3.90,4.85,3.35,4.15,7425,1511,9,11,4.10,50,12,5,4.25,50,0.6083,-0.3892,8.9221,1.4334,-1.4791,32.3623,0.0495,-0.2765,3.6779,1.7667,0.0149,0.0000,0.0000,0.0000,-0.0163,-15.6407,0.2750,0.2401,-0.5945,0.0000,0.3334,0.0001,2024-11-04T17:15:28.71,221.870\r\ + \n" + application/json: + schema: &id062 + type: array + items: *id061 + example: + symbol: + - AAPL + ask_size: + - 12 + dual_delta: + - -0.5945 + color: + - -0.0163 + zomma: + - 0.0 + delta: + - 0.6083 + implied_vol: + - 0.3334 + theta: + - -0.3892 + d1: + - 0.275 + speed: + - 0.0 + d2: + - 0.2401 + epsilon: + - -1.4791 + high: + - 4.85 + lambda: + - 32.3623 + low: + - 3.35 + ask_exchange: + - 5 + bid_exchange: + - 11 + vomma: + - 1.7667 + bid_condition: + - 50 + underlying_timestamp: + - '2024-11-04T17:15:28.71' + close: + - 4.15 + timestamp: + - '2024-11-04T15:59:59.828' + underlying_price: + - 221.87 + ask_condition: + - 50 + strike: + - 220.0 + count: + - 1511 + vera: + - 0.0 + right: + - CALL + veta: + - 0.0149 + iv_error: + - 0.0001 + ultima: + - -15.6407 + volume: + - 7425 + charm: + - 3.6779 + bid_size: + - 9 + ask: + - 4.25 + rho: + - 1.4334 + expiration: + - '2024-11-08' + vanna: + - -0.2765 + dual_gamma: + - 0.0 + bid: + - 4.1 + open: + - 3.9 + vega: + - 8.9221 + gamma: + - 0.0495 + application/x-ndjson: + schema: *id062 + example: '{"symbol":"AAPL","ask_size":12,"dual_delta":-0.5945,"color":-0.0163,"zomma":0.0000,"delta":0.6083,"implied_vol":0.3334,"theta":-0.3892,"d1":0.2750,"speed":0.0000,"d2":0.2401,"epsilon":-1.4791,"high":4.85,"lambda":32.3623,"low":3.35,"ask_exchange":5,"bid_exchange":11,"vomma":1.7667,"bid_condition":50,"underlying_timestamp":"2024-11-04T17:15:28.71","close":4.15,"timestamp":"2024-11-04T15:59:59.828","underlying_price":221.870,"ask_condition":50,"strike":220.000,"count":1511,"vera":0.0000,"right":"CALL","veta":0.0149,"iv_error":0.0001,"ultima":-15.6407,"volume":7425,"charm":3.6779,"bid_size":9,"ask":4.25,"rho":1.4334,"expiration":"2024-11-08","vanna":-0.2765,"dual_gamma":0.0000,"bid":4.10,"open":3.90,"vega":8.9221,"gamma":0.0495}' + + /option/history/greeks/all: + x-min-subscription: professional + get: + summary: All Greeks + operationId: option_history_greeks_all + tags: + - Option + - History + description: | + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculated using the option and underlying midpoint price. If an interval size is specified (*highly recommended*), the option quote used in the calculation follows the same rules as the [quote](/operations/option_history_quote.html) endpoint. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html). + x-sample-urls: + - url: http://localhost:25503/v3/option/history/greeks/all?symbol=AAPL&expiration=20241108&date=20241104&interval=10m + description: "Returns all greeks for an option contract" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration_no_star" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/interval" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns all greeks for an option contract + content: + text/csv: + schema: + type: array + items: &id063 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + bid: + type: number + description: The last NBBO bid price. + ask: + type: number + description: The last NBBO ask price. + delta: + type: number + description: The delta. + theta: + type: number + description: The Theta. + vega: + type: number + description: The vega. + rho: + type: number + description: The rho. + epsilon: + type: number + description: The epsilon. + lambda: + type: number + description: The lambda. + gamma: + type: number + description: The gamma. + vanna: + type: number + description: The vanna. + charm: + type: number + description: The charm. + vomma: + type: number + description: The vomma. + veta: + type: number + description: The veta. + vera: + type: number + description: The vera. + speed: + type: number + description: The speed. + zomma: + type: number + description: The zomma. + color: + type: number + description: The color. + ultima: + type: number + description: The ultima. + d1: + type: string + description: The d1. + d2: + type: string + description: The d2. + dual_delta: + type: number + description: The dual delta. + dual_gamma: + type: number + description: The dual gamma. + implied_vol: + type: number + description: The implied volatiltiy calculated using the trade price. + iv_error: + type: number + description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the + actual value reported in the quote. This value will increase as the strike price recedes from the + underlying price.' + underlying_timestamp: + type: string + format: date-time + description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format. + underlying_price: + type: number + description: The midpoint of the underlying at the time of the option trade. + example: "symbol,expiration,strike,right,timestamp,bid,ask,delta,theta,vega,rho,epsilon,lambda,gamma,vanna,charm,vomma,veta,vera,speed,zomma,color,ultima,d1,d2,dual_delta,dual_gamma,implied_vol,iv_error,underlying_timestamp,underlying_price\r\ + \nAAPL,2024-11-08,262.500,CALL,2024-11-04T09:30:00,0.00,0.00,0.0000,0.0000,0.0000,0.0000,0.0000,261.9304,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0001,-6.5422,-6.5683,0.0000,0.0000,0.2500,100.0000,2024-11-04T09:30:00,221.00\r\ + \nAAPL,2024-11-08,262.500,CALL,2024-11-04T09:40:00,0.00,0.02,0.0026,-0.0138,0.1873,0.0062,-0.0063,55.3974,0.0005,0.0393,-1.0623,2.5389,0.0136,0.0000,0.0000,0.0000,-0.0005,21.4427,-2.7911,-2.8526,-0.0021,0.0000,0.5874,0.0455,2024-11-04T09:40:00,220.56\r\ + \nAAPL,2024-11-08,262.500,CALL,2024-11-04T09:50:00,0.00,0.02,0.0025,-0.0130,0.1807,0.0059,-0.0060,56.7822,0.0005,0.0388,-1.0265,2.5262,0.0133,0.0000,0.0000,0.0000,-0.0005,22.1272,-2.8050,-2.8652,-0.0020,0.0000,0.5749,-0.0199,2024-11-04T09:50:00,221.20\r\ + \nAAPL,2024-11-08,262.500,CALL,2024-11-04T10:00:00,0.00,0.02,0.0025,-0.0129,0.1825,0.0060,-0.0061,57.9900,0.0006,0.0399,-1.0319,2.6034,0.0136,0.0000,0.0000,0.0000,-0.0005,23.2345,-2.8027,-2.8616,-0.0021,0.0000,0.5625,-0.0299,2024-11-04T10:00:00,222.06\r\ + \nAAPL,2024-11-08,262.500,CALL,2024-11-04T10:10:00,0.00,0.01,0.0000,0.0000,0.0000,0.0000,0.0000,254.5285,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0004,-6.3404,-6.3666,0.0000,0.0000,0.2500,100.0000,2024-11-04T10:10:00,222.17\r\ + \n" + application/json: + schema: &id064 + type: array + items: *id063 + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + dual_delta: + - 0.0 + - -0.0021 + - -0.002 + - -0.0021 + - 0.0 + color: + - 0.0 + - -0.0005 + - -0.0005 + - -0.0005 + - 0.0 + zomma: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + delta: + - 0.0 + - 0.0026 + - 0.0025 + - 0.0025 + - 0.0 + implied_vol: + - 0.25 + - 0.5874 + - 0.5749 + - 0.5625 + - 0.25 + theta: + - 0.0 + - -0.0138 + - -0.013 + - -0.0129 + - 0.0 + d1: + - -6.5422 + - -2.7911 + - -2.805 + - -2.8027 + - -6.3404 + speed: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + d2: + - -6.5683 + - -2.8526 + - -2.8652 + - -2.8616 + - -6.3666 + epsilon: + - 0.0 + - -0.0063 + - -0.006 + - -0.0061 + - 0.0 + lambda: + - 261.9304 + - 55.3974 + - 56.7822 + - 57.99 + - 254.5285 + vomma: + - 0.0 + - 2.5389 + - 2.5262 + - 2.6034 + - 0.0 + underlying_timestamp: + - '2024-11-04T09:30:00' + - '2024-11-04T09:40:00' + - '2024-11-04T09:50:00' + - '2024-11-04T10:00:00' + - '2024-11-04T10:10:00' + timestamp: + - '2024-11-04T09:30:00' + - '2024-11-04T09:40:00' + - '2024-11-04T09:50:00' + - '2024-11-04T10:00:00' + - '2024-11-04T10:10:00' + underlying_price: + - 221.0 + - 220.56 + - 221.2 + - 222.06 + - 222.17 + strike: + - 262.5 + - 262.5 + - 262.5 + - 262.5 + - 262.5 + vera: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + right: + - CALL + - CALL + - CALL + - CALL + - CALL + veta: + - 0.0 + - 0.0136 + - 0.0133 + - 0.0136 + - 0.0 + iv_error: + - 100.0 + - 0.0455 + - -0.0199 + - -0.0299 + - 100.0 + ultima: + - 0.0001 + - 21.4427 + - 22.1272 + - 23.2345 + - 0.0004 + charm: + - 0.0 + - -1.0623 + - -1.0265 + - -1.0319 + - 0.0 + ask: + - 0.0 + - 0.02 + - 0.02 + - 0.02 + - 0.01 + rho: + - 0.0 + - 0.0062 + - 0.0059 + - 0.006 + - 0.0 + expiration: + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + vanna: + - 0.0 + - 0.0393 + - 0.0388 + - 0.0399 + - 0.0 + dual_gamma: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + bid: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + vega: + - 0.0 + - 0.1873 + - 0.1807 + - 0.1825 + - 0.0 + gamma: + - 0.0 + - 0.0005 + - 0.0005 + - 0.0006 + - 0.0 + application/x-ndjson: + schema: *id064 + example: '{"symbol":"AAPL","dual_delta":0.0000,"color":0.0000,"zomma":0.0000,"delta":0.0000,"implied_vol":0.2500,"theta":0.0000,"d1":-6.5422,"speed":0.0000,"d2":-6.5683,"epsilon":0.0000,"lambda":261.9304,"vomma":0.0000,"underlying_timestamp":"2024-11-04T09:30:00","timestamp":"2024-11-04T09:30:00","underlying_price":221.00,"strike":262.500,"vera":0.0000,"right":"CALL","veta":0.0000,"iv_error":100.0000,"ultima":0.0001,"charm":0.0000,"ask":0.00,"rho":0.0000,"expiration":"2024-11-08","vanna":0.0000,"dual_gamma":0.0000,"bid":0.00,"vega":0.0000,"gamma":0.0000} + + {"symbol":"AAPL","dual_delta":-0.0021,"color":-0.0005,"zomma":0.0000,"delta":0.0026,"implied_vol":0.5874,"theta":-0.0138,"d1":-2.7911,"speed":0.0000,"d2":-2.8526,"epsilon":-0.0063,"lambda":55.3974,"vomma":2.5389,"underlying_timestamp":"2024-11-04T09:40:00","timestamp":"2024-11-04T09:40:00","underlying_price":220.56,"strike":262.500,"vera":0.0000,"right":"CALL","veta":0.0136,"iv_error":0.0455,"ultima":21.4427,"charm":-1.0623,"ask":0.02,"rho":0.0062,"expiration":"2024-11-08","vanna":0.0393,"dual_gamma":0.0000,"bid":0.00,"vega":0.1873,"gamma":0.0005} + + {"symbol":"AAPL","dual_delta":-0.0020,"color":-0.0005,"zomma":0.0000,"delta":0.0025,"implied_vol":0.5749,"theta":-0.0130,"d1":-2.8050,"speed":0.0000,"d2":-2.8652,"epsilon":-0.0060,"lambda":56.7822,"vomma":2.5262,"underlying_timestamp":"2024-11-04T09:50:00","timestamp":"2024-11-04T09:50:00","underlying_price":221.20,"strike":262.500,"vera":0.0000,"right":"CALL","veta":0.0133,"iv_error":-0.0199,"ultima":22.1272,"charm":-1.0265,"ask":0.02,"rho":0.0059,"expiration":"2024-11-08","vanna":0.0388,"dual_gamma":0.0000,"bid":0.00,"vega":0.1807,"gamma":0.0005} + + {"symbol":"AAPL","dual_delta":-0.0021,"color":-0.0005,"zomma":0.0000,"delta":0.0025,"implied_vol":0.5625,"theta":-0.0129,"d1":-2.8027,"speed":0.0000,"d2":-2.8616,"epsilon":-0.0061,"lambda":57.9900,"vomma":2.6034,"underlying_timestamp":"2024-11-04T10:00:00","timestamp":"2024-11-04T10:00:00","underlying_price":222.06,"strike":262.500,"vera":0.0000,"right":"CALL","veta":0.0136,"iv_error":-0.0299,"ultima":23.2345,"charm":-1.0319,"ask":0.02,"rho":0.0060,"expiration":"2024-11-08","vanna":0.0399,"dual_gamma":0.0000,"bid":0.00,"vega":0.1825,"gamma":0.0006} + + {"symbol":"AAPL","dual_delta":0.0000,"color":0.0000,"zomma":0.0000,"delta":0.0000,"implied_vol":0.2500,"theta":0.0000,"d1":-6.3404,"speed":0.0000,"d2":-6.3666,"epsilon":0.0000,"lambda":254.5285,"vomma":0.0000,"underlying_timestamp":"2024-11-04T10:10:00","timestamp":"2024-11-04T10:10:00","underlying_price":222.17,"strike":262.500,"vera":0.0000,"right":"CALL","veta":0.0000,"iv_error":100.0000,"ultima":0.0004,"charm":0.0000,"ask":0.01,"rho":0.0000,"expiration":"2024-11-08","vanna":0.0000,"dual_gamma":0.0000,"bid":0.00,"vega":0.0000,"gamma":0.0000}' + + /option/history/trade_greeks/all: + x-min-subscription: professional + get: + summary: All Trade Greeks + operationId: option_history_trade_greeks_all + tags: + - Option + - History + description: | + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html). + x-sample-urls: + - url: http://localhost:25503/v3/option/history/trade_greeks/all?symbol=AAPL&expiration=20231117&date=20231110 + description: "Returns all trade greeks for an option contract" + - url: http://localhost:25503/v3/option/history/trade_greeks/all?symbol=AAPL&expiration=*&date=20231110 + description: "Returns all trade greeks for an full chain of option contracts" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns all trade greeks for an option contract + content: + text/csv: + schema: + type: array + items: &id065 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + sequence: + type: string + description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences). + ext_condition1: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition2: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition3: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition4: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + condition: + type: integer + description: The trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html). + size: + type: integer + description: The amount of contracts / shares traded. + exchange: + type: integer + description: The [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html) the trade was executed. + price: + type: number + description: The trade price. + delta: + type: number + description: The delta. + theta: + type: string + description: The Theta. + vega: + type: number + description: The vega. + rho: + type: number + description: The rho. + epsilon: + type: string + description: The epsilon. + lambda: + type: number + description: The lambda. + gamma: + type: number + description: The gamma. + vanna: + type: number + description: The vanna. + charm: + type: string + description: The charm. + vomma: + type: number + description: The vomma. + veta: + type: number + description: The veta. + vera: + type: number + description: The vera. + speed: + type: number + description: The speed. + zomma: + type: number + description: The zomma. + color: + type: string + description: The color. + ultima: + type: string + description: The ultima. + d1: + type: string + description: The d1. + d2: + type: string + description: The d2. + dual_delta: + type: string + description: The dual delta. + dual_gamma: + type: number + description: The dual gamma. + implied_vol: + type: number + description: The implied volatiltiy calculated using the trade price. + iv_error: + type: string + description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the + actual value reported in the quote. This value will increase as the strike price recedes from the + underlying price.' + underlying_timestamp: + type: string + format: date-time + description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format. + underlying_price: + type: number + description: The midpoint of the underlying at the time of the option trade. + example: "symbol,expiration,strike,right,timestamp,sequence,ext_condition1,ext_condition2,ext_condition3,ext_condition4,condition,size,exchange,price,delta,theta,vega,rho,epsilon,lambda,gamma,vanna,charm,vomma,veta,vera,speed,zomma,color,ultima,d1,d2,dual_delta,dual_gamma,implied_vol,iv_error,underlying_timestamp,underlying_price\r\ + \nAAPL,2023-11-17,187.500,CALL,2023-11-10T09:30:00.004,-1391330475,255,255,255,255,18,1,9,0.59,0.2289,-0.1031,7.7122,0.7960,-0.8073,71.4109,0.0674,1.3174,-6.7146,24.9086,0.3553,0.0000,0.0000,0.0000,-0.0129,-100.0000,-0.7424,-0.7668,-0.2213,0.0000,0.1762,-0.0008,2023-11-10T09:30:00,183.89\r\ + \nAAPL,2023-11-17,187.500,CALL,2023-11-10T09:30:00.154,-1391317465,255,255,255,255,18,1,47,0.59,0.2289,-0.1031,7.7122,0.7960,-0.8073,71.4109,0.0674,1.3174,-6.7146,24.9086,0.3553,0.0000,0.0000,0.0000,-0.0129,-100.0000,-0.7424,-0.7668,-0.2213,0.0000,0.1762,-0.0008,2023-11-10T09:30:00,183.89\r\ + \nAAPL,2023-11-17,187.500,CALL,2023-11-10T09:30:00.22,-1391313694,255,255,255,255,18,8,6,0.52,0.2162,-0.0947,7.4656,0.7526,-0.7625,76.6064,0.0689,1.4186,-6.8508,28.3594,0.3755,0.0000,0.0000,0.0000,-0.0118,-100.0000,-0.7849,-0.8081,-0.2093,0.0000,0.1669,-0.0018,2023-11-10T09:30:00,183.89\r\ + \nAAPL,2023-11-17,187.500,CALL,2023-11-10T09:30:00.221,-1391313652,255,255,255,255,130,1,6,0.57,0.2256,-0.1009,7.6504,0.7849,-0.7958,72.7109,0.0678,1.3432,-6.7516,25.7650,0.3605,0.0000,0.0000,0.0000,-0.0126,-100.0000,-0.7531,-0.7772,-0.2182,0.0000,0.1738,0.0012,2023-11-10T09:30:00,183.89\r\ + \nAAPL,2023-11-17,187.500,CALL,2023-11-10T09:30:00.452,-1391297309,255,255,255,255,18,6,31,0.60,0.2308,-0.1044,7.7484,0.8025,-0.8140,70.6522,0.0672,1.3022,-6.6920,24.4114,0.3523,0.0000,0.0000,0.0000,-0.0130,-100.0000,-0.7360,-0.7607,-0.2231,0.0000,0.1777,0.0013,2023-11-10T09:30:00,183.89\r\ + \n" + application/json: + schema: &id066 + type: array + items: *id065 + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + dual_delta: + - -0.2213 + - -0.2213 + - -0.2093 + - -0.2182 + - -0.2231 + color: + - -0.0129 + - -0.0129 + - -0.0118 + - -0.0126 + - -0.013 + zomma: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + delta: + - 0.2289 + - 0.2289 + - 0.2162 + - 0.2256 + - 0.2308 + implied_vol: + - 0.1762 + - 0.1762 + - 0.1669 + - 0.1738 + - 0.1777 + theta: + - -0.1031 + - -0.1031 + - -0.0947 + - -0.1009 + - -0.1044 + d1: + - -0.7424 + - -0.7424 + - -0.7849 + - -0.7531 + - -0.736 + speed: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + d2: + - -0.7668 + - -0.7668 + - -0.8081 + - -0.7772 + - -0.7607 + epsilon: + - -0.8073 + - -0.8073 + - -0.7625 + - -0.7958 + - -0.814 + lambda: + - 71.4109 + - 71.4109 + - 76.6064 + - 72.7109 + - 70.6522 + price: + - 0.59 + - 0.59 + - 0.52 + - 0.57 + - 0.6 + ext_condition2: + - 255 + - 255 + - 255 + - 255 + - 255 + ext_condition1: + - 255 + - 255 + - 255 + - 255 + - 255 + ext_condition4: + - 255 + - 255 + - 255 + - 255 + - 255 + vomma: + - 24.9086 + - 24.9086 + - 28.3594 + - 25.765 + - 24.4114 + ext_condition3: + - 255 + - 255 + - 255 + - 255 + - 255 + underlying_timestamp: + - '2023-11-10T09:30:00' + - '2023-11-10T09:30:00' + - '2023-11-10T09:30:00' + - '2023-11-10T09:30:00' + - '2023-11-10T09:30:00' + timestamp: + - '2023-11-10T09:30:00.004' + - '2023-11-10T09:30:00.154' + - '2023-11-10T09:30:00.22' + - '2023-11-10T09:30:00.221' + - '2023-11-10T09:30:00.452' + underlying_price: + - 183.89 + - 183.89 + - 183.89 + - 183.89 + - 183.89 + strike: + - 187.5 + - 187.5 + - 187.5 + - 187.5 + - 187.5 + vera: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + right: + - CALL + - CALL + - CALL + - CALL + - CALL + veta: + - 0.3553 + - 0.3553 + - 0.3755 + - 0.3605 + - 0.3523 + iv_error: + - -0.0008 + - -0.0008 + - -0.0018 + - 0.0012 + - 0.0013 + ultima: + - -100.0 + - -100.0 + - -100.0 + - -100.0 + - -100.0 + sequence: + - -1391330475 + - -1391317465 + - -1391313694 + - -1391313652 + - -1391297309 + condition: + - 18 + - 18 + - 18 + - 130 + - 18 + size: + - 1 + - 1 + - 8 + - 1 + - 6 + charm: + - -6.7146 + - -6.7146 + - -6.8508 + - -6.7516 + - -6.692 + rho: + - 0.796 + - 0.796 + - 0.7526 + - 0.7849 + - 0.8025 + expiration: + - '2023-11-17' + - '2023-11-17' + - '2023-11-17' + - '2023-11-17' + - '2023-11-17' + exchange: + - 9 + - 47 + - 6 + - 6 + - 31 + vanna: + - 1.3174 + - 1.3174 + - 1.4186 + - 1.3432 + - 1.3022 + dual_gamma: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + vega: + - 7.7122 + - 7.7122 + - 7.4656 + - 7.6504 + - 7.7484 + gamma: + - 0.0674 + - 0.0674 + - 0.0689 + - 0.0678 + - 0.0672 + application/x-ndjson: + schema: *id066 + example: '{"symbol":"AAPL","dual_delta":-0.2213,"color":-0.0129,"zomma":0.0000,"delta":0.2289,"implied_vol":0.1762,"theta":-0.1031,"d1":-0.7424,"speed":0.0000,"d2":-0.7668,"epsilon":-0.8073,"lambda":71.4109,"price":0.59,"ext_condition2":255,"ext_condition1":255,"ext_condition4":255,"vomma":24.9086,"ext_condition3":255,"underlying_timestamp":"2023-11-10T09:30:00","timestamp":"2023-11-10T09:30:00.004","underlying_price":183.89,"strike":187.500,"vera":0.0000,"right":"CALL","veta":0.3553,"iv_error":-0.0008,"ultima":-100.0000,"sequence":-1391330475,"condition":18,"size":1,"charm":-6.7146,"rho":0.7960,"expiration":"2023-11-17","exchange":9,"vanna":1.3174,"dual_gamma":0.0000,"vega":7.7122,"gamma":0.0674} + + {"symbol":"AAPL","dual_delta":-0.2213,"color":-0.0129,"zomma":0.0000,"delta":0.2289,"implied_vol":0.1762,"theta":-0.1031,"d1":-0.7424,"speed":0.0000,"d2":-0.7668,"epsilon":-0.8073,"lambda":71.4109,"price":0.59,"ext_condition2":255,"ext_condition1":255,"ext_condition4":255,"vomma":24.9086,"ext_condition3":255,"underlying_timestamp":"2023-11-10T09:30:00","timestamp":"2023-11-10T09:30:00.154","underlying_price":183.89,"strike":187.500,"vera":0.0000,"right":"CALL","veta":0.3553,"iv_error":-0.0008,"ultima":-100.0000,"sequence":-1391317465,"condition":18,"size":1,"charm":-6.7146,"rho":0.7960,"expiration":"2023-11-17","exchange":47,"vanna":1.3174,"dual_gamma":0.0000,"vega":7.7122,"gamma":0.0674} + + {"symbol":"AAPL","dual_delta":-0.2093,"color":-0.0118,"zomma":0.0000,"delta":0.2162,"implied_vol":0.1669,"theta":-0.0947,"d1":-0.7849,"speed":0.0000,"d2":-0.8081,"epsilon":-0.7625,"lambda":76.6064,"price":0.52,"ext_condition2":255,"ext_condition1":255,"ext_condition4":255,"vomma":28.3594,"ext_condition3":255,"underlying_timestamp":"2023-11-10T09:30:00","timestamp":"2023-11-10T09:30:00.22","underlying_price":183.89,"strike":187.500,"vera":0.0000,"right":"CALL","veta":0.3755,"iv_error":-0.0018,"ultima":-100.0000,"sequence":-1391313694,"condition":18,"size":8,"charm":-6.8508,"rho":0.7526,"expiration":"2023-11-17","exchange":6,"vanna":1.4186,"dual_gamma":0.0000,"vega":7.4656,"gamma":0.0689} + + {"symbol":"AAPL","dual_delta":-0.2182,"color":-0.0126,"zomma":0.0000,"delta":0.2256,"implied_vol":0.1738,"theta":-0.1009,"d1":-0.7531,"speed":0.0000,"d2":-0.7772,"epsilon":-0.7958,"lambda":72.7109,"price":0.57,"ext_condition2":255,"ext_condition1":255,"ext_condition4":255,"vomma":25.7650,"ext_condition3":255,"underlying_timestamp":"2023-11-10T09:30:00","timestamp":"2023-11-10T09:30:00.221","underlying_price":183.89,"strike":187.500,"vera":0.0000,"right":"CALL","veta":0.3605,"iv_error":0.0012,"ultima":-100.0000,"sequence":-1391313652,"condition":130,"size":1,"charm":-6.7516,"rho":0.7849,"expiration":"2023-11-17","exchange":6,"vanna":1.3432,"dual_gamma":0.0000,"vega":7.6504,"gamma":0.0678} + + {"symbol":"AAPL","dual_delta":-0.2231,"color":-0.0130,"zomma":0.0000,"delta":0.2308,"implied_vol":0.1777,"theta":-0.1044,"d1":-0.7360,"speed":0.0000,"d2":-0.7607,"epsilon":-0.8140,"lambda":70.6522,"price":0.60,"ext_condition2":255,"ext_condition1":255,"ext_condition4":255,"vomma":24.4114,"ext_condition3":255,"underlying_timestamp":"2023-11-10T09:30:00","timestamp":"2023-11-10T09:30:00.452","underlying_price":183.89,"strike":187.500,"vera":0.0000,"right":"CALL","veta":0.3523,"iv_error":0.0013,"ultima":-100.0000,"sequence":-1391297309,"condition":18,"size":6,"charm":-6.6920,"rho":0.8025,"expiration":"2023-11-17","exchange":31,"vanna":1.3022,"dual_gamma":0.0000,"vega":7.7484,"gamma":0.0672}' + + /option/history/greeks/first_order: + x-min-subscription: standard + get: + summary: First Order Greeks + operationId: option_history_greeks_first_order + tags: + - Option + - History + description: | + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculated using the option and underlying midpoint price. If an interval size is specified (*highly recommended*), the option quote used in the calculation follows the same rules as the [quote](/operations/option_history_quote.html) endpoint. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html). + x-sample-urls: + - url: http://localhost:25503/v3/option/history/greeks/first_order?symbol=AAPL&expiration=20241108&date=20241104&interval=5m + description: "Returns first order greeks for an option contract" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration_no_star" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/interval" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns first order greeks for an option contract + content: + text/csv: + schema: + type: array + items: &id067 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + bid: + type: number + description: The last NBBO bid price. + ask: + type: number + description: The last NBBO ask price. + delta: + type: number + description: The delta. + theta: + type: number + description: The Theta. + vega: + type: number + description: The vega. + rho: + type: number + description: The rho. + epsilon: + type: number + description: The epsilon. + lambda: + type: number + description: The lambda. + implied_vol: + type: number + description: The implied volatiltiy calculated using the trade price. + iv_error: + type: number + description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the + actual value reported in the quote. This value will increase as the strike price recedes from the + underlying price.' + underlying_timestamp: + type: string + format: date-time + description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format. + underlying_price: + type: number + description: The midpoint of the underlying at the time of the option trade. + example: "symbol,expiration,strike,right,timestamp,bid,ask,delta,theta,vega,rho,epsilon,lambda,implied_vol,iv_error,underlying_timestamp,underlying_price\r\ + \nAAPL,2024-11-08,262.500,CALL,2024-11-04T09:30:00,0.00,0.00,0.0000,0.0000,0.0000,0.0000,0.0000,261.9304,0.2500,100.0000,2024-11-04T09:30:00,221.00\r\ + \nAAPL,2024-11-08,262.500,CALL,2024-11-04T09:35:00,0.00,0.02,0.0026,-0.0141,0.1913,0.0063,-0.0064,55.2930,0.5874,0.0721,2024-11-04T09:35:00,220.66\r\ + \nAAPL,2024-11-08,262.500,CALL,2024-11-04T09:40:00,0.00,0.02,0.0026,-0.0138,0.1873,0.0062,-0.0063,55.3974,0.5874,0.0455,2024-11-04T09:40:00,220.56\r\ + \nAAPL,2024-11-08,262.500,CALL,2024-11-04T09:45:00,0.00,0.02,0.0025,-0.0133,0.1832,0.0060,-0.0061,56.1024,0.5812,0.0075,2024-11-04T09:45:00,220.86\r\ + \nAAPL,2024-11-08,262.500,CALL,2024-11-04T09:50:00,0.00,0.02,0.0025,-0.0130,0.1807,0.0059,-0.0060,56.7822,0.5749,-0.0199,2024-11-04T09:50:00,221.20\r\ + \n" + application/json: + schema: &id068 + type: array + items: *id067 + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + underlying_price: + - 221.0 + - 220.66 + - 220.56 + - 220.86 + - 221.2 + strike: + - 262.5 + - 262.5 + - 262.5 + - 262.5 + - 262.5 + delta: + - 0.0 + - 0.0026 + - 0.0026 + - 0.0025 + - 0.0025 + right: + - CALL + - CALL + - CALL + - CALL + - CALL + implied_vol: + - 0.25 + - 0.5874 + - 0.5874 + - 0.5812 + - 0.5749 + theta: + - 0.0 + - -0.0141 + - -0.0138 + - -0.0133 + - -0.013 + iv_error: + - 100.0 + - 0.0721 + - 0.0455 + - 0.0075 + - -0.0199 + epsilon: + - 0.0 + - -0.0064 + - -0.0063 + - -0.0061 + - -0.006 + lambda: + - 261.9304 + - 55.293 + - 55.3974 + - 56.1024 + - 56.7822 + ask: + - 0.0 + - 0.02 + - 0.02 + - 0.02 + - 0.02 + rho: + - 0.0 + - 0.0063 + - 0.0062 + - 0.006 + - 0.0059 + expiration: + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + bid: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + underlying_timestamp: + - '2024-11-04T09:30:00' + - '2024-11-04T09:35:00' + - '2024-11-04T09:40:00' + - '2024-11-04T09:45:00' + - '2024-11-04T09:50:00' + vega: + - 0.0 + - 0.1913 + - 0.1873 + - 0.1832 + - 0.1807 + timestamp: + - '2024-11-04T09:30:00' + - '2024-11-04T09:35:00' + - '2024-11-04T09:40:00' + - '2024-11-04T09:45:00' + - '2024-11-04T09:50:00' + application/x-ndjson: + schema: *id068 + example: '{"symbol":"AAPL","underlying_price":221.00,"strike":262.500,"delta":0.0000,"right":"CALL","implied_vol":0.2500,"theta":0.0000,"iv_error":100.0000,"epsilon":0.0000,"lambda":261.9304,"ask":0.00,"rho":0.0000,"expiration":"2024-11-08","bid":0.00,"underlying_timestamp":"2024-11-04T09:30:00","vega":0.0000,"timestamp":"2024-11-04T09:30:00"} + + {"symbol":"AAPL","underlying_price":220.66,"strike":262.500,"delta":0.0026,"right":"CALL","implied_vol":0.5874,"theta":-0.0141,"iv_error":0.0721,"epsilon":-0.0064,"lambda":55.2930,"ask":0.02,"rho":0.0063,"expiration":"2024-11-08","bid":0.00,"underlying_timestamp":"2024-11-04T09:35:00","vega":0.1913,"timestamp":"2024-11-04T09:35:00"} + + {"symbol":"AAPL","underlying_price":220.56,"strike":262.500,"delta":0.0026,"right":"CALL","implied_vol":0.5874,"theta":-0.0138,"iv_error":0.0455,"epsilon":-0.0063,"lambda":55.3974,"ask":0.02,"rho":0.0062,"expiration":"2024-11-08","bid":0.00,"underlying_timestamp":"2024-11-04T09:40:00","vega":0.1873,"timestamp":"2024-11-04T09:40:00"} + + {"symbol":"AAPL","underlying_price":220.86,"strike":262.500,"delta":0.0025,"right":"CALL","implied_vol":0.5812,"theta":-0.0133,"iv_error":0.0075,"epsilon":-0.0061,"lambda":56.1024,"ask":0.02,"rho":0.0060,"expiration":"2024-11-08","bid":0.00,"underlying_timestamp":"2024-11-04T09:45:00","vega":0.1832,"timestamp":"2024-11-04T09:45:00"} + + {"symbol":"AAPL","underlying_price":221.20,"strike":262.500,"delta":0.0025,"right":"CALL","implied_vol":0.5749,"theta":-0.0130,"iv_error":-0.0199,"epsilon":-0.0060,"lambda":56.7822,"ask":0.02,"rho":0.0059,"expiration":"2024-11-08","bid":0.00,"underlying_timestamp":"2024-11-04T09:50:00","vega":0.1807,"timestamp":"2024-11-04T09:50:00"}' + + /option/history/trade_greeks/first_order: + x-min-subscription: professional + get: + summary: First Order Trade Greeks + operationId: option_history_trade_greeks_first_order + tags: + - Option + - History + description: | + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html). + x-sample-urls: + - url: http://localhost:25503/v3/option/history/trade_greeks/first_order?symbol=AAPL&expiration=20241108&date=20241104 + description: "Returns first order trade greeks for an option contract" + - url: http://localhost:25503/v3/option/history/trade_greeks/first_order?symbol=AAPL&expiration=*&date=20241104 + description: "Returns first order trade greeks for an full chain of option contracts" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns first order trade greeks for an option contract + content: + text/csv: + schema: + type: array + items: &id069 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + sequence: + type: integer + description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences). + ext_condition1: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition2: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition3: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition4: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + condition: + type: integer + description: The trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html). + size: + type: integer + description: The amount of contracts / shares traded. + exchange: + type: integer + description: The [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html) the trade was executed. + price: + type: number + description: The trade price. + delta: + type: number + description: The delta. + theta: + type: string + description: The Theta. + vega: + type: number + description: The vega. + rho: + type: number + description: The rho. + epsilon: + type: string + description: The epsilon. + lambda: + type: number + description: The lambda. + implied_vol: + type: number + description: The implied volatiltiy calculated using the trade price. + iv_error: + type: number + description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the + actual value reported in the quote. This value will increase as the strike price recedes from the + underlying price.' + underlying_timestamp: + type: string + format: date-time + description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format. + underlying_price: + type: number + description: The midpoint of the underlying at the time of the option trade. + example: "symbol,expiration,strike,right,timestamp,sequence,ext_condition1,ext_condition2,ext_condition3,ext_condition4,condition,size,exchange,price,delta,theta,vega,rho,epsilon,lambda,implied_vol,iv_error,underlying_timestamp,underlying_price\r\ + \nAAPL,2024-11-08,262.500,CALL,2024-11-04T09:53:54.069,156249981,255,255,255,255,125,1,9,0.01,0.0025,-0.0134,0.1858,0.0061,-0.0062,56.6408,0.5749,0.0132,2024-11-04T09:53:54,221.33\r\ + \nAAPL,2024-11-08,140.000,CALL,2024-11-04T11:47:14.764,546105677,255,255,255,255,131,2,5,81.32,0.9976,-0.0520,0.1690,1.5274,-2.4186,2.7139,1.5937,0.0000,2024-11-04T11:47:14,221.22\r\ + \nAAPL,2024-11-08,140.000,CALL,2024-11-04T11:47:56.669,548097371,255,255,255,255,130,3,7,81.16,1.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0011,2024-11-04T11:47:56,221.18\r\ + \nAAPL,2024-11-08,140.000,CALL,2024-11-04T11:48:03.852,548397162,255,255,255,255,130,3,6,81.26,0.9976,-0.0522,0.1697,1.5274,-2.4179,2.7152,1.5937,0.0000,2024-11-04T11:48:03,221.16\r\ + \nAAPL,2024-11-08,140.000,CALL,2024-11-04T11:48:51.11,550463381,255,255,255,255,131,1,5,81.27,0.9993,-0.0279,0.0544,1.5317,-2.4223,2.7198,1.3968,0.0000,2024-11-04T11:48:51,221.19\r\ + \n" + application/json: + schema: &id070 + type: array + items: *id069 + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + underlying_price: + - 221.33 + - 221.22 + - 221.18 + - 221.16 + - 221.19 + strike: + - 262.5 + - 140.0 + - 140.0 + - 140.0 + - 140.0 + delta: + - 0.0025 + - 0.9976 + - 1.0 + - 0.9976 + - 0.9993 + right: + - CALL + - CALL + - CALL + - CALL + - CALL + implied_vol: + - 0.5749 + - 1.5937 + - 0.0 + - 1.5937 + - 1.3968 + theta: + - -0.0134 + - -0.052 + - 0.0 + - -0.0522 + - -0.0279 + iv_error: + - 0.0132 + - 0.0 + - 0.0011 + - 0.0 + - 0.0 + epsilon: + - -0.0062 + - -2.4186 + - 0.0 + - -2.4179 + - -2.4223 + sequence: + - 156249981 + - 546105677 + - 548097371 + - 548397162 + - 550463381 + condition: + - 125 + - 131 + - 130 + - 130 + - 131 + lambda: + - 56.6408 + - 2.7139 + - 0.0 + - 2.7152 + - 2.7198 + size: + - 1 + - 2 + - 3 + - 3 + - 1 + price: + - 0.01 + - 81.32 + - 81.16 + - 81.26 + - 81.27 + ext_condition2: + - 255 + - 255 + - 255 + - 255 + - 255 + rho: + - 0.0061 + - 1.5274 + - 0.0 + - 1.5274 + - 1.5317 + ext_condition1: + - 255 + - 255 + - 255 + - 255 + - 255 + expiration: + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + ext_condition4: + - 255 + - 255 + - 255 + - 255 + - 255 + exchange: + - 9 + - 5 + - 7 + - 6 + - 5 + ext_condition3: + - 255 + - 255 + - 255 + - 255 + - 255 + underlying_timestamp: + - '2024-11-04T09:53:54' + - '2024-11-04T11:47:14' + - '2024-11-04T11:47:56' + - '2024-11-04T11:48:03' + - '2024-11-04T11:48:51' + vega: + - 0.1858 + - 0.169 + - 0.0 + - 0.1697 + - 0.0544 + timestamp: + - '2024-11-04T09:53:54.069' + - '2024-11-04T11:47:14.764' + - '2024-11-04T11:47:56.669' + - '2024-11-04T11:48:03.852' + - '2024-11-04T11:48:51.11' + application/x-ndjson: + schema: *id070 + example: '{"symbol":"AAPL","underlying_price":221.33,"strike":262.500,"delta":0.0025,"right":"CALL","implied_vol":0.5749,"theta":-0.0134,"iv_error":0.0132,"epsilon":-0.0062,"sequence":156249981,"condition":125,"lambda":56.6408,"size":1,"price":0.01,"ext_condition2":255,"rho":0.0061,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":9,"ext_condition3":255,"underlying_timestamp":"2024-11-04T09:53:54","vega":0.1858,"timestamp":"2024-11-04T09:53:54.069"} + + {"symbol":"AAPL","underlying_price":221.22,"strike":140.000,"delta":0.9976,"right":"CALL","implied_vol":1.5937,"theta":-0.0520,"iv_error":0.0000,"epsilon":-2.4186,"sequence":546105677,"condition":131,"lambda":2.7139,"size":2,"price":81.32,"ext_condition2":255,"rho":1.5274,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":5,"ext_condition3":255,"underlying_timestamp":"2024-11-04T11:47:14","vega":0.1690,"timestamp":"2024-11-04T11:47:14.764"} + + {"symbol":"AAPL","underlying_price":221.18,"strike":140.000,"delta":1.0000,"right":"CALL","implied_vol":0.0000,"theta":0.0000,"iv_error":0.0011,"epsilon":0.0000,"sequence":548097371,"condition":130,"lambda":0.0000,"size":3,"price":81.16,"ext_condition2":255,"rho":0.0000,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":7,"ext_condition3":255,"underlying_timestamp":"2024-11-04T11:47:56","vega":0.0000,"timestamp":"2024-11-04T11:47:56.669"} + + {"symbol":"AAPL","underlying_price":221.16,"strike":140.000,"delta":0.9976,"right":"CALL","implied_vol":1.5937,"theta":-0.0522,"iv_error":0.0000,"epsilon":-2.4179,"sequence":548397162,"condition":130,"lambda":2.7152,"size":3,"price":81.26,"ext_condition2":255,"rho":1.5274,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":6,"ext_condition3":255,"underlying_timestamp":"2024-11-04T11:48:03","vega":0.1697,"timestamp":"2024-11-04T11:48:03.852"} + + {"symbol":"AAPL","underlying_price":221.19,"strike":140.000,"delta":0.9993,"right":"CALL","implied_vol":1.3968,"theta":-0.0279,"iv_error":0.0000,"epsilon":-2.4223,"sequence":550463381,"condition":131,"lambda":2.7198,"size":1,"price":81.27,"ext_condition2":255,"rho":1.5317,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":5,"ext_condition3":255,"underlying_timestamp":"2024-11-04T11:48:51","vega":0.0544,"timestamp":"2024-11-04T11:48:51.11"}' + + /option/history/greeks/second_order: + x-min-subscription: professional + get: + summary: Second Order Greeks + operationId: option_history_greeks_second_order + tags: + - Option + - History + description: | + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculated using the option and underlying midpoint price. If an interval size is specified (*highly recommended*), the option quote used in the calculation follows the same rules as the [quote](/operations/option_history_quote.html) endpoint. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html). + x-sample-urls: + - url: http://localhost:25503/v3/option/history/greeks/second_order?symbol=AAPL&expiration=20241108&date=20241104&interval=1h + description: "Returns second order greeks for an option contract" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration_no_star" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/interval" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns second order greeks for an option contract + content: + text/csv: + schema: + type: array + items: &id071 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + bid: + type: number + description: The last NBBO bid price. + ask: + type: number + description: The last NBBO ask price. + gamma: + type: number + description: The gamma. + vanna: + type: number + description: The vanna. + charm: + type: number + description: The charm. + vomma: + type: number + description: The vomma. + veta: + type: number + description: The veta. + implied_vol: + type: number + description: The implied volatiltiy calculated using the trade price. + iv_error: + type: number + description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the + actual value reported in the quote. This value will increase as the strike price recedes from the + underlying price.' + underlying_timestamp: + type: string + format: date-time + description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format. + underlying_price: + type: number + description: The midpoint of the underlying at the time of the option trade. + example: "symbol,expiration,strike,right,timestamp,bid,ask,gamma,vanna,charm,vomma,veta,implied_vol,iv_error,underlying_timestamp,underlying_price\r\ + \nAAPL,2024-11-08,262.500,CALL,2024-11-04T09:30:00,0.00,0.00,0.0000,0.0000,0.0000,0.0000,0.0000,0.2500,100.0000,2024-11-04T09:30:00,221.00\r\ + \nAAPL,2024-11-08,262.500,CALL,2024-11-04T10:30:00,0.00,0.01,0.0000,0.0000,0.0000,0.0000,0.0000,0.2500,100.0000,2024-11-04T10:30:00,221.73\r\ + \nAAPL,2024-11-08,262.500,CALL,2024-11-04T11:30:00,0.00,0.01,0.0000,0.0000,0.0000,0.0000,0.0000,0.2500,100.0000,2024-11-04T11:30:00,221.49\r\ + \nAAPL,2024-11-08,262.500,CALL,2024-11-04T12:30:00,0.00,0.01,0.0000,0.0000,0.0000,0.0000,0.0000,0.2500,100.0000,2024-11-04T12:30:00,221.11\r\ + \nAAPL,2024-11-08,262.500,CALL,2024-11-04T13:30:00,0.00,0.01,0.0000,0.0000,0.0000,0.0000,0.0000,0.2500,100.0000,2024-11-04T13:30:00,222.03\r\ + \n" + application/json: + schema: &id072 + type: array + items: *id071 + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + underlying_price: + - 221.0 + - 221.73 + - 221.49 + - 221.11 + - 222.03 + strike: + - 262.5 + - 262.5 + - 262.5 + - 262.5 + - 262.5 + right: + - CALL + - CALL + - CALL + - CALL + - CALL + veta: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + implied_vol: + - 0.25 + - 0.25 + - 0.25 + - 0.25 + - 0.25 + iv_error: + - 100.0 + - 100.0 + - 100.0 + - 100.0 + - 100.0 + charm: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + ask: + - 0.0 + - 0.01 + - 0.01 + - 0.01 + - 0.01 + expiration: + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + vanna: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + vomma: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + bid: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + underlying_timestamp: + - '2024-11-04T09:30:00' + - '2024-11-04T10:30:00' + - '2024-11-04T11:30:00' + - '2024-11-04T12:30:00' + - '2024-11-04T13:30:00' + gamma: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + timestamp: + - '2024-11-04T09:30:00' + - '2024-11-04T10:30:00' + - '2024-11-04T11:30:00' + - '2024-11-04T12:30:00' + - '2024-11-04T13:30:00' + application/x-ndjson: + schema: *id072 + example: '{"symbol":"AAPL","underlying_price":221.00,"strike":262.500,"right":"CALL","veta":0.0000,"implied_vol":0.2500,"iv_error":100.0000,"charm":0.0000,"ask":0.00,"expiration":"2024-11-08","vanna":0.0000,"vomma":0.0000,"bid":0.00,"underlying_timestamp":"2024-11-04T09:30:00","gamma":0.0000,"timestamp":"2024-11-04T09:30:00"} + + {"symbol":"AAPL","underlying_price":221.73,"strike":262.500,"right":"CALL","veta":0.0000,"implied_vol":0.2500,"iv_error":100.0000,"charm":0.0000,"ask":0.01,"expiration":"2024-11-08","vanna":0.0000,"vomma":0.0000,"bid":0.00,"underlying_timestamp":"2024-11-04T10:30:00","gamma":0.0000,"timestamp":"2024-11-04T10:30:00"} + + {"symbol":"AAPL","underlying_price":221.49,"strike":262.500,"right":"CALL","veta":0.0000,"implied_vol":0.2500,"iv_error":100.0000,"charm":0.0000,"ask":0.01,"expiration":"2024-11-08","vanna":0.0000,"vomma":0.0000,"bid":0.00,"underlying_timestamp":"2024-11-04T11:30:00","gamma":0.0000,"timestamp":"2024-11-04T11:30:00"} + + {"symbol":"AAPL","underlying_price":221.11,"strike":262.500,"right":"CALL","veta":0.0000,"implied_vol":0.2500,"iv_error":100.0000,"charm":0.0000,"ask":0.01,"expiration":"2024-11-08","vanna":0.0000,"vomma":0.0000,"bid":0.00,"underlying_timestamp":"2024-11-04T12:30:00","gamma":0.0000,"timestamp":"2024-11-04T12:30:00"} + + {"symbol":"AAPL","underlying_price":222.03,"strike":262.500,"right":"CALL","veta":0.0000,"implied_vol":0.2500,"iv_error":100.0000,"charm":0.0000,"ask":0.01,"expiration":"2024-11-08","vanna":0.0000,"vomma":0.0000,"bid":0.00,"underlying_timestamp":"2024-11-04T13:30:00","gamma":0.0000,"timestamp":"2024-11-04T13:30:00"}' + + /option/history/trade_greeks/second_order: + x-min-subscription: professional + get: + summary: Second Order Trade Greeks + operationId: option_history_trade_greeks_second_order + tags: + - Option + - History + description: | + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html). + x-sample-urls: + - url: http://localhost:25503/v3/option/history/trade_greeks/second_order?symbol=AAPL&expiration=20241108&date=20241104 + description: "Returns second order trade greeks for an option contract" + - url: http://localhost:25503/v3/option/history/trade_greeks/second_order?symbol=AAPL&expiration=*&date=20241104 + description: "Returns second order trade greeks for an full chain of option contracts" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns second order trade greeks for an option contract + content: + text/csv: + schema: + type: array + items: &id073 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + sequence: + type: integer + description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences). + ext_condition1: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition2: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition3: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition4: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + condition: + type: integer + description: The trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html). + size: + type: integer + description: The amount of contracts / shares traded. + exchange: + type: integer + description: The [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html) the trade was executed. + price: + type: number + description: The trade price. + gamma: + type: number + description: The gamma. + vanna: + type: number + description: The vanna. + charm: + type: string + description: The charm. + vomma: + type: number + description: The vomma. + veta: + type: number + description: The veta. + implied_vol: + type: number + description: The implied volatiltiy calculated using the trade price. + iv_error: + type: number + description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the + actual value reported in the quote. This value will increase as the strike price recedes from the + underlying price.' + underlying_timestamp: + type: string + format: date-time + description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format. + underlying_price: + type: number + description: The midpoint of the underlying at the time of the option trade. + example: "symbol,expiration,strike,right,timestamp,sequence,ext_condition1,ext_condition2,ext_condition3,ext_condition4,condition,size,exchange,price,gamma,vanna,charm,vomma,veta,implied_vol,iv_error,underlying_timestamp,underlying_price\r\ + \nAAPL,2024-11-08,262.500,CALL,2024-11-04T09:53:54.069,156249981,255,255,255,255,125,1,9,0.01,0.0006,0.0398,-1.0514,2.5798,0.0137,0.5749,0.0132,2024-11-04T09:53:54,221.33\r\ + \nAAPL,2024-11-08,140.000,CALL,2024-11-04T11:47:14.764,546105677,255,255,255,255,131,2,5,81.32,0.0001,-0.0121,0.8843,0.7986,0.0063,1.5937,0.0000,2024-11-04T11:47:14,221.22\r\ + \nAAPL,2024-11-08,140.000,CALL,2024-11-04T11:47:56.669,548097371,255,255,255,255,130,3,7,81.16,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0011,2024-11-04T11:47:56,221.18\r\ + \nAAPL,2024-11-08,140.000,CALL,2024-11-04T11:48:03.852,548397162,255,255,255,255,130,3,6,81.26,0.0001,-0.0122,0.8879,0.8011,0.0064,1.5937,0.0000,2024-11-04T11:48:03,221.16\r\ + \nAAPL,2024-11-08,140.000,CALL,2024-11-04T11:48:51.11,550463381,255,255,255,255,131,1,5,81.27,0.0000,-0.0051,0.3271,0.3817,0.0025,1.3968,0.0000,2024-11-04T11:48:51,221.19\r\ + \n" + application/json: + schema: &id074 + type: array + items: *id073 + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + underlying_price: + - 221.33 + - 221.22 + - 221.18 + - 221.16 + - 221.19 + strike: + - 262.5 + - 140.0 + - 140.0 + - 140.0 + - 140.0 + right: + - CALL + - CALL + - CALL + - CALL + - CALL + veta: + - 0.0137 + - 0.0063 + - 0.0 + - 0.0064 + - 0.0025 + implied_vol: + - 0.5749 + - 1.5937 + - 0.0 + - 1.5937 + - 1.3968 + iv_error: + - 0.0132 + - 0.0 + - 0.0011 + - 0.0 + - 0.0 + sequence: + - 156249981 + - 546105677 + - 548097371 + - 548397162 + - 550463381 + condition: + - 125 + - 131 + - 130 + - 130 + - 131 + size: + - 1 + - 2 + - 3 + - 3 + - 1 + charm: + - -1.0514 + - 0.8843 + - 0.0 + - 0.8879 + - 0.3271 + price: + - 0.01 + - 81.32 + - 81.16 + - 81.26 + - 81.27 + ext_condition2: + - 255 + - 255 + - 255 + - 255 + - 255 + ext_condition1: + - 255 + - 255 + - 255 + - 255 + - 255 + expiration: + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + ext_condition4: + - 255 + - 255 + - 255 + - 255 + - 255 + exchange: + - 9 + - 5 + - 7 + - 6 + - 5 + vanna: + - 0.0398 + - -0.0121 + - 0.0 + - -0.0122 + - -0.0051 + vomma: + - 2.5798 + - 0.7986 + - 0.0 + - 0.8011 + - 0.3817 + ext_condition3: + - 255 + - 255 + - 255 + - 255 + - 255 + underlying_timestamp: + - '2024-11-04T09:53:54' + - '2024-11-04T11:47:14' + - '2024-11-04T11:47:56' + - '2024-11-04T11:48:03' + - '2024-11-04T11:48:51' + gamma: + - 0.0006 + - 0.0001 + - 0.0 + - 0.0001 + - 0.0 + timestamp: + - '2024-11-04T09:53:54.069' + - '2024-11-04T11:47:14.764' + - '2024-11-04T11:47:56.669' + - '2024-11-04T11:48:03.852' + - '2024-11-04T11:48:51.11' + application/x-ndjson: + schema: *id074 + example: '{"symbol":"AAPL","underlying_price":221.33,"strike":262.500,"right":"CALL","veta":0.0137,"implied_vol":0.5749,"iv_error":0.0132,"sequence":156249981,"condition":125,"size":1,"charm":-1.0514,"price":0.01,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":9,"vanna":0.0398,"vomma":2.5798,"ext_condition3":255,"underlying_timestamp":"2024-11-04T09:53:54","gamma":0.0006,"timestamp":"2024-11-04T09:53:54.069"} + + {"symbol":"AAPL","underlying_price":221.22,"strike":140.000,"right":"CALL","veta":0.0063,"implied_vol":1.5937,"iv_error":0.0000,"sequence":546105677,"condition":131,"size":2,"charm":0.8843,"price":81.32,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":5,"vanna":-0.0121,"vomma":0.7986,"ext_condition3":255,"underlying_timestamp":"2024-11-04T11:47:14","gamma":0.0001,"timestamp":"2024-11-04T11:47:14.764"} + + {"symbol":"AAPL","underlying_price":221.18,"strike":140.000,"right":"CALL","veta":0.0000,"implied_vol":0.0000,"iv_error":0.0011,"sequence":548097371,"condition":130,"size":3,"charm":0.0000,"price":81.16,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":7,"vanna":0.0000,"vomma":0.0000,"ext_condition3":255,"underlying_timestamp":"2024-11-04T11:47:56","gamma":0.0000,"timestamp":"2024-11-04T11:47:56.669"} + + {"symbol":"AAPL","underlying_price":221.16,"strike":140.000,"right":"CALL","veta":0.0064,"implied_vol":1.5937,"iv_error":0.0000,"sequence":548397162,"condition":130,"size":3,"charm":0.8879,"price":81.26,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":6,"vanna":-0.0122,"vomma":0.8011,"ext_condition3":255,"underlying_timestamp":"2024-11-04T11:48:03","gamma":0.0001,"timestamp":"2024-11-04T11:48:03.852"} + + {"symbol":"AAPL","underlying_price":221.19,"strike":140.000,"right":"CALL","veta":0.0025,"implied_vol":1.3968,"iv_error":0.0000,"sequence":550463381,"condition":131,"size":1,"charm":0.3271,"price":81.27,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":5,"vanna":-0.0051,"vomma":0.3817,"ext_condition3":255,"underlying_timestamp":"2024-11-04T11:48:51","gamma":0.0000,"timestamp":"2024-11-04T11:48:51.11"}' + + /option/history/greeks/third_order: + x-min-subscription: professional + get: + summary: Third Order Greeks + operationId: option_history_greeks_third_order + tags: + - Option + - History + description: | + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculated using the option and underlying midpoint price. If an interval size is specified (*highly recommended*), the option quote used in the calculation follows the same rules as the [quote](/operations/option_history_quote.html) endpoint. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html). + x-sample-urls: + - url: http://localhost:25503/v3/option/history/greeks/third_order?symbol=AAPL&expiration=20241108&date=20241104&interval=1h + description: "Returns third order greeks for an option contract" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration_no_star" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/interval" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns third order greeks for an option contract + content: + text/csv: + schema: + type: array + items: &id075 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + bid: + type: number + description: The last NBBO bid price. + ask: + type: number + description: The last NBBO ask price. + speed: + type: number + description: The speed. + zomma: + type: number + description: The zomma. + color: + type: number + description: The color. + ultima: + type: number + description: The ultima. + implied_vol: + type: number + description: The implied volatiltiy calculated using the trade price. + iv_error: + type: number + description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the + actual value reported in the quote. This value will increase as the strike price recedes from the + underlying price.' + underlying_timestamp: + type: string + format: date-time + description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format. + underlying_price: + type: number + description: The midpoint of the underlying at the time of the option trade. + example: "symbol,expiration,strike,right,timestamp,bid,ask,speed,zomma,color,ultima,implied_vol,iv_error,underlying_timestamp,underlying_price\r\ + \nAAPL,2024-11-08,262.500,CALL,2024-11-04T09:30:00,0.00,0.00,0.0000,0.0000,0.0000,0.0001,0.2500,100.0000,2024-11-04T09:30:00,221.00\r\ + \nAAPL,2024-11-08,262.500,CALL,2024-11-04T10:30:00,0.00,0.01,0.0000,0.0000,0.0000,0.0002,0.2500,100.0000,2024-11-04T10:30:00,221.73\r\ + \nAAPL,2024-11-08,262.500,CALL,2024-11-04T11:30:00,0.00,0.01,0.0000,0.0000,0.0000,0.0002,0.2500,100.0000,2024-11-04T11:30:00,221.49\r\ + \nAAPL,2024-11-08,262.500,CALL,2024-11-04T12:30:00,0.00,0.01,0.0000,0.0000,0.0000,0.0001,0.2500,100.0000,2024-11-04T12:30:00,221.11\r\ + \nAAPL,2024-11-08,262.500,CALL,2024-11-04T13:30:00,0.00,0.01,0.0000,0.0000,0.0000,0.0003,0.2500,100.0000,2024-11-04T13:30:00,222.03\r\ + \n" + application/json: + schema: &id076 + type: array + items: *id075 + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + underlying_price: + - 221.0 + - 221.73 + - 221.49 + - 221.11 + - 222.03 + color: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + strike: + - 262.5 + - 262.5 + - 262.5 + - 262.5 + - 262.5 + zomma: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + right: + - CALL + - CALL + - CALL + - CALL + - CALL + implied_vol: + - 0.25 + - 0.25 + - 0.25 + - 0.25 + - 0.25 + iv_error: + - 100.0 + - 100.0 + - 100.0 + - 100.0 + - 100.0 + speed: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + ultima: + - 0.0001 + - 0.0002 + - 0.0002 + - 0.0001 + - 0.0003 + ask: + - 0.0 + - 0.01 + - 0.01 + - 0.01 + - 0.01 + expiration: + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + bid: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + underlying_timestamp: + - '2024-11-04T09:30:00' + - '2024-11-04T10:30:00' + - '2024-11-04T11:30:00' + - '2024-11-04T12:30:00' + - '2024-11-04T13:30:00' + timestamp: + - '2024-11-04T09:30:00' + - '2024-11-04T10:30:00' + - '2024-11-04T11:30:00' + - '2024-11-04T12:30:00' + - '2024-11-04T13:30:00' + application/x-ndjson: + schema: *id076 + example: '{"symbol":"AAPL","underlying_price":221.00,"color":0.0000,"strike":262.500,"zomma":0.0000,"right":"CALL","implied_vol":0.2500,"iv_error":100.0000,"speed":0.0000,"ultima":0.0001,"ask":0.00,"expiration":"2024-11-08","bid":0.00,"underlying_timestamp":"2024-11-04T09:30:00","timestamp":"2024-11-04T09:30:00"} + + {"symbol":"AAPL","underlying_price":221.73,"color":0.0000,"strike":262.500,"zomma":0.0000,"right":"CALL","implied_vol":0.2500,"iv_error":100.0000,"speed":0.0000,"ultima":0.0002,"ask":0.01,"expiration":"2024-11-08","bid":0.00,"underlying_timestamp":"2024-11-04T10:30:00","timestamp":"2024-11-04T10:30:00"} + + {"symbol":"AAPL","underlying_price":221.49,"color":0.0000,"strike":262.500,"zomma":0.0000,"right":"CALL","implied_vol":0.2500,"iv_error":100.0000,"speed":0.0000,"ultima":0.0002,"ask":0.01,"expiration":"2024-11-08","bid":0.00,"underlying_timestamp":"2024-11-04T11:30:00","timestamp":"2024-11-04T11:30:00"} + + {"symbol":"AAPL","underlying_price":221.11,"color":0.0000,"strike":262.500,"zomma":0.0000,"right":"CALL","implied_vol":0.2500,"iv_error":100.0000,"speed":0.0000,"ultima":0.0001,"ask":0.01,"expiration":"2024-11-08","bid":0.00,"underlying_timestamp":"2024-11-04T12:30:00","timestamp":"2024-11-04T12:30:00"} + + {"symbol":"AAPL","underlying_price":222.03,"color":0.0000,"strike":262.500,"zomma":0.0000,"right":"CALL","implied_vol":0.2500,"iv_error":100.0000,"speed":0.0000,"ultima":0.0003,"ask":0.01,"expiration":"2024-11-08","bid":0.00,"underlying_timestamp":"2024-11-04T13:30:00","timestamp":"2024-11-04T13:30:00"}' + + /option/history/trade_greeks/third_order: + x-min-subscription: professional + get: + summary: Third Order Trade Greeks + operationId: option_history_trade_greeks_third_order + tags: + - Option + - History + description: | + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html). + x-sample-urls: + - url: http://localhost:25503/v3/option/history/trade_greeks/third_order?symbol=AAPL&expiration=20241108&date=20241104 + description: "Returns third order trade greeks for an option contract" + - url: http://localhost:25503/v3/option/history/trade_greeks/third_order?symbol=AAPL&expiration=*&date=20241104 + description: "Returns third order trade greeks for an full chain of option contracts" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns third order trade greeks for an option contract + content: + text/csv: + schema: + type: array + items: &id077 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + sequence: + type: integer + description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences). + ext_condition1: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition2: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition3: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition4: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + condition: + type: integer + description: The trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html). + size: + type: integer + description: The amount of contracts / shares traded. + exchange: + type: integer + description: The [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html) the trade was executed. + price: + type: number + description: The trade price. + speed: + type: number + description: The speed. + zomma: + type: number + description: The zomma. + color: + type: string + description: The color. + ultima: + type: number + description: The ultima. + implied_vol: + type: number + description: The implied volatiltiy calculated using the trade price. + iv_error: + type: number + description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the + actual value reported in the quote. This value will increase as the strike price recedes from the + underlying price.' + underlying_timestamp: + type: string + format: date-time + description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format. + underlying_price: + type: number + description: The midpoint of the underlying at the time of the option trade. + example: "symbol,expiration,strike,right,timestamp,sequence,ext_condition1,ext_condition2,ext_condition3,ext_condition4,condition,size,exchange,price,speed,zomma,color,ultima,implied_vol,iv_error,underlying_timestamp,underlying_price\r\ + \nAAPL,2024-11-08,262.500,CALL,2024-11-04T09:53:54.069,156249981,255,255,255,255,125,1,9,0.01,0.0000,0.0000,-0.0005,22.3494,0.5749,0.0132,2024-11-04T09:53:54,221.33\r\ + \nAAPL,2024-11-08,140.000,CALL,2024-11-04T11:47:14.764,546105677,255,255,255,255,131,2,5,81.32,0.0000,0.0000,-0.0013,2.2683,1.5937,0.0000,2024-11-04T11:47:14,221.22\r\ + \nAAPL,2024-11-08,140.000,CALL,2024-11-04T11:47:56.669,548097371,255,255,255,255,130,3,7,81.16,0.0000,0.0000,0.0000,0.0000,0.0000,0.0011,2024-11-04T11:47:56,221.18\r\ + \nAAPL,2024-11-08,140.000,CALL,2024-11-04T11:48:03.852,548397162,255,255,255,255,130,3,6,81.26,0.0000,0.0000,-0.0013,2.2709,1.5937,0.0000,2024-11-04T11:48:03,221.16\r\ + \nAAPL,2024-11-08,140.000,CALL,2024-11-04T11:48:51.11,550463381,255,255,255,255,131,1,5,81.27,0.0000,0.0000,-0.0003,1.8578,1.3968,0.0000,2024-11-04T11:48:51,221.19\r\ + \n" + application/json: + schema: &id078 + type: array + items: *id077 + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + underlying_price: + - 221.33 + - 221.22 + - 221.18 + - 221.16 + - 221.19 + color: + - -0.0005 + - -0.0013 + - 0.0 + - -0.0013 + - -0.0003 + strike: + - 262.5 + - 140.0 + - 140.0 + - 140.0 + - 140.0 + zomma: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + right: + - CALL + - CALL + - CALL + - CALL + - CALL + implied_vol: + - 0.5749 + - 1.5937 + - 0.0 + - 1.5937 + - 1.3968 + iv_error: + - 0.0132 + - 0.0 + - 0.0011 + - 0.0 + - 0.0 + speed: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + ultima: + - 22.3494 + - 2.2683 + - 0.0 + - 2.2709 + - 1.8578 + sequence: + - 156249981 + - 546105677 + - 548097371 + - 548397162 + - 550463381 + condition: + - 125 + - 131 + - 130 + - 130 + - 131 + size: + - 1 + - 2 + - 3 + - 3 + - 1 + price: + - 0.01 + - 81.32 + - 81.16 + - 81.26 + - 81.27 + ext_condition2: + - 255 + - 255 + - 255 + - 255 + - 255 + ext_condition1: + - 255 + - 255 + - 255 + - 255 + - 255 + expiration: + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + ext_condition4: + - 255 + - 255 + - 255 + - 255 + - 255 + exchange: + - 9 + - 5 + - 7 + - 6 + - 5 + ext_condition3: + - 255 + - 255 + - 255 + - 255 + - 255 + underlying_timestamp: + - '2024-11-04T09:53:54' + - '2024-11-04T11:47:14' + - '2024-11-04T11:47:56' + - '2024-11-04T11:48:03' + - '2024-11-04T11:48:51' + timestamp: + - '2024-11-04T09:53:54.069' + - '2024-11-04T11:47:14.764' + - '2024-11-04T11:47:56.669' + - '2024-11-04T11:48:03.852' + - '2024-11-04T11:48:51.11' + application/x-ndjson: + schema: *id078 + example: '{"symbol":"AAPL","underlying_price":221.33,"color":-0.0005,"strike":262.500,"zomma":0.0000,"right":"CALL","implied_vol":0.5749,"iv_error":0.0132,"speed":0.0000,"ultima":22.3494,"sequence":156249981,"condition":125,"size":1,"price":0.01,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":9,"ext_condition3":255,"underlying_timestamp":"2024-11-04T09:53:54","timestamp":"2024-11-04T09:53:54.069"} + + {"symbol":"AAPL","underlying_price":221.22,"color":-0.0013,"strike":140.000,"zomma":0.0000,"right":"CALL","implied_vol":1.5937,"iv_error":0.0000,"speed":0.0000,"ultima":2.2683,"sequence":546105677,"condition":131,"size":2,"price":81.32,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":5,"ext_condition3":255,"underlying_timestamp":"2024-11-04T11:47:14","timestamp":"2024-11-04T11:47:14.764"} + + {"symbol":"AAPL","underlying_price":221.18,"color":0.0000,"strike":140.000,"zomma":0.0000,"right":"CALL","implied_vol":0.0000,"iv_error":0.0011,"speed":0.0000,"ultima":0.0000,"sequence":548097371,"condition":130,"size":3,"price":81.16,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":7,"ext_condition3":255,"underlying_timestamp":"2024-11-04T11:47:56","timestamp":"2024-11-04T11:47:56.669"} + + {"symbol":"AAPL","underlying_price":221.16,"color":-0.0013,"strike":140.000,"zomma":0.0000,"right":"CALL","implied_vol":1.5937,"iv_error":0.0000,"speed":0.0000,"ultima":2.2709,"sequence":548397162,"condition":130,"size":3,"price":81.26,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":6,"ext_condition3":255,"underlying_timestamp":"2024-11-04T11:48:03","timestamp":"2024-11-04T11:48:03.852"} + + {"symbol":"AAPL","underlying_price":221.19,"color":-0.0003,"strike":140.000,"zomma":0.0000,"right":"CALL","implied_vol":1.3968,"iv_error":0.0000,"speed":0.0000,"ultima":1.8578,"sequence":550463381,"condition":131,"size":1,"price":81.27,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":5,"ext_condition3":255,"underlying_timestamp":"2024-11-04T11:48:51","timestamp":"2024-11-04T11:48:51.11"}' + + /option/history/greeks/implied_volatility: + x-min-subscription: standard + get: + summary: Implied Volatility + operationId: option_history_greeks_implied_volatility + tags: + - Option + - History + description: | + - Returns implied volatilies calculated using the national best bid, mid, and ask price of the option respectively. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html). + x-sample-urls: + - url: http://localhost:25503/v3/option/history/greeks/implied_volatility?symbol=AAPL&expiration=20241108&strike=220.000&right=call&date=20241104&interval=5m + description: "Returns 5m interval implied volatility for an option contract" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration_no_star" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/interval" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns 5m interval implied volatility for an option contract + content: + text/csv: + schema: + type: array + items: &id079 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + bid: + type: number + description: The last NBBO bid price. + bid_implied_vol: + type: number + description: The implied volatiltiy calculated using the bid price. + midpoint: + type: number + description: The midpoint calculated by averaging the bid & ask prices. + implied_vol: + type: number + description: The implied volatiltiy calculated using the trade price. + ask: + type: number + description: The last NBBO ask price. + ask_implied_vol: + type: number + description: The implied volatiltiy calculated using the ask price. + iv_error: + type: number + description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the + actual value reported in the quote. This value will increase as the strike price recedes from the + underlying price.' + underlying_timestamp: + type: string + format: date-time + description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format. + underlying_price: + type: number + description: The midpoint of the underlying at the time of the option trade. + example: "symbol,expiration,strike,right,timestamp,bid,bid_implied_vol,midpoint,implied_vol,ask,ask_implied_vol,iv_error,underlying_timestamp,underlying_price\r\ + \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:00,0.00,0.0000,0.00,0.0000,0.00,0.0000,100.0000,2024-11-04T09:30:00,221.00\r\ + \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:35:00,3.75,0.3640,3.80,0.3693,3.85,0.3747,0.0000,2024-11-04T09:35:00,220.66\r\ + \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:40:00,3.70,0.3643,3.75,0.3698,3.80,0.3752,0.0000,2024-11-04T09:40:00,220.56\r\ + \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:45:00,3.75,0.3518,3.80,0.3574,3.85,0.3627,0.0000,2024-11-04T09:45:00,220.86\r\ + \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:50:00,3.85,0.3417,3.90,0.3474,3.95,0.3527,0.0000,2024-11-04T09:50:00,221.20\r\ + \n" + application/json: + schema: &id080 + type: array + items: *id079 + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + underlying_price: + - 221.0 + - 220.66 + - 220.56 + - 220.86 + - 221.2 + strike: + - 220.0 + - 220.0 + - 220.0 + - 220.0 + - 220.0 + right: + - CALL + - CALL + - CALL + - CALL + - CALL + implied_vol: + - 0.0 + - 0.3693 + - 0.3698 + - 0.3574 + - 0.3474 + iv_error: + - 100.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + bid_implied_vol: + - 0.0 + - 0.364 + - 0.3643 + - 0.3518 + - 0.3417 + ask: + - 0.0 + - 3.85 + - 3.8 + - 3.85 + - 3.95 + midpoint: + - 0.0 + - 3.8 + - 3.75 + - 3.8 + - 3.9 + expiration: + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + ask_implied_vol: + - 0.0 + - 0.3747 + - 0.3752 + - 0.3627 + - 0.3527 + bid: + - 0.0 + - 3.75 + - 3.7 + - 3.75 + - 3.85 + underlying_timestamp: + - '2024-11-04T09:30:00' + - '2024-11-04T09:35:00' + - '2024-11-04T09:40:00' + - '2024-11-04T09:45:00' + - '2024-11-04T09:50:00' + timestamp: + - '2024-11-04T09:30:00' + - '2024-11-04T09:35:00' + - '2024-11-04T09:40:00' + - '2024-11-04T09:45:00' + - '2024-11-04T09:50:00' + application/x-ndjson: + schema: *id080 + example: '{"symbol":"AAPL","underlying_price":221.00,"strike":220.000,"right":"CALL","implied_vol":0.0000,"iv_error":100.0000,"bid_implied_vol":0.0000,"ask":0.00,"midpoint":0.00,"expiration":"2024-11-08","ask_implied_vol":0.0000,"bid":0.00,"underlying_timestamp":"2024-11-04T09:30:00","timestamp":"2024-11-04T09:30:00"} + + {"symbol":"AAPL","underlying_price":220.66,"strike":220.000,"right":"CALL","implied_vol":0.3693,"iv_error":0.0000,"bid_implied_vol":0.3640,"ask":3.85,"midpoint":3.80,"expiration":"2024-11-08","ask_implied_vol":0.3747,"bid":3.75,"underlying_timestamp":"2024-11-04T09:35:00","timestamp":"2024-11-04T09:35:00"} + + {"symbol":"AAPL","underlying_price":220.56,"strike":220.000,"right":"CALL","implied_vol":0.3698,"iv_error":0.0000,"bid_implied_vol":0.3643,"ask":3.80,"midpoint":3.75,"expiration":"2024-11-08","ask_implied_vol":0.3752,"bid":3.70,"underlying_timestamp":"2024-11-04T09:40:00","timestamp":"2024-11-04T09:40:00"} + + {"symbol":"AAPL","underlying_price":220.86,"strike":220.000,"right":"CALL","implied_vol":0.3574,"iv_error":0.0000,"bid_implied_vol":0.3518,"ask":3.85,"midpoint":3.80,"expiration":"2024-11-08","ask_implied_vol":0.3627,"bid":3.75,"underlying_timestamp":"2024-11-04T09:45:00","timestamp":"2024-11-04T09:45:00"} + + {"symbol":"AAPL","underlying_price":221.20,"strike":220.000,"right":"CALL","implied_vol":0.3474,"iv_error":0.0000,"bid_implied_vol":0.3417,"ask":3.95,"midpoint":3.90,"expiration":"2024-11-08","ask_implied_vol":0.3527,"bid":3.85,"underlying_timestamp":"2024-11-04T09:50:00","timestamp":"2024-11-04T09:50:00"}' + + /option/history/trade_greeks/implied_volatility: + x-min-subscription: professional + get: + summary: Trade Implied Volatility + operationId: option_history_trade_greeks_implied_volatility + tags: + - Option + - History + description: | + - Returns implied volatilies calculated using the trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option-Greeks.html). + x-sample-urls: + - url: http://localhost:25503/v3/option/history/trade_greeks/implied_volatility?symbol=AAPL&expiration=20241108&strike=220.000&right=call&date=20241104 + description: "Returns implied volatility for an option contract" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/annual_dividend" + - $ref: "#/components/parameters/rate_type" + - $ref: "#/components/parameters/rate_value" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns implied volatility for an option contract + content: + text/csv: + schema: + type: array + items: &id081 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + sequence: + type: integer + description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences). + ext_condition1: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition2: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition3: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition4: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + condition: + type: integer + description: The trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html). + size: + type: integer + description: The amount of contracts / shares traded. + exchange: + type: integer + description: The [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html) the trade was executed. + price: + type: number + description: The trade price. + implied_vol: + type: number + description: The implied volatiltiy calculated using the trade price. + iv_error: + type: number + description: 'IV Error: the value of the option calculated using the implied volatiltiy divided by the + actual value reported in the quote. This value will increase as the strike price recedes from the + underlying price.' + underlying_timestamp: + type: string + format: date-time + description: The underlying date formated as YYYY-MM-DDTHH:mm:ss.SSS format. + underlying_price: + type: number + description: The midpoint of the underlying at the time of the option trade. + example: "symbol,expiration,strike,right,timestamp,sequence,ext_condition1,ext_condition2,ext_condition3,ext_condition4,condition,size,exchange,price,implied_vol,iv_error,underlying_timestamp,underlying_price\r\ + \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:00.471,18902138,255,255,255,255,130,2,22,3.90,0.3598,0.0002,2024-11-04T09:30:00,221.00\r\ + \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:01.626,19368856,255,255,255,255,130,1,6,4.25,0.3876,0.0000,2024-11-04T09:30:01,221.17\r\ + \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:01.698,19403970,255,255,255,255,130,1,6,4.22,0.3842,-0.0002,2024-11-04T09:30:01,221.17\r\ + \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:02.064,19598457,255,255,255,255,18,1,5,4.15,0.3640,-0.0001,2024-11-04T09:30:02,221.37\r\ + \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:02.064,19598464,255,255,255,255,18,1,5,4.15,0.3640,-0.0001,2024-11-04T09:30:02,221.37\r\ + \n" + application/json: + schema: &id082 + type: array + items: *id081 + example: + symbol: + - AAPL + - AAPL + - AAPL + - AAPL + - AAPL + underlying_price: + - 221.0 + - 221.17 + - 221.17 + - 221.37 + - 221.37 + strike: + - 220.0 + - 220.0 + - 220.0 + - 220.0 + - 220.0 + right: + - CALL + - CALL + - CALL + - CALL + - CALL + implied_vol: + - 0.3598 + - 0.3876 + - 0.3842 + - 0.364 + - 0.364 + iv_error: + - 0.0002 + - 0.0 + - -0.0002 + - -0.0001 + - -0.0001 + sequence: + - 18902138 + - 19368856 + - 19403970 + - 19598457 + - 19598464 + condition: + - 130 + - 130 + - 130 + - 18 + - 18 + size: + - 2 + - 1 + - 1 + - 1 + - 1 + price: + - 3.9 + - 4.25 + - 4.22 + - 4.15 + - 4.15 + ext_condition2: + - 255 + - 255 + - 255 + - 255 + - 255 + ext_condition1: + - 255 + - 255 + - 255 + - 255 + - 255 + expiration: + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + - '2024-11-08' + ext_condition4: + - 255 + - 255 + - 255 + - 255 + - 255 + exchange: + - 22 + - 6 + - 6 + - 5 + - 5 + ext_condition3: + - 255 + - 255 + - 255 + - 255 + - 255 + underlying_timestamp: + - '2024-11-04T09:30:00' + - '2024-11-04T09:30:01' + - '2024-11-04T09:30:01' + - '2024-11-04T09:30:02' + - '2024-11-04T09:30:02' + timestamp: + - '2024-11-04T09:30:00.471' + - '2024-11-04T09:30:01.626' + - '2024-11-04T09:30:01.698' + - '2024-11-04T09:30:02.064' + - '2024-11-04T09:30:02.064' + application/x-ndjson: + schema: *id082 + example: '{"symbol":"AAPL","underlying_price":221.00,"strike":220.000,"right":"CALL","implied_vol":0.3598,"iv_error":0.0002,"sequence":18902138,"condition":130,"size":2,"price":3.90,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":22,"ext_condition3":255,"underlying_timestamp":"2024-11-04T09:30:00","timestamp":"2024-11-04T09:30:00.471"} + + {"symbol":"AAPL","underlying_price":221.17,"strike":220.000,"right":"CALL","implied_vol":0.3876,"iv_error":0.0000,"sequence":19368856,"condition":130,"size":1,"price":4.25,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":6,"ext_condition3":255,"underlying_timestamp":"2024-11-04T09:30:01","timestamp":"2024-11-04T09:30:01.626"} + + {"symbol":"AAPL","underlying_price":221.17,"strike":220.000,"right":"CALL","implied_vol":0.3842,"iv_error":-0.0002,"sequence":19403970,"condition":130,"size":1,"price":4.22,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":6,"ext_condition3":255,"underlying_timestamp":"2024-11-04T09:30:01","timestamp":"2024-11-04T09:30:01.698"} + + {"symbol":"AAPL","underlying_price":221.37,"strike":220.000,"right":"CALL","implied_vol":0.3640,"iv_error":-0.0001,"sequence":19598457,"condition":18,"size":1,"price":4.15,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":5,"ext_condition3":255,"underlying_timestamp":"2024-11-04T09:30:02","timestamp":"2024-11-04T09:30:02.064"} + + {"symbol":"AAPL","underlying_price":221.37,"strike":220.000,"right":"CALL","implied_vol":0.3640,"iv_error":-0.0001,"sequence":19598464,"condition":18,"size":1,"price":4.15,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":5,"ext_condition3":255,"underlying_timestamp":"2024-11-04T09:30:02","timestamp":"2024-11-04T09:30:02.064"}' + + /option/at_time/trade: + x-min-subscription: standard + get: + summary: Trade + operationId: option_at_time_trade + tags: + - Option + - At-Time + description: | + - Returns the last trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) at a specified millisecond of the day. + - Trade condition mappings can be found [here](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html). + - Extended trade conditions are not reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) for options, so they can be ignored. + - The ``time_of_day``parameter represents the 00:00:00.000 ET that the trade should be provided for. + x-sample-urls: + - url: http://localhost:25503/v3/option/at_time/trade?symbol=AAPL&expiration=20241108&strike=220.000&right=call&start_date=20241104&end_date=20241104&time_of_day=09:30:01.000 + description: "Returns the last trade for an option contract" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/start_date" + - $ref: "#/components/parameters/end_date" + - $ref: "#/components/parameters/time_of_day" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns the last trade for an option contract + content: + text/csv: + schema: + type: array + items: &id083 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + sequence: + type: integer + description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences). + ext_condition1: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition2: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition3: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition4: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + condition: + type: integer + description: The trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html). + size: + type: integer + description: The amount of contracts / shares traded. + exchange: + type: integer + description: The [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html) the trade was executed. + price: + type: number + description: The trade price. + example: "symbol,expiration,strike,right,timestamp,sequence,ext_condition1,ext_condition2,ext_condition3,ext_condition4,condition,size,exchange,price\r\ + \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:00.471,18902138,255,255,255,255,130,2,22,3.90\r\n" + application/json: + schema: &id084 + type: array + items: *id083 + example: + symbol: + - AAPL + strike: + - 220.0 + right: + - CALL + sequence: + - 18902138 + condition: + - 130 + size: + - 2 + price: + - 3.9 + ext_condition2: + - 255 + ext_condition1: + - 255 + expiration: + - '2024-11-08' + ext_condition4: + - 255 + exchange: + - 22 + ext_condition3: + - 255 + timestamp: + - '2024-11-04T09:30:00.471' + application/x-ndjson: + schema: *id084 + example: '{"symbol":"AAPL","strike":220.000,"right":"CALL","sequence":18902138,"condition":130,"size":2,"price":3.90,"ext_condition2":255,"ext_condition1":255,"expiration":"2024-11-08","ext_condition4":255,"exchange":22,"ext_condition3":255,"timestamp":"2024-11-04T09:30:00.471"}' + + /option/at_time/quote: + x-min-subscription: value + get: + summary: Quote + operationId: option_at_time_quote + tags: + - Option + - At-Time + description: | + - Returns the last NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) at a specified millisecond of the day. + - The ``time_of_day``parameter represents the 00:00:00.000 ET that the quote should be provided for. + x-sample-urls: + - url: http://localhost:25503/v3/option/at_time/quote?symbol=AAPL&expiration=20241108&strike=220.000&right=call&start_date=20241104&end_date=20241104&time_of_day=09:30:01.000 + description: "Returns the last quote for an option contract" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/start_date" + - $ref: "#/components/parameters/end_date" + - $ref: "#/components/parameters/time_of_day" + - $ref: "#/components/parameters/expiration" + - $ref: "#/components/parameters/strike" + - $ref: "#/components/parameters/right" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns the last quote for an option contract + content: + text/csv: + schema: + type: array + items: &id085 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + expiration: + type: string + format: date + description: Expiration date of the contract in YYYY-MM-DD format. + strike: + type: number + description: Strike price of the contract in dollars 180.00 + right: + type: string + description: Indicates whether the contract is a call or put option. + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + bid_size: + type: integer + description: The last NBBO bid size. + bid_exchange: + type: integer + description: The last NBBO bid [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html). + bid: + type: number + description: The last NBBO bid price. + bid_condition: + type: integer + description: The last NBBO bid [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html). + ask_size: + type: integer + description: The last NBBO ask size. + ask_exchange: + type: integer + description: The last NBBO ask [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html). + ask: + type: number + description: The last NBBO ask price. + ask_condition: + type: integer + description: The last NBBO ask [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html). + example: "symbol,expiration,strike,right,timestamp,bid_size,bid_exchange,bid,bid_condition,ask_size,ask_exchange,ask,ask_condition\r\ + \nAAPL,2024-11-08,220.000,CALL,2024-11-04T09:30:00.91,129,69,3.95,50,14,47,4.10,50\r\n" + application/json: + schema: &id086 + type: array + items: *id085 + example: + symbol: + - AAPL + ask_size: + - 14 + ask_condition: + - 50 + strike: + - 220.0 + right: + - CALL + bid_size: + - 129 + ask_exchange: + - 47 + bid_exchange: + - 69 + ask: + - 4.1 + expiration: + - '2024-11-08' + bid: + - 3.95 + bid_condition: + - 50 + timestamp: + - '2024-11-04T09:30:00.91' + application/x-ndjson: + schema: *id086 + example: '{"symbol":"AAPL","ask_size":14,"ask_condition":50,"strike":220.000,"right":"CALL","bid_size":129,"ask_exchange":47,"bid_exchange":69,"ask":4.10,"expiration":"2024-11-08","bid":3.95,"bid_condition":50,"timestamp":"2024-11-04T09:30:00.91"}' + +# +# INDEX ENDPOINTS +# + /index/list/symbols: + x-min-subscription: free + get: + summary: Symbols + operationId: index_list_symbols + tags: + - Index + - List + description: | + A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also include: root, ticker, and underlying. This endpoint returns all traded symbols for options. This endpoint is updated overnight. + x-sample-urls: + - url: http://localhost:25503/v3/index/list/symbols + description: "List all symbols for indices" + parameters: + - $ref: "#/components/parameters/format" + responses: + '200': + description: List all symbols for indices + content: + text/csv: + schema: + type: array + items: &id087 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + example: "symbol\r\nAASGI\r\nAASUS\r\nACNAC\r\nACNIT\r\nACNRE\r\n" + application/json: + schema: &id088 + type: array + items: *id087 + example: + symbol: + - AASGI + - AASUS + - ACNAC + - ACNIT + - ACNRE + application/x-ndjson: + schema: *id088 + example: '{"symbol":"AASGI"} + + {"symbol":"AASUS"} + + {"symbol":"ACNAC"} + + {"symbol":"ACNIT"} + + {"symbol":"ACNRE"}' + + /index/list/dates: + x-min-subscription: free + get: + summary: Dates + operationId: index_list_dates + tags: + - Index + - List + description: | + Lists all dates of data that are available for a index with a given request type and symbol. This endpoint is updated overnight. + x-sample-urls: + - url: http://localhost:25503/v3/index/list/dates?symbol=SPX + description: "List all dates for a index for a given symbol" + parameters: + - $ref: "#/components/parameters/multi_symbol" + - $ref: "#/components/parameters/format" + responses: + '200': + description: List all dates for a index for a given symbol + content: + text/csv: + schema: + type: array + items: &id089 + type: object + properties: + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + date: + type: string + format: date + description: The date formated as YYYY-MM-DD. + example: "symbol,date\r\nSPX,2023-04-20\r\nSPX,2023-04-21\r\nSPX,2023-04-17\r\nSPX,2023-04-18\r\nSPX,2023-04-19\r\ + \n" + application/json: + schema: &id090 + type: array + items: *id089 + example: + date: + - '2023-04-20' + - '2023-04-21' + - '2023-04-17' + - '2023-04-18' + - '2023-04-19' + symbol: + - SPX + - SPX + - SPX + - SPX + - SPX + application/x-ndjson: + schema: *id090 + example: '{"date":"2023-04-20","symbol":"SPX"} + + {"date":"2023-04-21","symbol":"SPX"} + + {"date":"2023-04-17","symbol":"SPX"} + + {"date":"2023-04-18","symbol":"SPX"} + + {"date":"2023-04-19","symbol":"SPX"}' + + /index/snapshot/ohlc: + x-min-subscription: standard + get: + summary: Open High Low Close + operationId: index_snapshot_ohlc + tags: + - Index + - Snapshot + description: | + - Retrieves the real-time current day OHLC. + - [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) typically generate a price report every second for popular indices like SPX. + x-sample-urls: + - url: http://localhost:25503/v3/index/snapshot/ohlc?symbol=SPX + description: "Returns OHLC for a given index price change" + parameters: + - $ref: "#/components/parameters/multi_symbol" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns OHLC for a given index price change + content: + text/csv: + schema: + type: array + items: &id091 + type: object + properties: + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + open: + type: number + description: The opening trade price. + high: + type: number + description: The highest traded price. + low: + type: number + description: The lowest traded price. + close: + type: number + description: The closing traded price. + volume: + type: integer + description: The amount of contracts / shares traded. + count: + type: integer + description: The amount of trades. + example: "timestamp,symbol,open,high,low,close,volume,count\r\n2025-08-20T16:02:06,SPX,6406.62,6408.40,6343.86,6395.78,0,0\r\ + \n" + application/json: + schema: &id092 + type: array + items: *id091 + example: + volume: + - 0 + symbol: + - SPX + high: + - 6408.4 + low: + - 6343.86 + count: + - 0 + close: + - 6395.78 + open: + - 6406.62 + timestamp: + - '2025-08-20T16:02:06' + application/x-ndjson: + schema: *id092 + example: '{"volume":0,"symbol":"SPX","high":6408.40,"low":6343.86,"count":0,"close":6395.78,"open":6406.62,"timestamp":"2025-08-20T16:02:06"}' + + /index/snapshot/price: + x-min-subscription: standard + get: + summary: Price + operationId: index_snapshot_price + tags: + - Index + - Snapshot + description: | + - Retrieves a real-time last index price. + - [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) typically generate a price report every second for popular indices like SPX. + x-sample-urls: + - url: http://localhost:25503/v3/index/snapshot/price?symbol=SPX + description: "Returns last index price" + parameters: + - $ref: "#/components/parameters/multi_symbol" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns last index price + content: + text/csv: + schema: + type: array + items: &id093 + type: object + properties: + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + symbol: + type: string + description: The symbol of the contract, or stock / underlying asset / option / index. + price: + type: number + description: The trade price. + example: "timestamp,symbol,price\r\n2025-08-20T16:02:06,SPX,6395.78\r\n" + application/json: + schema: &id094 + type: array + items: *id093 + example: + symbol: + - SPX + price: + - 6395.78 + timestamp: + - '2025-08-20T16:02:06' + application/x-ndjson: + schema: *id094 + example: '{"symbol":"SPX","price":6395.78,"timestamp":"2025-08-20T16:02:06"}' + + /index/history/eod: + x-min-subscription: free + get: + summary: End of Day + operationId: index_history_eod + tags: + - Index + - History + description: | + - Since [the indices feeds](/Articles/Data-And-Requests/The-SIPs.html) do not provide a national EOD report, Theta Data generates a national EOD report at 17:15 each day. + x-sample-urls: + - url: http://localhost:25503/v3/index/history/eod?symbol=SPX&start_date=20241104&end_date=20241108 + description: "Returns EOD report for a given symbol between specified dates (inclusive)" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/start_date" + - $ref: "#/components/parameters/end_date" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns EOD report for a given symbol between specified dates (inclusive) + content: + text/csv: + schema: + type: array + items: &id095 + type: object + properties: + created: + type: string + format: date-time + description: The date formated as YYYY-MM-DDTHH:mm:ss.SSS format. + last_trade: + type: string + format: date-time + description: The last trade date formated as YYYY-MM-DDTHH:mm:ss.SSS format. + open: + type: number + description: The opening trade price. + high: + type: number + description: The highest traded price. + low: + type: number + description: The lowest traded price. + close: + type: number + description: The closing traded price. + volume: + type: integer + description: The amount of contracts / shares traded. + count: + type: integer + description: The amount of trades. + bid_size: + type: integer + description: The last NBBO bid size. + bid_exchange: + type: integer + description: The last NBBO bid [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html). + bid: + type: number + description: The last NBBO bid price. + bid_condition: + type: integer + description: The last NBBO bid [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html). + ask_size: + type: integer + description: The last NBBO ask size. + ask_exchange: + type: integer + description: The last NBBO ask [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html). + ask: + type: number + description: The last NBBO ask price. + ask_condition: + type: integer + description: The last NBBO ask [condition](/Articles/Errors-Exchanges-Conditions/Quote-Conditions.html). + example: "created,last_trade,open,high,low,close,volume,count,bid_size,bid_exchange,bid,bid_condition,ask_size,ask_exchange,ask,ask_condition\r\ + \n2024-11-04T17:19:50.198,2024-11-04T16:03:03,5725.15,5741.43,5696.51,5712.69,0,0,0,0,0.00,0,0,0,0.00,0\r\n\ + 2024-11-05T17:15:03.061,2024-11-05T16:02:30,5722.43,5783.44,5722.10,5782.76,0,0,0,0,0.00,0,0,0,0.00,0\r\n\ + 2024-11-06T17:16:28.297,2024-11-06T16:01:37,5864.89,5936.14,5864.89,5929.04,0,0,0,0,0.00,0,0,0,0.00,0\r\n\ + 2024-11-07T17:17:17.218,2024-11-07T16:02:49,5947.21,5983.84,5947.21,5973.10,0,0,0,0,0.00,0,0,0,0.00,0\r\n\ + 2024-11-08T17:21:08.187,2024-11-08T16:01:15,5976.76,6012.45,5976.76,5995.54,0,0,0,0,0.00,0,0,0,0.00,0\r\n" + application/json: + schema: &id096 + type: array + items: *id095 + example: + ask_size: + - 0 + - 0 + - 0 + - 0 + - 0 + last_trade: + - '2024-11-04T16:03:03' + - '2024-11-05T16:02:30' + - '2024-11-06T16:01:37' + - '2024-11-07T16:02:49' + - '2024-11-08T16:01:15' + created: + - '2024-11-04T17:19:50.198' + - '2024-11-05T17:15:03.061' + - '2024-11-06T17:16:28.297' + - '2024-11-07T17:17:17.218' + - '2024-11-08T17:21:08.187' + ask_condition: + - 0 + - 0 + - 0 + - 0 + - 0 + count: + - 0 + - 0 + - 0 + - 0 + - 0 + volume: + - 0 + - 0 + - 0 + - 0 + - 0 + high: + - 5741.43 + - 5783.44 + - 5936.14 + - 5983.84 + - 6012.45 + low: + - 5696.51 + - 5722.1 + - 5864.89 + - 5947.21 + - 5976.76 + bid_size: + - 0 + - 0 + - 0 + - 0 + - 0 + ask_exchange: + - 0 + - 0 + - 0 + - 0 + - 0 + bid_exchange: + - 0 + - 0 + - 0 + - 0 + - 0 + ask: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + bid: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + bid_condition: + - 0 + - 0 + - 0 + - 0 + - 0 + close: + - 5712.69 + - 5782.76 + - 5929.04 + - 5973.1 + - 5995.54 + open: + - 5725.15 + - 5722.43 + - 5864.89 + - 5947.21 + - 5976.76 + application/x-ndjson: + schema: *id096 + example: '{"ask_size":0,"last_trade":"2024-11-04T16:03:03","created":"2024-11-04T17:19:50.198","ask_condition":0,"count":0,"volume":0,"high":5741.43,"low":5696.51,"bid_size":0,"ask_exchange":0,"bid_exchange":0,"ask":0.00,"bid":0.00,"bid_condition":0,"close":5712.69,"open":5725.15} + + {"ask_size":0,"last_trade":"2024-11-05T16:02:30","created":"2024-11-05T17:15:03.061","ask_condition":0,"count":0,"volume":0,"high":5783.44,"low":5722.10,"bid_size":0,"ask_exchange":0,"bid_exchange":0,"ask":0.00,"bid":0.00,"bid_condition":0,"close":5782.76,"open":5722.43} + + {"ask_size":0,"last_trade":"2024-11-06T16:01:37","created":"2024-11-06T17:16:28.297","ask_condition":0,"count":0,"volume":0,"high":5936.14,"low":5864.89,"bid_size":0,"ask_exchange":0,"bid_exchange":0,"ask":0.00,"bid":0.00,"bid_condition":0,"close":5929.04,"open":5864.89} + + {"ask_size":0,"last_trade":"2024-11-07T16:02:49","created":"2024-11-07T17:17:17.218","ask_condition":0,"count":0,"volume":0,"high":5983.84,"low":5947.21,"bid_size":0,"ask_exchange":0,"bid_exchange":0,"ask":0.00,"bid":0.00,"bid_condition":0,"close":5973.10,"open":5947.21} + + {"ask_size":0,"last_trade":"2024-11-08T16:01:15","created":"2024-11-08T17:21:08.187","ask_condition":0,"count":0,"volume":0,"high":6012.45,"low":5976.76,"bid_size":0,"ask_exchange":0,"bid_exchange":0,"ask":0.00,"bid":0.00,"bid_condition":0,"close":5995.54,"open":5976.76}' + + /index/history/ohlc: + x-min-subscription: standard + get: + summary: Open High Low Close + operationId: index_history_ohlc + tags: + - Index + - History + description: | + - Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. + - Time timestamp of the bar represents the opening time of the bar. For a trade to be part of the bar: ``bar timestamp`` <= ``trade time`` < ``bar timestamp + interval``. + - [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) typically generate a price report every second for popular indices like SPX. + x-sample-urls: + - url: http://localhost:25503/v3/index/history/ohlc?symbol=SPX&start_date=20241104&end_date=20241104&interval=1m + description: "Returns OHLC for a given symbol between specified dates (inclusive) with a one minute interval" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/start_date" + - $ref: "#/components/parameters/end_date" + - $ref: "#/components/parameters/interval" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns OHLC for a given symbol between specified dates (inclusive) with a one minute interval + content: + text/csv: + schema: + type: array + items: &id097 + type: object + properties: + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + open: + type: number + description: The opening trade price. + high: + type: number + description: The highest traded price. + low: + type: number + description: The lowest traded price. + close: + type: number + description: The closing traded price. + volume: + type: integer + description: The amount of contracts / shares traded. + count: + type: integer + description: The amount of trades. + vwap: + type: number + description: The volume weighted average price of the given interval. + example: "timestamp,open,high,low,close,volume,count,vwap\r\n2024-11-04T09:30:00,5725.15,5731.27,5725.15,5728.56,0,0,0.00\r\ + \n2024-11-04T09:31:00,5728.90,5730.40,5724.53,5725.42,0,0,0.00\r\n2024-11-04T09:32:00,5725.48,5729.20,5723.55,5726.54,0,0,0.00\r\ + \n2024-11-04T09:33:00,5726.57,5726.71,5723.13,5723.13,0,0,0.00\r\n2024-11-04T09:34:00,5722.88,5723.33,5717.35,5717.64,0,0,0.00\r\ + \n" + application/json: + schema: &id098 + type: array + items: *id097 + example: + volume: + - 0 + - 0 + - 0 + - 0 + - 0 + high: + - 5731.27 + - 5730.4 + - 5729.2 + - 5726.71 + - 5723.33 + low: + - 5725.15 + - 5724.53 + - 5723.55 + - 5723.13 + - 5717.35 + vwap: + - 0.0 + - 0.0 + - 0.0 + - 0.0 + - 0.0 + count: + - 0 + - 0 + - 0 + - 0 + - 0 + close: + - 5728.56 + - 5725.42 + - 5726.54 + - 5723.13 + - 5717.64 + open: + - 5725.15 + - 5728.9 + - 5725.48 + - 5726.57 + - 5722.88 + timestamp: + - '2024-11-04T09:30:00' + - '2024-11-04T09:31:00' + - '2024-11-04T09:32:00' + - '2024-11-04T09:33:00' + - '2024-11-04T09:34:00' + application/x-ndjson: + schema: *id098 + example: '{"volume":0,"high":5731.27,"low":5725.15,"vwap":0.00,"count":0,"close":5728.56,"open":5725.15,"timestamp":"2024-11-04T09:30:00"} + + {"volume":0,"high":5730.40,"low":5724.53,"vwap":0.00,"count":0,"close":5725.42,"open":5728.90,"timestamp":"2024-11-04T09:31:00"} + + {"volume":0,"high":5729.20,"low":5723.55,"vwap":0.00,"count":0,"close":5726.54,"open":5725.48,"timestamp":"2024-11-04T09:32:00"} + + {"volume":0,"high":5726.71,"low":5723.13,"vwap":0.00,"count":0,"close":5723.13,"open":5726.57,"timestamp":"2024-11-04T09:33:00"} + + {"volume":0,"high":5723.33,"low":5717.35,"vwap":0.00,"count":0,"close":5717.64,"open":5722.88,"timestamp":"2024-11-04T09:34:00"}' + + /index/history/price: + x-min-subscription: value + get: + summary: Price + operationId: index_history_price + tags: + - Index + - History + description: | + - Retrieves historical indices price reports. [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) typically generate a price report every second for popular indices like SPX. + - When the ``interval`` parameter is specified, the returned data represents the price at the exact time of each timestamp. If the timestamp in the response is 10:30:00, the price field represents the price at that exact time of the day. + - A price update from the exchange is omitted if the price remained the same from the previous update. + x-sample-urls: + - url: http://localhost:25503/v3/index/history/price?symbol=SPX&date=20241104&interval=1m + description: "Returns historical index price reports" + parameters: + - $ref: "#/components/parameters/date" + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/start_time" + - $ref: "#/components/parameters/end_time" + - $ref: "#/components/parameters/interval" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns historical index price reports + content: + text/csv: + schema: + type: array + items: &id099 + type: object + properties: + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + price: + type: number + description: The trade price. + example: "timestamp,price\r\n2024-11-04T09:30:00,0.0\r\n2024-11-04T09:31:00,5728.56\r\n2024-11-04T09:32:00,5725.48\r\ + \n2024-11-04T09:33:00,5726.57\r\n2024-11-04T09:34:00,5722.88\r\n" + application/json: + schema: &id100 + type: array + items: *id099 + example: + price: + - 0.0 + - 5728.56 + - 5725.48 + - 5726.57 + - 5722.88 + timestamp: + - '2024-11-04T09:30:00' + - '2024-11-04T09:31:00' + - '2024-11-04T09:32:00' + - '2024-11-04T09:33:00' + - '2024-11-04T09:34:00' + application/x-ndjson: + schema: *id100 + example: '{"price":0.0,"timestamp":"2024-11-04T09:30:00"} + + {"price":5728.56,"timestamp":"2024-11-04T09:31:00"} + + {"price":5725.48,"timestamp":"2024-11-04T09:32:00"} + + {"price":5726.57,"timestamp":"2024-11-04T09:33:00"} + + {"price":5722.88,"timestamp":"2024-11-04T09:34:00"}' + + /index/at_time/price: + x-min-subscription: value + get: + summary: Price + operationId: index_at_time_price + tags: + - Index + - At-Time + description: | + - Retrieves historical indices price reports. [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) typically generate a price report every second for popular indices like SPX. + - The ``time_of_day`` parameter represents the 00:00:00.000 ET that the price should be provided for. + x-sample-urls: + - url: http://localhost:25503/v3/index/at_time/price?symbol=SPX&start_date=20241104&end_date=20241108&time_of_day=09:30:01.000 + description: "Returns specific at time historical index price reports" + parameters: + - $ref: "#/components/parameters/single_symbol" + - $ref: "#/components/parameters/start_date" + - $ref: "#/components/parameters/end_date" + - $ref: "#/components/parameters/time_of_day" + - $ref: "#/components/parameters/format" + responses: + '200': + description: Returns specific at time historical index price reports + content: + text/csv: + schema: + type: array + items: &id101 + type: object + properties: + timestamp: + type: string + format: date-time + description: The timestamp in YYYY-MM-DDTHH:mm:ss.SSS format. + sequence: + type: integer + description: The exchange [sequence](/Articles/Data-And-Requests/Making-Requests#trade-sequences). + ext_condition1: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition2: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition3: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + ext_condition4: + type: integer + description: Additional trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html)(s). + These can be ignored for options. + condition: + type: integer + description: The trade [condition](/Articles/Errors-Exchanges-Conditions/Trade-Conditions.html). + size: + type: integer + description: The amount of contracts / shares traded. + exchange: + type: integer + description: The [exchange](/Articles/Errors-Exchanges-Conditions/Exchanges.html) the trade was executed. + price: + type: number + description: The trade price. + example: "timestamp,sequence,ext_condition1,ext_condition2,ext_condition3,ext_condition4,condition,size,exchange,price\r\ + \n2024-11-04T09:30:01,0,255,255,255,255,0,0,5,5725.15\r\n2024-11-05T09:30:01,0,255,255,255,255,0,0,5,5722.43\r\ + \n2024-11-06T09:30:01,0,255,255,255,255,0,0,5,5864.89\r\n2024-11-07T09:30:01,0,255,255,255,255,0,0,5,5947.21\r\ + \n2024-11-08T09:30:01,0,255,255,255,255,0,0,5,5976.76\r\n" + application/json: + schema: &id102 + type: array + items: *id101 + example: + sequence: + - 0 + - 0 + - 0 + - 0 + - 0 + condition: + - 0 + - 0 + - 0 + - 0 + - 0 + size: + - 0 + - 0 + - 0 + - 0 + - 0 + price: + - 5725.15 + - 5722.43 + - 5864.89 + - 5947.21 + - 5976.76 + ext_condition2: + - 255 + - 255 + - 255 + - 255 + - 255 + ext_condition1: + - 255 + - 255 + - 255 + - 255 + - 255 + ext_condition4: + - 255 + - 255 + - 255 + - 255 + - 255 + exchange: + - 5 + - 5 + - 5 + - 5 + - 5 + ext_condition3: + - 255 + - 255 + - 255 + - 255 + - 255 + timestamp: + - '2024-11-04T09:30:01' + - '2024-11-05T09:30:01' + - '2024-11-06T09:30:01' + - '2024-11-07T09:30:01' + - '2024-11-08T09:30:01' + application/x-ndjson: + schema: *id102 + example: '{"sequence":0,"condition":0,"size":0,"price":5725.15,"ext_condition2":255,"ext_condition1":255,"ext_condition4":255,"exchange":5,"ext_condition3":255,"timestamp":"2024-11-04T09:30:01"} + + {"sequence":0,"condition":0,"size":0,"price":5722.43,"ext_condition2":255,"ext_condition1":255,"ext_condition4":255,"exchange":5,"ext_condition3":255,"timestamp":"2024-11-05T09:30:01"} + + {"sequence":0,"condition":0,"size":0,"price":5864.89,"ext_condition2":255,"ext_condition1":255,"ext_condition4":255,"exchange":5,"ext_condition3":255,"timestamp":"2024-11-06T09:30:01"} + + {"sequence":0,"condition":0,"size":0,"price":5947.21,"ext_condition2":255,"ext_condition1":255,"ext_condition4":255,"exchange":5,"ext_condition3":255,"timestamp":"2024-11-07T09:30:01"} + + {"sequence":0,"condition":0,"size":0,"price":5976.76,"ext_condition2":255,"ext_condition1":255,"ext_condition4":255,"exchange":5,"ext_condition3":255,"timestamp":"2024-11-08T09:30:01"}' + + +components: + parameters: + # required parameters + single_symbol: + name: symbol + in: query + description: The stock or index symbol, or underlying symbol for options. + required: true + schema: + type: string + + multi_symbol: + name: symbol + in: query + description: The stock or index symbol, or underlying symbol for options. Specify '*' for all symbols or a comma separated list when appropriate. + required: true + schema: + type: array + items: + type: string + + opt_multi_symbol: + name: symbol + in: query + description: The stock or index symbol, or underlying symbol for options. + required: false + schema: + type: array + items: + type: string + + date: + name: date + in: query + description: The date to fetch data for. + required: true + schema: + type: string + format: date + + end_date: + name: end_date + in: query + description: The end date (inclusive). + required: true + schema: + type: string + format: date + + start_date: + name: start_date + in: query + description: The start date (inclusive). + required: true + schema: + type: string + format: date + + opt_end_date: + name: end_date + in: query + description: The end date (inclusive). + required: false + schema: + type: string + format: date + + opt_start_date: + name: start_date + in: query + description: The start date (inclusive). + required: false + schema: + type: string + format: date + + time_of_day: + name: time_of_day + in: query + description: The time of the day to fetch data for; assumed to be America/New_York. + required: true + schema: + type: string + format: time + + expiration: + name: expiration + in: query + description: The expiration of the contract in `YYYY-MM-DD` or `YYYYMMDD` format, or `*` for all expirations. + required: true + schema: + type: string + format: date + + expiration_no_star: + name: expiration + in: query + description: The expiration of the contract in `YYYY-MM-DD` or `YYYYMMDD` format. + required: true + schema: + type: string + format: date + + strike: + name: strike + in: query + description: The strike price of the contract in dollars (ie `100.00` for `$100.00`), or `*` for all strikes. + required: false + schema: + type: string + default: "*" + + interval: + name: interval + in: query + description: The size of the time interval must be one of the available options listed below. + required: true + schema: + type: string + enum: + - tick + - 10ms + - 100ms + - 500ms + - 1s + - 5s + - 10s + - 15s + - 30s + - 1m + - 5m + - 10m + - 15m + - 30m + - 1h + default: 1s + + security_type: + name: security_type + in: path + description: The security type. + required: true + schema: + type: string + enum: + - stock + - option + - index + + request_type: + name: request_type + in: path + description: The request type. + required: true + schema: + type: string + enum: + - trade + - quote + + + # non-required parameters + annual_dividend: + name: annual_dividend + in: query + description: The annualized expected dividend amount to be used in Greeks calculations. + required: false + schema: + type: number + format: float + + end_time: + name: end_time + in: query + description: The end time (inclusive) in the specified day. + required: false + schema: + type: string + format: time + default: "16:00:00" + + exclusive: + name: exclusive + in: query + description: If you prefer to match quotes with timestamps that are < the trade timestamp. + required: false + schema: + type: boolean + default: true + + format: + name: format + in: query + description: The format of the data when returned to the user. + required: false + schema: + type: string + enum: + - csv + - json + - ndjson + default: ndjson + + rate_type: + name: rate_type + in: query + description: The interest rate type to be used in a Greeks calculation. + required: false + schema: + type: string + enum: + - sofr + - treasury_m1 + - treasury_m3 + - treasury_m6 + - treasury_y1 + - treasury_y2 + - treasury_y3 + - treasury_y5 + - treasury_y7 + - treasury_y10 + - treasury_y20 + - treasury_y30 + default: sofr + + rate_value: + name: rate_value + in: query + description: The interest rate, as a percent, to be used in a Greeks calculation. + required: false + schema: + type: number + format: float + example: 5.0 + + right: + name: right + in: query + description: The right (call or put) of the contract. + required: false + schema: + type: string + enum: + - call + - put + - both + default: both + + start_time: + name: start_time + in: query + description: The start time (inclusive) in the specified day. + required: false + schema: + type: string + format: time + default: "09:30:00" + + stock_price: + name: stock_price + in: query + description: The underlying stock price to be used in the Greeks calculation. + required: false + schema: + type: number + format: float + + venue: + name: venue + in: query + description: Used to specify the venue of the real time or historic request. ``nqb`` = Nasdaq Basic; ``utp_cta`` = merged UTP & CTA. + required: false + schema: + type: string + enum: + - nqb + - utp_cta + default: nqb + + responses: + 200_OK: + description: "" + content: + text/csv: + schema: + type: string + + diff --git a/openapi/preprocess_td.py b/openapi/preprocess_td.py new file mode 100644 index 000000000..34da50ff1 --- /dev/null +++ b/openapi/preprocess_td.py @@ -0,0 +1,108 @@ +#!/usr/bin/env python3 +# preprocess_openapi.py +# Usage: python preprocess_openapi.py input.yaml output.yaml +from __future__ import annotations +import sys +from typing import Any +from ruamel.yaml import YAML + +yaml = YAML() +yaml.preserve_quotes = True + +def infer_item_type(x: Any) -> str: + if isinstance(x, bool): + return "boolean" + if isinstance(x, int): + return "integer" + if isinstance(x, float): + return "number" + if isinstance(x, dict): + return "object" + # default + return "string" + +def is_dict_of_lists(obj: Any) -> bool: + if not isinstance(obj, dict) or not obj: + return False + return all(isinstance(v, list) for v in obj.values()) + +def coerce_schema_to_object_of_arrays(example: dict[str, list[Any]]) -> dict[str, Any]: + props = {} + for k, v in example.items(): + item_type = infer_item_type(v[0]) if v else "string" + props[k] = {"type": "array", "items": {"type": item_type}} + return {"type": "object", "properties": props, "required": list(example.keys())} + +def try_fix_json_schema(json_content: dict[str, Any]) -> None: + """ + If the example is dict-of-lists, rewrite schema accordingly. + If schema says array but example is dict-of-lists, rewrite to object-of-arrays. + If there is no example, but schema clearly wrong (array w/ object items), leave it. + """ + example = json_content.get("example") + schema = json_content.get("schema") + + # If example shows dict-of-lists, prefer it as ground truth + if is_dict_of_lists(example): + json_content["schema"] = coerce_schema_to_object_of_arrays(example) + return + + # Fallback: if schema says array but provider actually returns dict-of-lists, + # and we have no example, we can’t safely infer keys. Leave as-is. + # If schema is object and missing properties but example present, fill them in. + if isinstance(schema, dict) and schema.get("type") == "object" and "properties" not in schema and is_dict_of_lists(example or {}): + json_content["schema"] = coerce_schema_to_object_of_arrays(example) # already handled above + +def keep_only_application_json(content: dict[str, Any]) -> dict[str, Any]: + if "application/json" in content: + return {"application/json": content["application/json"]} + # If no JSON declared, drop all to force a regen failure (better than wrong types), + # or convert NDJSON to JSON string schema if you prefer. Here we drop. + return {} + +def process(doc: dict[str, Any]) -> dict[str, Any]: + paths = doc.get("paths", {}) + for _, path_item in paths.items(): + if not isinstance(path_item, dict): + continue + for method, op in list(path_item.items()): + if method.lower() not in {"get", "post", "put", "patch", "delete", "options", "head"}: + continue + responses = op.get("responses") + if not isinstance(responses, dict): + continue + for _, resp in responses.items(): + if not isinstance(resp, dict): + continue + content = resp.get("content") + if not isinstance(content, dict): + continue + + # 1) Keep only application/json + new_content = keep_only_application_json(content) + if not new_content: + # remove content entirely if no JSON; generator will surface it + resp["content"] = {} + continue + + # 2) Fix JSON schema if dict-of-lists + json_content = new_content.get("application/json") + if isinstance(json_content, dict): + try_fix_json_schema(json_content) + + resp["content"] = new_content + return doc + +def main(): + if len(sys.argv) != 3: + print("Usage: python preprocess_openapi.py input.yaml output.yaml", file=sys.stderr) + sys.exit(2) + inf, outf = sys.argv[1], sys.argv[2] + with open(inf, "r", encoding="utf-8") as f: + doc = yaml.load(f) + doc = process(doc) + with open(outf, "w", encoding="utf-8") as f: + yaml.dump(doc, f) + +if __name__ == "__main__": + main() diff --git a/openapi_project/README.md b/openapi_project/README.md index 126ad5b7e..e82f9de96 100644 --- a/openapi_project/README.md +++ b/openapi_project/README.md @@ -1,5 +1,5 @@ # openapi_project -A client library for accessing Silexx API +A client library for accessing Theta Data v3 ## Usage First, create a client: diff --git a/openapi_project/openapi_package/__init__.py b/openapi_project/openapi_package/__init__.py index 80fd8e99d..1588df19e 100644 --- a/openapi_project/openapi_package/__init__.py +++ b/openapi_project/openapi_package/__init__.py @@ -1,5 +1,5 @@ -"""A client library for accessing Silexx API""" +""" A client library for accessing Theta Data v3 """ from openapi_project.openapi_package.client import AuthenticatedClient, Client __all__ = ( diff --git a/openapi_project/openapi_package/api/__init__.py b/openapi_project/openapi_package/api/__init__.py index e6035bd9f..f5925d14d 100644 --- a/openapi_project/openapi_package/api/__init__.py +++ b/openapi_project/openapi_package/api/__init__.py @@ -1 +1 @@ -"""Contains methods for accessing the API""" +""" Contains methods for accessing the API """ diff --git a/openapi_project/openapi_package/api/application_service/__init__.py b/openapi_project/openapi_package/api/application_service/__init__.py deleted file mode 100644 index dcbab9a7a..000000000 --- a/openapi_project/openapi_package/api/application_service/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/openapi_project/openapi_package/api/application_service/post_application_login.py b/openapi_project/openapi_package/api/application_service/post_application_login.py deleted file mode 100644 index 261f7a2a7..000000000 --- a/openapi_project/openapi_package/api/application_service/post_application_login.py +++ /dev/null @@ -1,157 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.login_request import LoginRequest -from openapi_project.openapi_package.models.login_response import LoginResponse -from typing import cast - - -def _get_kwargs( - *, - body: LoginRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/application/login", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> LoginResponse | None: - if response.status_code == 200: - response_200 = LoginResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[LoginResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: LoginRequest, -) -> Response[LoginResponse]: - """ - Args: - body (LoginRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[LoginResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: LoginRequest, -) -> LoginResponse | None: - """ - Args: - body (LoginRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - LoginResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: LoginRequest, -) -> Response[LoginResponse]: - """ - Args: - body (LoginRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[LoginResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: LoginRequest, -) -> LoginResponse | None: - """ - Args: - body (LoginRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - LoginResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/index/__init__.py b/openapi_project/openapi_package/api/index/__init__.py new file mode 100644 index 000000000..03e86a6af --- /dev/null +++ b/openapi_project/openapi_package/api/index/__init__.py @@ -0,0 +1 @@ +""" Contains endpoint functions for accessing the API """ diff --git a/openapi_project/openapi_package/api/index/index_at_time_price.py b/openapi_project/openapi_package/api/index/index_at_time_price.py new file mode 100644 index 000000000..00e10d05d --- /dev/null +++ b/openapi_project/openapi_package/api/index/index_at_time_price.py @@ -0,0 +1,264 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.index_at_time_price_format import IndexAtTimePriceFormat +from openapi_project.openapi_package.models.index_at_time_price_response_200 import IndexAtTimePriceResponse200 +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + time_of_day: str, + format_: Unset | IndexAtTimePriceFormat = IndexAtTimePriceFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["symbol"] = symbol + + json_start_date = start_date.isoformat() + params["start_date"] = json_start_date + + json_end_date = end_date.isoformat() + params["end_date"] = json_end_date + + params["time_of_day"] = time_of_day + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/index/at_time/price", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IndexAtTimePriceResponse200 | None: + if response.status_code == 200: + response_200 = IndexAtTimePriceResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[IndexAtTimePriceResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + time_of_day: str, + format_: Unset | IndexAtTimePriceFormat = IndexAtTimePriceFormat.NDJSON, + +) -> Response[IndexAtTimePriceResponse200]: + """ Price + + - Retrieves historical indices price reports. [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) + typically generate a price report every second for popular indices like SPX. + - The ``time_of_day`` parameter represents the 00:00:00.000 ET that the price should be provided + for. + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + time_of_day (str): + format_ (Unset | IndexAtTimePriceFormat): Default: IndexAtTimePriceFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[IndexAtTimePriceResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +start_date=start_date, +end_date=end_date, +time_of_day=time_of_day, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + time_of_day: str, + format_: Unset | IndexAtTimePriceFormat = IndexAtTimePriceFormat.NDJSON, + +) -> IndexAtTimePriceResponse200 | None: + """ Price + + - Retrieves historical indices price reports. [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) + typically generate a price report every second for popular indices like SPX. + - The ``time_of_day`` parameter represents the 00:00:00.000 ET that the price should be provided + for. + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + time_of_day (str): + format_ (Unset | IndexAtTimePriceFormat): Default: IndexAtTimePriceFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + IndexAtTimePriceResponse200 + """ + + + return sync_detailed( + client=client, +symbol=symbol, +start_date=start_date, +end_date=end_date, +time_of_day=time_of_day, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + time_of_day: str, + format_: Unset | IndexAtTimePriceFormat = IndexAtTimePriceFormat.NDJSON, + +) -> Response[IndexAtTimePriceResponse200]: + """ Price + + - Retrieves historical indices price reports. [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) + typically generate a price report every second for popular indices like SPX. + - The ``time_of_day`` parameter represents the 00:00:00.000 ET that the price should be provided + for. + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + time_of_day (str): + format_ (Unset | IndexAtTimePriceFormat): Default: IndexAtTimePriceFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[IndexAtTimePriceResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +start_date=start_date, +end_date=end_date, +time_of_day=time_of_day, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + time_of_day: str, + format_: Unset | IndexAtTimePriceFormat = IndexAtTimePriceFormat.NDJSON, + +) -> IndexAtTimePriceResponse200 | None: + """ Price + + - Retrieves historical indices price reports. [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) + typically generate a price report every second for popular indices like SPX. + - The ``time_of_day`` parameter represents the 00:00:00.000 ET that the price should be provided + for. + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + time_of_day (str): + format_ (Unset | IndexAtTimePriceFormat): Default: IndexAtTimePriceFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + IndexAtTimePriceResponse200 + """ + + + return (await asyncio_detailed( + client=client, +symbol=symbol, +start_date=start_date, +end_date=end_date, +time_of_day=time_of_day, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/index/index_history_eod.py b/openapi_project/openapi_package/api/index/index_history_eod.py new file mode 100644 index 000000000..a31097e38 --- /dev/null +++ b/openapi_project/openapi_package/api/index/index_history_eod.py @@ -0,0 +1,241 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.index_history_eod_format import IndexHistoryEodFormat +from openapi_project.openapi_package.models.index_history_eod_response_200 import IndexHistoryEodResponse200 +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + format_: Unset | IndexHistoryEodFormat = IndexHistoryEodFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["symbol"] = symbol + + json_start_date = start_date.isoformat() + params["start_date"] = json_start_date + + json_end_date = end_date.isoformat() + params["end_date"] = json_end_date + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/index/history/eod", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IndexHistoryEodResponse200 | None: + if response.status_code == 200: + response_200 = IndexHistoryEodResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[IndexHistoryEodResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + format_: Unset | IndexHistoryEodFormat = IndexHistoryEodFormat.NDJSON, + +) -> Response[IndexHistoryEodResponse200]: + """ End of Day + + - Since [the indices feeds](/Articles/Data-And-Requests/The-SIPs.html) do not provide a national EOD + report, Theta Data generates a national EOD report at 17:15 each day. + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + format_ (Unset | IndexHistoryEodFormat): Default: IndexHistoryEodFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[IndexHistoryEodResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +start_date=start_date, +end_date=end_date, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + format_: Unset | IndexHistoryEodFormat = IndexHistoryEodFormat.NDJSON, + +) -> IndexHistoryEodResponse200 | None: + """ End of Day + + - Since [the indices feeds](/Articles/Data-And-Requests/The-SIPs.html) do not provide a national EOD + report, Theta Data generates a national EOD report at 17:15 each day. + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + format_ (Unset | IndexHistoryEodFormat): Default: IndexHistoryEodFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + IndexHistoryEodResponse200 + """ + + + return sync_detailed( + client=client, +symbol=symbol, +start_date=start_date, +end_date=end_date, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + format_: Unset | IndexHistoryEodFormat = IndexHistoryEodFormat.NDJSON, + +) -> Response[IndexHistoryEodResponse200]: + """ End of Day + + - Since [the indices feeds](/Articles/Data-And-Requests/The-SIPs.html) do not provide a national EOD + report, Theta Data generates a national EOD report at 17:15 each day. + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + format_ (Unset | IndexHistoryEodFormat): Default: IndexHistoryEodFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[IndexHistoryEodResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +start_date=start_date, +end_date=end_date, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + format_: Unset | IndexHistoryEodFormat = IndexHistoryEodFormat.NDJSON, + +) -> IndexHistoryEodResponse200 | None: + """ End of Day + + - Since [the indices feeds](/Articles/Data-And-Requests/The-SIPs.html) do not provide a national EOD + report, Theta Data generates a national EOD report at 17:15 each day. + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + format_ (Unset | IndexHistoryEodFormat): Default: IndexHistoryEodFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + IndexHistoryEodResponse200 + """ + + + return (await asyncio_detailed( + client=client, +symbol=symbol, +start_date=start_date, +end_date=end_date, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/index/index_history_ohlc.py b/openapi_project/openapi_package/api/index/index_history_ohlc.py new file mode 100644 index 000000000..de332d7d4 --- /dev/null +++ b/openapi_project/openapi_package/api/index/index_history_ohlc.py @@ -0,0 +1,300 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.index_history_ohlc_format import IndexHistoryOhlcFormat +from openapi_project.openapi_package.models.index_history_ohlc_interval import IndexHistoryOhlcInterval +from openapi_project.openapi_package.models.index_history_ohlc_response_200 import IndexHistoryOhlcResponse200 +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + interval: IndexHistoryOhlcInterval = IndexHistoryOhlcInterval.VALUE_4, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + format_: Unset | IndexHistoryOhlcFormat = IndexHistoryOhlcFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["symbol"] = symbol + + json_start_date = start_date.isoformat() + params["start_date"] = json_start_date + + json_end_date = end_date.isoformat() + params["end_date"] = json_end_date + + json_interval = interval.value + params["interval"] = json_interval + + params["start_time"] = start_time + + params["end_time"] = end_time + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/index/history/ohlc", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IndexHistoryOhlcResponse200 | None: + if response.status_code == 200: + response_200 = IndexHistoryOhlcResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[IndexHistoryOhlcResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + interval: IndexHistoryOhlcInterval = IndexHistoryOhlcInterval.VALUE_4, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + format_: Unset | IndexHistoryOhlcFormat = IndexHistoryOhlcFormat.NDJSON, + +) -> Response[IndexHistoryOhlcResponse200]: + """ Open High Low Close + + - Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. + - Time timestamp of the bar represents the opening time of the bar. For a trade to be part of the + bar: ``bar timestamp`` <= ``trade time`` < ``bar timestamp + interval``. + - [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) typically generate a price report every + second for popular indices like SPX. + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + interval (IndexHistoryOhlcInterval): Default: IndexHistoryOhlcInterval.VALUE_4. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + format_ (Unset | IndexHistoryOhlcFormat): Default: IndexHistoryOhlcFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[IndexHistoryOhlcResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +start_date=start_date, +end_date=end_date, +interval=interval, +start_time=start_time, +end_time=end_time, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + interval: IndexHistoryOhlcInterval = IndexHistoryOhlcInterval.VALUE_4, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + format_: Unset | IndexHistoryOhlcFormat = IndexHistoryOhlcFormat.NDJSON, + +) -> IndexHistoryOhlcResponse200 | None: + """ Open High Low Close + + - Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. + - Time timestamp of the bar represents the opening time of the bar. For a trade to be part of the + bar: ``bar timestamp`` <= ``trade time`` < ``bar timestamp + interval``. + - [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) typically generate a price report every + second for popular indices like SPX. + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + interval (IndexHistoryOhlcInterval): Default: IndexHistoryOhlcInterval.VALUE_4. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + format_ (Unset | IndexHistoryOhlcFormat): Default: IndexHistoryOhlcFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + IndexHistoryOhlcResponse200 + """ + + + return sync_detailed( + client=client, +symbol=symbol, +start_date=start_date, +end_date=end_date, +interval=interval, +start_time=start_time, +end_time=end_time, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + interval: IndexHistoryOhlcInterval = IndexHistoryOhlcInterval.VALUE_4, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + format_: Unset | IndexHistoryOhlcFormat = IndexHistoryOhlcFormat.NDJSON, + +) -> Response[IndexHistoryOhlcResponse200]: + """ Open High Low Close + + - Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. + - Time timestamp of the bar represents the opening time of the bar. For a trade to be part of the + bar: ``bar timestamp`` <= ``trade time`` < ``bar timestamp + interval``. + - [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) typically generate a price report every + second for popular indices like SPX. + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + interval (IndexHistoryOhlcInterval): Default: IndexHistoryOhlcInterval.VALUE_4. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + format_ (Unset | IndexHistoryOhlcFormat): Default: IndexHistoryOhlcFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[IndexHistoryOhlcResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +start_date=start_date, +end_date=end_date, +interval=interval, +start_time=start_time, +end_time=end_time, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + interval: IndexHistoryOhlcInterval = IndexHistoryOhlcInterval.VALUE_4, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + format_: Unset | IndexHistoryOhlcFormat = IndexHistoryOhlcFormat.NDJSON, + +) -> IndexHistoryOhlcResponse200 | None: + """ Open High Low Close + + - Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. + - Time timestamp of the bar represents the opening time of the bar. For a trade to be part of the + bar: ``bar timestamp`` <= ``trade time`` < ``bar timestamp + interval``. + - [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) typically generate a price report every + second for popular indices like SPX. + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + interval (IndexHistoryOhlcInterval): Default: IndexHistoryOhlcInterval.VALUE_4. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + format_ (Unset | IndexHistoryOhlcFormat): Default: IndexHistoryOhlcFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + IndexHistoryOhlcResponse200 + """ + + + return (await asyncio_detailed( + client=client, +symbol=symbol, +start_date=start_date, +end_date=end_date, +interval=interval, +start_time=start_time, +end_time=end_time, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/index/index_history_price.py b/openapi_project/openapi_package/api/index/index_history_price.py new file mode 100644 index 000000000..691935411 --- /dev/null +++ b/openapi_project/openapi_package/api/index/index_history_price.py @@ -0,0 +1,292 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.index_history_price_format import IndexHistoryPriceFormat +from openapi_project.openapi_package.models.index_history_price_interval import IndexHistoryPriceInterval +from openapi_project.openapi_package.models.index_history_price_response_200 import IndexHistoryPriceResponse200 +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + date: datetime.date, + symbol: str, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: IndexHistoryPriceInterval = IndexHistoryPriceInterval.VALUE_4, + format_: Unset | IndexHistoryPriceFormat = IndexHistoryPriceFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_date = date.isoformat() + params["date"] = json_date + + params["symbol"] = symbol + + params["start_time"] = start_time + + params["end_time"] = end_time + + json_interval = interval.value + params["interval"] = json_interval + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/index/history/price", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IndexHistoryPriceResponse200 | None: + if response.status_code == 200: + response_200 = IndexHistoryPriceResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[IndexHistoryPriceResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: IndexHistoryPriceInterval = IndexHistoryPriceInterval.VALUE_4, + format_: Unset | IndexHistoryPriceFormat = IndexHistoryPriceFormat.NDJSON, + +) -> Response[IndexHistoryPriceResponse200]: + """ Price + + - Retrieves historical indices price reports. [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) + typically generate a price report every second for popular indices like SPX. + - When the ``interval`` parameter is specified, the returned data represents the price at the exact + time of each timestamp. If the timestamp in the response is 10:30:00, the price field represents the + price at that exact time of the day. + - A price update from the exchange is omitted if the price remained the same from the previous + update. + + Args: + date (datetime.date): + symbol (str): + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + interval (IndexHistoryPriceInterval): Default: IndexHistoryPriceInterval.VALUE_4. + format_ (Unset | IndexHistoryPriceFormat): Default: IndexHistoryPriceFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[IndexHistoryPriceResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +start_time=start_time, +end_time=end_time, +interval=interval, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: IndexHistoryPriceInterval = IndexHistoryPriceInterval.VALUE_4, + format_: Unset | IndexHistoryPriceFormat = IndexHistoryPriceFormat.NDJSON, + +) -> IndexHistoryPriceResponse200 | None: + """ Price + + - Retrieves historical indices price reports. [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) + typically generate a price report every second for popular indices like SPX. + - When the ``interval`` parameter is specified, the returned data represents the price at the exact + time of each timestamp. If the timestamp in the response is 10:30:00, the price field represents the + price at that exact time of the day. + - A price update from the exchange is omitted if the price remained the same from the previous + update. + + Args: + date (datetime.date): + symbol (str): + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + interval (IndexHistoryPriceInterval): Default: IndexHistoryPriceInterval.VALUE_4. + format_ (Unset | IndexHistoryPriceFormat): Default: IndexHistoryPriceFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + IndexHistoryPriceResponse200 + """ + + + return sync_detailed( + client=client, +date=date, +symbol=symbol, +start_time=start_time, +end_time=end_time, +interval=interval, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: IndexHistoryPriceInterval = IndexHistoryPriceInterval.VALUE_4, + format_: Unset | IndexHistoryPriceFormat = IndexHistoryPriceFormat.NDJSON, + +) -> Response[IndexHistoryPriceResponse200]: + """ Price + + - Retrieves historical indices price reports. [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) + typically generate a price report every second for popular indices like SPX. + - When the ``interval`` parameter is specified, the returned data represents the price at the exact + time of each timestamp. If the timestamp in the response is 10:30:00, the price field represents the + price at that exact time of the day. + - A price update from the exchange is omitted if the price remained the same from the previous + update. + + Args: + date (datetime.date): + symbol (str): + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + interval (IndexHistoryPriceInterval): Default: IndexHistoryPriceInterval.VALUE_4. + format_ (Unset | IndexHistoryPriceFormat): Default: IndexHistoryPriceFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[IndexHistoryPriceResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +start_time=start_time, +end_time=end_time, +interval=interval, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: IndexHistoryPriceInterval = IndexHistoryPriceInterval.VALUE_4, + format_: Unset | IndexHistoryPriceFormat = IndexHistoryPriceFormat.NDJSON, + +) -> IndexHistoryPriceResponse200 | None: + """ Price + + - Retrieves historical indices price reports. [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) + typically generate a price report every second for popular indices like SPX. + - When the ``interval`` parameter is specified, the returned data represents the price at the exact + time of each timestamp. If the timestamp in the response is 10:30:00, the price field represents the + price at that exact time of the day. + - A price update from the exchange is omitted if the price remained the same from the previous + update. + + Args: + date (datetime.date): + symbol (str): + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + interval (IndexHistoryPriceInterval): Default: IndexHistoryPriceInterval.VALUE_4. + format_ (Unset | IndexHistoryPriceFormat): Default: IndexHistoryPriceFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + IndexHistoryPriceResponse200 + """ + + + return (await asyncio_detailed( + client=client, +date=date, +symbol=symbol, +start_time=start_time, +end_time=end_time, +interval=interval, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/index/index_list_dates.py b/openapi_project/openapi_package/api/index/index_list_dates.py new file mode 100644 index 000000000..7db666853 --- /dev/null +++ b/openapi_project/openapi_package/api/index/index_list_dates.py @@ -0,0 +1,210 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.index_list_dates_format import IndexListDatesFormat +from openapi_project.openapi_package.models.index_list_dates_response_200 import IndexListDatesResponse200 +from openapi_project.openapi_package.types import UNSET, Unset +from typing import cast + + + +def _get_kwargs( + *, + symbol: list[str], + format_: Unset | IndexListDatesFormat = IndexListDatesFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_symbol = symbol + + + params["symbol"] = json_symbol + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/index/list/dates", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IndexListDatesResponse200 | None: + if response.status_code == 200: + response_200 = IndexListDatesResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[IndexListDatesResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + format_: Unset | IndexListDatesFormat = IndexListDatesFormat.NDJSON, + +) -> Response[IndexListDatesResponse200]: + """ Dates + + Lists all dates of data that are available for a index with a given request type and symbol. This + endpoint is updated overnight. + + Args: + symbol (list[str]): + format_ (Unset | IndexListDatesFormat): Default: IndexListDatesFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[IndexListDatesResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + format_: Unset | IndexListDatesFormat = IndexListDatesFormat.NDJSON, + +) -> IndexListDatesResponse200 | None: + """ Dates + + Lists all dates of data that are available for a index with a given request type and symbol. This + endpoint is updated overnight. + + Args: + symbol (list[str]): + format_ (Unset | IndexListDatesFormat): Default: IndexListDatesFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + IndexListDatesResponse200 + """ + + + return sync_detailed( + client=client, +symbol=symbol, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + format_: Unset | IndexListDatesFormat = IndexListDatesFormat.NDJSON, + +) -> Response[IndexListDatesResponse200]: + """ Dates + + Lists all dates of data that are available for a index with a given request type and symbol. This + endpoint is updated overnight. + + Args: + symbol (list[str]): + format_ (Unset | IndexListDatesFormat): Default: IndexListDatesFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[IndexListDatesResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + format_: Unset | IndexListDatesFormat = IndexListDatesFormat.NDJSON, + +) -> IndexListDatesResponse200 | None: + """ Dates + + Lists all dates of data that are available for a index with a given request type and symbol. This + endpoint is updated overnight. + + Args: + symbol (list[str]): + format_ (Unset | IndexListDatesFormat): Default: IndexListDatesFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + IndexListDatesResponse200 + """ + + + return (await asyncio_detailed( + client=client, +symbol=symbol, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/index/index_list_symbols.py b/openapi_project/openapi_package/api/index/index_list_symbols.py new file mode 100644 index 000000000..aaef70cf5 --- /dev/null +++ b/openapi_project/openapi_package/api/index/index_list_symbols.py @@ -0,0 +1,196 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.index_list_symbols_format import IndexListSymbolsFormat +from openapi_project.openapi_package.models.index_list_symbols_response_200 import IndexListSymbolsResponse200 +from openapi_project.openapi_package.types import UNSET, Unset +from typing import cast + + + +def _get_kwargs( + *, + format_: Unset | IndexListSymbolsFormat = IndexListSymbolsFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/index/list/symbols", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IndexListSymbolsResponse200 | None: + if response.status_code == 200: + response_200 = IndexListSymbolsResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[IndexListSymbolsResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + format_: Unset | IndexListSymbolsFormat = IndexListSymbolsFormat.NDJSON, + +) -> Response[IndexListSymbolsResponse200]: + """ Symbols + + A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also + include: root, ticker, and underlying. This endpoint returns all traded symbols for options. This + endpoint is updated overnight. + + Args: + format_ (Unset | IndexListSymbolsFormat): Default: IndexListSymbolsFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[IndexListSymbolsResponse200] + """ + + + kwargs = _get_kwargs( + format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + format_: Unset | IndexListSymbolsFormat = IndexListSymbolsFormat.NDJSON, + +) -> IndexListSymbolsResponse200 | None: + """ Symbols + + A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also + include: root, ticker, and underlying. This endpoint returns all traded symbols for options. This + endpoint is updated overnight. + + Args: + format_ (Unset | IndexListSymbolsFormat): Default: IndexListSymbolsFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + IndexListSymbolsResponse200 + """ + + + return sync_detailed( + client=client, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + format_: Unset | IndexListSymbolsFormat = IndexListSymbolsFormat.NDJSON, + +) -> Response[IndexListSymbolsResponse200]: + """ Symbols + + A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also + include: root, ticker, and underlying. This endpoint returns all traded symbols for options. This + endpoint is updated overnight. + + Args: + format_ (Unset | IndexListSymbolsFormat): Default: IndexListSymbolsFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[IndexListSymbolsResponse200] + """ + + + kwargs = _get_kwargs( + format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + format_: Unset | IndexListSymbolsFormat = IndexListSymbolsFormat.NDJSON, + +) -> IndexListSymbolsResponse200 | None: + """ Symbols + + A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also + include: root, ticker, and underlying. This endpoint returns all traded symbols for options. This + endpoint is updated overnight. + + Args: + format_ (Unset | IndexListSymbolsFormat): Default: IndexListSymbolsFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + IndexListSymbolsResponse200 + """ + + + return (await asyncio_detailed( + client=client, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/index/index_snapshot_ohlc.py b/openapi_project/openapi_package/api/index/index_snapshot_ohlc.py new file mode 100644 index 000000000..6a58a68ab --- /dev/null +++ b/openapi_project/openapi_package/api/index/index_snapshot_ohlc.py @@ -0,0 +1,214 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.index_snapshot_ohlc_format import IndexSnapshotOhlcFormat +from openapi_project.openapi_package.models.index_snapshot_ohlc_response_200 import IndexSnapshotOhlcResponse200 +from openapi_project.openapi_package.types import UNSET, Unset +from typing import cast + + + +def _get_kwargs( + *, + symbol: list[str], + format_: Unset | IndexSnapshotOhlcFormat = IndexSnapshotOhlcFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_symbol = symbol + + + params["symbol"] = json_symbol + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/index/snapshot/ohlc", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IndexSnapshotOhlcResponse200 | None: + if response.status_code == 200: + response_200 = IndexSnapshotOhlcResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[IndexSnapshotOhlcResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + format_: Unset | IndexSnapshotOhlcFormat = IndexSnapshotOhlcFormat.NDJSON, + +) -> Response[IndexSnapshotOhlcResponse200]: + """ Open High Low Close + + - Retrieves the real-time current day OHLC. + - [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) typically generate a price report every + second for popular indices like SPX. + + Args: + symbol (list[str]): + format_ (Unset | IndexSnapshotOhlcFormat): Default: IndexSnapshotOhlcFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[IndexSnapshotOhlcResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + format_: Unset | IndexSnapshotOhlcFormat = IndexSnapshotOhlcFormat.NDJSON, + +) -> IndexSnapshotOhlcResponse200 | None: + """ Open High Low Close + + - Retrieves the real-time current day OHLC. + - [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) typically generate a price report every + second for popular indices like SPX. + + Args: + symbol (list[str]): + format_ (Unset | IndexSnapshotOhlcFormat): Default: IndexSnapshotOhlcFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + IndexSnapshotOhlcResponse200 + """ + + + return sync_detailed( + client=client, +symbol=symbol, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + format_: Unset | IndexSnapshotOhlcFormat = IndexSnapshotOhlcFormat.NDJSON, + +) -> Response[IndexSnapshotOhlcResponse200]: + """ Open High Low Close + + - Retrieves the real-time current day OHLC. + - [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) typically generate a price report every + second for popular indices like SPX. + + Args: + symbol (list[str]): + format_ (Unset | IndexSnapshotOhlcFormat): Default: IndexSnapshotOhlcFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[IndexSnapshotOhlcResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + format_: Unset | IndexSnapshotOhlcFormat = IndexSnapshotOhlcFormat.NDJSON, + +) -> IndexSnapshotOhlcResponse200 | None: + """ Open High Low Close + + - Retrieves the real-time current day OHLC. + - [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) typically generate a price report every + second for popular indices like SPX. + + Args: + symbol (list[str]): + format_ (Unset | IndexSnapshotOhlcFormat): Default: IndexSnapshotOhlcFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + IndexSnapshotOhlcResponse200 + """ + + + return (await asyncio_detailed( + client=client, +symbol=symbol, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/index/index_snapshot_price.py b/openapi_project/openapi_package/api/index/index_snapshot_price.py new file mode 100644 index 000000000..620f9c67e --- /dev/null +++ b/openapi_project/openapi_package/api/index/index_snapshot_price.py @@ -0,0 +1,214 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.index_snapshot_price_format import IndexSnapshotPriceFormat +from openapi_project.openapi_package.models.index_snapshot_price_response_200 import IndexSnapshotPriceResponse200 +from openapi_project.openapi_package.types import UNSET, Unset +from typing import cast + + + +def _get_kwargs( + *, + symbol: list[str], + format_: Unset | IndexSnapshotPriceFormat = IndexSnapshotPriceFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_symbol = symbol + + + params["symbol"] = json_symbol + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/index/snapshot/price", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IndexSnapshotPriceResponse200 | None: + if response.status_code == 200: + response_200 = IndexSnapshotPriceResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[IndexSnapshotPriceResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + format_: Unset | IndexSnapshotPriceFormat = IndexSnapshotPriceFormat.NDJSON, + +) -> Response[IndexSnapshotPriceResponse200]: + """ Price + + - Retrieves a real-time last index price. + - [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) typically generate a price report every + second for popular indices like SPX. + + Args: + symbol (list[str]): + format_ (Unset | IndexSnapshotPriceFormat): Default: IndexSnapshotPriceFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[IndexSnapshotPriceResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + format_: Unset | IndexSnapshotPriceFormat = IndexSnapshotPriceFormat.NDJSON, + +) -> IndexSnapshotPriceResponse200 | None: + """ Price + + - Retrieves a real-time last index price. + - [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) typically generate a price report every + second for popular indices like SPX. + + Args: + symbol (list[str]): + format_ (Unset | IndexSnapshotPriceFormat): Default: IndexSnapshotPriceFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + IndexSnapshotPriceResponse200 + """ + + + return sync_detailed( + client=client, +symbol=symbol, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + format_: Unset | IndexSnapshotPriceFormat = IndexSnapshotPriceFormat.NDJSON, + +) -> Response[IndexSnapshotPriceResponse200]: + """ Price + + - Retrieves a real-time last index price. + - [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) typically generate a price report every + second for popular indices like SPX. + + Args: + symbol (list[str]): + format_ (Unset | IndexSnapshotPriceFormat): Default: IndexSnapshotPriceFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[IndexSnapshotPriceResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + format_: Unset | IndexSnapshotPriceFormat = IndexSnapshotPriceFormat.NDJSON, + +) -> IndexSnapshotPriceResponse200 | None: + """ Price + + - Retrieves a real-time last index price. + - [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) typically generate a price report every + second for popular indices like SPX. + + Args: + symbol (list[str]): + format_ (Unset | IndexSnapshotPriceFormat): Default: IndexSnapshotPriceFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + IndexSnapshotPriceResponse200 + """ + + + return (await asyncio_detailed( + client=client, +symbol=symbol, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/__init__.py b/openapi_project/openapi_package/api/option/__init__.py new file mode 100644 index 000000000..03e86a6af --- /dev/null +++ b/openapi_project/openapi_package/api/option/__init__.py @@ -0,0 +1 @@ +""" Contains endpoint functions for accessing the API """ diff --git a/openapi_project/openapi_package/api/option/option_at_time_quote.py b/openapi_project/openapi_package/api/option/option_at_time_quote.py new file mode 100644 index 000000000..1bc767b2b --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_at_time_quote.py @@ -0,0 +1,309 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_at_time_quote_format import OptionAtTimeQuoteFormat +from openapi_project.openapi_package.models.option_at_time_quote_response_200 import OptionAtTimeQuoteResponse200 +from openapi_project.openapi_package.models.option_at_time_quote_right import OptionAtTimeQuoteRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + time_of_day: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionAtTimeQuoteRight = OptionAtTimeQuoteRight.BOTH, + format_: Unset | OptionAtTimeQuoteFormat = OptionAtTimeQuoteFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["symbol"] = symbol + + json_start_date = start_date.isoformat() + params["start_date"] = json_start_date + + json_end_date = end_date.isoformat() + params["end_date"] = json_end_date + + params["time_of_day"] = time_of_day + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/at_time/quote", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionAtTimeQuoteResponse200 | None: + if response.status_code == 200: + response_200 = OptionAtTimeQuoteResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionAtTimeQuoteResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + time_of_day: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionAtTimeQuoteRight = OptionAtTimeQuoteRight.BOTH, + format_: Unset | OptionAtTimeQuoteFormat = OptionAtTimeQuoteFormat.NDJSON, + +) -> Response[OptionAtTimeQuoteResponse200]: + """ Quote + + - Returns the last NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) at a + specified millisecond of the day. + - The ``time_of_day``parameter represents the 00:00:00.000 ET that the quote should be provided for. + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + time_of_day (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionAtTimeQuoteRight): Default: OptionAtTimeQuoteRight.BOTH. + format_ (Unset | OptionAtTimeQuoteFormat): Default: OptionAtTimeQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionAtTimeQuoteResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +start_date=start_date, +end_date=end_date, +time_of_day=time_of_day, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + time_of_day: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionAtTimeQuoteRight = OptionAtTimeQuoteRight.BOTH, + format_: Unset | OptionAtTimeQuoteFormat = OptionAtTimeQuoteFormat.NDJSON, + +) -> OptionAtTimeQuoteResponse200 | None: + """ Quote + + - Returns the last NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) at a + specified millisecond of the day. + - The ``time_of_day``parameter represents the 00:00:00.000 ET that the quote should be provided for. + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + time_of_day (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionAtTimeQuoteRight): Default: OptionAtTimeQuoteRight.BOTH. + format_ (Unset | OptionAtTimeQuoteFormat): Default: OptionAtTimeQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionAtTimeQuoteResponse200 + """ + + + return sync_detailed( + client=client, +symbol=symbol, +start_date=start_date, +end_date=end_date, +time_of_day=time_of_day, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + time_of_day: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionAtTimeQuoteRight = OptionAtTimeQuoteRight.BOTH, + format_: Unset | OptionAtTimeQuoteFormat = OptionAtTimeQuoteFormat.NDJSON, + +) -> Response[OptionAtTimeQuoteResponse200]: + """ Quote + + - Returns the last NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) at a + specified millisecond of the day. + - The ``time_of_day``parameter represents the 00:00:00.000 ET that the quote should be provided for. + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + time_of_day (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionAtTimeQuoteRight): Default: OptionAtTimeQuoteRight.BOTH. + format_ (Unset | OptionAtTimeQuoteFormat): Default: OptionAtTimeQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionAtTimeQuoteResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +start_date=start_date, +end_date=end_date, +time_of_day=time_of_day, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + time_of_day: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionAtTimeQuoteRight = OptionAtTimeQuoteRight.BOTH, + format_: Unset | OptionAtTimeQuoteFormat = OptionAtTimeQuoteFormat.NDJSON, + +) -> OptionAtTimeQuoteResponse200 | None: + """ Quote + + - Returns the last NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) at a + specified millisecond of the day. + - The ``time_of_day``parameter represents the 00:00:00.000 ET that the quote should be provided for. + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + time_of_day (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionAtTimeQuoteRight): Default: OptionAtTimeQuoteRight.BOTH. + format_ (Unset | OptionAtTimeQuoteFormat): Default: OptionAtTimeQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionAtTimeQuoteResponse200 + """ + + + return (await asyncio_detailed( + client=client, +symbol=symbol, +start_date=start_date, +end_date=end_date, +time_of_day=time_of_day, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_at_time_trade.py b/openapi_project/openapi_package/api/option/option_at_time_trade.py new file mode 100644 index 000000000..773cb6b39 --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_at_time_trade.py @@ -0,0 +1,325 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_at_time_trade_format import OptionAtTimeTradeFormat +from openapi_project.openapi_package.models.option_at_time_trade_response_200 import OptionAtTimeTradeResponse200 +from openapi_project.openapi_package.models.option_at_time_trade_right import OptionAtTimeTradeRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + time_of_day: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionAtTimeTradeRight = OptionAtTimeTradeRight.BOTH, + format_: Unset | OptionAtTimeTradeFormat = OptionAtTimeTradeFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["symbol"] = symbol + + json_start_date = start_date.isoformat() + params["start_date"] = json_start_date + + json_end_date = end_date.isoformat() + params["end_date"] = json_end_date + + params["time_of_day"] = time_of_day + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/at_time/trade", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionAtTimeTradeResponse200 | None: + if response.status_code == 200: + response_200 = OptionAtTimeTradeResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionAtTimeTradeResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + time_of_day: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionAtTimeTradeRight = OptionAtTimeTradeRight.BOTH, + format_: Unset | OptionAtTimeTradeFormat = OptionAtTimeTradeFormat.NDJSON, + +) -> Response[OptionAtTimeTradeResponse200]: + """ Trade + + - Returns the last trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) at a + specified millisecond of the day. + - Trade condition mappings can be found [here](/Articles/Errors-Exchanges-Conditions/Trade- + Conditions.html). + - Extended trade conditions are not reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) + for options, so they can be ignored. + - The ``time_of_day``parameter represents the 00:00:00.000 ET that the trade should be provided for. + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + time_of_day (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionAtTimeTradeRight): Default: OptionAtTimeTradeRight.BOTH. + format_ (Unset | OptionAtTimeTradeFormat): Default: OptionAtTimeTradeFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionAtTimeTradeResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +start_date=start_date, +end_date=end_date, +time_of_day=time_of_day, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + time_of_day: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionAtTimeTradeRight = OptionAtTimeTradeRight.BOTH, + format_: Unset | OptionAtTimeTradeFormat = OptionAtTimeTradeFormat.NDJSON, + +) -> OptionAtTimeTradeResponse200 | None: + """ Trade + + - Returns the last trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) at a + specified millisecond of the day. + - Trade condition mappings can be found [here](/Articles/Errors-Exchanges-Conditions/Trade- + Conditions.html). + - Extended trade conditions are not reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) + for options, so they can be ignored. + - The ``time_of_day``parameter represents the 00:00:00.000 ET that the trade should be provided for. + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + time_of_day (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionAtTimeTradeRight): Default: OptionAtTimeTradeRight.BOTH. + format_ (Unset | OptionAtTimeTradeFormat): Default: OptionAtTimeTradeFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionAtTimeTradeResponse200 + """ + + + return sync_detailed( + client=client, +symbol=symbol, +start_date=start_date, +end_date=end_date, +time_of_day=time_of_day, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + time_of_day: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionAtTimeTradeRight = OptionAtTimeTradeRight.BOTH, + format_: Unset | OptionAtTimeTradeFormat = OptionAtTimeTradeFormat.NDJSON, + +) -> Response[OptionAtTimeTradeResponse200]: + """ Trade + + - Returns the last trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) at a + specified millisecond of the day. + - Trade condition mappings can be found [here](/Articles/Errors-Exchanges-Conditions/Trade- + Conditions.html). + - Extended trade conditions are not reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) + for options, so they can be ignored. + - The ``time_of_day``parameter represents the 00:00:00.000 ET that the trade should be provided for. + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + time_of_day (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionAtTimeTradeRight): Default: OptionAtTimeTradeRight.BOTH. + format_ (Unset | OptionAtTimeTradeFormat): Default: OptionAtTimeTradeFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionAtTimeTradeResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +start_date=start_date, +end_date=end_date, +time_of_day=time_of_day, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + time_of_day: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionAtTimeTradeRight = OptionAtTimeTradeRight.BOTH, + format_: Unset | OptionAtTimeTradeFormat = OptionAtTimeTradeFormat.NDJSON, + +) -> OptionAtTimeTradeResponse200 | None: + """ Trade + + - Returns the last trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) at a + specified millisecond of the day. + - Trade condition mappings can be found [here](/Articles/Errors-Exchanges-Conditions/Trade- + Conditions.html). + - Extended trade conditions are not reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) + for options, so they can be ignored. + - The ``time_of_day``parameter represents the 00:00:00.000 ET that the trade should be provided for. + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + time_of_day (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionAtTimeTradeRight): Default: OptionAtTimeTradeRight.BOTH. + format_ (Unset | OptionAtTimeTradeFormat): Default: OptionAtTimeTradeFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionAtTimeTradeResponse200 + """ + + + return (await asyncio_detailed( + client=client, +symbol=symbol, +start_date=start_date, +end_date=end_date, +time_of_day=time_of_day, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_history_eod.py b/openapi_project/openapi_package/api/option/option_history_eod.py new file mode 100644 index 000000000..1aa4a5912 --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_history_eod.py @@ -0,0 +1,318 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_history_eod_format import OptionHistoryEodFormat +from openapi_project.openapi_package.models.option_history_eod_response_200 import OptionHistoryEodResponse200 +from openapi_project.openapi_package.models.option_history_eod_right import OptionHistoryEodRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + start_date: datetime.date, + end_date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryEodRight = OptionHistoryEodRight.BOTH, + format_: Unset | OptionHistoryEodFormat = OptionHistoryEodFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_start_date = start_date.isoformat() + params["start_date"] = json_start_date + + json_end_date = end_date.isoformat() + params["end_date"] = json_end_date + + params["symbol"] = symbol + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/history/eod", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryEodResponse200 | None: + if response.status_code == 200: + response_200 = OptionHistoryEodResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryEodResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + start_date: datetime.date, + end_date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryEodRight = OptionHistoryEodRight.BOTH, + format_: Unset | OptionHistoryEodFormat = OptionHistoryEodFormat.NDJSON, + +) -> Response[OptionHistoryEodResponse200]: + """ End of Day + + - Since [OPRA](/Articles/Data-And-Requests/The-SIPs.html) does not provide a national EOD report for + options, Thetadata generates a national EOD report at 17:15 ET each day. + - ``created`` represents the datetime the report was generated and ``last_trade`` represents the + datetime of the last trade. + - The quote in the response represents the last NBBO reported by OPRA at the time of report + generation. + - You can read more about EOD & OHLC data [here](/Articles/Data-And-Requests/OHLC-EOD.html). + > The quote fields (bid / ask info) may not be available prior to 2023-12-01. We will expose further + history for the EOD quote in the near future. + + Args: + start_date (datetime.date): + end_date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryEodRight): Default: OptionHistoryEodRight.BOTH. + format_ (Unset | OptionHistoryEodFormat): Default: OptionHistoryEodFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryEodResponse200] + """ + + + kwargs = _get_kwargs( + start_date=start_date, +end_date=end_date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + start_date: datetime.date, + end_date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryEodRight = OptionHistoryEodRight.BOTH, + format_: Unset | OptionHistoryEodFormat = OptionHistoryEodFormat.NDJSON, + +) -> OptionHistoryEodResponse200 | None: + """ End of Day + + - Since [OPRA](/Articles/Data-And-Requests/The-SIPs.html) does not provide a national EOD report for + options, Thetadata generates a national EOD report at 17:15 ET each day. + - ``created`` represents the datetime the report was generated and ``last_trade`` represents the + datetime of the last trade. + - The quote in the response represents the last NBBO reported by OPRA at the time of report + generation. + - You can read more about EOD & OHLC data [here](/Articles/Data-And-Requests/OHLC-EOD.html). + > The quote fields (bid / ask info) may not be available prior to 2023-12-01. We will expose further + history for the EOD quote in the near future. + + Args: + start_date (datetime.date): + end_date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryEodRight): Default: OptionHistoryEodRight.BOTH. + format_ (Unset | OptionHistoryEodFormat): Default: OptionHistoryEodFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryEodResponse200 + """ + + + return sync_detailed( + client=client, +start_date=start_date, +end_date=end_date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + start_date: datetime.date, + end_date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryEodRight = OptionHistoryEodRight.BOTH, + format_: Unset | OptionHistoryEodFormat = OptionHistoryEodFormat.NDJSON, + +) -> Response[OptionHistoryEodResponse200]: + """ End of Day + + - Since [OPRA](/Articles/Data-And-Requests/The-SIPs.html) does not provide a national EOD report for + options, Thetadata generates a national EOD report at 17:15 ET each day. + - ``created`` represents the datetime the report was generated and ``last_trade`` represents the + datetime of the last trade. + - The quote in the response represents the last NBBO reported by OPRA at the time of report + generation. + - You can read more about EOD & OHLC data [here](/Articles/Data-And-Requests/OHLC-EOD.html). + > The quote fields (bid / ask info) may not be available prior to 2023-12-01. We will expose further + history for the EOD quote in the near future. + + Args: + start_date (datetime.date): + end_date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryEodRight): Default: OptionHistoryEodRight.BOTH. + format_ (Unset | OptionHistoryEodFormat): Default: OptionHistoryEodFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryEodResponse200] + """ + + + kwargs = _get_kwargs( + start_date=start_date, +end_date=end_date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + start_date: datetime.date, + end_date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryEodRight = OptionHistoryEodRight.BOTH, + format_: Unset | OptionHistoryEodFormat = OptionHistoryEodFormat.NDJSON, + +) -> OptionHistoryEodResponse200 | None: + """ End of Day + + - Since [OPRA](/Articles/Data-And-Requests/The-SIPs.html) does not provide a national EOD report for + options, Thetadata generates a national EOD report at 17:15 ET each day. + - ``created`` represents the datetime the report was generated and ``last_trade`` represents the + datetime of the last trade. + - The quote in the response represents the last NBBO reported by OPRA at the time of report + generation. + - You can read more about EOD & OHLC data [here](/Articles/Data-And-Requests/OHLC-EOD.html). + > The quote fields (bid / ask info) may not be available prior to 2023-12-01. We will expose further + history for the EOD quote in the near future. + + Args: + start_date (datetime.date): + end_date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryEodRight): Default: OptionHistoryEodRight.BOTH. + format_ (Unset | OptionHistoryEodFormat): Default: OptionHistoryEodFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryEodResponse200 + """ + + + return (await asyncio_detailed( + client=client, +start_date=start_date, +end_date=end_date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_history_greeks_all.py b/openapi_project/openapi_package/api/option/option_history_greeks_all.py new file mode 100644 index 000000000..47eac34b3 --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_history_greeks_all.py @@ -0,0 +1,401 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_history_greeks_all_format import OptionHistoryGreeksAllFormat +from openapi_project.openapi_package.models.option_history_greeks_all_interval import OptionHistoryGreeksAllInterval +from openapi_project.openapi_package.models.option_history_greeks_all_rate_type import OptionHistoryGreeksAllRateType +from openapi_project.openapi_package.models.option_history_greeks_all_response_200 import OptionHistoryGreeksAllResponse200 +from openapi_project.openapi_package.models.option_history_greeks_all_right import OptionHistoryGreeksAllRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksAllRight = OptionHistoryGreeksAllRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryGreeksAllInterval = OptionHistoryGreeksAllInterval.VALUE_4, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksAllRateType = OptionHistoryGreeksAllRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksAllFormat = OptionHistoryGreeksAllFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_date = date.isoformat() + params["date"] = json_date + + params["symbol"] = symbol + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + params["start_time"] = start_time + + params["end_time"] = end_time + + json_interval = interval.value + params["interval"] = json_interval + + params["annual_dividend"] = annual_dividend + + json_rate_type: Unset | str = UNSET if isinstance(rate_type, Unset) else rate_type.value + + params["rate_type"] = json_rate_type + + params["rate_value"] = rate_value + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/history/greeks/all", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryGreeksAllResponse200 | None: + if response.status_code == 200: + response_200 = OptionHistoryGreeksAllResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryGreeksAllResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksAllRight = OptionHistoryGreeksAllRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryGreeksAllInterval = OptionHistoryGreeksAllInterval.VALUE_4, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksAllRateType = OptionHistoryGreeksAllRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksAllFormat = OptionHistoryGreeksAllFormat.NDJSON, + +) -> Response[OptionHistoryGreeksAllResponse200]: + """ All Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculated using the option and underlying midpoint price. If an interval size is specified + (*highly recommended*), the option quote used in the calculation follows the same rules as the + [quote](/operations/option_history_quote.html) endpoint. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryGreeksAllRight): Default: OptionHistoryGreeksAllRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + interval (OptionHistoryGreeksAllInterval): Default: + OptionHistoryGreeksAllInterval.VALUE_4. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryGreeksAllRateType): Default: + OptionHistoryGreeksAllRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryGreeksAllFormat): Default: + OptionHistoryGreeksAllFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryGreeksAllResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +interval=interval, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksAllRight = OptionHistoryGreeksAllRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryGreeksAllInterval = OptionHistoryGreeksAllInterval.VALUE_4, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksAllRateType = OptionHistoryGreeksAllRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksAllFormat = OptionHistoryGreeksAllFormat.NDJSON, + +) -> OptionHistoryGreeksAllResponse200 | None: + """ All Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculated using the option and underlying midpoint price. If an interval size is specified + (*highly recommended*), the option quote used in the calculation follows the same rules as the + [quote](/operations/option_history_quote.html) endpoint. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryGreeksAllRight): Default: OptionHistoryGreeksAllRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + interval (OptionHistoryGreeksAllInterval): Default: + OptionHistoryGreeksAllInterval.VALUE_4. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryGreeksAllRateType): Default: + OptionHistoryGreeksAllRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryGreeksAllFormat): Default: + OptionHistoryGreeksAllFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryGreeksAllResponse200 + """ + + + return sync_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +interval=interval, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksAllRight = OptionHistoryGreeksAllRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryGreeksAllInterval = OptionHistoryGreeksAllInterval.VALUE_4, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksAllRateType = OptionHistoryGreeksAllRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksAllFormat = OptionHistoryGreeksAllFormat.NDJSON, + +) -> Response[OptionHistoryGreeksAllResponse200]: + """ All Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculated using the option and underlying midpoint price. If an interval size is specified + (*highly recommended*), the option quote used in the calculation follows the same rules as the + [quote](/operations/option_history_quote.html) endpoint. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryGreeksAllRight): Default: OptionHistoryGreeksAllRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + interval (OptionHistoryGreeksAllInterval): Default: + OptionHistoryGreeksAllInterval.VALUE_4. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryGreeksAllRateType): Default: + OptionHistoryGreeksAllRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryGreeksAllFormat): Default: + OptionHistoryGreeksAllFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryGreeksAllResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +interval=interval, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksAllRight = OptionHistoryGreeksAllRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryGreeksAllInterval = OptionHistoryGreeksAllInterval.VALUE_4, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksAllRateType = OptionHistoryGreeksAllRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksAllFormat = OptionHistoryGreeksAllFormat.NDJSON, + +) -> OptionHistoryGreeksAllResponse200 | None: + """ All Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculated using the option and underlying midpoint price. If an interval size is specified + (*highly recommended*), the option quote used in the calculation follows the same rules as the + [quote](/operations/option_history_quote.html) endpoint. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryGreeksAllRight): Default: OptionHistoryGreeksAllRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + interval (OptionHistoryGreeksAllInterval): Default: + OptionHistoryGreeksAllInterval.VALUE_4. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryGreeksAllRateType): Default: + OptionHistoryGreeksAllRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryGreeksAllFormat): Default: + OptionHistoryGreeksAllFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryGreeksAllResponse200 + """ + + + return (await asyncio_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +interval=interval, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_history_greeks_eod.py b/openapi_project/openapi_package/api/option/option_history_greeks_eod.py new file mode 100644 index 000000000..98144ba85 --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_history_greeks_eod.py @@ -0,0 +1,370 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_history_greeks_eod_format import OptionHistoryGreeksEodFormat +from openapi_project.openapi_package.models.option_history_greeks_eod_rate_type import OptionHistoryGreeksEodRateType +from openapi_project.openapi_package.models.option_history_greeks_eod_response_200 import OptionHistoryGreeksEodResponse200 +from openapi_project.openapi_package.models.option_history_greeks_eod_right import OptionHistoryGreeksEodRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksEodRight = OptionHistoryGreeksEodRight.BOTH, + start_date: datetime.date, + end_date: datetime.date, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksEodRateType = OptionHistoryGreeksEodRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksEodFormat = OptionHistoryGreeksEodFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["symbol"] = symbol + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + json_start_date = start_date.isoformat() + params["start_date"] = json_start_date + + json_end_date = end_date.isoformat() + params["end_date"] = json_end_date + + params["annual_dividend"] = annual_dividend + + json_rate_type: Unset | str = UNSET if isinstance(rate_type, Unset) else rate_type.value + + params["rate_type"] = json_rate_type + + params["rate_value"] = rate_value + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/history/greeks/eod", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryGreeksEodResponse200 | None: + if response.status_code == 200: + response_200 = OptionHistoryGreeksEodResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryGreeksEodResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksEodRight = OptionHistoryGreeksEodRight.BOTH, + start_date: datetime.date, + end_date: datetime.date, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksEodRateType = OptionHistoryGreeksEodRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksEodFormat = OptionHistoryGreeksEodFormat.NDJSON, + +) -> Response[OptionHistoryGreeksEodResponse200]: + """ End of Day Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Uses Theta Data's EOD reports that get generated at 17:15 ET each day. The closing option price + and closing underlying price are used for the greeks calculation. + - **Set `expiration` to ``*`` if you want to retrieve data for every option that shares the same + ``symbol``. (note: Any ``expiration=*`` must be requested day by day)** + > The quote fields (bid / ask info) may not be available prior to 2023-12-01. We are working to + expose this over the coming months. Obtaining the quote at the end of the day requires much more + processing than the trades, so we initially generated our history for trades. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryGreeksEodRight): Default: OptionHistoryGreeksEodRight.BOTH. + start_date (datetime.date): + end_date (datetime.date): + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryGreeksEodRateType): Default: + OptionHistoryGreeksEodRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryGreeksEodFormat): Default: + OptionHistoryGreeksEodFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryGreeksEodResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_date=start_date, +end_date=end_date, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksEodRight = OptionHistoryGreeksEodRight.BOTH, + start_date: datetime.date, + end_date: datetime.date, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksEodRateType = OptionHistoryGreeksEodRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksEodFormat = OptionHistoryGreeksEodFormat.NDJSON, + +) -> OptionHistoryGreeksEodResponse200 | None: + """ End of Day Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Uses Theta Data's EOD reports that get generated at 17:15 ET each day. The closing option price + and closing underlying price are used for the greeks calculation. + - **Set `expiration` to ``*`` if you want to retrieve data for every option that shares the same + ``symbol``. (note: Any ``expiration=*`` must be requested day by day)** + > The quote fields (bid / ask info) may not be available prior to 2023-12-01. We are working to + expose this over the coming months. Obtaining the quote at the end of the day requires much more + processing than the trades, so we initially generated our history for trades. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryGreeksEodRight): Default: OptionHistoryGreeksEodRight.BOTH. + start_date (datetime.date): + end_date (datetime.date): + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryGreeksEodRateType): Default: + OptionHistoryGreeksEodRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryGreeksEodFormat): Default: + OptionHistoryGreeksEodFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryGreeksEodResponse200 + """ + + + return sync_detailed( + client=client, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_date=start_date, +end_date=end_date, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksEodRight = OptionHistoryGreeksEodRight.BOTH, + start_date: datetime.date, + end_date: datetime.date, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksEodRateType = OptionHistoryGreeksEodRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksEodFormat = OptionHistoryGreeksEodFormat.NDJSON, + +) -> Response[OptionHistoryGreeksEodResponse200]: + """ End of Day Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Uses Theta Data's EOD reports that get generated at 17:15 ET each day. The closing option price + and closing underlying price are used for the greeks calculation. + - **Set `expiration` to ``*`` if you want to retrieve data for every option that shares the same + ``symbol``. (note: Any ``expiration=*`` must be requested day by day)** + > The quote fields (bid / ask info) may not be available prior to 2023-12-01. We are working to + expose this over the coming months. Obtaining the quote at the end of the day requires much more + processing than the trades, so we initially generated our history for trades. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryGreeksEodRight): Default: OptionHistoryGreeksEodRight.BOTH. + start_date (datetime.date): + end_date (datetime.date): + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryGreeksEodRateType): Default: + OptionHistoryGreeksEodRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryGreeksEodFormat): Default: + OptionHistoryGreeksEodFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryGreeksEodResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_date=start_date, +end_date=end_date, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksEodRight = OptionHistoryGreeksEodRight.BOTH, + start_date: datetime.date, + end_date: datetime.date, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksEodRateType = OptionHistoryGreeksEodRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksEodFormat = OptionHistoryGreeksEodFormat.NDJSON, + +) -> OptionHistoryGreeksEodResponse200 | None: + """ End of Day Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Uses Theta Data's EOD reports that get generated at 17:15 ET each day. The closing option price + and closing underlying price are used for the greeks calculation. + - **Set `expiration` to ``*`` if you want to retrieve data for every option that shares the same + ``symbol``. (note: Any ``expiration=*`` must be requested day by day)** + > The quote fields (bid / ask info) may not be available prior to 2023-12-01. We are working to + expose this over the coming months. Obtaining the quote at the end of the day requires much more + processing than the trades, so we initially generated our history for trades. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryGreeksEodRight): Default: OptionHistoryGreeksEodRight.BOTH. + start_date (datetime.date): + end_date (datetime.date): + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryGreeksEodRateType): Default: + OptionHistoryGreeksEodRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryGreeksEodFormat): Default: + OptionHistoryGreeksEodFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryGreeksEodResponse200 + """ + + + return (await asyncio_detailed( + client=client, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_date=start_date, +end_date=end_date, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_history_greeks_first_order.py b/openapi_project/openapi_package/api/option/option_history_greeks_first_order.py new file mode 100644 index 000000000..45dc6da48 --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_history_greeks_first_order.py @@ -0,0 +1,405 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_history_greeks_first_order_format import OptionHistoryGreeksFirstOrderFormat +from openapi_project.openapi_package.models.option_history_greeks_first_order_interval import OptionHistoryGreeksFirstOrderInterval +from openapi_project.openapi_package.models.option_history_greeks_first_order_rate_type import OptionHistoryGreeksFirstOrderRateType +from openapi_project.openapi_package.models.option_history_greeks_first_order_response_200 import OptionHistoryGreeksFirstOrderResponse200 +from openapi_project.openapi_package.models.option_history_greeks_first_order_right import OptionHistoryGreeksFirstOrderRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksFirstOrderRight = OptionHistoryGreeksFirstOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryGreeksFirstOrderInterval = OptionHistoryGreeksFirstOrderInterval.VALUE_4, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksFirstOrderRateType = OptionHistoryGreeksFirstOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksFirstOrderFormat = OptionHistoryGreeksFirstOrderFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_date = date.isoformat() + params["date"] = json_date + + params["symbol"] = symbol + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + params["start_time"] = start_time + + params["end_time"] = end_time + + json_interval = interval.value + params["interval"] = json_interval + + params["annual_dividend"] = annual_dividend + + json_rate_type: Unset | str = UNSET if isinstance(rate_type, Unset) else rate_type.value + + params["rate_type"] = json_rate_type + + params["rate_value"] = rate_value + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/history/greeks/first_order", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryGreeksFirstOrderResponse200 | None: + if response.status_code == 200: + response_200 = OptionHistoryGreeksFirstOrderResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryGreeksFirstOrderResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksFirstOrderRight = OptionHistoryGreeksFirstOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryGreeksFirstOrderInterval = OptionHistoryGreeksFirstOrderInterval.VALUE_4, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksFirstOrderRateType = OptionHistoryGreeksFirstOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksFirstOrderFormat = OptionHistoryGreeksFirstOrderFormat.NDJSON, + +) -> Response[OptionHistoryGreeksFirstOrderResponse200]: + """ First Order Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculated using the option and underlying midpoint price. If an interval size is specified + (*highly recommended*), the option quote used in the calculation follows the same rules as the + [quote](/operations/option_history_quote.html) endpoint. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryGreeksFirstOrderRight): Default: + OptionHistoryGreeksFirstOrderRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + interval (OptionHistoryGreeksFirstOrderInterval): Default: + OptionHistoryGreeksFirstOrderInterval.VALUE_4. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryGreeksFirstOrderRateType): Default: + OptionHistoryGreeksFirstOrderRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryGreeksFirstOrderFormat): Default: + OptionHistoryGreeksFirstOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryGreeksFirstOrderResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +interval=interval, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksFirstOrderRight = OptionHistoryGreeksFirstOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryGreeksFirstOrderInterval = OptionHistoryGreeksFirstOrderInterval.VALUE_4, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksFirstOrderRateType = OptionHistoryGreeksFirstOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksFirstOrderFormat = OptionHistoryGreeksFirstOrderFormat.NDJSON, + +) -> OptionHistoryGreeksFirstOrderResponse200 | None: + """ First Order Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculated using the option and underlying midpoint price. If an interval size is specified + (*highly recommended*), the option quote used in the calculation follows the same rules as the + [quote](/operations/option_history_quote.html) endpoint. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryGreeksFirstOrderRight): Default: + OptionHistoryGreeksFirstOrderRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + interval (OptionHistoryGreeksFirstOrderInterval): Default: + OptionHistoryGreeksFirstOrderInterval.VALUE_4. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryGreeksFirstOrderRateType): Default: + OptionHistoryGreeksFirstOrderRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryGreeksFirstOrderFormat): Default: + OptionHistoryGreeksFirstOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryGreeksFirstOrderResponse200 + """ + + + return sync_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +interval=interval, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksFirstOrderRight = OptionHistoryGreeksFirstOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryGreeksFirstOrderInterval = OptionHistoryGreeksFirstOrderInterval.VALUE_4, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksFirstOrderRateType = OptionHistoryGreeksFirstOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksFirstOrderFormat = OptionHistoryGreeksFirstOrderFormat.NDJSON, + +) -> Response[OptionHistoryGreeksFirstOrderResponse200]: + """ First Order Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculated using the option and underlying midpoint price. If an interval size is specified + (*highly recommended*), the option quote used in the calculation follows the same rules as the + [quote](/operations/option_history_quote.html) endpoint. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryGreeksFirstOrderRight): Default: + OptionHistoryGreeksFirstOrderRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + interval (OptionHistoryGreeksFirstOrderInterval): Default: + OptionHistoryGreeksFirstOrderInterval.VALUE_4. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryGreeksFirstOrderRateType): Default: + OptionHistoryGreeksFirstOrderRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryGreeksFirstOrderFormat): Default: + OptionHistoryGreeksFirstOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryGreeksFirstOrderResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +interval=interval, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksFirstOrderRight = OptionHistoryGreeksFirstOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryGreeksFirstOrderInterval = OptionHistoryGreeksFirstOrderInterval.VALUE_4, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksFirstOrderRateType = OptionHistoryGreeksFirstOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksFirstOrderFormat = OptionHistoryGreeksFirstOrderFormat.NDJSON, + +) -> OptionHistoryGreeksFirstOrderResponse200 | None: + """ First Order Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculated using the option and underlying midpoint price. If an interval size is specified + (*highly recommended*), the option quote used in the calculation follows the same rules as the + [quote](/operations/option_history_quote.html) endpoint. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryGreeksFirstOrderRight): Default: + OptionHistoryGreeksFirstOrderRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + interval (OptionHistoryGreeksFirstOrderInterval): Default: + OptionHistoryGreeksFirstOrderInterval.VALUE_4. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryGreeksFirstOrderRateType): Default: + OptionHistoryGreeksFirstOrderRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryGreeksFirstOrderFormat): Default: + OptionHistoryGreeksFirstOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryGreeksFirstOrderResponse200 + """ + + + return (await asyncio_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +interval=interval, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_history_greeks_implied_volatility.py b/openapi_project/openapi_package/api/option/option_history_greeks_implied_volatility.py new file mode 100644 index 000000000..7ca92c423 --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_history_greeks_implied_volatility.py @@ -0,0 +1,397 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_history_greeks_implied_volatility_format import OptionHistoryGreeksImpliedVolatilityFormat +from openapi_project.openapi_package.models.option_history_greeks_implied_volatility_interval import OptionHistoryGreeksImpliedVolatilityInterval +from openapi_project.openapi_package.models.option_history_greeks_implied_volatility_rate_type import OptionHistoryGreeksImpliedVolatilityRateType +from openapi_project.openapi_package.models.option_history_greeks_implied_volatility_response_200 import OptionHistoryGreeksImpliedVolatilityResponse200 +from openapi_project.openapi_package.models.option_history_greeks_implied_volatility_right import OptionHistoryGreeksImpliedVolatilityRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksImpliedVolatilityRight = OptionHistoryGreeksImpliedVolatilityRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryGreeksImpliedVolatilityInterval = OptionHistoryGreeksImpliedVolatilityInterval.VALUE_4, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksImpliedVolatilityRateType = OptionHistoryGreeksImpliedVolatilityRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksImpliedVolatilityFormat = OptionHistoryGreeksImpliedVolatilityFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_date = date.isoformat() + params["date"] = json_date + + params["symbol"] = symbol + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + params["start_time"] = start_time + + params["end_time"] = end_time + + json_interval = interval.value + params["interval"] = json_interval + + params["annual_dividend"] = annual_dividend + + json_rate_type: Unset | str = UNSET if isinstance(rate_type, Unset) else rate_type.value + + params["rate_type"] = json_rate_type + + params["rate_value"] = rate_value + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/history/greeks/implied_volatility", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryGreeksImpliedVolatilityResponse200 | None: + if response.status_code == 200: + response_200 = OptionHistoryGreeksImpliedVolatilityResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryGreeksImpliedVolatilityResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksImpliedVolatilityRight = OptionHistoryGreeksImpliedVolatilityRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryGreeksImpliedVolatilityInterval = OptionHistoryGreeksImpliedVolatilityInterval.VALUE_4, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksImpliedVolatilityRateType = OptionHistoryGreeksImpliedVolatilityRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksImpliedVolatilityFormat = OptionHistoryGreeksImpliedVolatilityFormat.NDJSON, + +) -> Response[OptionHistoryGreeksImpliedVolatilityResponse200]: + """ Implied Volatility + + - Returns implied volatilies calculated using the national best bid, mid, and ask price of the + option respectively. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryGreeksImpliedVolatilityRight): Default: + OptionHistoryGreeksImpliedVolatilityRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + interval (OptionHistoryGreeksImpliedVolatilityInterval): Default: + OptionHistoryGreeksImpliedVolatilityInterval.VALUE_4. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryGreeksImpliedVolatilityRateType): Default: + OptionHistoryGreeksImpliedVolatilityRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryGreeksImpliedVolatilityFormat): Default: + OptionHistoryGreeksImpliedVolatilityFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryGreeksImpliedVolatilityResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +interval=interval, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksImpliedVolatilityRight = OptionHistoryGreeksImpliedVolatilityRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryGreeksImpliedVolatilityInterval = OptionHistoryGreeksImpliedVolatilityInterval.VALUE_4, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksImpliedVolatilityRateType = OptionHistoryGreeksImpliedVolatilityRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksImpliedVolatilityFormat = OptionHistoryGreeksImpliedVolatilityFormat.NDJSON, + +) -> OptionHistoryGreeksImpliedVolatilityResponse200 | None: + """ Implied Volatility + + - Returns implied volatilies calculated using the national best bid, mid, and ask price of the + option respectively. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryGreeksImpliedVolatilityRight): Default: + OptionHistoryGreeksImpliedVolatilityRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + interval (OptionHistoryGreeksImpliedVolatilityInterval): Default: + OptionHistoryGreeksImpliedVolatilityInterval.VALUE_4. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryGreeksImpliedVolatilityRateType): Default: + OptionHistoryGreeksImpliedVolatilityRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryGreeksImpliedVolatilityFormat): Default: + OptionHistoryGreeksImpliedVolatilityFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryGreeksImpliedVolatilityResponse200 + """ + + + return sync_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +interval=interval, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksImpliedVolatilityRight = OptionHistoryGreeksImpliedVolatilityRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryGreeksImpliedVolatilityInterval = OptionHistoryGreeksImpliedVolatilityInterval.VALUE_4, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksImpliedVolatilityRateType = OptionHistoryGreeksImpliedVolatilityRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksImpliedVolatilityFormat = OptionHistoryGreeksImpliedVolatilityFormat.NDJSON, + +) -> Response[OptionHistoryGreeksImpliedVolatilityResponse200]: + """ Implied Volatility + + - Returns implied volatilies calculated using the national best bid, mid, and ask price of the + option respectively. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryGreeksImpliedVolatilityRight): Default: + OptionHistoryGreeksImpliedVolatilityRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + interval (OptionHistoryGreeksImpliedVolatilityInterval): Default: + OptionHistoryGreeksImpliedVolatilityInterval.VALUE_4. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryGreeksImpliedVolatilityRateType): Default: + OptionHistoryGreeksImpliedVolatilityRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryGreeksImpliedVolatilityFormat): Default: + OptionHistoryGreeksImpliedVolatilityFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryGreeksImpliedVolatilityResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +interval=interval, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksImpliedVolatilityRight = OptionHistoryGreeksImpliedVolatilityRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryGreeksImpliedVolatilityInterval = OptionHistoryGreeksImpliedVolatilityInterval.VALUE_4, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksImpliedVolatilityRateType = OptionHistoryGreeksImpliedVolatilityRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksImpliedVolatilityFormat = OptionHistoryGreeksImpliedVolatilityFormat.NDJSON, + +) -> OptionHistoryGreeksImpliedVolatilityResponse200 | None: + """ Implied Volatility + + - Returns implied volatilies calculated using the national best bid, mid, and ask price of the + option respectively. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryGreeksImpliedVolatilityRight): Default: + OptionHistoryGreeksImpliedVolatilityRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + interval (OptionHistoryGreeksImpliedVolatilityInterval): Default: + OptionHistoryGreeksImpliedVolatilityInterval.VALUE_4. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryGreeksImpliedVolatilityRateType): Default: + OptionHistoryGreeksImpliedVolatilityRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryGreeksImpliedVolatilityFormat): Default: + OptionHistoryGreeksImpliedVolatilityFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryGreeksImpliedVolatilityResponse200 + """ + + + return (await asyncio_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +interval=interval, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_history_greeks_second_order.py b/openapi_project/openapi_package/api/option/option_history_greeks_second_order.py new file mode 100644 index 000000000..551fd3e27 --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_history_greeks_second_order.py @@ -0,0 +1,405 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_history_greeks_second_order_format import OptionHistoryGreeksSecondOrderFormat +from openapi_project.openapi_package.models.option_history_greeks_second_order_interval import OptionHistoryGreeksSecondOrderInterval +from openapi_project.openapi_package.models.option_history_greeks_second_order_rate_type import OptionHistoryGreeksSecondOrderRateType +from openapi_project.openapi_package.models.option_history_greeks_second_order_response_200 import OptionHistoryGreeksSecondOrderResponse200 +from openapi_project.openapi_package.models.option_history_greeks_second_order_right import OptionHistoryGreeksSecondOrderRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksSecondOrderRight = OptionHistoryGreeksSecondOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryGreeksSecondOrderInterval = OptionHistoryGreeksSecondOrderInterval.VALUE_4, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksSecondOrderRateType = OptionHistoryGreeksSecondOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksSecondOrderFormat = OptionHistoryGreeksSecondOrderFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_date = date.isoformat() + params["date"] = json_date + + params["symbol"] = symbol + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + params["start_time"] = start_time + + params["end_time"] = end_time + + json_interval = interval.value + params["interval"] = json_interval + + params["annual_dividend"] = annual_dividend + + json_rate_type: Unset | str = UNSET if isinstance(rate_type, Unset) else rate_type.value + + params["rate_type"] = json_rate_type + + params["rate_value"] = rate_value + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/history/greeks/second_order", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryGreeksSecondOrderResponse200 | None: + if response.status_code == 200: + response_200 = OptionHistoryGreeksSecondOrderResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryGreeksSecondOrderResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksSecondOrderRight = OptionHistoryGreeksSecondOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryGreeksSecondOrderInterval = OptionHistoryGreeksSecondOrderInterval.VALUE_4, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksSecondOrderRateType = OptionHistoryGreeksSecondOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksSecondOrderFormat = OptionHistoryGreeksSecondOrderFormat.NDJSON, + +) -> Response[OptionHistoryGreeksSecondOrderResponse200]: + """ Second Order Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculated using the option and underlying midpoint price. If an interval size is specified + (*highly recommended*), the option quote used in the calculation follows the same rules as the + [quote](/operations/option_history_quote.html) endpoint. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryGreeksSecondOrderRight): Default: + OptionHistoryGreeksSecondOrderRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + interval (OptionHistoryGreeksSecondOrderInterval): Default: + OptionHistoryGreeksSecondOrderInterval.VALUE_4. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryGreeksSecondOrderRateType): Default: + OptionHistoryGreeksSecondOrderRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryGreeksSecondOrderFormat): Default: + OptionHistoryGreeksSecondOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryGreeksSecondOrderResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +interval=interval, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksSecondOrderRight = OptionHistoryGreeksSecondOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryGreeksSecondOrderInterval = OptionHistoryGreeksSecondOrderInterval.VALUE_4, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksSecondOrderRateType = OptionHistoryGreeksSecondOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksSecondOrderFormat = OptionHistoryGreeksSecondOrderFormat.NDJSON, + +) -> OptionHistoryGreeksSecondOrderResponse200 | None: + """ Second Order Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculated using the option and underlying midpoint price. If an interval size is specified + (*highly recommended*), the option quote used in the calculation follows the same rules as the + [quote](/operations/option_history_quote.html) endpoint. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryGreeksSecondOrderRight): Default: + OptionHistoryGreeksSecondOrderRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + interval (OptionHistoryGreeksSecondOrderInterval): Default: + OptionHistoryGreeksSecondOrderInterval.VALUE_4. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryGreeksSecondOrderRateType): Default: + OptionHistoryGreeksSecondOrderRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryGreeksSecondOrderFormat): Default: + OptionHistoryGreeksSecondOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryGreeksSecondOrderResponse200 + """ + + + return sync_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +interval=interval, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksSecondOrderRight = OptionHistoryGreeksSecondOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryGreeksSecondOrderInterval = OptionHistoryGreeksSecondOrderInterval.VALUE_4, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksSecondOrderRateType = OptionHistoryGreeksSecondOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksSecondOrderFormat = OptionHistoryGreeksSecondOrderFormat.NDJSON, + +) -> Response[OptionHistoryGreeksSecondOrderResponse200]: + """ Second Order Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculated using the option and underlying midpoint price. If an interval size is specified + (*highly recommended*), the option quote used in the calculation follows the same rules as the + [quote](/operations/option_history_quote.html) endpoint. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryGreeksSecondOrderRight): Default: + OptionHistoryGreeksSecondOrderRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + interval (OptionHistoryGreeksSecondOrderInterval): Default: + OptionHistoryGreeksSecondOrderInterval.VALUE_4. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryGreeksSecondOrderRateType): Default: + OptionHistoryGreeksSecondOrderRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryGreeksSecondOrderFormat): Default: + OptionHistoryGreeksSecondOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryGreeksSecondOrderResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +interval=interval, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksSecondOrderRight = OptionHistoryGreeksSecondOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryGreeksSecondOrderInterval = OptionHistoryGreeksSecondOrderInterval.VALUE_4, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksSecondOrderRateType = OptionHistoryGreeksSecondOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksSecondOrderFormat = OptionHistoryGreeksSecondOrderFormat.NDJSON, + +) -> OptionHistoryGreeksSecondOrderResponse200 | None: + """ Second Order Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculated using the option and underlying midpoint price. If an interval size is specified + (*highly recommended*), the option quote used in the calculation follows the same rules as the + [quote](/operations/option_history_quote.html) endpoint. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryGreeksSecondOrderRight): Default: + OptionHistoryGreeksSecondOrderRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + interval (OptionHistoryGreeksSecondOrderInterval): Default: + OptionHistoryGreeksSecondOrderInterval.VALUE_4. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryGreeksSecondOrderRateType): Default: + OptionHistoryGreeksSecondOrderRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryGreeksSecondOrderFormat): Default: + OptionHistoryGreeksSecondOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryGreeksSecondOrderResponse200 + """ + + + return (await asyncio_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +interval=interval, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_history_greeks_third_order.py b/openapi_project/openapi_package/api/option/option_history_greeks_third_order.py new file mode 100644 index 000000000..cfe14304a --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_history_greeks_third_order.py @@ -0,0 +1,405 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_history_greeks_third_order_format import OptionHistoryGreeksThirdOrderFormat +from openapi_project.openapi_package.models.option_history_greeks_third_order_interval import OptionHistoryGreeksThirdOrderInterval +from openapi_project.openapi_package.models.option_history_greeks_third_order_rate_type import OptionHistoryGreeksThirdOrderRateType +from openapi_project.openapi_package.models.option_history_greeks_third_order_response_200 import OptionHistoryGreeksThirdOrderResponse200 +from openapi_project.openapi_package.models.option_history_greeks_third_order_right import OptionHistoryGreeksThirdOrderRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksThirdOrderRight = OptionHistoryGreeksThirdOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryGreeksThirdOrderInterval = OptionHistoryGreeksThirdOrderInterval.VALUE_4, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksThirdOrderRateType = OptionHistoryGreeksThirdOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksThirdOrderFormat = OptionHistoryGreeksThirdOrderFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_date = date.isoformat() + params["date"] = json_date + + params["symbol"] = symbol + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + params["start_time"] = start_time + + params["end_time"] = end_time + + json_interval = interval.value + params["interval"] = json_interval + + params["annual_dividend"] = annual_dividend + + json_rate_type: Unset | str = UNSET if isinstance(rate_type, Unset) else rate_type.value + + params["rate_type"] = json_rate_type + + params["rate_value"] = rate_value + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/history/greeks/third_order", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryGreeksThirdOrderResponse200 | None: + if response.status_code == 200: + response_200 = OptionHistoryGreeksThirdOrderResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryGreeksThirdOrderResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksThirdOrderRight = OptionHistoryGreeksThirdOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryGreeksThirdOrderInterval = OptionHistoryGreeksThirdOrderInterval.VALUE_4, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksThirdOrderRateType = OptionHistoryGreeksThirdOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksThirdOrderFormat = OptionHistoryGreeksThirdOrderFormat.NDJSON, + +) -> Response[OptionHistoryGreeksThirdOrderResponse200]: + """ Third Order Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculated using the option and underlying midpoint price. If an interval size is specified + (*highly recommended*), the option quote used in the calculation follows the same rules as the + [quote](/operations/option_history_quote.html) endpoint. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryGreeksThirdOrderRight): Default: + OptionHistoryGreeksThirdOrderRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + interval (OptionHistoryGreeksThirdOrderInterval): Default: + OptionHistoryGreeksThirdOrderInterval.VALUE_4. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryGreeksThirdOrderRateType): Default: + OptionHistoryGreeksThirdOrderRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryGreeksThirdOrderFormat): Default: + OptionHistoryGreeksThirdOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryGreeksThirdOrderResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +interval=interval, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksThirdOrderRight = OptionHistoryGreeksThirdOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryGreeksThirdOrderInterval = OptionHistoryGreeksThirdOrderInterval.VALUE_4, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksThirdOrderRateType = OptionHistoryGreeksThirdOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksThirdOrderFormat = OptionHistoryGreeksThirdOrderFormat.NDJSON, + +) -> OptionHistoryGreeksThirdOrderResponse200 | None: + """ Third Order Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculated using the option and underlying midpoint price. If an interval size is specified + (*highly recommended*), the option quote used in the calculation follows the same rules as the + [quote](/operations/option_history_quote.html) endpoint. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryGreeksThirdOrderRight): Default: + OptionHistoryGreeksThirdOrderRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + interval (OptionHistoryGreeksThirdOrderInterval): Default: + OptionHistoryGreeksThirdOrderInterval.VALUE_4. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryGreeksThirdOrderRateType): Default: + OptionHistoryGreeksThirdOrderRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryGreeksThirdOrderFormat): Default: + OptionHistoryGreeksThirdOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryGreeksThirdOrderResponse200 + """ + + + return sync_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +interval=interval, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksThirdOrderRight = OptionHistoryGreeksThirdOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryGreeksThirdOrderInterval = OptionHistoryGreeksThirdOrderInterval.VALUE_4, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksThirdOrderRateType = OptionHistoryGreeksThirdOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksThirdOrderFormat = OptionHistoryGreeksThirdOrderFormat.NDJSON, + +) -> Response[OptionHistoryGreeksThirdOrderResponse200]: + """ Third Order Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculated using the option and underlying midpoint price. If an interval size is specified + (*highly recommended*), the option quote used in the calculation follows the same rules as the + [quote](/operations/option_history_quote.html) endpoint. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryGreeksThirdOrderRight): Default: + OptionHistoryGreeksThirdOrderRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + interval (OptionHistoryGreeksThirdOrderInterval): Default: + OptionHistoryGreeksThirdOrderInterval.VALUE_4. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryGreeksThirdOrderRateType): Default: + OptionHistoryGreeksThirdOrderRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryGreeksThirdOrderFormat): Default: + OptionHistoryGreeksThirdOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryGreeksThirdOrderResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +interval=interval, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryGreeksThirdOrderRight = OptionHistoryGreeksThirdOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryGreeksThirdOrderInterval = OptionHistoryGreeksThirdOrderInterval.VALUE_4, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryGreeksThirdOrderRateType = OptionHistoryGreeksThirdOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryGreeksThirdOrderFormat = OptionHistoryGreeksThirdOrderFormat.NDJSON, + +) -> OptionHistoryGreeksThirdOrderResponse200 | None: + """ Third Order Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculated using the option and underlying midpoint price. If an interval size is specified + (*highly recommended*), the option quote used in the calculation follows the same rules as the + [quote](/operations/option_history_quote.html) endpoint. + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryGreeksThirdOrderRight): Default: + OptionHistoryGreeksThirdOrderRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + interval (OptionHistoryGreeksThirdOrderInterval): Default: + OptionHistoryGreeksThirdOrderInterval.VALUE_4. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryGreeksThirdOrderRateType): Default: + OptionHistoryGreeksThirdOrderRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryGreeksThirdOrderFormat): Default: + OptionHistoryGreeksThirdOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryGreeksThirdOrderResponse200 + """ + + + return (await asyncio_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +interval=interval, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_history_ohlc.py b/openapi_project/openapi_package/api/option/option_history_ohlc.py new file mode 100644 index 000000000..4227cf608 --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_history_ohlc.py @@ -0,0 +1,325 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_history_ohlc_format import OptionHistoryOhlcFormat +from openapi_project.openapi_package.models.option_history_ohlc_interval import OptionHistoryOhlcInterval +from openapi_project.openapi_package.models.option_history_ohlc_response_200 import OptionHistoryOhlcResponse200 +from openapi_project.openapi_package.models.option_history_ohlc_right import OptionHistoryOhlcRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryOhlcRight = OptionHistoryOhlcRight.BOTH, + interval: OptionHistoryOhlcInterval = OptionHistoryOhlcInterval.VALUE_4, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + format_: Unset | OptionHistoryOhlcFormat = OptionHistoryOhlcFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_date = date.isoformat() + params["date"] = json_date + + params["symbol"] = symbol + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + json_interval = interval.value + params["interval"] = json_interval + + params["start_time"] = start_time + + params["end_time"] = end_time + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/history/ohlc", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryOhlcResponse200 | None: + if response.status_code == 200: + response_200 = OptionHistoryOhlcResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryOhlcResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryOhlcRight = OptionHistoryOhlcRight.BOTH, + interval: OptionHistoryOhlcInterval = OptionHistoryOhlcInterval.VALUE_4, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + format_: Unset | OptionHistoryOhlcFormat = OptionHistoryOhlcFormat.NDJSON, + +) -> Response[OptionHistoryOhlcResponse200]: + """ Open High Low Close + + - Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. + - Time timestamp of the bar represents the opening time of the bar. For a trade to be part of the + bar: ``bar timestamp`` <= ``trade time`` < ``bar timestamp + interval``. + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryOhlcRight): Default: OptionHistoryOhlcRight.BOTH. + interval (OptionHistoryOhlcInterval): Default: OptionHistoryOhlcInterval.VALUE_4. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + format_ (Unset | OptionHistoryOhlcFormat): Default: OptionHistoryOhlcFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryOhlcResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +interval=interval, +start_time=start_time, +end_time=end_time, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryOhlcRight = OptionHistoryOhlcRight.BOTH, + interval: OptionHistoryOhlcInterval = OptionHistoryOhlcInterval.VALUE_4, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + format_: Unset | OptionHistoryOhlcFormat = OptionHistoryOhlcFormat.NDJSON, + +) -> OptionHistoryOhlcResponse200 | None: + """ Open High Low Close + + - Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. + - Time timestamp of the bar represents the opening time of the bar. For a trade to be part of the + bar: ``bar timestamp`` <= ``trade time`` < ``bar timestamp + interval``. + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryOhlcRight): Default: OptionHistoryOhlcRight.BOTH. + interval (OptionHistoryOhlcInterval): Default: OptionHistoryOhlcInterval.VALUE_4. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + format_ (Unset | OptionHistoryOhlcFormat): Default: OptionHistoryOhlcFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryOhlcResponse200 + """ + + + return sync_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +interval=interval, +start_time=start_time, +end_time=end_time, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryOhlcRight = OptionHistoryOhlcRight.BOTH, + interval: OptionHistoryOhlcInterval = OptionHistoryOhlcInterval.VALUE_4, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + format_: Unset | OptionHistoryOhlcFormat = OptionHistoryOhlcFormat.NDJSON, + +) -> Response[OptionHistoryOhlcResponse200]: + """ Open High Low Close + + - Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. + - Time timestamp of the bar represents the opening time of the bar. For a trade to be part of the + bar: ``bar timestamp`` <= ``trade time`` < ``bar timestamp + interval``. + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryOhlcRight): Default: OptionHistoryOhlcRight.BOTH. + interval (OptionHistoryOhlcInterval): Default: OptionHistoryOhlcInterval.VALUE_4. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + format_ (Unset | OptionHistoryOhlcFormat): Default: OptionHistoryOhlcFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryOhlcResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +interval=interval, +start_time=start_time, +end_time=end_time, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryOhlcRight = OptionHistoryOhlcRight.BOTH, + interval: OptionHistoryOhlcInterval = OptionHistoryOhlcInterval.VALUE_4, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + format_: Unset | OptionHistoryOhlcFormat = OptionHistoryOhlcFormat.NDJSON, + +) -> OptionHistoryOhlcResponse200 | None: + """ Open High Low Close + + - Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. + - Time timestamp of the bar represents the opening time of the bar. For a trade to be part of the + bar: ``bar timestamp`` <= ``trade time`` < ``bar timestamp + interval``. + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryOhlcRight): Default: OptionHistoryOhlcRight.BOTH. + interval (OptionHistoryOhlcInterval): Default: OptionHistoryOhlcInterval.VALUE_4. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + format_ (Unset | OptionHistoryOhlcFormat): Default: OptionHistoryOhlcFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryOhlcResponse200 + """ + + + return (await asyncio_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +interval=interval, +start_time=start_time, +end_time=end_time, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_history_open_interest.py b/openapi_project/openapi_package/api/option/option_history_open_interest.py new file mode 100644 index 000000000..aaf504ffb --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_history_open_interest.py @@ -0,0 +1,294 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_history_open_interest_format import OptionHistoryOpenInterestFormat +from openapi_project.openapi_package.models.option_history_open_interest_response_200 import OptionHistoryOpenInterestResponse200 +from openapi_project.openapi_package.models.option_history_open_interest_right import OptionHistoryOpenInterestRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryOpenInterestRight = OptionHistoryOpenInterestRight.BOTH, + format_: Unset | OptionHistoryOpenInterestFormat = OptionHistoryOpenInterestFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_date = date.isoformat() + params["date"] = json_date + + params["symbol"] = symbol + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/history/open_interest", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryOpenInterestResponse200 | None: + if response.status_code == 200: + response_200 = OptionHistoryOpenInterestResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryOpenInterestResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryOpenInterestRight = OptionHistoryOpenInterestRight.BOTH, + format_: Unset | OptionHistoryOpenInterestFormat = OptionHistoryOpenInterestFormat.NDJSON, + +) -> Response[OptionHistoryOpenInterestResponse200]: + """ Open Interest + + - Open Interest is normally reported once per day by [OPRA](/Articles/Data-And-Requests/The- + SIPs.html) at approximately 06:30 ET. + - A new open interest message might not be sent by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) + if there is no open interest for the option contract. + - The reported open interest represents the open interest at the end of the previous trading day. + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryOpenInterestRight): Default: + OptionHistoryOpenInterestRight.BOTH. + format_ (Unset | OptionHistoryOpenInterestFormat): Default: + OptionHistoryOpenInterestFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryOpenInterestResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryOpenInterestRight = OptionHistoryOpenInterestRight.BOTH, + format_: Unset | OptionHistoryOpenInterestFormat = OptionHistoryOpenInterestFormat.NDJSON, + +) -> OptionHistoryOpenInterestResponse200 | None: + """ Open Interest + + - Open Interest is normally reported once per day by [OPRA](/Articles/Data-And-Requests/The- + SIPs.html) at approximately 06:30 ET. + - A new open interest message might not be sent by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) + if there is no open interest for the option contract. + - The reported open interest represents the open interest at the end of the previous trading day. + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryOpenInterestRight): Default: + OptionHistoryOpenInterestRight.BOTH. + format_ (Unset | OptionHistoryOpenInterestFormat): Default: + OptionHistoryOpenInterestFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryOpenInterestResponse200 + """ + + + return sync_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryOpenInterestRight = OptionHistoryOpenInterestRight.BOTH, + format_: Unset | OptionHistoryOpenInterestFormat = OptionHistoryOpenInterestFormat.NDJSON, + +) -> Response[OptionHistoryOpenInterestResponse200]: + """ Open Interest + + - Open Interest is normally reported once per day by [OPRA](/Articles/Data-And-Requests/The- + SIPs.html) at approximately 06:30 ET. + - A new open interest message might not be sent by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) + if there is no open interest for the option contract. + - The reported open interest represents the open interest at the end of the previous trading day. + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryOpenInterestRight): Default: + OptionHistoryOpenInterestRight.BOTH. + format_ (Unset | OptionHistoryOpenInterestFormat): Default: + OptionHistoryOpenInterestFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryOpenInterestResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryOpenInterestRight = OptionHistoryOpenInterestRight.BOTH, + format_: Unset | OptionHistoryOpenInterestFormat = OptionHistoryOpenInterestFormat.NDJSON, + +) -> OptionHistoryOpenInterestResponse200 | None: + """ Open Interest + + - Open Interest is normally reported once per day by [OPRA](/Articles/Data-And-Requests/The- + SIPs.html) at approximately 06:30 ET. + - A new open interest message might not be sent by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) + if there is no open interest for the option contract. + - The reported open interest represents the open interest at the end of the previous trading day. + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryOpenInterestRight): Default: + OptionHistoryOpenInterestRight.BOTH. + format_ (Unset | OptionHistoryOpenInterestFormat): Default: + OptionHistoryOpenInterestFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryOpenInterestResponse200 + """ + + + return (await asyncio_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_history_quote.py b/openapi_project/openapi_package/api/option/option_history_quote.py new file mode 100644 index 000000000..65374d372 --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_history_quote.py @@ -0,0 +1,325 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_history_quote_format import OptionHistoryQuoteFormat +from openapi_project.openapi_package.models.option_history_quote_interval import OptionHistoryQuoteInterval +from openapi_project.openapi_package.models.option_history_quote_response_200 import OptionHistoryQuoteResponse200 +from openapi_project.openapi_package.models.option_history_quote_right import OptionHistoryQuoteRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryQuoteRight = OptionHistoryQuoteRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryQuoteInterval = OptionHistoryQuoteInterval.VALUE_4, + format_: Unset | OptionHistoryQuoteFormat = OptionHistoryQuoteFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_date = date.isoformat() + params["date"] = json_date + + params["symbol"] = symbol + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + params["start_time"] = start_time + + params["end_time"] = end_time + + json_interval = interval.value + params["interval"] = json_interval + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/history/quote", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryQuoteResponse200 | None: + if response.status_code == 200: + response_200 = OptionHistoryQuoteResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryQuoteResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryQuoteRight = OptionHistoryQuoteRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryQuoteInterval = OptionHistoryQuoteInterval.VALUE_4, + format_: Unset | OptionHistoryQuoteFormat = OptionHistoryQuoteFormat.NDJSON, + +) -> Response[OptionHistoryQuoteResponse200]: + """ Quote + + - Returns every NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - If the ``interval`` parameter is specified, the quote for each interval represents the last quote + at the interval's timestamp. + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryQuoteRight): Default: OptionHistoryQuoteRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + interval (OptionHistoryQuoteInterval): Default: OptionHistoryQuoteInterval.VALUE_4. + format_ (Unset | OptionHistoryQuoteFormat): Default: OptionHistoryQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryQuoteResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +interval=interval, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryQuoteRight = OptionHistoryQuoteRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryQuoteInterval = OptionHistoryQuoteInterval.VALUE_4, + format_: Unset | OptionHistoryQuoteFormat = OptionHistoryQuoteFormat.NDJSON, + +) -> OptionHistoryQuoteResponse200 | None: + """ Quote + + - Returns every NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - If the ``interval`` parameter is specified, the quote for each interval represents the last quote + at the interval's timestamp. + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryQuoteRight): Default: OptionHistoryQuoteRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + interval (OptionHistoryQuoteInterval): Default: OptionHistoryQuoteInterval.VALUE_4. + format_ (Unset | OptionHistoryQuoteFormat): Default: OptionHistoryQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryQuoteResponse200 + """ + + + return sync_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +interval=interval, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryQuoteRight = OptionHistoryQuoteRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryQuoteInterval = OptionHistoryQuoteInterval.VALUE_4, + format_: Unset | OptionHistoryQuoteFormat = OptionHistoryQuoteFormat.NDJSON, + +) -> Response[OptionHistoryQuoteResponse200]: + """ Quote + + - Returns every NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - If the ``interval`` parameter is specified, the quote for each interval represents the last quote + at the interval's timestamp. + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryQuoteRight): Default: OptionHistoryQuoteRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + interval (OptionHistoryQuoteInterval): Default: OptionHistoryQuoteInterval.VALUE_4. + format_ (Unset | OptionHistoryQuoteFormat): Default: OptionHistoryQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryQuoteResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +interval=interval, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryQuoteRight = OptionHistoryQuoteRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + interval: OptionHistoryQuoteInterval = OptionHistoryQuoteInterval.VALUE_4, + format_: Unset | OptionHistoryQuoteFormat = OptionHistoryQuoteFormat.NDJSON, + +) -> OptionHistoryQuoteResponse200 | None: + """ Quote + + - Returns every NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - If the ``interval`` parameter is specified, the quote for each interval represents the last quote + at the interval's timestamp. + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryQuoteRight): Default: OptionHistoryQuoteRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + interval (OptionHistoryQuoteInterval): Default: OptionHistoryQuoteInterval.VALUE_4. + format_ (Unset | OptionHistoryQuoteFormat): Default: OptionHistoryQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryQuoteResponse200 + """ + + + return (await asyncio_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +interval=interval, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_history_trade.py b/openapi_project/openapi_package/api/option/option_history_trade.py new file mode 100644 index 000000000..58b044b35 --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_history_trade.py @@ -0,0 +1,316 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_history_trade_format import OptionHistoryTradeFormat +from openapi_project.openapi_package.models.option_history_trade_response_200 import OptionHistoryTradeResponse200 +from openapi_project.openapi_package.models.option_history_trade_right import OptionHistoryTradeRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeRight = OptionHistoryTradeRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + format_: Unset | OptionHistoryTradeFormat = OptionHistoryTradeFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_date = date.isoformat() + params["date"] = json_date + + params["symbol"] = symbol + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + params["start_time"] = start_time + + params["end_time"] = end_time + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/history/trade", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryTradeResponse200 | None: + if response.status_code == 200: + response_200 = OptionHistoryTradeResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryTradeResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeRight = OptionHistoryTradeRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + format_: Unset | OptionHistoryTradeFormat = OptionHistoryTradeFormat.NDJSON, + +) -> Response[OptionHistoryTradeResponse200]: + """ Trade + + - Returns every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - Trade condition mappings can be found [here](/Articles/Errors-Exchanges-Conditions/Trade- + Conditions.html). + - Extended trade conditions are not reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) + for options, so they can be ignored. + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryTradeRight): Default: OptionHistoryTradeRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + format_ (Unset | OptionHistoryTradeFormat): Default: OptionHistoryTradeFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryTradeResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeRight = OptionHistoryTradeRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + format_: Unset | OptionHistoryTradeFormat = OptionHistoryTradeFormat.NDJSON, + +) -> OptionHistoryTradeResponse200 | None: + """ Trade + + - Returns every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - Trade condition mappings can be found [here](/Articles/Errors-Exchanges-Conditions/Trade- + Conditions.html). + - Extended trade conditions are not reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) + for options, so they can be ignored. + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryTradeRight): Default: OptionHistoryTradeRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + format_ (Unset | OptionHistoryTradeFormat): Default: OptionHistoryTradeFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryTradeResponse200 + """ + + + return sync_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeRight = OptionHistoryTradeRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + format_: Unset | OptionHistoryTradeFormat = OptionHistoryTradeFormat.NDJSON, + +) -> Response[OptionHistoryTradeResponse200]: + """ Trade + + - Returns every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - Trade condition mappings can be found [here](/Articles/Errors-Exchanges-Conditions/Trade- + Conditions.html). + - Extended trade conditions are not reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) + for options, so they can be ignored. + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryTradeRight): Default: OptionHistoryTradeRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + format_ (Unset | OptionHistoryTradeFormat): Default: OptionHistoryTradeFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryTradeResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeRight = OptionHistoryTradeRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + format_: Unset | OptionHistoryTradeFormat = OptionHistoryTradeFormat.NDJSON, + +) -> OptionHistoryTradeResponse200 | None: + """ Trade + + - Returns every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - Trade condition mappings can be found [here](/Articles/Errors-Exchanges-Conditions/Trade- + Conditions.html). + - Extended trade conditions are not reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) + for options, so they can be ignored. + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryTradeRight): Default: OptionHistoryTradeRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + format_ (Unset | OptionHistoryTradeFormat): Default: OptionHistoryTradeFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryTradeResponse200 + """ + + + return (await asyncio_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_history_trade_greeks_all.py b/openapi_project/openapi_package/api/option/option_history_trade_greeks_all.py new file mode 100644 index 000000000..07b2c8da7 --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_history_trade_greeks_all.py @@ -0,0 +1,376 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_history_trade_greeks_all_format import OptionHistoryTradeGreeksAllFormat +from openapi_project.openapi_package.models.option_history_trade_greeks_all_rate_type import OptionHistoryTradeGreeksAllRateType +from openapi_project.openapi_package.models.option_history_trade_greeks_all_response_200 import OptionHistoryTradeGreeksAllResponse200 +from openapi_project.openapi_package.models.option_history_trade_greeks_all_right import OptionHistoryTradeGreeksAllRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeGreeksAllRight = OptionHistoryTradeGreeksAllRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryTradeGreeksAllRateType = OptionHistoryTradeGreeksAllRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryTradeGreeksAllFormat = OptionHistoryTradeGreeksAllFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_date = date.isoformat() + params["date"] = json_date + + params["symbol"] = symbol + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + params["start_time"] = start_time + + params["end_time"] = end_time + + params["annual_dividend"] = annual_dividend + + json_rate_type: Unset | str = UNSET if isinstance(rate_type, Unset) else rate_type.value + + params["rate_type"] = json_rate_type + + params["rate_value"] = rate_value + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/history/trade_greeks/all", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryTradeGreeksAllResponse200 | None: + if response.status_code == 200: + response_200 = OptionHistoryTradeGreeksAllResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryTradeGreeksAllResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeGreeksAllRight = OptionHistoryTradeGreeksAllRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryTradeGreeksAllRateType = OptionHistoryTradeGreeksAllRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryTradeGreeksAllFormat = OptionHistoryTradeGreeksAllFormat.NDJSON, + +) -> Response[OptionHistoryTradeGreeksAllResponse200]: + """ All Trade Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryTradeGreeksAllRight): Default: + OptionHistoryTradeGreeksAllRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryTradeGreeksAllRateType): Default: + OptionHistoryTradeGreeksAllRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryTradeGreeksAllFormat): Default: + OptionHistoryTradeGreeksAllFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryTradeGreeksAllResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeGreeksAllRight = OptionHistoryTradeGreeksAllRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryTradeGreeksAllRateType = OptionHistoryTradeGreeksAllRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryTradeGreeksAllFormat = OptionHistoryTradeGreeksAllFormat.NDJSON, + +) -> OptionHistoryTradeGreeksAllResponse200 | None: + """ All Trade Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryTradeGreeksAllRight): Default: + OptionHistoryTradeGreeksAllRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryTradeGreeksAllRateType): Default: + OptionHistoryTradeGreeksAllRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryTradeGreeksAllFormat): Default: + OptionHistoryTradeGreeksAllFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryTradeGreeksAllResponse200 + """ + + + return sync_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeGreeksAllRight = OptionHistoryTradeGreeksAllRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryTradeGreeksAllRateType = OptionHistoryTradeGreeksAllRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryTradeGreeksAllFormat = OptionHistoryTradeGreeksAllFormat.NDJSON, + +) -> Response[OptionHistoryTradeGreeksAllResponse200]: + """ All Trade Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryTradeGreeksAllRight): Default: + OptionHistoryTradeGreeksAllRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryTradeGreeksAllRateType): Default: + OptionHistoryTradeGreeksAllRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryTradeGreeksAllFormat): Default: + OptionHistoryTradeGreeksAllFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryTradeGreeksAllResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeGreeksAllRight = OptionHistoryTradeGreeksAllRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryTradeGreeksAllRateType = OptionHistoryTradeGreeksAllRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryTradeGreeksAllFormat = OptionHistoryTradeGreeksAllFormat.NDJSON, + +) -> OptionHistoryTradeGreeksAllResponse200 | None: + """ All Trade Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryTradeGreeksAllRight): Default: + OptionHistoryTradeGreeksAllRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryTradeGreeksAllRateType): Default: + OptionHistoryTradeGreeksAllRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryTradeGreeksAllFormat): Default: + OptionHistoryTradeGreeksAllFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryTradeGreeksAllResponse200 + """ + + + return (await asyncio_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_history_trade_greeks_first_order.py b/openapi_project/openapi_package/api/option/option_history_trade_greeks_first_order.py new file mode 100644 index 000000000..c974a269c --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_history_trade_greeks_first_order.py @@ -0,0 +1,376 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_history_trade_greeks_first_order_format import OptionHistoryTradeGreeksFirstOrderFormat +from openapi_project.openapi_package.models.option_history_trade_greeks_first_order_rate_type import OptionHistoryTradeGreeksFirstOrderRateType +from openapi_project.openapi_package.models.option_history_trade_greeks_first_order_response_200 import OptionHistoryTradeGreeksFirstOrderResponse200 +from openapi_project.openapi_package.models.option_history_trade_greeks_first_order_right import OptionHistoryTradeGreeksFirstOrderRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeGreeksFirstOrderRight = OptionHistoryTradeGreeksFirstOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryTradeGreeksFirstOrderRateType = OptionHistoryTradeGreeksFirstOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryTradeGreeksFirstOrderFormat = OptionHistoryTradeGreeksFirstOrderFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_date = date.isoformat() + params["date"] = json_date + + params["symbol"] = symbol + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + params["start_time"] = start_time + + params["end_time"] = end_time + + params["annual_dividend"] = annual_dividend + + json_rate_type: Unset | str = UNSET if isinstance(rate_type, Unset) else rate_type.value + + params["rate_type"] = json_rate_type + + params["rate_value"] = rate_value + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/history/trade_greeks/first_order", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryTradeGreeksFirstOrderResponse200 | None: + if response.status_code == 200: + response_200 = OptionHistoryTradeGreeksFirstOrderResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryTradeGreeksFirstOrderResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeGreeksFirstOrderRight = OptionHistoryTradeGreeksFirstOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryTradeGreeksFirstOrderRateType = OptionHistoryTradeGreeksFirstOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryTradeGreeksFirstOrderFormat = OptionHistoryTradeGreeksFirstOrderFormat.NDJSON, + +) -> Response[OptionHistoryTradeGreeksFirstOrderResponse200]: + """ First Order Trade Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryTradeGreeksFirstOrderRight): Default: + OptionHistoryTradeGreeksFirstOrderRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryTradeGreeksFirstOrderRateType): Default: + OptionHistoryTradeGreeksFirstOrderRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryTradeGreeksFirstOrderFormat): Default: + OptionHistoryTradeGreeksFirstOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryTradeGreeksFirstOrderResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeGreeksFirstOrderRight = OptionHistoryTradeGreeksFirstOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryTradeGreeksFirstOrderRateType = OptionHistoryTradeGreeksFirstOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryTradeGreeksFirstOrderFormat = OptionHistoryTradeGreeksFirstOrderFormat.NDJSON, + +) -> OptionHistoryTradeGreeksFirstOrderResponse200 | None: + """ First Order Trade Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryTradeGreeksFirstOrderRight): Default: + OptionHistoryTradeGreeksFirstOrderRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryTradeGreeksFirstOrderRateType): Default: + OptionHistoryTradeGreeksFirstOrderRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryTradeGreeksFirstOrderFormat): Default: + OptionHistoryTradeGreeksFirstOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryTradeGreeksFirstOrderResponse200 + """ + + + return sync_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeGreeksFirstOrderRight = OptionHistoryTradeGreeksFirstOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryTradeGreeksFirstOrderRateType = OptionHistoryTradeGreeksFirstOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryTradeGreeksFirstOrderFormat = OptionHistoryTradeGreeksFirstOrderFormat.NDJSON, + +) -> Response[OptionHistoryTradeGreeksFirstOrderResponse200]: + """ First Order Trade Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryTradeGreeksFirstOrderRight): Default: + OptionHistoryTradeGreeksFirstOrderRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryTradeGreeksFirstOrderRateType): Default: + OptionHistoryTradeGreeksFirstOrderRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryTradeGreeksFirstOrderFormat): Default: + OptionHistoryTradeGreeksFirstOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryTradeGreeksFirstOrderResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeGreeksFirstOrderRight = OptionHistoryTradeGreeksFirstOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryTradeGreeksFirstOrderRateType = OptionHistoryTradeGreeksFirstOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryTradeGreeksFirstOrderFormat = OptionHistoryTradeGreeksFirstOrderFormat.NDJSON, + +) -> OptionHistoryTradeGreeksFirstOrderResponse200 | None: + """ First Order Trade Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryTradeGreeksFirstOrderRight): Default: + OptionHistoryTradeGreeksFirstOrderRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryTradeGreeksFirstOrderRateType): Default: + OptionHistoryTradeGreeksFirstOrderRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryTradeGreeksFirstOrderFormat): Default: + OptionHistoryTradeGreeksFirstOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryTradeGreeksFirstOrderResponse200 + """ + + + return (await asyncio_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_history_trade_greeks_implied_volatility.py b/openapi_project/openapi_package/api/option/option_history_trade_greeks_implied_volatility.py new file mode 100644 index 000000000..148afa23a --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_history_trade_greeks_implied_volatility.py @@ -0,0 +1,376 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_history_trade_greeks_implied_volatility_format import OptionHistoryTradeGreeksImpliedVolatilityFormat +from openapi_project.openapi_package.models.option_history_trade_greeks_implied_volatility_rate_type import OptionHistoryTradeGreeksImpliedVolatilityRateType +from openapi_project.openapi_package.models.option_history_trade_greeks_implied_volatility_response_200 import OptionHistoryTradeGreeksImpliedVolatilityResponse200 +from openapi_project.openapi_package.models.option_history_trade_greeks_implied_volatility_right import OptionHistoryTradeGreeksImpliedVolatilityRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeGreeksImpliedVolatilityRight = OptionHistoryTradeGreeksImpliedVolatilityRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryTradeGreeksImpliedVolatilityRateType = OptionHistoryTradeGreeksImpliedVolatilityRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryTradeGreeksImpliedVolatilityFormat = OptionHistoryTradeGreeksImpliedVolatilityFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_date = date.isoformat() + params["date"] = json_date + + params["symbol"] = symbol + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + params["start_time"] = start_time + + params["end_time"] = end_time + + params["annual_dividend"] = annual_dividend + + json_rate_type: Unset | str = UNSET if isinstance(rate_type, Unset) else rate_type.value + + params["rate_type"] = json_rate_type + + params["rate_value"] = rate_value + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/history/trade_greeks/implied_volatility", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryTradeGreeksImpliedVolatilityResponse200 | None: + if response.status_code == 200: + response_200 = OptionHistoryTradeGreeksImpliedVolatilityResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryTradeGreeksImpliedVolatilityResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeGreeksImpliedVolatilityRight = OptionHistoryTradeGreeksImpliedVolatilityRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryTradeGreeksImpliedVolatilityRateType = OptionHistoryTradeGreeksImpliedVolatilityRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryTradeGreeksImpliedVolatilityFormat = OptionHistoryTradeGreeksImpliedVolatilityFormat.NDJSON, + +) -> Response[OptionHistoryTradeGreeksImpliedVolatilityResponse200]: + """ Trade Implied Volatility + + - Returns implied volatilies calculated using the trade reported by [OPRA](/Articles/Data-And- + Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryTradeGreeksImpliedVolatilityRight): Default: + OptionHistoryTradeGreeksImpliedVolatilityRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryTradeGreeksImpliedVolatilityRateType): Default: + OptionHistoryTradeGreeksImpliedVolatilityRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryTradeGreeksImpliedVolatilityFormat): Default: + OptionHistoryTradeGreeksImpliedVolatilityFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryTradeGreeksImpliedVolatilityResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeGreeksImpliedVolatilityRight = OptionHistoryTradeGreeksImpliedVolatilityRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryTradeGreeksImpliedVolatilityRateType = OptionHistoryTradeGreeksImpliedVolatilityRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryTradeGreeksImpliedVolatilityFormat = OptionHistoryTradeGreeksImpliedVolatilityFormat.NDJSON, + +) -> OptionHistoryTradeGreeksImpliedVolatilityResponse200 | None: + """ Trade Implied Volatility + + - Returns implied volatilies calculated using the trade reported by [OPRA](/Articles/Data-And- + Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryTradeGreeksImpliedVolatilityRight): Default: + OptionHistoryTradeGreeksImpliedVolatilityRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryTradeGreeksImpliedVolatilityRateType): Default: + OptionHistoryTradeGreeksImpliedVolatilityRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryTradeGreeksImpliedVolatilityFormat): Default: + OptionHistoryTradeGreeksImpliedVolatilityFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryTradeGreeksImpliedVolatilityResponse200 + """ + + + return sync_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeGreeksImpliedVolatilityRight = OptionHistoryTradeGreeksImpliedVolatilityRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryTradeGreeksImpliedVolatilityRateType = OptionHistoryTradeGreeksImpliedVolatilityRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryTradeGreeksImpliedVolatilityFormat = OptionHistoryTradeGreeksImpliedVolatilityFormat.NDJSON, + +) -> Response[OptionHistoryTradeGreeksImpliedVolatilityResponse200]: + """ Trade Implied Volatility + + - Returns implied volatilies calculated using the trade reported by [OPRA](/Articles/Data-And- + Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryTradeGreeksImpliedVolatilityRight): Default: + OptionHistoryTradeGreeksImpliedVolatilityRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryTradeGreeksImpliedVolatilityRateType): Default: + OptionHistoryTradeGreeksImpliedVolatilityRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryTradeGreeksImpliedVolatilityFormat): Default: + OptionHistoryTradeGreeksImpliedVolatilityFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryTradeGreeksImpliedVolatilityResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeGreeksImpliedVolatilityRight = OptionHistoryTradeGreeksImpliedVolatilityRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryTradeGreeksImpliedVolatilityRateType = OptionHistoryTradeGreeksImpliedVolatilityRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryTradeGreeksImpliedVolatilityFormat = OptionHistoryTradeGreeksImpliedVolatilityFormat.NDJSON, + +) -> OptionHistoryTradeGreeksImpliedVolatilityResponse200 | None: + """ Trade Implied Volatility + + - Returns implied volatilies calculated using the trade reported by [OPRA](/Articles/Data-And- + Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryTradeGreeksImpliedVolatilityRight): Default: + OptionHistoryTradeGreeksImpliedVolatilityRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryTradeGreeksImpliedVolatilityRateType): Default: + OptionHistoryTradeGreeksImpliedVolatilityRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryTradeGreeksImpliedVolatilityFormat): Default: + OptionHistoryTradeGreeksImpliedVolatilityFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryTradeGreeksImpliedVolatilityResponse200 + """ + + + return (await asyncio_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_history_trade_greeks_second_order.py b/openapi_project/openapi_package/api/option/option_history_trade_greeks_second_order.py new file mode 100644 index 000000000..6052b34b3 --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_history_trade_greeks_second_order.py @@ -0,0 +1,376 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_history_trade_greeks_second_order_format import OptionHistoryTradeGreeksSecondOrderFormat +from openapi_project.openapi_package.models.option_history_trade_greeks_second_order_rate_type import OptionHistoryTradeGreeksSecondOrderRateType +from openapi_project.openapi_package.models.option_history_trade_greeks_second_order_response_200 import OptionHistoryTradeGreeksSecondOrderResponse200 +from openapi_project.openapi_package.models.option_history_trade_greeks_second_order_right import OptionHistoryTradeGreeksSecondOrderRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeGreeksSecondOrderRight = OptionHistoryTradeGreeksSecondOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryTradeGreeksSecondOrderRateType = OptionHistoryTradeGreeksSecondOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryTradeGreeksSecondOrderFormat = OptionHistoryTradeGreeksSecondOrderFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_date = date.isoformat() + params["date"] = json_date + + params["symbol"] = symbol + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + params["start_time"] = start_time + + params["end_time"] = end_time + + params["annual_dividend"] = annual_dividend + + json_rate_type: Unset | str = UNSET if isinstance(rate_type, Unset) else rate_type.value + + params["rate_type"] = json_rate_type + + params["rate_value"] = rate_value + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/history/trade_greeks/second_order", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryTradeGreeksSecondOrderResponse200 | None: + if response.status_code == 200: + response_200 = OptionHistoryTradeGreeksSecondOrderResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryTradeGreeksSecondOrderResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeGreeksSecondOrderRight = OptionHistoryTradeGreeksSecondOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryTradeGreeksSecondOrderRateType = OptionHistoryTradeGreeksSecondOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryTradeGreeksSecondOrderFormat = OptionHistoryTradeGreeksSecondOrderFormat.NDJSON, + +) -> Response[OptionHistoryTradeGreeksSecondOrderResponse200]: + """ Second Order Trade Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryTradeGreeksSecondOrderRight): Default: + OptionHistoryTradeGreeksSecondOrderRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryTradeGreeksSecondOrderRateType): Default: + OptionHistoryTradeGreeksSecondOrderRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryTradeGreeksSecondOrderFormat): Default: + OptionHistoryTradeGreeksSecondOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryTradeGreeksSecondOrderResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeGreeksSecondOrderRight = OptionHistoryTradeGreeksSecondOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryTradeGreeksSecondOrderRateType = OptionHistoryTradeGreeksSecondOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryTradeGreeksSecondOrderFormat = OptionHistoryTradeGreeksSecondOrderFormat.NDJSON, + +) -> OptionHistoryTradeGreeksSecondOrderResponse200 | None: + """ Second Order Trade Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryTradeGreeksSecondOrderRight): Default: + OptionHistoryTradeGreeksSecondOrderRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryTradeGreeksSecondOrderRateType): Default: + OptionHistoryTradeGreeksSecondOrderRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryTradeGreeksSecondOrderFormat): Default: + OptionHistoryTradeGreeksSecondOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryTradeGreeksSecondOrderResponse200 + """ + + + return sync_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeGreeksSecondOrderRight = OptionHistoryTradeGreeksSecondOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryTradeGreeksSecondOrderRateType = OptionHistoryTradeGreeksSecondOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryTradeGreeksSecondOrderFormat = OptionHistoryTradeGreeksSecondOrderFormat.NDJSON, + +) -> Response[OptionHistoryTradeGreeksSecondOrderResponse200]: + """ Second Order Trade Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryTradeGreeksSecondOrderRight): Default: + OptionHistoryTradeGreeksSecondOrderRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryTradeGreeksSecondOrderRateType): Default: + OptionHistoryTradeGreeksSecondOrderRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryTradeGreeksSecondOrderFormat): Default: + OptionHistoryTradeGreeksSecondOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryTradeGreeksSecondOrderResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeGreeksSecondOrderRight = OptionHistoryTradeGreeksSecondOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryTradeGreeksSecondOrderRateType = OptionHistoryTradeGreeksSecondOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryTradeGreeksSecondOrderFormat = OptionHistoryTradeGreeksSecondOrderFormat.NDJSON, + +) -> OptionHistoryTradeGreeksSecondOrderResponse200 | None: + """ Second Order Trade Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryTradeGreeksSecondOrderRight): Default: + OptionHistoryTradeGreeksSecondOrderRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryTradeGreeksSecondOrderRateType): Default: + OptionHistoryTradeGreeksSecondOrderRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryTradeGreeksSecondOrderFormat): Default: + OptionHistoryTradeGreeksSecondOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryTradeGreeksSecondOrderResponse200 + """ + + + return (await asyncio_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_history_trade_greeks_third_order.py b/openapi_project/openapi_package/api/option/option_history_trade_greeks_third_order.py new file mode 100644 index 000000000..a862db5e9 --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_history_trade_greeks_third_order.py @@ -0,0 +1,376 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_history_trade_greeks_third_order_format import OptionHistoryTradeGreeksThirdOrderFormat +from openapi_project.openapi_package.models.option_history_trade_greeks_third_order_rate_type import OptionHistoryTradeGreeksThirdOrderRateType +from openapi_project.openapi_package.models.option_history_trade_greeks_third_order_response_200 import OptionHistoryTradeGreeksThirdOrderResponse200 +from openapi_project.openapi_package.models.option_history_trade_greeks_third_order_right import OptionHistoryTradeGreeksThirdOrderRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeGreeksThirdOrderRight = OptionHistoryTradeGreeksThirdOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryTradeGreeksThirdOrderRateType = OptionHistoryTradeGreeksThirdOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryTradeGreeksThirdOrderFormat = OptionHistoryTradeGreeksThirdOrderFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_date = date.isoformat() + params["date"] = json_date + + params["symbol"] = symbol + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + params["start_time"] = start_time + + params["end_time"] = end_time + + params["annual_dividend"] = annual_dividend + + json_rate_type: Unset | str = UNSET if isinstance(rate_type, Unset) else rate_type.value + + params["rate_type"] = json_rate_type + + params["rate_value"] = rate_value + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/history/trade_greeks/third_order", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryTradeGreeksThirdOrderResponse200 | None: + if response.status_code == 200: + response_200 = OptionHistoryTradeGreeksThirdOrderResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryTradeGreeksThirdOrderResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeGreeksThirdOrderRight = OptionHistoryTradeGreeksThirdOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryTradeGreeksThirdOrderRateType = OptionHistoryTradeGreeksThirdOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryTradeGreeksThirdOrderFormat = OptionHistoryTradeGreeksThirdOrderFormat.NDJSON, + +) -> Response[OptionHistoryTradeGreeksThirdOrderResponse200]: + """ Third Order Trade Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryTradeGreeksThirdOrderRight): Default: + OptionHistoryTradeGreeksThirdOrderRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryTradeGreeksThirdOrderRateType): Default: + OptionHistoryTradeGreeksThirdOrderRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryTradeGreeksThirdOrderFormat): Default: + OptionHistoryTradeGreeksThirdOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryTradeGreeksThirdOrderResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeGreeksThirdOrderRight = OptionHistoryTradeGreeksThirdOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryTradeGreeksThirdOrderRateType = OptionHistoryTradeGreeksThirdOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryTradeGreeksThirdOrderFormat = OptionHistoryTradeGreeksThirdOrderFormat.NDJSON, + +) -> OptionHistoryTradeGreeksThirdOrderResponse200 | None: + """ Third Order Trade Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryTradeGreeksThirdOrderRight): Default: + OptionHistoryTradeGreeksThirdOrderRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryTradeGreeksThirdOrderRateType): Default: + OptionHistoryTradeGreeksThirdOrderRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryTradeGreeksThirdOrderFormat): Default: + OptionHistoryTradeGreeksThirdOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryTradeGreeksThirdOrderResponse200 + """ + + + return sync_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeGreeksThirdOrderRight = OptionHistoryTradeGreeksThirdOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryTradeGreeksThirdOrderRateType = OptionHistoryTradeGreeksThirdOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryTradeGreeksThirdOrderFormat = OptionHistoryTradeGreeksThirdOrderFormat.NDJSON, + +) -> Response[OptionHistoryTradeGreeksThirdOrderResponse200]: + """ Third Order Trade Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryTradeGreeksThirdOrderRight): Default: + OptionHistoryTradeGreeksThirdOrderRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryTradeGreeksThirdOrderRateType): Default: + OptionHistoryTradeGreeksThirdOrderRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryTradeGreeksThirdOrderFormat): Default: + OptionHistoryTradeGreeksThirdOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryTradeGreeksThirdOrderResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeGreeksThirdOrderRight = OptionHistoryTradeGreeksThirdOrderRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionHistoryTradeGreeksThirdOrderRateType = OptionHistoryTradeGreeksThirdOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + format_: Unset | OptionHistoryTradeGreeksThirdOrderFormat = OptionHistoryTradeGreeksThirdOrderFormat.NDJSON, + +) -> OptionHistoryTradeGreeksThirdOrderResponse200 | None: + """ Third Order Trade Greeks + + - Returns the data for all contracts that share the same provided symbol and expiration. + - Calculates greeks for every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). + - The underlying price represents whatever the last underlying price was at the ``timestamp`` field. + You can read more about how Thetadata calculates greeks [here](/Articles/Data-And-Requests/Option- + Greeks.html). + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryTradeGreeksThirdOrderRight): Default: + OptionHistoryTradeGreeksThirdOrderRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + annual_dividend (Unset | float): + rate_type (Unset | OptionHistoryTradeGreeksThirdOrderRateType): Default: + OptionHistoryTradeGreeksThirdOrderRateType.SOFR. + rate_value (Unset | float): + format_ (Unset | OptionHistoryTradeGreeksThirdOrderFormat): Default: + OptionHistoryTradeGreeksThirdOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryTradeGreeksThirdOrderResponse200 + """ + + + return (await asyncio_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_history_trade_quote.py b/openapi_project/openapi_package/api/option/option_history_trade_quote.py new file mode 100644 index 000000000..e441dfa7f --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_history_trade_quote.py @@ -0,0 +1,343 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_history_trade_quote_format import OptionHistoryTradeQuoteFormat +from openapi_project.openapi_package.models.option_history_trade_quote_response_200 import OptionHistoryTradeQuoteResponse200 +from openapi_project.openapi_package.models.option_history_trade_quote_right import OptionHistoryTradeQuoteRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeQuoteRight = OptionHistoryTradeQuoteRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + exclusive: Unset | bool = True, + format_: Unset | OptionHistoryTradeQuoteFormat = OptionHistoryTradeQuoteFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_date = date.isoformat() + params["date"] = json_date + + params["symbol"] = symbol + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + params["start_time"] = start_time + + params["end_time"] = end_time + + params["exclusive"] = exclusive + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/history/trade_quote", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryTradeQuoteResponse200 | None: + if response.status_code == 200: + response_200 = OptionHistoryTradeQuoteResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryTradeQuoteResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeQuoteRight = OptionHistoryTradeQuoteRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + exclusive: Unset | bool = True, + format_: Unset | OptionHistoryTradeQuoteFormat = OptionHistoryTradeQuoteFormat.NDJSON, + +) -> Response[OptionHistoryTradeQuoteResponse200]: + """ Trade Quote + + - Returns every [trade](/operations/option_history_trade.html) reported by [OPRA](/Articles/Data- + And-Requests/The-SIPs.html) paired with the last NBBO quote reported by [OPRA](/Articles/Data-And- + Requests/The-SIPs.html) at the time of trade. + - A quote is matched with a trade if its timestamp ``<=`` the trade timestamp. + - To match trades with quotes timestamps that are ``<`` the trade timestamp, specify the + ``exclusive``parameter to ``true``. After thorough testing, we have determined that using + ``exclusive=true`` might yield better results for various applications. + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryTradeQuoteRight): Default: OptionHistoryTradeQuoteRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + exclusive (Unset | bool): Default: True. + format_ (Unset | OptionHistoryTradeQuoteFormat): Default: + OptionHistoryTradeQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryTradeQuoteResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +exclusive=exclusive, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeQuoteRight = OptionHistoryTradeQuoteRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + exclusive: Unset | bool = True, + format_: Unset | OptionHistoryTradeQuoteFormat = OptionHistoryTradeQuoteFormat.NDJSON, + +) -> OptionHistoryTradeQuoteResponse200 | None: + """ Trade Quote + + - Returns every [trade](/operations/option_history_trade.html) reported by [OPRA](/Articles/Data- + And-Requests/The-SIPs.html) paired with the last NBBO quote reported by [OPRA](/Articles/Data-And- + Requests/The-SIPs.html) at the time of trade. + - A quote is matched with a trade if its timestamp ``<=`` the trade timestamp. + - To match trades with quotes timestamps that are ``<`` the trade timestamp, specify the + ``exclusive``parameter to ``true``. After thorough testing, we have determined that using + ``exclusive=true`` might yield better results for various applications. + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryTradeQuoteRight): Default: OptionHistoryTradeQuoteRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + exclusive (Unset | bool): Default: True. + format_ (Unset | OptionHistoryTradeQuoteFormat): Default: + OptionHistoryTradeQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryTradeQuoteResponse200 + """ + + + return sync_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +exclusive=exclusive, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeQuoteRight = OptionHistoryTradeQuoteRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + exclusive: Unset | bool = True, + format_: Unset | OptionHistoryTradeQuoteFormat = OptionHistoryTradeQuoteFormat.NDJSON, + +) -> Response[OptionHistoryTradeQuoteResponse200]: + """ Trade Quote + + - Returns every [trade](/operations/option_history_trade.html) reported by [OPRA](/Articles/Data- + And-Requests/The-SIPs.html) paired with the last NBBO quote reported by [OPRA](/Articles/Data-And- + Requests/The-SIPs.html) at the time of trade. + - A quote is matched with a trade if its timestamp ``<=`` the trade timestamp. + - To match trades with quotes timestamps that are ``<`` the trade timestamp, specify the + ``exclusive``parameter to ``true``. After thorough testing, we have determined that using + ``exclusive=true`` might yield better results for various applications. + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryTradeQuoteRight): Default: OptionHistoryTradeQuoteRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + exclusive (Unset | bool): Default: True. + format_ (Unset | OptionHistoryTradeQuoteFormat): Default: + OptionHistoryTradeQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionHistoryTradeQuoteResponse200] + """ + + + kwargs = _get_kwargs( + date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +exclusive=exclusive, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + date: datetime.date, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionHistoryTradeQuoteRight = OptionHistoryTradeQuoteRight.BOTH, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + exclusive: Unset | bool = True, + format_: Unset | OptionHistoryTradeQuoteFormat = OptionHistoryTradeQuoteFormat.NDJSON, + +) -> OptionHistoryTradeQuoteResponse200 | None: + """ Trade Quote + + - Returns every [trade](/operations/option_history_trade.html) reported by [OPRA](/Articles/Data- + And-Requests/The-SIPs.html) paired with the last NBBO quote reported by [OPRA](/Articles/Data-And- + Requests/The-SIPs.html) at the time of trade. + - A quote is matched with a trade if its timestamp ``<=`` the trade timestamp. + - To match trades with quotes timestamps that are ``<`` the trade timestamp, specify the + ``exclusive``parameter to ``true``. After thorough testing, we have determined that using + ``exclusive=true`` might yield better results for various applications. + + Args: + date (datetime.date): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionHistoryTradeQuoteRight): Default: OptionHistoryTradeQuoteRight.BOTH. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + exclusive (Unset | bool): Default: True. + format_ (Unset | OptionHistoryTradeQuoteFormat): Default: + OptionHistoryTradeQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionHistoryTradeQuoteResponse200 + """ + + + return (await asyncio_detailed( + client=client, +date=date, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +start_time=start_time, +end_time=end_time, +exclusive=exclusive, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_list_contracts.py b/openapi_project/openapi_package/api/option/option_list_contracts.py new file mode 100644 index 000000000..99792cc0c --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_list_contracts.py @@ -0,0 +1,260 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_list_contracts_format import OptionListContractsFormat +from openapi_project.openapi_package.models.option_list_contracts_request_type import OptionListContractsRequestType +from openapi_project.openapi_package.models.option_list_contracts_response_200 import OptionListContractsResponse200 +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + request_type: OptionListContractsRequestType, + *, + symbol: Unset | list[str] = UNSET, + date: datetime.date, + format_: Unset | OptionListContractsFormat = OptionListContractsFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_symbol: Unset | list[str] = UNSET + if not isinstance(symbol, Unset): + json_symbol = symbol + + + params["symbol"] = json_symbol + + json_date = date.isoformat() + params["date"] = json_date + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/list/contracts/{request_type}".format(request_type=request_type,), + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionListContractsResponse200 | None: + if response.status_code == 200: + response_200 = OptionListContractsResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionListContractsResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + request_type: OptionListContractsRequestType, + *, + client: AuthenticatedClient | Client, + symbol: Unset | list[str] = UNSET, + date: datetime.date, + format_: Unset | OptionListContractsFormat = OptionListContractsFormat.NDJSON, + +) -> Response[OptionListContractsResponse200]: + """ Contracts + + Lists all contracts that were traded or quoted on a particular date. + + If the ``symbol`` parameter is specified, the returned contracts will be filtered to match the + symbol. + Multiple symbols can be specified by separating them with commas such as ``symbol=AAPL,SPY,AMD`` + This endpoint is updated real-time. + + Args: + request_type (OptionListContractsRequestType): + symbol (Unset | list[str]): + date (datetime.date): + format_ (Unset | OptionListContractsFormat): Default: OptionListContractsFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionListContractsResponse200] + """ + + + kwargs = _get_kwargs( + request_type=request_type, +symbol=symbol, +date=date, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + request_type: OptionListContractsRequestType, + *, + client: AuthenticatedClient | Client, + symbol: Unset | list[str] = UNSET, + date: datetime.date, + format_: Unset | OptionListContractsFormat = OptionListContractsFormat.NDJSON, + +) -> OptionListContractsResponse200 | None: + """ Contracts + + Lists all contracts that were traded or quoted on a particular date. + + If the ``symbol`` parameter is specified, the returned contracts will be filtered to match the + symbol. + Multiple symbols can be specified by separating them with commas such as ``symbol=AAPL,SPY,AMD`` + This endpoint is updated real-time. + + Args: + request_type (OptionListContractsRequestType): + symbol (Unset | list[str]): + date (datetime.date): + format_ (Unset | OptionListContractsFormat): Default: OptionListContractsFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionListContractsResponse200 + """ + + + return sync_detailed( + request_type=request_type, +client=client, +symbol=symbol, +date=date, +format_=format_, + + ).parsed + +async def asyncio_detailed( + request_type: OptionListContractsRequestType, + *, + client: AuthenticatedClient | Client, + symbol: Unset | list[str] = UNSET, + date: datetime.date, + format_: Unset | OptionListContractsFormat = OptionListContractsFormat.NDJSON, + +) -> Response[OptionListContractsResponse200]: + """ Contracts + + Lists all contracts that were traded or quoted on a particular date. + + If the ``symbol`` parameter is specified, the returned contracts will be filtered to match the + symbol. + Multiple symbols can be specified by separating them with commas such as ``symbol=AAPL,SPY,AMD`` + This endpoint is updated real-time. + + Args: + request_type (OptionListContractsRequestType): + symbol (Unset | list[str]): + date (datetime.date): + format_ (Unset | OptionListContractsFormat): Default: OptionListContractsFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionListContractsResponse200] + """ + + + kwargs = _get_kwargs( + request_type=request_type, +symbol=symbol, +date=date, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + request_type: OptionListContractsRequestType, + *, + client: AuthenticatedClient | Client, + symbol: Unset | list[str] = UNSET, + date: datetime.date, + format_: Unset | OptionListContractsFormat = OptionListContractsFormat.NDJSON, + +) -> OptionListContractsResponse200 | None: + """ Contracts + + Lists all contracts that were traded or quoted on a particular date. + + If the ``symbol`` parameter is specified, the returned contracts will be filtered to match the + symbol. + Multiple symbols can be specified by separating them with commas such as ``symbol=AAPL,SPY,AMD`` + This endpoint is updated real-time. + + Args: + request_type (OptionListContractsRequestType): + symbol (Unset | list[str]): + date (datetime.date): + format_ (Unset | OptionListContractsFormat): Default: OptionListContractsFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionListContractsResponse200 + """ + + + return (await asyncio_detailed( + request_type=request_type, +client=client, +symbol=symbol, +date=date, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_list_dates.py b/openapi_project/openapi_package/api/option/option_list_dates.py new file mode 100644 index 000000000..a4154eabc --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_list_dates.py @@ -0,0 +1,276 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_list_dates_format import OptionListDatesFormat +from openapi_project.openapi_package.models.option_list_dates_request_type import OptionListDatesRequestType +from openapi_project.openapi_package.models.option_list_dates_response_200 import OptionListDatesResponse200 +from openapi_project.openapi_package.models.option_list_dates_right import OptionListDatesRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + request_type: OptionListDatesRequestType, + *, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionListDatesRight = OptionListDatesRight.BOTH, + format_: Unset | OptionListDatesFormat = OptionListDatesFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["symbol"] = symbol + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/list/dates/{request_type}".format(request_type=request_type,), + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionListDatesResponse200 | None: + if response.status_code == 200: + response_200 = OptionListDatesResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionListDatesResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + request_type: OptionListDatesRequestType, + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionListDatesRight = OptionListDatesRight.BOTH, + format_: Unset | OptionListDatesFormat = OptionListDatesFormat.NDJSON, + +) -> Response[OptionListDatesResponse200]: + """ Dates + + Lists all dates of data that are available for an option with a given symbol, request type, and + expiration. + This endpoint is updated overnight. + + Args: + request_type (OptionListDatesRequestType): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionListDatesRight): Default: OptionListDatesRight.BOTH. + format_ (Unset | OptionListDatesFormat): Default: OptionListDatesFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionListDatesResponse200] + """ + + + kwargs = _get_kwargs( + request_type=request_type, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + request_type: OptionListDatesRequestType, + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionListDatesRight = OptionListDatesRight.BOTH, + format_: Unset | OptionListDatesFormat = OptionListDatesFormat.NDJSON, + +) -> OptionListDatesResponse200 | None: + """ Dates + + Lists all dates of data that are available for an option with a given symbol, request type, and + expiration. + This endpoint is updated overnight. + + Args: + request_type (OptionListDatesRequestType): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionListDatesRight): Default: OptionListDatesRight.BOTH. + format_ (Unset | OptionListDatesFormat): Default: OptionListDatesFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionListDatesResponse200 + """ + + + return sync_detailed( + request_type=request_type, +client=client, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + ).parsed + +async def asyncio_detailed( + request_type: OptionListDatesRequestType, + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionListDatesRight = OptionListDatesRight.BOTH, + format_: Unset | OptionListDatesFormat = OptionListDatesFormat.NDJSON, + +) -> Response[OptionListDatesResponse200]: + """ Dates + + Lists all dates of data that are available for an option with a given symbol, request type, and + expiration. + This endpoint is updated overnight. + + Args: + request_type (OptionListDatesRequestType): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionListDatesRight): Default: OptionListDatesRight.BOTH. + format_ (Unset | OptionListDatesFormat): Default: OptionListDatesFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionListDatesResponse200] + """ + + + kwargs = _get_kwargs( + request_type=request_type, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + request_type: OptionListDatesRequestType, + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionListDatesRight = OptionListDatesRight.BOTH, + format_: Unset | OptionListDatesFormat = OptionListDatesFormat.NDJSON, + +) -> OptionListDatesResponse200 | None: + """ Dates + + Lists all dates of data that are available for an option with a given symbol, request type, and + expiration. + This endpoint is updated overnight. + + Args: + request_type (OptionListDatesRequestType): + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionListDatesRight): Default: OptionListDatesRight.BOTH. + format_ (Unset | OptionListDatesFormat): Default: OptionListDatesFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionListDatesResponse200 + """ + + + return (await asyncio_detailed( + request_type=request_type, +client=client, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_list_expirations.py b/openapi_project/openapi_package/api/option/option_list_expirations.py new file mode 100644 index 000000000..3ed365006 --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_list_expirations.py @@ -0,0 +1,214 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_list_expirations_format import OptionListExpirationsFormat +from openapi_project.openapi_package.models.option_list_expirations_response_200 import OptionListExpirationsResponse200 +from openapi_project.openapi_package.types import UNSET, Unset +from typing import cast + + + +def _get_kwargs( + *, + symbol: list[str], + format_: Unset | OptionListExpirationsFormat = OptionListExpirationsFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_symbol = symbol + + + params["symbol"] = json_symbol + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/list/expirations", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionListExpirationsResponse200 | None: + if response.status_code == 200: + response_200 = OptionListExpirationsResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionListExpirationsResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + format_: Unset | OptionListExpirationsFormat = OptionListExpirationsFormat.NDJSON, + +) -> Response[OptionListExpirationsResponse200]: + """ Expirations + + Lists all dates of expirations that are available for an option with a given symbol. + This endpoint is updated overnight. + + Args: + symbol (list[str]): + format_ (Unset | OptionListExpirationsFormat): Default: + OptionListExpirationsFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionListExpirationsResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + format_: Unset | OptionListExpirationsFormat = OptionListExpirationsFormat.NDJSON, + +) -> OptionListExpirationsResponse200 | None: + """ Expirations + + Lists all dates of expirations that are available for an option with a given symbol. + This endpoint is updated overnight. + + Args: + symbol (list[str]): + format_ (Unset | OptionListExpirationsFormat): Default: + OptionListExpirationsFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionListExpirationsResponse200 + """ + + + return sync_detailed( + client=client, +symbol=symbol, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + format_: Unset | OptionListExpirationsFormat = OptionListExpirationsFormat.NDJSON, + +) -> Response[OptionListExpirationsResponse200]: + """ Expirations + + Lists all dates of expirations that are available for an option with a given symbol. + This endpoint is updated overnight. + + Args: + symbol (list[str]): + format_ (Unset | OptionListExpirationsFormat): Default: + OptionListExpirationsFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionListExpirationsResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + format_: Unset | OptionListExpirationsFormat = OptionListExpirationsFormat.NDJSON, + +) -> OptionListExpirationsResponse200 | None: + """ Expirations + + Lists all dates of expirations that are available for an option with a given symbol. + This endpoint is updated overnight. + + Args: + symbol (list[str]): + format_ (Unset | OptionListExpirationsFormat): Default: + OptionListExpirationsFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionListExpirationsResponse200 + """ + + + return (await asyncio_detailed( + client=client, +symbol=symbol, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_list_strikes.py b/openapi_project/openapi_package/api/option/option_list_strikes.py new file mode 100644 index 000000000..65ef81870 --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_list_strikes.py @@ -0,0 +1,228 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_list_strikes_format import OptionListStrikesFormat +from openapi_project.openapi_package.models.option_list_strikes_response_200 import OptionListStrikesResponse200 +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + symbol: list[str], + expiration: datetime.date, + format_: Unset | OptionListStrikesFormat = OptionListStrikesFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_symbol = symbol + + + params["symbol"] = json_symbol + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/list/strikes", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionListStrikesResponse200 | None: + if response.status_code == 200: + response_200 = OptionListStrikesResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionListStrikesResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + expiration: datetime.date, + format_: Unset | OptionListStrikesFormat = OptionListStrikesFormat.NDJSON, + +) -> Response[OptionListStrikesResponse200]: + """ Strikes + + Lists all strikes that are available for an option with a given symbol and expiration date. + This endpoint is updated overnight. + + Args: + symbol (list[str]): + expiration (datetime.date): + format_ (Unset | OptionListStrikesFormat): Default: OptionListStrikesFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionListStrikesResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +expiration=expiration, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + expiration: datetime.date, + format_: Unset | OptionListStrikesFormat = OptionListStrikesFormat.NDJSON, + +) -> OptionListStrikesResponse200 | None: + """ Strikes + + Lists all strikes that are available for an option with a given symbol and expiration date. + This endpoint is updated overnight. + + Args: + symbol (list[str]): + expiration (datetime.date): + format_ (Unset | OptionListStrikesFormat): Default: OptionListStrikesFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionListStrikesResponse200 + """ + + + return sync_detailed( + client=client, +symbol=symbol, +expiration=expiration, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + expiration: datetime.date, + format_: Unset | OptionListStrikesFormat = OptionListStrikesFormat.NDJSON, + +) -> Response[OptionListStrikesResponse200]: + """ Strikes + + Lists all strikes that are available for an option with a given symbol and expiration date. + This endpoint is updated overnight. + + Args: + symbol (list[str]): + expiration (datetime.date): + format_ (Unset | OptionListStrikesFormat): Default: OptionListStrikesFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionListStrikesResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +expiration=expiration, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + expiration: datetime.date, + format_: Unset | OptionListStrikesFormat = OptionListStrikesFormat.NDJSON, + +) -> OptionListStrikesResponse200 | None: + """ Strikes + + Lists all strikes that are available for an option with a given symbol and expiration date. + This endpoint is updated overnight. + + Args: + symbol (list[str]): + expiration (datetime.date): + format_ (Unset | OptionListStrikesFormat): Default: OptionListStrikesFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionListStrikesResponse200 + """ + + + return (await asyncio_detailed( + client=client, +symbol=symbol, +expiration=expiration, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_list_symbols.py b/openapi_project/openapi_package/api/option/option_list_symbols.py new file mode 100644 index 000000000..83da7f7e2 --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_list_symbols.py @@ -0,0 +1,196 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_list_symbols_format import OptionListSymbolsFormat +from openapi_project.openapi_package.models.option_list_symbols_response_200 import OptionListSymbolsResponse200 +from openapi_project.openapi_package.types import UNSET, Unset +from typing import cast + + + +def _get_kwargs( + *, + format_: Unset | OptionListSymbolsFormat = OptionListSymbolsFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/list/symbols", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionListSymbolsResponse200 | None: + if response.status_code == 200: + response_200 = OptionListSymbolsResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionListSymbolsResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + format_: Unset | OptionListSymbolsFormat = OptionListSymbolsFormat.NDJSON, + +) -> Response[OptionListSymbolsResponse200]: + """ Symbols + + A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also + include: root, ticker, and underlying. This endpoint returns all traded symbols for options. This + endpoint is updated overnight. + + Args: + format_ (Unset | OptionListSymbolsFormat): Default: OptionListSymbolsFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionListSymbolsResponse200] + """ + + + kwargs = _get_kwargs( + format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + format_: Unset | OptionListSymbolsFormat = OptionListSymbolsFormat.NDJSON, + +) -> OptionListSymbolsResponse200 | None: + """ Symbols + + A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also + include: root, ticker, and underlying. This endpoint returns all traded symbols for options. This + endpoint is updated overnight. + + Args: + format_ (Unset | OptionListSymbolsFormat): Default: OptionListSymbolsFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionListSymbolsResponse200 + """ + + + return sync_detailed( + client=client, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + format_: Unset | OptionListSymbolsFormat = OptionListSymbolsFormat.NDJSON, + +) -> Response[OptionListSymbolsResponse200]: + """ Symbols + + A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also + include: root, ticker, and underlying. This endpoint returns all traded symbols for options. This + endpoint is updated overnight. + + Args: + format_ (Unset | OptionListSymbolsFormat): Default: OptionListSymbolsFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionListSymbolsResponse200] + """ + + + kwargs = _get_kwargs( + format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + format_: Unset | OptionListSymbolsFormat = OptionListSymbolsFormat.NDJSON, + +) -> OptionListSymbolsResponse200 | None: + """ Symbols + + A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also + include: root, ticker, and underlying. This endpoint returns all traded symbols for options. This + endpoint is updated overnight. + + Args: + format_ (Unset | OptionListSymbolsFormat): Default: OptionListSymbolsFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionListSymbolsResponse200 + """ + + + return (await asyncio_detailed( + client=client, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_snapshot_greeks_all.py b/openapi_project/openapi_package/api/option/option_snapshot_greeks_all.py new file mode 100644 index 000000000..1d0bf51f2 --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_snapshot_greeks_all.py @@ -0,0 +1,349 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_snapshot_greeks_all_format import OptionSnapshotGreeksAllFormat +from openapi_project.openapi_package.models.option_snapshot_greeks_all_rate_type import OptionSnapshotGreeksAllRateType +from openapi_project.openapi_package.models.option_snapshot_greeks_all_response_200 import OptionSnapshotGreeksAllResponse200 +from openapi_project.openapi_package.models.option_snapshot_greeks_all_right import OptionSnapshotGreeksAllRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotGreeksAllRight = OptionSnapshotGreeksAllRight.BOTH, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionSnapshotGreeksAllRateType = OptionSnapshotGreeksAllRateType.SOFR, + rate_value: Unset | float = UNSET, + stock_price: Unset | float = UNSET, + format_: Unset | OptionSnapshotGreeksAllFormat = OptionSnapshotGreeksAllFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["symbol"] = symbol + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + params["annual_dividend"] = annual_dividend + + json_rate_type: Unset | str = UNSET if isinstance(rate_type, Unset) else rate_type.value + + params["rate_type"] = json_rate_type + + params["rate_value"] = rate_value + + params["stock_price"] = stock_price + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/snapshot/greeks/all", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionSnapshotGreeksAllResponse200 | None: + if response.status_code == 200: + response_200 = OptionSnapshotGreeksAllResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionSnapshotGreeksAllResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotGreeksAllRight = OptionSnapshotGreeksAllRight.BOTH, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionSnapshotGreeksAllRateType = OptionSnapshotGreeksAllRateType.SOFR, + rate_value: Unset | float = UNSET, + stock_price: Unset | float = UNSET, + format_: Unset | OptionSnapshotGreeksAllFormat = OptionSnapshotGreeksAllFormat.NDJSON, + +) -> Response[OptionSnapshotGreeksAllResponse200]: + """ All Greeks + + - Retrieve a real-time last greeks calculation for all option contracts that lie on a provided + expiration. + - You might need to change the default expiration date to a different date if it is past the current + date. Some quotes are omitted in the example to reduce the space of the sample output. + - Make `expiration` * if you want to get the snapshot for every expiration chain for the underlying. + > This endpoint will return no data if the market was closed for the day. Theta Data resets the + snapshot cache at midnight ET every night. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotGreeksAllRight): Default: OptionSnapshotGreeksAllRight.BOTH. + annual_dividend (Unset | float): + rate_type (Unset | OptionSnapshotGreeksAllRateType): Default: + OptionSnapshotGreeksAllRateType.SOFR. + rate_value (Unset | float): + stock_price (Unset | float): + format_ (Unset | OptionSnapshotGreeksAllFormat): Default: + OptionSnapshotGreeksAllFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionSnapshotGreeksAllResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +stock_price=stock_price, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotGreeksAllRight = OptionSnapshotGreeksAllRight.BOTH, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionSnapshotGreeksAllRateType = OptionSnapshotGreeksAllRateType.SOFR, + rate_value: Unset | float = UNSET, + stock_price: Unset | float = UNSET, + format_: Unset | OptionSnapshotGreeksAllFormat = OptionSnapshotGreeksAllFormat.NDJSON, + +) -> OptionSnapshotGreeksAllResponse200 | None: + """ All Greeks + + - Retrieve a real-time last greeks calculation for all option contracts that lie on a provided + expiration. + - You might need to change the default expiration date to a different date if it is past the current + date. Some quotes are omitted in the example to reduce the space of the sample output. + - Make `expiration` * if you want to get the snapshot for every expiration chain for the underlying. + > This endpoint will return no data if the market was closed for the day. Theta Data resets the + snapshot cache at midnight ET every night. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotGreeksAllRight): Default: OptionSnapshotGreeksAllRight.BOTH. + annual_dividend (Unset | float): + rate_type (Unset | OptionSnapshotGreeksAllRateType): Default: + OptionSnapshotGreeksAllRateType.SOFR. + rate_value (Unset | float): + stock_price (Unset | float): + format_ (Unset | OptionSnapshotGreeksAllFormat): Default: + OptionSnapshotGreeksAllFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionSnapshotGreeksAllResponse200 + """ + + + return sync_detailed( + client=client, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +stock_price=stock_price, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotGreeksAllRight = OptionSnapshotGreeksAllRight.BOTH, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionSnapshotGreeksAllRateType = OptionSnapshotGreeksAllRateType.SOFR, + rate_value: Unset | float = UNSET, + stock_price: Unset | float = UNSET, + format_: Unset | OptionSnapshotGreeksAllFormat = OptionSnapshotGreeksAllFormat.NDJSON, + +) -> Response[OptionSnapshotGreeksAllResponse200]: + """ All Greeks + + - Retrieve a real-time last greeks calculation for all option contracts that lie on a provided + expiration. + - You might need to change the default expiration date to a different date if it is past the current + date. Some quotes are omitted in the example to reduce the space of the sample output. + - Make `expiration` * if you want to get the snapshot for every expiration chain for the underlying. + > This endpoint will return no data if the market was closed for the day. Theta Data resets the + snapshot cache at midnight ET every night. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotGreeksAllRight): Default: OptionSnapshotGreeksAllRight.BOTH. + annual_dividend (Unset | float): + rate_type (Unset | OptionSnapshotGreeksAllRateType): Default: + OptionSnapshotGreeksAllRateType.SOFR. + rate_value (Unset | float): + stock_price (Unset | float): + format_ (Unset | OptionSnapshotGreeksAllFormat): Default: + OptionSnapshotGreeksAllFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionSnapshotGreeksAllResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +stock_price=stock_price, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotGreeksAllRight = OptionSnapshotGreeksAllRight.BOTH, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionSnapshotGreeksAllRateType = OptionSnapshotGreeksAllRateType.SOFR, + rate_value: Unset | float = UNSET, + stock_price: Unset | float = UNSET, + format_: Unset | OptionSnapshotGreeksAllFormat = OptionSnapshotGreeksAllFormat.NDJSON, + +) -> OptionSnapshotGreeksAllResponse200 | None: + """ All Greeks + + - Retrieve a real-time last greeks calculation for all option contracts that lie on a provided + expiration. + - You might need to change the default expiration date to a different date if it is past the current + date. Some quotes are omitted in the example to reduce the space of the sample output. + - Make `expiration` * if you want to get the snapshot for every expiration chain for the underlying. + > This endpoint will return no data if the market was closed for the day. Theta Data resets the + snapshot cache at midnight ET every night. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotGreeksAllRight): Default: OptionSnapshotGreeksAllRight.BOTH. + annual_dividend (Unset | float): + rate_type (Unset | OptionSnapshotGreeksAllRateType): Default: + OptionSnapshotGreeksAllRateType.SOFR. + rate_value (Unset | float): + stock_price (Unset | float): + format_ (Unset | OptionSnapshotGreeksAllFormat): Default: + OptionSnapshotGreeksAllFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionSnapshotGreeksAllResponse200 + """ + + + return (await asyncio_detailed( + client=client, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +stock_price=stock_price, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_snapshot_greeks_first_order.py b/openapi_project/openapi_package/api/option/option_snapshot_greeks_first_order.py new file mode 100644 index 000000000..4c7019b50 --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_snapshot_greeks_first_order.py @@ -0,0 +1,353 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_snapshot_greeks_first_order_format import OptionSnapshotGreeksFirstOrderFormat +from openapi_project.openapi_package.models.option_snapshot_greeks_first_order_rate_type import OptionSnapshotGreeksFirstOrderRateType +from openapi_project.openapi_package.models.option_snapshot_greeks_first_order_response_200 import OptionSnapshotGreeksFirstOrderResponse200 +from openapi_project.openapi_package.models.option_snapshot_greeks_first_order_right import OptionSnapshotGreeksFirstOrderRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotGreeksFirstOrderRight = OptionSnapshotGreeksFirstOrderRight.BOTH, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionSnapshotGreeksFirstOrderRateType = OptionSnapshotGreeksFirstOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + stock_price: Unset | float = UNSET, + format_: Unset | OptionSnapshotGreeksFirstOrderFormat = OptionSnapshotGreeksFirstOrderFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["symbol"] = symbol + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + params["annual_dividend"] = annual_dividend + + json_rate_type: Unset | str = UNSET if isinstance(rate_type, Unset) else rate_type.value + + params["rate_type"] = json_rate_type + + params["rate_value"] = rate_value + + params["stock_price"] = stock_price + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/snapshot/greeks/first_order", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionSnapshotGreeksFirstOrderResponse200 | None: + if response.status_code == 200: + response_200 = OptionSnapshotGreeksFirstOrderResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionSnapshotGreeksFirstOrderResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotGreeksFirstOrderRight = OptionSnapshotGreeksFirstOrderRight.BOTH, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionSnapshotGreeksFirstOrderRateType = OptionSnapshotGreeksFirstOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + stock_price: Unset | float = UNSET, + format_: Unset | OptionSnapshotGreeksFirstOrderFormat = OptionSnapshotGreeksFirstOrderFormat.NDJSON, + +) -> Response[OptionSnapshotGreeksFirstOrderResponse200]: + """ First Order Greeks + + - Retrieve a real-time last greeks calculation for all option contracts that lie on a provided + expiration. + - You might need to change the default expiration date to a different date if it is past the current + date. Some quotes are omitted in the example to reduce the space of the sample output. + - Make `expiration` * if you want to get the snapshot for every expiration chain for the underlying. + > This endpoint will return no data if the market was closed for the day. Theta Data resets the + snapshot cache at midnight ET every night. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotGreeksFirstOrderRight): Default: + OptionSnapshotGreeksFirstOrderRight.BOTH. + annual_dividend (Unset | float): + rate_type (Unset | OptionSnapshotGreeksFirstOrderRateType): Default: + OptionSnapshotGreeksFirstOrderRateType.SOFR. + rate_value (Unset | float): + stock_price (Unset | float): + format_ (Unset | OptionSnapshotGreeksFirstOrderFormat): Default: + OptionSnapshotGreeksFirstOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionSnapshotGreeksFirstOrderResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +stock_price=stock_price, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotGreeksFirstOrderRight = OptionSnapshotGreeksFirstOrderRight.BOTH, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionSnapshotGreeksFirstOrderRateType = OptionSnapshotGreeksFirstOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + stock_price: Unset | float = UNSET, + format_: Unset | OptionSnapshotGreeksFirstOrderFormat = OptionSnapshotGreeksFirstOrderFormat.NDJSON, + +) -> OptionSnapshotGreeksFirstOrderResponse200 | None: + """ First Order Greeks + + - Retrieve a real-time last greeks calculation for all option contracts that lie on a provided + expiration. + - You might need to change the default expiration date to a different date if it is past the current + date. Some quotes are omitted in the example to reduce the space of the sample output. + - Make `expiration` * if you want to get the snapshot for every expiration chain for the underlying. + > This endpoint will return no data if the market was closed for the day. Theta Data resets the + snapshot cache at midnight ET every night. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotGreeksFirstOrderRight): Default: + OptionSnapshotGreeksFirstOrderRight.BOTH. + annual_dividend (Unset | float): + rate_type (Unset | OptionSnapshotGreeksFirstOrderRateType): Default: + OptionSnapshotGreeksFirstOrderRateType.SOFR. + rate_value (Unset | float): + stock_price (Unset | float): + format_ (Unset | OptionSnapshotGreeksFirstOrderFormat): Default: + OptionSnapshotGreeksFirstOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionSnapshotGreeksFirstOrderResponse200 + """ + + + return sync_detailed( + client=client, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +stock_price=stock_price, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotGreeksFirstOrderRight = OptionSnapshotGreeksFirstOrderRight.BOTH, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionSnapshotGreeksFirstOrderRateType = OptionSnapshotGreeksFirstOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + stock_price: Unset | float = UNSET, + format_: Unset | OptionSnapshotGreeksFirstOrderFormat = OptionSnapshotGreeksFirstOrderFormat.NDJSON, + +) -> Response[OptionSnapshotGreeksFirstOrderResponse200]: + """ First Order Greeks + + - Retrieve a real-time last greeks calculation for all option contracts that lie on a provided + expiration. + - You might need to change the default expiration date to a different date if it is past the current + date. Some quotes are omitted in the example to reduce the space of the sample output. + - Make `expiration` * if you want to get the snapshot for every expiration chain for the underlying. + > This endpoint will return no data if the market was closed for the day. Theta Data resets the + snapshot cache at midnight ET every night. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotGreeksFirstOrderRight): Default: + OptionSnapshotGreeksFirstOrderRight.BOTH. + annual_dividend (Unset | float): + rate_type (Unset | OptionSnapshotGreeksFirstOrderRateType): Default: + OptionSnapshotGreeksFirstOrderRateType.SOFR. + rate_value (Unset | float): + stock_price (Unset | float): + format_ (Unset | OptionSnapshotGreeksFirstOrderFormat): Default: + OptionSnapshotGreeksFirstOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionSnapshotGreeksFirstOrderResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +stock_price=stock_price, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotGreeksFirstOrderRight = OptionSnapshotGreeksFirstOrderRight.BOTH, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionSnapshotGreeksFirstOrderRateType = OptionSnapshotGreeksFirstOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + stock_price: Unset | float = UNSET, + format_: Unset | OptionSnapshotGreeksFirstOrderFormat = OptionSnapshotGreeksFirstOrderFormat.NDJSON, + +) -> OptionSnapshotGreeksFirstOrderResponse200 | None: + """ First Order Greeks + + - Retrieve a real-time last greeks calculation for all option contracts that lie on a provided + expiration. + - You might need to change the default expiration date to a different date if it is past the current + date. Some quotes are omitted in the example to reduce the space of the sample output. + - Make `expiration` * if you want to get the snapshot for every expiration chain for the underlying. + > This endpoint will return no data if the market was closed for the day. Theta Data resets the + snapshot cache at midnight ET every night. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotGreeksFirstOrderRight): Default: + OptionSnapshotGreeksFirstOrderRight.BOTH. + annual_dividend (Unset | float): + rate_type (Unset | OptionSnapshotGreeksFirstOrderRateType): Default: + OptionSnapshotGreeksFirstOrderRateType.SOFR. + rate_value (Unset | float): + stock_price (Unset | float): + format_ (Unset | OptionSnapshotGreeksFirstOrderFormat): Default: + OptionSnapshotGreeksFirstOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionSnapshotGreeksFirstOrderResponse200 + """ + + + return (await asyncio_detailed( + client=client, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +stock_price=stock_price, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_snapshot_greeks_implied_volatility.py b/openapi_project/openapi_package/api/option/option_snapshot_greeks_implied_volatility.py new file mode 100644 index 000000000..750ae8077 --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_snapshot_greeks_implied_volatility.py @@ -0,0 +1,345 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_snapshot_greeks_implied_volatility_format import OptionSnapshotGreeksImpliedVolatilityFormat +from openapi_project.openapi_package.models.option_snapshot_greeks_implied_volatility_rate_type import OptionSnapshotGreeksImpliedVolatilityRateType +from openapi_project.openapi_package.models.option_snapshot_greeks_implied_volatility_response_200 import OptionSnapshotGreeksImpliedVolatilityResponse200 +from openapi_project.openapi_package.models.option_snapshot_greeks_implied_volatility_right import OptionSnapshotGreeksImpliedVolatilityRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotGreeksImpliedVolatilityRight = OptionSnapshotGreeksImpliedVolatilityRight.BOTH, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionSnapshotGreeksImpliedVolatilityRateType = OptionSnapshotGreeksImpliedVolatilityRateType.SOFR, + rate_value: Unset | float = UNSET, + stock_price: Unset | float = UNSET, + format_: Unset | OptionSnapshotGreeksImpliedVolatilityFormat = OptionSnapshotGreeksImpliedVolatilityFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["symbol"] = symbol + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + params["annual_dividend"] = annual_dividend + + json_rate_type: Unset | str = UNSET if isinstance(rate_type, Unset) else rate_type.value + + params["rate_type"] = json_rate_type + + params["rate_value"] = rate_value + + params["stock_price"] = stock_price + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/snapshot/greeks/implied_volatility", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionSnapshotGreeksImpliedVolatilityResponse200 | None: + if response.status_code == 200: + response_200 = OptionSnapshotGreeksImpliedVolatilityResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionSnapshotGreeksImpliedVolatilityResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotGreeksImpliedVolatilityRight = OptionSnapshotGreeksImpliedVolatilityRight.BOTH, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionSnapshotGreeksImpliedVolatilityRateType = OptionSnapshotGreeksImpliedVolatilityRateType.SOFR, + rate_value: Unset | float = UNSET, + stock_price: Unset | float = UNSET, + format_: Unset | OptionSnapshotGreeksImpliedVolatilityFormat = OptionSnapshotGreeksImpliedVolatilityFormat.NDJSON, + +) -> Response[OptionSnapshotGreeksImpliedVolatilityResponse200]: + """ Implied Volatility + + Returns implied volatilies calculated using the national best bid, mid, and ask price + of the option respectively. The underlying price represents whatever the last underlying price was + at the + ``underlying_timestamp`` field. You can read more about how Thetadata calculates greeks + [here](/Articles/Data-And-Requests/Option-Greeks.html). + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotGreeksImpliedVolatilityRight): Default: + OptionSnapshotGreeksImpliedVolatilityRight.BOTH. + annual_dividend (Unset | float): + rate_type (Unset | OptionSnapshotGreeksImpliedVolatilityRateType): Default: + OptionSnapshotGreeksImpliedVolatilityRateType.SOFR. + rate_value (Unset | float): + stock_price (Unset | float): + format_ (Unset | OptionSnapshotGreeksImpliedVolatilityFormat): Default: + OptionSnapshotGreeksImpliedVolatilityFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionSnapshotGreeksImpliedVolatilityResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +stock_price=stock_price, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotGreeksImpliedVolatilityRight = OptionSnapshotGreeksImpliedVolatilityRight.BOTH, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionSnapshotGreeksImpliedVolatilityRateType = OptionSnapshotGreeksImpliedVolatilityRateType.SOFR, + rate_value: Unset | float = UNSET, + stock_price: Unset | float = UNSET, + format_: Unset | OptionSnapshotGreeksImpliedVolatilityFormat = OptionSnapshotGreeksImpliedVolatilityFormat.NDJSON, + +) -> OptionSnapshotGreeksImpliedVolatilityResponse200 | None: + """ Implied Volatility + + Returns implied volatilies calculated using the national best bid, mid, and ask price + of the option respectively. The underlying price represents whatever the last underlying price was + at the + ``underlying_timestamp`` field. You can read more about how Thetadata calculates greeks + [here](/Articles/Data-And-Requests/Option-Greeks.html). + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotGreeksImpliedVolatilityRight): Default: + OptionSnapshotGreeksImpliedVolatilityRight.BOTH. + annual_dividend (Unset | float): + rate_type (Unset | OptionSnapshotGreeksImpliedVolatilityRateType): Default: + OptionSnapshotGreeksImpliedVolatilityRateType.SOFR. + rate_value (Unset | float): + stock_price (Unset | float): + format_ (Unset | OptionSnapshotGreeksImpliedVolatilityFormat): Default: + OptionSnapshotGreeksImpliedVolatilityFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionSnapshotGreeksImpliedVolatilityResponse200 + """ + + + return sync_detailed( + client=client, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +stock_price=stock_price, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotGreeksImpliedVolatilityRight = OptionSnapshotGreeksImpliedVolatilityRight.BOTH, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionSnapshotGreeksImpliedVolatilityRateType = OptionSnapshotGreeksImpliedVolatilityRateType.SOFR, + rate_value: Unset | float = UNSET, + stock_price: Unset | float = UNSET, + format_: Unset | OptionSnapshotGreeksImpliedVolatilityFormat = OptionSnapshotGreeksImpliedVolatilityFormat.NDJSON, + +) -> Response[OptionSnapshotGreeksImpliedVolatilityResponse200]: + """ Implied Volatility + + Returns implied volatilies calculated using the national best bid, mid, and ask price + of the option respectively. The underlying price represents whatever the last underlying price was + at the + ``underlying_timestamp`` field. You can read more about how Thetadata calculates greeks + [here](/Articles/Data-And-Requests/Option-Greeks.html). + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotGreeksImpliedVolatilityRight): Default: + OptionSnapshotGreeksImpliedVolatilityRight.BOTH. + annual_dividend (Unset | float): + rate_type (Unset | OptionSnapshotGreeksImpliedVolatilityRateType): Default: + OptionSnapshotGreeksImpliedVolatilityRateType.SOFR. + rate_value (Unset | float): + stock_price (Unset | float): + format_ (Unset | OptionSnapshotGreeksImpliedVolatilityFormat): Default: + OptionSnapshotGreeksImpliedVolatilityFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionSnapshotGreeksImpliedVolatilityResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +stock_price=stock_price, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotGreeksImpliedVolatilityRight = OptionSnapshotGreeksImpliedVolatilityRight.BOTH, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionSnapshotGreeksImpliedVolatilityRateType = OptionSnapshotGreeksImpliedVolatilityRateType.SOFR, + rate_value: Unset | float = UNSET, + stock_price: Unset | float = UNSET, + format_: Unset | OptionSnapshotGreeksImpliedVolatilityFormat = OptionSnapshotGreeksImpliedVolatilityFormat.NDJSON, + +) -> OptionSnapshotGreeksImpliedVolatilityResponse200 | None: + """ Implied Volatility + + Returns implied volatilies calculated using the national best bid, mid, and ask price + of the option respectively. The underlying price represents whatever the last underlying price was + at the + ``underlying_timestamp`` field. You can read more about how Thetadata calculates greeks + [here](/Articles/Data-And-Requests/Option-Greeks.html). + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotGreeksImpliedVolatilityRight): Default: + OptionSnapshotGreeksImpliedVolatilityRight.BOTH. + annual_dividend (Unset | float): + rate_type (Unset | OptionSnapshotGreeksImpliedVolatilityRateType): Default: + OptionSnapshotGreeksImpliedVolatilityRateType.SOFR. + rate_value (Unset | float): + stock_price (Unset | float): + format_ (Unset | OptionSnapshotGreeksImpliedVolatilityFormat): Default: + OptionSnapshotGreeksImpliedVolatilityFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionSnapshotGreeksImpliedVolatilityResponse200 + """ + + + return (await asyncio_detailed( + client=client, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +stock_price=stock_price, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_snapshot_greeks_second_order.py b/openapi_project/openapi_package/api/option/option_snapshot_greeks_second_order.py new file mode 100644 index 000000000..f088fc303 --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_snapshot_greeks_second_order.py @@ -0,0 +1,353 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_snapshot_greeks_second_order_format import OptionSnapshotGreeksSecondOrderFormat +from openapi_project.openapi_package.models.option_snapshot_greeks_second_order_rate_type import OptionSnapshotGreeksSecondOrderRateType +from openapi_project.openapi_package.models.option_snapshot_greeks_second_order_response_200 import OptionSnapshotGreeksSecondOrderResponse200 +from openapi_project.openapi_package.models.option_snapshot_greeks_second_order_right import OptionSnapshotGreeksSecondOrderRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotGreeksSecondOrderRight = OptionSnapshotGreeksSecondOrderRight.BOTH, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionSnapshotGreeksSecondOrderRateType = OptionSnapshotGreeksSecondOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + stock_price: Unset | float = UNSET, + format_: Unset | OptionSnapshotGreeksSecondOrderFormat = OptionSnapshotGreeksSecondOrderFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["symbol"] = symbol + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + params["annual_dividend"] = annual_dividend + + json_rate_type: Unset | str = UNSET if isinstance(rate_type, Unset) else rate_type.value + + params["rate_type"] = json_rate_type + + params["rate_value"] = rate_value + + params["stock_price"] = stock_price + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/snapshot/greeks/second_order", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionSnapshotGreeksSecondOrderResponse200 | None: + if response.status_code == 200: + response_200 = OptionSnapshotGreeksSecondOrderResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionSnapshotGreeksSecondOrderResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotGreeksSecondOrderRight = OptionSnapshotGreeksSecondOrderRight.BOTH, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionSnapshotGreeksSecondOrderRateType = OptionSnapshotGreeksSecondOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + stock_price: Unset | float = UNSET, + format_: Unset | OptionSnapshotGreeksSecondOrderFormat = OptionSnapshotGreeksSecondOrderFormat.NDJSON, + +) -> Response[OptionSnapshotGreeksSecondOrderResponse200]: + """ Second Order Greeks + + - Retrieve a real-time last second order greeks calculation for all option contracts that lie on a + provided expiration. + - You might need to change the default expiration date to a different date if it is past the current + date. Some quotes are omitted in the example to reduce the space of the sample output. + - Make `expiration` * if you want to get the snapshot for every expiration chain for the underlying. + > This endpoint will return no data if the market was closed for the day. Theta Data resets the + snapshot cache at midnight ET every night. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotGreeksSecondOrderRight): Default: + OptionSnapshotGreeksSecondOrderRight.BOTH. + annual_dividend (Unset | float): + rate_type (Unset | OptionSnapshotGreeksSecondOrderRateType): Default: + OptionSnapshotGreeksSecondOrderRateType.SOFR. + rate_value (Unset | float): + stock_price (Unset | float): + format_ (Unset | OptionSnapshotGreeksSecondOrderFormat): Default: + OptionSnapshotGreeksSecondOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionSnapshotGreeksSecondOrderResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +stock_price=stock_price, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotGreeksSecondOrderRight = OptionSnapshotGreeksSecondOrderRight.BOTH, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionSnapshotGreeksSecondOrderRateType = OptionSnapshotGreeksSecondOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + stock_price: Unset | float = UNSET, + format_: Unset | OptionSnapshotGreeksSecondOrderFormat = OptionSnapshotGreeksSecondOrderFormat.NDJSON, + +) -> OptionSnapshotGreeksSecondOrderResponse200 | None: + """ Second Order Greeks + + - Retrieve a real-time last second order greeks calculation for all option contracts that lie on a + provided expiration. + - You might need to change the default expiration date to a different date if it is past the current + date. Some quotes are omitted in the example to reduce the space of the sample output. + - Make `expiration` * if you want to get the snapshot for every expiration chain for the underlying. + > This endpoint will return no data if the market was closed for the day. Theta Data resets the + snapshot cache at midnight ET every night. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotGreeksSecondOrderRight): Default: + OptionSnapshotGreeksSecondOrderRight.BOTH. + annual_dividend (Unset | float): + rate_type (Unset | OptionSnapshotGreeksSecondOrderRateType): Default: + OptionSnapshotGreeksSecondOrderRateType.SOFR. + rate_value (Unset | float): + stock_price (Unset | float): + format_ (Unset | OptionSnapshotGreeksSecondOrderFormat): Default: + OptionSnapshotGreeksSecondOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionSnapshotGreeksSecondOrderResponse200 + """ + + + return sync_detailed( + client=client, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +stock_price=stock_price, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotGreeksSecondOrderRight = OptionSnapshotGreeksSecondOrderRight.BOTH, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionSnapshotGreeksSecondOrderRateType = OptionSnapshotGreeksSecondOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + stock_price: Unset | float = UNSET, + format_: Unset | OptionSnapshotGreeksSecondOrderFormat = OptionSnapshotGreeksSecondOrderFormat.NDJSON, + +) -> Response[OptionSnapshotGreeksSecondOrderResponse200]: + """ Second Order Greeks + + - Retrieve a real-time last second order greeks calculation for all option contracts that lie on a + provided expiration. + - You might need to change the default expiration date to a different date if it is past the current + date. Some quotes are omitted in the example to reduce the space of the sample output. + - Make `expiration` * if you want to get the snapshot for every expiration chain for the underlying. + > This endpoint will return no data if the market was closed for the day. Theta Data resets the + snapshot cache at midnight ET every night. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotGreeksSecondOrderRight): Default: + OptionSnapshotGreeksSecondOrderRight.BOTH. + annual_dividend (Unset | float): + rate_type (Unset | OptionSnapshotGreeksSecondOrderRateType): Default: + OptionSnapshotGreeksSecondOrderRateType.SOFR. + rate_value (Unset | float): + stock_price (Unset | float): + format_ (Unset | OptionSnapshotGreeksSecondOrderFormat): Default: + OptionSnapshotGreeksSecondOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionSnapshotGreeksSecondOrderResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +stock_price=stock_price, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotGreeksSecondOrderRight = OptionSnapshotGreeksSecondOrderRight.BOTH, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionSnapshotGreeksSecondOrderRateType = OptionSnapshotGreeksSecondOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + stock_price: Unset | float = UNSET, + format_: Unset | OptionSnapshotGreeksSecondOrderFormat = OptionSnapshotGreeksSecondOrderFormat.NDJSON, + +) -> OptionSnapshotGreeksSecondOrderResponse200 | None: + """ Second Order Greeks + + - Retrieve a real-time last second order greeks calculation for all option contracts that lie on a + provided expiration. + - You might need to change the default expiration date to a different date if it is past the current + date. Some quotes are omitted in the example to reduce the space of the sample output. + - Make `expiration` * if you want to get the snapshot for every expiration chain for the underlying. + > This endpoint will return no data if the market was closed for the day. Theta Data resets the + snapshot cache at midnight ET every night. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotGreeksSecondOrderRight): Default: + OptionSnapshotGreeksSecondOrderRight.BOTH. + annual_dividend (Unset | float): + rate_type (Unset | OptionSnapshotGreeksSecondOrderRateType): Default: + OptionSnapshotGreeksSecondOrderRateType.SOFR. + rate_value (Unset | float): + stock_price (Unset | float): + format_ (Unset | OptionSnapshotGreeksSecondOrderFormat): Default: + OptionSnapshotGreeksSecondOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionSnapshotGreeksSecondOrderResponse200 + """ + + + return (await asyncio_detailed( + client=client, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +stock_price=stock_price, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_snapshot_greeks_third_order.py b/openapi_project/openapi_package/api/option/option_snapshot_greeks_third_order.py new file mode 100644 index 000000000..be8b9452e --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_snapshot_greeks_third_order.py @@ -0,0 +1,353 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_snapshot_greeks_third_order_format import OptionSnapshotGreeksThirdOrderFormat +from openapi_project.openapi_package.models.option_snapshot_greeks_third_order_rate_type import OptionSnapshotGreeksThirdOrderRateType +from openapi_project.openapi_package.models.option_snapshot_greeks_third_order_response_200 import OptionSnapshotGreeksThirdOrderResponse200 +from openapi_project.openapi_package.models.option_snapshot_greeks_third_order_right import OptionSnapshotGreeksThirdOrderRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotGreeksThirdOrderRight = OptionSnapshotGreeksThirdOrderRight.BOTH, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionSnapshotGreeksThirdOrderRateType = OptionSnapshotGreeksThirdOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + stock_price: Unset | float = UNSET, + format_: Unset | OptionSnapshotGreeksThirdOrderFormat = OptionSnapshotGreeksThirdOrderFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["symbol"] = symbol + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + params["annual_dividend"] = annual_dividend + + json_rate_type: Unset | str = UNSET if isinstance(rate_type, Unset) else rate_type.value + + params["rate_type"] = json_rate_type + + params["rate_value"] = rate_value + + params["stock_price"] = stock_price + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/snapshot/greeks/third_order", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionSnapshotGreeksThirdOrderResponse200 | None: + if response.status_code == 200: + response_200 = OptionSnapshotGreeksThirdOrderResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionSnapshotGreeksThirdOrderResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotGreeksThirdOrderRight = OptionSnapshotGreeksThirdOrderRight.BOTH, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionSnapshotGreeksThirdOrderRateType = OptionSnapshotGreeksThirdOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + stock_price: Unset | float = UNSET, + format_: Unset | OptionSnapshotGreeksThirdOrderFormat = OptionSnapshotGreeksThirdOrderFormat.NDJSON, + +) -> Response[OptionSnapshotGreeksThirdOrderResponse200]: + """ Third Order Greeks + + - Retrieve a real-time last third order greeks calculation for all option contracts that lie on a + provided expiration. + - You might need to change the default expiration date to a different date if it is past the current + date. Some quotes are omitted in the example to reduce the space of the sample output. + - Make `expiration` * if you want to get the snapshot for every expiration chain for the underlying. + > This endpoint will return no data if the market was closed for the day. Theta Data resets the + snapshot cache at midnight ET every night. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotGreeksThirdOrderRight): Default: + OptionSnapshotGreeksThirdOrderRight.BOTH. + annual_dividend (Unset | float): + rate_type (Unset | OptionSnapshotGreeksThirdOrderRateType): Default: + OptionSnapshotGreeksThirdOrderRateType.SOFR. + rate_value (Unset | float): + stock_price (Unset | float): + format_ (Unset | OptionSnapshotGreeksThirdOrderFormat): Default: + OptionSnapshotGreeksThirdOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionSnapshotGreeksThirdOrderResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +stock_price=stock_price, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotGreeksThirdOrderRight = OptionSnapshotGreeksThirdOrderRight.BOTH, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionSnapshotGreeksThirdOrderRateType = OptionSnapshotGreeksThirdOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + stock_price: Unset | float = UNSET, + format_: Unset | OptionSnapshotGreeksThirdOrderFormat = OptionSnapshotGreeksThirdOrderFormat.NDJSON, + +) -> OptionSnapshotGreeksThirdOrderResponse200 | None: + """ Third Order Greeks + + - Retrieve a real-time last third order greeks calculation for all option contracts that lie on a + provided expiration. + - You might need to change the default expiration date to a different date if it is past the current + date. Some quotes are omitted in the example to reduce the space of the sample output. + - Make `expiration` * if you want to get the snapshot for every expiration chain for the underlying. + > This endpoint will return no data if the market was closed for the day. Theta Data resets the + snapshot cache at midnight ET every night. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotGreeksThirdOrderRight): Default: + OptionSnapshotGreeksThirdOrderRight.BOTH. + annual_dividend (Unset | float): + rate_type (Unset | OptionSnapshotGreeksThirdOrderRateType): Default: + OptionSnapshotGreeksThirdOrderRateType.SOFR. + rate_value (Unset | float): + stock_price (Unset | float): + format_ (Unset | OptionSnapshotGreeksThirdOrderFormat): Default: + OptionSnapshotGreeksThirdOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionSnapshotGreeksThirdOrderResponse200 + """ + + + return sync_detailed( + client=client, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +stock_price=stock_price, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotGreeksThirdOrderRight = OptionSnapshotGreeksThirdOrderRight.BOTH, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionSnapshotGreeksThirdOrderRateType = OptionSnapshotGreeksThirdOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + stock_price: Unset | float = UNSET, + format_: Unset | OptionSnapshotGreeksThirdOrderFormat = OptionSnapshotGreeksThirdOrderFormat.NDJSON, + +) -> Response[OptionSnapshotGreeksThirdOrderResponse200]: + """ Third Order Greeks + + - Retrieve a real-time last third order greeks calculation for all option contracts that lie on a + provided expiration. + - You might need to change the default expiration date to a different date if it is past the current + date. Some quotes are omitted in the example to reduce the space of the sample output. + - Make `expiration` * if you want to get the snapshot for every expiration chain for the underlying. + > This endpoint will return no data if the market was closed for the day. Theta Data resets the + snapshot cache at midnight ET every night. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotGreeksThirdOrderRight): Default: + OptionSnapshotGreeksThirdOrderRight.BOTH. + annual_dividend (Unset | float): + rate_type (Unset | OptionSnapshotGreeksThirdOrderRateType): Default: + OptionSnapshotGreeksThirdOrderRateType.SOFR. + rate_value (Unset | float): + stock_price (Unset | float): + format_ (Unset | OptionSnapshotGreeksThirdOrderFormat): Default: + OptionSnapshotGreeksThirdOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionSnapshotGreeksThirdOrderResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +stock_price=stock_price, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotGreeksThirdOrderRight = OptionSnapshotGreeksThirdOrderRight.BOTH, + annual_dividend: Unset | float = UNSET, + rate_type: Unset | OptionSnapshotGreeksThirdOrderRateType = OptionSnapshotGreeksThirdOrderRateType.SOFR, + rate_value: Unset | float = UNSET, + stock_price: Unset | float = UNSET, + format_: Unset | OptionSnapshotGreeksThirdOrderFormat = OptionSnapshotGreeksThirdOrderFormat.NDJSON, + +) -> OptionSnapshotGreeksThirdOrderResponse200 | None: + """ Third Order Greeks + + - Retrieve a real-time last third order greeks calculation for all option contracts that lie on a + provided expiration. + - You might need to change the default expiration date to a different date if it is past the current + date. Some quotes are omitted in the example to reduce the space of the sample output. + - Make `expiration` * if you want to get the snapshot for every expiration chain for the underlying. + > This endpoint will return no data if the market was closed for the day. Theta Data resets the + snapshot cache at midnight ET every night. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotGreeksThirdOrderRight): Default: + OptionSnapshotGreeksThirdOrderRight.BOTH. + annual_dividend (Unset | float): + rate_type (Unset | OptionSnapshotGreeksThirdOrderRateType): Default: + OptionSnapshotGreeksThirdOrderRateType.SOFR. + rate_value (Unset | float): + stock_price (Unset | float): + format_ (Unset | OptionSnapshotGreeksThirdOrderFormat): Default: + OptionSnapshotGreeksThirdOrderFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionSnapshotGreeksThirdOrderResponse200 + """ + + + return (await asyncio_detailed( + client=client, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +annual_dividend=annual_dividend, +rate_type=rate_type, +rate_value=rate_value, +stock_price=stock_price, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_snapshot_ohlc.py b/openapi_project/openapi_package/api/option/option_snapshot_ohlc.py new file mode 100644 index 000000000..461731fc8 --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_snapshot_ohlc.py @@ -0,0 +1,262 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_snapshot_ohlc_format import OptionSnapshotOhlcFormat +from openapi_project.openapi_package.models.option_snapshot_ohlc_response_200 import OptionSnapshotOhlcResponse200 +from openapi_project.openapi_package.models.option_snapshot_ohlc_right import OptionSnapshotOhlcRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotOhlcRight = OptionSnapshotOhlcRight.BOTH, + format_: Unset | OptionSnapshotOhlcFormat = OptionSnapshotOhlcFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["symbol"] = symbol + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/snapshot/ohlc", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionSnapshotOhlcResponse200 | None: + if response.status_code == 200: + response_200 = OptionSnapshotOhlcResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionSnapshotOhlcResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotOhlcRight = OptionSnapshotOhlcRight.BOTH, + format_: Unset | OptionSnapshotOhlcFormat = OptionSnapshotOhlcFormat.NDJSON, + +) -> Response[OptionSnapshotOhlcResponse200]: + """ Open High Low Close + + - Retrieve a real-time last ohlc of an option contract for the trading day. + - You might need to change the default expiration date to a different date if it is past the current + date. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotOhlcRight): Default: OptionSnapshotOhlcRight.BOTH. + format_ (Unset | OptionSnapshotOhlcFormat): Default: OptionSnapshotOhlcFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionSnapshotOhlcResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotOhlcRight = OptionSnapshotOhlcRight.BOTH, + format_: Unset | OptionSnapshotOhlcFormat = OptionSnapshotOhlcFormat.NDJSON, + +) -> OptionSnapshotOhlcResponse200 | None: + """ Open High Low Close + + - Retrieve a real-time last ohlc of an option contract for the trading day. + - You might need to change the default expiration date to a different date if it is past the current + date. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotOhlcRight): Default: OptionSnapshotOhlcRight.BOTH. + format_ (Unset | OptionSnapshotOhlcFormat): Default: OptionSnapshotOhlcFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionSnapshotOhlcResponse200 + """ + + + return sync_detailed( + client=client, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotOhlcRight = OptionSnapshotOhlcRight.BOTH, + format_: Unset | OptionSnapshotOhlcFormat = OptionSnapshotOhlcFormat.NDJSON, + +) -> Response[OptionSnapshotOhlcResponse200]: + """ Open High Low Close + + - Retrieve a real-time last ohlc of an option contract for the trading day. + - You might need to change the default expiration date to a different date if it is past the current + date. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotOhlcRight): Default: OptionSnapshotOhlcRight.BOTH. + format_ (Unset | OptionSnapshotOhlcFormat): Default: OptionSnapshotOhlcFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionSnapshotOhlcResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotOhlcRight = OptionSnapshotOhlcRight.BOTH, + format_: Unset | OptionSnapshotOhlcFormat = OptionSnapshotOhlcFormat.NDJSON, + +) -> OptionSnapshotOhlcResponse200 | None: + """ Open High Low Close + + - Retrieve a real-time last ohlc of an option contract for the trading day. + - You might need to change the default expiration date to a different date if it is past the current + date. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotOhlcRight): Default: OptionSnapshotOhlcRight.BOTH. + format_ (Unset | OptionSnapshotOhlcFormat): Default: OptionSnapshotOhlcFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionSnapshotOhlcResponse200 + """ + + + return (await asyncio_detailed( + client=client, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_snapshot_open_interest.py b/openapi_project/openapi_package/api/option/option_snapshot_open_interest.py new file mode 100644 index 000000000..a89ca5a68 --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_snapshot_open_interest.py @@ -0,0 +1,286 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_snapshot_open_interest_format import OptionSnapshotOpenInterestFormat +from openapi_project.openapi_package.models.option_snapshot_open_interest_response_200 import OptionSnapshotOpenInterestResponse200 +from openapi_project.openapi_package.models.option_snapshot_open_interest_right import OptionSnapshotOpenInterestRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotOpenInterestRight = OptionSnapshotOpenInterestRight.BOTH, + format_: Unset | OptionSnapshotOpenInterestFormat = OptionSnapshotOpenInterestFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["symbol"] = symbol + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/snapshot/open_interest", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionSnapshotOpenInterestResponse200 | None: + if response.status_code == 200: + response_200 = OptionSnapshotOpenInterestResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionSnapshotOpenInterestResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotOpenInterestRight = OptionSnapshotOpenInterestRight.BOTH, + format_: Unset | OptionSnapshotOpenInterestFormat = OptionSnapshotOpenInterestFormat.NDJSON, + +) -> Response[OptionSnapshotOpenInterestResponse200]: + """ Open Interest + + - Retrieve the last open interest message of an option contract. + - Open interest is reported around 06:30 ET every morning by OPRA and reflects the open interest at + the of the previous trading day. + - You might need to change the default expiration date to a different date if it is past the current + date. + - This endpoint will return no data if the market was closed for the day. Theta Data resets the + snapshot cache at midnight ET every night. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotOpenInterestRight): Default: + OptionSnapshotOpenInterestRight.BOTH. + format_ (Unset | OptionSnapshotOpenInterestFormat): Default: + OptionSnapshotOpenInterestFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionSnapshotOpenInterestResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotOpenInterestRight = OptionSnapshotOpenInterestRight.BOTH, + format_: Unset | OptionSnapshotOpenInterestFormat = OptionSnapshotOpenInterestFormat.NDJSON, + +) -> OptionSnapshotOpenInterestResponse200 | None: + """ Open Interest + + - Retrieve the last open interest message of an option contract. + - Open interest is reported around 06:30 ET every morning by OPRA and reflects the open interest at + the of the previous trading day. + - You might need to change the default expiration date to a different date if it is past the current + date. + - This endpoint will return no data if the market was closed for the day. Theta Data resets the + snapshot cache at midnight ET every night. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotOpenInterestRight): Default: + OptionSnapshotOpenInterestRight.BOTH. + format_ (Unset | OptionSnapshotOpenInterestFormat): Default: + OptionSnapshotOpenInterestFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionSnapshotOpenInterestResponse200 + """ + + + return sync_detailed( + client=client, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotOpenInterestRight = OptionSnapshotOpenInterestRight.BOTH, + format_: Unset | OptionSnapshotOpenInterestFormat = OptionSnapshotOpenInterestFormat.NDJSON, + +) -> Response[OptionSnapshotOpenInterestResponse200]: + """ Open Interest + + - Retrieve the last open interest message of an option contract. + - Open interest is reported around 06:30 ET every morning by OPRA and reflects the open interest at + the of the previous trading day. + - You might need to change the default expiration date to a different date if it is past the current + date. + - This endpoint will return no data if the market was closed for the day. Theta Data resets the + snapshot cache at midnight ET every night. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotOpenInterestRight): Default: + OptionSnapshotOpenInterestRight.BOTH. + format_ (Unset | OptionSnapshotOpenInterestFormat): Default: + OptionSnapshotOpenInterestFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionSnapshotOpenInterestResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotOpenInterestRight = OptionSnapshotOpenInterestRight.BOTH, + format_: Unset | OptionSnapshotOpenInterestFormat = OptionSnapshotOpenInterestFormat.NDJSON, + +) -> OptionSnapshotOpenInterestResponse200 | None: + """ Open Interest + + - Retrieve the last open interest message of an option contract. + - Open interest is reported around 06:30 ET every morning by OPRA and reflects the open interest at + the of the previous trading day. + - You might need to change the default expiration date to a different date if it is past the current + date. + - This endpoint will return no data if the market was closed for the day. Theta Data resets the + snapshot cache at midnight ET every night. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotOpenInterestRight): Default: + OptionSnapshotOpenInterestRight.BOTH. + format_ (Unset | OptionSnapshotOpenInterestFormat): Default: + OptionSnapshotOpenInterestFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionSnapshotOpenInterestResponse200 + """ + + + return (await asyncio_detailed( + client=client, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_snapshot_quote.py b/openapi_project/openapi_package/api/option/option_snapshot_quote.py new file mode 100644 index 000000000..ec2b74ed6 --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_snapshot_quote.py @@ -0,0 +1,274 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_snapshot_quote_format import OptionSnapshotQuoteFormat +from openapi_project.openapi_package.models.option_snapshot_quote_response_200 import OptionSnapshotQuoteResponse200 +from openapi_project.openapi_package.models.option_snapshot_quote_right import OptionSnapshotQuoteRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotQuoteRight = OptionSnapshotQuoteRight.BOTH, + format_: Unset | OptionSnapshotQuoteFormat = OptionSnapshotQuoteFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["symbol"] = symbol + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/snapshot/quote", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionSnapshotQuoteResponse200 | None: + if response.status_code == 200: + response_200 = OptionSnapshotQuoteResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionSnapshotQuoteResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotQuoteRight = OptionSnapshotQuoteRight.BOTH, + format_: Unset | OptionSnapshotQuoteFormat = OptionSnapshotQuoteFormat.NDJSON, + +) -> Response[OptionSnapshotQuoteResponse200]: + """ Quote + + + - Retrieve a real-time last NBBO quote of an option contract. + - You might need to change the default expiration date to a different date if it is past the current + date. + - This endpoint will return no data if the market was closed for the day. Theta Data resets the + snapshot cache at midnight ET every night. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotQuoteRight): Default: OptionSnapshotQuoteRight.BOTH. + format_ (Unset | OptionSnapshotQuoteFormat): Default: OptionSnapshotQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionSnapshotQuoteResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotQuoteRight = OptionSnapshotQuoteRight.BOTH, + format_: Unset | OptionSnapshotQuoteFormat = OptionSnapshotQuoteFormat.NDJSON, + +) -> OptionSnapshotQuoteResponse200 | None: + """ Quote + + + - Retrieve a real-time last NBBO quote of an option contract. + - You might need to change the default expiration date to a different date if it is past the current + date. + - This endpoint will return no data if the market was closed for the day. Theta Data resets the + snapshot cache at midnight ET every night. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotQuoteRight): Default: OptionSnapshotQuoteRight.BOTH. + format_ (Unset | OptionSnapshotQuoteFormat): Default: OptionSnapshotQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionSnapshotQuoteResponse200 + """ + + + return sync_detailed( + client=client, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotQuoteRight = OptionSnapshotQuoteRight.BOTH, + format_: Unset | OptionSnapshotQuoteFormat = OptionSnapshotQuoteFormat.NDJSON, + +) -> Response[OptionSnapshotQuoteResponse200]: + """ Quote + + + - Retrieve a real-time last NBBO quote of an option contract. + - You might need to change the default expiration date to a different date if it is past the current + date. + - This endpoint will return no data if the market was closed for the day. Theta Data resets the + snapshot cache at midnight ET every night. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotQuoteRight): Default: OptionSnapshotQuoteRight.BOTH. + format_ (Unset | OptionSnapshotQuoteFormat): Default: OptionSnapshotQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionSnapshotQuoteResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotQuoteRight = OptionSnapshotQuoteRight.BOTH, + format_: Unset | OptionSnapshotQuoteFormat = OptionSnapshotQuoteFormat.NDJSON, + +) -> OptionSnapshotQuoteResponse200 | None: + """ Quote + + + - Retrieve a real-time last NBBO quote of an option contract. + - You might need to change the default expiration date to a different date if it is past the current + date. + - This endpoint will return no data if the market was closed for the day. Theta Data resets the + snapshot cache at midnight ET every night. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotQuoteRight): Default: OptionSnapshotQuoteRight.BOTH. + format_ (Unset | OptionSnapshotQuoteFormat): Default: OptionSnapshotQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionSnapshotQuoteResponse200 + """ + + + return (await asyncio_detailed( + client=client, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/option/option_snapshot_trade.py b/openapi_project/openapi_package/api/option/option_snapshot_trade.py new file mode 100644 index 000000000..6bc82afd2 --- /dev/null +++ b/openapi_project/openapi_package/api/option/option_snapshot_trade.py @@ -0,0 +1,270 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.option_snapshot_trade_format import OptionSnapshotTradeFormat +from openapi_project.openapi_package.models.option_snapshot_trade_response_200 import OptionSnapshotTradeResponse200 +from openapi_project.openapi_package.models.option_snapshot_trade_right import OptionSnapshotTradeRight +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotTradeRight = OptionSnapshotTradeRight.BOTH, + format_: Unset | OptionSnapshotTradeFormat = OptionSnapshotTradeFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["symbol"] = symbol + + json_expiration = expiration.isoformat() + params["expiration"] = json_expiration + + params["strike"] = strike + + json_right: Unset | str = UNSET if isinstance(right, Unset) else right.value + + params["right"] = json_right + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/option/snapshot/trade", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionSnapshotTradeResponse200 | None: + if response.status_code == 200: + response_200 = OptionSnapshotTradeResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionSnapshotTradeResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotTradeRight = OptionSnapshotTradeRight.BOTH, + format_: Unset | OptionSnapshotTradeFormat = OptionSnapshotTradeFormat.NDJSON, + +) -> Response[OptionSnapshotTradeResponse200]: + """ Trade + + - Retrieve the real-time last trade of an option contract. + - You might need to change the default expiration date to a different date if it is past the current + date. + - This endpoint will return no data if the market was closed for the day. Theta Data resets the + snapshot cache at midnight ET every night. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotTradeRight): Default: OptionSnapshotTradeRight.BOTH. + format_ (Unset | OptionSnapshotTradeFormat): Default: OptionSnapshotTradeFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionSnapshotTradeResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotTradeRight = OptionSnapshotTradeRight.BOTH, + format_: Unset | OptionSnapshotTradeFormat = OptionSnapshotTradeFormat.NDJSON, + +) -> OptionSnapshotTradeResponse200 | None: + """ Trade + + - Retrieve the real-time last trade of an option contract. + - You might need to change the default expiration date to a different date if it is past the current + date. + - This endpoint will return no data if the market was closed for the day. Theta Data resets the + snapshot cache at midnight ET every night. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotTradeRight): Default: OptionSnapshotTradeRight.BOTH. + format_ (Unset | OptionSnapshotTradeFormat): Default: OptionSnapshotTradeFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionSnapshotTradeResponse200 + """ + + + return sync_detailed( + client=client, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotTradeRight = OptionSnapshotTradeRight.BOTH, + format_: Unset | OptionSnapshotTradeFormat = OptionSnapshotTradeFormat.NDJSON, + +) -> Response[OptionSnapshotTradeResponse200]: + """ Trade + + - Retrieve the real-time last trade of an option contract. + - You might need to change the default expiration date to a different date if it is past the current + date. + - This endpoint will return no data if the market was closed for the day. Theta Data resets the + snapshot cache at midnight ET every night. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotTradeRight): Default: OptionSnapshotTradeRight.BOTH. + format_ (Unset | OptionSnapshotTradeFormat): Default: OptionSnapshotTradeFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OptionSnapshotTradeResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + symbol: str, + expiration: datetime.date, + strike: Unset | str = '*', + right: Unset | OptionSnapshotTradeRight = OptionSnapshotTradeRight.BOTH, + format_: Unset | OptionSnapshotTradeFormat = OptionSnapshotTradeFormat.NDJSON, + +) -> OptionSnapshotTradeResponse200 | None: + """ Trade + + - Retrieve the real-time last trade of an option contract. + - You might need to change the default expiration date to a different date if it is past the current + date. + - This endpoint will return no data if the market was closed for the day. Theta Data resets the + snapshot cache at midnight ET every night. + + Args: + symbol (str): + expiration (datetime.date): + strike (Unset | str): Default: '*'. + right (Unset | OptionSnapshotTradeRight): Default: OptionSnapshotTradeRight.BOTH. + format_ (Unset | OptionSnapshotTradeFormat): Default: OptionSnapshotTradeFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OptionSnapshotTradeResponse200 + """ + + + return (await asyncio_detailed( + client=client, +symbol=symbol, +expiration=expiration, +strike=strike, +right=right, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/order_service/__init__.py b/openapi_project/openapi_package/api/order_service/__init__.py deleted file mode 100644 index dcbab9a7a..000000000 --- a/openapi_project/openapi_package/api/order_service/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/openapi_project/openapi_package/api/order_service/get_orders.py b/openapi_project/openapi_package/api/order_service/get_orders.py deleted file mode 100644 index e9dade5f9..000000000 --- a/openapi_project/openapi_package/api/order_service/get_orders.py +++ /dev/null @@ -1,125 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.list_orders_response import ListOrdersResponse -from typing import cast - - -def _get_kwargs() -> dict[str, Any]: - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/orders", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ListOrdersResponse | None: - if response.status_code == 200: - response_200 = ListOrdersResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ListOrdersResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[ListOrdersResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListOrdersResponse] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, -) -> ListOrdersResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListOrdersResponse - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[ListOrdersResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListOrdersResponse] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, -) -> ListOrdersResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListOrdersResponse - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/order_service/get_orders_searchhistory.py b/openapi_project/openapi_package/api/order_service/get_orders_searchhistory.py deleted file mode 100644 index bfac5f3f1..000000000 --- a/openapi_project/openapi_package/api/order_service/get_orders_searchhistory.py +++ /dev/null @@ -1,248 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.search_order_history_response import SearchOrderHistoryResponse -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - - -def _get_kwargs( - *, - account_ids: Unset | str = UNSET, - to_dt_year: Unset | str = UNSET, - to_dt_month: Unset | str = UNSET, - to_dt_day: Unset | str = UNSET, - from_dt_year: Unset | str = UNSET, - from_dt_month: Unset | str = UNSET, - from_dt_day: Unset | str = UNSET, -) -> dict[str, Any]: - - params: dict[str, Any] = {} - - params["accountIds"] = account_ids - - params["toDt.year"] = to_dt_year - - params["toDt.month"] = to_dt_month - - params["toDt.day"] = to_dt_day - - params["fromDt.year"] = from_dt_year - - params["fromDt.month"] = from_dt_month - - params["fromDt.day"] = from_dt_day - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/orders/searchhistory", - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> SearchOrderHistoryResponse | None: - if response.status_code == 200: - response_200 = SearchOrderHistoryResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[SearchOrderHistoryResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - account_ids: Unset | str = UNSET, - to_dt_year: Unset | str = UNSET, - to_dt_month: Unset | str = UNSET, - to_dt_day: Unset | str = UNSET, - from_dt_year: Unset | str = UNSET, - from_dt_month: Unset | str = UNSET, - from_dt_day: Unset | str = UNSET, -) -> Response[SearchOrderHistoryResponse]: - """ - Args: - account_ids (Unset | str): - to_dt_year (Unset | str): - to_dt_month (Unset | str): - to_dt_day (Unset | str): - from_dt_year (Unset | str): - from_dt_month (Unset | str): - from_dt_day (Unset | str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[SearchOrderHistoryResponse] - """ - - kwargs = _get_kwargs( - account_ids=account_ids, - to_dt_year=to_dt_year, - to_dt_month=to_dt_month, - to_dt_day=to_dt_day, - from_dt_year=from_dt_year, - from_dt_month=from_dt_month, - from_dt_day=from_dt_day, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - account_ids: Unset | str = UNSET, - to_dt_year: Unset | str = UNSET, - to_dt_month: Unset | str = UNSET, - to_dt_day: Unset | str = UNSET, - from_dt_year: Unset | str = UNSET, - from_dt_month: Unset | str = UNSET, - from_dt_day: Unset | str = UNSET, -) -> SearchOrderHistoryResponse | None: - """ - Args: - account_ids (Unset | str): - to_dt_year (Unset | str): - to_dt_month (Unset | str): - to_dt_day (Unset | str): - from_dt_year (Unset | str): - from_dt_month (Unset | str): - from_dt_day (Unset | str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - SearchOrderHistoryResponse - """ - - return sync_detailed( - client=client, - account_ids=account_ids, - to_dt_year=to_dt_year, - to_dt_month=to_dt_month, - to_dt_day=to_dt_day, - from_dt_year=from_dt_year, - from_dt_month=from_dt_month, - from_dt_day=from_dt_day, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - account_ids: Unset | str = UNSET, - to_dt_year: Unset | str = UNSET, - to_dt_month: Unset | str = UNSET, - to_dt_day: Unset | str = UNSET, - from_dt_year: Unset | str = UNSET, - from_dt_month: Unset | str = UNSET, - from_dt_day: Unset | str = UNSET, -) -> Response[SearchOrderHistoryResponse]: - """ - Args: - account_ids (Unset | str): - to_dt_year (Unset | str): - to_dt_month (Unset | str): - to_dt_day (Unset | str): - from_dt_year (Unset | str): - from_dt_month (Unset | str): - from_dt_day (Unset | str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[SearchOrderHistoryResponse] - """ - - kwargs = _get_kwargs( - account_ids=account_ids, - to_dt_year=to_dt_year, - to_dt_month=to_dt_month, - to_dt_day=to_dt_day, - from_dt_year=from_dt_year, - from_dt_month=from_dt_month, - from_dt_day=from_dt_day, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - account_ids: Unset | str = UNSET, - to_dt_year: Unset | str = UNSET, - to_dt_month: Unset | str = UNSET, - to_dt_day: Unset | str = UNSET, - from_dt_year: Unset | str = UNSET, - from_dt_month: Unset | str = UNSET, - from_dt_day: Unset | str = UNSET, -) -> SearchOrderHistoryResponse | None: - """ - Args: - account_ids (Unset | str): - to_dt_year (Unset | str): - to_dt_month (Unset | str): - to_dt_day (Unset | str): - from_dt_year (Unset | str): - from_dt_month (Unset | str): - from_dt_day (Unset | str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - SearchOrderHistoryResponse - """ - - return ( - await asyncio_detailed( - client=client, - account_ids=account_ids, - to_dt_year=to_dt_year, - to_dt_month=to_dt_month, - to_dt_day=to_dt_day, - from_dt_year=from_dt_year, - from_dt_month=from_dt_month, - from_dt_day=from_dt_day, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/order_service/get_orders_tradeconfirms.py b/openapi_project/openapi_package/api/order_service/get_orders_tradeconfirms.py deleted file mode 100644 index cabbc2bdf..000000000 --- a/openapi_project/openapi_package/api/order_service/get_orders_tradeconfirms.py +++ /dev/null @@ -1,218 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.list_trade_confirms_response import ListTradeConfirmsResponse -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - - -def _get_kwargs( - *, - account_ids: Unset | str = UNSET, - end_time_utc: Unset | str = UNSET, - start_time_utc: Unset | str = UNSET, - trading_firm_ids: Unset | str = UNSET, - user_ids: Unset | str = UNSET, -) -> dict[str, Any]: - - params: dict[str, Any] = {} - - params["accountIds"] = account_ids - - params["endTimeUtc"] = end_time_utc - - params["startTimeUtc"] = start_time_utc - - params["tradingFirmIds"] = trading_firm_ids - - params["userIds"] = user_ids - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/orders/tradeconfirms", - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ListTradeConfirmsResponse | None: - if response.status_code == 200: - response_200 = ListTradeConfirmsResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ListTradeConfirmsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - account_ids: Unset | str = UNSET, - end_time_utc: Unset | str = UNSET, - start_time_utc: Unset | str = UNSET, - trading_firm_ids: Unset | str = UNSET, - user_ids: Unset | str = UNSET, -) -> Response[ListTradeConfirmsResponse]: - """ - Args: - account_ids (Unset | str): - end_time_utc (Unset | str): - start_time_utc (Unset | str): - trading_firm_ids (Unset | str): - user_ids (Unset | str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListTradeConfirmsResponse] - """ - - kwargs = _get_kwargs( - account_ids=account_ids, - end_time_utc=end_time_utc, - start_time_utc=start_time_utc, - trading_firm_ids=trading_firm_ids, - user_ids=user_ids, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - account_ids: Unset | str = UNSET, - end_time_utc: Unset | str = UNSET, - start_time_utc: Unset | str = UNSET, - trading_firm_ids: Unset | str = UNSET, - user_ids: Unset | str = UNSET, -) -> ListTradeConfirmsResponse | None: - """ - Args: - account_ids (Unset | str): - end_time_utc (Unset | str): - start_time_utc (Unset | str): - trading_firm_ids (Unset | str): - user_ids (Unset | str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListTradeConfirmsResponse - """ - - return sync_detailed( - client=client, - account_ids=account_ids, - end_time_utc=end_time_utc, - start_time_utc=start_time_utc, - trading_firm_ids=trading_firm_ids, - user_ids=user_ids, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - account_ids: Unset | str = UNSET, - end_time_utc: Unset | str = UNSET, - start_time_utc: Unset | str = UNSET, - trading_firm_ids: Unset | str = UNSET, - user_ids: Unset | str = UNSET, -) -> Response[ListTradeConfirmsResponse]: - """ - Args: - account_ids (Unset | str): - end_time_utc (Unset | str): - start_time_utc (Unset | str): - trading_firm_ids (Unset | str): - user_ids (Unset | str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListTradeConfirmsResponse] - """ - - kwargs = _get_kwargs( - account_ids=account_ids, - end_time_utc=end_time_utc, - start_time_utc=start_time_utc, - trading_firm_ids=trading_firm_ids, - user_ids=user_ids, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - account_ids: Unset | str = UNSET, - end_time_utc: Unset | str = UNSET, - start_time_utc: Unset | str = UNSET, - trading_firm_ids: Unset | str = UNSET, - user_ids: Unset | str = UNSET, -) -> ListTradeConfirmsResponse | None: - """ - Args: - account_ids (Unset | str): - end_time_utc (Unset | str): - start_time_utc (Unset | str): - trading_firm_ids (Unset | str): - user_ids (Unset | str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListTradeConfirmsResponse - """ - - return ( - await asyncio_detailed( - client=client, - account_ids=account_ids, - end_time_utc=end_time_utc, - start_time_utc=start_time_utc, - trading_firm_ids=trading_firm_ids, - user_ids=user_ids, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/order_service/post_orders_cancelorder.py b/openapi_project/openapi_package/api/order_service/post_orders_cancelorder.py deleted file mode 100644 index 3e33e58bd..000000000 --- a/openapi_project/openapi_package/api/order_service/post_orders_cancelorder.py +++ /dev/null @@ -1,157 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.cancel_order_request import CancelOrderRequest -from openapi_project.openapi_package.models.cancel_order_response import CancelOrderResponse -from typing import cast - - -def _get_kwargs( - *, - body: CancelOrderRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/orders/cancelorder", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CancelOrderResponse | None: - if response.status_code == 200: - response_200 = CancelOrderResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CancelOrderResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CancelOrderRequest, -) -> Response[CancelOrderResponse]: - """ - Args: - body (CancelOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CancelOrderResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CancelOrderRequest, -) -> CancelOrderResponse | None: - """ - Args: - body (CancelOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CancelOrderResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CancelOrderRequest, -) -> Response[CancelOrderResponse]: - """ - Args: - body (CancelOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CancelOrderResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CancelOrderRequest, -) -> CancelOrderResponse | None: - """ - Args: - body (CancelOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CancelOrderResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/order_service/post_orders_createmultilegorder.py b/openapi_project/openapi_package/api/order_service/post_orders_createmultilegorder.py deleted file mode 100644 index ed682be23..000000000 --- a/openapi_project/openapi_package/api/order_service/post_orders_createmultilegorder.py +++ /dev/null @@ -1,157 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.create_multi_leg_order_request import CreateMultiLegOrderRequest -from openapi_project.openapi_package.models.create_multi_leg_order_response import CreateMultiLegOrderResponse -from typing import cast - - -def _get_kwargs( - *, - body: CreateMultiLegOrderRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/orders/createmultilegorder", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CreateMultiLegOrderResponse | None: - if response.status_code == 200: - response_200 = CreateMultiLegOrderResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CreateMultiLegOrderResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderRequest, -) -> Response[CreateMultiLegOrderResponse]: - """ - Args: - body (CreateMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateMultiLegOrderResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderRequest, -) -> CreateMultiLegOrderResponse | None: - """ - Args: - body (CreateMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateMultiLegOrderResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderRequest, -) -> Response[CreateMultiLegOrderResponse]: - """ - Args: - body (CreateMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateMultiLegOrderResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderRequest, -) -> CreateMultiLegOrderResponse | None: - """ - Args: - body (CreateMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateMultiLegOrderResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/order_service/post_orders_createmultilegordercross.py b/openapi_project/openapi_package/api/order_service/post_orders_createmultilegordercross.py deleted file mode 100644 index 52a72d36b..000000000 --- a/openapi_project/openapi_package/api/order_service/post_orders_createmultilegordercross.py +++ /dev/null @@ -1,157 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.create_multi_leg_order_cross_request import CreateMultiLegOrderCrossRequest -from openapi_project.openapi_package.models.create_multi_leg_order_cross_response import CreateMultiLegOrderCrossResponse -from typing import cast - - -def _get_kwargs( - *, - body: CreateMultiLegOrderCrossRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/orders/createmultilegordercross", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CreateMultiLegOrderCrossResponse | None: - if response.status_code == 200: - response_200 = CreateMultiLegOrderCrossResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CreateMultiLegOrderCrossResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderCrossRequest, -) -> Response[CreateMultiLegOrderCrossResponse]: - """ - Args: - body (CreateMultiLegOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateMultiLegOrderCrossResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderCrossRequest, -) -> CreateMultiLegOrderCrossResponse | None: - """ - Args: - body (CreateMultiLegOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateMultiLegOrderCrossResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderCrossRequest, -) -> Response[CreateMultiLegOrderCrossResponse]: - """ - Args: - body (CreateMultiLegOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateMultiLegOrderCrossResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderCrossRequest, -) -> CreateMultiLegOrderCrossResponse | None: - """ - Args: - body (CreateMultiLegOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateMultiLegOrderCrossResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/order_service/post_orders_createorder.py b/openapi_project/openapi_package/api/order_service/post_orders_createorder.py deleted file mode 100644 index 8ed7620c4..000000000 --- a/openapi_project/openapi_package/api/order_service/post_orders_createorder.py +++ /dev/null @@ -1,157 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.create_order_request import CreateOrderRequest -from openapi_project.openapi_package.models.create_order_response import CreateOrderResponse -from typing import cast - - -def _get_kwargs( - *, - body: CreateOrderRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/orders/createorder", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CreateOrderResponse | None: - if response.status_code == 200: - response_200 = CreateOrderResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CreateOrderResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateOrderRequest, -) -> Response[CreateOrderResponse]: - """ - Args: - body (CreateOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateOrderResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CreateOrderRequest, -) -> CreateOrderResponse | None: - """ - Args: - body (CreateOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateOrderResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateOrderRequest, -) -> Response[CreateOrderResponse]: - """ - Args: - body (CreateOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateOrderResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CreateOrderRequest, -) -> CreateOrderResponse | None: - """ - Args: - body (CreateOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateOrderResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/order_service/post_orders_createordercross.py b/openapi_project/openapi_package/api/order_service/post_orders_createordercross.py deleted file mode 100644 index d0ba5b894..000000000 --- a/openapi_project/openapi_package/api/order_service/post_orders_createordercross.py +++ /dev/null @@ -1,157 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.create_order_cross_request import CreateOrderCrossRequest -from openapi_project.openapi_package.models.create_order_cross_response import CreateOrderCrossResponse -from typing import cast - - -def _get_kwargs( - *, - body: CreateOrderCrossRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/orders/createordercross", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CreateOrderCrossResponse | None: - if response.status_code == 200: - response_200 = CreateOrderCrossResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CreateOrderCrossResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateOrderCrossRequest, -) -> Response[CreateOrderCrossResponse]: - """ - Args: - body (CreateOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateOrderCrossResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CreateOrderCrossRequest, -) -> CreateOrderCrossResponse | None: - """ - Args: - body (CreateOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateOrderCrossResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateOrderCrossRequest, -) -> Response[CreateOrderCrossResponse]: - """ - Args: - body (CreateOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateOrderCrossResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CreateOrderCrossRequest, -) -> CreateOrderCrossResponse | None: - """ - Args: - body (CreateOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateOrderCrossResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/order_service/post_orders_replacemultilegorder.py b/openapi_project/openapi_package/api/order_service/post_orders_replacemultilegorder.py deleted file mode 100644 index 99069f998..000000000 --- a/openapi_project/openapi_package/api/order_service/post_orders_replacemultilegorder.py +++ /dev/null @@ -1,157 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request import CancelReplaceMultiLegOrderRequest -from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_response import CancelReplaceMultiLegOrderResponse -from typing import cast - - -def _get_kwargs( - *, - body: CancelReplaceMultiLegOrderRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/orders/replacemultilegorder", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CancelReplaceMultiLegOrderResponse | None: - if response.status_code == 200: - response_200 = CancelReplaceMultiLegOrderResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CancelReplaceMultiLegOrderResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceMultiLegOrderRequest, -) -> Response[CancelReplaceMultiLegOrderResponse]: - """ - Args: - body (CancelReplaceMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CancelReplaceMultiLegOrderResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceMultiLegOrderRequest, -) -> CancelReplaceMultiLegOrderResponse | None: - """ - Args: - body (CancelReplaceMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CancelReplaceMultiLegOrderResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceMultiLegOrderRequest, -) -> Response[CancelReplaceMultiLegOrderResponse]: - """ - Args: - body (CancelReplaceMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CancelReplaceMultiLegOrderResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceMultiLegOrderRequest, -) -> CancelReplaceMultiLegOrderResponse | None: - """ - Args: - body (CancelReplaceMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CancelReplaceMultiLegOrderResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/order_service/post_orders_replaceorder.py b/openapi_project/openapi_package/api/order_service/post_orders_replaceorder.py deleted file mode 100644 index 86d3f065a..000000000 --- a/openapi_project/openapi_package/api/order_service/post_orders_replaceorder.py +++ /dev/null @@ -1,157 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.cancel_replace_order_request import CancelReplaceOrderRequest -from openapi_project.openapi_package.models.cancel_replace_order_response import CancelReplaceOrderResponse -from typing import cast - - -def _get_kwargs( - *, - body: CancelReplaceOrderRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/orders/replaceorder", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CancelReplaceOrderResponse | None: - if response.status_code == 200: - response_200 = CancelReplaceOrderResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CancelReplaceOrderResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceOrderRequest, -) -> Response[CancelReplaceOrderResponse]: - """ - Args: - body (CancelReplaceOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CancelReplaceOrderResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceOrderRequest, -) -> CancelReplaceOrderResponse | None: - """ - Args: - body (CancelReplaceOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CancelReplaceOrderResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceOrderRequest, -) -> Response[CancelReplaceOrderResponse]: - """ - Args: - body (CancelReplaceOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CancelReplaceOrderResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceOrderRequest, -) -> CancelReplaceOrderResponse | None: - """ - Args: - body (CancelReplaceOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CancelReplaceOrderResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegorder.py b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegorder.py deleted file mode 100644 index 025772e6b..000000000 --- a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegorder.py +++ /dev/null @@ -1,157 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.create_multi_leg_order_request import CreateMultiLegOrderRequest -from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse -from typing import cast - - -def _get_kwargs( - *, - body: CreateMultiLegOrderRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/orders/validaterisk/createmultilegorder", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ValidateRiskResponse | None: - if response.status_code == 200: - response_200 = ValidateRiskResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ValidateRiskResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderRequest, -) -> Response[ValidateRiskResponse]: - """ - Args: - body (CreateMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ValidateRiskResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderRequest, -) -> ValidateRiskResponse | None: - """ - Args: - body (CreateMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ValidateRiskResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderRequest, -) -> Response[ValidateRiskResponse]: - """ - Args: - body (CreateMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ValidateRiskResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderRequest, -) -> ValidateRiskResponse | None: - """ - Args: - body (CreateMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ValidateRiskResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegordercross.py b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegordercross.py deleted file mode 100644 index db0a36576..000000000 --- a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createmultilegordercross.py +++ /dev/null @@ -1,157 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.create_multi_leg_order_cross_request import CreateMultiLegOrderCrossRequest -from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse -from typing import cast - - -def _get_kwargs( - *, - body: CreateMultiLegOrderCrossRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/orders/validaterisk/createmultilegordercross", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ValidateRiskResponse | None: - if response.status_code == 200: - response_200 = ValidateRiskResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ValidateRiskResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderCrossRequest, -) -> Response[ValidateRiskResponse]: - """ - Args: - body (CreateMultiLegOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ValidateRiskResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderCrossRequest, -) -> ValidateRiskResponse | None: - """ - Args: - body (CreateMultiLegOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ValidateRiskResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderCrossRequest, -) -> Response[ValidateRiskResponse]: - """ - Args: - body (CreateMultiLegOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ValidateRiskResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CreateMultiLegOrderCrossRequest, -) -> ValidateRiskResponse | None: - """ - Args: - body (CreateMultiLegOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ValidateRiskResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createorder.py b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createorder.py deleted file mode 100644 index 0b6085fba..000000000 --- a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createorder.py +++ /dev/null @@ -1,157 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.create_order_request import CreateOrderRequest -from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse -from typing import cast - - -def _get_kwargs( - *, - body: CreateOrderRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/orders/validaterisk/createorder", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ValidateRiskResponse | None: - if response.status_code == 200: - response_200 = ValidateRiskResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ValidateRiskResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateOrderRequest, -) -> Response[ValidateRiskResponse]: - """ - Args: - body (CreateOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ValidateRiskResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CreateOrderRequest, -) -> ValidateRiskResponse | None: - """ - Args: - body (CreateOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ValidateRiskResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateOrderRequest, -) -> Response[ValidateRiskResponse]: - """ - Args: - body (CreateOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ValidateRiskResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CreateOrderRequest, -) -> ValidateRiskResponse | None: - """ - Args: - body (CreateOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ValidateRiskResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createordercross.py b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createordercross.py deleted file mode 100644 index 43f123e89..000000000 --- a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_createordercross.py +++ /dev/null @@ -1,157 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.create_order_cross_request import CreateOrderCrossRequest -from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse -from typing import cast - - -def _get_kwargs( - *, - body: CreateOrderCrossRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/orders/validaterisk/createordercross", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ValidateRiskResponse | None: - if response.status_code == 200: - response_200 = ValidateRiskResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ValidateRiskResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateOrderCrossRequest, -) -> Response[ValidateRiskResponse]: - """ - Args: - body (CreateOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ValidateRiskResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CreateOrderCrossRequest, -) -> ValidateRiskResponse | None: - """ - Args: - body (CreateOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ValidateRiskResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateOrderCrossRequest, -) -> Response[ValidateRiskResponse]: - """ - Args: - body (CreateOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ValidateRiskResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CreateOrderCrossRequest, -) -> ValidateRiskResponse | None: - """ - Args: - body (CreateOrderCrossRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ValidateRiskResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replacemultilegorder.py b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replacemultilegorder.py deleted file mode 100644 index 623c67ec0..000000000 --- a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replacemultilegorder.py +++ /dev/null @@ -1,157 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request import CancelReplaceMultiLegOrderRequest -from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse -from typing import cast - - -def _get_kwargs( - *, - body: CancelReplaceMultiLegOrderRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/orders/validaterisk/replacemultilegorder", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ValidateRiskResponse | None: - if response.status_code == 200: - response_200 = ValidateRiskResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ValidateRiskResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceMultiLegOrderRequest, -) -> Response[ValidateRiskResponse]: - """ - Args: - body (CancelReplaceMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ValidateRiskResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceMultiLegOrderRequest, -) -> ValidateRiskResponse | None: - """ - Args: - body (CancelReplaceMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ValidateRiskResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceMultiLegOrderRequest, -) -> Response[ValidateRiskResponse]: - """ - Args: - body (CancelReplaceMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ValidateRiskResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceMultiLegOrderRequest, -) -> ValidateRiskResponse | None: - """ - Args: - body (CancelReplaceMultiLegOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ValidateRiskResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replaceorder.py b/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replaceorder.py deleted file mode 100644 index a10bccb20..000000000 --- a/openapi_project/openapi_package/api/order_service/post_orders_validaterisk_replaceorder.py +++ /dev/null @@ -1,157 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.cancel_replace_order_request import CancelReplaceOrderRequest -from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse -from typing import cast - - -def _get_kwargs( - *, - body: CancelReplaceOrderRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/orders/validaterisk/replaceorder", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ValidateRiskResponse | None: - if response.status_code == 200: - response_200 = ValidateRiskResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ValidateRiskResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceOrderRequest, -) -> Response[ValidateRiskResponse]: - """ - Args: - body (CancelReplaceOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ValidateRiskResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceOrderRequest, -) -> ValidateRiskResponse | None: - """ - Args: - body (CancelReplaceOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ValidateRiskResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceOrderRequest, -) -> Response[ValidateRiskResponse]: - """ - Args: - body (CancelReplaceOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ValidateRiskResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CancelReplaceOrderRequest, -) -> ValidateRiskResponse | None: - """ - Args: - body (CancelReplaceOrderRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ValidateRiskResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/portfolio_service/__init__.py b/openapi_project/openapi_package/api/portfolio_service/__init__.py deleted file mode 100644 index dcbab9a7a..000000000 --- a/openapi_project/openapi_package/api/portfolio_service/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/openapi_project/openapi_package/api/portfolio_service/get_portfolio_positions.py b/openapi_project/openapi_package/api/portfolio_service/get_portfolio_positions.py deleted file mode 100644 index a4bb644e5..000000000 --- a/openapi_project/openapi_package/api/portfolio_service/get_portfolio_positions.py +++ /dev/null @@ -1,203 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.list_positions_response import ListPositionsResponse -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - - -def _get_kwargs( - *, - all_: Unset | str = UNSET, - account_id: Unset | str = UNSET, - account_id_and_symbol_account_id: Unset | str = UNSET, - account_id_and_symbol_symbol: Unset | str = UNSET, -) -> dict[str, Any]: - - params: dict[str, Any] = {} - - params["all"] = all_ - - params["accountId"] = account_id - - params["accountIdAndSymbol.accountId"] = account_id_and_symbol_account_id - - params["accountIdAndSymbol.symbol"] = account_id_and_symbol_symbol - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/portfolio/positions", - "params": params, - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ListPositionsResponse | None: - if response.status_code == 200: - response_200 = ListPositionsResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ListPositionsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - all_: Unset | str = UNSET, - account_id: Unset | str = UNSET, - account_id_and_symbol_account_id: Unset | str = UNSET, - account_id_and_symbol_symbol: Unset | str = UNSET, -) -> Response[ListPositionsResponse]: - """ - Args: - all_ (Unset | str): - account_id (Unset | str): - account_id_and_symbol_account_id (Unset | str): - account_id_and_symbol_symbol (Unset | str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListPositionsResponse] - """ - - kwargs = _get_kwargs( - all_=all_, - account_id=account_id, - account_id_and_symbol_account_id=account_id_and_symbol_account_id, - account_id_and_symbol_symbol=account_id_and_symbol_symbol, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - all_: Unset | str = UNSET, - account_id: Unset | str = UNSET, - account_id_and_symbol_account_id: Unset | str = UNSET, - account_id_and_symbol_symbol: Unset | str = UNSET, -) -> ListPositionsResponse | None: - """ - Args: - all_ (Unset | str): - account_id (Unset | str): - account_id_and_symbol_account_id (Unset | str): - account_id_and_symbol_symbol (Unset | str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListPositionsResponse - """ - - return sync_detailed( - client=client, - all_=all_, - account_id=account_id, - account_id_and_symbol_account_id=account_id_and_symbol_account_id, - account_id_and_symbol_symbol=account_id_and_symbol_symbol, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - all_: Unset | str = UNSET, - account_id: Unset | str = UNSET, - account_id_and_symbol_account_id: Unset | str = UNSET, - account_id_and_symbol_symbol: Unset | str = UNSET, -) -> Response[ListPositionsResponse]: - """ - Args: - all_ (Unset | str): - account_id (Unset | str): - account_id_and_symbol_account_id (Unset | str): - account_id_and_symbol_symbol (Unset | str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListPositionsResponse] - """ - - kwargs = _get_kwargs( - all_=all_, - account_id=account_id, - account_id_and_symbol_account_id=account_id_and_symbol_account_id, - account_id_and_symbol_symbol=account_id_and_symbol_symbol, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - all_: Unset | str = UNSET, - account_id: Unset | str = UNSET, - account_id_and_symbol_account_id: Unset | str = UNSET, - account_id_and_symbol_symbol: Unset | str = UNSET, -) -> ListPositionsResponse | None: - """ - Args: - all_ (Unset | str): - account_id (Unset | str): - account_id_and_symbol_account_id (Unset | str): - account_id_and_symbol_symbol (Unset | str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListPositionsResponse - """ - - return ( - await asyncio_detailed( - client=client, - all_=all_, - account_id=account_id, - account_id_and_symbol_account_id=account_id_and_symbol_account_id, - account_id_and_symbol_symbol=account_id_and_symbol_symbol, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/portfolio_service/post_portfolio_analyzepositions.py b/openapi_project/openapi_package/api/portfolio_service/post_portfolio_analyzepositions.py deleted file mode 100644 index cb4946c30..000000000 --- a/openapi_project/openapi_package/api/portfolio_service/post_portfolio_analyzepositions.py +++ /dev/null @@ -1,157 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.analyze_positions_request import AnalyzePositionsRequest -from openapi_project.openapi_package.models.analyze_positions_response import AnalyzePositionsResponse -from typing import cast - - -def _get_kwargs( - *, - body: AnalyzePositionsRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/portfolio/analyzepositions", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AnalyzePositionsResponse | None: - if response.status_code == 200: - response_200 = AnalyzePositionsResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AnalyzePositionsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: AnalyzePositionsRequest, -) -> Response[AnalyzePositionsResponse]: - """ - Args: - body (AnalyzePositionsRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[AnalyzePositionsResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: AnalyzePositionsRequest, -) -> AnalyzePositionsResponse | None: - """ - Args: - body (AnalyzePositionsRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - AnalyzePositionsResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: AnalyzePositionsRequest, -) -> Response[AnalyzePositionsResponse]: - """ - Args: - body (AnalyzePositionsRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[AnalyzePositionsResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: AnalyzePositionsRequest, -) -> AnalyzePositionsResponse | None: - """ - Args: - body (AnalyzePositionsRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - AnalyzePositionsResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/portfolio_service/post_portfolio_calculatemargins.py b/openapi_project/openapi_package/api/portfolio_service/post_portfolio_calculatemargins.py deleted file mode 100644 index 7fb58f59e..000000000 --- a/openapi_project/openapi_package/api/portfolio_service/post_portfolio_calculatemargins.py +++ /dev/null @@ -1,157 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.calculate_margin_request import CalculateMarginRequest -from openapi_project.openapi_package.models.calculate_margin_response import CalculateMarginResponse -from typing import cast - - -def _get_kwargs( - *, - body: CalculateMarginRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/portfolio/calculatemargins", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CalculateMarginResponse | None: - if response.status_code == 200: - response_200 = CalculateMarginResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CalculateMarginResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CalculateMarginRequest, -) -> Response[CalculateMarginResponse]: - """ - Args: - body (CalculateMarginRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CalculateMarginResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CalculateMarginRequest, -) -> CalculateMarginResponse | None: - """ - Args: - body (CalculateMarginRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CalculateMarginResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CalculateMarginRequest, -) -> Response[CalculateMarginResponse]: - """ - Args: - body (CalculateMarginRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CalculateMarginResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CalculateMarginRequest, -) -> CalculateMarginResponse | None: - """ - Args: - body (CalculateMarginRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CalculateMarginResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/portfolio_service/post_portfolio_riskradar.py b/openapi_project/openapi_package/api/portfolio_service/post_portfolio_riskradar.py deleted file mode 100644 index 0dbf9cba6..000000000 --- a/openapi_project/openapi_package/api/portfolio_service/post_portfolio_riskradar.py +++ /dev/null @@ -1,157 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.risk_radar_request import RiskRadarRequest -from openapi_project.openapi_package.models.risk_radar_response import RiskRadarResponse -from typing import cast - - -def _get_kwargs( - *, - body: RiskRadarRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/portfolio/riskradar", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> RiskRadarResponse | None: - if response.status_code == 200: - response_200 = RiskRadarResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[RiskRadarResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: RiskRadarRequest, -) -> Response[RiskRadarResponse]: - """ - Args: - body (RiskRadarRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[RiskRadarResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: RiskRadarRequest, -) -> RiskRadarResponse | None: - """ - Args: - body (RiskRadarRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - RiskRadarResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: RiskRadarRequest, -) -> Response[RiskRadarResponse]: - """ - Args: - body (RiskRadarRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[RiskRadarResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: RiskRadarRequest, -) -> RiskRadarResponse | None: - """ - Args: - body (RiskRadarRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - RiskRadarResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/security_service/__init__.py b/openapi_project/openapi_package/api/security_service/__init__.py deleted file mode 100644 index dcbab9a7a..000000000 --- a/openapi_project/openapi_package/api/security_service/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/openapi_project/openapi_package/api/security_service/get_securities_exchanges.py b/openapi_project/openapi_package/api/security_service/get_securities_exchanges.py deleted file mode 100644 index d1a0b432f..000000000 --- a/openapi_project/openapi_package/api/security_service/get_securities_exchanges.py +++ /dev/null @@ -1,125 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.list_exchanges_response import ListExchangesResponse -from typing import cast - - -def _get_kwargs() -> dict[str, Any]: - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/securities/exchanges", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ListExchangesResponse | None: - if response.status_code == 200: - response_200 = ListExchangesResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ListExchangesResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[ListExchangesResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListExchangesResponse] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, -) -> ListExchangesResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListExchangesResponse - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[ListExchangesResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListExchangesResponse] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, -) -> ListExchangesResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListExchangesResponse - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/security_service/post_securities_easytoborrowsecurities.py b/openapi_project/openapi_package/api/security_service/post_securities_easytoborrowsecurities.py deleted file mode 100644 index 1abdbd058..000000000 --- a/openapi_project/openapi_package/api/security_service/post_securities_easytoborrowsecurities.py +++ /dev/null @@ -1,157 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.list_easy_to_borrow_securities_request import ListEasyToBorrowSecuritiesRequest -from openapi_project.openapi_package.models.list_easy_to_borrow_securities_response import ListEasyToBorrowSecuritiesResponse -from typing import cast - - -def _get_kwargs( - *, - body: ListEasyToBorrowSecuritiesRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/securities/easytoborrowsecurities", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ListEasyToBorrowSecuritiesResponse | None: - if response.status_code == 200: - response_200 = ListEasyToBorrowSecuritiesResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ListEasyToBorrowSecuritiesResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: ListEasyToBorrowSecuritiesRequest, -) -> Response[ListEasyToBorrowSecuritiesResponse]: - """ - Args: - body (ListEasyToBorrowSecuritiesRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListEasyToBorrowSecuritiesResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: ListEasyToBorrowSecuritiesRequest, -) -> ListEasyToBorrowSecuritiesResponse | None: - """ - Args: - body (ListEasyToBorrowSecuritiesRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListEasyToBorrowSecuritiesResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: ListEasyToBorrowSecuritiesRequest, -) -> Response[ListEasyToBorrowSecuritiesResponse]: - """ - Args: - body (ListEasyToBorrowSecuritiesRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListEasyToBorrowSecuritiesResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: ListEasyToBorrowSecuritiesRequest, -) -> ListEasyToBorrowSecuritiesResponse | None: - """ - Args: - body (ListEasyToBorrowSecuritiesRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListEasyToBorrowSecuritiesResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/security_service/post_securities_flexoption.py b/openapi_project/openapi_package/api/security_service/post_securities_flexoption.py deleted file mode 100644 index 6345bd226..000000000 --- a/openapi_project/openapi_package/api/security_service/post_securities_flexoption.py +++ /dev/null @@ -1,157 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.create_flex_option_request import CreateFlexOptionRequest -from openapi_project.openapi_package.models.create_flex_option_response import CreateFlexOptionResponse -from typing import cast - - -def _get_kwargs( - *, - body: CreateFlexOptionRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/securities/flexoption", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> CreateFlexOptionResponse | None: - if response.status_code == 200: - response_200 = CreateFlexOptionResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[CreateFlexOptionResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateFlexOptionRequest, -) -> Response[CreateFlexOptionResponse]: - """ - Args: - body (CreateFlexOptionRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateFlexOptionResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: CreateFlexOptionRequest, -) -> CreateFlexOptionResponse | None: - """ - Args: - body (CreateFlexOptionRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateFlexOptionResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: CreateFlexOptionRequest, -) -> Response[CreateFlexOptionResponse]: - """ - Args: - body (CreateFlexOptionRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CreateFlexOptionResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: CreateFlexOptionRequest, -) -> CreateFlexOptionResponse | None: - """ - Args: - body (CreateFlexOptionRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CreateFlexOptionResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/security_service/post_securities_optionchains.py b/openapi_project/openapi_package/api/security_service/post_securities_optionchains.py deleted file mode 100644 index c9c764012..000000000 --- a/openapi_project/openapi_package/api/security_service/post_securities_optionchains.py +++ /dev/null @@ -1,157 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.list_option_chains_repsonse import ListOptionChainsRepsonse -from openapi_project.openapi_package.models.list_option_chains_request import ListOptionChainsRequest -from typing import cast - - -def _get_kwargs( - *, - body: ListOptionChainsRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/securities/optionchains", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ListOptionChainsRepsonse | None: - if response.status_code == 200: - response_200 = ListOptionChainsRepsonse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ListOptionChainsRepsonse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: ListOptionChainsRequest, -) -> Response[ListOptionChainsRepsonse]: - """ - Args: - body (ListOptionChainsRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListOptionChainsRepsonse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: ListOptionChainsRequest, -) -> ListOptionChainsRepsonse | None: - """ - Args: - body (ListOptionChainsRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListOptionChainsRepsonse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: ListOptionChainsRequest, -) -> Response[ListOptionChainsRepsonse]: - """ - Args: - body (ListOptionChainsRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListOptionChainsRepsonse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: ListOptionChainsRequest, -) -> ListOptionChainsRepsonse | None: - """ - Args: - body (ListOptionChainsRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListOptionChainsRepsonse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/security_service/post_securities_securities.py b/openapi_project/openapi_package/api/security_service/post_securities_securities.py deleted file mode 100644 index 6c4edccf8..000000000 --- a/openapi_project/openapi_package/api/security_service/post_securities_securities.py +++ /dev/null @@ -1,157 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.list_securities_request import ListSecuritiesRequest -from openapi_project.openapi_package.models.list_securities_response import ListSecuritiesResponse -from typing import cast - - -def _get_kwargs( - *, - body: ListSecuritiesRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/securities/securities", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ListSecuritiesResponse | None: - if response.status_code == 200: - response_200 = ListSecuritiesResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ListSecuritiesResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, - body: ListSecuritiesRequest, -) -> Response[ListSecuritiesResponse]: - """ - Args: - body (ListSecuritiesRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListSecuritiesResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, - body: ListSecuritiesRequest, -) -> ListSecuritiesResponse | None: - """ - Args: - body (ListSecuritiesRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListSecuritiesResponse - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, - body: ListSecuritiesRequest, -) -> Response[ListSecuritiesResponse]: - """ - Args: - body (ListSecuritiesRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListSecuritiesResponse] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, - body: ListSecuritiesRequest, -) -> ListSecuritiesResponse | None: - """ - Args: - body (ListSecuritiesRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListSecuritiesResponse - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/stock/__init__.py b/openapi_project/openapi_package/api/stock/__init__.py new file mode 100644 index 000000000..03e86a6af --- /dev/null +++ b/openapi_project/openapi_package/api/stock/__init__.py @@ -0,0 +1 @@ +""" Contains endpoint functions for accessing the API """ diff --git a/openapi_project/openapi_package/api/stock/stock_at_time_quote.py b/openapi_project/openapi_package/api/stock/stock_at_time_quote.py new file mode 100644 index 000000000..b13133013 --- /dev/null +++ b/openapi_project/openapi_package/api/stock/stock_at_time_quote.py @@ -0,0 +1,314 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.stock_at_time_quote_format import StockAtTimeQuoteFormat +from openapi_project.openapi_package.models.stock_at_time_quote_response_200 import StockAtTimeQuoteResponse200 +from openapi_project.openapi_package.models.stock_at_time_quote_venue import StockAtTimeQuoteVenue +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + time_of_day: str, + venue: Unset | StockAtTimeQuoteVenue = StockAtTimeQuoteVenue.NQB, + format_: Unset | StockAtTimeQuoteFormat = StockAtTimeQuoteFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["symbol"] = symbol + + json_start_date = start_date.isoformat() + params["start_date"] = json_start_date + + json_end_date = end_date.isoformat() + params["end_date"] = json_end_date + + params["time_of_day"] = time_of_day + + json_venue: Unset | str = UNSET if isinstance(venue, Unset) else venue.value + + params["venue"] = json_venue + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/stock/at_time/quote", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> StockAtTimeQuoteResponse200 | None: + if response.status_code == 200: + response_200 = StockAtTimeQuoteResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[StockAtTimeQuoteResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + time_of_day: str, + venue: Unset | StockAtTimeQuoteVenue = StockAtTimeQuoteVenue.NQB, + format_: Unset | StockAtTimeQuoteFormat = StockAtTimeQuoteFormat.NDJSON, + +) -> Response[StockAtTimeQuoteResponse200]: + """ Quote + + #### Real-time request: + - Subscription tier standard or higher will default to NQB. + - Real-time last BBO quote at-time_of_day-time from the [Nasdaq Basic feed](/Articles/Data-And- + Requests/The-SIPs.html#nasdaq-basic) if the account has a [stocks standard or pro + subscription](https://www.thetadata.net/subscribe.html#stocks). + - 15-minute delayed NBBO quote at-time_of_day-time from the [UTP & CTA feeds](/Articles/Data-And- + Requests/The-SIPs.html#equities-cta-utp) account has the [stocks value + subscription](https://www.thetadata.net/subscribe.html#stocks) subscription. + + #### Historical request: + Returns the last NBBO quote reported by [UTP & CTA feeds](/Articles/Data-And-Requests/The- + SIPs.html#equities-cta-utp) at a specified millisecond of the day. + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + time_of_day (str): + venue (Unset | StockAtTimeQuoteVenue): Default: StockAtTimeQuoteVenue.NQB. + format_ (Unset | StockAtTimeQuoteFormat): Default: StockAtTimeQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StockAtTimeQuoteResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +start_date=start_date, +end_date=end_date, +time_of_day=time_of_day, +venue=venue, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + time_of_day: str, + venue: Unset | StockAtTimeQuoteVenue = StockAtTimeQuoteVenue.NQB, + format_: Unset | StockAtTimeQuoteFormat = StockAtTimeQuoteFormat.NDJSON, + +) -> StockAtTimeQuoteResponse200 | None: + """ Quote + + #### Real-time request: + - Subscription tier standard or higher will default to NQB. + - Real-time last BBO quote at-time_of_day-time from the [Nasdaq Basic feed](/Articles/Data-And- + Requests/The-SIPs.html#nasdaq-basic) if the account has a [stocks standard or pro + subscription](https://www.thetadata.net/subscribe.html#stocks). + - 15-minute delayed NBBO quote at-time_of_day-time from the [UTP & CTA feeds](/Articles/Data-And- + Requests/The-SIPs.html#equities-cta-utp) account has the [stocks value + subscription](https://www.thetadata.net/subscribe.html#stocks) subscription. + + #### Historical request: + Returns the last NBBO quote reported by [UTP & CTA feeds](/Articles/Data-And-Requests/The- + SIPs.html#equities-cta-utp) at a specified millisecond of the day. + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + time_of_day (str): + venue (Unset | StockAtTimeQuoteVenue): Default: StockAtTimeQuoteVenue.NQB. + format_ (Unset | StockAtTimeQuoteFormat): Default: StockAtTimeQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StockAtTimeQuoteResponse200 + """ + + + return sync_detailed( + client=client, +symbol=symbol, +start_date=start_date, +end_date=end_date, +time_of_day=time_of_day, +venue=venue, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + time_of_day: str, + venue: Unset | StockAtTimeQuoteVenue = StockAtTimeQuoteVenue.NQB, + format_: Unset | StockAtTimeQuoteFormat = StockAtTimeQuoteFormat.NDJSON, + +) -> Response[StockAtTimeQuoteResponse200]: + """ Quote + + #### Real-time request: + - Subscription tier standard or higher will default to NQB. + - Real-time last BBO quote at-time_of_day-time from the [Nasdaq Basic feed](/Articles/Data-And- + Requests/The-SIPs.html#nasdaq-basic) if the account has a [stocks standard or pro + subscription](https://www.thetadata.net/subscribe.html#stocks). + - 15-minute delayed NBBO quote at-time_of_day-time from the [UTP & CTA feeds](/Articles/Data-And- + Requests/The-SIPs.html#equities-cta-utp) account has the [stocks value + subscription](https://www.thetadata.net/subscribe.html#stocks) subscription. + + #### Historical request: + Returns the last NBBO quote reported by [UTP & CTA feeds](/Articles/Data-And-Requests/The- + SIPs.html#equities-cta-utp) at a specified millisecond of the day. + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + time_of_day (str): + venue (Unset | StockAtTimeQuoteVenue): Default: StockAtTimeQuoteVenue.NQB. + format_ (Unset | StockAtTimeQuoteFormat): Default: StockAtTimeQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StockAtTimeQuoteResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +start_date=start_date, +end_date=end_date, +time_of_day=time_of_day, +venue=venue, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + time_of_day: str, + venue: Unset | StockAtTimeQuoteVenue = StockAtTimeQuoteVenue.NQB, + format_: Unset | StockAtTimeQuoteFormat = StockAtTimeQuoteFormat.NDJSON, + +) -> StockAtTimeQuoteResponse200 | None: + """ Quote + + #### Real-time request: + - Subscription tier standard or higher will default to NQB. + - Real-time last BBO quote at-time_of_day-time from the [Nasdaq Basic feed](/Articles/Data-And- + Requests/The-SIPs.html#nasdaq-basic) if the account has a [stocks standard or pro + subscription](https://www.thetadata.net/subscribe.html#stocks). + - 15-minute delayed NBBO quote at-time_of_day-time from the [UTP & CTA feeds](/Articles/Data-And- + Requests/The-SIPs.html#equities-cta-utp) account has the [stocks value + subscription](https://www.thetadata.net/subscribe.html#stocks) subscription. + + #### Historical request: + Returns the last NBBO quote reported by [UTP & CTA feeds](/Articles/Data-And-Requests/The- + SIPs.html#equities-cta-utp) at a specified millisecond of the day. + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + time_of_day (str): + venue (Unset | StockAtTimeQuoteVenue): Default: StockAtTimeQuoteVenue.NQB. + format_ (Unset | StockAtTimeQuoteFormat): Default: StockAtTimeQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StockAtTimeQuoteResponse200 + """ + + + return (await asyncio_detailed( + client=client, +symbol=symbol, +start_date=start_date, +end_date=end_date, +time_of_day=time_of_day, +venue=venue, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/stock/stock_at_time_trade.py b/openapi_project/openapi_package/api/stock/stock_at_time_trade.py new file mode 100644 index 000000000..e426a7a60 --- /dev/null +++ b/openapi_project/openapi_package/api/stock/stock_at_time_trade.py @@ -0,0 +1,318 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.stock_at_time_trade_format import StockAtTimeTradeFormat +from openapi_project.openapi_package.models.stock_at_time_trade_response_200 import StockAtTimeTradeResponse200 +from openapi_project.openapi_package.models.stock_at_time_trade_venue import StockAtTimeTradeVenue +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + time_of_day: str, + venue: Unset | StockAtTimeTradeVenue = StockAtTimeTradeVenue.NQB, + format_: Unset | StockAtTimeTradeFormat = StockAtTimeTradeFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["symbol"] = symbol + + json_start_date = start_date.isoformat() + params["start_date"] = json_start_date + + json_end_date = end_date.isoformat() + params["end_date"] = json_end_date + + params["time_of_day"] = time_of_day + + json_venue: Unset | str = UNSET if isinstance(venue, Unset) else venue.value + + params["venue"] = json_venue + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/stock/at_time/trade", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> StockAtTimeTradeResponse200 | None: + if response.status_code == 200: + response_200 = StockAtTimeTradeResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[StockAtTimeTradeResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + time_of_day: str, + venue: Unset | StockAtTimeTradeVenue = StockAtTimeTradeVenue.NQB, + format_: Unset | StockAtTimeTradeFormat = StockAtTimeTradeFormat.NDJSON, + +) -> Response[StockAtTimeTradeResponse200]: + """ Trade + + #### Real-time request: + - Returns a real-time session from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The- + SIPs.html#nasdaq-basic) if the account has a [stocks standard or pro + subscription](https://www.thetadata.net/subscribe.html#stocks). + - Returns a 15-minute delayed session from the [UTP & CTA feeds](/Articles/Data-And-Requests/The- + SIPs.html#equities-cta-utp) account has the [stocks value + subscription](https://www.thetadata.net/subscribe.html#stocks) subscription. + + #### Historical request: + Returns the last trade reported by [UTP & CTA feeds](/Articles/Data-And-Requests/The- + SIPs.html#equities-cta-utp) at a specified millisecond of the day. + Trade condition mappings can be found [here](/Articles/Errors-Exchanges-Conditions/Trade- + Conditions.html). + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + time_of_day (str): + venue (Unset | StockAtTimeTradeVenue): Default: StockAtTimeTradeVenue.NQB. + format_ (Unset | StockAtTimeTradeFormat): Default: StockAtTimeTradeFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StockAtTimeTradeResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +start_date=start_date, +end_date=end_date, +time_of_day=time_of_day, +venue=venue, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + time_of_day: str, + venue: Unset | StockAtTimeTradeVenue = StockAtTimeTradeVenue.NQB, + format_: Unset | StockAtTimeTradeFormat = StockAtTimeTradeFormat.NDJSON, + +) -> StockAtTimeTradeResponse200 | None: + """ Trade + + #### Real-time request: + - Returns a real-time session from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The- + SIPs.html#nasdaq-basic) if the account has a [stocks standard or pro + subscription](https://www.thetadata.net/subscribe.html#stocks). + - Returns a 15-minute delayed session from the [UTP & CTA feeds](/Articles/Data-And-Requests/The- + SIPs.html#equities-cta-utp) account has the [stocks value + subscription](https://www.thetadata.net/subscribe.html#stocks) subscription. + + #### Historical request: + Returns the last trade reported by [UTP & CTA feeds](/Articles/Data-And-Requests/The- + SIPs.html#equities-cta-utp) at a specified millisecond of the day. + Trade condition mappings can be found [here](/Articles/Errors-Exchanges-Conditions/Trade- + Conditions.html). + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + time_of_day (str): + venue (Unset | StockAtTimeTradeVenue): Default: StockAtTimeTradeVenue.NQB. + format_ (Unset | StockAtTimeTradeFormat): Default: StockAtTimeTradeFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StockAtTimeTradeResponse200 + """ + + + return sync_detailed( + client=client, +symbol=symbol, +start_date=start_date, +end_date=end_date, +time_of_day=time_of_day, +venue=venue, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + time_of_day: str, + venue: Unset | StockAtTimeTradeVenue = StockAtTimeTradeVenue.NQB, + format_: Unset | StockAtTimeTradeFormat = StockAtTimeTradeFormat.NDJSON, + +) -> Response[StockAtTimeTradeResponse200]: + """ Trade + + #### Real-time request: + - Returns a real-time session from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The- + SIPs.html#nasdaq-basic) if the account has a [stocks standard or pro + subscription](https://www.thetadata.net/subscribe.html#stocks). + - Returns a 15-minute delayed session from the [UTP & CTA feeds](/Articles/Data-And-Requests/The- + SIPs.html#equities-cta-utp) account has the [stocks value + subscription](https://www.thetadata.net/subscribe.html#stocks) subscription. + + #### Historical request: + Returns the last trade reported by [UTP & CTA feeds](/Articles/Data-And-Requests/The- + SIPs.html#equities-cta-utp) at a specified millisecond of the day. + Trade condition mappings can be found [here](/Articles/Errors-Exchanges-Conditions/Trade- + Conditions.html). + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + time_of_day (str): + venue (Unset | StockAtTimeTradeVenue): Default: StockAtTimeTradeVenue.NQB. + format_ (Unset | StockAtTimeTradeFormat): Default: StockAtTimeTradeFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StockAtTimeTradeResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +start_date=start_date, +end_date=end_date, +time_of_day=time_of_day, +venue=venue, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + time_of_day: str, + venue: Unset | StockAtTimeTradeVenue = StockAtTimeTradeVenue.NQB, + format_: Unset | StockAtTimeTradeFormat = StockAtTimeTradeFormat.NDJSON, + +) -> StockAtTimeTradeResponse200 | None: + """ Trade + + #### Real-time request: + - Returns a real-time session from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The- + SIPs.html#nasdaq-basic) if the account has a [stocks standard or pro + subscription](https://www.thetadata.net/subscribe.html#stocks). + - Returns a 15-minute delayed session from the [UTP & CTA feeds](/Articles/Data-And-Requests/The- + SIPs.html#equities-cta-utp) account has the [stocks value + subscription](https://www.thetadata.net/subscribe.html#stocks) subscription. + + #### Historical request: + Returns the last trade reported by [UTP & CTA feeds](/Articles/Data-And-Requests/The- + SIPs.html#equities-cta-utp) at a specified millisecond of the day. + Trade condition mappings can be found [here](/Articles/Errors-Exchanges-Conditions/Trade- + Conditions.html). + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + time_of_day (str): + venue (Unset | StockAtTimeTradeVenue): Default: StockAtTimeTradeVenue.NQB. + format_ (Unset | StockAtTimeTradeFormat): Default: StockAtTimeTradeFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StockAtTimeTradeResponse200 + """ + + + return (await asyncio_detailed( + client=client, +symbol=symbol, +start_date=start_date, +end_date=end_date, +time_of_day=time_of_day, +venue=venue, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/stock/stock_history_eod.py b/openapi_project/openapi_package/api/stock/stock_history_eod.py new file mode 100644 index 000000000..dca3ed951 --- /dev/null +++ b/openapi_project/openapi_package/api/stock/stock_history_eod.py @@ -0,0 +1,265 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.stock_history_eod_format import StockHistoryEodFormat +from openapi_project.openapi_package.models.stock_history_eod_response_200 import StockHistoryEodResponse200 +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + format_: Unset | StockHistoryEodFormat = StockHistoryEodFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["symbol"] = symbol + + json_start_date = start_date.isoformat() + params["start_date"] = json_start_date + + json_end_date = end_date.isoformat() + params["end_date"] = json_end_date + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/stock/history/eod", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> StockHistoryEodResponse200 | None: + if response.status_code == 200: + response_200 = StockHistoryEodResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[StockHistoryEodResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + format_: Unset | StockHistoryEodFormat = StockHistoryEodFormat.NDJSON, + +) -> Response[StockHistoryEodResponse200]: + """ End of Day + + + Since [the equity SIPs](/Articles/Data-And-Requests/The-SIPs.html) only generate a partial EOD + report, Theta Data generates a national EOD report at 17:15 ET each day. ``created`` represents the + datetime the report was generated and ``last_trade`` represents the datetime of the last trade. The + quote in the response represents the last NBBO reported by [CTA or UTP](/Articles/Data-And- + Requests/The-SIPs.html) at the time of report generation. You can read more about EOD & OHLC data + [here](/Articles/Data-And-Requests/OHLC-EOD.html). Theta Data plans to avail SIP EOD reports in the + near future. + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + format_ (Unset | StockHistoryEodFormat): Default: StockHistoryEodFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StockHistoryEodResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +start_date=start_date, +end_date=end_date, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + format_: Unset | StockHistoryEodFormat = StockHistoryEodFormat.NDJSON, + +) -> StockHistoryEodResponse200 | None: + """ End of Day + + + Since [the equity SIPs](/Articles/Data-And-Requests/The-SIPs.html) only generate a partial EOD + report, Theta Data generates a national EOD report at 17:15 ET each day. ``created`` represents the + datetime the report was generated and ``last_trade`` represents the datetime of the last trade. The + quote in the response represents the last NBBO reported by [CTA or UTP](/Articles/Data-And- + Requests/The-SIPs.html) at the time of report generation. You can read more about EOD & OHLC data + [here](/Articles/Data-And-Requests/OHLC-EOD.html). Theta Data plans to avail SIP EOD reports in the + near future. + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + format_ (Unset | StockHistoryEodFormat): Default: StockHistoryEodFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StockHistoryEodResponse200 + """ + + + return sync_detailed( + client=client, +symbol=symbol, +start_date=start_date, +end_date=end_date, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + format_: Unset | StockHistoryEodFormat = StockHistoryEodFormat.NDJSON, + +) -> Response[StockHistoryEodResponse200]: + """ End of Day + + + Since [the equity SIPs](/Articles/Data-And-Requests/The-SIPs.html) only generate a partial EOD + report, Theta Data generates a national EOD report at 17:15 ET each day. ``created`` represents the + datetime the report was generated and ``last_trade`` represents the datetime of the last trade. The + quote in the response represents the last NBBO reported by [CTA or UTP](/Articles/Data-And- + Requests/The-SIPs.html) at the time of report generation. You can read more about EOD & OHLC data + [here](/Articles/Data-And-Requests/OHLC-EOD.html). Theta Data plans to avail SIP EOD reports in the + near future. + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + format_ (Unset | StockHistoryEodFormat): Default: StockHistoryEodFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StockHistoryEodResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +start_date=start_date, +end_date=end_date, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + symbol: str, + start_date: datetime.date, + end_date: datetime.date, + format_: Unset | StockHistoryEodFormat = StockHistoryEodFormat.NDJSON, + +) -> StockHistoryEodResponse200 | None: + """ End of Day + + + Since [the equity SIPs](/Articles/Data-And-Requests/The-SIPs.html) only generate a partial EOD + report, Theta Data generates a national EOD report at 17:15 ET each day. ``created`` represents the + datetime the report was generated and ``last_trade`` represents the datetime of the last trade. The + quote in the response represents the last NBBO reported by [CTA or UTP](/Articles/Data-And- + Requests/The-SIPs.html) at the time of report generation. You can read more about EOD & OHLC data + [here](/Articles/Data-And-Requests/OHLC-EOD.html). Theta Data plans to avail SIP EOD reports in the + near future. + + Args: + symbol (str): + start_date (datetime.date): + end_date (datetime.date): + format_ (Unset | StockHistoryEodFormat): Default: StockHistoryEodFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StockHistoryEodResponse200 + """ + + + return (await asyncio_detailed( + client=client, +symbol=symbol, +start_date=start_date, +end_date=end_date, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/stock/stock_history_ohlc.py b/openapi_project/openapi_package/api/stock/stock_history_ohlc.py new file mode 100644 index 000000000..ce3fbc63e --- /dev/null +++ b/openapi_project/openapi_package/api/stock/stock_history_ohlc.py @@ -0,0 +1,306 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.stock_history_ohlc_format import StockHistoryOhlcFormat +from openapi_project.openapi_package.models.stock_history_ohlc_interval import StockHistoryOhlcInterval +from openapi_project.openapi_package.models.stock_history_ohlc_response_200 import StockHistoryOhlcResponse200 +from openapi_project.openapi_package.models.stock_history_ohlc_venue import StockHistoryOhlcVenue +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + symbol: str, + date: datetime.date, + interval: StockHistoryOhlcInterval = StockHistoryOhlcInterval.VALUE_4, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + venue: Unset | StockHistoryOhlcVenue = StockHistoryOhlcVenue.NQB, + format_: Unset | StockHistoryOhlcFormat = StockHistoryOhlcFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["symbol"] = symbol + + json_date = date.isoformat() + params["date"] = json_date + + json_interval = interval.value + params["interval"] = json_interval + + params["start_time"] = start_time + + params["end_time"] = end_time + + json_venue: Unset | str = UNSET if isinstance(venue, Unset) else venue.value + + params["venue"] = json_venue + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/stock/history/ohlc", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> StockHistoryOhlcResponse200 | None: + if response.status_code == 200: + response_200 = StockHistoryOhlcResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[StockHistoryOhlcResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + date: datetime.date, + interval: StockHistoryOhlcInterval = StockHistoryOhlcInterval.VALUE_4, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + venue: Unset | StockHistoryOhlcVenue = StockHistoryOhlcVenue.NQB, + format_: Unset | StockHistoryOhlcFormat = StockHistoryOhlcFormat.NDJSON, + +) -> Response[StockHistoryOhlcResponse200]: + """ Open High Low Close + + Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. + Time timestamp of the bar represents the opening time of the bar. For a trade to be part of the bar: + ``bar time`` <= ``trade time`` < ``bar timestamp + ivl``, where ivl is the specified interval size + in milliseconds. Set the ``venue`` parameter to ``nqb`` to access current-day real-time historic + data from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks + standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks). + + Args: + symbol (str): + date (datetime.date): + interval (StockHistoryOhlcInterval): Default: StockHistoryOhlcInterval.VALUE_4. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + venue (Unset | StockHistoryOhlcVenue): Default: StockHistoryOhlcVenue.NQB. + format_ (Unset | StockHistoryOhlcFormat): Default: StockHistoryOhlcFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StockHistoryOhlcResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +date=date, +interval=interval, +start_time=start_time, +end_time=end_time, +venue=venue, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + symbol: str, + date: datetime.date, + interval: StockHistoryOhlcInterval = StockHistoryOhlcInterval.VALUE_4, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + venue: Unset | StockHistoryOhlcVenue = StockHistoryOhlcVenue.NQB, + format_: Unset | StockHistoryOhlcFormat = StockHistoryOhlcFormat.NDJSON, + +) -> StockHistoryOhlcResponse200 | None: + """ Open High Low Close + + Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. + Time timestamp of the bar represents the opening time of the bar. For a trade to be part of the bar: + ``bar time`` <= ``trade time`` < ``bar timestamp + ivl``, where ivl is the specified interval size + in milliseconds. Set the ``venue`` parameter to ``nqb`` to access current-day real-time historic + data from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks + standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks). + + Args: + symbol (str): + date (datetime.date): + interval (StockHistoryOhlcInterval): Default: StockHistoryOhlcInterval.VALUE_4. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + venue (Unset | StockHistoryOhlcVenue): Default: StockHistoryOhlcVenue.NQB. + format_ (Unset | StockHistoryOhlcFormat): Default: StockHistoryOhlcFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StockHistoryOhlcResponse200 + """ + + + return sync_detailed( + client=client, +symbol=symbol, +date=date, +interval=interval, +start_time=start_time, +end_time=end_time, +venue=venue, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + date: datetime.date, + interval: StockHistoryOhlcInterval = StockHistoryOhlcInterval.VALUE_4, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + venue: Unset | StockHistoryOhlcVenue = StockHistoryOhlcVenue.NQB, + format_: Unset | StockHistoryOhlcFormat = StockHistoryOhlcFormat.NDJSON, + +) -> Response[StockHistoryOhlcResponse200]: + """ Open High Low Close + + Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. + Time timestamp of the bar represents the opening time of the bar. For a trade to be part of the bar: + ``bar time`` <= ``trade time`` < ``bar timestamp + ivl``, where ivl is the specified interval size + in milliseconds. Set the ``venue`` parameter to ``nqb`` to access current-day real-time historic + data from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks + standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks). + + Args: + symbol (str): + date (datetime.date): + interval (StockHistoryOhlcInterval): Default: StockHistoryOhlcInterval.VALUE_4. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + venue (Unset | StockHistoryOhlcVenue): Default: StockHistoryOhlcVenue.NQB. + format_ (Unset | StockHistoryOhlcFormat): Default: StockHistoryOhlcFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StockHistoryOhlcResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +date=date, +interval=interval, +start_time=start_time, +end_time=end_time, +venue=venue, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + symbol: str, + date: datetime.date, + interval: StockHistoryOhlcInterval = StockHistoryOhlcInterval.VALUE_4, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + venue: Unset | StockHistoryOhlcVenue = StockHistoryOhlcVenue.NQB, + format_: Unset | StockHistoryOhlcFormat = StockHistoryOhlcFormat.NDJSON, + +) -> StockHistoryOhlcResponse200 | None: + """ Open High Low Close + + Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. + Time timestamp of the bar represents the opening time of the bar. For a trade to be part of the bar: + ``bar time`` <= ``trade time`` < ``bar timestamp + ivl``, where ivl is the specified interval size + in milliseconds. Set the ``venue`` parameter to ``nqb`` to access current-day real-time historic + data from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks + standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks). + + Args: + symbol (str): + date (datetime.date): + interval (StockHistoryOhlcInterval): Default: StockHistoryOhlcInterval.VALUE_4. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + venue (Unset | StockHistoryOhlcVenue): Default: StockHistoryOhlcVenue.NQB. + format_ (Unset | StockHistoryOhlcFormat): Default: StockHistoryOhlcFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StockHistoryOhlcResponse200 + """ + + + return (await asyncio_detailed( + client=client, +symbol=symbol, +date=date, +interval=interval, +start_time=start_time, +end_time=end_time, +venue=venue, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/stock/stock_history_quote.py b/openapi_project/openapi_package/api/stock/stock_history_quote.py new file mode 100644 index 000000000..18739f6be --- /dev/null +++ b/openapi_project/openapi_package/api/stock/stock_history_quote.py @@ -0,0 +1,302 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.stock_history_quote_format import StockHistoryQuoteFormat +from openapi_project.openapi_package.models.stock_history_quote_interval import StockHistoryQuoteInterval +from openapi_project.openapi_package.models.stock_history_quote_response_200 import StockHistoryQuoteResponse200 +from openapi_project.openapi_package.models.stock_history_quote_venue import StockHistoryQuoteVenue +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + symbol: str, + date: datetime.date, + interval: StockHistoryQuoteInterval = StockHistoryQuoteInterval.VALUE_4, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + venue: Unset | StockHistoryQuoteVenue = StockHistoryQuoteVenue.NQB, + format_: Unset | StockHistoryQuoteFormat = StockHistoryQuoteFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["symbol"] = symbol + + json_date = date.isoformat() + params["date"] = json_date + + json_interval = interval.value + params["interval"] = json_interval + + params["start_time"] = start_time + + params["end_time"] = end_time + + json_venue: Unset | str = UNSET if isinstance(venue, Unset) else venue.value + + params["venue"] = json_venue + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/stock/history/quote", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> StockHistoryQuoteResponse200 | None: + if response.status_code == 200: + response_200 = StockHistoryQuoteResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[StockHistoryQuoteResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + date: datetime.date, + interval: StockHistoryQuoteInterval = StockHistoryQuoteInterval.VALUE_4, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + venue: Unset | StockHistoryQuoteVenue = StockHistoryQuoteVenue.NQB, + format_: Unset | StockHistoryQuoteFormat = StockHistoryQuoteFormat.NDJSON, + +) -> Response[StockHistoryQuoteResponse200]: + """ Quote + + Returns every NBBO quote reported by [UTP and CTA](/Articles/Data-And-Requests/The-SIPs). If the + ``interval`` parameter is specified, the quote for each interval represents the last quote prior to + the interval's timestamp. Set the ``venue`` parameter to ``nqb`` to access current-day real-time + historic data from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has + a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks). + + Args: + symbol (str): + date (datetime.date): + interval (StockHistoryQuoteInterval): Default: StockHistoryQuoteInterval.VALUE_4. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + venue (Unset | StockHistoryQuoteVenue): Default: StockHistoryQuoteVenue.NQB. + format_ (Unset | StockHistoryQuoteFormat): Default: StockHistoryQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StockHistoryQuoteResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +date=date, +interval=interval, +start_time=start_time, +end_time=end_time, +venue=venue, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + symbol: str, + date: datetime.date, + interval: StockHistoryQuoteInterval = StockHistoryQuoteInterval.VALUE_4, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + venue: Unset | StockHistoryQuoteVenue = StockHistoryQuoteVenue.NQB, + format_: Unset | StockHistoryQuoteFormat = StockHistoryQuoteFormat.NDJSON, + +) -> StockHistoryQuoteResponse200 | None: + """ Quote + + Returns every NBBO quote reported by [UTP and CTA](/Articles/Data-And-Requests/The-SIPs). If the + ``interval`` parameter is specified, the quote for each interval represents the last quote prior to + the interval's timestamp. Set the ``venue`` parameter to ``nqb`` to access current-day real-time + historic data from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has + a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks). + + Args: + symbol (str): + date (datetime.date): + interval (StockHistoryQuoteInterval): Default: StockHistoryQuoteInterval.VALUE_4. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + venue (Unset | StockHistoryQuoteVenue): Default: StockHistoryQuoteVenue.NQB. + format_ (Unset | StockHistoryQuoteFormat): Default: StockHistoryQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StockHistoryQuoteResponse200 + """ + + + return sync_detailed( + client=client, +symbol=symbol, +date=date, +interval=interval, +start_time=start_time, +end_time=end_time, +venue=venue, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + date: datetime.date, + interval: StockHistoryQuoteInterval = StockHistoryQuoteInterval.VALUE_4, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + venue: Unset | StockHistoryQuoteVenue = StockHistoryQuoteVenue.NQB, + format_: Unset | StockHistoryQuoteFormat = StockHistoryQuoteFormat.NDJSON, + +) -> Response[StockHistoryQuoteResponse200]: + """ Quote + + Returns every NBBO quote reported by [UTP and CTA](/Articles/Data-And-Requests/The-SIPs). If the + ``interval`` parameter is specified, the quote for each interval represents the last quote prior to + the interval's timestamp. Set the ``venue`` parameter to ``nqb`` to access current-day real-time + historic data from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has + a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks). + + Args: + symbol (str): + date (datetime.date): + interval (StockHistoryQuoteInterval): Default: StockHistoryQuoteInterval.VALUE_4. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + venue (Unset | StockHistoryQuoteVenue): Default: StockHistoryQuoteVenue.NQB. + format_ (Unset | StockHistoryQuoteFormat): Default: StockHistoryQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StockHistoryQuoteResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +date=date, +interval=interval, +start_time=start_time, +end_time=end_time, +venue=venue, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + symbol: str, + date: datetime.date, + interval: StockHistoryQuoteInterval = StockHistoryQuoteInterval.VALUE_4, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + venue: Unset | StockHistoryQuoteVenue = StockHistoryQuoteVenue.NQB, + format_: Unset | StockHistoryQuoteFormat = StockHistoryQuoteFormat.NDJSON, + +) -> StockHistoryQuoteResponse200 | None: + """ Quote + + Returns every NBBO quote reported by [UTP and CTA](/Articles/Data-And-Requests/The-SIPs). If the + ``interval`` parameter is specified, the quote for each interval represents the last quote prior to + the interval's timestamp. Set the ``venue`` parameter to ``nqb`` to access current-day real-time + historic data from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has + a [stocks standard or pro subscription](https://www.thetadata.net/subscribe.html#stocks). + + Args: + symbol (str): + date (datetime.date): + interval (StockHistoryQuoteInterval): Default: StockHistoryQuoteInterval.VALUE_4. + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + venue (Unset | StockHistoryQuoteVenue): Default: StockHistoryQuoteVenue.NQB. + format_ (Unset | StockHistoryQuoteFormat): Default: StockHistoryQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StockHistoryQuoteResponse200 + """ + + + return (await asyncio_detailed( + client=client, +symbol=symbol, +date=date, +interval=interval, +start_time=start_time, +end_time=end_time, +venue=venue, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/stock/stock_history_trade.py b/openapi_project/openapi_package/api/stock/stock_history_trade.py new file mode 100644 index 000000000..b57ac589f --- /dev/null +++ b/openapi_project/openapi_package/api/stock/stock_history_trade.py @@ -0,0 +1,186 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.stock_history_trade_format import StockHistoryTradeFormat +from openapi_project.openapi_package.models.stock_history_trade_venue import StockHistoryTradeVenue +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + symbol: str, + date: datetime.date, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + venue: Unset | StockHistoryTradeVenue = StockHistoryTradeVenue.NQB, + format_: Unset | StockHistoryTradeFormat = StockHistoryTradeFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["symbol"] = symbol + + json_date = date.isoformat() + params["date"] = json_date + + params["start_time"] = start_time + + params["end_time"] = end_time + + json_venue: Unset | str = UNSET if isinstance(venue, Unset) else venue.value + + params["venue"] = json_venue + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/stock/history/trade", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: + if response.status_code == 200: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + date: datetime.date, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + venue: Unset | StockHistoryTradeVenue = StockHistoryTradeVenue.NQB, + format_: Unset | StockHistoryTradeFormat = StockHistoryTradeFormat.NDJSON, + +) -> Response[Any]: + """ Trade + + Returns every trade reported by [UTP & CTA](/Articles/Data-And-Requests/The-SIPs). Set the ``venue`` + parameter to ``nqb`` to access current-day real-time historic data from the [Nasdaq Basic + feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks standard or pro + subscription](https://www.thetadata.net/subscribe.html#stocks). + + Args: + symbol (str): + date (datetime.date): + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + venue (Unset | StockHistoryTradeVenue): Default: StockHistoryTradeVenue.NQB. + format_ (Unset | StockHistoryTradeFormat): Default: StockHistoryTradeFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +date=date, +start_time=start_time, +end_time=end_time, +venue=venue, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + date: datetime.date, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + venue: Unset | StockHistoryTradeVenue = StockHistoryTradeVenue.NQB, + format_: Unset | StockHistoryTradeFormat = StockHistoryTradeFormat.NDJSON, + +) -> Response[Any]: + """ Trade + + Returns every trade reported by [UTP & CTA](/Articles/Data-And-Requests/The-SIPs). Set the ``venue`` + parameter to ``nqb`` to access current-day real-time historic data from the [Nasdaq Basic + feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks standard or pro + subscription](https://www.thetadata.net/subscribe.html#stocks). + + Args: + symbol (str): + date (datetime.date): + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + venue (Unset | StockHistoryTradeVenue): Default: StockHistoryTradeVenue.NQB. + format_ (Unset | StockHistoryTradeFormat): Default: StockHistoryTradeFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +date=date, +start_time=start_time, +end_time=end_time, +venue=venue, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + diff --git a/openapi_project/openapi_package/api/stock/stock_history_trade_quote.py b/openapi_project/openapi_package/api/stock/stock_history_trade_quote.py new file mode 100644 index 000000000..cc18025cb --- /dev/null +++ b/openapi_project/openapi_package/api/stock/stock_history_trade_quote.py @@ -0,0 +1,203 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.stock_history_trade_quote_format import StockHistoryTradeQuoteFormat +from openapi_project.openapi_package.models.stock_history_trade_quote_venue import StockHistoryTradeQuoteVenue +from openapi_project.openapi_package.types import UNSET, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + + + +def _get_kwargs( + *, + symbol: str, + date: datetime.date, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + exclusive: Unset | bool = True, + venue: Unset | StockHistoryTradeQuoteVenue = StockHistoryTradeQuoteVenue.NQB, + format_: Unset | StockHistoryTradeQuoteFormat = StockHistoryTradeQuoteFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["symbol"] = symbol + + json_date = date.isoformat() + params["date"] = json_date + + params["start_time"] = start_time + + params["end_time"] = end_time + + params["exclusive"] = exclusive + + json_venue: Unset | str = UNSET if isinstance(venue, Unset) else venue.value + + params["venue"] = json_venue + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/stock/history/trade_quote", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: + if response.status_code == 200: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + date: datetime.date, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + exclusive: Unset | bool = True, + venue: Unset | StockHistoryTradeQuoteVenue = StockHistoryTradeQuoteVenue.NQB, + format_: Unset | StockHistoryTradeQuoteFormat = StockHistoryTradeQuoteFormat.NDJSON, + +) -> Response[Any]: + """ Trade Quote + + Returns every trade reported by [UTP & CTA](/Articles/Data-And-Requests/The-SIPs) paired with the + last BBO quote reported by [UTP or CTA](/Articles/Data-And-Requests/The-SIPs) at the time of trade. + A quote is matched with a trade if its timestamp ``<=`` the trade timestamp. If you prefer to match + quotes with timestamps that are ``<`` the trade timestamp, specify the ``exclusive`` parameter to + ``true``. Set the ``venue`` parameter to ``nqb`` to access current-day real-time historic data from + the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks standard + or pro subscription](https://www.thetadata.net/subscribe.html#stocks). + + Args: + symbol (str): + date (datetime.date): + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + exclusive (Unset | bool): Default: True. + venue (Unset | StockHistoryTradeQuoteVenue): Default: StockHistoryTradeQuoteVenue.NQB. + format_ (Unset | StockHistoryTradeQuoteFormat): Default: + StockHistoryTradeQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +date=date, +start_time=start_time, +end_time=end_time, +exclusive=exclusive, +venue=venue, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: str, + date: datetime.date, + start_time: Unset | str = '09:30:00', + end_time: Unset | str = '16:00:00', + exclusive: Unset | bool = True, + venue: Unset | StockHistoryTradeQuoteVenue = StockHistoryTradeQuoteVenue.NQB, + format_: Unset | StockHistoryTradeQuoteFormat = StockHistoryTradeQuoteFormat.NDJSON, + +) -> Response[Any]: + """ Trade Quote + + Returns every trade reported by [UTP & CTA](/Articles/Data-And-Requests/The-SIPs) paired with the + last BBO quote reported by [UTP or CTA](/Articles/Data-And-Requests/The-SIPs) at the time of trade. + A quote is matched with a trade if its timestamp ``<=`` the trade timestamp. If you prefer to match + quotes with timestamps that are ``<`` the trade timestamp, specify the ``exclusive`` parameter to + ``true``. Set the ``venue`` parameter to ``nqb`` to access current-day real-time historic data from + the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if the account has a [stocks standard + or pro subscription](https://www.thetadata.net/subscribe.html#stocks). + + Args: + symbol (str): + date (datetime.date): + start_time (Unset | str): Default: '09:30:00'. + end_time (Unset | str): Default: '16:00:00'. + exclusive (Unset | bool): Default: True. + venue (Unset | StockHistoryTradeQuoteVenue): Default: StockHistoryTradeQuoteVenue.NQB. + format_ (Unset | StockHistoryTradeQuoteFormat): Default: + StockHistoryTradeQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +date=date, +start_time=start_time, +end_time=end_time, +exclusive=exclusive, +venue=venue, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + diff --git a/openapi_project/openapi_package/api/stock/stock_list_dates.py b/openapi_project/openapi_package/api/stock/stock_list_dates.py new file mode 100644 index 000000000..f422dcbf1 --- /dev/null +++ b/openapi_project/openapi_package/api/stock/stock_list_dates.py @@ -0,0 +1,224 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.stock_list_dates_format import StockListDatesFormat +from openapi_project.openapi_package.models.stock_list_dates_request_type import StockListDatesRequestType +from openapi_project.openapi_package.models.stock_list_dates_response_200 import StockListDatesResponse200 +from openapi_project.openapi_package.types import UNSET, Unset +from typing import cast + + + +def _get_kwargs( + request_type: StockListDatesRequestType, + *, + symbol: list[str], + format_: Unset | StockListDatesFormat = StockListDatesFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_symbol = symbol + + + params["symbol"] = json_symbol + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/stock/list/dates/{request_type}".format(request_type=request_type,), + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> StockListDatesResponse200 | None: + if response.status_code == 200: + response_200 = StockListDatesResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[StockListDatesResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + request_type: StockListDatesRequestType, + *, + client: AuthenticatedClient | Client, + symbol: list[str], + format_: Unset | StockListDatesFormat = StockListDatesFormat.NDJSON, + +) -> Response[StockListDatesResponse200]: + """ Dates + + Lists all dates of data that are available for a stock with a given request type and symbol. This + endpoint is updated overnight. + + Args: + request_type (StockListDatesRequestType): + symbol (list[str]): + format_ (Unset | StockListDatesFormat): Default: StockListDatesFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StockListDatesResponse200] + """ + + + kwargs = _get_kwargs( + request_type=request_type, +symbol=symbol, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + request_type: StockListDatesRequestType, + *, + client: AuthenticatedClient | Client, + symbol: list[str], + format_: Unset | StockListDatesFormat = StockListDatesFormat.NDJSON, + +) -> StockListDatesResponse200 | None: + """ Dates + + Lists all dates of data that are available for a stock with a given request type and symbol. This + endpoint is updated overnight. + + Args: + request_type (StockListDatesRequestType): + symbol (list[str]): + format_ (Unset | StockListDatesFormat): Default: StockListDatesFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StockListDatesResponse200 + """ + + + return sync_detailed( + request_type=request_type, +client=client, +symbol=symbol, +format_=format_, + + ).parsed + +async def asyncio_detailed( + request_type: StockListDatesRequestType, + *, + client: AuthenticatedClient | Client, + symbol: list[str], + format_: Unset | StockListDatesFormat = StockListDatesFormat.NDJSON, + +) -> Response[StockListDatesResponse200]: + """ Dates + + Lists all dates of data that are available for a stock with a given request type and symbol. This + endpoint is updated overnight. + + Args: + request_type (StockListDatesRequestType): + symbol (list[str]): + format_ (Unset | StockListDatesFormat): Default: StockListDatesFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StockListDatesResponse200] + """ + + + kwargs = _get_kwargs( + request_type=request_type, +symbol=symbol, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + request_type: StockListDatesRequestType, + *, + client: AuthenticatedClient | Client, + symbol: list[str], + format_: Unset | StockListDatesFormat = StockListDatesFormat.NDJSON, + +) -> StockListDatesResponse200 | None: + """ Dates + + Lists all dates of data that are available for a stock with a given request type and symbol. This + endpoint is updated overnight. + + Args: + request_type (StockListDatesRequestType): + symbol (list[str]): + format_ (Unset | StockListDatesFormat): Default: StockListDatesFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StockListDatesResponse200 + """ + + + return (await asyncio_detailed( + request_type=request_type, +client=client, +symbol=symbol, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/stock/stock_list_symbols.py b/openapi_project/openapi_package/api/stock/stock_list_symbols.py new file mode 100644 index 000000000..82ab66417 --- /dev/null +++ b/openapi_project/openapi_package/api/stock/stock_list_symbols.py @@ -0,0 +1,196 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.stock_list_symbols_format import StockListSymbolsFormat +from openapi_project.openapi_package.models.stock_list_symbols_response_200 import StockListSymbolsResponse200 +from openapi_project.openapi_package.types import UNSET, Unset +from typing import cast + + + +def _get_kwargs( + *, + format_: Unset | StockListSymbolsFormat = StockListSymbolsFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/stock/list/symbols", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> StockListSymbolsResponse200 | None: + if response.status_code == 200: + response_200 = StockListSymbolsResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[StockListSymbolsResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + format_: Unset | StockListSymbolsFormat = StockListSymbolsFormat.NDJSON, + +) -> Response[StockListSymbolsResponse200]: + """ Symbols + + A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also + include: root, ticker, and underlying. This endpoint returns all traded symbols for stocks. This + endpoint is updated overnight. + + Args: + format_ (Unset | StockListSymbolsFormat): Default: StockListSymbolsFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StockListSymbolsResponse200] + """ + + + kwargs = _get_kwargs( + format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + format_: Unset | StockListSymbolsFormat = StockListSymbolsFormat.NDJSON, + +) -> StockListSymbolsResponse200 | None: + """ Symbols + + A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also + include: root, ticker, and underlying. This endpoint returns all traded symbols for stocks. This + endpoint is updated overnight. + + Args: + format_ (Unset | StockListSymbolsFormat): Default: StockListSymbolsFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StockListSymbolsResponse200 + """ + + + return sync_detailed( + client=client, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + format_: Unset | StockListSymbolsFormat = StockListSymbolsFormat.NDJSON, + +) -> Response[StockListSymbolsResponse200]: + """ Symbols + + A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also + include: root, ticker, and underlying. This endpoint returns all traded symbols for stocks. This + endpoint is updated overnight. + + Args: + format_ (Unset | StockListSymbolsFormat): Default: StockListSymbolsFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StockListSymbolsResponse200] + """ + + + kwargs = _get_kwargs( + format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + format_: Unset | StockListSymbolsFormat = StockListSymbolsFormat.NDJSON, + +) -> StockListSymbolsResponse200 | None: + """ Symbols + + A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also + include: root, ticker, and underlying. This endpoint returns all traded symbols for stocks. This + endpoint is updated overnight. + + Args: + format_ (Unset | StockListSymbolsFormat): Default: StockListSymbolsFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StockListSymbolsResponse200 + """ + + + return (await asyncio_detailed( + client=client, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/stock/stock_snapshot_ohlc.py b/openapi_project/openapi_package/api/stock/stock_snapshot_ohlc.py new file mode 100644 index 000000000..e40e0d349 --- /dev/null +++ b/openapi_project/openapi_package/api/stock/stock_snapshot_ohlc.py @@ -0,0 +1,260 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.stock_snapshot_ohlc_format import StockSnapshotOhlcFormat +from openapi_project.openapi_package.models.stock_snapshot_ohlc_response_200 import StockSnapshotOhlcResponse200 +from openapi_project.openapi_package.models.stock_snapshot_ohlc_venue import StockSnapshotOhlcVenue +from openapi_project.openapi_package.types import UNSET, Unset +from typing import cast + + + +def _get_kwargs( + *, + symbol: list[str], + venue: Unset | StockSnapshotOhlcVenue = StockSnapshotOhlcVenue.NQB, + format_: Unset | StockSnapshotOhlcFormat = StockSnapshotOhlcFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_symbol = symbol + + + params["symbol"] = json_symbol + + json_venue: Unset | str = UNSET if isinstance(venue, Unset) else venue.value + + params["venue"] = json_venue + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/stock/snapshot/ohlc", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> StockSnapshotOhlcResponse200 | None: + if response.status_code == 200: + response_200 = StockSnapshotOhlcResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[StockSnapshotOhlcResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + venue: Unset | StockSnapshotOhlcVenue = StockSnapshotOhlcVenue.NQB, + format_: Unset | StockSnapshotOhlcFormat = StockSnapshotOhlcFormat.NDJSON, + +) -> Response[StockSnapshotOhlcResponse200]: + """ Open High Low Close + + + Provides a real-time Open, High, Low, Close for the current day. + * Returns a real-time session OHLC from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The- + SIPs) if the account has a [stocks standard or pro + subscription](https://www.thetadata.net/subscribe.html#stocks). + * Returns a 15-minute delayed session OHLC from the [UTP & CTA feeds](/Articles/Data-And- + Requests/The-SIPs) if the account has the stocks value subscription. + * ThetaData resets its snapshot cache at midnight ET every day. This endpoint may not work on a + weekend where there were no eligible messages sent over exchange feeds. We recommend using historic + requests during the weekend. + + Args: + symbol (list[str]): + venue (Unset | StockSnapshotOhlcVenue): Default: StockSnapshotOhlcVenue.NQB. + format_ (Unset | StockSnapshotOhlcFormat): Default: StockSnapshotOhlcFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StockSnapshotOhlcResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +venue=venue, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + venue: Unset | StockSnapshotOhlcVenue = StockSnapshotOhlcVenue.NQB, + format_: Unset | StockSnapshotOhlcFormat = StockSnapshotOhlcFormat.NDJSON, + +) -> StockSnapshotOhlcResponse200 | None: + """ Open High Low Close + + + Provides a real-time Open, High, Low, Close for the current day. + * Returns a real-time session OHLC from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The- + SIPs) if the account has a [stocks standard or pro + subscription](https://www.thetadata.net/subscribe.html#stocks). + * Returns a 15-minute delayed session OHLC from the [UTP & CTA feeds](/Articles/Data-And- + Requests/The-SIPs) if the account has the stocks value subscription. + * ThetaData resets its snapshot cache at midnight ET every day. This endpoint may not work on a + weekend where there were no eligible messages sent over exchange feeds. We recommend using historic + requests during the weekend. + + Args: + symbol (list[str]): + venue (Unset | StockSnapshotOhlcVenue): Default: StockSnapshotOhlcVenue.NQB. + format_ (Unset | StockSnapshotOhlcFormat): Default: StockSnapshotOhlcFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StockSnapshotOhlcResponse200 + """ + + + return sync_detailed( + client=client, +symbol=symbol, +venue=venue, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + venue: Unset | StockSnapshotOhlcVenue = StockSnapshotOhlcVenue.NQB, + format_: Unset | StockSnapshotOhlcFormat = StockSnapshotOhlcFormat.NDJSON, + +) -> Response[StockSnapshotOhlcResponse200]: + """ Open High Low Close + + + Provides a real-time Open, High, Low, Close for the current day. + * Returns a real-time session OHLC from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The- + SIPs) if the account has a [stocks standard or pro + subscription](https://www.thetadata.net/subscribe.html#stocks). + * Returns a 15-minute delayed session OHLC from the [UTP & CTA feeds](/Articles/Data-And- + Requests/The-SIPs) if the account has the stocks value subscription. + * ThetaData resets its snapshot cache at midnight ET every day. This endpoint may not work on a + weekend where there were no eligible messages sent over exchange feeds. We recommend using historic + requests during the weekend. + + Args: + symbol (list[str]): + venue (Unset | StockSnapshotOhlcVenue): Default: StockSnapshotOhlcVenue.NQB. + format_ (Unset | StockSnapshotOhlcFormat): Default: StockSnapshotOhlcFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StockSnapshotOhlcResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +venue=venue, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + venue: Unset | StockSnapshotOhlcVenue = StockSnapshotOhlcVenue.NQB, + format_: Unset | StockSnapshotOhlcFormat = StockSnapshotOhlcFormat.NDJSON, + +) -> StockSnapshotOhlcResponse200 | None: + """ Open High Low Close + + + Provides a real-time Open, High, Low, Close for the current day. + * Returns a real-time session OHLC from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The- + SIPs) if the account has a [stocks standard or pro + subscription](https://www.thetadata.net/subscribe.html#stocks). + * Returns a 15-minute delayed session OHLC from the [UTP & CTA feeds](/Articles/Data-And- + Requests/The-SIPs) if the account has the stocks value subscription. + * ThetaData resets its snapshot cache at midnight ET every day. This endpoint may not work on a + weekend where there were no eligible messages sent over exchange feeds. We recommend using historic + requests during the weekend. + + Args: + symbol (list[str]): + venue (Unset | StockSnapshotOhlcVenue): Default: StockSnapshotOhlcVenue.NQB. + format_ (Unset | StockSnapshotOhlcFormat): Default: StockSnapshotOhlcFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StockSnapshotOhlcResponse200 + """ + + + return (await asyncio_detailed( + client=client, +symbol=symbol, +venue=venue, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/stock/stock_snapshot_quote.py b/openapi_project/openapi_package/api/stock/stock_snapshot_quote.py new file mode 100644 index 000000000..bbd16ce6c --- /dev/null +++ b/openapi_project/openapi_package/api/stock/stock_snapshot_quote.py @@ -0,0 +1,256 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.stock_snapshot_quote_format import StockSnapshotQuoteFormat +from openapi_project.openapi_package.models.stock_snapshot_quote_response_200 import StockSnapshotQuoteResponse200 +from openapi_project.openapi_package.models.stock_snapshot_quote_venue import StockSnapshotQuoteVenue +from openapi_project.openapi_package.types import UNSET, Unset +from typing import cast + + + +def _get_kwargs( + *, + symbol: list[str], + venue: Unset | StockSnapshotQuoteVenue = StockSnapshotQuoteVenue.NQB, + format_: Unset | StockSnapshotQuoteFormat = StockSnapshotQuoteFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_symbol = symbol + + + params["symbol"] = json_symbol + + json_venue: Unset | str = UNSET if isinstance(venue, Unset) else venue.value + + params["venue"] = json_venue + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/stock/snapshot/quote", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> StockSnapshotQuoteResponse200 | None: + if response.status_code == 200: + response_200 = StockSnapshotQuoteResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[StockSnapshotQuoteResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + venue: Unset | StockSnapshotQuoteVenue = StockSnapshotQuoteVenue.NQB, + format_: Unset | StockSnapshotQuoteFormat = StockSnapshotQuoteFormat.NDJSON, + +) -> Response[StockSnapshotQuoteResponse200]: + """ Quote + + * Returns a real-time last BBO quote from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The- + SIPs) if the account has a [stocks standard or pro + subscription](https://www.thetadata.net/subscribe.html#stocks). + * Returns a 15-minute delayed NBBO quote from the [UTP & CTA feeds](/Articles/Data-And-Requests/The- + SIPs) account has the [stocks value subscription](https://www.thetadata.net/subscribe.html#stocks) + subscription. + - ThetaData resets its snapshot cache at midnight ET every day. This endpoint may not work on a + weekend where there were no eligible messages sent over exchange feeds. We recommend using historic + requests during the weekend. + + Args: + symbol (list[str]): + venue (Unset | StockSnapshotQuoteVenue): Default: StockSnapshotQuoteVenue.NQB. + format_ (Unset | StockSnapshotQuoteFormat): Default: StockSnapshotQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StockSnapshotQuoteResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +venue=venue, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + venue: Unset | StockSnapshotQuoteVenue = StockSnapshotQuoteVenue.NQB, + format_: Unset | StockSnapshotQuoteFormat = StockSnapshotQuoteFormat.NDJSON, + +) -> StockSnapshotQuoteResponse200 | None: + """ Quote + + * Returns a real-time last BBO quote from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The- + SIPs) if the account has a [stocks standard or pro + subscription](https://www.thetadata.net/subscribe.html#stocks). + * Returns a 15-minute delayed NBBO quote from the [UTP & CTA feeds](/Articles/Data-And-Requests/The- + SIPs) account has the [stocks value subscription](https://www.thetadata.net/subscribe.html#stocks) + subscription. + - ThetaData resets its snapshot cache at midnight ET every day. This endpoint may not work on a + weekend where there were no eligible messages sent over exchange feeds. We recommend using historic + requests during the weekend. + + Args: + symbol (list[str]): + venue (Unset | StockSnapshotQuoteVenue): Default: StockSnapshotQuoteVenue.NQB. + format_ (Unset | StockSnapshotQuoteFormat): Default: StockSnapshotQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StockSnapshotQuoteResponse200 + """ + + + return sync_detailed( + client=client, +symbol=symbol, +venue=venue, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + venue: Unset | StockSnapshotQuoteVenue = StockSnapshotQuoteVenue.NQB, + format_: Unset | StockSnapshotQuoteFormat = StockSnapshotQuoteFormat.NDJSON, + +) -> Response[StockSnapshotQuoteResponse200]: + """ Quote + + * Returns a real-time last BBO quote from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The- + SIPs) if the account has a [stocks standard or pro + subscription](https://www.thetadata.net/subscribe.html#stocks). + * Returns a 15-minute delayed NBBO quote from the [UTP & CTA feeds](/Articles/Data-And-Requests/The- + SIPs) account has the [stocks value subscription](https://www.thetadata.net/subscribe.html#stocks) + subscription. + - ThetaData resets its snapshot cache at midnight ET every day. This endpoint may not work on a + weekend where there were no eligible messages sent over exchange feeds. We recommend using historic + requests during the weekend. + + Args: + symbol (list[str]): + venue (Unset | StockSnapshotQuoteVenue): Default: StockSnapshotQuoteVenue.NQB. + format_ (Unset | StockSnapshotQuoteFormat): Default: StockSnapshotQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StockSnapshotQuoteResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +venue=venue, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + venue: Unset | StockSnapshotQuoteVenue = StockSnapshotQuoteVenue.NQB, + format_: Unset | StockSnapshotQuoteFormat = StockSnapshotQuoteFormat.NDJSON, + +) -> StockSnapshotQuoteResponse200 | None: + """ Quote + + * Returns a real-time last BBO quote from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The- + SIPs) if the account has a [stocks standard or pro + subscription](https://www.thetadata.net/subscribe.html#stocks). + * Returns a 15-minute delayed NBBO quote from the [UTP & CTA feeds](/Articles/Data-And-Requests/The- + SIPs) account has the [stocks value subscription](https://www.thetadata.net/subscribe.html#stocks) + subscription. + - ThetaData resets its snapshot cache at midnight ET every day. This endpoint may not work on a + weekend where there were no eligible messages sent over exchange feeds. We recommend using historic + requests during the weekend. + + Args: + symbol (list[str]): + venue (Unset | StockSnapshotQuoteVenue): Default: StockSnapshotQuoteVenue.NQB. + format_ (Unset | StockSnapshotQuoteFormat): Default: StockSnapshotQuoteFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StockSnapshotQuoteResponse200 + """ + + + return (await asyncio_detailed( + client=client, +symbol=symbol, +venue=venue, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/stock/stock_snapshot_trade.py b/openapi_project/openapi_package/api/stock/stock_snapshot_trade.py new file mode 100644 index 000000000..c76ed3723 --- /dev/null +++ b/openapi_project/openapi_package/api/stock/stock_snapshot_trade.py @@ -0,0 +1,252 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from openapi_project.openapi_package.client import AuthenticatedClient, Client +from openapi_project.openapi_package.types import Response, UNSET +from openapi_project.openapi_package import errors + +from openapi_project.openapi_package.models.stock_snapshot_trade_format import StockSnapshotTradeFormat +from openapi_project.openapi_package.models.stock_snapshot_trade_response_200 import StockSnapshotTradeResponse200 +from openapi_project.openapi_package.models.stock_snapshot_trade_venue import StockSnapshotTradeVenue +from openapi_project.openapi_package.types import UNSET, Unset +from typing import cast + + + +def _get_kwargs( + *, + symbol: list[str], + venue: Unset | StockSnapshotTradeVenue = StockSnapshotTradeVenue.NQB, + format_: Unset | StockSnapshotTradeFormat = StockSnapshotTradeFormat.NDJSON, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_symbol = symbol + + + params["symbol"] = json_symbol + + json_venue: Unset | str = UNSET if isinstance(venue, Unset) else venue.value + + params["venue"] = json_venue + + json_format_: Unset | str = UNSET if isinstance(format_, Unset) else format_.value + + params["format"] = json_format_ + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/stock/snapshot/trade", + "params": params, + } + + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> StockSnapshotTradeResponse200 | None: + if response.status_code == 200: + response_200 = StockSnapshotTradeResponse200.from_dict(response.json()) + + + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[StockSnapshotTradeResponse200]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + venue: Unset | StockSnapshotTradeVenue = StockSnapshotTradeVenue.NQB, + format_: Unset | StockSnapshotTradeFormat = StockSnapshotTradeFormat.NDJSON, + +) -> Response[StockSnapshotTradeResponse200]: + """ Trade + + + Returns a real-time last trade from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if + the account has a [stocks standard or pro + subscription](https://www.thetadata.net/subscribe.html#stocks). + + - ThetaData resets its snapshot cache at midnight ET every day. This endpoint may not work on a + weekend where there were no eligible messages sent over exchange feeds. We recommend using historic + requests during the weekend. + + Args: + symbol (list[str]): + venue (Unset | StockSnapshotTradeVenue): Default: StockSnapshotTradeVenue.NQB. + format_ (Unset | StockSnapshotTradeFormat): Default: StockSnapshotTradeFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StockSnapshotTradeResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +venue=venue, +format_=format_, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + venue: Unset | StockSnapshotTradeVenue = StockSnapshotTradeVenue.NQB, + format_: Unset | StockSnapshotTradeFormat = StockSnapshotTradeFormat.NDJSON, + +) -> StockSnapshotTradeResponse200 | None: + """ Trade + + + Returns a real-time last trade from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if + the account has a [stocks standard or pro + subscription](https://www.thetadata.net/subscribe.html#stocks). + + - ThetaData resets its snapshot cache at midnight ET every day. This endpoint may not work on a + weekend where there were no eligible messages sent over exchange feeds. We recommend using historic + requests during the weekend. + + Args: + symbol (list[str]): + venue (Unset | StockSnapshotTradeVenue): Default: StockSnapshotTradeVenue.NQB. + format_ (Unset | StockSnapshotTradeFormat): Default: StockSnapshotTradeFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StockSnapshotTradeResponse200 + """ + + + return sync_detailed( + client=client, +symbol=symbol, +venue=venue, +format_=format_, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + venue: Unset | StockSnapshotTradeVenue = StockSnapshotTradeVenue.NQB, + format_: Unset | StockSnapshotTradeFormat = StockSnapshotTradeFormat.NDJSON, + +) -> Response[StockSnapshotTradeResponse200]: + """ Trade + + + Returns a real-time last trade from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if + the account has a [stocks standard or pro + subscription](https://www.thetadata.net/subscribe.html#stocks). + + - ThetaData resets its snapshot cache at midnight ET every day. This endpoint may not work on a + weekend where there were no eligible messages sent over exchange feeds. We recommend using historic + requests during the weekend. + + Args: + symbol (list[str]): + venue (Unset | StockSnapshotTradeVenue): Default: StockSnapshotTradeVenue.NQB. + format_ (Unset | StockSnapshotTradeFormat): Default: StockSnapshotTradeFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StockSnapshotTradeResponse200] + """ + + + kwargs = _get_kwargs( + symbol=symbol, +venue=venue, +format_=format_, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return _build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + symbol: list[str], + venue: Unset | StockSnapshotTradeVenue = StockSnapshotTradeVenue.NQB, + format_: Unset | StockSnapshotTradeFormat = StockSnapshotTradeFormat.NDJSON, + +) -> StockSnapshotTradeResponse200 | None: + """ Trade + + + Returns a real-time last trade from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The-SIPs) if + the account has a [stocks standard or pro + subscription](https://www.thetadata.net/subscribe.html#stocks). + + - ThetaData resets its snapshot cache at midnight ET every day. This endpoint may not work on a + weekend where there were no eligible messages sent over exchange feeds. We recommend using historic + requests during the weekend. + + Args: + symbol (list[str]): + venue (Unset | StockSnapshotTradeVenue): Default: StockSnapshotTradeVenue.NQB. + format_ (Unset | StockSnapshotTradeFormat): Default: StockSnapshotTradeFormat.NDJSON. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StockSnapshotTradeResponse200 + """ + + + return (await asyncio_detailed( + client=client, +symbol=symbol, +venue=venue, +format_=format_, + + )).parsed diff --git a/openapi_project/openapi_package/api/user_data_service/__init__.py b/openapi_project/openapi_package/api/user_data_service/__init__.py deleted file mode 100644 index dcbab9a7a..000000000 --- a/openapi_project/openapi_package/api/user_data_service/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/openapi_project/openapi_package/api/user_data_service/get_userdata_accounts.py b/openapi_project/openapi_package/api/user_data_service/get_userdata_accounts.py deleted file mode 100644 index f70cbd8da..000000000 --- a/openapi_project/openapi_package/api/user_data_service/get_userdata_accounts.py +++ /dev/null @@ -1,125 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.list_accounts_response import ListAccountsResponse -from typing import cast - - -def _get_kwargs() -> dict[str, Any]: - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/userdata/accounts", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ListAccountsResponse | None: - if response.status_code == 200: - response_200 = ListAccountsResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ListAccountsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[ListAccountsResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListAccountsResponse] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, -) -> ListAccountsResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListAccountsResponse - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[ListAccountsResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListAccountsResponse] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, -) -> ListAccountsResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListAccountsResponse - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/user_data_service/get_userdata_activeuser.py b/openapi_project/openapi_package/api/user_data_service/get_userdata_activeuser.py deleted file mode 100644 index a559dfe15..000000000 --- a/openapi_project/openapi_package/api/user_data_service/get_userdata_activeuser.py +++ /dev/null @@ -1,125 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.get_active_user_response import GetActiveUserResponse -from typing import cast - - -def _get_kwargs() -> dict[str, Any]: - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/userdata/activeuser", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> GetActiveUserResponse | None: - if response.status_code == 200: - response_200 = GetActiveUserResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[GetActiveUserResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[GetActiveUserResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[GetActiveUserResponse] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, -) -> GetActiveUserResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - GetActiveUserResponse - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[GetActiveUserResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[GetActiveUserResponse] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, -) -> GetActiveUserResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - GetActiveUserResponse - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/user_data_service/get_userdata_affiliatedtradingfirms.py b/openapi_project/openapi_package/api/user_data_service/get_userdata_affiliatedtradingfirms.py deleted file mode 100644 index 2794d5315..000000000 --- a/openapi_project/openapi_package/api/user_data_service/get_userdata_affiliatedtradingfirms.py +++ /dev/null @@ -1,125 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.list_affiliated_trading_firms_response import ListAffiliatedTradingFirmsResponse -from typing import cast - - -def _get_kwargs() -> dict[str, Any]: - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/userdata/affiliatedtradingfirms", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ListAffiliatedTradingFirmsResponse | None: - if response.status_code == 200: - response_200 = ListAffiliatedTradingFirmsResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ListAffiliatedTradingFirmsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[ListAffiliatedTradingFirmsResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListAffiliatedTradingFirmsResponse] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, -) -> ListAffiliatedTradingFirmsResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListAffiliatedTradingFirmsResponse - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[ListAffiliatedTradingFirmsResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListAffiliatedTradingFirmsResponse] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, -) -> ListAffiliatedTradingFirmsResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListAffiliatedTradingFirmsResponse - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/user_data_service/get_userdata_p2paccounts.py b/openapi_project/openapi_package/api/user_data_service/get_userdata_p2paccounts.py deleted file mode 100644 index b08b8cca9..000000000 --- a/openapi_project/openapi_package/api/user_data_service/get_userdata_p2paccounts.py +++ /dev/null @@ -1,125 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.list_accounts_response import ListAccountsResponse -from typing import cast - - -def _get_kwargs() -> dict[str, Any]: - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/userdata/p2paccounts", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ListAccountsResponse | None: - if response.status_code == 200: - response_200 = ListAccountsResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ListAccountsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[ListAccountsResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListAccountsResponse] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, -) -> ListAccountsResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListAccountsResponse - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[ListAccountsResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListAccountsResponse] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, -) -> ListAccountsResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListAccountsResponse - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/user_data_service/get_userdata_routes.py b/openapi_project/openapi_package/api/user_data_service/get_userdata_routes.py deleted file mode 100644 index dff62b11d..000000000 --- a/openapi_project/openapi_package/api/user_data_service/get_userdata_routes.py +++ /dev/null @@ -1,125 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.list_routes_response import ListRoutesResponse -from typing import cast - - -def _get_kwargs() -> dict[str, Any]: - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/userdata/routes", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ListRoutesResponse | None: - if response.status_code == 200: - response_200 = ListRoutesResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ListRoutesResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[ListRoutesResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListRoutesResponse] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, -) -> ListRoutesResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListRoutesResponse - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[ListRoutesResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListRoutesResponse] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, -) -> ListRoutesResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListRoutesResponse - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/user_data_service/get_userdata_tradingfirms.py b/openapi_project/openapi_package/api/user_data_service/get_userdata_tradingfirms.py deleted file mode 100644 index 6986c5226..000000000 --- a/openapi_project/openapi_package/api/user_data_service/get_userdata_tradingfirms.py +++ /dev/null @@ -1,125 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.list_trading_firms_response import ListTradingFirmsResponse -from typing import cast - - -def _get_kwargs() -> dict[str, Any]: - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/userdata/tradingfirms", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ListTradingFirmsResponse | None: - if response.status_code == 200: - response_200 = ListTradingFirmsResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ListTradingFirmsResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[ListTradingFirmsResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListTradingFirmsResponse] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, -) -> ListTradingFirmsResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListTradingFirmsResponse - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[ListTradingFirmsResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ListTradingFirmsResponse] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, -) -> ListTradingFirmsResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ListTradingFirmsResponse - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/utility_service/__init__.py b/openapi_project/openapi_package/api/utility_service/__init__.py deleted file mode 100644 index dcbab9a7a..000000000 --- a/openapi_project/openapi_package/api/utility_service/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/openapi_project/openapi_package/api/utility_service/get_utility_serverinfo.py b/openapi_project/openapi_package/api/utility_service/get_utility_serverinfo.py deleted file mode 100644 index 61179a632..000000000 --- a/openapi_project/openapi_package/api/utility_service/get_utility_serverinfo.py +++ /dev/null @@ -1,125 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.get_server_info_response import GetServerInfoResponse -from typing import cast - - -def _get_kwargs() -> dict[str, Any]: - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/utility/serverinfo", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> GetServerInfoResponse | None: - if response.status_code == 200: - response_200 = GetServerInfoResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[GetServerInfoResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[GetServerInfoResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[GetServerInfoResponse] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, -) -> GetServerInfoResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - GetServerInfoResponse - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[GetServerInfoResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[GetServerInfoResponse] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, -) -> GetServerInfoResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - GetServerInfoResponse - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/utility_service/get_utility_servertime.py b/openapi_project/openapi_package/api/utility_service/get_utility_servertime.py deleted file mode 100644 index a527d1b3a..000000000 --- a/openapi_project/openapi_package/api/utility_service/get_utility_servertime.py +++ /dev/null @@ -1,125 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.get_server_time_response import GetServerTimeResponse -from typing import cast - - -def _get_kwargs() -> dict[str, Any]: - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/utility/servertime", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> GetServerTimeResponse | None: - if response.status_code == 200: - response_200 = GetServerTimeResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[GetServerTimeResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[GetServerTimeResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[GetServerTimeResponse] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, -) -> GetServerTimeResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - GetServerTimeResponse - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[GetServerTimeResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[GetServerTimeResponse] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, -) -> GetServerTimeResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - GetServerTimeResponse - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/openapi_project/openapi_package/api/utility_service/get_utility_tradingholidays.py b/openapi_project/openapi_package/api/utility_service/get_utility_tradingholidays.py deleted file mode 100644 index 508e57932..000000000 --- a/openapi_project/openapi_package/api/utility_service/get_utility_tradingholidays.py +++ /dev/null @@ -1,125 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast - -import httpx - -from openapi_project.openapi_package.client import AuthenticatedClient, Client -from openapi_project.openapi_package.types import Response, UNSET -from openapi_project.openapi_package import errors - -from openapi_project.openapi_package.models.get_trading_holidays_response import GetTradingHolidaysResponse -from typing import cast - - -def _get_kwargs() -> dict[str, Any]: - - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/utility/tradingholidays", - } - - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> GetTradingHolidaysResponse | None: - if response.status_code == 200: - response_200 = GetTradingHolidaysResponse.from_dict(response.json()) - - return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[GetTradingHolidaysResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[GetTradingHolidaysResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[GetTradingHolidaysResponse] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient | Client, -) -> GetTradingHolidaysResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - GetTradingHolidaysResponse - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient | Client, -) -> Response[GetTradingHolidaysResponse]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[GetTradingHolidaysResponse] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient | Client, -) -> GetTradingHolidaysResponse | None: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - GetTradingHolidaysResponse - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/openapi_project/openapi_package/client.py b/openapi_project/openapi_package/client.py index eaec5c6e7..4b89354a4 100644 --- a/openapi_project/openapi_package/client.py +++ b/openapi_project/openapi_package/client.py @@ -5,6 +5,9 @@ import httpx + + + @define class Client: """A class for keeping track of data related to the API @@ -33,18 +36,13 @@ class Client: status code that was not documented in the source OpenAPI document. Can also be provided as a keyword argument to the constructor. """ - raise_on_unexpected_status: bool = field(default=False, kw_only=True) _base_url: str = field(alias="base_url") _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") - _verify_ssl: str | bool | ssl.SSLContext = field( - default=True, kw_only=True, alias="verify_ssl" - ) - _follow_redirects: bool = field( - default=False, kw_only=True, alias="follow_redirects" - ) + _verify_ssl: str | bool | ssl.SSLContext = field(default=True, kw_only=True, alias="verify_ssl") + _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") _client: httpx.Client | None = field(default=None, init=False) _async_client: httpx.AsyncClient | None = field(default=None, init=False) @@ -173,12 +171,8 @@ class AuthenticatedClient: _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") - _verify_ssl: str | bool | ssl.SSLContext = field( - default=True, kw_only=True, alias="verify_ssl" - ) - _follow_redirects: bool = field( - default=False, kw_only=True, alias="follow_redirects" - ) + _verify_ssl: str | bool | ssl.SSLContext = field(default=True, kw_only=True, alias="verify_ssl") + _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") _client: httpx.Client | None = field(default=None, init=False) _async_client: httpx.AsyncClient | None = field(default=None, init=False) @@ -222,9 +216,7 @@ def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient": def get_httpx_client(self) -> httpx.Client: """Get the underlying httpx.Client, constructing a new one if not previously set""" if self._client is None: - self._headers[self.auth_header_name] = ( - f"{self.prefix} {self.token}" if self.prefix else self.token - ) + self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token self._client = httpx.Client( base_url=self._base_url, cookies=self._cookies, @@ -245,9 +237,7 @@ def __exit__(self, *args: Any, **kwargs: Any) -> None: """Exit a context manager for internal httpx.Client (see httpx docs)""" self.get_httpx_client().__exit__(*args, **kwargs) - def set_async_httpx_client( - self, async_client: httpx.AsyncClient - ) -> "AuthenticatedClient": + def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "AuthenticatedClient": """Manually the underlying httpx.AsyncClient **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. @@ -258,9 +248,7 @@ def set_async_httpx_client( def get_async_httpx_client(self) -> httpx.AsyncClient: """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" if self._async_client is None: - self._headers[self.auth_header_name] = ( - f"{self.prefix} {self.token}" if self.prefix else self.token - ) + self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token self._async_client = httpx.AsyncClient( base_url=self._base_url, cookies=self._cookies, @@ -280,3 +268,4 @@ async def __aenter__(self) -> "AuthenticatedClient": async def __aexit__(self, *args: Any, **kwargs: Any) -> None: """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" await self.get_async_httpx_client().__aexit__(*args, **kwargs) + diff --git a/openapi_project/openapi_package/errors.py b/openapi_project/openapi_package/errors.py index 75f9c2a55..ce027c6b0 100644 --- a/openapi_project/openapi_package/errors.py +++ b/openapi_project/openapi_package/errors.py @@ -1,8 +1,7 @@ -"""Contains shared errors types that can be raised from API functions""" +""" Contains shared errors types that can be raised from API functions """ from __future__ import annotations - class UnexpectedStatus(Exception): """Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True""" @@ -14,5 +13,4 @@ def __init__(self, status_code: int, content: bytes): f"Unexpected status code: {status_code}\n\nResponse content:\n{content.decode(errors='ignore')}" ) - __all__ = ["UnexpectedStatus"] diff --git a/openapi_project/openapi_package/models/__init__.py b/openapi_project/openapi_package/models/__init__.py index 9a23ee025..57555e6d5 100644 --- a/openapi_project/openapi_package/models/__init__.py +++ b/openapi_project/openapi_package/models/__init__.py @@ -1,503 +1,349 @@ -"""Contains all the data models used in inputs/outputs""" +""" Contains all the data models used in inputs/outputs """ -from openapi_project.openapi_package.models.account import Account -from openapi_project.openapi_package.models.account_script import AccountScript -from openapi_project.openapi_package.models.account_status import AccountStatus -from openapi_project.openapi_package.models.account_type import AccountType -from openapi_project.openapi_package.models.analyze_position_item import AnalyzePositionItem -from openapi_project.openapi_package.models.analyze_positions_request import AnalyzePositionsRequest -from openapi_project.openapi_package.models.analyze_positions_response import AnalyzePositionsResponse -from openapi_project.openapi_package.models.any_model import AnyModel -from openapi_project.openapi_package.models.calculate_margin_request import CalculateMarginRequest -from openapi_project.openapi_package.models.calculate_margin_request_position import CalculateMarginRequestPosition -from openapi_project.openapi_package.models.calculate_margin_request_position_list import CalculateMarginRequestPositionList -from openapi_project.openapi_package.models.calculate_margin_response import CalculateMarginResponse -from openapi_project.openapi_package.models.cancel_order_request import CancelOrderRequest -from openapi_project.openapi_package.models.cancel_order_request_optional_data import CancelOrderRequestOptionalData -from openapi_project.openapi_package.models.cancel_order_response import CancelOrderResponse -from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request import CancelReplaceMultiLegOrderRequest -from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_algo import CancelReplaceMultiLegOrderRequestAlgo -from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_market_condition import CancelReplaceMultiLegOrderRequestMarketCondition -from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_optional_data import CancelReplaceMultiLegOrderRequestOptionalData -from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_response import CancelReplaceMultiLegOrderResponse -from openapi_project.openapi_package.models.cancel_replace_order_request import CancelReplaceOrderRequest -from openapi_project.openapi_package.models.cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo -from openapi_project.openapi_package.models.cancel_replace_order_request_market_condition import CancelReplaceOrderRequestMarketCondition -from openapi_project.openapi_package.models.cancel_replace_order_request_optional_data import CancelReplaceOrderRequestOptionalData -from openapi_project.openapi_package.models.cancel_replace_order_response import CancelReplaceOrderResponse -from openapi_project.openapi_package.models.capacity_code import CapacityCode -from openapi_project.openapi_package.models.claim_type import ClaimType -from openapi_project.openapi_package.models.clearing_info import ClearingInfo -from openapi_project.openapi_package.models.clearing_range import ClearingRange -from openapi_project.openapi_package.models.country import Country -from openapi_project.openapi_package.models.create_flex_option_request import CreateFlexOptionRequest -from openapi_project.openapi_package.models.create_flex_option_response import CreateFlexOptionResponse -from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation import CreateMultiLegOrderCrossAllocation -from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation_optional_data import CreateMultiLegOrderCrossAllocationOptionalData -from openapi_project.openapi_package.models.create_multi_leg_order_cross_request import CreateMultiLegOrderCrossRequest -from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_algo import CreateMultiLegOrderCrossRequestAlgo -from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_market_condition import CreateMultiLegOrderCrossRequestMarketCondition -from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_optional_data import CreateMultiLegOrderCrossRequestOptionalData -from openapi_project.openapi_package.models.create_multi_leg_order_cross_response import CreateMultiLegOrderCrossResponse -from openapi_project.openapi_package.models.create_multi_leg_order_leg import CreateMultiLegOrderLeg -from openapi_project.openapi_package.models.create_multi_leg_order_leg_market_condition import CreateMultiLegOrderLegMarketCondition -from openapi_project.openapi_package.models.create_multi_leg_order_leg_optional_data import CreateMultiLegOrderLegOptionalData -from openapi_project.openapi_package.models.create_multi_leg_order_request import CreateMultiLegOrderRequest -from openapi_project.openapi_package.models.create_multi_leg_order_request_algo import CreateMultiLegOrderRequestAlgo -from openapi_project.openapi_package.models.create_multi_leg_order_request_market_condition import CreateMultiLegOrderRequestMarketCondition -from openapi_project.openapi_package.models.create_multi_leg_order_request_optional_data import CreateMultiLegOrderRequestOptionalData -from openapi_project.openapi_package.models.create_multi_leg_order_response import CreateMultiLegOrderResponse -from openapi_project.openapi_package.models.create_order_cross_allocation import CreateOrderCrossAllocation -from openapi_project.openapi_package.models.create_order_cross_allocation_optional_data import CreateOrderCrossAllocationOptionalData -from openapi_project.openapi_package.models.create_order_cross_request import CreateOrderCrossRequest -from openapi_project.openapi_package.models.create_order_cross_request_algo import CreateOrderCrossRequestAlgo -from openapi_project.openapi_package.models.create_order_cross_request_market_condition import CreateOrderCrossRequestMarketCondition -from openapi_project.openapi_package.models.create_order_cross_request_optional_data import CreateOrderCrossRequestOptionalData -from openapi_project.openapi_package.models.create_order_cross_response import CreateOrderCrossResponse -from openapi_project.openapi_package.models.create_order_request import CreateOrderRequest -from openapi_project.openapi_package.models.create_order_request_algo import CreateOrderRequestAlgo -from openapi_project.openapi_package.models.create_order_request_market_condition import CreateOrderRequestMarketCondition -from openapi_project.openapi_package.models.create_order_request_optional_data import CreateOrderRequestOptionalData -from openapi_project.openapi_package.models.create_order_response import CreateOrderResponse -from openapi_project.openapi_package.models.cross_side_type import CrossSideType -from openapi_project.openapi_package.models.cross_type import CrossType -from openapi_project.openapi_package.models.crypto import Crypto -from openapi_project.openapi_package.models.crypto_aliases import CryptoAliases -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.models.cxl_rej_response_to import CxlRejResponseTo -from openapi_project.openapi_package.models.date import Date -from openapi_project.openapi_package.models.easy_to_borrow_security import EasyToBorrowSecurity -from openapi_project.openapi_package.models.empty import Empty -from openapi_project.openapi_package.models.exchange import Exchange -from openapi_project.openapi_package.models.exchange_code import ExchangeCode -from openapi_project.openapi_package.models.exec_type import ExecType -from openapi_project.openapi_package.models.execution import Execution -from openapi_project.openapi_package.models.execution_algo import ExecutionAlgo -from openapi_project.openapi_package.models.execution_optional_data import ExecutionOptionalData -from openapi_project.openapi_package.models.flex_option import FlexOption -from openapi_project.openapi_package.models.flex_option_aliases import FlexOptionAliases -from openapi_project.openapi_package.models.flex_settlement_type import FlexSettlementType -from openapi_project.openapi_package.models.future import Future -from openapi_project.openapi_package.models.future_aliases import FutureAliases -from openapi_project.openapi_package.models.future_root import FutureRoot -from openapi_project.openapi_package.models.future_root_aliases import FutureRootAliases -from openapi_project.openapi_package.models.future_spread import FutureSpread -from openapi_project.openapi_package.models.future_spread_aliases import FutureSpreadAliases -from openapi_project.openapi_package.models.future_spread_leg import FutureSpreadLeg -from openapi_project.openapi_package.models.fx import Fx -from openapi_project.openapi_package.models.fx_aliases import FxAliases -from openapi_project.openapi_package.models.generic_order import GenericOrder -from openapi_project.openapi_package.models.get_active_user_response import GetActiveUserResponse -from openapi_project.openapi_package.models.get_server_info_response import GetServerInfoResponse -from openapi_project.openapi_package.models.get_server_info_response_system_settings import GetServerInfoResponseSystemSettings -from openapi_project.openapi_package.models.get_server_time_response import GetServerTimeResponse -from openapi_project.openapi_package.models.get_trading_holidays_response import GetTradingHolidaysResponse -from openapi_project.openapi_package.models.header import Header -from openapi_project.openapi_package.models.index import Index -from openapi_project.openapi_package.models.index_aliases import IndexAliases -from openapi_project.openapi_package.models.list_accounts_response import ListAccountsResponse -from openapi_project.openapi_package.models.list_affiliated_trading_firms_response import ListAffiliatedTradingFirmsResponse -from openapi_project.openapi_package.models.list_easy_to_borrow_securities_request import ListEasyToBorrowSecuritiesRequest -from openapi_project.openapi_package.models.list_easy_to_borrow_securities_response import ListEasyToBorrowSecuritiesResponse -from openapi_project.openapi_package.models.list_exchanges_response import ListExchangesResponse -from openapi_project.openapi_package.models.list_option_chains_repsonse import ListOptionChainsRepsonse -from openapi_project.openapi_package.models.list_option_chains_request import ListOptionChainsRequest -from openapi_project.openapi_package.models.list_orders_response import ListOrdersResponse -from openapi_project.openapi_package.models.list_positions_response import ListPositionsResponse -from openapi_project.openapi_package.models.list_routes_response import ListRoutesResponse -from openapi_project.openapi_package.models.list_securities_request import ListSecuritiesRequest -from openapi_project.openapi_package.models.list_securities_response import ListSecuritiesResponse -from openapi_project.openapi_package.models.list_trade_confirms_response import ListTradeConfirmsResponse -from openapi_project.openapi_package.models.list_trading_firms_response import ListTradingFirmsResponse -from openapi_project.openapi_package.models.login_request import LoginRequest -from openapi_project.openapi_package.models.login_response import LoginResponse -from openapi_project.openapi_package.models.login_response_system_settings import LoginResponseSystemSettings -from openapi_project.openapi_package.models.login_status import LoginStatus -from openapi_project.openapi_package.models.margin_data import MarginData -from openapi_project.openapi_package.models.margin_data_type import MarginDataType -from openapi_project.openapi_package.models.multi_leg_order import MultiLegOrder -from openapi_project.openapi_package.models.multi_leg_order_algo import MultiLegOrderAlgo -from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request import MultiLegOrderCancelReplaceRequest -from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_algo import MultiLegOrderCancelReplaceRequestAlgo -from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_market_condition import MultiLegOrderCancelReplaceRequestMarketCondition -from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_optional_data import MultiLegOrderCancelReplaceRequestOptionalData -from openapi_project.openapi_package.models.multi_leg_order_cross import MultiLegOrderCross -from openapi_project.openapi_package.models.multi_leg_order_cross_algo import MultiLegOrderCrossAlgo -from openapi_project.openapi_package.models.multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation -from openapi_project.openapi_package.models.multi_leg_order_cross_allocation_optional_data import MultiLegOrderCrossAllocationOptionalData -from openapi_project.openapi_package.models.multi_leg_order_cross_market_condition import MultiLegOrderCrossMarketCondition -from openapi_project.openapi_package.models.multi_leg_order_cross_optional_data import MultiLegOrderCrossOptionalData -from openapi_project.openapi_package.models.multi_leg_order_leg import MultiLegOrderLeg -from openapi_project.openapi_package.models.multi_leg_order_leg_market_condition import MultiLegOrderLegMarketCondition -from openapi_project.openapi_package.models.multi_leg_order_leg_optional_data import MultiLegOrderLegOptionalData -from openapi_project.openapi_package.models.multi_leg_order_market_condition import MultiLegOrderMarketCondition -from openapi_project.openapi_package.models.multi_leg_order_optional_data import MultiLegOrderOptionalData -from openapi_project.openapi_package.models.multi_leg_reporting_type import MultiLegReportingType -from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat -from openapi_project.openapi_package.models.option import Option -from openapi_project.openapi_package.models.option_aliases import OptionAliases -from openapi_project.openapi_package.models.option_chain import OptionChain -from openapi_project.openapi_package.models.option_chain_option import OptionChainOption -from openapi_project.openapi_package.models.option_chain_option_aliases import OptionChainOptionAliases -from openapi_project.openapi_package.models.option_chain_options import OptionChainOptions -from openapi_project.openapi_package.models.option_chain_roots import OptionChainRoots -from openapi_project.openapi_package.models.option_exercise_style import OptionExerciseStyle -from openapi_project.openapi_package.models.option_expiration_style import OptionExpirationStyle -from openapi_project.openapi_package.models.option_root import OptionRoot -from openapi_project.openapi_package.models.option_root_aliases import OptionRootAliases -from openapi_project.openapi_package.models.option_series import OptionSeries -from openapi_project.openapi_package.models.option_series_product_type import OptionSeriesProductType -from openapi_project.openapi_package.models.option_series_type import OptionSeriesType -from openapi_project.openapi_package.models.option_settlement_type import OptionSettlementType -from openapi_project.openapi_package.models.ord_status import OrdStatus -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.order import Order -from openapi_project.openapi_package.models.order_algo import OrderAlgo -from openapi_project.openapi_package.models.order_cancel_reject import OrderCancelReject -from openapi_project.openapi_package.models.order_cancel_reject_optional_data import OrderCancelRejectOptionalData -from openapi_project.openapi_package.models.order_cancel_replace_request import OrderCancelReplaceRequest -from openapi_project.openapi_package.models.order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo -from openapi_project.openapi_package.models.order_cancel_replace_request_market_condition import OrderCancelReplaceRequestMarketCondition -from openapi_project.openapi_package.models.order_cancel_replace_request_optional_data import OrderCancelReplaceRequestOptionalData -from openapi_project.openapi_package.models.order_cancel_request import OrderCancelRequest -from openapi_project.openapi_package.models.order_cancel_request_optional_data import OrderCancelRequestOptionalData -from openapi_project.openapi_package.models.order_cross import OrderCross -from openapi_project.openapi_package.models.order_cross_algo import OrderCrossAlgo -from openapi_project.openapi_package.models.order_cross_allocation import OrderCrossAllocation -from openapi_project.openapi_package.models.order_cross_allocation_optional_data import OrderCrossAllocationOptionalData -from openapi_project.openapi_package.models.order_cross_market_condition import OrderCrossMarketCondition -from openapi_project.openapi_package.models.order_cross_optional_data import OrderCrossOptionalData -from openapi_project.openapi_package.models.order_delete import OrderDelete -from openapi_project.openapi_package.models.order_delete_optional_data import OrderDeleteOptionalData -from openapi_project.openapi_package.models.order_instruction import OrderInstruction -from openapi_project.openapi_package.models.order_instruction_type import OrderInstructionType -from openapi_project.openapi_package.models.order_market_condition import OrderMarketCondition -from openapi_project.openapi_package.models.order_optional_data import OrderOptionalData -from openapi_project.openapi_package.models.order_type import OrderType -from openapi_project.openapi_package.models.order_update import OrderUpdate -from openapi_project.openapi_package.models.order_update_algo import OrderUpdateAlgo -from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent -from openapi_project.openapi_package.models.order_update_optional_data import OrderUpdateOptionalData -from openapi_project.openapi_package.models.origination_type import OriginationType -from openapi_project.openapi_package.models.position import Position -from openapi_project.openapi_package.models.position_analysis import PositionAnalysis -from openapi_project.openapi_package.models.position_effect import PositionEffect -from openapi_project.openapi_package.models.position_source import PositionSource -from openapi_project.openapi_package.models.position_theo import PositionTheo -from openapi_project.openapi_package.models.position_theo_leg import PositionTheoLeg -from openapi_project.openapi_package.models.price_type import PriceType -from openapi_project.openapi_package.models.product_group import ProductGroup -from openapi_project.openapi_package.models.product_sub_group import ProductSubGroup -from openapi_project.openapi_package.models.put_call import PutCall -from openapi_project.openapi_package.models.risk_calculation_type import RiskCalculationType -from openapi_project.openapi_package.models.risk_eval_mode import RiskEvalMode -from openapi_project.openapi_package.models.risk_radar_account_group import RiskRadarAccountGroup -from openapi_project.openapi_package.models.risk_radar_class_group import RiskRadarClassGroup -from openapi_project.openapi_package.models.risk_radar_data import RiskRadarData -from openapi_project.openapi_package.models.risk_radar_position import RiskRadarPosition -from openapi_project.openapi_package.models.risk_radar_product_group import RiskRadarProductGroup -from openapi_project.openapi_package.models.risk_radar_request import RiskRadarRequest -from openapi_project.openapi_package.models.risk_radar_request_position import RiskRadarRequestPosition -from openapi_project.openapi_package.models.risk_radar_request_position_list import RiskRadarRequestPositionList -from openapi_project.openapi_package.models.risk_radar_response import RiskRadarResponse -from openapi_project.openapi_package.models.risk_radar_scenario_order import RiskRadarScenarioOrder -from openapi_project.openapi_package.models.risk_reject import RiskReject -from openapi_project.openapi_package.models.risk_reject_type import RiskRejectType -from openapi_project.openapi_package.models.route import Route -from openapi_project.openapi_package.models.route_applicability import RouteApplicability -from openapi_project.openapi_package.models.route_property import RouteProperty -from openapi_project.openapi_package.models.route_property_type import RoutePropertyType -from openapi_project.openapi_package.models.route_type import RouteType -from openapi_project.openapi_package.models.routing_session_group import RoutingSessionGroup -from openapi_project.openapi_package.models.routing_session_group_type import RoutingSessionGroupType -from openapi_project.openapi_package.models.scenario import Scenario -from openapi_project.openapi_package.models.scenario_leg import ScenarioLeg -from openapi_project.openapi_package.models.scenario_position import ScenarioPosition -from openapi_project.openapi_package.models.scenario_theo import ScenarioTheo -from openapi_project.openapi_package.models.search_order_history_response import SearchOrderHistoryResponse -from openapi_project.openapi_package.models.security import Security -from openapi_project.openapi_package.models.security_category import SecurityCategory -from openapi_project.openapi_package.models.security_type import SecurityType -from openapi_project.openapi_package.models.settlement_deliverable_type import SettlementDeliverableType -from openapi_project.openapi_package.models.settlement_info import SettlementInfo -from openapi_project.openapi_package.models.shock_value import ShockValue -from openapi_project.openapi_package.models.shock_value_flags import ShockValueFlags -from openapi_project.openapi_package.models.side import Side -from openapi_project.openapi_package.models.spread_leg_side import SpreadLegSide -from openapi_project.openapi_package.models.spread_leg_type import SpreadLegType -from openapi_project.openapi_package.models.status import Status -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.models.stock import Stock -from openapi_project.openapi_package.models.stock_aliases import StockAliases -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.models.time_of_day import TimeOfDay -from openapi_project.openapi_package.models.tims_class_group import TimsClassGroup -from openapi_project.openapi_package.models.tims_margin_data import TimsMarginData -from openapi_project.openapi_package.models.tims_position_group import TimsPositionGroup -from openapi_project.openapi_package.models.tims_product_group import TimsProductGroup -from openapi_project.openapi_package.models.trade_confirm import TradeConfirm -from openapi_project.openapi_package.models.trading_firm import TradingFirm -from openapi_project.openapi_package.models.trading_firm_slim import TradingFirmSlim -from openapi_project.openapi_package.models.trading_holiday import TradingHoliday -from openapi_project.openapi_package.models.trading_session import TradingSession -from openapi_project.openapi_package.models.trading_session_group import TradingSessionGroup -from openapi_project.openapi_package.models.user import User -from openapi_project.openapi_package.models.user_location import UserLocation -from openapi_project.openapi_package.models.user_permission import UserPermission -from openapi_project.openapi_package.models.user_status import UserStatus -from openapi_project.openapi_package.models.user_type import UserType -from openapi_project.openapi_package.models.validate_risk_response import ValidateRiskResponse -from openapi_project.openapi_package.models.volatility_shock_skew import VolatilityShockSkew -from openapi_project.openapi_package.models.volatility_shock_type import VolatilityShockType +from openapi_project.openapi_package.models.index_at_time_price_format import IndexAtTimePriceFormat +from openapi_project.openapi_package.models.index_at_time_price_response_200 import IndexAtTimePriceResponse200 +from openapi_project.openapi_package.models.index_history_eod_format import IndexHistoryEodFormat +from openapi_project.openapi_package.models.index_history_eod_response_200 import IndexHistoryEodResponse200 +from openapi_project.openapi_package.models.index_history_ohlc_format import IndexHistoryOhlcFormat +from openapi_project.openapi_package.models.index_history_ohlc_interval import IndexHistoryOhlcInterval +from openapi_project.openapi_package.models.index_history_ohlc_response_200 import IndexHistoryOhlcResponse200 +from openapi_project.openapi_package.models.index_history_price_format import IndexHistoryPriceFormat +from openapi_project.openapi_package.models.index_history_price_interval import IndexHistoryPriceInterval +from openapi_project.openapi_package.models.index_history_price_response_200 import IndexHistoryPriceResponse200 +from openapi_project.openapi_package.models.index_list_dates_format import IndexListDatesFormat +from openapi_project.openapi_package.models.index_list_dates_response_200 import IndexListDatesResponse200 +from openapi_project.openapi_package.models.index_list_symbols_format import IndexListSymbolsFormat +from openapi_project.openapi_package.models.index_list_symbols_response_200 import IndexListSymbolsResponse200 +from openapi_project.openapi_package.models.index_snapshot_ohlc_format import IndexSnapshotOhlcFormat +from openapi_project.openapi_package.models.index_snapshot_ohlc_response_200 import IndexSnapshotOhlcResponse200 +from openapi_project.openapi_package.models.index_snapshot_price_format import IndexSnapshotPriceFormat +from openapi_project.openapi_package.models.index_snapshot_price_response_200 import IndexSnapshotPriceResponse200 +from openapi_project.openapi_package.models.option_at_time_quote_format import OptionAtTimeQuoteFormat +from openapi_project.openapi_package.models.option_at_time_quote_response_200 import OptionAtTimeQuoteResponse200 +from openapi_project.openapi_package.models.option_at_time_quote_right import OptionAtTimeQuoteRight +from openapi_project.openapi_package.models.option_at_time_trade_format import OptionAtTimeTradeFormat +from openapi_project.openapi_package.models.option_at_time_trade_response_200 import OptionAtTimeTradeResponse200 +from openapi_project.openapi_package.models.option_at_time_trade_right import OptionAtTimeTradeRight +from openapi_project.openapi_package.models.option_history_eod_format import OptionHistoryEodFormat +from openapi_project.openapi_package.models.option_history_eod_response_200 import OptionHistoryEodResponse200 +from openapi_project.openapi_package.models.option_history_eod_right import OptionHistoryEodRight +from openapi_project.openapi_package.models.option_history_greeks_all_format import OptionHistoryGreeksAllFormat +from openapi_project.openapi_package.models.option_history_greeks_all_interval import OptionHistoryGreeksAllInterval +from openapi_project.openapi_package.models.option_history_greeks_all_rate_type import OptionHistoryGreeksAllRateType +from openapi_project.openapi_package.models.option_history_greeks_all_response_200 import OptionHistoryGreeksAllResponse200 +from openapi_project.openapi_package.models.option_history_greeks_all_right import OptionHistoryGreeksAllRight +from openapi_project.openapi_package.models.option_history_greeks_eod_format import OptionHistoryGreeksEodFormat +from openapi_project.openapi_package.models.option_history_greeks_eod_rate_type import OptionHistoryGreeksEodRateType +from openapi_project.openapi_package.models.option_history_greeks_eod_response_200 import OptionHistoryGreeksEodResponse200 +from openapi_project.openapi_package.models.option_history_greeks_eod_right import OptionHistoryGreeksEodRight +from openapi_project.openapi_package.models.option_history_greeks_first_order_format import OptionHistoryGreeksFirstOrderFormat +from openapi_project.openapi_package.models.option_history_greeks_first_order_interval import OptionHistoryGreeksFirstOrderInterval +from openapi_project.openapi_package.models.option_history_greeks_first_order_rate_type import OptionHistoryGreeksFirstOrderRateType +from openapi_project.openapi_package.models.option_history_greeks_first_order_response_200 import OptionHistoryGreeksFirstOrderResponse200 +from openapi_project.openapi_package.models.option_history_greeks_first_order_right import OptionHistoryGreeksFirstOrderRight +from openapi_project.openapi_package.models.option_history_greeks_implied_volatility_format import OptionHistoryGreeksImpliedVolatilityFormat +from openapi_project.openapi_package.models.option_history_greeks_implied_volatility_interval import OptionHistoryGreeksImpliedVolatilityInterval +from openapi_project.openapi_package.models.option_history_greeks_implied_volatility_rate_type import OptionHistoryGreeksImpliedVolatilityRateType +from openapi_project.openapi_package.models.option_history_greeks_implied_volatility_response_200 import OptionHistoryGreeksImpliedVolatilityResponse200 +from openapi_project.openapi_package.models.option_history_greeks_implied_volatility_right import OptionHistoryGreeksImpliedVolatilityRight +from openapi_project.openapi_package.models.option_history_greeks_second_order_format import OptionHistoryGreeksSecondOrderFormat +from openapi_project.openapi_package.models.option_history_greeks_second_order_interval import OptionHistoryGreeksSecondOrderInterval +from openapi_project.openapi_package.models.option_history_greeks_second_order_rate_type import OptionHistoryGreeksSecondOrderRateType +from openapi_project.openapi_package.models.option_history_greeks_second_order_response_200 import OptionHistoryGreeksSecondOrderResponse200 +from openapi_project.openapi_package.models.option_history_greeks_second_order_right import OptionHistoryGreeksSecondOrderRight +from openapi_project.openapi_package.models.option_history_greeks_third_order_format import OptionHistoryGreeksThirdOrderFormat +from openapi_project.openapi_package.models.option_history_greeks_third_order_interval import OptionHistoryGreeksThirdOrderInterval +from openapi_project.openapi_package.models.option_history_greeks_third_order_rate_type import OptionHistoryGreeksThirdOrderRateType +from openapi_project.openapi_package.models.option_history_greeks_third_order_response_200 import OptionHistoryGreeksThirdOrderResponse200 +from openapi_project.openapi_package.models.option_history_greeks_third_order_right import OptionHistoryGreeksThirdOrderRight +from openapi_project.openapi_package.models.option_history_ohlc_format import OptionHistoryOhlcFormat +from openapi_project.openapi_package.models.option_history_ohlc_interval import OptionHistoryOhlcInterval +from openapi_project.openapi_package.models.option_history_ohlc_response_200 import OptionHistoryOhlcResponse200 +from openapi_project.openapi_package.models.option_history_ohlc_right import OptionHistoryOhlcRight +from openapi_project.openapi_package.models.option_history_open_interest_format import OptionHistoryOpenInterestFormat +from openapi_project.openapi_package.models.option_history_open_interest_response_200 import OptionHistoryOpenInterestResponse200 +from openapi_project.openapi_package.models.option_history_open_interest_right import OptionHistoryOpenInterestRight +from openapi_project.openapi_package.models.option_history_quote_format import OptionHistoryQuoteFormat +from openapi_project.openapi_package.models.option_history_quote_interval import OptionHistoryQuoteInterval +from openapi_project.openapi_package.models.option_history_quote_response_200 import OptionHistoryQuoteResponse200 +from openapi_project.openapi_package.models.option_history_quote_right import OptionHistoryQuoteRight +from openapi_project.openapi_package.models.option_history_trade_format import OptionHistoryTradeFormat +from openapi_project.openapi_package.models.option_history_trade_greeks_all_format import OptionHistoryTradeGreeksAllFormat +from openapi_project.openapi_package.models.option_history_trade_greeks_all_rate_type import OptionHistoryTradeGreeksAllRateType +from openapi_project.openapi_package.models.option_history_trade_greeks_all_response_200 import OptionHistoryTradeGreeksAllResponse200 +from openapi_project.openapi_package.models.option_history_trade_greeks_all_right import OptionHistoryTradeGreeksAllRight +from openapi_project.openapi_package.models.option_history_trade_greeks_first_order_format import OptionHistoryTradeGreeksFirstOrderFormat +from openapi_project.openapi_package.models.option_history_trade_greeks_first_order_rate_type import OptionHistoryTradeGreeksFirstOrderRateType +from openapi_project.openapi_package.models.option_history_trade_greeks_first_order_response_200 import OptionHistoryTradeGreeksFirstOrderResponse200 +from openapi_project.openapi_package.models.option_history_trade_greeks_first_order_right import OptionHistoryTradeGreeksFirstOrderRight +from openapi_project.openapi_package.models.option_history_trade_greeks_implied_volatility_format import OptionHistoryTradeGreeksImpliedVolatilityFormat +from openapi_project.openapi_package.models.option_history_trade_greeks_implied_volatility_rate_type import OptionHistoryTradeGreeksImpliedVolatilityRateType +from openapi_project.openapi_package.models.option_history_trade_greeks_implied_volatility_response_200 import OptionHistoryTradeGreeksImpliedVolatilityResponse200 +from openapi_project.openapi_package.models.option_history_trade_greeks_implied_volatility_right import OptionHistoryTradeGreeksImpliedVolatilityRight +from openapi_project.openapi_package.models.option_history_trade_greeks_second_order_format import OptionHistoryTradeGreeksSecondOrderFormat +from openapi_project.openapi_package.models.option_history_trade_greeks_second_order_rate_type import OptionHistoryTradeGreeksSecondOrderRateType +from openapi_project.openapi_package.models.option_history_trade_greeks_second_order_response_200 import OptionHistoryTradeGreeksSecondOrderResponse200 +from openapi_project.openapi_package.models.option_history_trade_greeks_second_order_right import OptionHistoryTradeGreeksSecondOrderRight +from openapi_project.openapi_package.models.option_history_trade_greeks_third_order_format import OptionHistoryTradeGreeksThirdOrderFormat +from openapi_project.openapi_package.models.option_history_trade_greeks_third_order_rate_type import OptionHistoryTradeGreeksThirdOrderRateType +from openapi_project.openapi_package.models.option_history_trade_greeks_third_order_response_200 import OptionHistoryTradeGreeksThirdOrderResponse200 +from openapi_project.openapi_package.models.option_history_trade_greeks_third_order_right import OptionHistoryTradeGreeksThirdOrderRight +from openapi_project.openapi_package.models.option_history_trade_quote_format import OptionHistoryTradeQuoteFormat +from openapi_project.openapi_package.models.option_history_trade_quote_response_200 import OptionHistoryTradeQuoteResponse200 +from openapi_project.openapi_package.models.option_history_trade_quote_right import OptionHistoryTradeQuoteRight +from openapi_project.openapi_package.models.option_history_trade_response_200 import OptionHistoryTradeResponse200 +from openapi_project.openapi_package.models.option_history_trade_right import OptionHistoryTradeRight +from openapi_project.openapi_package.models.option_list_contracts_format import OptionListContractsFormat +from openapi_project.openapi_package.models.option_list_contracts_request_type import OptionListContractsRequestType +from openapi_project.openapi_package.models.option_list_contracts_response_200 import OptionListContractsResponse200 +from openapi_project.openapi_package.models.option_list_dates_format import OptionListDatesFormat +from openapi_project.openapi_package.models.option_list_dates_request_type import OptionListDatesRequestType +from openapi_project.openapi_package.models.option_list_dates_response_200 import OptionListDatesResponse200 +from openapi_project.openapi_package.models.option_list_dates_right import OptionListDatesRight +from openapi_project.openapi_package.models.option_list_expirations_format import OptionListExpirationsFormat +from openapi_project.openapi_package.models.option_list_expirations_response_200 import OptionListExpirationsResponse200 +from openapi_project.openapi_package.models.option_list_strikes_format import OptionListStrikesFormat +from openapi_project.openapi_package.models.option_list_strikes_response_200 import OptionListStrikesResponse200 +from openapi_project.openapi_package.models.option_list_symbols_format import OptionListSymbolsFormat +from openapi_project.openapi_package.models.option_list_symbols_response_200 import OptionListSymbolsResponse200 +from openapi_project.openapi_package.models.option_snapshot_greeks_all_format import OptionSnapshotGreeksAllFormat +from openapi_project.openapi_package.models.option_snapshot_greeks_all_rate_type import OptionSnapshotGreeksAllRateType +from openapi_project.openapi_package.models.option_snapshot_greeks_all_response_200 import OptionSnapshotGreeksAllResponse200 +from openapi_project.openapi_package.models.option_snapshot_greeks_all_right import OptionSnapshotGreeksAllRight +from openapi_project.openapi_package.models.option_snapshot_greeks_first_order_format import OptionSnapshotGreeksFirstOrderFormat +from openapi_project.openapi_package.models.option_snapshot_greeks_first_order_rate_type import OptionSnapshotGreeksFirstOrderRateType +from openapi_project.openapi_package.models.option_snapshot_greeks_first_order_response_200 import OptionSnapshotGreeksFirstOrderResponse200 +from openapi_project.openapi_package.models.option_snapshot_greeks_first_order_right import OptionSnapshotGreeksFirstOrderRight +from openapi_project.openapi_package.models.option_snapshot_greeks_implied_volatility_format import OptionSnapshotGreeksImpliedVolatilityFormat +from openapi_project.openapi_package.models.option_snapshot_greeks_implied_volatility_rate_type import OptionSnapshotGreeksImpliedVolatilityRateType +from openapi_project.openapi_package.models.option_snapshot_greeks_implied_volatility_response_200 import OptionSnapshotGreeksImpliedVolatilityResponse200 +from openapi_project.openapi_package.models.option_snapshot_greeks_implied_volatility_right import OptionSnapshotGreeksImpliedVolatilityRight +from openapi_project.openapi_package.models.option_snapshot_greeks_second_order_format import OptionSnapshotGreeksSecondOrderFormat +from openapi_project.openapi_package.models.option_snapshot_greeks_second_order_rate_type import OptionSnapshotGreeksSecondOrderRateType +from openapi_project.openapi_package.models.option_snapshot_greeks_second_order_response_200 import OptionSnapshotGreeksSecondOrderResponse200 +from openapi_project.openapi_package.models.option_snapshot_greeks_second_order_right import OptionSnapshotGreeksSecondOrderRight +from openapi_project.openapi_package.models.option_snapshot_greeks_third_order_format import OptionSnapshotGreeksThirdOrderFormat +from openapi_project.openapi_package.models.option_snapshot_greeks_third_order_rate_type import OptionSnapshotGreeksThirdOrderRateType +from openapi_project.openapi_package.models.option_snapshot_greeks_third_order_response_200 import OptionSnapshotGreeksThirdOrderResponse200 +from openapi_project.openapi_package.models.option_snapshot_greeks_third_order_right import OptionSnapshotGreeksThirdOrderRight +from openapi_project.openapi_package.models.option_snapshot_ohlc_format import OptionSnapshotOhlcFormat +from openapi_project.openapi_package.models.option_snapshot_ohlc_response_200 import OptionSnapshotOhlcResponse200 +from openapi_project.openapi_package.models.option_snapshot_ohlc_right import OptionSnapshotOhlcRight +from openapi_project.openapi_package.models.option_snapshot_open_interest_format import OptionSnapshotOpenInterestFormat +from openapi_project.openapi_package.models.option_snapshot_open_interest_response_200 import OptionSnapshotOpenInterestResponse200 +from openapi_project.openapi_package.models.option_snapshot_open_interest_right import OptionSnapshotOpenInterestRight +from openapi_project.openapi_package.models.option_snapshot_quote_format import OptionSnapshotQuoteFormat +from openapi_project.openapi_package.models.option_snapshot_quote_response_200 import OptionSnapshotQuoteResponse200 +from openapi_project.openapi_package.models.option_snapshot_quote_right import OptionSnapshotQuoteRight +from openapi_project.openapi_package.models.option_snapshot_trade_format import OptionSnapshotTradeFormat +from openapi_project.openapi_package.models.option_snapshot_trade_response_200 import OptionSnapshotTradeResponse200 +from openapi_project.openapi_package.models.option_snapshot_trade_right import OptionSnapshotTradeRight +from openapi_project.openapi_package.models.stock_at_time_quote_format import StockAtTimeQuoteFormat +from openapi_project.openapi_package.models.stock_at_time_quote_response_200 import StockAtTimeQuoteResponse200 +from openapi_project.openapi_package.models.stock_at_time_quote_venue import StockAtTimeQuoteVenue +from openapi_project.openapi_package.models.stock_at_time_trade_format import StockAtTimeTradeFormat +from openapi_project.openapi_package.models.stock_at_time_trade_response_200 import StockAtTimeTradeResponse200 +from openapi_project.openapi_package.models.stock_at_time_trade_venue import StockAtTimeTradeVenue +from openapi_project.openapi_package.models.stock_history_eod_format import StockHistoryEodFormat +from openapi_project.openapi_package.models.stock_history_eod_response_200 import StockHistoryEodResponse200 +from openapi_project.openapi_package.models.stock_history_ohlc_format import StockHistoryOhlcFormat +from openapi_project.openapi_package.models.stock_history_ohlc_interval import StockHistoryOhlcInterval +from openapi_project.openapi_package.models.stock_history_ohlc_response_200 import StockHistoryOhlcResponse200 +from openapi_project.openapi_package.models.stock_history_ohlc_venue import StockHistoryOhlcVenue +from openapi_project.openapi_package.models.stock_history_quote_format import StockHistoryQuoteFormat +from openapi_project.openapi_package.models.stock_history_quote_interval import StockHistoryQuoteInterval +from openapi_project.openapi_package.models.stock_history_quote_response_200 import StockHistoryQuoteResponse200 +from openapi_project.openapi_package.models.stock_history_quote_venue import StockHistoryQuoteVenue +from openapi_project.openapi_package.models.stock_history_trade_format import StockHistoryTradeFormat +from openapi_project.openapi_package.models.stock_history_trade_quote_format import StockHistoryTradeQuoteFormat +from openapi_project.openapi_package.models.stock_history_trade_quote_venue import StockHistoryTradeQuoteVenue +from openapi_project.openapi_package.models.stock_history_trade_venue import StockHistoryTradeVenue +from openapi_project.openapi_package.models.stock_list_dates_format import StockListDatesFormat +from openapi_project.openapi_package.models.stock_list_dates_request_type import StockListDatesRequestType +from openapi_project.openapi_package.models.stock_list_dates_response_200 import StockListDatesResponse200 +from openapi_project.openapi_package.models.stock_list_symbols_format import StockListSymbolsFormat +from openapi_project.openapi_package.models.stock_list_symbols_response_200 import StockListSymbolsResponse200 +from openapi_project.openapi_package.models.stock_snapshot_ohlc_format import StockSnapshotOhlcFormat +from openapi_project.openapi_package.models.stock_snapshot_ohlc_response_200 import StockSnapshotOhlcResponse200 +from openapi_project.openapi_package.models.stock_snapshot_ohlc_venue import StockSnapshotOhlcVenue +from openapi_project.openapi_package.models.stock_snapshot_quote_format import StockSnapshotQuoteFormat +from openapi_project.openapi_package.models.stock_snapshot_quote_response_200 import StockSnapshotQuoteResponse200 +from openapi_project.openapi_package.models.stock_snapshot_quote_venue import StockSnapshotQuoteVenue +from openapi_project.openapi_package.models.stock_snapshot_trade_format import StockSnapshotTradeFormat +from openapi_project.openapi_package.models.stock_snapshot_trade_response_200 import StockSnapshotTradeResponse200 +from openapi_project.openapi_package.models.stock_snapshot_trade_venue import StockSnapshotTradeVenue __all__ = ( - "Account", - "AccountScript", - "AccountStatus", - "AccountType", - "AnalyzePositionItem", - "AnalyzePositionsRequest", - "AnalyzePositionsResponse", - "AnyModel", - "CalculateMarginRequest", - "CalculateMarginRequestPosition", - "CalculateMarginRequestPositionList", - "CalculateMarginResponse", - "CancelOrderRequest", - "CancelOrderRequestOptionalData", - "CancelOrderResponse", - "CancelReplaceMultiLegOrderRequest", - "CancelReplaceMultiLegOrderRequestAlgo", - "CancelReplaceMultiLegOrderRequestMarketCondition", - "CancelReplaceMultiLegOrderRequestOptionalData", - "CancelReplaceMultiLegOrderResponse", - "CancelReplaceOrderRequest", - "CancelReplaceOrderRequestAlgo", - "CancelReplaceOrderRequestMarketCondition", - "CancelReplaceOrderRequestOptionalData", - "CancelReplaceOrderResponse", - "CapacityCode", - "ClaimType", - "ClearingInfo", - "ClearingRange", - "Country", - "CreateFlexOptionRequest", - "CreateFlexOptionResponse", - "CreateMultiLegOrderCrossAllocation", - "CreateMultiLegOrderCrossAllocationOptionalData", - "CreateMultiLegOrderCrossRequest", - "CreateMultiLegOrderCrossRequestAlgo", - "CreateMultiLegOrderCrossRequestMarketCondition", - "CreateMultiLegOrderCrossRequestOptionalData", - "CreateMultiLegOrderCrossResponse", - "CreateMultiLegOrderLeg", - "CreateMultiLegOrderLegMarketCondition", - "CreateMultiLegOrderLegOptionalData", - "CreateMultiLegOrderRequest", - "CreateMultiLegOrderRequestAlgo", - "CreateMultiLegOrderRequestMarketCondition", - "CreateMultiLegOrderRequestOptionalData", - "CreateMultiLegOrderResponse", - "CreateOrderCrossAllocation", - "CreateOrderCrossAllocationOptionalData", - "CreateOrderCrossRequest", - "CreateOrderCrossRequestAlgo", - "CreateOrderCrossRequestMarketCondition", - "CreateOrderCrossRequestOptionalData", - "CreateOrderCrossResponse", - "CreateOrderRequest", - "CreateOrderRequestAlgo", - "CreateOrderRequestMarketCondition", - "CreateOrderRequestOptionalData", - "CreateOrderResponse", - "CrossSideType", - "CrossType", - "Crypto", - "CryptoAliases", - "Currency", - "CxlRejResponseTo", - "Date", - "EasyToBorrowSecurity", - "Empty", - "Exchange", - "ExchangeCode", - "ExecType", - "Execution", - "ExecutionAlgo", - "ExecutionOptionalData", - "FlexOption", - "FlexOptionAliases", - "FlexSettlementType", - "Future", - "FutureAliases", - "FutureRoot", - "FutureRootAliases", - "FutureSpread", - "FutureSpreadAliases", - "FutureSpreadLeg", - "Fx", - "FxAliases", - "GenericOrder", - "GetActiveUserResponse", - "GetServerInfoResponse", - "GetServerInfoResponseSystemSettings", - "GetServerTimeResponse", - "GetTradingHolidaysResponse", - "Header", - "Index", - "IndexAliases", - "ListAccountsResponse", - "ListAffiliatedTradingFirmsResponse", - "ListEasyToBorrowSecuritiesRequest", - "ListEasyToBorrowSecuritiesResponse", - "ListExchangesResponse", - "ListOptionChainsRepsonse", - "ListOptionChainsRequest", - "ListOrdersResponse", - "ListPositionsResponse", - "ListRoutesResponse", - "ListSecuritiesRequest", - "ListSecuritiesResponse", - "ListTradeConfirmsResponse", - "ListTradingFirmsResponse", - "LoginRequest", - "LoginResponse", - "LoginResponseSystemSettings", - "LoginStatus", - "MarginData", - "MarginDataType", - "MultiLegOrder", - "MultiLegOrderAlgo", - "MultiLegOrderCancelReplaceRequest", - "MultiLegOrderCancelReplaceRequestAlgo", - "MultiLegOrderCancelReplaceRequestMarketCondition", - "MultiLegOrderCancelReplaceRequestOptionalData", - "MultiLegOrderCross", - "MultiLegOrderCrossAlgo", - "MultiLegOrderCrossAllocation", - "MultiLegOrderCrossAllocationOptionalData", - "MultiLegOrderCrossMarketCondition", - "MultiLegOrderCrossOptionalData", - "MultiLegOrderLeg", - "MultiLegOrderLegMarketCondition", - "MultiLegOrderLegOptionalData", - "MultiLegOrderMarketCondition", - "MultiLegOrderOptionalData", - "MultiLegReportingType", - "NumericDisplayFormat", - "Option", - "OptionAliases", - "OptionChain", - "OptionChainOption", - "OptionChainOptionAliases", - "OptionChainOptions", - "OptionChainRoots", - "OptionExerciseStyle", - "OptionExpirationStyle", - "OptionRoot", - "OptionRootAliases", - "OptionSeries", - "OptionSeriesProductType", - "OptionSeriesType", - "OptionSettlementType", - "Order", - "OrderAlgo", - "OrderCancelReject", - "OrderCancelRejectOptionalData", - "OrderCancelReplaceRequest", - "OrderCancelReplaceRequestAlgo", - "OrderCancelReplaceRequestMarketCondition", - "OrderCancelReplaceRequestOptionalData", - "OrderCancelRequest", - "OrderCancelRequestOptionalData", - "OrderCross", - "OrderCrossAlgo", - "OrderCrossAllocation", - "OrderCrossAllocationOptionalData", - "OrderCrossMarketCondition", - "OrderCrossOptionalData", - "OrderDelete", - "OrderDeleteOptionalData", - "OrderInstruction", - "OrderInstructionType", - "OrderMarketCondition", - "OrderOptionalData", - "OrderType", - "OrderUpdate", - "OrderUpdateAlgo", - "OrderUpdateEvent", - "OrderUpdateOptionalData", - "OrdStatus", - "OrdType", - "OriginationType", - "Position", - "PositionAnalysis", - "PositionEffect", - "PositionSource", - "PositionTheo", - "PositionTheoLeg", - "PriceType", - "ProductGroup", - "ProductSubGroup", - "PutCall", - "RiskCalculationType", - "RiskEvalMode", - "RiskRadarAccountGroup", - "RiskRadarClassGroup", - "RiskRadarData", - "RiskRadarPosition", - "RiskRadarProductGroup", - "RiskRadarRequest", - "RiskRadarRequestPosition", - "RiskRadarRequestPositionList", - "RiskRadarResponse", - "RiskRadarScenarioOrder", - "RiskReject", - "RiskRejectType", - "Route", - "RouteApplicability", - "RouteProperty", - "RoutePropertyType", - "RouteType", - "RoutingSessionGroup", - "RoutingSessionGroupType", - "Scenario", - "ScenarioLeg", - "ScenarioPosition", - "ScenarioTheo", - "SearchOrderHistoryResponse", - "Security", - "SecurityCategory", - "SecurityType", - "SettlementDeliverableType", - "SettlementInfo", - "ShockValue", - "ShockValueFlags", - "Side", - "SpreadLegSide", - "SpreadLegType", - "Status", - "StatusCode", - "Stock", - "StockAliases", - "Tif", - "TimeOfDay", - "TimsClassGroup", - "TimsMarginData", - "TimsPositionGroup", - "TimsProductGroup", - "TradeConfirm", - "TradingFirm", - "TradingFirmSlim", - "TradingHoliday", - "TradingSession", - "TradingSessionGroup", - "User", - "UserLocation", - "UserPermission", - "UserStatus", - "UserType", - "ValidateRiskResponse", - "VolatilityShockSkew", - "VolatilityShockType", + "IndexAtTimePriceFormat", + "IndexAtTimePriceResponse200", + "IndexHistoryEodFormat", + "IndexHistoryEodResponse200", + "IndexHistoryOhlcFormat", + "IndexHistoryOhlcInterval", + "IndexHistoryOhlcResponse200", + "IndexHistoryPriceFormat", + "IndexHistoryPriceInterval", + "IndexHistoryPriceResponse200", + "IndexListDatesFormat", + "IndexListDatesResponse200", + "IndexListSymbolsFormat", + "IndexListSymbolsResponse200", + "IndexSnapshotOhlcFormat", + "IndexSnapshotOhlcResponse200", + "IndexSnapshotPriceFormat", + "IndexSnapshotPriceResponse200", + "OptionAtTimeQuoteFormat", + "OptionAtTimeQuoteResponse200", + "OptionAtTimeQuoteRight", + "OptionAtTimeTradeFormat", + "OptionAtTimeTradeResponse200", + "OptionAtTimeTradeRight", + "OptionHistoryEodFormat", + "OptionHistoryEodResponse200", + "OptionHistoryEodRight", + "OptionHistoryGreeksAllFormat", + "OptionHistoryGreeksAllInterval", + "OptionHistoryGreeksAllRateType", + "OptionHistoryGreeksAllResponse200", + "OptionHistoryGreeksAllRight", + "OptionHistoryGreeksEodFormat", + "OptionHistoryGreeksEodRateType", + "OptionHistoryGreeksEodResponse200", + "OptionHistoryGreeksEodRight", + "OptionHistoryGreeksFirstOrderFormat", + "OptionHistoryGreeksFirstOrderInterval", + "OptionHistoryGreeksFirstOrderRateType", + "OptionHistoryGreeksFirstOrderResponse200", + "OptionHistoryGreeksFirstOrderRight", + "OptionHistoryGreeksImpliedVolatilityFormat", + "OptionHistoryGreeksImpliedVolatilityInterval", + "OptionHistoryGreeksImpliedVolatilityRateType", + "OptionHistoryGreeksImpliedVolatilityResponse200", + "OptionHistoryGreeksImpliedVolatilityRight", + "OptionHistoryGreeksSecondOrderFormat", + "OptionHistoryGreeksSecondOrderInterval", + "OptionHistoryGreeksSecondOrderRateType", + "OptionHistoryGreeksSecondOrderResponse200", + "OptionHistoryGreeksSecondOrderRight", + "OptionHistoryGreeksThirdOrderFormat", + "OptionHistoryGreeksThirdOrderInterval", + "OptionHistoryGreeksThirdOrderRateType", + "OptionHistoryGreeksThirdOrderResponse200", + "OptionHistoryGreeksThirdOrderRight", + "OptionHistoryOhlcFormat", + "OptionHistoryOhlcInterval", + "OptionHistoryOhlcResponse200", + "OptionHistoryOhlcRight", + "OptionHistoryOpenInterestFormat", + "OptionHistoryOpenInterestResponse200", + "OptionHistoryOpenInterestRight", + "OptionHistoryQuoteFormat", + "OptionHistoryQuoteInterval", + "OptionHistoryQuoteResponse200", + "OptionHistoryQuoteRight", + "OptionHistoryTradeFormat", + "OptionHistoryTradeGreeksAllFormat", + "OptionHistoryTradeGreeksAllRateType", + "OptionHistoryTradeGreeksAllResponse200", + "OptionHistoryTradeGreeksAllRight", + "OptionHistoryTradeGreeksFirstOrderFormat", + "OptionHistoryTradeGreeksFirstOrderRateType", + "OptionHistoryTradeGreeksFirstOrderResponse200", + "OptionHistoryTradeGreeksFirstOrderRight", + "OptionHistoryTradeGreeksImpliedVolatilityFormat", + "OptionHistoryTradeGreeksImpliedVolatilityRateType", + "OptionHistoryTradeGreeksImpliedVolatilityResponse200", + "OptionHistoryTradeGreeksImpliedVolatilityRight", + "OptionHistoryTradeGreeksSecondOrderFormat", + "OptionHistoryTradeGreeksSecondOrderRateType", + "OptionHistoryTradeGreeksSecondOrderResponse200", + "OptionHistoryTradeGreeksSecondOrderRight", + "OptionHistoryTradeGreeksThirdOrderFormat", + "OptionHistoryTradeGreeksThirdOrderRateType", + "OptionHistoryTradeGreeksThirdOrderResponse200", + "OptionHistoryTradeGreeksThirdOrderRight", + "OptionHistoryTradeQuoteFormat", + "OptionHistoryTradeQuoteResponse200", + "OptionHistoryTradeQuoteRight", + "OptionHistoryTradeResponse200", + "OptionHistoryTradeRight", + "OptionListContractsFormat", + "OptionListContractsRequestType", + "OptionListContractsResponse200", + "OptionListDatesFormat", + "OptionListDatesRequestType", + "OptionListDatesResponse200", + "OptionListDatesRight", + "OptionListExpirationsFormat", + "OptionListExpirationsResponse200", + "OptionListStrikesFormat", + "OptionListStrikesResponse200", + "OptionListSymbolsFormat", + "OptionListSymbolsResponse200", + "OptionSnapshotGreeksAllFormat", + "OptionSnapshotGreeksAllRateType", + "OptionSnapshotGreeksAllResponse200", + "OptionSnapshotGreeksAllRight", + "OptionSnapshotGreeksFirstOrderFormat", + "OptionSnapshotGreeksFirstOrderRateType", + "OptionSnapshotGreeksFirstOrderResponse200", + "OptionSnapshotGreeksFirstOrderRight", + "OptionSnapshotGreeksImpliedVolatilityFormat", + "OptionSnapshotGreeksImpliedVolatilityRateType", + "OptionSnapshotGreeksImpliedVolatilityResponse200", + "OptionSnapshotGreeksImpliedVolatilityRight", + "OptionSnapshotGreeksSecondOrderFormat", + "OptionSnapshotGreeksSecondOrderRateType", + "OptionSnapshotGreeksSecondOrderResponse200", + "OptionSnapshotGreeksSecondOrderRight", + "OptionSnapshotGreeksThirdOrderFormat", + "OptionSnapshotGreeksThirdOrderRateType", + "OptionSnapshotGreeksThirdOrderResponse200", + "OptionSnapshotGreeksThirdOrderRight", + "OptionSnapshotOhlcFormat", + "OptionSnapshotOhlcResponse200", + "OptionSnapshotOhlcRight", + "OptionSnapshotOpenInterestFormat", + "OptionSnapshotOpenInterestResponse200", + "OptionSnapshotOpenInterestRight", + "OptionSnapshotQuoteFormat", + "OptionSnapshotQuoteResponse200", + "OptionSnapshotQuoteRight", + "OptionSnapshotTradeFormat", + "OptionSnapshotTradeResponse200", + "OptionSnapshotTradeRight", + "StockAtTimeQuoteFormat", + "StockAtTimeQuoteResponse200", + "StockAtTimeQuoteVenue", + "StockAtTimeTradeFormat", + "StockAtTimeTradeResponse200", + "StockAtTimeTradeVenue", + "StockHistoryEodFormat", + "StockHistoryEodResponse200", + "StockHistoryOhlcFormat", + "StockHistoryOhlcInterval", + "StockHistoryOhlcResponse200", + "StockHistoryOhlcVenue", + "StockHistoryQuoteFormat", + "StockHistoryQuoteInterval", + "StockHistoryQuoteResponse200", + "StockHistoryQuoteVenue", + "StockHistoryTradeFormat", + "StockHistoryTradeQuoteFormat", + "StockHistoryTradeQuoteVenue", + "StockHistoryTradeVenue", + "StockListDatesFormat", + "StockListDatesRequestType", + "StockListDatesResponse200", + "StockListSymbolsFormat", + "StockListSymbolsResponse200", + "StockSnapshotOhlcFormat", + "StockSnapshotOhlcResponse200", + "StockSnapshotOhlcVenue", + "StockSnapshotQuoteFormat", + "StockSnapshotQuoteResponse200", + "StockSnapshotQuoteVenue", + "StockSnapshotTradeFormat", + "StockSnapshotTradeResponse200", + "StockSnapshotTradeVenue", ) diff --git a/openapi_project/openapi_package/models/account.py b/openapi_project/openapi_package/models/account.py deleted file mode 100644 index 4f658eb65..000000000 --- a/openapi_project/openapi_package/models/account.py +++ /dev/null @@ -1,380 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.account_status import AccountStatus -from openapi_project.openapi_package.models.account_type import AccountType -from openapi_project.openapi_package.models.capacity_code import CapacityCode -from openapi_project.openapi_package.models.clearing_range import ClearingRange -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.routing_session_group import RoutingSessionGroup - from openapi_project.openapi_package.models.account_script import AccountScript - - -T = TypeVar("T", bound="Account") - - -@_attrs_define -class Account: - """ - Attributes: - id_ (Unset | int): - billing_code (Unset | str): - cti_code (Unset | str): - currency (Unset | Currency): - equities_capacity (Unset | CapacityCode): - equities_give_up (Unset | str): - equities_mpid (Unset | str): - futures_clearing_account (Unset | str): - futures_clearing_range (Unset | ClearingRange): - futures_cmta (Unset | str): - futures_execution_broker (Unset | str): - name (Unset | str): - occ_actionable_id (Unset | str): - options_clearing_account (Unset | str): - options_clearing_range (Unset | ClearingRange): - options_cmta (Unset | str): - options_efid (Unset | str): - options_give_up (Unset | str): - routing_session_groups (Unset | list[RoutingSessionGroup]): - status (Unset | AccountStatus): - tag1 (Unset | str): - trading_firm_id (Unset | int): - type_ (Unset | AccountType): - created_ts (Unset | str): - optional_data (Unset | str): - position_script (Unset | AccountScript): - buying_power_script (Unset | AccountScript): - clearing_script (Unset | AccountScript): - """ - - id_: Unset | int = UNSET - billing_code: Unset | str = UNSET - cti_code: Unset | str = UNSET - currency: Unset | Currency = UNSET - equities_capacity: Unset | CapacityCode = UNSET - equities_give_up: Unset | str = UNSET - equities_mpid: Unset | str = UNSET - futures_clearing_account: Unset | str = UNSET - futures_clearing_range: Unset | ClearingRange = UNSET - futures_cmta: Unset | str = UNSET - futures_execution_broker: Unset | str = UNSET - name: Unset | str = UNSET - occ_actionable_id: Unset | str = UNSET - options_clearing_account: Unset | str = UNSET - options_clearing_range: Unset | ClearingRange = UNSET - options_cmta: Unset | str = UNSET - options_efid: Unset | str = UNSET - options_give_up: Unset | str = UNSET - routing_session_groups: Unset | list[RoutingSessionGroup] = UNSET - status: Unset | AccountStatus = UNSET - tag1: Unset | str = UNSET - trading_firm_id: Unset | int = UNSET - type_: Unset | AccountType = UNSET - created_ts: Unset | str = UNSET - optional_data: Unset | str = UNSET - position_script: Unset | AccountScript = UNSET - buying_power_script: Unset | AccountScript = UNSET - clearing_script: Unset | AccountScript = UNSET - - def to_dict(self) -> dict[str, Any]: - id_ = self.id_ - - billing_code = self.billing_code - - cti_code = self.cti_code - - currency: Unset | str = ( - UNSET if isinstance(self.currency, Unset) else self.currency.value - ) - - equities_capacity: Unset | str = ( - UNSET - if isinstance(self.equities_capacity, Unset) - else self.equities_capacity.value - ) - - equities_give_up = self.equities_give_up - - equities_mpid = self.equities_mpid - - futures_clearing_account = self.futures_clearing_account - - futures_clearing_range: Unset | str = ( - UNSET - if isinstance(self.futures_clearing_range, Unset) - else self.futures_clearing_range.value - ) - - futures_cmta = self.futures_cmta - - futures_execution_broker = self.futures_execution_broker - - name = self.name - - occ_actionable_id = self.occ_actionable_id - - options_clearing_account = self.options_clearing_account - - options_clearing_range: Unset | str = ( - UNSET - if isinstance(self.options_clearing_range, Unset) - else self.options_clearing_range.value - ) - - options_cmta = self.options_cmta - - options_efid = self.options_efid - - options_give_up = self.options_give_up - - routing_session_groups: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.routing_session_groups, Unset): - routing_session_groups = [] - for routing_session_groups_item_data in self.routing_session_groups: - routing_session_groups_item = routing_session_groups_item_data.to_dict() - routing_session_groups.append(routing_session_groups_item) - - status: Unset | str = ( - UNSET if isinstance(self.status, Unset) else self.status.value - ) - - tag1 = self.tag1 - - trading_firm_id = self.trading_firm_id - - type_: Unset | str = ( - UNSET if isinstance(self.type_, Unset) else self.type_.value - ) - - created_ts = self.created_ts - - optional_data = self.optional_data - - position_script: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.position_script, Unset) - else self.position_script.to_dict() - ) - - buying_power_script: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.buying_power_script, Unset) - else self.buying_power_script.to_dict() - ) - - clearing_script: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.clearing_script, Unset) - else self.clearing_script.to_dict() - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if id_ is not UNSET: - field_dict["id"] = id - if billing_code is not UNSET: - field_dict["billingCode"] = billing_code - if cti_code is not UNSET: - field_dict["ctiCode"] = cti_code - if currency is not UNSET: - field_dict["currency"] = currency - if equities_capacity is not UNSET: - field_dict["equitiesCapacity"] = equities_capacity - if equities_give_up is not UNSET: - field_dict["equitiesGiveUp"] = equities_give_up - if equities_mpid is not UNSET: - field_dict["equitiesMpid"] = equities_mpid - if futures_clearing_account is not UNSET: - field_dict["futuresClearingAccount"] = futures_clearing_account - if futures_clearing_range is not UNSET: - field_dict["futuresClearingRange"] = futures_clearing_range - if futures_cmta is not UNSET: - field_dict["futuresCmta"] = futures_cmta - if futures_execution_broker is not UNSET: - field_dict["futuresExecutionBroker"] = futures_execution_broker - if name is not UNSET: - field_dict["name"] = name - if occ_actionable_id is not UNSET: - field_dict["occActionableId"] = occ_actionable_id - if options_clearing_account is not UNSET: - field_dict["optionsClearingAccount"] = options_clearing_account - if options_clearing_range is not UNSET: - field_dict["optionsClearingRange"] = options_clearing_range - if options_cmta is not UNSET: - field_dict["optionsCmta"] = options_cmta - if options_efid is not UNSET: - field_dict["optionsEfid"] = options_efid - if options_give_up is not UNSET: - field_dict["optionsGiveUp"] = options_give_up - if routing_session_groups is not UNSET: - field_dict["routingSessionGroups"] = routing_session_groups - if status is not UNSET: - field_dict["status"] = status - if tag1 is not UNSET: - field_dict["tag1"] = tag1 - if trading_firm_id is not UNSET: - field_dict["tradingFirmId"] = trading_firm_id - if type_ is not UNSET: - field_dict["type"] = type_ - if created_ts is not UNSET: - field_dict["createdTs"] = created_ts - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if position_script is not UNSET: - field_dict["positionScript"] = position_script - if buying_power_script is not UNSET: - field_dict["buyingPowerScript"] = buying_power_script - if clearing_script is not UNSET: - field_dict["clearingScript"] = clearing_script - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - id_ = d.pop("id", UNSET) - - billing_code = d.pop("billingCode", UNSET) - - cti_code = d.pop("ctiCode", UNSET) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency = ( - UNSET if isinstance(_currency, Unset) else Currency(_currency) - ) - - _equities_capacity = d.pop("equitiesCapacity", UNSET) - equities_capacity: Unset | CapacityCode = ( - UNSET - if isinstance(_equities_capacity, Unset) - else CapacityCode(_equities_capacity) - ) - - equities_give_up = d.pop("equitiesGiveUp", UNSET) - - equities_mpid = d.pop("equitiesMpid", UNSET) - - futures_clearing_account = d.pop("futuresClearingAccount", UNSET) - - _futures_clearing_range = d.pop("futuresClearingRange", UNSET) - futures_clearing_range: Unset | ClearingRange = ( - UNSET - if isinstance(_futures_clearing_range, Unset) - else ClearingRange(_futures_clearing_range) - ) - - futures_cmta = d.pop("futuresCmta", UNSET) - - futures_execution_broker = d.pop("futuresExecutionBroker", UNSET) - - name = d.pop("name", UNSET) - - occ_actionable_id = d.pop("occActionableId", UNSET) - - options_clearing_account = d.pop("optionsClearingAccount", UNSET) - - _options_clearing_range = d.pop("optionsClearingRange", UNSET) - options_clearing_range: Unset | ClearingRange = ( - UNSET - if isinstance(_options_clearing_range, Unset) - else ClearingRange(_options_clearing_range) - ) - - options_cmta = d.pop("optionsCmta", UNSET) - - options_efid = d.pop("optionsEfid", UNSET) - - options_give_up = d.pop("optionsGiveUp", UNSET) - - routing_session_groups = [] - _routing_session_groups = d.pop("routingSessionGroups", UNSET) - for routing_session_groups_item_data in _routing_session_groups or []: - routing_session_groups_item = RoutingSessionGroup.from_dict( - routing_session_groups_item_data - ) - - routing_session_groups.append(routing_session_groups_item) - - _status = d.pop("status", UNSET) - status: Unset | AccountStatus = ( - UNSET if isinstance(_status, Unset) else AccountStatus(_status) - ) - - tag1 = d.pop("tag1", UNSET) - - trading_firm_id = d.pop("tradingFirmId", UNSET) - - _type_ = d.pop("type", UNSET) - type_: Unset | AccountType = ( - UNSET if isinstance(_type_, Unset) else AccountType(_type_) - ) - - created_ts = d.pop("createdTs", UNSET) - - optional_data = d.pop("optionalData", UNSET) - - _position_script = d.pop("positionScript", UNSET) - position_script: Unset | AccountScript = ( - UNSET - if isinstance(_position_script, Unset) - else AccountScript.from_dict(_position_script) - ) - - _buying_power_script = d.pop("buyingPowerScript", UNSET) - buying_power_script: Unset | AccountScript = ( - UNSET - if isinstance(_buying_power_script, Unset) - else AccountScript.from_dict(_buying_power_script) - ) - - _clearing_script = d.pop("clearingScript", UNSET) - clearing_script: Unset | AccountScript = ( - UNSET - if isinstance(_clearing_script, Unset) - else AccountScript.from_dict(_clearing_script) - ) - - account = cls( - id_=id_, - billing_code=billing_code, - cti_code=cti_code, - currency=currency, - equities_capacity=equities_capacity, - equities_give_up=equities_give_up, - equities_mpid=equities_mpid, - futures_clearing_account=futures_clearing_account, - futures_clearing_range=futures_clearing_range, - futures_cmta=futures_cmta, - futures_execution_broker=futures_execution_broker, - name=name, - occ_actionable_id=occ_actionable_id, - options_clearing_account=options_clearing_account, - options_clearing_range=options_clearing_range, - options_cmta=options_cmta, - options_efid=options_efid, - options_give_up=options_give_up, - routing_session_groups=routing_session_groups, - status=status, - tag1=tag1, - trading_firm_id=trading_firm_id, - type_=type_, - created_ts=created_ts, - optional_data=optional_data, - position_script=position_script, - buying_power_script=buying_power_script, - clearing_script=clearing_script, - ) - - return account diff --git a/openapi_project/openapi_package/models/account_script.py b/openapi_project/openapi_package/models/account_script.py deleted file mode 100644 index 3d9043bbb..000000000 --- a/openapi_project/openapi_package/models/account_script.py +++ /dev/null @@ -1,55 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="AccountScript") - - -@_attrs_define -class AccountScript: - """ - Attributes: - script_name (Unset | str): - account_name (Unset | str): - """ - - script_name: Unset | str = UNSET - account_name: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - script_name = self.script_name - - account_name = self.account_name - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if script_name is not UNSET: - field_dict["scriptName"] = script_name - if account_name is not UNSET: - field_dict["accountName"] = account_name - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - script_name = d.pop("scriptName", UNSET) - - account_name = d.pop("accountName", UNSET) - - account_script = cls( - script_name=script_name, - account_name=account_name, - ) - - return account_script diff --git a/openapi_project/openapi_package/models/account_status.py b/openapi_project/openapi_package/models/account_status.py deleted file mode 100644 index 0a19e6040..000000000 --- a/openapi_project/openapi_package/models/account_status.py +++ /dev/null @@ -1,11 +0,0 @@ -from enum import Enum - - -class AccountStatus(str, Enum): - ACCOUNT_STATUS_ACTIVE = "ACCOUNT_STATUS_ACTIVE" - ACCOUNT_STATUS_DELETED = "ACCOUNT_STATUS_DELETED" - ACCOUNT_STATUS_LIQUIDATION = "ACCOUNT_STATUS_LIQUIDATION" - ACCOUNT_STATUS_VIEW_ONLY = "ACCOUNT_STATUS_VIEW_ONLY" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/account_type.py b/openapi_project/openapi_package/models/account_type.py deleted file mode 100644 index 65c58c63a..000000000 --- a/openapi_project/openapi_package/models/account_type.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class AccountType(str, Enum): - ACCOUNT_TYPE_CASH = "ACCOUNT_TYPE_CASH" - ACCOUNT_TYPE_INVENTORY = "ACCOUNT_TYPE_INVENTORY" - ACCOUNT_TYPE_MARGIN = "ACCOUNT_TYPE_MARGIN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/analyze_position_item.py b/openapi_project/openapi_package/models/analyze_position_item.py deleted file mode 100644 index 70a13cd6e..000000000 --- a/openapi_project/openapi_package/models/analyze_position_item.py +++ /dev/null @@ -1,73 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="AnalyzePositionItem") - - -@_attrs_define -class AnalyzePositionItem: - """ - Attributes: - price (Unset | float): - qty (Unset | int): - symbol (Unset | str): - volatility (Unset | float): - """ - - price: Unset | float = UNSET - qty: Unset | int = UNSET - symbol: Unset | str = UNSET - volatility: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - price = self.price - - qty = self.qty - - symbol = self.symbol - - volatility = self.volatility - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if price is not UNSET: - field_dict["price"] = price - if qty is not UNSET: - field_dict["qty"] = qty - if symbol is not UNSET: - field_dict["symbol"] = symbol - if volatility is not UNSET: - field_dict["volatility"] = volatility - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - price = d.pop("price", UNSET) - - qty = d.pop("qty", UNSET) - - symbol = d.pop("symbol", UNSET) - - volatility = d.pop("volatility", UNSET) - - analyze_position_item = cls( - price=price, - qty=qty, - symbol=symbol, - volatility=volatility, - ) - - return analyze_position_item diff --git a/openapi_project/openapi_package/models/analyze_positions_request.py b/openapi_project/openapi_package/models/analyze_positions_request.py deleted file mode 100644 index 111b4e00b..000000000 --- a/openapi_project/openapi_package/models/analyze_positions_request.py +++ /dev/null @@ -1,140 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.analyze_position_item import AnalyzePositionItem - - -T = TypeVar("T", bound="AnalyzePositionsRequest") - - -@_attrs_define -class AnalyzePositionsRequest: - """ - Attributes: - as_of_ts (Unset | str): - evaluate_at_expiry (Unset | bool): - evaluate_at_strike (Unset | bool): - evaluation_as_of (Unset | list[str]): - positions (Unset | list[AnalyzePositionItem]): - price (Unset | float): - underlying_volatility (Unset | list[float]): - historical_volatility_days (Unset | list[int]): - volatility_change (Unset | float): - """ - - as_of_ts: Unset | str = UNSET - evaluate_at_expiry: Unset | bool = UNSET - evaluate_at_strike: Unset | bool = UNSET - evaluation_as_of: Unset | list[str] = UNSET - positions: Unset | list[AnalyzePositionItem] = UNSET - price: Unset | float = UNSET - underlying_volatility: Unset | list[float] = UNSET - historical_volatility_days: Unset | list[int] = UNSET - volatility_change: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - as_of_ts = self.as_of_ts - - evaluate_at_expiry = self.evaluate_at_expiry - - evaluate_at_strike = self.evaluate_at_strike - - evaluation_as_of: Unset | list[str] = UNSET - if not isinstance(self.evaluation_as_of, Unset): - evaluation_as_of = self.evaluation_as_of - - positions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.positions, Unset): - positions = [] - for positions_item_data in self.positions: - positions_item = positions_item_data.to_dict() - positions.append(positions_item) - - price = self.price - - underlying_volatility: Unset | list[float] = UNSET - if not isinstance(self.underlying_volatility, Unset): - underlying_volatility = self.underlying_volatility - - historical_volatility_days: Unset | list[int] = UNSET - if not isinstance(self.historical_volatility_days, Unset): - historical_volatility_days = self.historical_volatility_days - - volatility_change = self.volatility_change - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if as_of_ts is not UNSET: - field_dict["asOfTs"] = as_of_ts - if evaluate_at_expiry is not UNSET: - field_dict["evaluateAtExpiry"] = evaluate_at_expiry - if evaluate_at_strike is not UNSET: - field_dict["evaluateAtStrike"] = evaluate_at_strike - if evaluation_as_of is not UNSET: - field_dict["evaluationAsOf"] = evaluation_as_of - if positions is not UNSET: - field_dict["positions"] = positions - if price is not UNSET: - field_dict["price"] = price - if underlying_volatility is not UNSET: - field_dict["underlyingVolatility"] = underlying_volatility - if historical_volatility_days is not UNSET: - field_dict["historicalVolatilityDays"] = historical_volatility_days - if volatility_change is not UNSET: - field_dict["volatilityChange"] = volatility_change - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - as_of_ts = d.pop("asOfTs", UNSET) - - evaluate_at_expiry = d.pop("evaluateAtExpiry", UNSET) - - evaluate_at_strike = d.pop("evaluateAtStrike", UNSET) - - evaluation_as_of = cast(list[str], d.pop("evaluationAsOf", UNSET)) - - positions = [] - _positions = d.pop("positions", UNSET) - for positions_item_data in _positions or []: - positions_item = AnalyzePositionItem.from_dict(positions_item_data) - - positions.append(positions_item) - - price = d.pop("price", UNSET) - - underlying_volatility = cast(list[float], d.pop("underlyingVolatility", UNSET)) - - historical_volatility_days = cast( - list[int], d.pop("historicalVolatilityDays", UNSET) - ) - - volatility_change = d.pop("volatilityChange", UNSET) - - analyze_positions_request = cls( - as_of_ts=as_of_ts, - evaluate_at_expiry=evaluate_at_expiry, - evaluate_at_strike=evaluate_at_strike, - evaluation_as_of=evaluation_as_of, - positions=positions, - price=price, - underlying_volatility=underlying_volatility, - historical_volatility_days=historical_volatility_days, - volatility_change=volatility_change, - ) - - return analyze_positions_request diff --git a/openapi_project/openapi_package/models/analyze_positions_response.py b/openapi_project/openapi_package/models/analyze_positions_response.py deleted file mode 100644 index 5b6fda4f2..000000000 --- a/openapi_project/openapi_package/models/analyze_positions_response.py +++ /dev/null @@ -1,81 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.position_analysis import PositionAnalysis - - -T = TypeVar("T", bound="AnalyzePositionsResponse") - - -@_attrs_define -class AnalyzePositionsResponse: - """ - Attributes: - analysis (Unset | PositionAnalysis): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - analysis: Unset | PositionAnalysis = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - analysis: Unset | dict[str, Any] = ( - UNSET if isinstance(self.analysis, Unset) else self.analysis.to_dict() - ) - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if analysis is not UNSET: - field_dict["analysis"] = analysis - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _analysis = d.pop("analysis", UNSET) - analysis: Unset | PositionAnalysis = ( - UNSET - if isinstance(_analysis, Unset) - else PositionAnalysis.from_dict(_analysis) - ) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - analyze_positions_response = cls( - analysis=analysis, - error_message=error_message, - status_code=status_code, - ) - - return analyze_positions_response diff --git a/openapi_project/openapi_package/models/calculate_margin_request.py b/openapi_project/openapi_package/models/calculate_margin_request.py deleted file mode 100644 index 2d560e9c2..000000000 --- a/openapi_project/openapi_package/models/calculate_margin_request.py +++ /dev/null @@ -1,122 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.margin_data_type import MarginDataType -from openapi_project.openapi_package.models.position_source import PositionSource -from openapi_project.openapi_package.models.risk_eval_mode import RiskEvalMode -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.calculate_margin_request_position_list import CalculateMarginRequestPositionList -T = TypeVar("T", bound="CalculateMarginRequest") - - -@_attrs_define -class CalculateMarginRequest: - """ - Attributes: - account_ids (Unset | list[int]): - margin_data_type (Unset | MarginDataType): - positions_by_account_id (Unset | list[CalculateMarginRequestPositionList]): - eval_mode (Unset | RiskEvalMode): - source (Unset | PositionSource): - """ - - account_ids: Unset | list[int] = UNSET - margin_data_type: Unset | MarginDataType = UNSET - positions_by_account_id: Unset | list[CalculateMarginRequestPositionList] = UNSET - eval_mode: Unset | RiskEvalMode = UNSET - source: Unset | PositionSource = UNSET - - def to_dict(self) -> dict[str, Any]: - account_ids: Unset | list[int] = UNSET - if not isinstance(self.account_ids, Unset): - account_ids = self.account_ids - - margin_data_type: Unset | str = ( - UNSET - if isinstance(self.margin_data_type, Unset) - else self.margin_data_type.value - ) - - positions_by_account_id: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.positions_by_account_id, Unset): - positions_by_account_id = [] - for positions_by_account_id_item_data in self.positions_by_account_id: - positions_by_account_id_item = ( - positions_by_account_id_item_data.to_dict() - ) - positions_by_account_id.append(positions_by_account_id_item) - - eval_mode: Unset | str = ( - UNSET if isinstance(self.eval_mode, Unset) else self.eval_mode.value - ) - - source: Unset | str = ( - UNSET if isinstance(self.source, Unset) else self.source.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_ids is not UNSET: - field_dict["accountIds"] = account_ids - if margin_data_type is not UNSET: - field_dict["marginDataType"] = margin_data_type - if positions_by_account_id is not UNSET: - field_dict["positionsByAccountId"] = positions_by_account_id - if eval_mode is not UNSET: - field_dict["evalMode"] = eval_mode - if source is not UNSET: - field_dict["source"] = source - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_ids = cast(list[int], d.pop("accountIds", UNSET)) - - _margin_data_type = d.pop("marginDataType", UNSET) - margin_data_type: Unset | MarginDataType = ( - UNSET - if isinstance(_margin_data_type, Unset) - else MarginDataType(_margin_data_type) - ) - - positions_by_account_id = [] - _positions_by_account_id = d.pop("positionsByAccountId", UNSET) - for positions_by_account_id_item_data in _positions_by_account_id or []: - positions_by_account_id_item = CalculateMarginRequestPositionList.from_dict( - positions_by_account_id_item_data - ) - - positions_by_account_id.append(positions_by_account_id_item) - - _eval_mode = d.pop("evalMode", UNSET) - eval_mode: Unset | RiskEvalMode = ( - UNSET if isinstance(_eval_mode, Unset) else RiskEvalMode(_eval_mode) - ) - - _source = d.pop("source", UNSET) - source: Unset | PositionSource = ( - UNSET if isinstance(_source, Unset) else PositionSource(_source) - ) - - calculate_margin_request = cls( - account_ids=account_ids, - margin_data_type=margin_data_type, - positions_by_account_id=positions_by_account_id, - eval_mode=eval_mode, - source=source, - ) - - return calculate_margin_request diff --git a/openapi_project/openapi_package/models/calculate_margin_request_position.py b/openapi_project/openapi_package/models/calculate_margin_request_position.py deleted file mode 100644 index 6a752729d..000000000 --- a/openapi_project/openapi_package/models/calculate_margin_request_position.py +++ /dev/null @@ -1,64 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="CalculateMarginRequestPosition") - - -@_attrs_define -class CalculateMarginRequestPosition: - """ - Attributes: - is_simulated_position (Unset | bool): - qty (Unset | float): - symbol (Unset | str): - """ - - is_simulated_position: Unset | bool = UNSET - qty: Unset | float = UNSET - symbol: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - is_simulated_position = self.is_simulated_position - - qty = self.qty - - symbol = self.symbol - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if is_simulated_position is not UNSET: - field_dict["isSimulatedPosition"] = is_simulated_position - if qty is not UNSET: - field_dict["qty"] = qty - if symbol is not UNSET: - field_dict["symbol"] = symbol - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - is_simulated_position = d.pop("isSimulatedPosition", UNSET) - - qty = d.pop("qty", UNSET) - - symbol = d.pop("symbol", UNSET) - - calculate_margin_request_position = cls( - is_simulated_position=is_simulated_position, - qty=qty, - symbol=symbol, - ) - - return calculate_margin_request_position diff --git a/openapi_project/openapi_package/models/calculate_margin_request_position_list.py b/openapi_project/openapi_package/models/calculate_margin_request_position_list.py deleted file mode 100644 index 15a9adca9..000000000 --- a/openapi_project/openapi_package/models/calculate_margin_request_position_list.py +++ /dev/null @@ -1,69 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.calculate_margin_request_position import CalculateMarginRequestPosition -T = TypeVar("T", bound="CalculateMarginRequestPositionList") - - -@_attrs_define -class CalculateMarginRequestPositionList: - """ - Attributes: - account_id (Unset | int): - positions (Unset | list[CalculateMarginRequestPosition]): - """ - - account_id: Unset | int = UNSET - positions: Unset | list[CalculateMarginRequestPosition] = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - positions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.positions, Unset): - positions = [] - for positions_item_data in self.positions: - positions_item = positions_item_data.to_dict() - positions.append(positions_item) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if positions is not UNSET: - field_dict["positions"] = positions - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - positions = [] - _positions = d.pop("positions", UNSET) - for positions_item_data in _positions or []: - positions_item = CalculateMarginRequestPosition.from_dict( - positions_item_data - ) - - positions.append(positions_item) - - calculate_margin_request_position_list = cls( - account_id=account_id, - positions=positions, - ) - - return calculate_margin_request_position_list diff --git a/openapi_project/openapi_package/models/calculate_margin_response.py b/openapi_project/openapi_package/models/calculate_margin_response.py deleted file mode 100644 index aa97a84db..000000000 --- a/openapi_project/openapi_package/models/calculate_margin_response.py +++ /dev/null @@ -1,84 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.margin_data import MarginData - - -T = TypeVar("T", bound="CalculateMarginResponse") - - -@_attrs_define -class CalculateMarginResponse: - """ - Attributes: - margin_data (Unset | list[MarginData]): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - margin_data: Unset | list[MarginData] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - margin_data: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.margin_data, Unset): - margin_data = [] - for margin_data_item_data in self.margin_data: - margin_data_item = margin_data_item_data.to_dict() - margin_data.append(margin_data_item) - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if margin_data is not UNSET: - field_dict["marginData"] = margin_data - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - margin_data = [] - _margin_data = d.pop("marginData", UNSET) - for margin_data_item_data in _margin_data or []: - margin_data_item = MarginData.from_dict(margin_data_item_data) - - margin_data.append(margin_data_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - calculate_margin_response = cls( - margin_data=margin_data, - error_message=error_message, - status_code=status_code, - ) - - return calculate_margin_response diff --git a/openapi_project/openapi_package/models/cancel_order_request.py b/openapi_project/openapi_package/models/cancel_order_request.py deleted file mode 100644 index d912ab3ef..000000000 --- a/openapi_project/openapi_package/models/cancel_order_request.py +++ /dev/null @@ -1,95 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.cancel_order_request_optional_data import CancelOrderRequestOptionalData -T = TypeVar("T", bound="CancelOrderRequest") - - -@_attrs_define -class CancelOrderRequest: - """ - Attributes: - cur_ord_id (Unset | str): - instructions (Unset | list[OrderInstruction]): - perm_ord_id (Unset | str): - optional_data (Unset | CancelOrderRequestOptionalData): - """ - - cur_ord_id: Unset | str = UNSET - instructions: Unset | list[OrderInstruction] = UNSET - perm_ord_id: Unset | str = UNSET - optional_data: Unset | CancelOrderRequestOptionalData = UNSET - - def to_dict(self) -> dict[str, Any]: - cur_ord_id = self.cur_ord_id - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - perm_ord_id = self.perm_ord_id - - optional_data: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.optional_data, Unset) - else self.optional_data.to_dict() - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if instructions is not UNSET: - field_dict["instructions"] = instructions - if perm_ord_id is not UNSET: - field_dict["permOrdId"] = perm_ord_id - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - cur_ord_id = d.pop("curOrdId", UNSET) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - perm_ord_id = d.pop("permOrdId", UNSET) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CancelOrderRequestOptionalData = ( - UNSET - if isinstance(_optional_data, Unset) - else CancelOrderRequestOptionalData.from_dict(_optional_data) - ) - - cancel_order_request = cls( - cur_ord_id=cur_ord_id, - instructions=instructions, - perm_ord_id=perm_ord_id, - optional_data=optional_data, - ) - - return cancel_order_request diff --git a/openapi_project/openapi_package/models/cancel_order_request_optional_data.py b/openapi_project/openapi_package/models/cancel_order_request_optional_data.py deleted file mode 100644 index c4334574c..000000000 --- a/openapi_project/openapi_package/models/cancel_order_request_optional_data.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="CancelOrderRequestOptionalData") - - -@_attrs_define -class CancelOrderRequestOptionalData: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - cancel_order_request_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - cancel_order_request_optional_data.additional_properties = additional_properties - return cancel_order_request_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/cancel_order_response.py b/openapi_project/openapi_package/models/cancel_order_response.py deleted file mode 100644 index 70831055f..000000000 --- a/openapi_project/openapi_package/models/cancel_order_response.py +++ /dev/null @@ -1,79 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="CancelOrderResponse") - - -@_attrs_define -class CancelOrderResponse: - """ - Attributes: - submit_ts (Unset | str): - req_ord_id (Unset | str): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - submit_ts: Unset | str = UNSET - req_ord_id: Unset | str = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - submit_ts = self.submit_ts - - req_ord_id = self.req_ord_id - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if submit_ts is not UNSET: - field_dict["submitTs"] = submit_ts - if req_ord_id is not UNSET: - field_dict["reqOrdId"] = req_ord_id - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - submit_ts = d.pop("submitTs", UNSET) - - req_ord_id = d.pop("reqOrdId", UNSET) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - cancel_order_response = cls( - submit_ts=submit_ts, - req_ord_id=req_ord_id, - error_message=error_message, - status_code=status_code, - ) - - return cancel_order_response diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py deleted file mode 100644 index dcc49bbe4..000000000 --- a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request.py +++ /dev/null @@ -1,223 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_optional_data import CancelReplaceMultiLegOrderRequestOptionalData - from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_algo import CancelReplaceMultiLegOrderRequestAlgo - from openapi_project.openapi_package.models.cancel_replace_multi_leg_order_request_market_condition import CancelReplaceMultiLegOrderRequestMarketCondition -T = TypeVar("T", bound="CancelReplaceMultiLegOrderRequest") - - -@_attrs_define -class CancelReplaceMultiLegOrderRequest: - """ - Attributes: - aux_price (Unset | float): - clearing_info (Unset | ClearingInfo): - cur_ord_id (Unset | str): - instructions (Unset | list[OrderInstruction]): - ord_type (Unset | OrdType): - perm_ord_id (Unset | str): - price (Unset | float): - qty (Unset | float): - tag (Unset | str): - text (Unset | str): - tif (Unset | Tif): - algo (Unset | CancelReplaceMultiLegOrderRequestAlgo): - market_condition (Unset | CancelReplaceMultiLegOrderRequestMarketCondition): - optional_data (Unset | CancelReplaceMultiLegOrderRequestOptionalData): - """ - - aux_price: Unset | float = UNSET - clearing_info: Unset | ClearingInfo = UNSET - cur_ord_id: Unset | str = UNSET - instructions: Unset | list[OrderInstruction] = UNSET - ord_type: Unset | OrdType = UNSET - perm_ord_id: Unset | str = UNSET - price: Unset | float = UNSET - qty: Unset | float = UNSET - tag: Unset | str = UNSET - text: Unset | str = UNSET - tif: Unset | Tif = UNSET - algo: Unset | CancelReplaceMultiLegOrderRequestAlgo = UNSET - market_condition: Unset | CancelReplaceMultiLegOrderRequestMarketCondition = UNSET - optional_data: Unset | CancelReplaceMultiLegOrderRequestOptionalData = UNSET - - def to_dict(self) -> dict[str, Any]: - aux_price = self.aux_price - - clearing_info: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.clearing_info, Unset) - else self.clearing_info.to_dict() - ) - - cur_ord_id = self.cur_ord_id - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - ord_type: Unset | str = ( - UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value - ) - - perm_ord_id = self.perm_ord_id - - price = self.price - - qty = self.qty - - tag = self.tag - - text = self.text - - tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value - - algo: Unset | dict[str, Any] = ( - UNSET if isinstance(self.algo, Unset) else self.algo.to_dict() - ) - - market_condition: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.market_condition, Unset) - else self.market_condition.to_dict() - ) - - optional_data: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.optional_data, Unset) - else self.optional_data.to_dict() - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if aux_price is not UNSET: - field_dict["auxPrice"] = aux_price - if clearing_info is not UNSET: - field_dict["clearingInfo"] = clearing_info - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if instructions is not UNSET: - field_dict["instructions"] = instructions - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if perm_ord_id is not UNSET: - field_dict["permOrdId"] = perm_ord_id - if price is not UNSET: - field_dict["price"] = price - if qty is not UNSET: - field_dict["qty"] = qty - if tag is not UNSET: - field_dict["tag"] = tag - if text is not UNSET: - field_dict["text"] = text - if tif is not UNSET: - field_dict["tif"] = tif - if algo is not UNSET: - field_dict["algo"] = algo - if market_condition is not UNSET: - field_dict["marketCondition"] = market_condition - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - aux_price = d.pop("auxPrice", UNSET) - - _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo = ( - UNSET - if isinstance(_clearing_info, Unset) - else ClearingInfo.from_dict(_clearing_info) - ) - - cur_ord_id = d.pop("curOrdId", UNSET) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType = ( - UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) - ) - - perm_ord_id = d.pop("permOrdId", UNSET) - - price = d.pop("price", UNSET) - - qty = d.pop("qty", UNSET) - - tag = d.pop("tag", UNSET) - - text = d.pop("text", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) - - _algo = d.pop("algo", UNSET) - algo: Unset | CancelReplaceMultiLegOrderRequestAlgo = ( - UNSET - if isinstance(_algo, Unset) - else CancelReplaceMultiLegOrderRequestAlgo.from_dict(_algo) - ) - - _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | CancelReplaceMultiLegOrderRequestMarketCondition = ( - UNSET - if isinstance(_market_condition, Unset) - else CancelReplaceMultiLegOrderRequestMarketCondition.from_dict( - _market_condition - ) - ) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CancelReplaceMultiLegOrderRequestOptionalData = ( - UNSET - if isinstance(_optional_data, Unset) - else CancelReplaceMultiLegOrderRequestOptionalData.from_dict(_optional_data) - ) - - cancel_replace_multi_leg_order_request = cls( - aux_price=aux_price, - clearing_info=clearing_info, - cur_ord_id=cur_ord_id, - instructions=instructions, - ord_type=ord_type, - perm_ord_id=perm_ord_id, - price=price, - qty=qty, - tag=tag, - text=text, - tif=tif, - algo=algo, - market_condition=market_condition, - optional_data=optional_data, - ) - - return cancel_replace_multi_leg_order_request diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py deleted file mode 100644 index d11700d2c..000000000 --- a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_algo.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="CancelReplaceMultiLegOrderRequestAlgo") - - -@_attrs_define -class CancelReplaceMultiLegOrderRequestAlgo: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - cancel_replace_multi_leg_order_request_algo = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - cancel_replace_multi_leg_order_request_algo.additional_properties = ( - additional_properties - ) - return cancel_replace_multi_leg_order_request_algo - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py deleted file mode 100644 index 39a910643..000000000 --- a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_market_condition.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="CancelReplaceMultiLegOrderRequestMarketCondition") - - -@_attrs_define -class CancelReplaceMultiLegOrderRequestMarketCondition: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - cancel_replace_multi_leg_order_request_market_condition = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - cancel_replace_multi_leg_order_request_market_condition.additional_properties = ( - additional_properties - ) - return cancel_replace_multi_leg_order_request_market_condition - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py deleted file mode 100644 index 471afa52c..000000000 --- a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_request_optional_data.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="CancelReplaceMultiLegOrderRequestOptionalData") - - -@_attrs_define -class CancelReplaceMultiLegOrderRequestOptionalData: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - cancel_replace_multi_leg_order_request_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - cancel_replace_multi_leg_order_request_optional_data.additional_properties = ( - additional_properties - ) - return cancel_replace_multi_leg_order_request_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py b/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py deleted file mode 100644 index 3c5681f6c..000000000 --- a/openapi_project/openapi_package/models/cancel_replace_multi_leg_order_response.py +++ /dev/null @@ -1,79 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="CancelReplaceMultiLegOrderResponse") - - -@_attrs_define -class CancelReplaceMultiLegOrderResponse: - """ - Attributes: - submit_ts (Unset | str): - req_ord_id (Unset | str): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - submit_ts: Unset | str = UNSET - req_ord_id: Unset | str = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - submit_ts = self.submit_ts - - req_ord_id = self.req_ord_id - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if submit_ts is not UNSET: - field_dict["submitTs"] = submit_ts - if req_ord_id is not UNSET: - field_dict["reqOrdId"] = req_ord_id - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - submit_ts = d.pop("submitTs", UNSET) - - req_ord_id = d.pop("reqOrdId", UNSET) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - cancel_replace_multi_leg_order_response = cls( - submit_ts=submit_ts, - req_ord_id=req_ord_id, - error_message=error_message, - status_code=status_code, - ) - - return cancel_replace_multi_leg_order_response diff --git a/openapi_project/openapi_package/models/cancel_replace_order_request.py b/openapi_project/openapi_package/models/cancel_replace_order_request.py deleted file mode 100644 index 36a3fc000..000000000 --- a/openapi_project/openapi_package/models/cancel_replace_order_request.py +++ /dev/null @@ -1,205 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.cancel_replace_order_request_market_condition import CancelReplaceOrderRequestMarketCondition - from openapi_project.openapi_package.models.cancel_replace_order_request_optional_data import CancelReplaceOrderRequestOptionalData - from openapi_project.openapi_package.models.cancel_replace_order_request_algo import CancelReplaceOrderRequestAlgo - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - - -T = TypeVar("T", bound="CancelReplaceOrderRequest") - - -@_attrs_define -class CancelReplaceOrderRequest: - """ - Attributes: - aux_price (Unset | float): - clearing_info (Unset | ClearingInfo): - cur_ord_id (Unset | str): - instructions (Unset | list[OrderInstruction]): - ord_type (Unset | OrdType): - perm_ord_id (Unset | str): - price (Unset | float): - qty (Unset | float): - tif (Unset | Tif): - algo (Unset | CancelReplaceOrderRequestAlgo): - market_condition (Unset | CancelReplaceOrderRequestMarketCondition): - optional_data (Unset | CancelReplaceOrderRequestOptionalData): - """ - - aux_price: Unset | float = UNSET - clearing_info: Unset | ClearingInfo = UNSET - cur_ord_id: Unset | str = UNSET - instructions: Unset | list[OrderInstruction] = UNSET - ord_type: Unset | OrdType = UNSET - perm_ord_id: Unset | str = UNSET - price: Unset | float = UNSET - qty: Unset | float = UNSET - tif: Unset | Tif = UNSET - algo: Unset | CancelReplaceOrderRequestAlgo = UNSET - market_condition: Unset | CancelReplaceOrderRequestMarketCondition = UNSET - optional_data: Unset | CancelReplaceOrderRequestOptionalData = UNSET - - def to_dict(self) -> dict[str, Any]: - aux_price = self.aux_price - - clearing_info: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.clearing_info, Unset) - else self.clearing_info.to_dict() - ) - - cur_ord_id = self.cur_ord_id - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - ord_type: Unset | str = ( - UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value - ) - - perm_ord_id = self.perm_ord_id - - price = self.price - - qty = self.qty - - tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value - - algo: Unset | dict[str, Any] = ( - UNSET if isinstance(self.algo, Unset) else self.algo.to_dict() - ) - - market_condition: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.market_condition, Unset) - else self.market_condition.to_dict() - ) - - optional_data: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.optional_data, Unset) - else self.optional_data.to_dict() - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if aux_price is not UNSET: - field_dict["auxPrice"] = aux_price - if clearing_info is not UNSET: - field_dict["clearingInfo"] = clearing_info - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if instructions is not UNSET: - field_dict["instructions"] = instructions - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if perm_ord_id is not UNSET: - field_dict["permOrdId"] = perm_ord_id - if price is not UNSET: - field_dict["price"] = price - if qty is not UNSET: - field_dict["qty"] = qty - if tif is not UNSET: - field_dict["tif"] = tif - if algo is not UNSET: - field_dict["algo"] = algo - if market_condition is not UNSET: - field_dict["marketCondition"] = market_condition - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - aux_price = d.pop("auxPrice", UNSET) - - _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo = ( - UNSET - if isinstance(_clearing_info, Unset) - else ClearingInfo.from_dict(_clearing_info) - ) - - cur_ord_id = d.pop("curOrdId", UNSET) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType = ( - UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) - ) - - perm_ord_id = d.pop("permOrdId", UNSET) - - price = d.pop("price", UNSET) - - qty = d.pop("qty", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) - - _algo = d.pop("algo", UNSET) - algo: Unset | CancelReplaceOrderRequestAlgo = ( - UNSET - if isinstance(_algo, Unset) - else CancelReplaceOrderRequestAlgo.from_dict(_algo) - ) - - _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | CancelReplaceOrderRequestMarketCondition = ( - UNSET - if isinstance(_market_condition, Unset) - else CancelReplaceOrderRequestMarketCondition.from_dict(_market_condition) - ) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CancelReplaceOrderRequestOptionalData = ( - UNSET - if isinstance(_optional_data, Unset) - else CancelReplaceOrderRequestOptionalData.from_dict(_optional_data) - ) - - cancel_replace_order_request = cls( - aux_price=aux_price, - clearing_info=clearing_info, - cur_ord_id=cur_ord_id, - instructions=instructions, - ord_type=ord_type, - perm_ord_id=perm_ord_id, - price=price, - qty=qty, - tif=tif, - algo=algo, - market_condition=market_condition, - optional_data=optional_data, - ) - - return cancel_replace_order_request diff --git a/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py b/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py deleted file mode 100644 index f7cdf0309..000000000 --- a/openapi_project/openapi_package/models/cancel_replace_order_request_algo.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="CancelReplaceOrderRequestAlgo") - - -@_attrs_define -class CancelReplaceOrderRequestAlgo: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - cancel_replace_order_request_algo = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - cancel_replace_order_request_algo.additional_properties = additional_properties - return cancel_replace_order_request_algo - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py b/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py deleted file mode 100644 index 65e766b2c..000000000 --- a/openapi_project/openapi_package/models/cancel_replace_order_request_market_condition.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="CancelReplaceOrderRequestMarketCondition") - - -@_attrs_define -class CancelReplaceOrderRequestMarketCondition: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - cancel_replace_order_request_market_condition = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - cancel_replace_order_request_market_condition.additional_properties = ( - additional_properties - ) - return cancel_replace_order_request_market_condition - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py b/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py deleted file mode 100644 index c7156af58..000000000 --- a/openapi_project/openapi_package/models/cancel_replace_order_request_optional_data.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="CancelReplaceOrderRequestOptionalData") - - -@_attrs_define -class CancelReplaceOrderRequestOptionalData: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - cancel_replace_order_request_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - cancel_replace_order_request_optional_data.additional_properties = ( - additional_properties - ) - return cancel_replace_order_request_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/cancel_replace_order_response.py b/openapi_project/openapi_package/models/cancel_replace_order_response.py deleted file mode 100644 index 9f90052c4..000000000 --- a/openapi_project/openapi_package/models/cancel_replace_order_response.py +++ /dev/null @@ -1,79 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="CancelReplaceOrderResponse") - - -@_attrs_define -class CancelReplaceOrderResponse: - """ - Attributes: - submit_ts (Unset | str): - req_ord_id (Unset | str): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - submit_ts: Unset | str = UNSET - req_ord_id: Unset | str = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - submit_ts = self.submit_ts - - req_ord_id = self.req_ord_id - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if submit_ts is not UNSET: - field_dict["submitTs"] = submit_ts - if req_ord_id is not UNSET: - field_dict["reqOrdId"] = req_ord_id - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - submit_ts = d.pop("submitTs", UNSET) - - req_ord_id = d.pop("reqOrdId", UNSET) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - cancel_replace_order_response = cls( - submit_ts=submit_ts, - req_ord_id=req_ord_id, - error_message=error_message, - status_code=status_code, - ) - - return cancel_replace_order_response diff --git a/openapi_project/openapi_package/models/capacity_code.py b/openapi_project/openapi_package/models/capacity_code.py deleted file mode 100644 index db23b3407..000000000 --- a/openapi_project/openapi_package/models/capacity_code.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class CapacityCode(str, Enum): - CAPACITY_CODE_AGENT = "CAPACITY_CODE_AGENT" - CAPACITY_CODE_NOT_SET = "CAPACITY_CODE_NOT_SET" - CAPACITY_CODE_PRINCIPAL = "CAPACITY_CODE_PRINCIPAL" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/claim_type.py b/openapi_project/openapi_package/models/claim_type.py deleted file mode 100644 index a4ac678ab..000000000 --- a/openapi_project/openapi_package/models/claim_type.py +++ /dev/null @@ -1,11 +0,0 @@ -from enum import Enum - - -class ClaimType(str, Enum): - CLAIM_TYPE_FUNCTIONALITY_PERMISSION = "CLAIM_TYPE_FUNCTIONALITY_PERMISSION" - CLAIM_TYPE_SYSOP_PERMISSION = "CLAIM_TYPE_SYSOP_PERMISSION" - CLAIM_TYPE_UI_MODULE_PERMISSION = "CLAIM_TYPE_UI_MODULE_PERMISSION" - CLAIM_TYPE_UNDEFINED = "CLAIM_TYPE_UNDEFINED" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/clearing_info.py b/openapi_project/openapi_package/models/clearing_info.py deleted file mode 100644 index 20bb7150e..000000000 --- a/openapi_project/openapi_package/models/clearing_info.py +++ /dev/null @@ -1,224 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.capacity_code import CapacityCode -from openapi_project.openapi_package.models.clearing_range import ClearingRange -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="ClearingInfo") - - -@_attrs_define -class ClearingInfo: - """ - Attributes: - clearing_optional_data (Unset | str): - cti_code (Unset | str): - efid (Unset | str): - eq_capacity (Unset | CapacityCode): - eq_clearing_account (Unset | str): - eq_give_up (Unset | str): - eq_mpid (Unset | str): - fut_clearing_account (Unset | str): - fut_clearing_range (Unset | ClearingRange): - fut_cmta (Unset | str): - fut_exec_broker (Unset | str): - locate_id (Unset | str): - opt_clearing_account (Unset | str): - opt_clearing_range (Unset | ClearingRange): - opt_cmta (Unset | str): - opt_give_up (Unset | str): - tag1 (Unset | str): - billing_code (Unset | str): - """ - - clearing_optional_data: Unset | str = UNSET - cti_code: Unset | str = UNSET - efid: Unset | str = UNSET - eq_capacity: Unset | CapacityCode = UNSET - eq_clearing_account: Unset | str = UNSET - eq_give_up: Unset | str = UNSET - eq_mpid: Unset | str = UNSET - fut_clearing_account: Unset | str = UNSET - fut_clearing_range: Unset | ClearingRange = UNSET - fut_cmta: Unset | str = UNSET - fut_exec_broker: Unset | str = UNSET - locate_id: Unset | str = UNSET - opt_clearing_account: Unset | str = UNSET - opt_clearing_range: Unset | ClearingRange = UNSET - opt_cmta: Unset | str = UNSET - opt_give_up: Unset | str = UNSET - tag1: Unset | str = UNSET - billing_code: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - clearing_optional_data = self.clearing_optional_data - - cti_code = self.cti_code - - efid = self.efid - - eq_capacity: Unset | str = ( - UNSET if isinstance(self.eq_capacity, Unset) else self.eq_capacity.value - ) - - eq_clearing_account = self.eq_clearing_account - - eq_give_up = self.eq_give_up - - eq_mpid = self.eq_mpid - - fut_clearing_account = self.fut_clearing_account - - fut_clearing_range: Unset | str = ( - UNSET - if isinstance(self.fut_clearing_range, Unset) - else self.fut_clearing_range.value - ) - - fut_cmta = self.fut_cmta - - fut_exec_broker = self.fut_exec_broker - - locate_id = self.locate_id - - opt_clearing_account = self.opt_clearing_account - - opt_clearing_range: Unset | str = ( - UNSET - if isinstance(self.opt_clearing_range, Unset) - else self.opt_clearing_range.value - ) - - opt_cmta = self.opt_cmta - - opt_give_up = self.opt_give_up - - tag1 = self.tag1 - - billing_code = self.billing_code - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if clearing_optional_data is not UNSET: - field_dict["clearingOptionalData"] = clearing_optional_data - if cti_code is not UNSET: - field_dict["ctiCode"] = cti_code - if efid is not UNSET: - field_dict["efid"] = efid - if eq_capacity is not UNSET: - field_dict["eqCapacity"] = eq_capacity - if eq_clearing_account is not UNSET: - field_dict["eqClearingAccount"] = eq_clearing_account - if eq_give_up is not UNSET: - field_dict["eqGiveUp"] = eq_give_up - if eq_mpid is not UNSET: - field_dict["eqMpid"] = eq_mpid - if fut_clearing_account is not UNSET: - field_dict["futClearingAccount"] = fut_clearing_account - if fut_clearing_range is not UNSET: - field_dict["futClearingRange"] = fut_clearing_range - if fut_cmta is not UNSET: - field_dict["futCmta"] = fut_cmta - if fut_exec_broker is not UNSET: - field_dict["futExecBroker"] = fut_exec_broker - if locate_id is not UNSET: - field_dict["locateId"] = locate_id - if opt_clearing_account is not UNSET: - field_dict["optClearingAccount"] = opt_clearing_account - if opt_clearing_range is not UNSET: - field_dict["optClearingRange"] = opt_clearing_range - if opt_cmta is not UNSET: - field_dict["optCmta"] = opt_cmta - if opt_give_up is not UNSET: - field_dict["optGiveUp"] = opt_give_up - if tag1 is not UNSET: - field_dict["tag1"] = tag1 - if billing_code is not UNSET: - field_dict["billingCode"] = billing_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - clearing_optional_data = d.pop("clearingOptionalData", UNSET) - - cti_code = d.pop("ctiCode", UNSET) - - efid = d.pop("efid", UNSET) - - _eq_capacity = d.pop("eqCapacity", UNSET) - eq_capacity: Unset | CapacityCode = ( - UNSET if isinstance(_eq_capacity, Unset) else CapacityCode(_eq_capacity) - ) - - eq_clearing_account = d.pop("eqClearingAccount", UNSET) - - eq_give_up = d.pop("eqGiveUp", UNSET) - - eq_mpid = d.pop("eqMpid", UNSET) - - fut_clearing_account = d.pop("futClearingAccount", UNSET) - - _fut_clearing_range = d.pop("futClearingRange", UNSET) - fut_clearing_range: Unset | ClearingRange = ( - UNSET - if isinstance(_fut_clearing_range, Unset) - else ClearingRange(_fut_clearing_range) - ) - - fut_cmta = d.pop("futCmta", UNSET) - - fut_exec_broker = d.pop("futExecBroker", UNSET) - - locate_id = d.pop("locateId", UNSET) - - opt_clearing_account = d.pop("optClearingAccount", UNSET) - - _opt_clearing_range = d.pop("optClearingRange", UNSET) - opt_clearing_range: Unset | ClearingRange = ( - UNSET - if isinstance(_opt_clearing_range, Unset) - else ClearingRange(_opt_clearing_range) - ) - - opt_cmta = d.pop("optCmta", UNSET) - - opt_give_up = d.pop("optGiveUp", UNSET) - - tag1 = d.pop("tag1", UNSET) - - billing_code = d.pop("billingCode", UNSET) - - clearing_info = cls( - clearing_optional_data=clearing_optional_data, - cti_code=cti_code, - efid=efid, - eq_capacity=eq_capacity, - eq_clearing_account=eq_clearing_account, - eq_give_up=eq_give_up, - eq_mpid=eq_mpid, - fut_clearing_account=fut_clearing_account, - fut_clearing_range=fut_clearing_range, - fut_cmta=fut_cmta, - fut_exec_broker=fut_exec_broker, - locate_id=locate_id, - opt_clearing_account=opt_clearing_account, - opt_clearing_range=opt_clearing_range, - opt_cmta=opt_cmta, - opt_give_up=opt_give_up, - tag1=tag1, - billing_code=billing_code, - ) - - return clearing_info diff --git a/openapi_project/openapi_package/models/clearing_range.py b/openapi_project/openapi_package/models/clearing_range.py deleted file mode 100644 index a4f20d190..000000000 --- a/openapi_project/openapi_package/models/clearing_range.py +++ /dev/null @@ -1,21 +0,0 @@ -from enum import Enum - - -class ClearingRange(str, Enum): - CLEARING_RANGE_AWAY_MARKET_MAKER = "CLEARING_RANGE_AWAY_MARKET_MAKER" - CLEARING_RANGE_BROKER_DEALER = "CLEARING_RANGE_BROKER_DEALER" - CLEARING_RANGE_BROKER_DEALER_CUSTOMER = "CLEARING_RANGE_BROKER_DEALER_CUSTOMER" - CLEARING_RANGE_BROKER_DEALER_FIRM = "CLEARING_RANGE_BROKER_DEALER_FIRM" - CLEARING_RANGE_CUSTOMER = "CLEARING_RANGE_CUSTOMER" - CLEARING_RANGE_FIRM = "CLEARING_RANGE_FIRM" - CLEARING_RANGE_JOINT_BACK_OFFICE = "CLEARING_RANGE_JOINT_BACK_OFFICE" - CLEARING_RANGE_MARKET_MAKER = "CLEARING_RANGE_MARKET_MAKER" - CLEARING_RANGE_NON_TPH_AFFILIATE = "CLEARING_RANGE_NON_TPH_AFFILIATE" - CLEARING_RANGE_NON_TPH_BROKER_DEALER = "CLEARING_RANGE_NON_TPH_BROKER_DEALER" - CLEARING_RANGE_NOTSET = "CLEARING_RANGE_NOTSET" - CLEARING_RANGE_PROFESSIONAL_CUSTOMER = "CLEARING_RANGE_PROFESSIONAL_CUSTOMER" - CLEARING_RANGE_PROPRIETARY_CUSTOMER = "CLEARING_RANGE_PROPRIETARY_CUSTOMER" - CLEARING_RANGE_PROPRIETARY_FIRM = "CLEARING_RANGE_PROPRIETARY_FIRM" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/country.py b/openapi_project/openapi_package/models/country.py deleted file mode 100644 index a29ba6b7a..000000000 --- a/openapi_project/openapi_package/models/country.py +++ /dev/null @@ -1,14 +0,0 @@ -from enum import Enum - - -class Country(str, Enum): - COUNTRY_CHINA = "COUNTRY_CHINA" - COUNTRY_GERMANY = "COUNTRY_GERMANY" - COUNTRY_INDIA = "COUNTRY_INDIA" - COUNTRY_JAPAN = "COUNTRY_JAPAN" - COUNTRY_UNITED_KINGDOM = "COUNTRY_UNITED_KINGDOM" - COUNTRY_UNITED_STATES = "COUNTRY_UNITED_STATES" - COUNTRY_UNKNOWN = "COUNTRY_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/create_flex_option_request.py b/openapi_project/openapi_package/models/create_flex_option_request.py deleted file mode 100644 index 370b48988..000000000 --- a/openapi_project/openapi_package/models/create_flex_option_request.py +++ /dev/null @@ -1,188 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.flex_settlement_type import FlexSettlementType -from openapi_project.openapi_package.models.option_exercise_style import OptionExerciseStyle -from openapi_project.openapi_package.models.option_series_product_type import OptionSeriesProductType -from openapi_project.openapi_package.models.put_call import PutCall -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.date import Date - - -T = TypeVar("T", bound="CreateFlexOptionRequest") - - -@_attrs_define -class CreateFlexOptionRequest: - """ - Attributes: - root_symbol (Unset | str): - settlement_type (Unset | FlexSettlementType): - expiration_dt (Unset | Date): - strike (Unset | float): - put_call (Unset | PutCall): - product_type (Unset | OptionSeriesProductType): - exercise_style (Unset | OptionExerciseStyle): - creation_dt (Unset | Date): - observation_day (Unset | int): - is_percentage_priced (Unset | bool): - cap_percentage (Unset | float): - """ - - root_symbol: Unset | str = UNSET - settlement_type: Unset | FlexSettlementType = UNSET - expiration_dt: Unset | Date = UNSET - strike: Unset | float = UNSET - put_call: Unset | PutCall = UNSET - product_type: Unset | OptionSeriesProductType = UNSET - exercise_style: Unset | OptionExerciseStyle = UNSET - creation_dt: Unset | Date = UNSET - observation_day: Unset | int = UNSET - is_percentage_priced: Unset | bool = UNSET - cap_percentage: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - root_symbol = self.root_symbol - - settlement_type: Unset | str = ( - UNSET - if isinstance(self.settlement_type, Unset) - else self.settlement_type.value - ) - - expiration_dt: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.expiration_dt, Unset) - else self.expiration_dt.to_dict() - ) - - strike = self.strike - - put_call: Unset | str = ( - UNSET if isinstance(self.put_call, Unset) else self.put_call.value - ) - - product_type: Unset | str = ( - UNSET if isinstance(self.product_type, Unset) else self.product_type.value - ) - - exercise_style: Unset | str = ( - UNSET - if isinstance(self.exercise_style, Unset) - else self.exercise_style.value - ) - - creation_dt: Unset | dict[str, Any] = ( - UNSET if isinstance(self.creation_dt, Unset) else self.creation_dt.to_dict() - ) - - observation_day = self.observation_day - - is_percentage_priced = self.is_percentage_priced - - cap_percentage = self.cap_percentage - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if root_symbol is not UNSET: - field_dict["rootSymbol"] = root_symbol - if settlement_type is not UNSET: - field_dict["settlementType"] = settlement_type - if expiration_dt is not UNSET: - field_dict["expirationDt"] = expiration_dt - if strike is not UNSET: - field_dict["strike"] = strike - if put_call is not UNSET: - field_dict["putCall"] = put_call - if product_type is not UNSET: - field_dict["productType"] = product_type - if exercise_style is not UNSET: - field_dict["exerciseStyle"] = exercise_style - if creation_dt is not UNSET: - field_dict["creationDt"] = creation_dt - if observation_day is not UNSET: - field_dict["observationDay"] = observation_day - if is_percentage_priced is not UNSET: - field_dict["isPercentagePriced"] = is_percentage_priced - if cap_percentage is not UNSET: - field_dict["capPercentage"] = cap_percentage - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - root_symbol = d.pop("rootSymbol", UNSET) - - _settlement_type = d.pop("settlementType", UNSET) - settlement_type: Unset | FlexSettlementType = ( - UNSET - if isinstance(_settlement_type, Unset) - else FlexSettlementType(_settlement_type) - ) - - _expiration_dt = d.pop("expirationDt", UNSET) - expiration_dt: Unset | Date = ( - UNSET - if isinstance(_expiration_dt, Unset) - else Date.from_dict(_expiration_dt) - ) - - strike = d.pop("strike", UNSET) - - _put_call = d.pop("putCall", UNSET) - put_call: Unset | PutCall = ( - UNSET if isinstance(_put_call, Unset) else PutCall(_put_call) - ) - - _product_type = d.pop("productType", UNSET) - product_type: Unset | OptionSeriesProductType = ( - UNSET - if isinstance(_product_type, Unset) - else OptionSeriesProductType(_product_type) - ) - - _exercise_style = d.pop("exerciseStyle", UNSET) - exercise_style: Unset | OptionExerciseStyle = ( - UNSET - if isinstance(_exercise_style, Unset) - else OptionExerciseStyle(_exercise_style) - ) - - _creation_dt = d.pop("creationDt", UNSET) - creation_dt: Unset | Date = ( - UNSET if isinstance(_creation_dt, Unset) else Date.from_dict(_creation_dt) - ) - - observation_day = d.pop("observationDay", UNSET) - - is_percentage_priced = d.pop("isPercentagePriced", UNSET) - - cap_percentage = d.pop("capPercentage", UNSET) - - create_flex_option_request = cls( - root_symbol=root_symbol, - settlement_type=settlement_type, - expiration_dt=expiration_dt, - strike=strike, - put_call=put_call, - product_type=product_type, - exercise_style=exercise_style, - creation_dt=creation_dt, - observation_day=observation_day, - is_percentage_priced=is_percentage_priced, - cap_percentage=cap_percentage, - ) - - return create_flex_option_request diff --git a/openapi_project/openapi_package/models/create_flex_option_response.py b/openapi_project/openapi_package/models/create_flex_option_response.py deleted file mode 100644 index 586fb83e2..000000000 --- a/openapi_project/openapi_package/models/create_flex_option_response.py +++ /dev/null @@ -1,81 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.flex_option import FlexOption - - -T = TypeVar("T", bound="CreateFlexOptionResponse") - - -@_attrs_define -class CreateFlexOptionResponse: - """ - Attributes: - flex_option (Unset | FlexOption): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - flex_option: Unset | FlexOption = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - flex_option: Unset | dict[str, Any] = ( - UNSET if isinstance(self.flex_option, Unset) else self.flex_option.to_dict() - ) - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if flex_option is not UNSET: - field_dict["flexOption"] = flex_option - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _flex_option = d.pop("flexOption", UNSET) - flex_option: Unset | FlexOption = ( - UNSET - if isinstance(_flex_option, Unset) - else FlexOption.from_dict(_flex_option) - ) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - create_flex_option_response = cls( - flex_option=flex_option, - error_message=error_message, - status_code=status_code, - ) - - return create_flex_option_response diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py deleted file mode 100644 index a23c71e3d..000000000 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation.py +++ /dev/null @@ -1,153 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.cross_side_type import CrossSideType -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.create_multi_leg_order_leg import CreateMultiLegOrderLeg - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation_optional_data import CreateMultiLegOrderCrossAllocationOptionalData - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - - -T = TypeVar("T", bound="CreateMultiLegOrderCrossAllocation") - - -@_attrs_define -class CreateMultiLegOrderCrossAllocation: - """ - Attributes: - account_id (Unset | int): - clearing_info (Unset | ClearingInfo): - instructions (Unset | list[OrderInstruction]): - legs (Unset | list[CreateMultiLegOrderLeg]): - optional_data (Unset | CreateMultiLegOrderCrossAllocationOptionalData): - qty (Unset | float): - side_type (Unset | CrossSideType): - """ - - account_id: Unset | int = UNSET - clearing_info: Unset | ClearingInfo = UNSET - instructions: Unset | list[OrderInstruction] = UNSET - legs: Unset | list[CreateMultiLegOrderLeg] = UNSET - optional_data: Unset | CreateMultiLegOrderCrossAllocationOptionalData = UNSET - qty: Unset | float = UNSET - side_type: Unset | CrossSideType = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - clearing_info: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.clearing_info, Unset) - else self.clearing_info.to_dict() - ) - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - legs: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.legs, Unset): - legs = [] - for legs_item_data in self.legs: - legs_item = legs_item_data.to_dict() - legs.append(legs_item) - - optional_data: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.optional_data, Unset) - else self.optional_data.to_dict() - ) - - qty = self.qty - - side_type: Unset | str = ( - UNSET if isinstance(self.side_type, Unset) else self.side_type.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if clearing_info is not UNSET: - field_dict["clearingInfo"] = clearing_info - if instructions is not UNSET: - field_dict["instructions"] = instructions - if legs is not UNSET: - field_dict["legs"] = legs - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if qty is not UNSET: - field_dict["qty"] = qty - if side_type is not UNSET: - field_dict["sideType"] = side_type - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo = ( - UNSET - if isinstance(_clearing_info, Unset) - else ClearingInfo.from_dict(_clearing_info) - ) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - legs = [] - _legs = d.pop("legs", UNSET) - for legs_item_data in _legs or []: - legs_item = CreateMultiLegOrderLeg.from_dict(legs_item_data) - - legs.append(legs_item) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CreateMultiLegOrderCrossAllocationOptionalData = ( - UNSET - if isinstance(_optional_data, Unset) - else CreateMultiLegOrderCrossAllocationOptionalData.from_dict( - _optional_data - ) - ) - - qty = d.pop("qty", UNSET) - - _side_type = d.pop("sideType", UNSET) - side_type: Unset | CrossSideType = ( - UNSET if isinstance(_side_type, Unset) else CrossSideType(_side_type) - ) - - create_multi_leg_order_cross_allocation = cls( - account_id=account_id, - clearing_info=clearing_info, - instructions=instructions, - legs=legs, - optional_data=optional_data, - qty=qty, - side_type=side_type, - ) - - return create_multi_leg_order_cross_allocation diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py deleted file mode 100644 index a33751d11..000000000 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_allocation_optional_data.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="CreateMultiLegOrderCrossAllocationOptionalData") - - -@_attrs_define -class CreateMultiLegOrderCrossAllocationOptionalData: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_multi_leg_order_cross_allocation_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_multi_leg_order_cross_allocation_optional_data.additional_properties = ( - additional_properties - ) - return create_multi_leg_order_cross_allocation_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py deleted file mode 100644 index 4c68a0767..000000000 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request.py +++ /dev/null @@ -1,265 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.cross_type import CrossType -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.price_type import PriceType -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_market_condition import CreateMultiLegOrderCrossRequestMarketCondition - from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_optional_data import CreateMultiLegOrderCrossRequestOptionalData - from openapi_project.openapi_package.models.create_multi_leg_order_cross_allocation import CreateMultiLegOrderCrossAllocation - from openapi_project.openapi_package.models.create_multi_leg_order_cross_request_algo import CreateMultiLegOrderCrossRequestAlgo -T = TypeVar("T", bound="CreateMultiLegOrderCrossRequest") - - -@_attrs_define -class CreateMultiLegOrderCrossRequest: - """ - Attributes: - account_id (Unset | int): - allocations (Unset | list[CreateMultiLegOrderCrossAllocation]): - cross_type (Unset | CrossType): - instructions (Unset | list[OrderInstruction]): - ord_type (Unset | OrdType): - order_flags (Unset | int): - parent_ord_id (Unset | str): - price (Unset | float): - price_type (Unset | PriceType): - qty (Unset | float): - route (Unset | str): - tag (Unset | str): - text (Unset | str): - tif (Unset | Tif): - algo (Unset | CreateMultiLegOrderCrossRequestAlgo): - market_condition (Unset | CreateMultiLegOrderCrossRequestMarketCondition): - optional_data (Unset | CreateMultiLegOrderCrossRequestOptionalData): - """ - - account_id: Unset | int = UNSET - allocations: Unset | list[CreateMultiLegOrderCrossAllocation] = UNSET - cross_type: Unset | CrossType = UNSET - instructions: Unset | list[OrderInstruction] = UNSET - ord_type: Unset | OrdType = UNSET - order_flags: Unset | int = UNSET - parent_ord_id: Unset | str = UNSET - price: Unset | float = UNSET - price_type: Unset | PriceType = UNSET - qty: Unset | float = UNSET - route: Unset | str = UNSET - tag: Unset | str = UNSET - text: Unset | str = UNSET - tif: Unset | Tif = UNSET - algo: Unset | CreateMultiLegOrderCrossRequestAlgo = UNSET - market_condition: Unset | CreateMultiLegOrderCrossRequestMarketCondition = UNSET - optional_data: Unset | CreateMultiLegOrderCrossRequestOptionalData = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - allocations: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.allocations, Unset): - allocations = [] - for allocations_item_data in self.allocations: - allocations_item = allocations_item_data.to_dict() - allocations.append(allocations_item) - - cross_type: Unset | str = ( - UNSET if isinstance(self.cross_type, Unset) else self.cross_type.value - ) - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - ord_type: Unset | str = ( - UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value - ) - - order_flags = self.order_flags - - parent_ord_id = self.parent_ord_id - - price = self.price - - price_type: Unset | str = ( - UNSET if isinstance(self.price_type, Unset) else self.price_type.value - ) - - qty = self.qty - - route = self.route - - tag = self.tag - - text = self.text - - tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value - - algo: Unset | dict[str, Any] = ( - UNSET if isinstance(self.algo, Unset) else self.algo.to_dict() - ) - - market_condition: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.market_condition, Unset) - else self.market_condition.to_dict() - ) - - optional_data: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.optional_data, Unset) - else self.optional_data.to_dict() - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if allocations is not UNSET: - field_dict["allocations"] = allocations - if cross_type is not UNSET: - field_dict["crossType"] = cross_type - if instructions is not UNSET: - field_dict["instructions"] = instructions - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if order_flags is not UNSET: - field_dict["orderFlags"] = order_flags - if parent_ord_id is not UNSET: - field_dict["parentOrdId"] = parent_ord_id - if price is not UNSET: - field_dict["price"] = price - if price_type is not UNSET: - field_dict["priceType"] = price_type - if qty is not UNSET: - field_dict["qty"] = qty - if route is not UNSET: - field_dict["route"] = route - if tag is not UNSET: - field_dict["tag"] = tag - if text is not UNSET: - field_dict["text"] = text - if tif is not UNSET: - field_dict["tif"] = tif - if algo is not UNSET: - field_dict["algo"] = algo - if market_condition is not UNSET: - field_dict["marketCondition"] = market_condition - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - allocations = [] - _allocations = d.pop("allocations", UNSET) - for allocations_item_data in _allocations or []: - allocations_item = CreateMultiLegOrderCrossAllocation.from_dict( - allocations_item_data - ) - - allocations.append(allocations_item) - - _cross_type = d.pop("crossType", UNSET) - cross_type: Unset | CrossType = ( - UNSET if isinstance(_cross_type, Unset) else CrossType(_cross_type) - ) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType = ( - UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) - ) - - order_flags = d.pop("orderFlags", UNSET) - - parent_ord_id = d.pop("parentOrdId", UNSET) - - price = d.pop("price", UNSET) - - _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType = ( - UNSET if isinstance(_price_type, Unset) else PriceType(_price_type) - ) - - qty = d.pop("qty", UNSET) - - route = d.pop("route", UNSET) - - tag = d.pop("tag", UNSET) - - text = d.pop("text", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) - - _algo = d.pop("algo", UNSET) - algo: Unset | CreateMultiLegOrderCrossRequestAlgo = ( - UNSET - if isinstance(_algo, Unset) - else CreateMultiLegOrderCrossRequestAlgo.from_dict(_algo) - ) - - _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | CreateMultiLegOrderCrossRequestMarketCondition = ( - UNSET - if isinstance(_market_condition, Unset) - else CreateMultiLegOrderCrossRequestMarketCondition.from_dict( - _market_condition - ) - ) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CreateMultiLegOrderCrossRequestOptionalData = ( - UNSET - if isinstance(_optional_data, Unset) - else CreateMultiLegOrderCrossRequestOptionalData.from_dict(_optional_data) - ) - - create_multi_leg_order_cross_request = cls( - account_id=account_id, - allocations=allocations, - cross_type=cross_type, - instructions=instructions, - ord_type=ord_type, - order_flags=order_flags, - parent_ord_id=parent_ord_id, - price=price, - price_type=price_type, - qty=qty, - route=route, - tag=tag, - text=text, - tif=tif, - algo=algo, - market_condition=market_condition, - optional_data=optional_data, - ) - - return create_multi_leg_order_cross_request diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py deleted file mode 100644 index 9ccba7ba2..000000000 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_algo.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="CreateMultiLegOrderCrossRequestAlgo") - - -@_attrs_define -class CreateMultiLegOrderCrossRequestAlgo: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_multi_leg_order_cross_request_algo = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_multi_leg_order_cross_request_algo.additional_properties = ( - additional_properties - ) - return create_multi_leg_order_cross_request_algo - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py deleted file mode 100644 index 8b48a7804..000000000 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_market_condition.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="CreateMultiLegOrderCrossRequestMarketCondition") - - -@_attrs_define -class CreateMultiLegOrderCrossRequestMarketCondition: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_multi_leg_order_cross_request_market_condition = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_multi_leg_order_cross_request_market_condition.additional_properties = ( - additional_properties - ) - return create_multi_leg_order_cross_request_market_condition - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py deleted file mode 100644 index cd8d62e0c..000000000 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_request_optional_data.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="CreateMultiLegOrderCrossRequestOptionalData") - - -@_attrs_define -class CreateMultiLegOrderCrossRequestOptionalData: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_multi_leg_order_cross_request_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_multi_leg_order_cross_request_optional_data.additional_properties = ( - additional_properties - ) - return create_multi_leg_order_cross_request_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py b/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py deleted file mode 100644 index 94ed8cd56..000000000 --- a/openapi_project/openapi_package/models/create_multi_leg_order_cross_response.py +++ /dev/null @@ -1,83 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.multi_leg_order_cross import MultiLegOrderCross - - -T = TypeVar("T", bound="CreateMultiLegOrderCrossResponse") - - -@_attrs_define -class CreateMultiLegOrderCrossResponse: - """ - Attributes: - multi_leg_order_cross (Unset | MultiLegOrderCross): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - multi_leg_order_cross: Unset | MultiLegOrderCross = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - multi_leg_order_cross: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.multi_leg_order_cross, Unset) - else self.multi_leg_order_cross.to_dict() - ) - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if multi_leg_order_cross is not UNSET: - field_dict["multiLegOrderCross"] = multi_leg_order_cross - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _multi_leg_order_cross = d.pop("multiLegOrderCross", UNSET) - multi_leg_order_cross: Unset | MultiLegOrderCross = ( - UNSET - if isinstance(_multi_leg_order_cross, Unset) - else MultiLegOrderCross.from_dict(_multi_leg_order_cross) - ) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - create_multi_leg_order_cross_response = cls( - multi_leg_order_cross=multi_leg_order_cross, - error_message=error_message, - status_code=status_code, - ) - - return create_multi_leg_order_cross_response diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_leg.py b/openapi_project/openapi_package/models/create_multi_leg_order_leg.py deleted file mode 100644 index 035ef6e5e..000000000 --- a/openapi_project/openapi_package/models/create_multi_leg_order_leg.py +++ /dev/null @@ -1,152 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.position_effect import PositionEffect -from openapi_project.openapi_package.models.side import Side -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.create_multi_leg_order_leg_optional_data import CreateMultiLegOrderLegOptionalData - from openapi_project.openapi_package.models.create_multi_leg_order_leg_market_condition import CreateMultiLegOrderLegMarketCondition - from openapi_project.openapi_package.models.flex_option import FlexOption - - -T = TypeVar("T", bound="CreateMultiLegOrderLeg") - - -@_attrs_define -class CreateMultiLegOrderLeg: - """ - Attributes: - position_effect (Unset | PositionEffect): - price (Unset | float): - ratio (Unset | int): - side (Unset | Side): - symbol (Unset | str): - market_condition (Unset | CreateMultiLegOrderLegMarketCondition): - optional_data (Unset | CreateMultiLegOrderLegOptionalData): - flex_option (Unset | FlexOption): - """ - - position_effect: Unset | PositionEffect = UNSET - price: Unset | float = UNSET - ratio: Unset | int = UNSET - side: Unset | Side = UNSET - symbol: Unset | str = UNSET - market_condition: Unset | CreateMultiLegOrderLegMarketCondition = UNSET - optional_data: Unset | CreateMultiLegOrderLegOptionalData = UNSET - flex_option: Unset | FlexOption = UNSET - - def to_dict(self) -> dict[str, Any]: - position_effect: Unset | str = ( - UNSET - if isinstance(self.position_effect, Unset) - else self.position_effect.value - ) - - price = self.price - - ratio = self.ratio - - side: Unset | str = UNSET if isinstance(self.side, Unset) else self.side.value - - symbol = self.symbol - - market_condition: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.market_condition, Unset) - else self.market_condition.to_dict() - ) - - optional_data: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.optional_data, Unset) - else self.optional_data.to_dict() - ) - - flex_option: Unset | dict[str, Any] = ( - UNSET if isinstance(self.flex_option, Unset) else self.flex_option.to_dict() - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if position_effect is not UNSET: - field_dict["positionEffect"] = position_effect - if price is not UNSET: - field_dict["price"] = price - if ratio is not UNSET: - field_dict["ratio"] = ratio - if side is not UNSET: - field_dict["side"] = side - if symbol is not UNSET: - field_dict["symbol"] = symbol - if market_condition is not UNSET: - field_dict["marketCondition"] = market_condition - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if flex_option is not UNSET: - field_dict["flexOption"] = flex_option - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _position_effect = d.pop("positionEffect", UNSET) - position_effect: Unset | PositionEffect = ( - UNSET - if isinstance(_position_effect, Unset) - else PositionEffect(_position_effect) - ) - - price = d.pop("price", UNSET) - - ratio = d.pop("ratio", UNSET) - - _side = d.pop("side", UNSET) - side: Unset | Side = UNSET if isinstance(_side, Unset) else Side(_side) - - symbol = d.pop("symbol", UNSET) - - _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | CreateMultiLegOrderLegMarketCondition = ( - UNSET - if isinstance(_market_condition, Unset) - else CreateMultiLegOrderLegMarketCondition.from_dict(_market_condition) - ) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CreateMultiLegOrderLegOptionalData = ( - UNSET - if isinstance(_optional_data, Unset) - else CreateMultiLegOrderLegOptionalData.from_dict(_optional_data) - ) - - _flex_option = d.pop("flexOption", UNSET) - flex_option: Unset | FlexOption = ( - UNSET - if isinstance(_flex_option, Unset) - else FlexOption.from_dict(_flex_option) - ) - - create_multi_leg_order_leg = cls( - position_effect=position_effect, - price=price, - ratio=ratio, - side=side, - symbol=symbol, - market_condition=market_condition, - optional_data=optional_data, - flex_option=flex_option, - ) - - return create_multi_leg_order_leg diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py b/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py deleted file mode 100644 index f0ee453a7..000000000 --- a/openapi_project/openapi_package/models/create_multi_leg_order_leg_market_condition.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="CreateMultiLegOrderLegMarketCondition") - - -@_attrs_define -class CreateMultiLegOrderLegMarketCondition: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_multi_leg_order_leg_market_condition = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_multi_leg_order_leg_market_condition.additional_properties = ( - additional_properties - ) - return create_multi_leg_order_leg_market_condition - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py b/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py deleted file mode 100644 index 63405eab9..000000000 --- a/openapi_project/openapi_package/models/create_multi_leg_order_leg_optional_data.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="CreateMultiLegOrderLegOptionalData") - - -@_attrs_define -class CreateMultiLegOrderLegOptionalData: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_multi_leg_order_leg_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_multi_leg_order_leg_optional_data.additional_properties = ( - additional_properties - ) - return create_multi_leg_order_leg_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_request.py b/openapi_project/openapi_package/models/create_multi_leg_order_request.py deleted file mode 100644 index 29d2b97fc..000000000 --- a/openapi_project/openapi_package/models/create_multi_leg_order_request.py +++ /dev/null @@ -1,276 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.price_type import PriceType -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.create_multi_leg_order_request_optional_data import CreateMultiLegOrderRequestOptionalData - from openapi_project.openapi_package.models.create_multi_leg_order_request_algo import CreateMultiLegOrderRequestAlgo - from openapi_project.openapi_package.models.create_multi_leg_order_request_market_condition import CreateMultiLegOrderRequestMarketCondition - from openapi_project.openapi_package.models.create_multi_leg_order_leg import CreateMultiLegOrderLeg - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - - -T = TypeVar("T", bound="CreateMultiLegOrderRequest") - - -@_attrs_define -class CreateMultiLegOrderRequest: - """ - Attributes: - account_id (Unset | int): - aux_price (Unset | float): - clearing_info (Unset | ClearingInfo): - instructions (Unset | list[OrderInstruction]): - legs (Unset | list[CreateMultiLegOrderLeg]): - ord_type (Unset | OrdType): - order_flags (Unset | int): - parent_ord_id (Unset | str): - price (Unset | float): - price_type (Unset | PriceType): - qty (Unset | float): - route (Unset | str): - tag (Unset | str): - text (Unset | str): - tif (Unset | Tif): - algo (Unset | CreateMultiLegOrderRequestAlgo): - market_condition (Unset | CreateMultiLegOrderRequestMarketCondition): - optional_data (Unset | CreateMultiLegOrderRequestOptionalData): - """ - - account_id: Unset | int = UNSET - aux_price: Unset | float = UNSET - clearing_info: Unset | ClearingInfo = UNSET - instructions: Unset | list[OrderInstruction] = UNSET - legs: Unset | list[CreateMultiLegOrderLeg] = UNSET - ord_type: Unset | OrdType = UNSET - order_flags: Unset | int = UNSET - parent_ord_id: Unset | str = UNSET - price: Unset | float = UNSET - price_type: Unset | PriceType = UNSET - qty: Unset | float = UNSET - route: Unset | str = UNSET - tag: Unset | str = UNSET - text: Unset | str = UNSET - tif: Unset | Tif = UNSET - algo: Unset | CreateMultiLegOrderRequestAlgo = UNSET - market_condition: Unset | CreateMultiLegOrderRequestMarketCondition = UNSET - optional_data: Unset | CreateMultiLegOrderRequestOptionalData = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - aux_price = self.aux_price - - clearing_info: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.clearing_info, Unset) - else self.clearing_info.to_dict() - ) - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - legs: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.legs, Unset): - legs = [] - for legs_item_data in self.legs: - legs_item = legs_item_data.to_dict() - legs.append(legs_item) - - ord_type: Unset | str = ( - UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value - ) - - order_flags = self.order_flags - - parent_ord_id = self.parent_ord_id - - price = self.price - - price_type: Unset | str = ( - UNSET if isinstance(self.price_type, Unset) else self.price_type.value - ) - - qty = self.qty - - route = self.route - - tag = self.tag - - text = self.text - - tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value - - algo: Unset | dict[str, Any] = ( - UNSET if isinstance(self.algo, Unset) else self.algo.to_dict() - ) - - market_condition: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.market_condition, Unset) - else self.market_condition.to_dict() - ) - - optional_data: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.optional_data, Unset) - else self.optional_data.to_dict() - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if aux_price is not UNSET: - field_dict["auxPrice"] = aux_price - if clearing_info is not UNSET: - field_dict["clearingInfo"] = clearing_info - if instructions is not UNSET: - field_dict["instructions"] = instructions - if legs is not UNSET: - field_dict["legs"] = legs - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if order_flags is not UNSET: - field_dict["orderFlags"] = order_flags - if parent_ord_id is not UNSET: - field_dict["parentOrdId"] = parent_ord_id - if price is not UNSET: - field_dict["price"] = price - if price_type is not UNSET: - field_dict["priceType"] = price_type - if qty is not UNSET: - field_dict["qty"] = qty - if route is not UNSET: - field_dict["route"] = route - if tag is not UNSET: - field_dict["tag"] = tag - if text is not UNSET: - field_dict["text"] = text - if tif is not UNSET: - field_dict["tif"] = tif - if algo is not UNSET: - field_dict["algo"] = algo - if market_condition is not UNSET: - field_dict["marketCondition"] = market_condition - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - aux_price = d.pop("auxPrice", UNSET) - - _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo = ( - UNSET - if isinstance(_clearing_info, Unset) - else ClearingInfo.from_dict(_clearing_info) - ) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - legs = [] - _legs = d.pop("legs", UNSET) - for legs_item_data in _legs or []: - legs_item = CreateMultiLegOrderLeg.from_dict(legs_item_data) - - legs.append(legs_item) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType = ( - UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) - ) - - order_flags = d.pop("orderFlags", UNSET) - - parent_ord_id = d.pop("parentOrdId", UNSET) - - price = d.pop("price", UNSET) - - _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType = ( - UNSET if isinstance(_price_type, Unset) else PriceType(_price_type) - ) - - qty = d.pop("qty", UNSET) - - route = d.pop("route", UNSET) - - tag = d.pop("tag", UNSET) - - text = d.pop("text", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) - - _algo = d.pop("algo", UNSET) - algo: Unset | CreateMultiLegOrderRequestAlgo = ( - UNSET - if isinstance(_algo, Unset) - else CreateMultiLegOrderRequestAlgo.from_dict(_algo) - ) - - _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | CreateMultiLegOrderRequestMarketCondition = ( - UNSET - if isinstance(_market_condition, Unset) - else CreateMultiLegOrderRequestMarketCondition.from_dict(_market_condition) - ) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CreateMultiLegOrderRequestOptionalData = ( - UNSET - if isinstance(_optional_data, Unset) - else CreateMultiLegOrderRequestOptionalData.from_dict(_optional_data) - ) - - create_multi_leg_order_request = cls( - account_id=account_id, - aux_price=aux_price, - clearing_info=clearing_info, - instructions=instructions, - legs=legs, - ord_type=ord_type, - order_flags=order_flags, - parent_ord_id=parent_ord_id, - price=price, - price_type=price_type, - qty=qty, - route=route, - tag=tag, - text=text, - tif=tif, - algo=algo, - market_condition=market_condition, - optional_data=optional_data, - ) - - return create_multi_leg_order_request diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py b/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py deleted file mode 100644 index 07bb1a8e6..000000000 --- a/openapi_project/openapi_package/models/create_multi_leg_order_request_algo.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="CreateMultiLegOrderRequestAlgo") - - -@_attrs_define -class CreateMultiLegOrderRequestAlgo: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_multi_leg_order_request_algo = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_multi_leg_order_request_algo.additional_properties = ( - additional_properties - ) - return create_multi_leg_order_request_algo - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py b/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py deleted file mode 100644 index 78acdb11a..000000000 --- a/openapi_project/openapi_package/models/create_multi_leg_order_request_market_condition.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="CreateMultiLegOrderRequestMarketCondition") - - -@_attrs_define -class CreateMultiLegOrderRequestMarketCondition: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_multi_leg_order_request_market_condition = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_multi_leg_order_request_market_condition.additional_properties = ( - additional_properties - ) - return create_multi_leg_order_request_market_condition - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py b/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py deleted file mode 100644 index 5426c0ab7..000000000 --- a/openapi_project/openapi_package/models/create_multi_leg_order_request_optional_data.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="CreateMultiLegOrderRequestOptionalData") - - -@_attrs_define -class CreateMultiLegOrderRequestOptionalData: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_multi_leg_order_request_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_multi_leg_order_request_optional_data.additional_properties = ( - additional_properties - ) - return create_multi_leg_order_request_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_multi_leg_order_response.py b/openapi_project/openapi_package/models/create_multi_leg_order_response.py deleted file mode 100644 index 87e18f695..000000000 --- a/openapi_project/openapi_package/models/create_multi_leg_order_response.py +++ /dev/null @@ -1,83 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.multi_leg_order import MultiLegOrder - - -T = TypeVar("T", bound="CreateMultiLegOrderResponse") - - -@_attrs_define -class CreateMultiLegOrderResponse: - """ - Attributes: - multi_leg_order (Unset | MultiLegOrder): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - multi_leg_order: Unset | MultiLegOrder = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - multi_leg_order: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.multi_leg_order, Unset) - else self.multi_leg_order.to_dict() - ) - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if multi_leg_order is not UNSET: - field_dict["multiLegOrder"] = multi_leg_order - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _multi_leg_order = d.pop("multiLegOrder", UNSET) - multi_leg_order: Unset | MultiLegOrder = ( - UNSET - if isinstance(_multi_leg_order, Unset) - else MultiLegOrder.from_dict(_multi_leg_order) - ) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - create_multi_leg_order_response = cls( - multi_leg_order=multi_leg_order, - error_message=error_message, - status_code=status_code, - ) - - return create_multi_leg_order_response diff --git a/openapi_project/openapi_package/models/create_order_cross_allocation.py b/openapi_project/openapi_package/models/create_order_cross_allocation.py deleted file mode 100644 index 7c029274d..000000000 --- a/openapi_project/openapi_package/models/create_order_cross_allocation.py +++ /dev/null @@ -1,161 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.cross_side_type import CrossSideType -from openapi_project.openapi_package.models.position_effect import PositionEffect -from openapi_project.openapi_package.models.side import Side -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.create_order_cross_allocation_optional_data import CreateOrderCrossAllocationOptionalData - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - - -T = TypeVar("T", bound="CreateOrderCrossAllocation") - - -@_attrs_define -class CreateOrderCrossAllocation: - """ - Attributes: - account_id (Unset | int): - clearing_info (Unset | ClearingInfo): - instructions (Unset | list[OrderInstruction]): - optional_data (Unset | CreateOrderCrossAllocationOptionalData): - position_effect (Unset | PositionEffect): - qty (Unset | float): - side (Unset | Side): - side_type (Unset | CrossSideType): - """ - - account_id: Unset | int = UNSET - clearing_info: Unset | ClearingInfo = UNSET - instructions: Unset | list[OrderInstruction] = UNSET - optional_data: Unset | CreateOrderCrossAllocationOptionalData = UNSET - position_effect: Unset | PositionEffect = UNSET - qty: Unset | float = UNSET - side: Unset | Side = UNSET - side_type: Unset | CrossSideType = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - clearing_info: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.clearing_info, Unset) - else self.clearing_info.to_dict() - ) - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - optional_data: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.optional_data, Unset) - else self.optional_data.to_dict() - ) - - position_effect: Unset | str = ( - UNSET - if isinstance(self.position_effect, Unset) - else self.position_effect.value - ) - - qty = self.qty - - side: Unset | str = UNSET if isinstance(self.side, Unset) else self.side.value - - side_type: Unset | str = ( - UNSET if isinstance(self.side_type, Unset) else self.side_type.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if clearing_info is not UNSET: - field_dict["clearingInfo"] = clearing_info - if instructions is not UNSET: - field_dict["instructions"] = instructions - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if position_effect is not UNSET: - field_dict["positionEffect"] = position_effect - if qty is not UNSET: - field_dict["qty"] = qty - if side is not UNSET: - field_dict["side"] = side - if side_type is not UNSET: - field_dict["sideType"] = side_type - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo = ( - UNSET - if isinstance(_clearing_info, Unset) - else ClearingInfo.from_dict(_clearing_info) - ) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CreateOrderCrossAllocationOptionalData = ( - UNSET - if isinstance(_optional_data, Unset) - else CreateOrderCrossAllocationOptionalData.from_dict(_optional_data) - ) - - _position_effect = d.pop("positionEffect", UNSET) - position_effect: Unset | PositionEffect = ( - UNSET - if isinstance(_position_effect, Unset) - else PositionEffect(_position_effect) - ) - - qty = d.pop("qty", UNSET) - - _side = d.pop("side", UNSET) - side: Unset | Side = UNSET if isinstance(_side, Unset) else Side(_side) - - _side_type = d.pop("sideType", UNSET) - side_type: Unset | CrossSideType = ( - UNSET if isinstance(_side_type, Unset) else CrossSideType(_side_type) - ) - - create_order_cross_allocation = cls( - account_id=account_id, - clearing_info=clearing_info, - instructions=instructions, - optional_data=optional_data, - position_effect=position_effect, - qty=qty, - side=side, - side_type=side_type, - ) - - return create_order_cross_allocation diff --git a/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py b/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py deleted file mode 100644 index 69a7ffafc..000000000 --- a/openapi_project/openapi_package/models/create_order_cross_allocation_optional_data.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="CreateOrderCrossAllocationOptionalData") - - -@_attrs_define -class CreateOrderCrossAllocationOptionalData: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_order_cross_allocation_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_order_cross_allocation_optional_data.additional_properties = ( - additional_properties - ) - return create_order_cross_allocation_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_order_cross_request.py b/openapi_project/openapi_package/models/create_order_cross_request.py deleted file mode 100644 index 25e6487a6..000000000 --- a/openapi_project/openapi_package/models/create_order_cross_request.py +++ /dev/null @@ -1,289 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.cross_type import CrossType -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.price_type import PriceType -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.create_order_cross_allocation import CreateOrderCrossAllocation - from openapi_project.openapi_package.models.create_order_cross_request_algo import CreateOrderCrossRequestAlgo - from openapi_project.openapi_package.models.flex_option import FlexOption - from openapi_project.openapi_package.models.create_order_cross_request_market_condition import CreateOrderCrossRequestMarketCondition - from openapi_project.openapi_package.models.create_order_cross_request_optional_data import CreateOrderCrossRequestOptionalData -T = TypeVar("T", bound="CreateOrderCrossRequest") - - -@_attrs_define -class CreateOrderCrossRequest: - """ - Attributes: - account_id (Unset | int): - allocations (Unset | list[CreateOrderCrossAllocation]): - cross_type (Unset | CrossType): - instructions (Unset | list[OrderInstruction]): - ord_type (Unset | OrdType): - order_flags (Unset | int): - parent_ord_id (Unset | str): - price (Unset | float): - price_type (Unset | PriceType): - qty (Unset | float): - route (Unset | str): - symbol (Unset | str): - tag (Unset | str): - text (Unset | str): - tif (Unset | Tif): - algo (Unset | CreateOrderCrossRequestAlgo): - market_condition (Unset | CreateOrderCrossRequestMarketCondition): - optional_data (Unset | CreateOrderCrossRequestOptionalData): - flex_option (Unset | FlexOption): - """ - - account_id: Unset | int = UNSET - allocations: Unset | list[CreateOrderCrossAllocation] = UNSET - cross_type: Unset | CrossType = UNSET - instructions: Unset | list[OrderInstruction] = UNSET - ord_type: Unset | OrdType = UNSET - order_flags: Unset | int = UNSET - parent_ord_id: Unset | str = UNSET - price: Unset | float = UNSET - price_type: Unset | PriceType = UNSET - qty: Unset | float = UNSET - route: Unset | str = UNSET - symbol: Unset | str = UNSET - tag: Unset | str = UNSET - text: Unset | str = UNSET - tif: Unset | Tif = UNSET - algo: Unset | CreateOrderCrossRequestAlgo = UNSET - market_condition: Unset | CreateOrderCrossRequestMarketCondition = UNSET - optional_data: Unset | CreateOrderCrossRequestOptionalData = UNSET - flex_option: Unset | FlexOption = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - allocations: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.allocations, Unset): - allocations = [] - for allocations_item_data in self.allocations: - allocations_item = allocations_item_data.to_dict() - allocations.append(allocations_item) - - cross_type: Unset | str = ( - UNSET if isinstance(self.cross_type, Unset) else self.cross_type.value - ) - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - ord_type: Unset | str = ( - UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value - ) - - order_flags = self.order_flags - - parent_ord_id = self.parent_ord_id - - price = self.price - - price_type: Unset | str = ( - UNSET if isinstance(self.price_type, Unset) else self.price_type.value - ) - - qty = self.qty - - route = self.route - - symbol = self.symbol - - tag = self.tag - - text = self.text - - tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value - - algo: Unset | dict[str, Any] = ( - UNSET if isinstance(self.algo, Unset) else self.algo.to_dict() - ) - - market_condition: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.market_condition, Unset) - else self.market_condition.to_dict() - ) - - optional_data: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.optional_data, Unset) - else self.optional_data.to_dict() - ) - - flex_option: Unset | dict[str, Any] = ( - UNSET if isinstance(self.flex_option, Unset) else self.flex_option.to_dict() - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if allocations is not UNSET: - field_dict["allocations"] = allocations - if cross_type is not UNSET: - field_dict["crossType"] = cross_type - if instructions is not UNSET: - field_dict["instructions"] = instructions - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if order_flags is not UNSET: - field_dict["orderFlags"] = order_flags - if parent_ord_id is not UNSET: - field_dict["parentOrdId"] = parent_ord_id - if price is not UNSET: - field_dict["price"] = price - if price_type is not UNSET: - field_dict["priceType"] = price_type - if qty is not UNSET: - field_dict["qty"] = qty - if route is not UNSET: - field_dict["route"] = route - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tag is not UNSET: - field_dict["tag"] = tag - if text is not UNSET: - field_dict["text"] = text - if tif is not UNSET: - field_dict["tif"] = tif - if algo is not UNSET: - field_dict["algo"] = algo - if market_condition is not UNSET: - field_dict["marketCondition"] = market_condition - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if flex_option is not UNSET: - field_dict["flexOption"] = flex_option - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - allocations = [] - _allocations = d.pop("allocations", UNSET) - for allocations_item_data in _allocations or []: - allocations_item = CreateOrderCrossAllocation.from_dict( - allocations_item_data - ) - - allocations.append(allocations_item) - - _cross_type = d.pop("crossType", UNSET) - cross_type: Unset | CrossType = ( - UNSET if isinstance(_cross_type, Unset) else CrossType(_cross_type) - ) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType = ( - UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) - ) - - order_flags = d.pop("orderFlags", UNSET) - - parent_ord_id = d.pop("parentOrdId", UNSET) - - price = d.pop("price", UNSET) - - _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType = ( - UNSET if isinstance(_price_type, Unset) else PriceType(_price_type) - ) - - qty = d.pop("qty", UNSET) - - route = d.pop("route", UNSET) - - symbol = d.pop("symbol", UNSET) - - tag = d.pop("tag", UNSET) - - text = d.pop("text", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) - - _algo = d.pop("algo", UNSET) - algo: Unset | CreateOrderCrossRequestAlgo = ( - UNSET - if isinstance(_algo, Unset) - else CreateOrderCrossRequestAlgo.from_dict(_algo) - ) - - _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | CreateOrderCrossRequestMarketCondition = ( - UNSET - if isinstance(_market_condition, Unset) - else CreateOrderCrossRequestMarketCondition.from_dict(_market_condition) - ) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CreateOrderCrossRequestOptionalData = ( - UNSET - if isinstance(_optional_data, Unset) - else CreateOrderCrossRequestOptionalData.from_dict(_optional_data) - ) - - _flex_option = d.pop("flexOption", UNSET) - flex_option: Unset | FlexOption = ( - UNSET - if isinstance(_flex_option, Unset) - else FlexOption.from_dict(_flex_option) - ) - - create_order_cross_request = cls( - account_id=account_id, - allocations=allocations, - cross_type=cross_type, - instructions=instructions, - ord_type=ord_type, - order_flags=order_flags, - parent_ord_id=parent_ord_id, - price=price, - price_type=price_type, - qty=qty, - route=route, - symbol=symbol, - tag=tag, - text=text, - tif=tif, - algo=algo, - market_condition=market_condition, - optional_data=optional_data, - flex_option=flex_option, - ) - - return create_order_cross_request diff --git a/openapi_project/openapi_package/models/create_order_cross_request_algo.py b/openapi_project/openapi_package/models/create_order_cross_request_algo.py deleted file mode 100644 index 693516ac8..000000000 --- a/openapi_project/openapi_package/models/create_order_cross_request_algo.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="CreateOrderCrossRequestAlgo") - - -@_attrs_define -class CreateOrderCrossRequestAlgo: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_order_cross_request_algo = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_order_cross_request_algo.additional_properties = additional_properties - return create_order_cross_request_algo - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py b/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py deleted file mode 100644 index f16be6888..000000000 --- a/openapi_project/openapi_package/models/create_order_cross_request_market_condition.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="CreateOrderCrossRequestMarketCondition") - - -@_attrs_define -class CreateOrderCrossRequestMarketCondition: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_order_cross_request_market_condition = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_order_cross_request_market_condition.additional_properties = ( - additional_properties - ) - return create_order_cross_request_market_condition - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py b/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py deleted file mode 100644 index 06a735087..000000000 --- a/openapi_project/openapi_package/models/create_order_cross_request_optional_data.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="CreateOrderCrossRequestOptionalData") - - -@_attrs_define -class CreateOrderCrossRequestOptionalData: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_order_cross_request_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_order_cross_request_optional_data.additional_properties = ( - additional_properties - ) - return create_order_cross_request_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_order_cross_response.py b/openapi_project/openapi_package/models/create_order_cross_response.py deleted file mode 100644 index c7835ce9d..000000000 --- a/openapi_project/openapi_package/models/create_order_cross_response.py +++ /dev/null @@ -1,81 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_cross import OrderCross - - -T = TypeVar("T", bound="CreateOrderCrossResponse") - - -@_attrs_define -class CreateOrderCrossResponse: - """ - Attributes: - order_cross (Unset | OrderCross): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - order_cross: Unset | OrderCross = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - order_cross: Unset | dict[str, Any] = ( - UNSET if isinstance(self.order_cross, Unset) else self.order_cross.to_dict() - ) - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if order_cross is not UNSET: - field_dict["orderCross"] = order_cross - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _order_cross = d.pop("orderCross", UNSET) - order_cross: Unset | OrderCross = ( - UNSET - if isinstance(_order_cross, Unset) - else OrderCross.from_dict(_order_cross) - ) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - create_order_cross_response = cls( - order_cross=order_cross, - error_message=error_message, - status_code=status_code, - ) - - return create_order_cross_response diff --git a/openapi_project/openapi_package/models/create_order_request.py b/openapi_project/openapi_package/models/create_order_request.py deleted file mode 100644 index d50740a90..000000000 --- a/openapi_project/openapi_package/models/create_order_request.py +++ /dev/null @@ -1,312 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.position_effect import PositionEffect -from openapi_project.openapi_package.models.price_type import PriceType -from openapi_project.openapi_package.models.side import Side -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.create_order_request_market_condition import CreateOrderRequestMarketCondition - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.create_order_request_optional_data import CreateOrderRequestOptionalData - from openapi_project.openapi_package.models.create_order_request_algo import CreateOrderRequestAlgo - from openapi_project.openapi_package.models.flex_option import FlexOption - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - - -T = TypeVar("T", bound="CreateOrderRequest") - - -@_attrs_define -class CreateOrderRequest: - """ - Attributes: - account_id (Unset | int): - aux_price (Unset | float): - clearing_info (Unset | ClearingInfo): - instructions (Unset | list[OrderInstruction]): - ord_type (Unset | OrdType): - order_flags (Unset | int): - parent_ord_id (Unset | str): - position_effect (Unset | PositionEffect): - price (Unset | float): - price_type (Unset | PriceType): - qty (Unset | float): - route (Unset | str): - side (Unset | Side): - symbol (Unset | str): - tag (Unset | str): - text (Unset | str): - tif (Unset | Tif): - algo (Unset | CreateOrderRequestAlgo): - market_condition (Unset | CreateOrderRequestMarketCondition): - optional_data (Unset | CreateOrderRequestOptionalData): - flex_option (Unset | FlexOption): - """ - - account_id: Unset | int = UNSET - aux_price: Unset | float = UNSET - clearing_info: Unset | ClearingInfo = UNSET - instructions: Unset | list[OrderInstruction] = UNSET - ord_type: Unset | OrdType = UNSET - order_flags: Unset | int = UNSET - parent_ord_id: Unset | str = UNSET - position_effect: Unset | PositionEffect = UNSET - price: Unset | float = UNSET - price_type: Unset | PriceType = UNSET - qty: Unset | float = UNSET - route: Unset | str = UNSET - side: Unset | Side = UNSET - symbol: Unset | str = UNSET - tag: Unset | str = UNSET - text: Unset | str = UNSET - tif: Unset | Tif = UNSET - algo: Unset | CreateOrderRequestAlgo = UNSET - market_condition: Unset | CreateOrderRequestMarketCondition = UNSET - optional_data: Unset | CreateOrderRequestOptionalData = UNSET - flex_option: Unset | FlexOption = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - aux_price = self.aux_price - - clearing_info: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.clearing_info, Unset) - else self.clearing_info.to_dict() - ) - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - ord_type: Unset | str = ( - UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value - ) - - order_flags = self.order_flags - - parent_ord_id = self.parent_ord_id - - position_effect: Unset | str = ( - UNSET - if isinstance(self.position_effect, Unset) - else self.position_effect.value - ) - - price = self.price - - price_type: Unset | str = ( - UNSET if isinstance(self.price_type, Unset) else self.price_type.value - ) - - qty = self.qty - - route = self.route - - side: Unset | str = UNSET if isinstance(self.side, Unset) else self.side.value - - symbol = self.symbol - - tag = self.tag - - text = self.text - - tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value - - algo: Unset | dict[str, Any] = ( - UNSET if isinstance(self.algo, Unset) else self.algo.to_dict() - ) - - market_condition: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.market_condition, Unset) - else self.market_condition.to_dict() - ) - - optional_data: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.optional_data, Unset) - else self.optional_data.to_dict() - ) - - flex_option: Unset | dict[str, Any] = ( - UNSET if isinstance(self.flex_option, Unset) else self.flex_option.to_dict() - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if aux_price is not UNSET: - field_dict["auxPrice"] = aux_price - if clearing_info is not UNSET: - field_dict["clearingInfo"] = clearing_info - if instructions is not UNSET: - field_dict["instructions"] = instructions - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if order_flags is not UNSET: - field_dict["orderFlags"] = order_flags - if parent_ord_id is not UNSET: - field_dict["parentOrdId"] = parent_ord_id - if position_effect is not UNSET: - field_dict["positionEffect"] = position_effect - if price is not UNSET: - field_dict["price"] = price - if price_type is not UNSET: - field_dict["priceType"] = price_type - if qty is not UNSET: - field_dict["qty"] = qty - if route is not UNSET: - field_dict["route"] = route - if side is not UNSET: - field_dict["side"] = side - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tag is not UNSET: - field_dict["tag"] = tag - if text is not UNSET: - field_dict["text"] = text - if tif is not UNSET: - field_dict["tif"] = tif - if algo is not UNSET: - field_dict["algo"] = algo - if market_condition is not UNSET: - field_dict["marketCondition"] = market_condition - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if flex_option is not UNSET: - field_dict["flexOption"] = flex_option - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - aux_price = d.pop("auxPrice", UNSET) - - _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo = ( - UNSET - if isinstance(_clearing_info, Unset) - else ClearingInfo.from_dict(_clearing_info) - ) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType = ( - UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) - ) - - order_flags = d.pop("orderFlags", UNSET) - - parent_ord_id = d.pop("parentOrdId", UNSET) - - _position_effect = d.pop("positionEffect", UNSET) - position_effect: Unset | PositionEffect = ( - UNSET - if isinstance(_position_effect, Unset) - else PositionEffect(_position_effect) - ) - - price = d.pop("price", UNSET) - - _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType = ( - UNSET if isinstance(_price_type, Unset) else PriceType(_price_type) - ) - - qty = d.pop("qty", UNSET) - - route = d.pop("route", UNSET) - - _side = d.pop("side", UNSET) - side: Unset | Side = UNSET if isinstance(_side, Unset) else Side(_side) - - symbol = d.pop("symbol", UNSET) - - tag = d.pop("tag", UNSET) - - text = d.pop("text", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) - - _algo = d.pop("algo", UNSET) - algo: Unset | CreateOrderRequestAlgo = ( - UNSET - if isinstance(_algo, Unset) - else CreateOrderRequestAlgo.from_dict(_algo) - ) - - _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | CreateOrderRequestMarketCondition = ( - UNSET - if isinstance(_market_condition, Unset) - else CreateOrderRequestMarketCondition.from_dict(_market_condition) - ) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | CreateOrderRequestOptionalData = ( - UNSET - if isinstance(_optional_data, Unset) - else CreateOrderRequestOptionalData.from_dict(_optional_data) - ) - - _flex_option = d.pop("flexOption", UNSET) - flex_option: Unset | FlexOption = ( - UNSET - if isinstance(_flex_option, Unset) - else FlexOption.from_dict(_flex_option) - ) - - create_order_request = cls( - account_id=account_id, - aux_price=aux_price, - clearing_info=clearing_info, - instructions=instructions, - ord_type=ord_type, - order_flags=order_flags, - parent_ord_id=parent_ord_id, - position_effect=position_effect, - price=price, - price_type=price_type, - qty=qty, - route=route, - side=side, - symbol=symbol, - tag=tag, - text=text, - tif=tif, - algo=algo, - market_condition=market_condition, - optional_data=optional_data, - flex_option=flex_option, - ) - - return create_order_request diff --git a/openapi_project/openapi_package/models/create_order_request_algo.py b/openapi_project/openapi_package/models/create_order_request_algo.py deleted file mode 100644 index e3c864707..000000000 --- a/openapi_project/openapi_package/models/create_order_request_algo.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="CreateOrderRequestAlgo") - - -@_attrs_define -class CreateOrderRequestAlgo: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_order_request_algo = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_order_request_algo.additional_properties = additional_properties - return create_order_request_algo - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_order_request_market_condition.py b/openapi_project/openapi_package/models/create_order_request_market_condition.py deleted file mode 100644 index 72be92d7d..000000000 --- a/openapi_project/openapi_package/models/create_order_request_market_condition.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="CreateOrderRequestMarketCondition") - - -@_attrs_define -class CreateOrderRequestMarketCondition: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_order_request_market_condition = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_order_request_market_condition.additional_properties = ( - additional_properties - ) - return create_order_request_market_condition - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_order_request_optional_data.py b/openapi_project/openapi_package/models/create_order_request_optional_data.py deleted file mode 100644 index 54d7e7972..000000000 --- a/openapi_project/openapi_package/models/create_order_request_optional_data.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="CreateOrderRequestOptionalData") - - -@_attrs_define -class CreateOrderRequestOptionalData: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - create_order_request_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - create_order_request_optional_data.additional_properties = additional_properties - return create_order_request_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/create_order_response.py b/openapi_project/openapi_package/models/create_order_response.py deleted file mode 100644 index d7579f30f..000000000 --- a/openapi_project/openapi_package/models/create_order_response.py +++ /dev/null @@ -1,79 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.order import Order - - -T = TypeVar("T", bound="CreateOrderResponse") - - -@_attrs_define -class CreateOrderResponse: - """ - Attributes: - order (Unset | Order): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - order: Unset | Order = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - order: Unset | dict[str, Any] = ( - UNSET if isinstance(self.order, Unset) else self.order.to_dict() - ) - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if order is not UNSET: - field_dict["order"] = order - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _order = d.pop("order", UNSET) - order: Unset | Order = ( - UNSET if isinstance(_order, Unset) else Order.from_dict(_order) - ) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - create_order_response = cls( - order=order, - error_message=error_message, - status_code=status_code, - ) - - return create_order_response diff --git a/openapi_project/openapi_package/models/cross_side_type.py b/openapi_project/openapi_package/models/cross_side_type.py deleted file mode 100644 index 31e60a925..000000000 --- a/openapi_project/openapi_package/models/cross_side_type.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class CrossSideType(str, Enum): - CROSS_SIDE_TYPE_AGENCY = "CROSS_SIDE_TYPE_AGENCY" - CROSS_SIDE_TYPE_CONTRA = "CROSS_SIDE_TYPE_CONTRA" - CROSS_SIDE_TYPE_UNDEFINED = "CROSS_SIDE_TYPE_UNDEFINED" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/cross_type.py b/openapi_project/openapi_package/models/cross_type.py deleted file mode 100644 index 41cbd00c3..000000000 --- a/openapi_project/openapi_package/models/cross_type.py +++ /dev/null @@ -1,20 +0,0 @@ -from enum import Enum - - -class CrossType(str, Enum): - CROSS_TYPE_AIM = "CROSS_TYPE_AIM" - CROSS_TYPE_BAM = "CROSS_TYPE_BAM" - CROSS_TYPE_C2C = "CROSS_TYPE_C2C" - CROSS_TYPE_FACILITATION = "CROSS_TYPE_FACILITATION" - CROSS_TYPE_MATRIX_CROSS = "CROSS_TYPE_MATRIX_CROSS" - CROSS_TYPE_PCC = "CROSS_TYPE_PCC" - CROSS_TYPE_PIM = "CROSS_TYPE_PIM" - CROSS_TYPE_QCC = "CROSS_TYPE_QCC" - CROSS_TYPE_RFC = "CROSS_TYPE_RFC" - CROSS_TYPE_SAM = "CROSS_TYPE_SAM" - CROSS_TYPE_SWEEP_AND_AIM = "CROSS_TYPE_SWEEP_AND_AIM" - CROSS_TYPE_SWEEP_AND_CROSS = "CROSS_TYPE_SWEEP_AND_CROSS" - CROSS_TYPE_UNDEFINED = "CROSS_TYPE_UNDEFINED" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/crypto.py b/openapi_project/openapi_package/models/crypto.py deleted file mode 100644 index 6485c5f3e..000000000 --- a/openapi_project/openapi_package/models/crypto.py +++ /dev/null @@ -1,290 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.models.exchange_code import ExchangeCode -from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat -from openapi_project.openapi_package.models.security_category import SecurityCategory -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.date import Date - from openapi_project.openapi_package.models.crypto_aliases import CryptoAliases - - -T = TypeVar("T", bound="Crypto") - - -@_attrs_define -class Crypto: - """ - Attributes: - aliases (Unset | CryptoAliases): - currency (Unset | Currency): - listed_dt (Unset | Date): - delisted_dt (Unset | Date): - description (Unset | str): - exchange_id (Unset | int): - id_ (Unset | int): - multiplier (Unset | float): - price_base_factor (Unset | float): - price_display_factor (Unset | float): - price_display_format (Unset | NumericDisplayFormat): - qty_display_factor (Unset | float): - qty_display_format (Unset | NumericDisplayFormat): - security_category (Unset | SecurityCategory): - symbol (Unset | str): - tick_rule (Unset | str): - tick_size (Unset | float): - tick_value (Unset | float): - traded_exchanges (Unset | list[ExchangeCode]): - quote_currency (Unset | Currency): - """ - - aliases: Unset | CryptoAliases = UNSET - currency: Unset | Currency = UNSET - listed_dt: Unset | Date = UNSET - delisted_dt: Unset | Date = UNSET - description: Unset | str = UNSET - exchange_id: Unset | int = UNSET - id_: Unset | int = UNSET - multiplier: Unset | float = UNSET - price_base_factor: Unset | float = UNSET - price_display_factor: Unset | float = UNSET - price_display_format: Unset | NumericDisplayFormat = UNSET - qty_display_factor: Unset | float = UNSET - qty_display_format: Unset | NumericDisplayFormat = UNSET - security_category: Unset | SecurityCategory = UNSET - symbol: Unset | str = UNSET - tick_rule: Unset | str = UNSET - tick_size: Unset | float = UNSET - tick_value: Unset | float = UNSET - traded_exchanges: Unset | list[ExchangeCode] = UNSET - quote_currency: Unset | Currency = UNSET - - def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = ( - UNSET if isinstance(self.aliases, Unset) else self.aliases.to_dict() - ) - - currency: Unset | str = ( - UNSET if isinstance(self.currency, Unset) else self.currency.value - ) - - listed_dt: Unset | dict[str, Any] = ( - UNSET if isinstance(self.listed_dt, Unset) else self.listed_dt.to_dict() - ) - - delisted_dt: Unset | dict[str, Any] = ( - UNSET if isinstance(self.delisted_dt, Unset) else self.delisted_dt.to_dict() - ) - - description = self.description - - exchange_id = self.exchange_id - - id_ = self.id_ - - multiplier = self.multiplier - - price_base_factor = self.price_base_factor - - price_display_factor = self.price_display_factor - - price_display_format: Unset | str = ( - UNSET - if isinstance(self.price_display_format, Unset) - else self.price_display_format.value - ) - - qty_display_factor = self.qty_display_factor - - qty_display_format: Unset | str = ( - UNSET - if isinstance(self.qty_display_format, Unset) - else self.qty_display_format.value - ) - - security_category: Unset | str = ( - UNSET - if isinstance(self.security_category, Unset) - else self.security_category.value - ) - - symbol = self.symbol - - tick_rule = self.tick_rule - - tick_size = self.tick_size - - tick_value = self.tick_value - - traded_exchanges: Unset | list[str] = UNSET - if not isinstance(self.traded_exchanges, Unset): - traded_exchanges = [] - for traded_exchanges_item_data in self.traded_exchanges: - traded_exchanges_item = traded_exchanges_item_data.value - traded_exchanges.append(traded_exchanges_item) - - quote_currency: Unset | str = ( - UNSET - if isinstance(self.quote_currency, Unset) - else self.quote_currency.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if aliases is not UNSET: - field_dict["aliases"] = aliases - if currency is not UNSET: - field_dict["currency"] = currency - if listed_dt is not UNSET: - field_dict["listedDt"] = listed_dt - if delisted_dt is not UNSET: - field_dict["delistedDt"] = delisted_dt - if description is not UNSET: - field_dict["description"] = description - if exchange_id is not UNSET: - field_dict["exchangeId"] = exchange_id - if id_ is not UNSET: - field_dict["id"] = id - if multiplier is not UNSET: - field_dict["multiplier"] = multiplier - if price_base_factor is not UNSET: - field_dict["priceBaseFactor"] = price_base_factor - if price_display_factor is not UNSET: - field_dict["priceDisplayFactor"] = price_display_factor - if price_display_format is not UNSET: - field_dict["priceDisplayFormat"] = price_display_format - if qty_display_factor is not UNSET: - field_dict["qtyDisplayFactor"] = qty_display_factor - if qty_display_format is not UNSET: - field_dict["qtyDisplayFormat"] = qty_display_format - if security_category is not UNSET: - field_dict["securityCategory"] = security_category - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tick_rule is not UNSET: - field_dict["tickRule"] = tick_rule - if tick_size is not UNSET: - field_dict["tickSize"] = tick_size - if tick_value is not UNSET: - field_dict["tickValue"] = tick_value - if traded_exchanges is not UNSET: - field_dict["tradedExchanges"] = traded_exchanges - if quote_currency is not UNSET: - field_dict["quoteCurrency"] = quote_currency - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _aliases = d.pop("aliases", UNSET) - aliases: Unset | CryptoAliases = ( - UNSET if isinstance(_aliases, Unset) else CryptoAliases.from_dict(_aliases) - ) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency = ( - UNSET if isinstance(_currency, Unset) else Currency(_currency) - ) - - _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date = ( - UNSET if isinstance(_listed_dt, Unset) else Date.from_dict(_listed_dt) - ) - - _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date = ( - UNSET if isinstance(_delisted_dt, Unset) else Date.from_dict(_delisted_dt) - ) - - description = d.pop("description", UNSET) - - exchange_id = d.pop("exchangeId", UNSET) - - id_ = d.pop("id", UNSET) - - multiplier = d.pop("multiplier", UNSET) - - price_base_factor = d.pop("priceBaseFactor", UNSET) - - price_display_factor = d.pop("priceDisplayFactor", UNSET) - - _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat = ( - UNSET - if isinstance(_price_display_format, Unset) - else NumericDisplayFormat(_price_display_format) - ) - - qty_display_factor = d.pop("qtyDisplayFactor", UNSET) - - _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat = ( - UNSET - if isinstance(_qty_display_format, Unset) - else NumericDisplayFormat(_qty_display_format) - ) - - _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory = ( - UNSET - if isinstance(_security_category, Unset) - else SecurityCategory(_security_category) - ) - - symbol = d.pop("symbol", UNSET) - - tick_rule = d.pop("tickRule", UNSET) - - tick_size = d.pop("tickSize", UNSET) - - tick_value = d.pop("tickValue", UNSET) - - traded_exchanges = [] - _traded_exchanges = d.pop("tradedExchanges", UNSET) - for traded_exchanges_item_data in _traded_exchanges or []: - traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) - - traded_exchanges.append(traded_exchanges_item) - - _quote_currency = d.pop("quoteCurrency", UNSET) - quote_currency: Unset | Currency = ( - UNSET if isinstance(_quote_currency, Unset) else Currency(_quote_currency) - ) - - crypto = cls( - aliases=aliases, - currency=currency, - listed_dt=listed_dt, - delisted_dt=delisted_dt, - description=description, - exchange_id=exchange_id, - id_=id_, - multiplier=multiplier, - price_base_factor=price_base_factor, - price_display_factor=price_display_factor, - price_display_format=price_display_format, - qty_display_factor=qty_display_factor, - qty_display_format=qty_display_format, - security_category=security_category, - symbol=symbol, - tick_rule=tick_rule, - tick_size=tick_size, - tick_value=tick_value, - traded_exchanges=traded_exchanges, - quote_currency=quote_currency, - ) - - return crypto diff --git a/openapi_project/openapi_package/models/crypto_aliases.py b/openapi_project/openapi_package/models/crypto_aliases.py deleted file mode 100644 index a9f4abe0e..000000000 --- a/openapi_project/openapi_package/models/crypto_aliases.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="CryptoAliases") - - -@_attrs_define -class CryptoAliases: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - crypto_aliases = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - crypto_aliases.additional_properties = additional_properties - return crypto_aliases - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/currency.py b/openapi_project/openapi_package/models/currency.py deleted file mode 100644 index bb1f74189..000000000 --- a/openapi_project/openapi_package/models/currency.py +++ /dev/null @@ -1,180 +0,0 @@ -from enum import Enum - - -class Currency(str, Enum): - CURRENCY_AED = "CURRENCY_AED" - CURRENCY_AFN = "CURRENCY_AFN" - CURRENCY_ALL = "CURRENCY_ALL" - CURRENCY_AMD = "CURRENCY_AMD" - CURRENCY_ANG = "CURRENCY_ANG" - CURRENCY_AOA = "CURRENCY_AOA" - CURRENCY_ARS = "CURRENCY_ARS" - CURRENCY_AUD = "CURRENCY_AUD" - CURRENCY_AWG = "CURRENCY_AWG" - CURRENCY_AZN = "CURRENCY_AZN" - CURRENCY_BAM = "CURRENCY_BAM" - CURRENCY_BBD = "CURRENCY_BBD" - CURRENCY_BDT = "CURRENCY_BDT" - CURRENCY_BGN = "CURRENCY_BGN" - CURRENCY_BHD = "CURRENCY_BHD" - CURRENCY_BIF = "CURRENCY_BIF" - CURRENCY_BMD = "CURRENCY_BMD" - CURRENCY_BND = "CURRENCY_BND" - CURRENCY_BOB = "CURRENCY_BOB" - CURRENCY_BRL = "CURRENCY_BRL" - CURRENCY_BSD = "CURRENCY_BSD" - CURRENCY_BTC = "CURRENCY_BTC" - CURRENCY_BTN = "CURRENCY_BTN" - CURRENCY_BWP = "CURRENCY_BWP" - CURRENCY_BYR = "CURRENCY_BYR" - CURRENCY_BZD = "CURRENCY_BZD" - CURRENCY_CAD = "CURRENCY_CAD" - CURRENCY_CDF = "CURRENCY_CDF" - CURRENCY_CHF = "CURRENCY_CHF" - CURRENCY_CLP = "CURRENCY_CLP" - CURRENCY_CNH = "CURRENCY_CNH" - CURRENCY_CNY = "CURRENCY_CNY" - CURRENCY_COP = "CURRENCY_COP" - CURRENCY_CRC = "CURRENCY_CRC" - CURRENCY_CUC = "CURRENCY_CUC" - CURRENCY_CUP = "CURRENCY_CUP" - CURRENCY_CVE = "CURRENCY_CVE" - CURRENCY_CZK = "CURRENCY_CZK" - CURRENCY_DEM = "CURRENCY_DEM" - CURRENCY_DJF = "CURRENCY_DJF" - CURRENCY_DKK = "CURRENCY_DKK" - CURRENCY_DOP = "CURRENCY_DOP" - CURRENCY_DZD = "CURRENCY_DZD" - CURRENCY_EEK = "CURRENCY_EEK" - CURRENCY_EGP = "CURRENCY_EGP" - CURRENCY_ERN = "CURRENCY_ERN" - CURRENCY_ETB = "CURRENCY_ETB" - CURRENCY_ETH = "CURRENCY_ETH" - CURRENCY_EUR = "CURRENCY_EUR" - CURRENCY_FJD = "CURRENCY_FJD" - CURRENCY_FKP = "CURRENCY_FKP" - CURRENCY_GBP = "CURRENCY_GBP" - CURRENCY_GBX = "CURRENCY_GBX" - CURRENCY_GEL = "CURRENCY_GEL" - CURRENCY_GGP = "CURRENCY_GGP" - CURRENCY_GHS = "CURRENCY_GHS" - CURRENCY_GIP = "CURRENCY_GIP" - CURRENCY_GMD = "CURRENCY_GMD" - CURRENCY_GNF = "CURRENCY_GNF" - CURRENCY_GTQ = "CURRENCY_GTQ" - CURRENCY_GYD = "CURRENCY_GYD" - CURRENCY_HKD = "CURRENCY_HKD" - CURRENCY_HNL = "CURRENCY_HNL" - CURRENCY_HRK = "CURRENCY_HRK" - CURRENCY_HTG = "CURRENCY_HTG" - CURRENCY_HUF = "CURRENCY_HUF" - CURRENCY_IDR = "CURRENCY_IDR" - CURRENCY_ILS = "CURRENCY_ILS" - CURRENCY_IMP = "CURRENCY_IMP" - CURRENCY_INR = "CURRENCY_INR" - CURRENCY_IQD = "CURRENCY_IQD" - CURRENCY_IRR = "CURRENCY_IRR" - CURRENCY_ISK = "CURRENCY_ISK" - CURRENCY_JEP = "CURRENCY_JEP" - CURRENCY_JMD = "CURRENCY_JMD" - CURRENCY_JOD = "CURRENCY_JOD" - CURRENCY_JPY = "CURRENCY_JPY" - CURRENCY_KES = "CURRENCY_KES" - CURRENCY_KGS = "CURRENCY_KGS" - CURRENCY_KHR = "CURRENCY_KHR" - CURRENCY_KMF = "CURRENCY_KMF" - CURRENCY_KPW = "CURRENCY_KPW" - CURRENCY_KRW = "CURRENCY_KRW" - CURRENCY_KWD = "CURRENCY_KWD" - CURRENCY_KYD = "CURRENCY_KYD" - CURRENCY_KZT = "CURRENCY_KZT" - CURRENCY_LAK = "CURRENCY_LAK" - CURRENCY_LBP = "CURRENCY_LBP" - CURRENCY_LKR = "CURRENCY_LKR" - CURRENCY_LRD = "CURRENCY_LRD" - CURRENCY_LSL = "CURRENCY_LSL" - CURRENCY_LTL = "CURRENCY_LTL" - CURRENCY_LVL = "CURRENCY_LVL" - CURRENCY_LYD = "CURRENCY_LYD" - CURRENCY_MAD = "CURRENCY_MAD" - CURRENCY_MDL = "CURRENCY_MDL" - CURRENCY_MGA = "CURRENCY_MGA" - CURRENCY_MKD = "CURRENCY_MKD" - CURRENCY_MMK = "CURRENCY_MMK" - CURRENCY_MNT = "CURRENCY_MNT" - CURRENCY_MOP = "CURRENCY_MOP" - CURRENCY_MRO = "CURRENCY_MRO" - CURRENCY_MUR = "CURRENCY_MUR" - CURRENCY_MVR = "CURRENCY_MVR" - CURRENCY_MWK = "CURRENCY_MWK" - CURRENCY_MXN = "CURRENCY_MXN" - CURRENCY_MYR = "CURRENCY_MYR" - CURRENCY_MZN = "CURRENCY_MZN" - CURRENCY_NAD = "CURRENCY_NAD" - CURRENCY_NGN = "CURRENCY_NGN" - CURRENCY_NIO = "CURRENCY_NIO" - CURRENCY_NLG = "CURRENCY_NLG" - CURRENCY_NOK = "CURRENCY_NOK" - CURRENCY_NPR = "CURRENCY_NPR" - CURRENCY_NZD = "CURRENCY_NZD" - CURRENCY_OMR = "CURRENCY_OMR" - CURRENCY_PAB = "CURRENCY_PAB" - CURRENCY_PEN = "CURRENCY_PEN" - CURRENCY_PGK = "CURRENCY_PGK" - CURRENCY_PHP = "CURRENCY_PHP" - CURRENCY_PKR = "CURRENCY_PKR" - CURRENCY_PLN = "CURRENCY_PLN" - CURRENCY_PYG = "CURRENCY_PYG" - CURRENCY_QAR = "CURRENCY_QAR" - CURRENCY_RON = "CURRENCY_RON" - CURRENCY_RSD = "CURRENCY_RSD" - CURRENCY_RUB = "CURRENCY_RUB" - CURRENCY_RWF = "CURRENCY_RWF" - CURRENCY_SAR = "CURRENCY_SAR" - CURRENCY_SBD = "CURRENCY_SBD" - CURRENCY_SCR = "CURRENCY_SCR" - CURRENCY_SDG = "CURRENCY_SDG" - CURRENCY_SEK = "CURRENCY_SEK" - CURRENCY_SGD = "CURRENCY_SGD" - CURRENCY_SHP = "CURRENCY_SHP" - CURRENCY_SKK = "CURRENCY_SKK" - CURRENCY_SLL = "CURRENCY_SLL" - CURRENCY_SOS = "CURRENCY_SOS" - CURRENCY_SPL = "CURRENCY_SPL" - CURRENCY_SRD = "CURRENCY_SRD" - CURRENCY_STD = "CURRENCY_STD" - CURRENCY_SVC = "CURRENCY_SVC" - CURRENCY_SYP = "CURRENCY_SYP" - CURRENCY_SZL = "CURRENCY_SZL" - CURRENCY_THB = "CURRENCY_THB" - CURRENCY_TJS = "CURRENCY_TJS" - CURRENCY_TMT = "CURRENCY_TMT" - CURRENCY_TND = "CURRENCY_TND" - CURRENCY_TOP = "CURRENCY_TOP" - CURRENCY_TRY = "CURRENCY_TRY" - CURRENCY_TTD = "CURRENCY_TTD" - CURRENCY_TVD = "CURRENCY_TVD" - CURRENCY_TWD = "CURRENCY_TWD" - CURRENCY_TZS = "CURRENCY_TZS" - CURRENCY_UAH = "CURRENCY_UAH" - CURRENCY_UGX = "CURRENCY_UGX" - CURRENCY_USD = "CURRENCY_USD" - CURRENCY_UYU = "CURRENCY_UYU" - CURRENCY_UZS = "CURRENCY_UZS" - CURRENCY_VEF = "CURRENCY_VEF" - CURRENCY_VND = "CURRENCY_VND" - CURRENCY_VUV = "CURRENCY_VUV" - CURRENCY_WST = "CURRENCY_WST" - CURRENCY_XAF = "CURRENCY_XAF" - CURRENCY_XCD = "CURRENCY_XCD" - CURRENCY_XDR = "CURRENCY_XDR" - CURRENCY_XOF = "CURRENCY_XOF" - CURRENCY_XPF = "CURRENCY_XPF" - CURRENCY_XXX = "CURRENCY_XXX" - CURRENCY_YER = "CURRENCY_YER" - CURRENCY_ZAR = "CURRENCY_ZAR" - CURRENCY_ZMW = "CURRENCY_ZMW" - CURRENCY_ZWD = "CURRENCY_ZWD" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/cxl_rej_response_to.py b/openapi_project/openapi_package/models/cxl_rej_response_to.py deleted file mode 100644 index 294c6354a..000000000 --- a/openapi_project/openapi_package/models/cxl_rej_response_to.py +++ /dev/null @@ -1,14 +0,0 @@ -from enum import Enum - - -class CxlRejResponseTo(str, Enum): - CXL_REJ_RESPONSE_TO_ORDER_CANCEL_REPLACE_REQUEST = ( - "CXL_REJ_RESPONSE_TO_ORDER_CANCEL_REPLACE_REQUEST" - ) - CXL_REJ_RESPONSE_TO_ORDER_CANCEL_REQUEST = ( - "CXL_REJ_RESPONSE_TO_ORDER_CANCEL_REQUEST" - ) - CXL_REJ_RESPONSE_TO_UNKNOWN = "CXL_REJ_RESPONSE_TO_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/date.py b/openapi_project/openapi_package/models/date.py deleted file mode 100644 index f2b47ca29..000000000 --- a/openapi_project/openapi_package/models/date.py +++ /dev/null @@ -1,64 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="Date") - - -@_attrs_define -class Date: - """ - Attributes: - year (Unset | int): - month (Unset | int): - day (Unset | int): - """ - - year: Unset | int = UNSET - month: Unset | int = UNSET - day: Unset | int = UNSET - - def to_dict(self) -> dict[str, Any]: - year = self.year - - month = self.month - - day = self.day - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if year is not UNSET: - field_dict["year"] = year - if month is not UNSET: - field_dict["month"] = month - if day is not UNSET: - field_dict["day"] = day - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - year = d.pop("year", UNSET) - - month = d.pop("month", UNSET) - - day = d.pop("day", UNSET) - - date = cls( - year=year, - month=month, - day=day, - ) - - return date diff --git a/openapi_project/openapi_package/models/easy_to_borrow_security.py b/openapi_project/openapi_package/models/easy_to_borrow_security.py deleted file mode 100644 index b5b5f85d2..000000000 --- a/openapi_project/openapi_package/models/easy_to_borrow_security.py +++ /dev/null @@ -1,55 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="EasyToBorrowSecurity") - - -@_attrs_define -class EasyToBorrowSecurity: - """ - Attributes: - symbol (Unset | str): - locate_id (Unset | str): - """ - - symbol: Unset | str = UNSET - locate_id: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - symbol = self.symbol - - locate_id = self.locate_id - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if symbol is not UNSET: - field_dict["symbol"] = symbol - if locate_id is not UNSET: - field_dict["locateId"] = locate_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - symbol = d.pop("symbol", UNSET) - - locate_id = d.pop("locateId", UNSET) - - easy_to_borrow_security = cls( - symbol=symbol, - locate_id=locate_id, - ) - - return easy_to_borrow_security diff --git a/openapi_project/openapi_package/models/empty.py b/openapi_project/openapi_package/models/empty.py deleted file mode 100644 index b615a58ca..000000000 --- a/openapi_project/openapi_package/models/empty.py +++ /dev/null @@ -1,29 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="Empty") - - -@_attrs_define -class Empty: - """ """ - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - empty = cls() - - return empty diff --git a/openapi_project/openapi_package/models/exchange.py b/openapi_project/openapi_package/models/exchange.py deleted file mode 100644 index ce815ccba..000000000 --- a/openapi_project/openapi_package/models/exchange.py +++ /dev/null @@ -1,163 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="Exchange") - - -@_attrs_define -class Exchange: - """ - Attributes: - country (Unset | str): - description (Unset | str): - display_name (Unset | str): - id_ (Unset | int): - mic (Unset | str): - microsoft_timezone (Unset | str): - name (Unset | str): - olson_timezone (Unset | str): - operating_mic (Unset | str): - region (Unset | str): - short_code (Unset | str): - suffix (Unset | str): - utc_offset (Unset | int): - website (Unset | str): - """ - - country: Unset | str = UNSET - description: Unset | str = UNSET - display_name: Unset | str = UNSET - id_: Unset | int = UNSET - mic: Unset | str = UNSET - microsoft_timezone: Unset | str = UNSET - name: Unset | str = UNSET - olson_timezone: Unset | str = UNSET - operating_mic: Unset | str = UNSET - region: Unset | str = UNSET - short_code: Unset | str = UNSET - suffix: Unset | str = UNSET - utc_offset: Unset | int = UNSET - website: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - country = self.country - - description = self.description - - display_name = self.display_name - - id_ = self.id_ - - mic = self.mic - - microsoft_timezone = self.microsoft_timezone - - name = self.name - - olson_timezone = self.olson_timezone - - operating_mic = self.operating_mic - - region = self.region - - short_code = self.short_code - - suffix = self.suffix - - utc_offset = self.utc_offset - - website = self.website - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if country is not UNSET: - field_dict["Country"] = country - if description is not UNSET: - field_dict["Description"] = description - if display_name is not UNSET: - field_dict["DisplayName"] = display_name - if id_ is not UNSET: - field_dict["Id"] = id - if mic is not UNSET: - field_dict["MIC"] = mic - if microsoft_timezone is not UNSET: - field_dict["MicrosoftTimezone"] = microsoft_timezone - if name is not UNSET: - field_dict["Name"] = name - if olson_timezone is not UNSET: - field_dict["OlsonTimezone"] = olson_timezone - if operating_mic is not UNSET: - field_dict["OperatingMIC"] = operating_mic - if region is not UNSET: - field_dict["Region"] = region - if short_code is not UNSET: - field_dict["ShortCode"] = short_code - if suffix is not UNSET: - field_dict["Suffix"] = suffix - if utc_offset is not UNSET: - field_dict["UtcOffset"] = utc_offset - if website is not UNSET: - field_dict["Website"] = website - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - country = d.pop("Country", UNSET) - - description = d.pop("Description", UNSET) - - display_name = d.pop("DisplayName", UNSET) - - id_ =d.pop("Id", UNSET) - - mic = d.pop("MIC", UNSET) - - microsoft_timezone = d.pop("MicrosoftTimezone", UNSET) - - name = d.pop("Name", UNSET) - - olson_timezone = d.pop("OlsonTimezone", UNSET) - - operating_mic = d.pop("OperatingMIC", UNSET) - - region = d.pop("Region", UNSET) - - short_code = d.pop("ShortCode", UNSET) - - suffix = d.pop("Suffix", UNSET) - - utc_offset = d.pop("UtcOffset", UNSET) - - website = d.pop("Website", UNSET) - - exchange = cls( - country=country, - description=description, - display_name=display_name, - id_=id_, - mic=mic, - microsoft_timezone=microsoft_timezone, - name=name, - olson_timezone=olson_timezone, - operating_mic=operating_mic, - region=region, - short_code=short_code, - suffix=suffix, - utc_offset=utc_offset, - website=website, - ) - - return exchange diff --git a/openapi_project/openapi_package/models/exchange_code.py b/openapi_project/openapi_package/models/exchange_code.py deleted file mode 100644 index fff12c425..000000000 --- a/openapi_project/openapi_package/models/exchange_code.py +++ /dev/null @@ -1,72 +0,0 @@ -from enum import Enum - - -class ExchangeCode(str, Enum): - EXCHANGE_CODE_AMXO = "EXCHANGE_CODE_AMXO" - EXCHANGE_CODE_ARCO = "EXCHANGE_CODE_ARCO" - EXCHANGE_CODE_ARCX = "EXCHANGE_CODE_ARCX" - EXCHANGE_CODE_BATO = "EXCHANGE_CODE_BATO" - EXCHANGE_CODE_BATS = "EXCHANGE_CODE_BATS" - EXCHANGE_CODE_BATY = "EXCHANGE_CODE_BATY" - EXCHANGE_CODE_BLCK = "EXCHANGE_CODE_BLCK" - EXCHANGE_CODE_C2OX = "EXCHANGE_CODE_C2OX" - EXCHANGE_CODE_CBSX = "EXCHANGE_CODE_CBSX" - EXCHANGE_CODE_CGIX = "EXCHANGE_CODE_CGIX" - EXCHANGE_CODE_CSMI = "EXCHANGE_CODE_CSMI" - EXCHANGE_CODE_DJXX = "EXCHANGE_CODE_DJXX" - EXCHANGE_CODE_EDGA = "EXCHANGE_CODE_EDGA" - EXCHANGE_CODE_EDGO = "EXCHANGE_CODE_EDGO" - EXCHANGE_CODE_EDGX = "EXCHANGE_CODE_EDGX" - EXCHANGE_CODE_EMLD = "EXCHANGE_CODE_EMLD" - EXCHANGE_CODE_EPRL = "EXCHANGE_CODE_EPRL" - EXCHANGE_CODE_GIDS = "EXCHANGE_CODE_GIDS" - EXCHANGE_CODE_GLBX = "EXCHANGE_CODE_GLBX" - EXCHANGE_CODE_GMNI = "EXCHANGE_CODE_GMNI" - EXCHANGE_CODE_IEXG = "EXCHANGE_CODE_IEXG" - EXCHANGE_CODE_LTSE = "EXCHANGE_CODE_LTSE" - EXCHANGE_CODE_MCRY = "EXCHANGE_CODE_MCRY" - EXCHANGE_CODE_MEMX = "EXCHANGE_CODE_MEMX" - EXCHANGE_CODE_MPRL = "EXCHANGE_CODE_MPRL" - EXCHANGE_CODE_MSCI = "EXCHANGE_CODE_MSCI" - EXCHANGE_CODE_MSTR = "EXCHANGE_CODE_MSTR" - EXCHANGE_CODE_MXOP = "EXCHANGE_CODE_MXOP" - EXCHANGE_CODE_OOTC = "EXCHANGE_CODE_OOTC" - EXCHANGE_CODE_OPRA = "EXCHANGE_CODE_OPRA" - EXCHANGE_CODE_OTCB = "EXCHANGE_CODE_OTCB" - EXCHANGE_CODE_OTCM = "EXCHANGE_CODE_OTCM" - EXCHANGE_CODE_OTCQ = "EXCHANGE_CODE_OTCQ" - EXCHANGE_CODE_PINC = "EXCHANGE_CODE_PINC" - EXCHANGE_CODE_PINX = "EXCHANGE_CODE_PINX" - EXCHANGE_CODE_RTXX = "EXCHANGE_CODE_RTXX" - EXCHANGE_CODE_SPHR = "EXCHANGE_CODE_SPHR" - EXCHANGE_CODE_SPXX = "EXCHANGE_CODE_SPXX" - EXCHANGE_CODE_USEQ = "EXCHANGE_CODE_USEQ" - EXCHANGE_CODE_XADF = "EXCHANGE_CODE_XADF" - EXCHANGE_CODE_XASE = "EXCHANGE_CODE_XASE" - EXCHANGE_CODE_XBOS = "EXCHANGE_CODE_XBOS" - EXCHANGE_CODE_XBOX = "EXCHANGE_CODE_XBOX" - EXCHANGE_CODE_XBXO = "EXCHANGE_CODE_XBXO" - EXCHANGE_CODE_XCBF = "EXCHANGE_CODE_XCBF" - EXCHANGE_CODE_XCBO = "EXCHANGE_CODE_XCBO" - EXCHANGE_CODE_XCBT = "EXCHANGE_CODE_XCBT" - EXCHANGE_CODE_XCEC = "EXCHANGE_CODE_XCEC" - EXCHANGE_CODE_XCHI = "EXCHANGE_CODE_XCHI" - EXCHANGE_CODE_XCIS = "EXCHANGE_CODE_XCIS" - EXCHANGE_CODE_XCME = "EXCHANGE_CODE_XCME" - EXCHANGE_CODE_XISE = "EXCHANGE_CODE_XISE" - EXCHANGE_CODE_XISX = "EXCHANGE_CODE_XISX" - EXCHANGE_CODE_XKBT = "EXCHANGE_CODE_XKBT" - EXCHANGE_CODE_XMIO = "EXCHANGE_CODE_XMIO" - EXCHANGE_CODE_XNAS = "EXCHANGE_CODE_XNAS" - EXCHANGE_CODE_XNDQ = "EXCHANGE_CODE_XNDQ" - EXCHANGE_CODE_XNGS = "EXCHANGE_CODE_XNGS" - EXCHANGE_CODE_XNYM = "EXCHANGE_CODE_XNYM" - EXCHANGE_CODE_XNYS = "EXCHANGE_CODE_XNYS" - EXCHANGE_CODE_XOCC = "EXCHANGE_CODE_XOCC" - EXCHANGE_CODE_XOTC = "EXCHANGE_CODE_XOTC" - EXCHANGE_CODE_XPHO = "EXCHANGE_CODE_XPHO" - EXCHANGE_CODE_XPSX = "EXCHANGE_CODE_XPSX" - EXCHANGE_CODE_XXXX = "EXCHANGE_CODE_XXXX" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/exec_type.py b/openapi_project/openapi_package/models/exec_type.py deleted file mode 100644 index 851f1e912..000000000 --- a/openapi_project/openapi_package/models/exec_type.py +++ /dev/null @@ -1,30 +0,0 @@ -from enum import Enum - - -class ExecType(str, Enum): - EXEC_TYPE_CANCELED = "EXEC_TYPE_CANCELED" - EXEC_TYPE_CLAIM_REQUIRED = "EXEC_TYPE_CLAIM_REQUIRED" - EXEC_TYPE_DONE_FOR_DAY = "EXEC_TYPE_DONE_FOR_DAY" - EXEC_TYPE_EXPIRED = "EXEC_TYPE_EXPIRED" - EXEC_TYPE_NEW = "EXEC_TYPE_NEW" - EXEC_TYPE_NOTE = "EXEC_TYPE_NOTE" - EXEC_TYPE_PENDING_CANCEL = "EXEC_TYPE_PENDING_CANCEL" - EXEC_TYPE_PENDING_NEW = "EXEC_TYPE_PENDING_NEW" - EXEC_TYPE_PENDING_REPLACE = "EXEC_TYPE_PENDING_REPLACE" - EXEC_TYPE_QUEUED_ORDER = "EXEC_TYPE_QUEUED_ORDER" - EXEC_TYPE_REJECTED = "EXEC_TYPE_REJECTED" - EXEC_TYPE_REPLACED = "EXEC_TYPE_REPLACED" - EXEC_TYPE_REPRESENTED = "EXEC_TYPE_REPRESENTED" - EXEC_TYPE_RESTATED = "EXEC_TYPE_RESTATED" - EXEC_TYPE_STOPPED = "EXEC_TYPE_STOPPED" - EXEC_TYPE_SUSPENDED = "EXEC_TYPE_SUSPENDED" - EXEC_TYPE_TRADE = "EXEC_TYPE_TRADE" - EXEC_TYPE_TRADE_BUST = "EXEC_TYPE_TRADE_BUST" - EXEC_TYPE_TRADE_CORRECT = "EXEC_TYPE_TRADE_CORRECT" - EXEC_TYPE_UNKNOWN = "EXEC_TYPE_UNKNOWN" - EXEC_TYPE_UPDATE = "EXEC_TYPE_UPDATE" - EXEC_TYPE_UPDATE_OPTIONAL_DATA = "EXEC_TYPE_UPDATE_OPTIONAL_DATA" - EXEC_TYPE_USER_CLAIMED = "EXEC_TYPE_USER_CLAIMED" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/execution.py b/openapi_project/openapi_package/models/execution.py deleted file mode 100644 index 970b95ae1..000000000 --- a/openapi_project/openapi_package/models/execution.py +++ /dev/null @@ -1,624 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.exec_type import ExecType -from openapi_project.openapi_package.models.multi_leg_reporting_type import MultiLegReportingType -from openapi_project.openapi_package.models.ord_status import OrdStatus -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.origination_type import OriginationType -from openapi_project.openapi_package.models.position_effect import PositionEffect -from openapi_project.openapi_package.models.price_type import PriceType -from openapi_project.openapi_package.models.side import Side -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.security import Security - from openapi_project.openapi_package.models.header import Header - from openapi_project.openapi_package.models.execution_optional_data import ExecutionOptionalData - from openapi_project.openapi_package.models.execution_algo import ExecutionAlgo - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - - -T = TypeVar("T", bound="Execution") - - -@_attrs_define -class Execution: - """ - Attributes: - account_id (Unset | int): - algo (Unset | ExecutionAlgo): - alloc_id (Unset | str): - aux_price (Unset | float): - avg_price (Unset | float): - claimed_by (Unset | str): - clearing_info (Unset | ClearingInfo): - commission (Unset | float): - cum_qty (Unset | float): - cur_ord_id (Unset | str): - exec_broker (Unset | str): - exec_id (Unset | str): - exec_ref_id (Unset | str): - exec_type (Unset | ExecType): - fee1 (Unset | float): - fee2 (Unset | float): - header (Unset | Header): - incoming_cl_ord_id (Unset | str): - incoming_ord_id (Unset | str): - incoming_orig_cl_ord_id (Unset | str): - instructions (Unset | list[OrderInstruction]): - last_market (Unset | str): - last_price (Unset | float): - last_qty (Unset | float): - leaves_qty (Unset | float): - leg_id (Unset | str): - liquidity_flag (Unset | str): - multi_leg_reporting_type (Unset | MultiLegReportingType): - optional_data (Unset | ExecutionOptionalData): - order_flags (Unset | int): - ord_status (Unset | OrdStatus): - ord_type (Unset | OrdType): - origination_type (Unset | OriginationType): - orig_ord_id (Unset | str): - parent_ord_id (Unset | str): - perm_ord_id (Unset | str): - position_effect (Unset | PositionEffect): - price (Unset | float): - price_type (Unset | PriceType): - qty (Unset | float): - route (Unset | str): - routing_session (Unset | str): - security (Unset | Security): - side (Unset | Side): - source (Unset | str): - symbol (Unset | str): - tag (Unset | str): - text (Unset | str): - tif (Unset | Tif): - trader_id (Unset | str): - transact_ts (Unset | str): - user_id (Unset | int): - working_qty (Unset | float): - """ - - account_id: Unset | int = UNSET - algo: Unset | ExecutionAlgo = UNSET - alloc_id: Unset | str = UNSET - aux_price: Unset | float = UNSET - avg_price: Unset | float = UNSET - claimed_by: Unset | str = UNSET - clearing_info: Unset | ClearingInfo = UNSET - commission: Unset | float = UNSET - cum_qty: Unset | float = UNSET - cur_ord_id: Unset | str = UNSET - exec_broker: Unset | str = UNSET - exec_id: Unset | str = UNSET - exec_ref_id: Unset | str = UNSET - exec_type: Unset | ExecType = UNSET - fee1: Unset | float = UNSET - fee2: Unset | float = UNSET - header: Unset | Header = UNSET - incoming_cl_ord_id: Unset | str = UNSET - incoming_ord_id: Unset | str = UNSET - incoming_orig_cl_ord_id: Unset | str = UNSET - instructions: Unset | list[OrderInstruction] = UNSET - last_market: Unset | str = UNSET - last_price: Unset | float = UNSET - last_qty: Unset | float = UNSET - leaves_qty: Unset | float = UNSET - leg_id: Unset | str = UNSET - liquidity_flag: Unset | str = UNSET - multi_leg_reporting_type: Unset | MultiLegReportingType = UNSET - optional_data: Unset | ExecutionOptionalData = UNSET - order_flags: Unset | int = UNSET - ord_status: Unset | OrdStatus = UNSET - ord_type: Unset | OrdType = UNSET - origination_type: Unset | OriginationType = UNSET - orig_ord_id: Unset | str = UNSET - parent_ord_id: Unset | str = UNSET - perm_ord_id: Unset | str = UNSET - position_effect: Unset | PositionEffect = UNSET - price: Unset | float = UNSET - price_type: Unset | PriceType = UNSET - qty: Unset | float = UNSET - route: Unset | str = UNSET - routing_session: Unset | str = UNSET - security: Unset | Security = UNSET - side: Unset | Side = UNSET - source: Unset | str = UNSET - symbol: Unset | str = UNSET - tag: Unset | str = UNSET - text: Unset | str = UNSET - tif: Unset | Tif = UNSET - trader_id: Unset | str = UNSET - transact_ts: Unset | str = UNSET - user_id: Unset | int = UNSET - working_qty: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - algo: Unset | dict[str, Any] = ( - UNSET if isinstance(self.algo, Unset) else self.algo.to_dict() - ) - - alloc_id = self.alloc_id - - aux_price = self.aux_price - - avg_price = self.avg_price - - claimed_by = self.claimed_by - - clearing_info: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.clearing_info, Unset) - else self.clearing_info.to_dict() - ) - - commission = self.commission - - cum_qty = self.cum_qty - - cur_ord_id = self.cur_ord_id - - exec_broker = self.exec_broker - - exec_id = self.exec_id - - exec_ref_id = self.exec_ref_id - - exec_type: Unset | str = ( - UNSET if isinstance(self.exec_type, Unset) else self.exec_type.value - ) - - fee1 = self.fee1 - - fee2 = self.fee2 - - header: Unset | dict[str, Any] = ( - UNSET if isinstance(self.header, Unset) else self.header.to_dict() - ) - - incoming_cl_ord_id = self.incoming_cl_ord_id - - incoming_ord_id = self.incoming_ord_id - - incoming_orig_cl_ord_id = self.incoming_orig_cl_ord_id - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - last_market = self.last_market - - last_price = self.last_price - - last_qty = self.last_qty - - leaves_qty = self.leaves_qty - - leg_id = self.leg_id - - liquidity_flag = self.liquidity_flag - - multi_leg_reporting_type: Unset | str = ( - UNSET - if isinstance(self.multi_leg_reporting_type, Unset) - else self.multi_leg_reporting_type.value - ) - - optional_data: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.optional_data, Unset) - else self.optional_data.to_dict() - ) - - order_flags = self.order_flags - - ord_status: Unset | str = ( - UNSET if isinstance(self.ord_status, Unset) else self.ord_status.value - ) - - ord_type: Unset | str = ( - UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value - ) - - origination_type: Unset | str = ( - UNSET - if isinstance(self.origination_type, Unset) - else self.origination_type.value - ) - - orig_ord_id = self.orig_ord_id - - parent_ord_id = self.parent_ord_id - - perm_ord_id = self.perm_ord_id - - position_effect: Unset | str = ( - UNSET - if isinstance(self.position_effect, Unset) - else self.position_effect.value - ) - - price = self.price - - price_type: Unset | str = ( - UNSET if isinstance(self.price_type, Unset) else self.price_type.value - ) - - qty = self.qty - - route = self.route - - routing_session = self.routing_session - - security: Unset | dict[str, Any] = ( - UNSET if isinstance(self.security, Unset) else self.security.to_dict() - ) - - side: Unset | str = UNSET if isinstance(self.side, Unset) else self.side.value - - source = self.source - - symbol = self.symbol - - tag = self.tag - - text = self.text - - tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value - - trader_id = self.trader_id - - transact_ts = self.transact_ts - - user_id = self.user_id - - working_qty = self.working_qty - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if algo is not UNSET: - field_dict["algo"] = algo - if alloc_id is not UNSET: - field_dict["allocId"] = alloc_id - if aux_price is not UNSET: - field_dict["auxPrice"] = aux_price - if avg_price is not UNSET: - field_dict["avgPrice"] = avg_price - if claimed_by is not UNSET: - field_dict["claimedBy"] = claimed_by - if clearing_info is not UNSET: - field_dict["clearingInfo"] = clearing_info - if commission is not UNSET: - field_dict["commission"] = commission - if cum_qty is not UNSET: - field_dict["cumQty"] = cum_qty - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if exec_broker is not UNSET: - field_dict["execBroker"] = exec_broker - if exec_id is not UNSET: - field_dict["execId"] = exec_id - if exec_ref_id is not UNSET: - field_dict["execRefId"] = exec_ref_id - if exec_type is not UNSET: - field_dict["execType"] = exec_type - if fee1 is not UNSET: - field_dict["fee1"] = fee1 - if fee2 is not UNSET: - field_dict["fee2"] = fee2 - if header is not UNSET: - field_dict["header"] = header - if incoming_cl_ord_id is not UNSET: - field_dict["incomingClOrdId"] = incoming_cl_ord_id - if incoming_ord_id is not UNSET: - field_dict["incomingOrdId"] = incoming_ord_id - if incoming_orig_cl_ord_id is not UNSET: - field_dict["incomingOrigClOrdId"] = incoming_orig_cl_ord_id - if instructions is not UNSET: - field_dict["instructions"] = instructions - if last_market is not UNSET: - field_dict["lastMarket"] = last_market - if last_price is not UNSET: - field_dict["lastPrice"] = last_price - if last_qty is not UNSET: - field_dict["lastQty"] = last_qty - if leaves_qty is not UNSET: - field_dict["leavesQty"] = leaves_qty - if leg_id is not UNSET: - field_dict["legId"] = leg_id - if liquidity_flag is not UNSET: - field_dict["liquidityFlag"] = liquidity_flag - if multi_leg_reporting_type is not UNSET: - field_dict["multiLegReportingType"] = multi_leg_reporting_type - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if order_flags is not UNSET: - field_dict["orderFlags"] = order_flags - if ord_status is not UNSET: - field_dict["ordStatus"] = ord_status - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if origination_type is not UNSET: - field_dict["originationType"] = origination_type - if orig_ord_id is not UNSET: - field_dict["origOrdId"] = orig_ord_id - if parent_ord_id is not UNSET: - field_dict["parentOrdId"] = parent_ord_id - if perm_ord_id is not UNSET: - field_dict["permOrdId"] = perm_ord_id - if position_effect is not UNSET: - field_dict["positionEffect"] = position_effect - if price is not UNSET: - field_dict["price"] = price - if price_type is not UNSET: - field_dict["priceType"] = price_type - if qty is not UNSET: - field_dict["qty"] = qty - if route is not UNSET: - field_dict["route"] = route - if routing_session is not UNSET: - field_dict["routingSession"] = routing_session - if security is not UNSET: - field_dict["security"] = security - if side is not UNSET: - field_dict["side"] = side - if source is not UNSET: - field_dict["source"] = source - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tag is not UNSET: - field_dict["tag"] = tag - if text is not UNSET: - field_dict["text"] = text - if tif is not UNSET: - field_dict["tif"] = tif - if trader_id is not UNSET: - field_dict["traderId"] = trader_id - if transact_ts is not UNSET: - field_dict["transactTs"] = transact_ts - if user_id is not UNSET: - field_dict["userId"] = user_id - if working_qty is not UNSET: - field_dict["workingQty"] = working_qty - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - _algo = d.pop("algo", UNSET) - algo: Unset | ExecutionAlgo = ( - UNSET if isinstance(_algo, Unset) else ExecutionAlgo.from_dict(_algo) - ) - - alloc_id = d.pop("allocId", UNSET) - - aux_price = d.pop("auxPrice", UNSET) - - avg_price = d.pop("avgPrice", UNSET) - - claimed_by = d.pop("claimedBy", UNSET) - - _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo = ( - UNSET - if isinstance(_clearing_info, Unset) - else ClearingInfo.from_dict(_clearing_info) - ) - - commission = d.pop("commission", UNSET) - - cum_qty = d.pop("cumQty", UNSET) - - cur_ord_id = d.pop("curOrdId", UNSET) - - exec_broker = d.pop("execBroker", UNSET) - - exec_id = d.pop("execId", UNSET) - - exec_ref_id = d.pop("execRefId", UNSET) - - _exec_type = d.pop("execType", UNSET) - exec_type: Unset | ExecType = ( - UNSET if isinstance(_exec_type, Unset) else ExecType(_exec_type) - ) - - fee1 = d.pop("fee1", UNSET) - - fee2 = d.pop("fee2", UNSET) - - _header = d.pop("header", UNSET) - header: Unset | Header = ( - UNSET if isinstance(_header, Unset) else Header.from_dict(_header) - ) - - incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) - - incoming_ord_id = d.pop("incomingOrdId", UNSET) - - incoming_orig_cl_ord_id = d.pop("incomingOrigClOrdId", UNSET) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - last_market = d.pop("lastMarket", UNSET) - - last_price = d.pop("lastPrice", UNSET) - - last_qty = d.pop("lastQty", UNSET) - - leaves_qty = d.pop("leavesQty", UNSET) - - leg_id = d.pop("legId", UNSET) - - liquidity_flag = d.pop("liquidityFlag", UNSET) - - _multi_leg_reporting_type = d.pop("multiLegReportingType", UNSET) - multi_leg_reporting_type: Unset | MultiLegReportingType = ( - UNSET - if isinstance(_multi_leg_reporting_type, Unset) - else MultiLegReportingType(_multi_leg_reporting_type) - ) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | ExecutionOptionalData = ( - UNSET - if isinstance(_optional_data, Unset) - else ExecutionOptionalData.from_dict(_optional_data) - ) - - order_flags = d.pop("orderFlags", UNSET) - - _ord_status = d.pop("ordStatus", UNSET) - ord_status: Unset | OrdStatus = ( - UNSET if isinstance(_ord_status, Unset) else OrdStatus(_ord_status) - ) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType = ( - UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) - ) - - _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType = ( - UNSET - if isinstance(_origination_type, Unset) - else OriginationType(_origination_type) - ) - - orig_ord_id = d.pop("origOrdId", UNSET) - - parent_ord_id = d.pop("parentOrdId", UNSET) - - perm_ord_id = d.pop("permOrdId", UNSET) - - _position_effect = d.pop("positionEffect", UNSET) - position_effect: Unset | PositionEffect = ( - UNSET - if isinstance(_position_effect, Unset) - else PositionEffect(_position_effect) - ) - - price = d.pop("price", UNSET) - - _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType = ( - UNSET if isinstance(_price_type, Unset) else PriceType(_price_type) - ) - - qty = d.pop("qty", UNSET) - - route = d.pop("route", UNSET) - - routing_session = d.pop("routingSession", UNSET) - - _security = d.pop("security", UNSET) - security: Unset | Security = ( - UNSET if isinstance(_security, Unset) else Security.from_dict(_security) - ) - - _side = d.pop("side", UNSET) - side: Unset | Side = UNSET if isinstance(_side, Unset) else Side(_side) - - source = d.pop("source", UNSET) - - symbol = d.pop("symbol", UNSET) - - tag = d.pop("tag", UNSET) - - text = d.pop("text", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) - - trader_id = d.pop("traderId", UNSET) - - transact_ts = d.pop("transactTs", UNSET) - - user_id = d.pop("userId", UNSET) - - working_qty = d.pop("workingQty", UNSET) - - execution = cls( - account_id=account_id, - algo=algo, - alloc_id=alloc_id, - aux_price=aux_price, - avg_price=avg_price, - claimed_by=claimed_by, - clearing_info=clearing_info, - commission=commission, - cum_qty=cum_qty, - cur_ord_id=cur_ord_id, - exec_broker=exec_broker, - exec_id=exec_id, - exec_ref_id=exec_ref_id, - exec_type=exec_type, - fee1=fee1, - fee2=fee2, - header=header, - incoming_cl_ord_id=incoming_cl_ord_id, - incoming_ord_id=incoming_ord_id, - incoming_orig_cl_ord_id=incoming_orig_cl_ord_id, - instructions=instructions, - last_market=last_market, - last_price=last_price, - last_qty=last_qty, - leaves_qty=leaves_qty, - leg_id=leg_id, - liquidity_flag=liquidity_flag, - multi_leg_reporting_type=multi_leg_reporting_type, - optional_data=optional_data, - order_flags=order_flags, - ord_status=ord_status, - ord_type=ord_type, - origination_type=origination_type, - orig_ord_id=orig_ord_id, - parent_ord_id=parent_ord_id, - perm_ord_id=perm_ord_id, - position_effect=position_effect, - price=price, - price_type=price_type, - qty=qty, - route=route, - routing_session=routing_session, - security=security, - side=side, - source=source, - symbol=symbol, - tag=tag, - text=text, - tif=tif, - trader_id=trader_id, - transact_ts=transact_ts, - user_id=user_id, - working_qty=working_qty, - ) - - return execution diff --git a/openapi_project/openapi_package/models/execution_algo.py b/openapi_project/openapi_package/models/execution_algo.py deleted file mode 100644 index a3e0dff97..000000000 --- a/openapi_project/openapi_package/models/execution_algo.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="ExecutionAlgo") - - -@_attrs_define -class ExecutionAlgo: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - execution_algo = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - execution_algo.additional_properties = additional_properties - return execution_algo - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/execution_optional_data.py b/openapi_project/openapi_package/models/execution_optional_data.py deleted file mode 100644 index c1df9d80b..000000000 --- a/openapi_project/openapi_package/models/execution_optional_data.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="ExecutionOptionalData") - - -@_attrs_define -class ExecutionOptionalData: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - execution_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - execution_optional_data.additional_properties = additional_properties - return execution_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/flex_option.py b/openapi_project/openapi_package/models/flex_option.py deleted file mode 100644 index 8053990a3..000000000 --- a/openapi_project/openapi_package/models/flex_option.py +++ /dev/null @@ -1,450 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.models.exchange_code import ExchangeCode -from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat -from openapi_project.openapi_package.models.option_exercise_style import OptionExerciseStyle -from openapi_project.openapi_package.models.option_series_product_type import OptionSeriesProductType -from openapi_project.openapi_package.models.option_settlement_type import OptionSettlementType -from openapi_project.openapi_package.models.put_call import PutCall -from openapi_project.openapi_package.models.security_category import SecurityCategory -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.flex_option_aliases import FlexOptionAliases - from openapi_project.openapi_package.models.date import Date - - -T = TypeVar("T", bound="FlexOption") - - -@_attrs_define -class FlexOption: - """ - Attributes: - aliases (Unset | FlexOptionAliases): - currency (Unset | Currency): - listed_dt (Unset | Date): - delisted_dt (Unset | Date): - description (Unset | str): - exchange_id (Unset | int): - id_ (Unset | int): - multiplier (Unset | float): - price_base_factor (Unset | float): - price_display_factor (Unset | float): - price_display_format (Unset | NumericDisplayFormat): - qty_display_factor (Unset | float): - qty_display_format (Unset | NumericDisplayFormat): - security_category (Unset | SecurityCategory): - symbol (Unset | str): - tick_rule (Unset | str): - tick_size (Unset | float): - tick_value (Unset | float): - traded_exchanges (Unset | list[ExchangeCode]): - cap_percentage (Unset | float): - creation_dt (Unset | Date): - deliverable_per_contract (Unset | float): - exercise_style (Unset | OptionExerciseStyle): - expiration_dt (Unset | Date): - observation_day (Unset | int): - percentage_pricing (Unset | bool): - product_type (Unset | OptionSeriesProductType): - put_call (Unset | PutCall): - root (Unset | str): - root_base (Unset | str): - settlement_type (Unset | OptionSettlementType): - strike (Unset | float): - underlying (Unset | str): - """ - - aliases: Unset | FlexOptionAliases = UNSET - currency: Unset | Currency = UNSET - listed_dt: Unset | Date = UNSET - delisted_dt: Unset | Date = UNSET - description: Unset | str = UNSET - exchange_id: Unset | int = UNSET - id_: Unset | int = UNSET - multiplier: Unset | float = UNSET - price_base_factor: Unset | float = UNSET - price_display_factor: Unset | float = UNSET - price_display_format: Unset | NumericDisplayFormat = UNSET - qty_display_factor: Unset | float = UNSET - qty_display_format: Unset | NumericDisplayFormat = UNSET - security_category: Unset | SecurityCategory = UNSET - symbol: Unset | str = UNSET - tick_rule: Unset | str = UNSET - tick_size: Unset | float = UNSET - tick_value: Unset | float = UNSET - traded_exchanges: Unset | list[ExchangeCode] = UNSET - cap_percentage: Unset | float = UNSET - creation_dt: Unset | Date = UNSET - deliverable_per_contract: Unset | float = UNSET - exercise_style: Unset | OptionExerciseStyle = UNSET - expiration_dt: Unset | Date = UNSET - observation_day: Unset | int = UNSET - percentage_pricing: Unset | bool = UNSET - product_type: Unset | OptionSeriesProductType = UNSET - put_call: Unset | PutCall = UNSET - root: Unset | str = UNSET - root_base: Unset | str = UNSET - settlement_type: Unset | OptionSettlementType = UNSET - strike: Unset | float = UNSET - underlying: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = ( - UNSET if isinstance(self.aliases, Unset) else self.aliases.to_dict() - ) - - currency: Unset | str = ( - UNSET if isinstance(self.currency, Unset) else self.currency.value - ) - - listed_dt: Unset | dict[str, Any] = ( - UNSET if isinstance(self.listed_dt, Unset) else self.listed_dt.to_dict() - ) - - delisted_dt: Unset | dict[str, Any] = ( - UNSET if isinstance(self.delisted_dt, Unset) else self.delisted_dt.to_dict() - ) - - description = self.description - - exchange_id = self.exchange_id - - id_ = self.id_ - - multiplier = self.multiplier - - price_base_factor = self.price_base_factor - - price_display_factor = self.price_display_factor - - price_display_format: Unset | str = ( - UNSET - if isinstance(self.price_display_format, Unset) - else self.price_display_format.value - ) - - qty_display_factor = self.qty_display_factor - - qty_display_format: Unset | str = ( - UNSET - if isinstance(self.qty_display_format, Unset) - else self.qty_display_format.value - ) - - security_category: Unset | str = ( - UNSET - if isinstance(self.security_category, Unset) - else self.security_category.value - ) - - symbol = self.symbol - - tick_rule = self.tick_rule - - tick_size = self.tick_size - - tick_value = self.tick_value - - traded_exchanges: Unset | list[str] = UNSET - if not isinstance(self.traded_exchanges, Unset): - traded_exchanges = [] - for traded_exchanges_item_data in self.traded_exchanges: - traded_exchanges_item = traded_exchanges_item_data.value - traded_exchanges.append(traded_exchanges_item) - - cap_percentage = self.cap_percentage - - creation_dt: Unset | dict[str, Any] = ( - UNSET if isinstance(self.creation_dt, Unset) else self.creation_dt.to_dict() - ) - - deliverable_per_contract = self.deliverable_per_contract - - exercise_style: Unset | str = ( - UNSET - if isinstance(self.exercise_style, Unset) - else self.exercise_style.value - ) - - expiration_dt: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.expiration_dt, Unset) - else self.expiration_dt.to_dict() - ) - - observation_day = self.observation_day - - percentage_pricing = self.percentage_pricing - - product_type: Unset | str = ( - UNSET if isinstance(self.product_type, Unset) else self.product_type.value - ) - - put_call: Unset | str = ( - UNSET if isinstance(self.put_call, Unset) else self.put_call.value - ) - - root = self.root - - root_base = self.root_base - - settlement_type: Unset | str = ( - UNSET - if isinstance(self.settlement_type, Unset) - else self.settlement_type.value - ) - - strike = self.strike - - underlying = self.underlying - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if aliases is not UNSET: - field_dict["aliases"] = aliases - if currency is not UNSET: - field_dict["currency"] = currency - if listed_dt is not UNSET: - field_dict["listedDt"] = listed_dt - if delisted_dt is not UNSET: - field_dict["delistedDt"] = delisted_dt - if description is not UNSET: - field_dict["description"] = description - if exchange_id is not UNSET: - field_dict["exchangeId"] = exchange_id - if id_ is not UNSET: - field_dict["id"] = id - if multiplier is not UNSET: - field_dict["multiplier"] = multiplier - if price_base_factor is not UNSET: - field_dict["priceBaseFactor"] = price_base_factor - if price_display_factor is not UNSET: - field_dict["priceDisplayFactor"] = price_display_factor - if price_display_format is not UNSET: - field_dict["priceDisplayFormat"] = price_display_format - if qty_display_factor is not UNSET: - field_dict["qtyDisplayFactor"] = qty_display_factor - if qty_display_format is not UNSET: - field_dict["qtyDisplayFormat"] = qty_display_format - if security_category is not UNSET: - field_dict["securityCategory"] = security_category - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tick_rule is not UNSET: - field_dict["tickRule"] = tick_rule - if tick_size is not UNSET: - field_dict["tickSize"] = tick_size - if tick_value is not UNSET: - field_dict["tickValue"] = tick_value - if traded_exchanges is not UNSET: - field_dict["tradedExchanges"] = traded_exchanges - if cap_percentage is not UNSET: - field_dict["capPercentage"] = cap_percentage - if creation_dt is not UNSET: - field_dict["creationDt"] = creation_dt - if deliverable_per_contract is not UNSET: - field_dict["deliverablePerContract"] = deliverable_per_contract - if exercise_style is not UNSET: - field_dict["exerciseStyle"] = exercise_style - if expiration_dt is not UNSET: - field_dict["expirationDt"] = expiration_dt - if observation_day is not UNSET: - field_dict["observationDay"] = observation_day - if percentage_pricing is not UNSET: - field_dict["percentagePricing"] = percentage_pricing - if product_type is not UNSET: - field_dict["productType"] = product_type - if put_call is not UNSET: - field_dict["putCall"] = put_call - if root is not UNSET: - field_dict["root"] = root - if root_base is not UNSET: - field_dict["rootBase"] = root_base - if settlement_type is not UNSET: - field_dict["settlementType"] = settlement_type - if strike is not UNSET: - field_dict["strike"] = strike - if underlying is not UNSET: - field_dict["underlying"] = underlying - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _aliases = d.pop("aliases", UNSET) - aliases: Unset | FlexOptionAliases = ( - UNSET - if isinstance(_aliases, Unset) - else FlexOptionAliases.from_dict(_aliases) - ) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency = ( - UNSET if isinstance(_currency, Unset) else Currency(_currency) - ) - - _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date = ( - UNSET if isinstance(_listed_dt, Unset) else Date.from_dict(_listed_dt) - ) - - _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date = ( - UNSET if isinstance(_delisted_dt, Unset) else Date.from_dict(_delisted_dt) - ) - - description = d.pop("description", UNSET) - - exchange_id = d.pop("exchangeId", UNSET) - - id_ = d.pop("id", UNSET) - - multiplier = d.pop("multiplier", UNSET) - - price_base_factor = d.pop("priceBaseFactor", UNSET) - - price_display_factor = d.pop("priceDisplayFactor", UNSET) - - _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat = ( - UNSET - if isinstance(_price_display_format, Unset) - else NumericDisplayFormat(_price_display_format) - ) - - qty_display_factor = d.pop("qtyDisplayFactor", UNSET) - - _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat = ( - UNSET - if isinstance(_qty_display_format, Unset) - else NumericDisplayFormat(_qty_display_format) - ) - - _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory = ( - UNSET - if isinstance(_security_category, Unset) - else SecurityCategory(_security_category) - ) - - symbol = d.pop("symbol", UNSET) - - tick_rule = d.pop("tickRule", UNSET) - - tick_size = d.pop("tickSize", UNSET) - - tick_value = d.pop("tickValue", UNSET) - - traded_exchanges = [] - _traded_exchanges = d.pop("tradedExchanges", UNSET) - for traded_exchanges_item_data in _traded_exchanges or []: - traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) - - traded_exchanges.append(traded_exchanges_item) - - cap_percentage = d.pop("capPercentage", UNSET) - - _creation_dt = d.pop("creationDt", UNSET) - creation_dt: Unset | Date = ( - UNSET if isinstance(_creation_dt, Unset) else Date.from_dict(_creation_dt) - ) - - deliverable_per_contract = d.pop("deliverablePerContract", UNSET) - - _exercise_style = d.pop("exerciseStyle", UNSET) - exercise_style: Unset | OptionExerciseStyle = ( - UNSET - if isinstance(_exercise_style, Unset) - else OptionExerciseStyle(_exercise_style) - ) - - _expiration_dt = d.pop("expirationDt", UNSET) - expiration_dt: Unset | Date = ( - UNSET - if isinstance(_expiration_dt, Unset) - else Date.from_dict(_expiration_dt) - ) - - observation_day = d.pop("observationDay", UNSET) - - percentage_pricing = d.pop("percentagePricing", UNSET) - - _product_type = d.pop("productType", UNSET) - product_type: Unset | OptionSeriesProductType = ( - UNSET - if isinstance(_product_type, Unset) - else OptionSeriesProductType(_product_type) - ) - - _put_call = d.pop("putCall", UNSET) - put_call: Unset | PutCall = ( - UNSET if isinstance(_put_call, Unset) else PutCall(_put_call) - ) - - root = d.pop("root", UNSET) - - root_base = d.pop("rootBase", UNSET) - - _settlement_type = d.pop("settlementType", UNSET) - settlement_type: Unset | OptionSettlementType = ( - UNSET - if isinstance(_settlement_type, Unset) - else OptionSettlementType(_settlement_type) - ) - - strike = d.pop("strike", UNSET) - - underlying = d.pop("underlying", UNSET) - - flex_option = cls( - aliases=aliases, - currency=currency, - listed_dt=listed_dt, - delisted_dt=delisted_dt, - description=description, - exchange_id=exchange_id, - id_=id_, - multiplier=multiplier, - price_base_factor=price_base_factor, - price_display_factor=price_display_factor, - price_display_format=price_display_format, - qty_display_factor=qty_display_factor, - qty_display_format=qty_display_format, - security_category=security_category, - symbol=symbol, - tick_rule=tick_rule, - tick_size=tick_size, - tick_value=tick_value, - traded_exchanges=traded_exchanges, - cap_percentage=cap_percentage, - creation_dt=creation_dt, - deliverable_per_contract=deliverable_per_contract, - exercise_style=exercise_style, - expiration_dt=expiration_dt, - observation_day=observation_day, - percentage_pricing=percentage_pricing, - product_type=product_type, - put_call=put_call, - root=root, - root_base=root_base, - settlement_type=settlement_type, - strike=strike, - underlying=underlying, - ) - - return flex_option diff --git a/openapi_project/openapi_package/models/flex_option_aliases.py b/openapi_project/openapi_package/models/flex_option_aliases.py deleted file mode 100644 index 6a6b28afa..000000000 --- a/openapi_project/openapi_package/models/flex_option_aliases.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="FlexOptionAliases") - - -@_attrs_define -class FlexOptionAliases: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - flex_option_aliases = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - flex_option_aliases.additional_properties = additional_properties - return flex_option_aliases - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/flex_settlement_type.py b/openapi_project/openapi_package/models/flex_settlement_type.py deleted file mode 100644 index 4c2b8eb1a..000000000 --- a/openapi_project/openapi_package/models/flex_settlement_type.py +++ /dev/null @@ -1,12 +0,0 @@ -from enum import Enum - - -class FlexSettlementType(str, Enum): - FLEX_SETTLEMENT_TYPE_AM = "FLEX_SETTLEMENT_TYPE_AM" - FLEX_SETTLEMENT_TYPE_ASIAN = "FLEX_SETTLEMENT_TYPE_ASIAN" - FLEX_SETTLEMENT_TYPE_CLIQUET = "FLEX_SETTLEMENT_TYPE_CLIQUET" - FLEX_SETTLEMENT_TYPE_PM = "FLEX_SETTLEMENT_TYPE_PM" - FLEX_SETTLEMENT_TYPE_PM_CASH = "FLEX_SETTLEMENT_TYPE_PM_CASH" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/future.py b/openapi_project/openapi_package/models/future.py deleted file mode 100644 index e57334762..000000000 --- a/openapi_project/openapi_package/models/future.py +++ /dev/null @@ -1,370 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.models.exchange_code import ExchangeCode -from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat -from openapi_project.openapi_package.models.security_category import SecurityCategory -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.future_root import FutureRoot - from openapi_project.openapi_package.models.future_aliases import FutureAliases - from openapi_project.openapi_package.models.date import Date - - -T = TypeVar("T", bound="Future") - - -@_attrs_define -class Future: - """ - Attributes: - aliases (Unset | FutureAliases): - currency (Unset | Currency): - listed_dt (Unset | Date): - delisted_dt (Unset | Date): - description (Unset | str): - exchange_id (Unset | int): - id_ (Unset | int): - multiplier (Unset | float): - price_base_factor (Unset | float): - price_display_factor (Unset | float): - price_display_format (Unset | NumericDisplayFormat): - qty_display_factor (Unset | float): - qty_display_format (Unset | NumericDisplayFormat): - security_category (Unset | SecurityCategory): - symbol (Unset | str): - tick_rule (Unset | str): - tick_size (Unset | float): - tick_value (Unset | float): - traded_exchanges (Unset | list[ExchangeCode]): - contract_myy (Unset | str): - first_notice_dt (Unset | Date): - first_trade_dt (Unset | Date): - last_notice_dt (Unset | Date): - last_trade_dt (Unset | Date): - root (Unset | FutureRoot): - """ - - aliases: Unset | FutureAliases = UNSET - currency: Unset | Currency = UNSET - listed_dt: Unset | Date = UNSET - delisted_dt: Unset | Date = UNSET - description: Unset | str = UNSET - exchange_id: Unset | int = UNSET - id_: Unset | int = UNSET - multiplier: Unset | float = UNSET - price_base_factor: Unset | float = UNSET - price_display_factor: Unset | float = UNSET - price_display_format: Unset | NumericDisplayFormat = UNSET - qty_display_factor: Unset | float = UNSET - qty_display_format: Unset | NumericDisplayFormat = UNSET - security_category: Unset | SecurityCategory = UNSET - symbol: Unset | str = UNSET - tick_rule: Unset | str = UNSET - tick_size: Unset | float = UNSET - tick_value: Unset | float = UNSET - traded_exchanges: Unset | list[ExchangeCode] = UNSET - contract_myy: Unset | str = UNSET - first_notice_dt: Unset | Date = UNSET - first_trade_dt: Unset | Date = UNSET - last_notice_dt: Unset | Date = UNSET - last_trade_dt: Unset | Date = UNSET - root: Unset | FutureRoot = UNSET - - def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = ( - UNSET if isinstance(self.aliases, Unset) else self.aliases.to_dict() - ) - - currency: Unset | str = ( - UNSET if isinstance(self.currency, Unset) else self.currency.value - ) - - listed_dt: Unset | dict[str, Any] = ( - UNSET if isinstance(self.listed_dt, Unset) else self.listed_dt.to_dict() - ) - - delisted_dt: Unset | dict[str, Any] = ( - UNSET if isinstance(self.delisted_dt, Unset) else self.delisted_dt.to_dict() - ) - - description = self.description - - exchange_id = self.exchange_id - - id_ = self.id_ - - multiplier = self.multiplier - - price_base_factor = self.price_base_factor - - price_display_factor = self.price_display_factor - - price_display_format: Unset | str = ( - UNSET - if isinstance(self.price_display_format, Unset) - else self.price_display_format.value - ) - - qty_display_factor = self.qty_display_factor - - qty_display_format: Unset | str = ( - UNSET - if isinstance(self.qty_display_format, Unset) - else self.qty_display_format.value - ) - - security_category: Unset | str = ( - UNSET - if isinstance(self.security_category, Unset) - else self.security_category.value - ) - - symbol = self.symbol - - tick_rule = self.tick_rule - - tick_size = self.tick_size - - tick_value = self.tick_value - - traded_exchanges: Unset | list[str] = UNSET - if not isinstance(self.traded_exchanges, Unset): - traded_exchanges = [] - for traded_exchanges_item_data in self.traded_exchanges: - traded_exchanges_item = traded_exchanges_item_data.value - traded_exchanges.append(traded_exchanges_item) - - contract_myy = self.contract_myy - - first_notice_dt: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.first_notice_dt, Unset) - else self.first_notice_dt.to_dict() - ) - - first_trade_dt: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.first_trade_dt, Unset) - else self.first_trade_dt.to_dict() - ) - - last_notice_dt: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.last_notice_dt, Unset) - else self.last_notice_dt.to_dict() - ) - - last_trade_dt: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.last_trade_dt, Unset) - else self.last_trade_dt.to_dict() - ) - - root: Unset | dict[str, Any] = ( - UNSET if isinstance(self.root, Unset) else self.root.to_dict() - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if aliases is not UNSET: - field_dict["aliases"] = aliases - if currency is not UNSET: - field_dict["currency"] = currency - if listed_dt is not UNSET: - field_dict["listedDt"] = listed_dt - if delisted_dt is not UNSET: - field_dict["delistedDt"] = delisted_dt - if description is not UNSET: - field_dict["description"] = description - if exchange_id is not UNSET: - field_dict["exchangeId"] = exchange_id - if id_ is not UNSET: - field_dict["id"] = id - if multiplier is not UNSET: - field_dict["multiplier"] = multiplier - if price_base_factor is not UNSET: - field_dict["priceBaseFactor"] = price_base_factor - if price_display_factor is not UNSET: - field_dict["priceDisplayFactor"] = price_display_factor - if price_display_format is not UNSET: - field_dict["priceDisplayFormat"] = price_display_format - if qty_display_factor is not UNSET: - field_dict["qtyDisplayFactor"] = qty_display_factor - if qty_display_format is not UNSET: - field_dict["qtyDisplayFormat"] = qty_display_format - if security_category is not UNSET: - field_dict["securityCategory"] = security_category - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tick_rule is not UNSET: - field_dict["tickRule"] = tick_rule - if tick_size is not UNSET: - field_dict["tickSize"] = tick_size - if tick_value is not UNSET: - field_dict["tickValue"] = tick_value - if traded_exchanges is not UNSET: - field_dict["tradedExchanges"] = traded_exchanges - if contract_myy is not UNSET: - field_dict["contractMYY"] = contract_myy - if first_notice_dt is not UNSET: - field_dict["firstNoticeDt"] = first_notice_dt - if first_trade_dt is not UNSET: - field_dict["firstTradeDt"] = first_trade_dt - if last_notice_dt is not UNSET: - field_dict["lastNoticeDt"] = last_notice_dt - if last_trade_dt is not UNSET: - field_dict["lastTradeDt"] = last_trade_dt - if root is not UNSET: - field_dict["root"] = root - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _aliases = d.pop("aliases", UNSET) - aliases: Unset | FutureAliases = ( - UNSET if isinstance(_aliases, Unset) else FutureAliases.from_dict(_aliases) - ) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency = ( - UNSET if isinstance(_currency, Unset) else Currency(_currency) - ) - - _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date = ( - UNSET if isinstance(_listed_dt, Unset) else Date.from_dict(_listed_dt) - ) - - _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date = ( - UNSET if isinstance(_delisted_dt, Unset) else Date.from_dict(_delisted_dt) - ) - - description = d.pop("description", UNSET) - - exchange_id = d.pop("exchangeId", UNSET) - - id_ = d.pop("id", UNSET) - - multiplier = d.pop("multiplier", UNSET) - - price_base_factor = d.pop("priceBaseFactor", UNSET) - - price_display_factor = d.pop("priceDisplayFactor", UNSET) - - _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat = ( - UNSET - if isinstance(_price_display_format, Unset) - else NumericDisplayFormat(_price_display_format) - ) - - qty_display_factor = d.pop("qtyDisplayFactor", UNSET) - - _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat = ( - UNSET - if isinstance(_qty_display_format, Unset) - else NumericDisplayFormat(_qty_display_format) - ) - - _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory = ( - UNSET - if isinstance(_security_category, Unset) - else SecurityCategory(_security_category) - ) - - symbol = d.pop("symbol", UNSET) - - tick_rule = d.pop("tickRule", UNSET) - - tick_size = d.pop("tickSize", UNSET) - - tick_value = d.pop("tickValue", UNSET) - - traded_exchanges = [] - _traded_exchanges = d.pop("tradedExchanges", UNSET) - for traded_exchanges_item_data in _traded_exchanges or []: - traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) - - traded_exchanges.append(traded_exchanges_item) - - contract_myy = d.pop("contractMYY", UNSET) - - _first_notice_dt = d.pop("firstNoticeDt", UNSET) - first_notice_dt: Unset | Date = ( - UNSET - if isinstance(_first_notice_dt, Unset) - else Date.from_dict(_first_notice_dt) - ) - - _first_trade_dt = d.pop("firstTradeDt", UNSET) - first_trade_dt: Unset | Date = ( - UNSET - if isinstance(_first_trade_dt, Unset) - else Date.from_dict(_first_trade_dt) - ) - - _last_notice_dt = d.pop("lastNoticeDt", UNSET) - last_notice_dt: Unset | Date = ( - UNSET - if isinstance(_last_notice_dt, Unset) - else Date.from_dict(_last_notice_dt) - ) - - _last_trade_dt = d.pop("lastTradeDt", UNSET) - last_trade_dt: Unset | Date = ( - UNSET - if isinstance(_last_trade_dt, Unset) - else Date.from_dict(_last_trade_dt) - ) - - _root = d.pop("root", UNSET) - root: Unset | FutureRoot = ( - UNSET if isinstance(_root, Unset) else FutureRoot.from_dict(_root) - ) - - future = cls( - aliases=aliases, - currency=currency, - listed_dt=listed_dt, - delisted_dt=delisted_dt, - description=description, - exchange_id=exchange_id, - id_=id_, - multiplier=multiplier, - price_base_factor=price_base_factor, - price_display_factor=price_display_factor, - price_display_format=price_display_format, - qty_display_factor=qty_display_factor, - qty_display_format=qty_display_format, - security_category=security_category, - symbol=symbol, - tick_rule=tick_rule, - tick_size=tick_size, - tick_value=tick_value, - traded_exchanges=traded_exchanges, - contract_myy=contract_myy, - first_notice_dt=first_notice_dt, - first_trade_dt=first_trade_dt, - last_notice_dt=last_notice_dt, - last_trade_dt=last_trade_dt, - root=root, - ) - - return future diff --git a/openapi_project/openapi_package/models/future_aliases.py b/openapi_project/openapi_package/models/future_aliases.py deleted file mode 100644 index d2d9b4744..000000000 --- a/openapi_project/openapi_package/models/future_aliases.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="FutureAliases") - - -@_attrs_define -class FutureAliases: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - future_aliases = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - future_aliases.additional_properties = additional_properties - return future_aliases - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/future_root.py b/openapi_project/openapi_package/models/future_root.py deleted file mode 100644 index 37d5cb1d9..000000000 --- a/openapi_project/openapi_package/models/future_root.py +++ /dev/null @@ -1,366 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.models.exchange_code import ExchangeCode -from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat -from openapi_project.openapi_package.models.product_group import ProductGroup -from openapi_project.openapi_package.models.product_sub_group import ProductSubGroup -from openapi_project.openapi_package.models.security_category import SecurityCategory -from openapi_project.openapi_package.models.settlement_deliverable_type import SettlementDeliverableType -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.trading_session_group import TradingSessionGroup - from openapi_project.openapi_package.models.future_root_aliases import FutureRootAliases - from openapi_project.openapi_package.models.date import Date - - -T = TypeVar("T", bound="FutureRoot") - - -@_attrs_define -class FutureRoot: - """ - Attributes: - aliases (Unset | FutureRootAliases): - currency (Unset | Currency): - listed_dt (Unset | Date): - delisted_dt (Unset | Date): - description (Unset | str): - exchange_id (Unset | int): - id_ (Unset | int): - multiplier (Unset | float): - price_base_factor (Unset | float): - price_display_factor (Unset | float): - price_display_format (Unset | NumericDisplayFormat): - qty_display_factor (Unset | float): - qty_display_format (Unset | NumericDisplayFormat): - security_category (Unset | SecurityCategory): - symbol (Unset | str): - tick_rule (Unset | str): - tick_size (Unset | float): - tick_value (Unset | float): - traded_exchanges (Unset | list[ExchangeCode]): - product_group (Unset | ProductGroup): - product_sub_group (Unset | ProductSubGroup): - settlement_deliverable_type (Unset | SettlementDeliverableType): - unit_of_measure (Unset | str): - unit_of_measure_qty (Unset | float): - trading_session_group (Unset | TradingSessionGroup): - """ - - aliases: Unset | FutureRootAliases = UNSET - currency: Unset | Currency = UNSET - listed_dt: Unset | Date = UNSET - delisted_dt: Unset | Date = UNSET - description: Unset | str = UNSET - exchange_id: Unset | int = UNSET - id_: Unset | int = UNSET - multiplier: Unset | float = UNSET - price_base_factor: Unset | float = UNSET - price_display_factor: Unset | float = UNSET - price_display_format: Unset | NumericDisplayFormat = UNSET - qty_display_factor: Unset | float = UNSET - qty_display_format: Unset | NumericDisplayFormat = UNSET - security_category: Unset | SecurityCategory = UNSET - symbol: Unset | str = UNSET - tick_rule: Unset | str = UNSET - tick_size: Unset | float = UNSET - tick_value: Unset | float = UNSET - traded_exchanges: Unset | list[ExchangeCode] = UNSET - product_group: Unset | ProductGroup = UNSET - product_sub_group: Unset | ProductSubGroup = UNSET - settlement_deliverable_type: Unset | SettlementDeliverableType = UNSET - unit_of_measure: Unset | str = UNSET - unit_of_measure_qty: Unset | float = UNSET - trading_session_group: Unset | TradingSessionGroup = UNSET - - def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = ( - UNSET if isinstance(self.aliases, Unset) else self.aliases.to_dict() - ) - - currency: Unset | str = ( - UNSET if isinstance(self.currency, Unset) else self.currency.value - ) - - listed_dt: Unset | dict[str, Any] = ( - UNSET if isinstance(self.listed_dt, Unset) else self.listed_dt.to_dict() - ) - - delisted_dt: Unset | dict[str, Any] = ( - UNSET if isinstance(self.delisted_dt, Unset) else self.delisted_dt.to_dict() - ) - - description = self.description - - exchange_id = self.exchange_id - - id_ = self.id_ - - multiplier = self.multiplier - - price_base_factor = self.price_base_factor - - price_display_factor = self.price_display_factor - - price_display_format: Unset | str = ( - UNSET - if isinstance(self.price_display_format, Unset) - else self.price_display_format.value - ) - - qty_display_factor = self.qty_display_factor - - qty_display_format: Unset | str = ( - UNSET - if isinstance(self.qty_display_format, Unset) - else self.qty_display_format.value - ) - - security_category: Unset | str = ( - UNSET - if isinstance(self.security_category, Unset) - else self.security_category.value - ) - - symbol = self.symbol - - tick_rule = self.tick_rule - - tick_size = self.tick_size - - tick_value = self.tick_value - - traded_exchanges: Unset | list[str] = UNSET - if not isinstance(self.traded_exchanges, Unset): - traded_exchanges = [] - for traded_exchanges_item_data in self.traded_exchanges: - traded_exchanges_item = traded_exchanges_item_data.value - traded_exchanges.append(traded_exchanges_item) - - product_group: Unset | str = ( - UNSET if isinstance(self.product_group, Unset) else self.product_group.value - ) - - product_sub_group: Unset | str = ( - UNSET - if isinstance(self.product_sub_group, Unset) - else self.product_sub_group.value - ) - - settlement_deliverable_type: Unset | str = ( - UNSET - if isinstance(self.settlement_deliverable_type, Unset) - else self.settlement_deliverable_type.value - ) - - unit_of_measure = self.unit_of_measure - - unit_of_measure_qty = self.unit_of_measure_qty - - trading_session_group: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.trading_session_group, Unset) - else self.trading_session_group.to_dict() - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if aliases is not UNSET: - field_dict["aliases"] = aliases - if currency is not UNSET: - field_dict["currency"] = currency - if listed_dt is not UNSET: - field_dict["listedDt"] = listed_dt - if delisted_dt is not UNSET: - field_dict["delistedDt"] = delisted_dt - if description is not UNSET: - field_dict["description"] = description - if exchange_id is not UNSET: - field_dict["exchangeId"] = exchange_id - if id_ is not UNSET: - field_dict["id"] = id - if multiplier is not UNSET: - field_dict["multiplier"] = multiplier - if price_base_factor is not UNSET: - field_dict["priceBaseFactor"] = price_base_factor - if price_display_factor is not UNSET: - field_dict["priceDisplayFactor"] = price_display_factor - if price_display_format is not UNSET: - field_dict["priceDisplayFormat"] = price_display_format - if qty_display_factor is not UNSET: - field_dict["qtyDisplayFactor"] = qty_display_factor - if qty_display_format is not UNSET: - field_dict["qtyDisplayFormat"] = qty_display_format - if security_category is not UNSET: - field_dict["securityCategory"] = security_category - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tick_rule is not UNSET: - field_dict["tickRule"] = tick_rule - if tick_size is not UNSET: - field_dict["tickSize"] = tick_size - if tick_value is not UNSET: - field_dict["tickValue"] = tick_value - if traded_exchanges is not UNSET: - field_dict["tradedExchanges"] = traded_exchanges - if product_group is not UNSET: - field_dict["productGroup"] = product_group - if product_sub_group is not UNSET: - field_dict["productSubGroup"] = product_sub_group - if settlement_deliverable_type is not UNSET: - field_dict["settlementDeliverableType"] = settlement_deliverable_type - if unit_of_measure is not UNSET: - field_dict["unitOfMeasure"] = unit_of_measure - if unit_of_measure_qty is not UNSET: - field_dict["unitOfMeasureQty"] = unit_of_measure_qty - if trading_session_group is not UNSET: - field_dict["tradingSessionGroup"] = trading_session_group - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _aliases = d.pop("aliases", UNSET) - aliases: Unset | FutureRootAliases = ( - UNSET - if isinstance(_aliases, Unset) - else FutureRootAliases.from_dict(_aliases) - ) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency = ( - UNSET if isinstance(_currency, Unset) else Currency(_currency) - ) - - _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date = ( - UNSET if isinstance(_listed_dt, Unset) else Date.from_dict(_listed_dt) - ) - - _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date = ( - UNSET if isinstance(_delisted_dt, Unset) else Date.from_dict(_delisted_dt) - ) - - description = d.pop("description", UNSET) - - exchange_id = d.pop("exchangeId", UNSET) - - id_ = d.pop("id", UNSET) - - multiplier = d.pop("multiplier", UNSET) - - price_base_factor = d.pop("priceBaseFactor", UNSET) - - price_display_factor = d.pop("priceDisplayFactor", UNSET) - - _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat = ( - UNSET - if isinstance(_price_display_format, Unset) - else NumericDisplayFormat(_price_display_format) - ) - - qty_display_factor = d.pop("qtyDisplayFactor", UNSET) - - _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat = ( - UNSET - if isinstance(_qty_display_format, Unset) - else NumericDisplayFormat(_qty_display_format) - ) - - _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory = ( - UNSET - if isinstance(_security_category, Unset) - else SecurityCategory(_security_category) - ) - - symbol = d.pop("symbol", UNSET) - - tick_rule = d.pop("tickRule", UNSET) - - tick_size = d.pop("tickSize", UNSET) - - tick_value = d.pop("tickValue", UNSET) - - traded_exchanges = [] - _traded_exchanges = d.pop("tradedExchanges", UNSET) - for traded_exchanges_item_data in _traded_exchanges or []: - traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) - - traded_exchanges.append(traded_exchanges_item) - - _product_group = d.pop("productGroup", UNSET) - product_group: Unset | ProductGroup = ( - UNSET if isinstance(_product_group, Unset) else ProductGroup(_product_group) - ) - - _product_sub_group = d.pop("productSubGroup", UNSET) - product_sub_group: Unset | ProductSubGroup = ( - UNSET - if isinstance(_product_sub_group, Unset) - else ProductSubGroup(_product_sub_group) - ) - - _settlement_deliverable_type = d.pop("settlementDeliverableType", UNSET) - settlement_deliverable_type: Unset | SettlementDeliverableType = ( - UNSET - if isinstance(_settlement_deliverable_type, Unset) - else SettlementDeliverableType(_settlement_deliverable_type) - ) - - unit_of_measure = d.pop("unitOfMeasure", UNSET) - - unit_of_measure_qty = d.pop("unitOfMeasureQty", UNSET) - - _trading_session_group = d.pop("tradingSessionGroup", UNSET) - trading_session_group: Unset | TradingSessionGroup = ( - UNSET - if isinstance(_trading_session_group, Unset) - else TradingSessionGroup.from_dict(_trading_session_group) - ) - - future_root = cls( - aliases=aliases, - currency=currency, - listed_dt=listed_dt, - delisted_dt=delisted_dt, - description=description, - exchange_id=exchange_id, - id_=id_, - multiplier=multiplier, - price_base_factor=price_base_factor, - price_display_factor=price_display_factor, - price_display_format=price_display_format, - qty_display_factor=qty_display_factor, - qty_display_format=qty_display_format, - security_category=security_category, - symbol=symbol, - tick_rule=tick_rule, - tick_size=tick_size, - tick_value=tick_value, - traded_exchanges=traded_exchanges, - product_group=product_group, - product_sub_group=product_sub_group, - settlement_deliverable_type=settlement_deliverable_type, - unit_of_measure=unit_of_measure, - unit_of_measure_qty=unit_of_measure_qty, - trading_session_group=trading_session_group, - ) - - return future_root diff --git a/openapi_project/openapi_package/models/future_root_aliases.py b/openapi_project/openapi_package/models/future_root_aliases.py deleted file mode 100644 index c9585d2a8..000000000 --- a/openapi_project/openapi_package/models/future_root_aliases.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="FutureRootAliases") - - -@_attrs_define -class FutureRootAliases: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - future_root_aliases = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - future_root_aliases.additional_properties = additional_properties - return future_root_aliases - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/future_spread.py b/openapi_project/openapi_package/models/future_spread.py deleted file mode 100644 index 62c0324b4..000000000 --- a/openapi_project/openapi_package/models/future_spread.py +++ /dev/null @@ -1,395 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.models.exchange_code import ExchangeCode -from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat -from openapi_project.openapi_package.models.security_category import SecurityCategory -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.future_spread_aliases import FutureSpreadAliases - from openapi_project.openapi_package.models.future_spread_leg import FutureSpreadLeg - from openapi_project.openapi_package.models.date import Date - - -T = TypeVar("T", bound="FutureSpread") - - -@_attrs_define -class FutureSpread: - """ - Attributes: - aliases (Unset | FutureSpreadAliases): - currency (Unset | Currency): - listed_dt (Unset | Date): - delisted_dt (Unset | Date): - description (Unset | str): - exchange_id (Unset | int): - id_ (Unset | int): - multiplier (Unset | float): - price_base_factor (Unset | float): - price_display_factor (Unset | float): - price_display_format (Unset | NumericDisplayFormat): - qty_display_factor (Unset | float): - qty_display_format (Unset | NumericDisplayFormat): - security_category (Unset | SecurityCategory): - symbol (Unset | str): - tick_rule (Unset | str): - tick_size (Unset | float): - tick_value (Unset | float): - traded_exchanges (Unset | list[ExchangeCode]): - contract_myy (Unset | str): - display_factor (Unset | float): - first_notice_dt (Unset | Date): - first_trade_dt (Unset | Date): - last_notice_dt (Unset | Date): - last_trade_dt (Unset | Date): - legs (Unset | list[FutureSpreadLeg]): - spread_code (Unset | str): - """ - - aliases: Unset | FutureSpreadAliases = UNSET - currency: Unset | Currency = UNSET - listed_dt: Unset | Date = UNSET - delisted_dt: Unset | Date = UNSET - description: Unset | str = UNSET - exchange_id: Unset | int = UNSET - id_: Unset | int = UNSET - multiplier: Unset | float = UNSET - price_base_factor: Unset | float = UNSET - price_display_factor: Unset | float = UNSET - price_display_format: Unset | NumericDisplayFormat = UNSET - qty_display_factor: Unset | float = UNSET - qty_display_format: Unset | NumericDisplayFormat = UNSET - security_category: Unset | SecurityCategory = UNSET - symbol: Unset | str = UNSET - tick_rule: Unset | str = UNSET - tick_size: Unset | float = UNSET - tick_value: Unset | float = UNSET - traded_exchanges: Unset | list[ExchangeCode] = UNSET - contract_myy: Unset | str = UNSET - display_factor: Unset | float = UNSET - first_notice_dt: Unset | Date = UNSET - first_trade_dt: Unset | Date = UNSET - last_notice_dt: Unset | Date = UNSET - last_trade_dt: Unset | Date = UNSET - legs: Unset | list[FutureSpreadLeg] = UNSET - spread_code: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = ( - UNSET if isinstance(self.aliases, Unset) else self.aliases.to_dict() - ) - - currency: Unset | str = ( - UNSET if isinstance(self.currency, Unset) else self.currency.value - ) - - listed_dt: Unset | dict[str, Any] = ( - UNSET if isinstance(self.listed_dt, Unset) else self.listed_dt.to_dict() - ) - - delisted_dt: Unset | dict[str, Any] = ( - UNSET if isinstance(self.delisted_dt, Unset) else self.delisted_dt.to_dict() - ) - - description = self.description - - exchange_id = self.exchange_id - - id_ = self.id_ - - multiplier = self.multiplier - - price_base_factor = self.price_base_factor - - price_display_factor = self.price_display_factor - - price_display_format: Unset | str = ( - UNSET - if isinstance(self.price_display_format, Unset) - else self.price_display_format.value - ) - - qty_display_factor = self.qty_display_factor - - qty_display_format: Unset | str = ( - UNSET - if isinstance(self.qty_display_format, Unset) - else self.qty_display_format.value - ) - - security_category: Unset | str = ( - UNSET - if isinstance(self.security_category, Unset) - else self.security_category.value - ) - - symbol = self.symbol - - tick_rule = self.tick_rule - - tick_size = self.tick_size - - tick_value = self.tick_value - - traded_exchanges: Unset | list[str] = UNSET - if not isinstance(self.traded_exchanges, Unset): - traded_exchanges = [] - for traded_exchanges_item_data in self.traded_exchanges: - traded_exchanges_item = traded_exchanges_item_data.value - traded_exchanges.append(traded_exchanges_item) - - contract_myy = self.contract_myy - - display_factor = self.display_factor - - first_notice_dt: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.first_notice_dt, Unset) - else self.first_notice_dt.to_dict() - ) - - first_trade_dt: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.first_trade_dt, Unset) - else self.first_trade_dt.to_dict() - ) - - last_notice_dt: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.last_notice_dt, Unset) - else self.last_notice_dt.to_dict() - ) - - last_trade_dt: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.last_trade_dt, Unset) - else self.last_trade_dt.to_dict() - ) - - legs: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.legs, Unset): - legs = [] - for legs_item_data in self.legs: - legs_item = legs_item_data.to_dict() - legs.append(legs_item) - - spread_code = self.spread_code - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if aliases is not UNSET: - field_dict["aliases"] = aliases - if currency is not UNSET: - field_dict["currency"] = currency - if listed_dt is not UNSET: - field_dict["listedDt"] = listed_dt - if delisted_dt is not UNSET: - field_dict["delistedDt"] = delisted_dt - if description is not UNSET: - field_dict["description"] = description - if exchange_id is not UNSET: - field_dict["exchangeId"] = exchange_id - if id_ is not UNSET: - field_dict["id"] = id - if multiplier is not UNSET: - field_dict["multiplier"] = multiplier - if price_base_factor is not UNSET: - field_dict["priceBaseFactor"] = price_base_factor - if price_display_factor is not UNSET: - field_dict["priceDisplayFactor"] = price_display_factor - if price_display_format is not UNSET: - field_dict["priceDisplayFormat"] = price_display_format - if qty_display_factor is not UNSET: - field_dict["qtyDisplayFactor"] = qty_display_factor - if qty_display_format is not UNSET: - field_dict["qtyDisplayFormat"] = qty_display_format - if security_category is not UNSET: - field_dict["securityCategory"] = security_category - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tick_rule is not UNSET: - field_dict["tickRule"] = tick_rule - if tick_size is not UNSET: - field_dict["tickSize"] = tick_size - if tick_value is not UNSET: - field_dict["tickValue"] = tick_value - if traded_exchanges is not UNSET: - field_dict["tradedExchanges"] = traded_exchanges - if contract_myy is not UNSET: - field_dict["contractMYY"] = contract_myy - if display_factor is not UNSET: - field_dict["displayFactor"] = display_factor - if first_notice_dt is not UNSET: - field_dict["firstNoticeDt"] = first_notice_dt - if first_trade_dt is not UNSET: - field_dict["firstTradeDt"] = first_trade_dt - if last_notice_dt is not UNSET: - field_dict["lastNoticeDt"] = last_notice_dt - if last_trade_dt is not UNSET: - field_dict["lastTradeDt"] = last_trade_dt - if legs is not UNSET: - field_dict["legs"] = legs - if spread_code is not UNSET: - field_dict["spreadCode"] = spread_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _aliases = d.pop("aliases", UNSET) - aliases: Unset | FutureSpreadAliases = ( - UNSET - if isinstance(_aliases, Unset) - else FutureSpreadAliases.from_dict(_aliases) - ) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency = ( - UNSET if isinstance(_currency, Unset) else Currency(_currency) - ) - - _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date = ( - UNSET if isinstance(_listed_dt, Unset) else Date.from_dict(_listed_dt) - ) - - _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date = ( - UNSET if isinstance(_delisted_dt, Unset) else Date.from_dict(_delisted_dt) - ) - - description = d.pop("description", UNSET) - - exchange_id = d.pop("exchangeId", UNSET) - - id_ = d.pop("id", UNSET) - - multiplier = d.pop("multiplier", UNSET) - - price_base_factor = d.pop("priceBaseFactor", UNSET) - - price_display_factor = d.pop("priceDisplayFactor", UNSET) - - _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat = ( - UNSET - if isinstance(_price_display_format, Unset) - else NumericDisplayFormat(_price_display_format) - ) - - qty_display_factor = d.pop("qtyDisplayFactor", UNSET) - - _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat = ( - UNSET - if isinstance(_qty_display_format, Unset) - else NumericDisplayFormat(_qty_display_format) - ) - - _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory = ( - UNSET - if isinstance(_security_category, Unset) - else SecurityCategory(_security_category) - ) - - symbol = d.pop("symbol", UNSET) - - tick_rule = d.pop("tickRule", UNSET) - - tick_size = d.pop("tickSize", UNSET) - - tick_value = d.pop("tickValue", UNSET) - - traded_exchanges = [] - _traded_exchanges = d.pop("tradedExchanges", UNSET) - for traded_exchanges_item_data in _traded_exchanges or []: - traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) - - traded_exchanges.append(traded_exchanges_item) - - contract_myy = d.pop("contractMYY", UNSET) - - display_factor = d.pop("displayFactor", UNSET) - - _first_notice_dt = d.pop("firstNoticeDt", UNSET) - first_notice_dt: Unset | Date = ( - UNSET - if isinstance(_first_notice_dt, Unset) - else Date.from_dict(_first_notice_dt) - ) - - _first_trade_dt = d.pop("firstTradeDt", UNSET) - first_trade_dt: Unset | Date = ( - UNSET - if isinstance(_first_trade_dt, Unset) - else Date.from_dict(_first_trade_dt) - ) - - _last_notice_dt = d.pop("lastNoticeDt", UNSET) - last_notice_dt: Unset | Date = ( - UNSET - if isinstance(_last_notice_dt, Unset) - else Date.from_dict(_last_notice_dt) - ) - - _last_trade_dt = d.pop("lastTradeDt", UNSET) - last_trade_dt: Unset | Date = ( - UNSET - if isinstance(_last_trade_dt, Unset) - else Date.from_dict(_last_trade_dt) - ) - - legs = [] - _legs = d.pop("legs", UNSET) - for legs_item_data in _legs or []: - legs_item = FutureSpreadLeg.from_dict(legs_item_data) - - legs.append(legs_item) - - spread_code = d.pop("spreadCode", UNSET) - - future_spread = cls( - aliases=aliases, - currency=currency, - listed_dt=listed_dt, - delisted_dt=delisted_dt, - description=description, - exchange_id=exchange_id, - id_=id_, - multiplier=multiplier, - price_base_factor=price_base_factor, - price_display_factor=price_display_factor, - price_display_format=price_display_format, - qty_display_factor=qty_display_factor, - qty_display_format=qty_display_format, - security_category=security_category, - symbol=symbol, - tick_rule=tick_rule, - tick_size=tick_size, - tick_value=tick_value, - traded_exchanges=traded_exchanges, - contract_myy=contract_myy, - display_factor=display_factor, - first_notice_dt=first_notice_dt, - first_trade_dt=first_trade_dt, - last_notice_dt=last_notice_dt, - last_trade_dt=last_trade_dt, - legs=legs, - spread_code=spread_code, - ) - - return future_spread diff --git a/openapi_project/openapi_package/models/future_spread_aliases.py b/openapi_project/openapi_package/models/future_spread_aliases.py deleted file mode 100644 index 9f563b8b1..000000000 --- a/openapi_project/openapi_package/models/future_spread_aliases.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="FutureSpreadAliases") - - -@_attrs_define -class FutureSpreadAliases: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - future_spread_aliases = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - future_spread_aliases.additional_properties = additional_properties - return future_spread_aliases - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/future_spread_leg.py b/openapi_project/openapi_package/models/future_spread_leg.py deleted file mode 100644 index cee4507d3..000000000 --- a/openapi_project/openapi_package/models/future_spread_leg.py +++ /dev/null @@ -1,114 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.spread_leg_side import SpreadLegSide -from openapi_project.openapi_package.models.spread_leg_type import SpreadLegType -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.future import Future - - -T = TypeVar("T", bound="FutureSpreadLeg") - - -@_attrs_define -class FutureSpreadLeg: - """ - Attributes: - delta (Unset | float): - price (Unset | float): - ratio (Unset | int): - future (Unset | Future): - side (Unset | SpreadLegSide): - spread_leg_type (Unset | SpreadLegType): - """ - - delta: Unset | float = UNSET - price: Unset | float = UNSET - ratio: Unset | int = UNSET - future: Unset | Future = UNSET - side: Unset | SpreadLegSide = UNSET - spread_leg_type: Unset | SpreadLegType = UNSET - - def to_dict(self) -> dict[str, Any]: - delta = self.delta - - price = self.price - - ratio = self.ratio - - future: Unset | dict[str, Any] = ( - UNSET if isinstance(self.future, Unset) else self.future.to_dict() - ) - - side: Unset | str = UNSET if isinstance(self.side, Unset) else self.side.value - - spread_leg_type: Unset | str = ( - UNSET - if isinstance(self.spread_leg_type, Unset) - else self.spread_leg_type.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if delta is not UNSET: - field_dict["delta"] = delta - if price is not UNSET: - field_dict["price"] = price - if ratio is not UNSET: - field_dict["ratio"] = ratio - if future is not UNSET: - field_dict["future"] = future - if side is not UNSET: - field_dict["side"] = side - if spread_leg_type is not UNSET: - field_dict["spreadLegType"] = spread_leg_type - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - delta = d.pop("delta", UNSET) - - price = d.pop("price", UNSET) - - ratio = d.pop("ratio", UNSET) - - _future = d.pop("future", UNSET) - future: Unset | Future = ( - UNSET if isinstance(_future, Unset) else Future.from_dict(_future) - ) - - _side = d.pop("side", UNSET) - side: Unset | SpreadLegSide = ( - UNSET if isinstance(_side, Unset) else SpreadLegSide(_side) - ) - - _spread_leg_type = d.pop("spreadLegType", UNSET) - spread_leg_type: Unset | SpreadLegType = ( - UNSET - if isinstance(_spread_leg_type, Unset) - else SpreadLegType(_spread_leg_type) - ) - - future_spread_leg = cls( - delta=delta, - price=price, - ratio=ratio, - future=future, - side=side, - spread_leg_type=spread_leg_type, - ) - - return future_spread_leg diff --git a/openapi_project/openapi_package/models/fx.py b/openapi_project/openapi_package/models/fx.py deleted file mode 100644 index 233ffa33c..000000000 --- a/openapi_project/openapi_package/models/fx.py +++ /dev/null @@ -1,290 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.models.exchange_code import ExchangeCode -from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat -from openapi_project.openapi_package.models.security_category import SecurityCategory -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.date import Date - from openapi_project.openapi_package.models.fx_aliases import FxAliases - - -T = TypeVar("T", bound="Fx") - - -@_attrs_define -class Fx: - """ - Attributes: - aliases (Unset | FxAliases): - currency (Unset | Currency): - listed_dt (Unset | Date): - delisted_dt (Unset | Date): - description (Unset | str): - exchange_id (Unset | int): - id_ (Unset | int): - multiplier (Unset | float): - price_base_factor (Unset | float): - price_display_factor (Unset | float): - price_display_format (Unset | NumericDisplayFormat): - qty_display_factor (Unset | float): - qty_display_format (Unset | NumericDisplayFormat): - security_category (Unset | SecurityCategory): - symbol (Unset | str): - tick_rule (Unset | str): - tick_size (Unset | float): - tick_value (Unset | float): - traded_exchanges (Unset | list[ExchangeCode]): - quote_currency (Unset | Currency): - """ - - aliases: Unset | FxAliases = UNSET - currency: Unset | Currency = UNSET - listed_dt: Unset | Date = UNSET - delisted_dt: Unset | Date = UNSET - description: Unset | str = UNSET - exchange_id: Unset | int = UNSET - id_: Unset | int = UNSET - multiplier: Unset | float = UNSET - price_base_factor: Unset | float = UNSET - price_display_factor: Unset | float = UNSET - price_display_format: Unset | NumericDisplayFormat = UNSET - qty_display_factor: Unset | float = UNSET - qty_display_format: Unset | NumericDisplayFormat = UNSET - security_category: Unset | SecurityCategory = UNSET - symbol: Unset | str = UNSET - tick_rule: Unset | str = UNSET - tick_size: Unset | float = UNSET - tick_value: Unset | float = UNSET - traded_exchanges: Unset | list[ExchangeCode] = UNSET - quote_currency: Unset | Currency = UNSET - - def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = ( - UNSET if isinstance(self.aliases, Unset) else self.aliases.to_dict() - ) - - currency: Unset | str = ( - UNSET if isinstance(self.currency, Unset) else self.currency.value - ) - - listed_dt: Unset | dict[str, Any] = ( - UNSET if isinstance(self.listed_dt, Unset) else self.listed_dt.to_dict() - ) - - delisted_dt: Unset | dict[str, Any] = ( - UNSET if isinstance(self.delisted_dt, Unset) else self.delisted_dt.to_dict() - ) - - description = self.description - - exchange_id = self.exchange_id - - id_ = self.id_ - - multiplier = self.multiplier - - price_base_factor = self.price_base_factor - - price_display_factor = self.price_display_factor - - price_display_format: Unset | str = ( - UNSET - if isinstance(self.price_display_format, Unset) - else self.price_display_format.value - ) - - qty_display_factor = self.qty_display_factor - - qty_display_format: Unset | str = ( - UNSET - if isinstance(self.qty_display_format, Unset) - else self.qty_display_format.value - ) - - security_category: Unset | str = ( - UNSET - if isinstance(self.security_category, Unset) - else self.security_category.value - ) - - symbol = self.symbol - - tick_rule = self.tick_rule - - tick_size = self.tick_size - - tick_value = self.tick_value - - traded_exchanges: Unset | list[str] = UNSET - if not isinstance(self.traded_exchanges, Unset): - traded_exchanges = [] - for traded_exchanges_item_data in self.traded_exchanges: - traded_exchanges_item = traded_exchanges_item_data.value - traded_exchanges.append(traded_exchanges_item) - - quote_currency: Unset | str = ( - UNSET - if isinstance(self.quote_currency, Unset) - else self.quote_currency.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if aliases is not UNSET: - field_dict["aliases"] = aliases - if currency is not UNSET: - field_dict["currency"] = currency - if listed_dt is not UNSET: - field_dict["listedDt"] = listed_dt - if delisted_dt is not UNSET: - field_dict["delistedDt"] = delisted_dt - if description is not UNSET: - field_dict["description"] = description - if exchange_id is not UNSET: - field_dict["exchangeId"] = exchange_id - if id_ is not UNSET: - field_dict["id"] = id - if multiplier is not UNSET: - field_dict["multiplier"] = multiplier - if price_base_factor is not UNSET: - field_dict["priceBaseFactor"] = price_base_factor - if price_display_factor is not UNSET: - field_dict["priceDisplayFactor"] = price_display_factor - if price_display_format is not UNSET: - field_dict["priceDisplayFormat"] = price_display_format - if qty_display_factor is not UNSET: - field_dict["qtyDisplayFactor"] = qty_display_factor - if qty_display_format is not UNSET: - field_dict["qtyDisplayFormat"] = qty_display_format - if security_category is not UNSET: - field_dict["securityCategory"] = security_category - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tick_rule is not UNSET: - field_dict["tickRule"] = tick_rule - if tick_size is not UNSET: - field_dict["tickSize"] = tick_size - if tick_value is not UNSET: - field_dict["tickValue"] = tick_value - if traded_exchanges is not UNSET: - field_dict["tradedExchanges"] = traded_exchanges - if quote_currency is not UNSET: - field_dict["quoteCurrency"] = quote_currency - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _aliases = d.pop("aliases", UNSET) - aliases: Unset | FxAliases = ( - UNSET if isinstance(_aliases, Unset) else FxAliases.from_dict(_aliases) - ) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency = ( - UNSET if isinstance(_currency, Unset) else Currency(_currency) - ) - - _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date = ( - UNSET if isinstance(_listed_dt, Unset) else Date.from_dict(_listed_dt) - ) - - _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date = ( - UNSET if isinstance(_delisted_dt, Unset) else Date.from_dict(_delisted_dt) - ) - - description = d.pop("description", UNSET) - - exchange_id = d.pop("exchangeId", UNSET) - - id_ = d.pop("id", UNSET) - - multiplier = d.pop("multiplier", UNSET) - - price_base_factor = d.pop("priceBaseFactor", UNSET) - - price_display_factor = d.pop("priceDisplayFactor", UNSET) - - _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat = ( - UNSET - if isinstance(_price_display_format, Unset) - else NumericDisplayFormat(_price_display_format) - ) - - qty_display_factor = d.pop("qtyDisplayFactor", UNSET) - - _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat = ( - UNSET - if isinstance(_qty_display_format, Unset) - else NumericDisplayFormat(_qty_display_format) - ) - - _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory = ( - UNSET - if isinstance(_security_category, Unset) - else SecurityCategory(_security_category) - ) - - symbol = d.pop("symbol", UNSET) - - tick_rule = d.pop("tickRule", UNSET) - - tick_size = d.pop("tickSize", UNSET) - - tick_value = d.pop("tickValue", UNSET) - - traded_exchanges = [] - _traded_exchanges = d.pop("tradedExchanges", UNSET) - for traded_exchanges_item_data in _traded_exchanges or []: - traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) - - traded_exchanges.append(traded_exchanges_item) - - _quote_currency = d.pop("quoteCurrency", UNSET) - quote_currency: Unset | Currency = ( - UNSET if isinstance(_quote_currency, Unset) else Currency(_quote_currency) - ) - - fx = cls( - aliases=aliases, - currency=currency, - listed_dt=listed_dt, - delisted_dt=delisted_dt, - description=description, - exchange_id=exchange_id, - id_=id_, - multiplier=multiplier, - price_base_factor=price_base_factor, - price_display_factor=price_display_factor, - price_display_format=price_display_format, - qty_display_factor=qty_display_factor, - qty_display_format=qty_display_format, - security_category=security_category, - symbol=symbol, - tick_rule=tick_rule, - tick_size=tick_size, - tick_value=tick_value, - traded_exchanges=traded_exchanges, - quote_currency=quote_currency, - ) - - return fx diff --git a/openapi_project/openapi_package/models/fx_aliases.py b/openapi_project/openapi_package/models/fx_aliases.py deleted file mode 100644 index b25e4755f..000000000 --- a/openapi_project/openapi_package/models/fx_aliases.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="FxAliases") - - -@_attrs_define -class FxAliases: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - fx_aliases = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - fx_aliases.additional_properties = additional_properties - return fx_aliases - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/generic_order.py b/openapi_project/openapi_package/models/generic_order.py deleted file mode 100644 index 64eb84072..000000000 --- a/openapi_project/openapi_package/models/generic_order.py +++ /dev/null @@ -1,110 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.multi_leg_order import MultiLegOrder - from openapi_project.openapi_package.models.order_cross import OrderCross - from openapi_project.openapi_package.models.order import Order - from openapi_project.openapi_package.models.multi_leg_order_cross import MultiLegOrderCross - - -T = TypeVar("T", bound="GenericOrder") - - -@_attrs_define -class GenericOrder: - """ - Attributes: - order (Unset | Order): - order_cross (Unset | OrderCross): - multi_leg_order (Unset | MultiLegOrder): - multi_leg_order_cross (Unset | MultiLegOrderCross): - """ - - order: Unset | Order = UNSET - order_cross: Unset | OrderCross = UNSET - multi_leg_order: Unset | MultiLegOrder = UNSET - multi_leg_order_cross: Unset | MultiLegOrderCross = UNSET - - def to_dict(self) -> dict[str, Any]: - order: Unset | dict[str, Any] = ( - UNSET if isinstance(self.order, Unset) else self.order.to_dict() - ) - - order_cross: Unset | dict[str, Any] = ( - UNSET if isinstance(self.order_cross, Unset) else self.order_cross.to_dict() - ) - - multi_leg_order: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.multi_leg_order, Unset) - else self.multi_leg_order.to_dict() - ) - - multi_leg_order_cross: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.multi_leg_order_cross, Unset) - else self.multi_leg_order_cross.to_dict() - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if order is not UNSET: - field_dict["order"] = order - if order_cross is not UNSET: - field_dict["orderCross"] = order_cross - if multi_leg_order is not UNSET: - field_dict["multiLegOrder"] = multi_leg_order - if multi_leg_order_cross is not UNSET: - field_dict["multiLegOrderCross"] = multi_leg_order_cross - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _order = d.pop("order", UNSET) - order: Unset | Order = ( - UNSET if isinstance(_order, Unset) else Order.from_dict(_order) - ) - - _order_cross = d.pop("orderCross", UNSET) - order_cross: Unset | OrderCross = ( - UNSET - if isinstance(_order_cross, Unset) - else OrderCross.from_dict(_order_cross) - ) - - _multi_leg_order = d.pop("multiLegOrder", UNSET) - multi_leg_order: Unset | MultiLegOrder = ( - UNSET - if isinstance(_multi_leg_order, Unset) - else MultiLegOrder.from_dict(_multi_leg_order) - ) - - _multi_leg_order_cross = d.pop("multiLegOrderCross", UNSET) - multi_leg_order_cross: Unset | MultiLegOrderCross = ( - UNSET - if isinstance(_multi_leg_order_cross, Unset) - else MultiLegOrderCross.from_dict(_multi_leg_order_cross) - ) - - generic_order = cls( - order=order, - order_cross=order_cross, - multi_leg_order=multi_leg_order, - multi_leg_order_cross=multi_leg_order_cross, - ) - - return generic_order diff --git a/openapi_project/openapi_package/models/get_active_user_response.py b/openapi_project/openapi_package/models/get_active_user_response.py deleted file mode 100644 index 291bc1506..000000000 --- a/openapi_project/openapi_package/models/get_active_user_response.py +++ /dev/null @@ -1,79 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.user import User - - -T = TypeVar("T", bound="GetActiveUserResponse") - - -@_attrs_define -class GetActiveUserResponse: - """ - Attributes: - user (Unset | User): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - user: Unset | User = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - user: Unset | dict[str, Any] = ( - UNSET if isinstance(self.user, Unset) else self.user.to_dict() - ) - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if user is not UNSET: - field_dict["user"] = user - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _user = d.pop("user", UNSET) - user: Unset | User = ( - UNSET if isinstance(_user, Unset) else User.from_dict(_user) - ) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - get_active_user_response = cls( - user=user, - error_message=error_message, - status_code=status_code, - ) - - return get_active_user_response diff --git a/openapi_project/openapi_package/models/get_server_info_response.py b/openapi_project/openapi_package/models/get_server_info_response.py deleted file mode 100644 index 41bf10c7c..000000000 --- a/openapi_project/openapi_package/models/get_server_info_response.py +++ /dev/null @@ -1,135 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.get_server_info_response_system_settings import GetServerInfoResponseSystemSettings -T = TypeVar("T", bound="GetServerInfoResponse") - - -@_attrs_define -class GetServerInfoResponse: - """ - Attributes: - environment (Unset | str): - server_build_ts (Unset | str): - server_hash (Unset | str): - server_name (Unset | str): - server_version (Unset | str): - site (Unset | str): - system_settings (Unset | GetServerInfoResponseSystemSettings): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - environment: Unset | str = UNSET - server_build_ts: Unset | str = UNSET - server_hash: Unset | str = UNSET - server_name: Unset | str = UNSET - server_version: Unset | str = UNSET - site: Unset | str = UNSET - system_settings: Unset | GetServerInfoResponseSystemSettings = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - environment = self.environment - - server_build_ts = self.server_build_ts - - server_hash = self.server_hash - - server_name = self.server_name - - server_version = self.server_version - - site = self.site - - system_settings: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.system_settings, Unset) - else self.system_settings.to_dict() - ) - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if environment is not UNSET: - field_dict["environment"] = environment - if server_build_ts is not UNSET: - field_dict["serverBuildTs"] = server_build_ts - if server_hash is not UNSET: - field_dict["serverHash"] = server_hash - if server_name is not UNSET: - field_dict["serverName"] = server_name - if server_version is not UNSET: - field_dict["serverVersion"] = server_version - if site is not UNSET: - field_dict["site"] = site - if system_settings is not UNSET: - field_dict["systemSettings"] = system_settings - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - environment = d.pop("environment", UNSET) - - server_build_ts = d.pop("serverBuildTs", UNSET) - - server_hash = d.pop("serverHash", UNSET) - - server_name = d.pop("serverName", UNSET) - - server_version = d.pop("serverVersion", UNSET) - - site = d.pop("site", UNSET) - - _system_settings = d.pop("systemSettings", UNSET) - system_settings: Unset | GetServerInfoResponseSystemSettings = ( - UNSET - if isinstance(_system_settings, Unset) - else GetServerInfoResponseSystemSettings.from_dict(_system_settings) - ) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - get_server_info_response = cls( - environment=environment, - server_build_ts=server_build_ts, - server_hash=server_hash, - server_name=server_name, - server_version=server_version, - site=site, - system_settings=system_settings, - error_message=error_message, - status_code=status_code, - ) - - return get_server_info_response diff --git a/openapi_project/openapi_package/models/get_server_info_response_system_settings.py b/openapi_project/openapi_package/models/get_server_info_response_system_settings.py deleted file mode 100644 index 813ca1811..000000000 --- a/openapi_project/openapi_package/models/get_server_info_response_system_settings.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="GetServerInfoResponseSystemSettings") - - -@_attrs_define -class GetServerInfoResponseSystemSettings: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - get_server_info_response_system_settings = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - get_server_info_response_system_settings.additional_properties = ( - additional_properties - ) - return get_server_info_response_system_settings - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/get_server_time_response.py b/openapi_project/openapi_package/models/get_server_time_response.py deleted file mode 100644 index 65afee073..000000000 --- a/openapi_project/openapi_package/models/get_server_time_response.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="GetServerTimeResponse") - - -@_attrs_define -class GetServerTimeResponse: - """ - Attributes: - server_time_utc (Unset | str): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - server_time_utc: Unset | str = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - server_time_utc = self.server_time_utc - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if server_time_utc is not UNSET: - field_dict["serverTimeUtc"] = server_time_utc - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - server_time_utc = d.pop("serverTimeUtc", UNSET) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - get_server_time_response = cls( - server_time_utc=server_time_utc, - error_message=error_message, - status_code=status_code, - ) - - return get_server_time_response diff --git a/openapi_project/openapi_package/models/get_trading_holidays_response.py b/openapi_project/openapi_package/models/get_trading_holidays_response.py deleted file mode 100644 index 327231be4..000000000 --- a/openapi_project/openapi_package/models/get_trading_holidays_response.py +++ /dev/null @@ -1,84 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.trading_holiday import TradingHoliday - - -T = TypeVar("T", bound="GetTradingHolidaysResponse") - - -@_attrs_define -class GetTradingHolidaysResponse: - """ - Attributes: - trading_holidays (Unset | list[TradingHoliday]): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - trading_holidays: Unset | list[TradingHoliday] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - trading_holidays: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.trading_holidays, Unset): - trading_holidays = [] - for trading_holidays_item_data in self.trading_holidays: - trading_holidays_item = trading_holidays_item_data.to_dict() - trading_holidays.append(trading_holidays_item) - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if trading_holidays is not UNSET: - field_dict["tradingHolidays"] = trading_holidays - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - trading_holidays = [] - _trading_holidays = d.pop("tradingHolidays", UNSET) - for trading_holidays_item_data in _trading_holidays or []: - trading_holidays_item = TradingHoliday.from_dict(trading_holidays_item_data) - - trading_holidays.append(trading_holidays_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - get_trading_holidays_response = cls( - trading_holidays=trading_holidays, - error_message=error_message, - status_code=status_code, - ) - - return get_trading_holidays_response diff --git a/openapi_project/openapi_package/models/header.py b/openapi_project/openapi_package/models/header.py deleted file mode 100644 index 1b22cb13c..000000000 --- a/openapi_project/openapi_package/models/header.py +++ /dev/null @@ -1,109 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="Header") - - -@_attrs_define -class Header: - """ - Attributes: - deliver_to_comp_id (Unset | str): - deliver_to_sub_id (Unset | str): - on_behalf_of_comp_id (Unset | str): - on_behalf_of_sub_id (Unset | str): - sender_comp_id (Unset | str): - sender_sub_id (Unset | str): - target_comp_id (Unset | str): - target_sub_id (Unset | str): - """ - - deliver_to_comp_id: Unset | str = UNSET - deliver_to_sub_id: Unset | str = UNSET - on_behalf_of_comp_id: Unset | str = UNSET - on_behalf_of_sub_id: Unset | str = UNSET - sender_comp_id: Unset | str = UNSET - sender_sub_id: Unset | str = UNSET - target_comp_id: Unset | str = UNSET - target_sub_id: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - deliver_to_comp_id = self.deliver_to_comp_id - - deliver_to_sub_id = self.deliver_to_sub_id - - on_behalf_of_comp_id = self.on_behalf_of_comp_id - - on_behalf_of_sub_id = self.on_behalf_of_sub_id - - sender_comp_id = self.sender_comp_id - - sender_sub_id = self.sender_sub_id - - target_comp_id = self.target_comp_id - - target_sub_id = self.target_sub_id - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if deliver_to_comp_id is not UNSET: - field_dict["deliverToCompId"] = deliver_to_comp_id - if deliver_to_sub_id is not UNSET: - field_dict["deliverToSubId"] = deliver_to_sub_id - if on_behalf_of_comp_id is not UNSET: - field_dict["onBehalfOfCompId"] = on_behalf_of_comp_id - if on_behalf_of_sub_id is not UNSET: - field_dict["onBehalfOfSubId"] = on_behalf_of_sub_id - if sender_comp_id is not UNSET: - field_dict["senderCompId"] = sender_comp_id - if sender_sub_id is not UNSET: - field_dict["senderSubId"] = sender_sub_id - if target_comp_id is not UNSET: - field_dict["targetCompId"] = target_comp_id - if target_sub_id is not UNSET: - field_dict["targetSubId"] = target_sub_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - deliver_to_comp_id = d.pop("deliverToCompId", UNSET) - - deliver_to_sub_id = d.pop("deliverToSubId", UNSET) - - on_behalf_of_comp_id = d.pop("onBehalfOfCompId", UNSET) - - on_behalf_of_sub_id = d.pop("onBehalfOfSubId", UNSET) - - sender_comp_id = d.pop("senderCompId", UNSET) - - sender_sub_id = d.pop("senderSubId", UNSET) - - target_comp_id = d.pop("targetCompId", UNSET) - - target_sub_id = d.pop("targetSubId", UNSET) - - header = cls( - deliver_to_comp_id=deliver_to_comp_id, - deliver_to_sub_id=deliver_to_sub_id, - on_behalf_of_comp_id=on_behalf_of_comp_id, - on_behalf_of_sub_id=on_behalf_of_sub_id, - sender_comp_id=sender_comp_id, - sender_sub_id=sender_sub_id, - target_comp_id=target_comp_id, - target_sub_id=target_sub_id, - ) - - return header diff --git a/openapi_project/openapi_package/models/index.py b/openapi_project/openapi_package/models/index.py deleted file mode 100644 index a109e1a59..000000000 --- a/openapi_project/openapi_package/models/index.py +++ /dev/null @@ -1,274 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.models.exchange_code import ExchangeCode -from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat -from openapi_project.openapi_package.models.security_category import SecurityCategory -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.index_aliases import IndexAliases - from openapi_project.openapi_package.models.date import Date - - -T = TypeVar("T", bound="Index") - - -@_attrs_define -class Index: - """ - Attributes: - aliases (Unset | IndexAliases): - currency (Unset | Currency): - listed_dt (Unset | Date): - delisted_dt (Unset | Date): - description (Unset | str): - exchange_id (Unset | int): - id_ (Unset | int): - multiplier (Unset | float): - price_base_factor (Unset | float): - price_display_factor (Unset | float): - price_display_format (Unset | NumericDisplayFormat): - qty_display_factor (Unset | float): - qty_display_format (Unset | NumericDisplayFormat): - security_category (Unset | SecurityCategory): - symbol (Unset | str): - tick_rule (Unset | str): - tick_size (Unset | float): - tick_value (Unset | float): - traded_exchanges (Unset | list[ExchangeCode]): - """ - - aliases: Unset | IndexAliases = UNSET - currency: Unset | Currency = UNSET - listed_dt: Unset | Date = UNSET - delisted_dt: Unset | Date = UNSET - description: Unset | str = UNSET - exchange_id: Unset | int = UNSET - id_: Unset | int = UNSET - multiplier: Unset | float = UNSET - price_base_factor: Unset | float = UNSET - price_display_factor: Unset | float = UNSET - price_display_format: Unset | NumericDisplayFormat = UNSET - qty_display_factor: Unset | float = UNSET - qty_display_format: Unset | NumericDisplayFormat = UNSET - security_category: Unset | SecurityCategory = UNSET - symbol: Unset | str = UNSET - tick_rule: Unset | str = UNSET - tick_size: Unset | float = UNSET - tick_value: Unset | float = UNSET - traded_exchanges: Unset | list[ExchangeCode] = UNSET - - def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = ( - UNSET if isinstance(self.aliases, Unset) else self.aliases.to_dict() - ) - - currency: Unset | str = ( - UNSET if isinstance(self.currency, Unset) else self.currency.value - ) - - listed_dt: Unset | dict[str, Any] = ( - UNSET if isinstance(self.listed_dt, Unset) else self.listed_dt.to_dict() - ) - - delisted_dt: Unset | dict[str, Any] = ( - UNSET if isinstance(self.delisted_dt, Unset) else self.delisted_dt.to_dict() - ) - - description = self.description - - exchange_id = self.exchange_id - - id_ = self.id_ - - multiplier = self.multiplier - - price_base_factor = self.price_base_factor - - price_display_factor = self.price_display_factor - - price_display_format: Unset | str = ( - UNSET - if isinstance(self.price_display_format, Unset) - else self.price_display_format.value - ) - - qty_display_factor = self.qty_display_factor - - qty_display_format: Unset | str = ( - UNSET - if isinstance(self.qty_display_format, Unset) - else self.qty_display_format.value - ) - - security_category: Unset | str = ( - UNSET - if isinstance(self.security_category, Unset) - else self.security_category.value - ) - - symbol = self.symbol - - tick_rule = self.tick_rule - - tick_size = self.tick_size - - tick_value = self.tick_value - - traded_exchanges: Unset | list[str] = UNSET - if not isinstance(self.traded_exchanges, Unset): - traded_exchanges = [] - for traded_exchanges_item_data in self.traded_exchanges: - traded_exchanges_item = traded_exchanges_item_data.value - traded_exchanges.append(traded_exchanges_item) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if aliases is not UNSET: - field_dict["aliases"] = aliases - if currency is not UNSET: - field_dict["currency"] = currency - if listed_dt is not UNSET: - field_dict["listedDt"] = listed_dt - if delisted_dt is not UNSET: - field_dict["delistedDt"] = delisted_dt - if description is not UNSET: - field_dict["description"] = description - if exchange_id is not UNSET: - field_dict["exchangeId"] = exchange_id - if id_ is not UNSET: - field_dict["id"] = id - if multiplier is not UNSET: - field_dict["multiplier"] = multiplier - if price_base_factor is not UNSET: - field_dict["priceBaseFactor"] = price_base_factor - if price_display_factor is not UNSET: - field_dict["priceDisplayFactor"] = price_display_factor - if price_display_format is not UNSET: - field_dict["priceDisplayFormat"] = price_display_format - if qty_display_factor is not UNSET: - field_dict["qtyDisplayFactor"] = qty_display_factor - if qty_display_format is not UNSET: - field_dict["qtyDisplayFormat"] = qty_display_format - if security_category is not UNSET: - field_dict["securityCategory"] = security_category - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tick_rule is not UNSET: - field_dict["tickRule"] = tick_rule - if tick_size is not UNSET: - field_dict["tickSize"] = tick_size - if tick_value is not UNSET: - field_dict["tickValue"] = tick_value - if traded_exchanges is not UNSET: - field_dict["tradedExchanges"] = traded_exchanges - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _aliases = d.pop("aliases", UNSET) - aliases: Unset | IndexAliases = ( - UNSET if isinstance(_aliases, Unset) else IndexAliases.from_dict(_aliases) - ) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency = ( - UNSET if isinstance(_currency, Unset) else Currency(_currency) - ) - - _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date = ( - UNSET if isinstance(_listed_dt, Unset) else Date.from_dict(_listed_dt) - ) - - _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date = ( - UNSET if isinstance(_delisted_dt, Unset) else Date.from_dict(_delisted_dt) - ) - - description = d.pop("description", UNSET) - - exchange_id = d.pop("exchangeId", UNSET) - - id_ = d.pop("id", UNSET) - - multiplier = d.pop("multiplier", UNSET) - - price_base_factor = d.pop("priceBaseFactor", UNSET) - - price_display_factor = d.pop("priceDisplayFactor", UNSET) - - _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat = ( - UNSET - if isinstance(_price_display_format, Unset) - else NumericDisplayFormat(_price_display_format) - ) - - qty_display_factor = d.pop("qtyDisplayFactor", UNSET) - - _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat = ( - UNSET - if isinstance(_qty_display_format, Unset) - else NumericDisplayFormat(_qty_display_format) - ) - - _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory = ( - UNSET - if isinstance(_security_category, Unset) - else SecurityCategory(_security_category) - ) - - symbol = d.pop("symbol", UNSET) - - tick_rule = d.pop("tickRule", UNSET) - - tick_size = d.pop("tickSize", UNSET) - - tick_value = d.pop("tickValue", UNSET) - - traded_exchanges = [] - _traded_exchanges = d.pop("tradedExchanges", UNSET) - for traded_exchanges_item_data in _traded_exchanges or []: - traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) - - traded_exchanges.append(traded_exchanges_item) - - index = cls( - aliases=aliases, - currency=currency, - listed_dt=listed_dt, - delisted_dt=delisted_dt, - description=description, - exchange_id=exchange_id, - id_=id_, - multiplier=multiplier, - price_base_factor=price_base_factor, - price_display_factor=price_display_factor, - price_display_format=price_display_format, - qty_display_factor=qty_display_factor, - qty_display_format=qty_display_format, - security_category=security_category, - symbol=symbol, - tick_rule=tick_rule, - tick_size=tick_size, - tick_value=tick_value, - traded_exchanges=traded_exchanges, - ) - - return index diff --git a/openapi_project/openapi_package/models/index_aliases.py b/openapi_project/openapi_package/models/index_aliases.py deleted file mode 100644 index c755bf44a..000000000 --- a/openapi_project/openapi_package/models/index_aliases.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="IndexAliases") - - -@_attrs_define -class IndexAliases: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - index_aliases = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - index_aliases.additional_properties = additional_properties - return index_aliases - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/index_at_time_price_format.py b/openapi_project/openapi_package/models/index_at_time_price_format.py new file mode 100644 index 000000000..2ba3c0a8e --- /dev/null +++ b/openapi_project/openapi_package/models/index_at_time_price_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class IndexAtTimePriceFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/index_at_time_price_response_200.py b/openapi_project/openapi_package/models/index_at_time_price_response_200.py new file mode 100644 index 000000000..7b748975e --- /dev/null +++ b/openapi_project/openapi_package/models/index_at_time_price_response_200.py @@ -0,0 +1,183 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="IndexAtTimePriceResponse200") + + + +@_attrs_define +class IndexAtTimePriceResponse200: + """ + Attributes: + sequence (list[int]): + condition (list[int]): + size (list[int]): + price (list[float]): + ext_condition2 (list[int]): + ext_condition1 (list[int]): + ext_condition4 (list[int]): + exchange (list[int]): + ext_condition3 (list[int]): + timestamp (list[str]): + """ + + sequence: list[int] + condition: list[int] + size: list[int] + price: list[float] + ext_condition2: list[int] + ext_condition1: list[int] + ext_condition4: list[int] + exchange: list[int] + ext_condition3: list[int] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + sequence = self.sequence + + + + condition = self.condition + + + + size = self.size + + + + price = self.price + + + + ext_condition2 = self.ext_condition2 + + + + ext_condition1 = self.ext_condition1 + + + + ext_condition4 = self.ext_condition4 + + + + exchange = self.exchange + + + + ext_condition3 = self.ext_condition3 + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "sequence": sequence, + "condition": condition, + "size": size, + "price": price, + "ext_condition2": ext_condition2, + "ext_condition1": ext_condition1, + "ext_condition4": ext_condition4, + "exchange": exchange, + "ext_condition3": ext_condition3, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + sequence = cast(list[int], d.pop("sequence")) + + + condition = cast(list[int], d.pop("condition")) + + + size = cast(list[int], d.pop("size")) + + + price = cast(list[float], d.pop("price")) + + + ext_condition2 = cast(list[int], d.pop("ext_condition2")) + + + ext_condition1 = cast(list[int], d.pop("ext_condition1")) + + + ext_condition4 = cast(list[int], d.pop("ext_condition4")) + + + exchange = cast(list[int], d.pop("exchange")) + + + ext_condition3 = cast(list[int], d.pop("ext_condition3")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + index_at_time_price_response_200 = cls( + sequence=sequence, + condition=condition, + size=size, + price=price, + ext_condition2=ext_condition2, + ext_condition1=ext_condition1, + ext_condition4=ext_condition4, + exchange=exchange, + ext_condition3=ext_condition3, + timestamp=timestamp, + ) + + + + index_at_time_price_response_200.additional_properties = d + return index_at_time_price_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/index_history_eod_format.py b/openapi_project/openapi_package/models/index_history_eod_format.py new file mode 100644 index 000000000..6694acbe8 --- /dev/null +++ b/openapi_project/openapi_package/models/index_history_eod_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class IndexHistoryEodFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/index_history_eod_response_200.py b/openapi_project/openapi_package/models/index_history_eod_response_200.py new file mode 100644 index 000000000..a24d59586 --- /dev/null +++ b/openapi_project/openapi_package/models/index_history_eod_response_200.py @@ -0,0 +1,249 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="IndexHistoryEodResponse200") + + + +@_attrs_define +class IndexHistoryEodResponse200: + """ + Attributes: + ask_size (list[int]): + last_trade (list[str]): + created (list[str]): + ask_condition (list[int]): + count (list[int]): + volume (list[int]): + high (list[float]): + low (list[float]): + bid_size (list[int]): + ask_exchange (list[int]): + bid_exchange (list[int]): + ask (list[float]): + bid (list[float]): + bid_condition (list[int]): + close (list[float]): + open_ (list[float]): + """ + + ask_size: list[int] + last_trade: list[str] + created: list[str] + ask_condition: list[int] + count: list[int] + volume: list[int] + high: list[float] + low: list[float] + bid_size: list[int] + ask_exchange: list[int] + bid_exchange: list[int] + ask: list[float] + bid: list[float] + bid_condition: list[int] + close: list[float] + open_: list[float] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + ask_size = self.ask_size + + + + last_trade = self.last_trade + + + + created = self.created + + + + ask_condition = self.ask_condition + + + + count = self.count + + + + volume = self.volume + + + + high = self.high + + + + low = self.low + + + + bid_size = self.bid_size + + + + ask_exchange = self.ask_exchange + + + + bid_exchange = self.bid_exchange + + + + ask = self.ask + + + + bid = self.bid + + + + bid_condition = self.bid_condition + + + + close = self.close + + + + open_ = self.open_ + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "ask_size": ask_size, + "last_trade": last_trade, + "created": created, + "ask_condition": ask_condition, + "count": count, + "volume": volume, + "high": high, + "low": low, + "bid_size": bid_size, + "ask_exchange": ask_exchange, + "bid_exchange": bid_exchange, + "ask": ask, + "bid": bid, + "bid_condition": bid_condition, + "close": close, + "open": open_, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + ask_size = cast(list[int], d.pop("ask_size")) + + + last_trade = cast(list[str], d.pop("last_trade")) + + + created = cast(list[str], d.pop("created")) + + + ask_condition = cast(list[int], d.pop("ask_condition")) + + + count = cast(list[int], d.pop("count")) + + + volume = cast(list[int], d.pop("volume")) + + + high = cast(list[float], d.pop("high")) + + + low = cast(list[float], d.pop("low")) + + + bid_size = cast(list[int], d.pop("bid_size")) + + + ask_exchange = cast(list[int], d.pop("ask_exchange")) + + + bid_exchange = cast(list[int], d.pop("bid_exchange")) + + + ask = cast(list[float], d.pop("ask")) + + + bid = cast(list[float], d.pop("bid")) + + + bid_condition = cast(list[int], d.pop("bid_condition")) + + + close = cast(list[float], d.pop("close")) + + + open_ = cast(list[float], d.pop("open")) + + + index_history_eod_response_200 = cls( + ask_size=ask_size, + last_trade=last_trade, + created=created, + ask_condition=ask_condition, + count=count, + volume=volume, + high=high, + low=low, + bid_size=bid_size, + ask_exchange=ask_exchange, + bid_exchange=bid_exchange, + ask=ask, + bid=bid, + bid_condition=bid_condition, + close=close, + open_=open_, + ) + + + + index_history_eod_response_200.additional_properties = d + return index_history_eod_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/index_history_ohlc_format.py b/openapi_project/openapi_package/models/index_history_ohlc_format.py new file mode 100644 index 000000000..a6852cb51 --- /dev/null +++ b/openapi_project/openapi_package/models/index_history_ohlc_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class IndexHistoryOhlcFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/index_history_ohlc_interval.py b/openapi_project/openapi_package/models/index_history_ohlc_interval.py new file mode 100644 index 000000000..8eda6530f --- /dev/null +++ b/openapi_project/openapi_package/models/index_history_ohlc_interval.py @@ -0,0 +1,21 @@ +from enum import Enum + +class IndexHistoryOhlcInterval(str, Enum): + TICK = "tick" + VALUE_1 = "10ms" + VALUE_10 = "5m" + VALUE_11 = "10m" + VALUE_12 = "15m" + VALUE_13 = "30m" + VALUE_14 = "1h" + VALUE_2 = "100ms" + VALUE_3 = "500ms" + VALUE_4 = "1s" + VALUE_5 = "5s" + VALUE_6 = "10s" + VALUE_7 = "15s" + VALUE_8 = "30s" + VALUE_9 = "1m" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/index_history_ohlc_response_200.py b/openapi_project/openapi_package/models/index_history_ohlc_response_200.py new file mode 100644 index 000000000..7da68be62 --- /dev/null +++ b/openapi_project/openapi_package/models/index_history_ohlc_response_200.py @@ -0,0 +1,161 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="IndexHistoryOhlcResponse200") + + + +@_attrs_define +class IndexHistoryOhlcResponse200: + """ + Attributes: + volume (list[int]): + high (list[float]): + low (list[float]): + vwap (list[float]): + count (list[int]): + close (list[float]): + open_ (list[float]): + timestamp (list[str]): + """ + + volume: list[int] + high: list[float] + low: list[float] + vwap: list[float] + count: list[int] + close: list[float] + open_: list[float] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + volume = self.volume + + + + high = self.high + + + + low = self.low + + + + vwap = self.vwap + + + + count = self.count + + + + close = self.close + + + + open_ = self.open_ + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "volume": volume, + "high": high, + "low": low, + "vwap": vwap, + "count": count, + "close": close, + "open": open_, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + volume = cast(list[int], d.pop("volume")) + + + high = cast(list[float], d.pop("high")) + + + low = cast(list[float], d.pop("low")) + + + vwap = cast(list[float], d.pop("vwap")) + + + count = cast(list[int], d.pop("count")) + + + close = cast(list[float], d.pop("close")) + + + open_ = cast(list[float], d.pop("open")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + index_history_ohlc_response_200 = cls( + volume=volume, + high=high, + low=low, + vwap=vwap, + count=count, + close=close, + open_=open_, + timestamp=timestamp, + ) + + + + index_history_ohlc_response_200.additional_properties = d + return index_history_ohlc_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/index_history_price_format.py b/openapi_project/openapi_package/models/index_history_price_format.py new file mode 100644 index 000000000..8b2808c5a --- /dev/null +++ b/openapi_project/openapi_package/models/index_history_price_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class IndexHistoryPriceFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/index_history_price_interval.py b/openapi_project/openapi_package/models/index_history_price_interval.py new file mode 100644 index 000000000..8104487f9 --- /dev/null +++ b/openapi_project/openapi_package/models/index_history_price_interval.py @@ -0,0 +1,21 @@ +from enum import Enum + +class IndexHistoryPriceInterval(str, Enum): + TICK = "tick" + VALUE_1 = "10ms" + VALUE_10 = "5m" + VALUE_11 = "10m" + VALUE_12 = "15m" + VALUE_13 = "30m" + VALUE_14 = "1h" + VALUE_2 = "100ms" + VALUE_3 = "500ms" + VALUE_4 = "1s" + VALUE_5 = "5s" + VALUE_6 = "10s" + VALUE_7 = "15s" + VALUE_8 = "30s" + VALUE_9 = "1m" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/index_history_price_response_200.py b/openapi_project/openapi_package/models/index_history_price_response_200.py new file mode 100644 index 000000000..78f0f2014 --- /dev/null +++ b/openapi_project/openapi_package/models/index_history_price_response_200.py @@ -0,0 +1,95 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="IndexHistoryPriceResponse200") + + + +@_attrs_define +class IndexHistoryPriceResponse200: + """ + Attributes: + price (list[float]): + timestamp (list[str]): + """ + + price: list[float] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + price = self.price + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "price": price, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + price = cast(list[float], d.pop("price")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + index_history_price_response_200 = cls( + price=price, + timestamp=timestamp, + ) + + + + index_history_price_response_200.additional_properties = d + return index_history_price_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/index_list_dates_format.py b/openapi_project/openapi_package/models/index_list_dates_format.py new file mode 100644 index 000000000..264a70c8a --- /dev/null +++ b/openapi_project/openapi_package/models/index_list_dates_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class IndexListDatesFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/index_list_dates_response_200.py b/openapi_project/openapi_package/models/index_list_dates_response_200.py new file mode 100644 index 000000000..962277a6f --- /dev/null +++ b/openapi_project/openapi_package/models/index_list_dates_response_200.py @@ -0,0 +1,95 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="IndexListDatesResponse200") + + + +@_attrs_define +class IndexListDatesResponse200: + """ + Attributes: + date (list[str]): + symbol (list[str]): + """ + + date: list[str] + symbol: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + date = self.date + + + + symbol = self.symbol + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "date": date, + "symbol": symbol, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + date = cast(list[str], d.pop("date")) + + + symbol = cast(list[str], d.pop("symbol")) + + + index_list_dates_response_200 = cls( + date=date, + symbol=symbol, + ) + + + + index_list_dates_response_200.additional_properties = d + return index_list_dates_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/index_list_symbols_format.py b/openapi_project/openapi_package/models/index_list_symbols_format.py new file mode 100644 index 000000000..d8cdbe7e4 --- /dev/null +++ b/openapi_project/openapi_package/models/index_list_symbols_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class IndexListSymbolsFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/any_model.py b/openapi_project/openapi_package/models/index_list_symbols_response_200.py similarity index 59% rename from openapi_project/openapi_package/models/any_model.py rename to openapi_project/openapi_package/models/index_list_symbols_response_200.py index 1d30ce01e..dd9d247d1 100644 --- a/openapi_project/openapi_package/models/any_model.py +++ b/openapi_project/openapi_package/models/index_list_symbols_response_200.py @@ -8,46 +8,64 @@ from openapi_project.openapi_package.types import UNSET, Unset +from typing import cast + + + + + + +T = TypeVar("T", bound="IndexListSymbolsResponse200") -T = TypeVar("T", bound="AnyModel") @_attrs_define -class AnyModel: - """ - Attributes: - type_ (str): +class IndexListSymbolsResponse200: """ + Attributes: + symbol (list[str]): + """ - type_: str + symbol: list[str] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + def to_dict(self) -> dict[str, Any]: - type_ = self.type_ + symbol = self.symbol + + + field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - field_dict.update( - { - "@type": type_, - } - ) + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + }) return field_dict + + @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - type_ = d.pop("@type") + symbol = cast(list[str], d.pop("symbol")) + - any_model = cls( - type_=type_, + index_list_symbols_response_200 = cls( + symbol=symbol, ) - any_model.additional_properties = d - return any_model + + + index_list_symbols_response_200.additional_properties = d + return index_list_symbols_response_200 @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/index_snapshot_ohlc_format.py b/openapi_project/openapi_package/models/index_snapshot_ohlc_format.py new file mode 100644 index 000000000..c7efd8953 --- /dev/null +++ b/openapi_project/openapi_package/models/index_snapshot_ohlc_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class IndexSnapshotOhlcFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/index_snapshot_ohlc_response_200.py b/openapi_project/openapi_package/models/index_snapshot_ohlc_response_200.py new file mode 100644 index 000000000..1c0410962 --- /dev/null +++ b/openapi_project/openapi_package/models/index_snapshot_ohlc_response_200.py @@ -0,0 +1,161 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="IndexSnapshotOhlcResponse200") + + + +@_attrs_define +class IndexSnapshotOhlcResponse200: + """ + Attributes: + volume (list[int]): + symbol (list[str]): + high (list[float]): + low (list[float]): + count (list[int]): + close (list[float]): + open_ (list[float]): + timestamp (list[str]): + """ + + volume: list[int] + symbol: list[str] + high: list[float] + low: list[float] + count: list[int] + close: list[float] + open_: list[float] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + volume = self.volume + + + + symbol = self.symbol + + + + high = self.high + + + + low = self.low + + + + count = self.count + + + + close = self.close + + + + open_ = self.open_ + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "volume": volume, + "symbol": symbol, + "high": high, + "low": low, + "count": count, + "close": close, + "open": open_, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + volume = cast(list[int], d.pop("volume")) + + + symbol = cast(list[str], d.pop("symbol")) + + + high = cast(list[float], d.pop("high")) + + + low = cast(list[float], d.pop("low")) + + + count = cast(list[int], d.pop("count")) + + + close = cast(list[float], d.pop("close")) + + + open_ = cast(list[float], d.pop("open")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + index_snapshot_ohlc_response_200 = cls( + volume=volume, + symbol=symbol, + high=high, + low=low, + count=count, + close=close, + open_=open_, + timestamp=timestamp, + ) + + + + index_snapshot_ohlc_response_200.additional_properties = d + return index_snapshot_ohlc_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/index_snapshot_price_format.py b/openapi_project/openapi_package/models/index_snapshot_price_format.py new file mode 100644 index 000000000..8dfba6cad --- /dev/null +++ b/openapi_project/openapi_package/models/index_snapshot_price_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class IndexSnapshotPriceFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/index_snapshot_price_response_200.py b/openapi_project/openapi_package/models/index_snapshot_price_response_200.py new file mode 100644 index 000000000..46c01cedf --- /dev/null +++ b/openapi_project/openapi_package/models/index_snapshot_price_response_200.py @@ -0,0 +1,106 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="IndexSnapshotPriceResponse200") + + + +@_attrs_define +class IndexSnapshotPriceResponse200: + """ + Attributes: + symbol (list[str]): + price (list[float]): + timestamp (list[str]): + """ + + symbol: list[str] + price: list[float] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + price = self.price + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "price": price, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + price = cast(list[float], d.pop("price")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + index_snapshot_price_response_200 = cls( + symbol=symbol, + price=price, + timestamp=timestamp, + ) + + + + index_snapshot_price_response_200.additional_properties = d + return index_snapshot_price_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/list_accounts_response.py b/openapi_project/openapi_package/models/list_accounts_response.py deleted file mode 100644 index de7dddf29..000000000 --- a/openapi_project/openapi_package/models/list_accounts_response.py +++ /dev/null @@ -1,84 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.account import Account - - -T = TypeVar("T", bound="ListAccountsResponse") - - -@_attrs_define -class ListAccountsResponse: - """ - Attributes: - accounts (Unset | list[Account]): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - accounts: Unset | list[Account] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - accounts: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.accounts, Unset): - accounts = [] - for accounts_item_data in self.accounts: - accounts_item = accounts_item_data.to_dict() - accounts.append(accounts_item) - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if accounts is not UNSET: - field_dict["accounts"] = accounts - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - accounts = [] - _accounts = d.pop("accounts", UNSET) - for accounts_item_data in _accounts or []: - accounts_item = Account.from_dict(accounts_item_data) - - accounts.append(accounts_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - list_accounts_response = cls( - accounts=accounts, - error_message=error_message, - status_code=status_code, - ) - - return list_accounts_response diff --git a/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py b/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py deleted file mode 100644 index dbdec99ae..000000000 --- a/openapi_project/openapi_package/models/list_affiliated_trading_firms_response.py +++ /dev/null @@ -1,86 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.trading_firm_slim import TradingFirmSlim - - -T = TypeVar("T", bound="ListAffiliatedTradingFirmsResponse") - - -@_attrs_define -class ListAffiliatedTradingFirmsResponse: - """ - Attributes: - affiliated_firms (Unset | list[TradingFirmSlim]): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - affiliated_firms: Unset | list[TradingFirmSlim] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - affiliated_firms: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.affiliated_firms, Unset): - affiliated_firms = [] - for affiliated_firms_item_data in self.affiliated_firms: - affiliated_firms_item = affiliated_firms_item_data.to_dict() - affiliated_firms.append(affiliated_firms_item) - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if affiliated_firms is not UNSET: - field_dict["affiliatedFirms"] = affiliated_firms - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - affiliated_firms = [] - _affiliated_firms = d.pop("affiliatedFirms", UNSET) - for affiliated_firms_item_data in _affiliated_firms or []: - affiliated_firms_item = TradingFirmSlim.from_dict( - affiliated_firms_item_data - ) - - affiliated_firms.append(affiliated_firms_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - list_affiliated_trading_firms_response = cls( - affiliated_firms=affiliated_firms, - error_message=error_message, - status_code=status_code, - ) - - return list_affiliated_trading_firms_response diff --git a/openapi_project/openapi_package/models/list_easy_to_borrow_securities_request.py b/openapi_project/openapi_package/models/list_easy_to_borrow_securities_request.py deleted file mode 100644 index b8e4188f0..000000000 --- a/openapi_project/openapi_package/models/list_easy_to_borrow_securities_request.py +++ /dev/null @@ -1,55 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="ListEasyToBorrowSecuritiesRequest") - - -@_attrs_define -class ListEasyToBorrowSecuritiesRequest: - """ - Attributes: - trading_firm_id (Unset | int): - account_id (Unset | int): - """ - - trading_firm_id: Unset | int = UNSET - account_id: Unset | int = UNSET - - def to_dict(self) -> dict[str, Any]: - trading_firm_id = self.trading_firm_id - - account_id = self.account_id - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if trading_firm_id is not UNSET: - field_dict["tradingFirmId"] = trading_firm_id - if account_id is not UNSET: - field_dict["accountId"] = account_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - trading_firm_id = d.pop("tradingFirmId", UNSET) - - account_id = d.pop("accountId", UNSET) - - list_easy_to_borrow_securities_request = cls( - trading_firm_id=trading_firm_id, - account_id=account_id, - ) - - return list_easy_to_borrow_securities_request diff --git a/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py b/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py deleted file mode 100644 index 7d5a4f0d1..000000000 --- a/openapi_project/openapi_package/models/list_easy_to_borrow_securities_response.py +++ /dev/null @@ -1,84 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.easy_to_borrow_security import EasyToBorrowSecurity - - -T = TypeVar("T", bound="ListEasyToBorrowSecuritiesResponse") - - -@_attrs_define -class ListEasyToBorrowSecuritiesResponse: - """ - Attributes: - securities (Unset | list[EasyToBorrowSecurity]): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - securities: Unset | list[EasyToBorrowSecurity] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - securities: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.securities, Unset): - securities = [] - for securities_item_data in self.securities: - securities_item = securities_item_data.to_dict() - securities.append(securities_item) - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if securities is not UNSET: - field_dict["securities"] = securities - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - securities = [] - _securities = d.pop("securities", UNSET) - for securities_item_data in _securities or []: - securities_item = EasyToBorrowSecurity.from_dict(securities_item_data) - - securities.append(securities_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - list_easy_to_borrow_securities_response = cls( - securities=securities, - error_message=error_message, - status_code=status_code, - ) - - return list_easy_to_borrow_securities_response diff --git a/openapi_project/openapi_package/models/list_exchanges_response.py b/openapi_project/openapi_package/models/list_exchanges_response.py deleted file mode 100644 index ce18f8f68..000000000 --- a/openapi_project/openapi_package/models/list_exchanges_response.py +++ /dev/null @@ -1,84 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.exchange import Exchange - - -T = TypeVar("T", bound="ListExchangesResponse") - - -@_attrs_define -class ListExchangesResponse: - """ - Attributes: - exchanges (Unset | list[Exchange]): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - exchanges: Unset | list[Exchange] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - exchanges: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.exchanges, Unset): - exchanges = [] - for exchanges_item_data in self.exchanges: - exchanges_item = exchanges_item_data.to_dict() - exchanges.append(exchanges_item) - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if exchanges is not UNSET: - field_dict["exchanges"] = exchanges - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - exchanges = [] - _exchanges = d.pop("exchanges", UNSET) - for exchanges_item_data in _exchanges or []: - exchanges_item = Exchange.from_dict(exchanges_item_data) - - exchanges.append(exchanges_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - list_exchanges_response = cls( - exchanges=exchanges, - error_message=error_message, - status_code=status_code, - ) - - return list_exchanges_response diff --git a/openapi_project/openapi_package/models/list_option_chains_repsonse.py b/openapi_project/openapi_package/models/list_option_chains_repsonse.py deleted file mode 100644 index 7cb006551..000000000 --- a/openapi_project/openapi_package/models/list_option_chains_repsonse.py +++ /dev/null @@ -1,84 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.option_chain import OptionChain - - -T = TypeVar("T", bound="ListOptionChainsRepsonse") - - -@_attrs_define -class ListOptionChainsRepsonse: - """ - Attributes: - option_chains (Unset | list[OptionChain]): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - option_chains: Unset | list[OptionChain] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - option_chains: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.option_chains, Unset): - option_chains = [] - for option_chains_item_data in self.option_chains: - option_chains_item = option_chains_item_data.to_dict() - option_chains.append(option_chains_item) - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if option_chains is not UNSET: - field_dict["optionChains"] = option_chains - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - option_chains = [] - _option_chains = d.pop("optionChains", UNSET) - for option_chains_item_data in _option_chains or []: - option_chains_item = OptionChain.from_dict(option_chains_item_data) - - option_chains.append(option_chains_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - list_option_chains_repsonse = cls( - option_chains=option_chains, - error_message=error_message, - status_code=status_code, - ) - - return list_option_chains_repsonse diff --git a/openapi_project/openapi_package/models/list_option_chains_request.py b/openapi_project/openapi_package/models/list_option_chains_request.py deleted file mode 100644 index 2623150e3..000000000 --- a/openapi_project/openapi_package/models/list_option_chains_request.py +++ /dev/null @@ -1,49 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - - -T = TypeVar("T", bound="ListOptionChainsRequest") - - -@_attrs_define -class ListOptionChainsRequest: - """ - Attributes: - underlying_symbols (Unset | list[str]): - """ - - underlying_symbols: Unset | list[str] = UNSET - - def to_dict(self) -> dict[str, Any]: - underlying_symbols: Unset | list[str] = UNSET - if not isinstance(self.underlying_symbols, Unset): - underlying_symbols = self.underlying_symbols - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if underlying_symbols is not UNSET: - field_dict["underlyingSymbols"] = underlying_symbols - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - underlying_symbols = cast(list[str], d.pop("underlyingSymbols", UNSET)) - - list_option_chains_request = cls( - underlying_symbols=underlying_symbols, - ) - - return list_option_chains_request diff --git a/openapi_project/openapi_package/models/list_orders_response.py b/openapi_project/openapi_package/models/list_orders_response.py deleted file mode 100644 index ed0d79409..000000000 --- a/openapi_project/openapi_package/models/list_orders_response.py +++ /dev/null @@ -1,84 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.generic_order import GenericOrder - - -T = TypeVar("T", bound="ListOrdersResponse") - - -@_attrs_define -class ListOrdersResponse: - """ - Attributes: - orders (Unset | list[GenericOrder]): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - orders: Unset | list[GenericOrder] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - orders: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.orders, Unset): - orders = [] - for orders_item_data in self.orders: - orders_item = orders_item_data.to_dict() - orders.append(orders_item) - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if orders is not UNSET: - field_dict["orders"] = orders - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - orders = [] - _orders = d.pop("orders", UNSET) - for orders_item_data in _orders or []: - orders_item = GenericOrder.from_dict(orders_item_data) - - orders.append(orders_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - list_orders_response = cls( - orders=orders, - error_message=error_message, - status_code=status_code, - ) - - return list_orders_response diff --git a/openapi_project/openapi_package/models/list_positions_response.py b/openapi_project/openapi_package/models/list_positions_response.py deleted file mode 100644 index e1a2ad5ba..000000000 --- a/openapi_project/openapi_package/models/list_positions_response.py +++ /dev/null @@ -1,84 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.position import Position - - -T = TypeVar("T", bound="ListPositionsResponse") - - -@_attrs_define -class ListPositionsResponse: - """ - Attributes: - positions (Unset | list[Position]): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - positions: Unset | list[Position] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - positions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.positions, Unset): - positions = [] - for positions_item_data in self.positions: - positions_item = positions_item_data.to_dict() - positions.append(positions_item) - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if positions is not UNSET: - field_dict["positions"] = positions - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - positions = [] - _positions = d.pop("positions", UNSET) - for positions_item_data in _positions or []: - positions_item = Position.from_dict(positions_item_data) - - positions.append(positions_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - list_positions_response = cls( - positions=positions, - error_message=error_message, - status_code=status_code, - ) - - return list_positions_response diff --git a/openapi_project/openapi_package/models/list_routes_response.py b/openapi_project/openapi_package/models/list_routes_response.py deleted file mode 100644 index 70d5abb02..000000000 --- a/openapi_project/openapi_package/models/list_routes_response.py +++ /dev/null @@ -1,106 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.route_applicability import RouteApplicability - from openapi_project.openapi_package.models.route import Route - - -T = TypeVar("T", bound="ListRoutesResponse") - - -@_attrs_define -class ListRoutesResponse: - """ - Attributes: - routes (Unset | list[Route]): - route_applicabilities (Unset | list[RouteApplicability]): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - routes: Unset | list[Route] = UNSET - route_applicabilities: Unset | list[RouteApplicability] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - routes: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.routes, Unset): - routes = [] - for routes_item_data in self.routes: - routes_item = routes_item_data.to_dict() - routes.append(routes_item) - - route_applicabilities: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.route_applicabilities, Unset): - route_applicabilities = [] - for route_applicabilities_item_data in self.route_applicabilities: - route_applicabilities_item = route_applicabilities_item_data.to_dict() - route_applicabilities.append(route_applicabilities_item) - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if routes is not UNSET: - field_dict["routes"] = routes - if route_applicabilities is not UNSET: - field_dict["routeApplicabilities"] = route_applicabilities - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - routes = [] - _routes = d.pop("routes", UNSET) - for routes_item_data in _routes or []: - routes_item = Route.from_dict(routes_item_data) - - routes.append(routes_item) - - route_applicabilities = [] - _route_applicabilities = d.pop("routeApplicabilities", UNSET) - for route_applicabilities_item_data in _route_applicabilities or []: - route_applicabilities_item = RouteApplicability.from_dict( - route_applicabilities_item_data - ) - - route_applicabilities.append(route_applicabilities_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - list_routes_response = cls( - routes=routes, - route_applicabilities=route_applicabilities, - error_message=error_message, - status_code=status_code, - ) - - return list_routes_response diff --git a/openapi_project/openapi_package/models/list_securities_request.py b/openapi_project/openapi_package/models/list_securities_request.py deleted file mode 100644 index 8f9a1841b..000000000 --- a/openapi_project/openapi_package/models/list_securities_request.py +++ /dev/null @@ -1,49 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - - -T = TypeVar("T", bound="ListSecuritiesRequest") - - -@_attrs_define -class ListSecuritiesRequest: - """ - Attributes: - symbols (Unset | list[str]): - """ - - symbols: Unset | list[str] = UNSET - - def to_dict(self) -> dict[str, Any]: - symbols: Unset | list[str] = UNSET - if not isinstance(self.symbols, Unset): - symbols = self.symbols - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if symbols is not UNSET: - field_dict["symbols"] = symbols - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - symbols = cast(list[str], d.pop("symbols", UNSET)) - - list_securities_request = cls( - symbols=symbols, - ) - - return list_securities_request diff --git a/openapi_project/openapi_package/models/list_securities_response.py b/openapi_project/openapi_package/models/list_securities_response.py deleted file mode 100644 index bdf9969c3..000000000 --- a/openapi_project/openapi_package/models/list_securities_response.py +++ /dev/null @@ -1,84 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.security import Security - - -T = TypeVar("T", bound="ListSecuritiesResponse") - - -@_attrs_define -class ListSecuritiesResponse: - """ - Attributes: - securities (Unset | list[Security]): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - securities: Unset | list[Security] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - securities: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.securities, Unset): - securities = [] - for securities_item_data in self.securities: - securities_item = securities_item_data.to_dict() - securities.append(securities_item) - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if securities is not UNSET: - field_dict["securities"] = securities - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - securities = [] - _securities = d.pop("securities", UNSET) - for securities_item_data in _securities or []: - securities_item = Security.from_dict(securities_item_data) - - securities.append(securities_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - list_securities_response = cls( - securities=securities, - error_message=error_message, - status_code=status_code, - ) - - return list_securities_response diff --git a/openapi_project/openapi_package/models/list_trade_confirms_response.py b/openapi_project/openapi_package/models/list_trade_confirms_response.py deleted file mode 100644 index 6e58b7ad0..000000000 --- a/openapi_project/openapi_package/models/list_trade_confirms_response.py +++ /dev/null @@ -1,84 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.trade_confirm import TradeConfirm - - -T = TypeVar("T", bound="ListTradeConfirmsResponse") - - -@_attrs_define -class ListTradeConfirmsResponse: - """ - Attributes: - trade_confirms (Unset | list[TradeConfirm]): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - trade_confirms: Unset | list[TradeConfirm] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - trade_confirms: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.trade_confirms, Unset): - trade_confirms = [] - for trade_confirms_item_data in self.trade_confirms: - trade_confirms_item = trade_confirms_item_data.to_dict() - trade_confirms.append(trade_confirms_item) - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if trade_confirms is not UNSET: - field_dict["tradeConfirms"] = trade_confirms - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - trade_confirms = [] - _trade_confirms = d.pop("tradeConfirms", UNSET) - for trade_confirms_item_data in _trade_confirms or []: - trade_confirms_item = TradeConfirm.from_dict(trade_confirms_item_data) - - trade_confirms.append(trade_confirms_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - list_trade_confirms_response = cls( - trade_confirms=trade_confirms, - error_message=error_message, - status_code=status_code, - ) - - return list_trade_confirms_response diff --git a/openapi_project/openapi_package/models/list_trading_firms_response.py b/openapi_project/openapi_package/models/list_trading_firms_response.py deleted file mode 100644 index 416eb659c..000000000 --- a/openapi_project/openapi_package/models/list_trading_firms_response.py +++ /dev/null @@ -1,84 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.trading_firm import TradingFirm - - -T = TypeVar("T", bound="ListTradingFirmsResponse") - - -@_attrs_define -class ListTradingFirmsResponse: - """ - Attributes: - trading_firms (Unset | list[TradingFirm]): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - trading_firms: Unset | list[TradingFirm] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - trading_firms: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.trading_firms, Unset): - trading_firms = [] - for trading_firms_item_data in self.trading_firms: - trading_firms_item = trading_firms_item_data.to_dict() - trading_firms.append(trading_firms_item) - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if trading_firms is not UNSET: - field_dict["tradingFirms"] = trading_firms - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - trading_firms = [] - _trading_firms = d.pop("tradingFirms", UNSET) - for trading_firms_item_data in _trading_firms or []: - trading_firms_item = TradingFirm.from_dict(trading_firms_item_data) - - trading_firms.append(trading_firms_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - list_trading_firms_response = cls( - trading_firms=trading_firms, - error_message=error_message, - status_code=status_code, - ) - - return list_trading_firms_response diff --git a/openapi_project/openapi_package/models/login_request.py b/openapi_project/openapi_package/models/login_request.py deleted file mode 100644 index 54b75f9c3..000000000 --- a/openapi_project/openapi_package/models/login_request.py +++ /dev/null @@ -1,82 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="LoginRequest") - - -@_attrs_define -class LoginRequest: - """ - Attributes: - domain (Unset | str): - username (Unset | str): - password (Unset | str): - application_name (Unset | str): - application_version (Unset | str): - """ - - domain: Unset | str = UNSET - username: Unset | str = UNSET - password: Unset | str = UNSET - application_name: Unset | str = UNSET - application_version: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - domain = self.domain - - username = self.username - - password = self.password - - application_name = self.application_name - - application_version = self.application_version - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if domain is not UNSET: - field_dict["domain"] = domain - if username is not UNSET: - field_dict["username"] = username - if password is not UNSET: - field_dict["password"] = password - if application_name is not UNSET: - field_dict["applicationName"] = application_name - if application_version is not UNSET: - field_dict["applicationVersion"] = application_version - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - domain = d.pop("domain", UNSET) - - username = d.pop("username", UNSET) - - password = d.pop("password", UNSET) - - application_name = d.pop("applicationName", UNSET) - - application_version = d.pop("applicationVersion", UNSET) - - login_request = cls( - domain=domain, - username=username, - password=password, - application_name=application_name, - application_version=application_version, - ) - - return login_request diff --git a/openapi_project/openapi_package/models/login_response.py b/openapi_project/openapi_package/models/login_response.py deleted file mode 100644 index 8d0901e33..000000000 --- a/openapi_project/openapi_package/models/login_response.py +++ /dev/null @@ -1,203 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.login_status import LoginStatus -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.user import User - from openapi_project.openapi_package.models.login_response_system_settings import LoginResponseSystemSettings - - -T = TypeVar("T", bound="LoginResponse") - - -@_attrs_define -class LoginResponse: - """ - Attributes: - token (Unset | str): - environment (Unset | str): - login_attempts_remaining (Unset | int): - login_status (Unset | LoginStatus): - server_build_ts (Unset | str): - server_hash (Unset | str): - server_name (Unset | str): - server_time_utc (Unset | str): - server_version (Unset | str): - site (Unset | str): - text (Unset | str): - user (Unset | User): - system_settings (Unset | LoginResponseSystemSettings): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - token: Unset | str = UNSET - environment: Unset | str = UNSET - login_attempts_remaining: Unset | int = UNSET - login_status: Unset | LoginStatus = UNSET - server_build_ts: Unset | str = UNSET - server_hash: Unset | str = UNSET - server_name: Unset | str = UNSET - server_time_utc: Unset | str = UNSET - server_version: Unset | str = UNSET - site: Unset | str = UNSET - text: Unset | str = UNSET - user: Unset | User = UNSET - system_settings: Unset | LoginResponseSystemSettings = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - token = self.token - - environment = self.environment - - login_attempts_remaining = self.login_attempts_remaining - - login_status: Unset | str = ( - UNSET if isinstance(self.login_status, Unset) else self.login_status.value - ) - - server_build_ts = self.server_build_ts - - server_hash = self.server_hash - - server_name = self.server_name - - server_time_utc = self.server_time_utc - - server_version = self.server_version - - site = self.site - - text = self.text - - user: Unset | dict[str, Any] = ( - UNSET if isinstance(self.user, Unset) else self.user.to_dict() - ) - - system_settings: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.system_settings, Unset) - else self.system_settings.to_dict() - ) - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if token is not UNSET: - field_dict["token"] = token - if environment is not UNSET: - field_dict["environment"] = environment - if login_attempts_remaining is not UNSET: - field_dict["loginAttemptsRemaining"] = login_attempts_remaining - if login_status is not UNSET: - field_dict["loginStatus"] = login_status - if server_build_ts is not UNSET: - field_dict["serverBuildTs"] = server_build_ts - if server_hash is not UNSET: - field_dict["serverHash"] = server_hash - if server_name is not UNSET: - field_dict["serverName"] = server_name - if server_time_utc is not UNSET: - field_dict["serverTimeUtc"] = server_time_utc - if server_version is not UNSET: - field_dict["serverVersion"] = server_version - if site is not UNSET: - field_dict["site"] = site - if text is not UNSET: - field_dict["text"] = text - if user is not UNSET: - field_dict["user"] = user - if system_settings is not UNSET: - field_dict["systemSettings"] = system_settings - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - token = d.pop("token", UNSET) - - environment = d.pop("environment", UNSET) - - login_attempts_remaining = d.pop("loginAttemptsRemaining", UNSET) - - _login_status = d.pop("loginStatus", UNSET) - login_status: Unset | LoginStatus = ( - UNSET if isinstance(_login_status, Unset) else LoginStatus(_login_status) - ) - - server_build_ts = d.pop("serverBuildTs", UNSET) - - server_hash = d.pop("serverHash", UNSET) - - server_name = d.pop("serverName", UNSET) - - server_time_utc = d.pop("serverTimeUtc", UNSET) - - server_version = d.pop("serverVersion", UNSET) - - site = d.pop("site", UNSET) - - text = d.pop("text", UNSET) - - _user = d.pop("user", UNSET) - user: Unset | User = ( - UNSET if isinstance(_user, Unset) else User.from_dict(_user) - ) - - _system_settings = d.pop("systemSettings", UNSET) - system_settings: Unset | LoginResponseSystemSettings = ( - UNSET - if isinstance(_system_settings, Unset) - else LoginResponseSystemSettings.from_dict(_system_settings) - ) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - login_response = cls( - token=token, - environment=environment, - login_attempts_remaining=login_attempts_remaining, - login_status=login_status, - server_build_ts=server_build_ts, - server_hash=server_hash, - server_name=server_name, - server_time_utc=server_time_utc, - server_version=server_version, - site=site, - text=text, - user=user, - system_settings=system_settings, - error_message=error_message, - status_code=status_code, - ) - - return login_response diff --git a/openapi_project/openapi_package/models/login_response_system_settings.py b/openapi_project/openapi_package/models/login_response_system_settings.py deleted file mode 100644 index 98b0a2586..000000000 --- a/openapi_project/openapi_package/models/login_response_system_settings.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="LoginResponseSystemSettings") - - -@_attrs_define -class LoginResponseSystemSettings: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - login_response_system_settings = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - login_response_system_settings.additional_properties = additional_properties - return login_response_system_settings - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/login_status.py b/openapi_project/openapi_package/models/login_status.py deleted file mode 100644 index 30ad89211..000000000 --- a/openapi_project/openapi_package/models/login_status.py +++ /dev/null @@ -1,19 +0,0 @@ -from enum import Enum - - -class LoginStatus(str, Enum): - CONNECTION_FAILED = "CONNECTION_FAILED" - LOGIN_DISALLOWED = "LOGIN_DISALLOWED" - LOGIN_SUCCESS = "LOGIN_SUCCESS" - MFA_FAILED = "MFA_FAILED" - MFA_REQUIRED = "MFA_REQUIRED" - NOT_AUTHORIZED = "NOT_AUTHORIZED" - PASSWORD_CHANGE_FAILED = "PASSWORD_CHANGE_FAILED" - PASSWORD_CHANGE_SUCCESSFUL = "PASSWORD_CHANGE_SUCCESSFUL" - PASSWORD_EXPIRED = "PASSWORD_EXPIRED" - SERVER_HASH_CHANGED = "SERVER_HASH_CHANGED" - UNDEFINED = "UNDEFINED" - VERSION_TOO_OLD = "VERSION_TOO_OLD" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/margin_data.py b/openapi_project/openapi_package/models/margin_data.py deleted file mode 100644 index 7e5053af1..000000000 --- a/openapi_project/openapi_package/models/margin_data.py +++ /dev/null @@ -1,79 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.tims_margin_data import TimsMarginData - from openapi_project.openapi_package.models.empty import Empty - - -T = TypeVar("T", bound="MarginData") - - -@_attrs_define -class MarginData: - """ - Attributes: - account_id (Unset | int): - tims (Unset | TimsMarginData): - span (Unset | Empty): - """ - - account_id: Unset | int = UNSET - tims: Unset | TimsMarginData = UNSET - span: Unset | Empty = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - tims: Unset | dict[str, Any] = ( - UNSET if isinstance(self.tims, Unset) else self.tims.to_dict() - ) - - span: Unset | dict[str, Any] = ( - UNSET if isinstance(self.span, Unset) else self.span.to_dict() - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if tims is not UNSET: - field_dict["tims"] = tims - if span is not UNSET: - field_dict["span"] = span - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - _tims = d.pop("tims", UNSET) - tims: Unset | TimsMarginData = ( - UNSET if isinstance(_tims, Unset) else TimsMarginData.from_dict(_tims) - ) - - _span = d.pop("span", UNSET) - span: Unset | Empty = ( - UNSET if isinstance(_span, Unset) else Empty.from_dict(_span) - ) - - margin_data = cls( - account_id=account_id, - tims=tims, - span=span, - ) - - return margin_data diff --git a/openapi_project/openapi_package/models/margin_data_type.py b/openapi_project/openapi_package/models/margin_data_type.py deleted file mode 100644 index aecc4034d..000000000 --- a/openapi_project/openapi_package/models/margin_data_type.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class MarginDataType(str, Enum): - MARGIN_DATA_TYPE_SPAN = "MARGIN_DATA_TYPE_SPAN" - MARGIN_DATA_TYPE_TIMS = "MARGIN_DATA_TYPE_TIMS" - MARGIN_DATA_TYPE_UNKNOWN = "MARGIN_DATA_TYPE_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/multi_leg_order.py b/openapi_project/openapi_package/models/multi_leg_order.py deleted file mode 100644 index 59a2043a8..000000000 --- a/openapi_project/openapi_package/models/multi_leg_order.py +++ /dev/null @@ -1,532 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.ord_status import OrdStatus -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.origination_type import OriginationType -from openapi_project.openapi_package.models.price_type import PriceType -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.multi_leg_order_market_condition import MultiLegOrderMarketCondition - from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.header import Header - from openapi_project.openapi_package.models.multi_leg_order_optional_data import MultiLegOrderOptionalData - from openapi_project.openapi_package.models.multi_leg_order_leg import MultiLegOrderLeg - from openapi_project.openapi_package.models.multi_leg_order_algo import MultiLegOrderAlgo - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - - -T = TypeVar("T", bound="MultiLegOrder") - - -@_attrs_define -class MultiLegOrder: - """ - Attributes: - account_id (Unset | int): - algo (Unset | MultiLegOrderAlgo): - aux_price (Unset | float): - clearing_info (Unset | ClearingInfo): - cur_ord_id (Unset | str): - header (Unset | Header): - id_ (Unset | str): - incoming_cl_ord_id (Unset | str): - incoming_ord_id (Unset | str): - instructions (Unset | list[OrderInstruction]): - legs (Unset | list[MultiLegOrderLeg]): - market_condition (Unset | MultiLegOrderMarketCondition): - optional_data (Unset | MultiLegOrderOptionalData): - order_flags (Unset | int): - order_updates (Unset | list[OrderUpdateEvent]): - ord_type (Unset | OrdType): - origination_type (Unset | OriginationType): - parent_ord_id (Unset | str): - price (Unset | float): - price_type (Unset | PriceType): - qty (Unset | float): - route (Unset | str): - source (Unset | str): - source_address (Unset | str): - submit_ts (Unset | str): - tag (Unset | str): - text (Unset | str): - tif (Unset | Tif): - user_id (Unset | int): - trader_id (Unset | str): - ord_status (Unset | OrdStatus): - avg_price (Unset | float): - claimed_by (Unset | str): - last_price (Unset | float): - last_qty (Unset | float): - last_market (Unset | str): - leaves_qty (Unset | float): - cum_qty (Unset | float): - transact_ts (Unset | str): - working_qty (Unset | float): - has_busts (Unset | bool): - has_corrects (Unset | bool): - has_notes (Unset | bool): - """ - - account_id: Unset | int = UNSET - algo: Unset | MultiLegOrderAlgo = UNSET - aux_price: Unset | float = UNSET - clearing_info: Unset | ClearingInfo = UNSET - cur_ord_id: Unset | str = UNSET - header: Unset | Header = UNSET - id_: Unset | str = UNSET - incoming_cl_ord_id: Unset | str = UNSET - incoming_ord_id: Unset | str = UNSET - instructions: Unset | list[OrderInstruction] = UNSET - legs: Unset | list[MultiLegOrderLeg] = UNSET - market_condition: Unset | MultiLegOrderMarketCondition = UNSET - optional_data: Unset | MultiLegOrderOptionalData = UNSET - order_flags: Unset | int = UNSET - order_updates: Unset | list[OrderUpdateEvent] = UNSET - ord_type: Unset | OrdType = UNSET - origination_type: Unset | OriginationType = UNSET - parent_ord_id: Unset | str = UNSET - price: Unset | float = UNSET - price_type: Unset | PriceType = UNSET - qty: Unset | float = UNSET - route: Unset | str = UNSET - source: Unset | str = UNSET - source_address: Unset | str = UNSET - submit_ts: Unset | str = UNSET - tag: Unset | str = UNSET - text: Unset | str = UNSET - tif: Unset | Tif = UNSET - user_id: Unset | int = UNSET - trader_id: Unset | str = UNSET - ord_status: Unset | OrdStatus = UNSET - avg_price: Unset | float = UNSET - claimed_by: Unset | str = UNSET - last_price: Unset | float = UNSET - last_qty: Unset | float = UNSET - last_market: Unset | str = UNSET - leaves_qty: Unset | float = UNSET - cum_qty: Unset | float = UNSET - transact_ts: Unset | str = UNSET - working_qty: Unset | float = UNSET - has_busts: Unset | bool = UNSET - has_corrects: Unset | bool = UNSET - has_notes: Unset | bool = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - algo: Unset | dict[str, Any] = ( - UNSET if isinstance(self.algo, Unset) else self.algo.to_dict() - ) - - aux_price = self.aux_price - - clearing_info: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.clearing_info, Unset) - else self.clearing_info.to_dict() - ) - - cur_ord_id = self.cur_ord_id - - header: Unset | dict[str, Any] = ( - UNSET if isinstance(self.header, Unset) else self.header.to_dict() - ) - - id_ = self.id_ - - incoming_cl_ord_id = self.incoming_cl_ord_id - - incoming_ord_id = self.incoming_ord_id - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - legs: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.legs, Unset): - legs = [] - for legs_item_data in self.legs: - legs_item = legs_item_data.to_dict() - legs.append(legs_item) - - market_condition: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.market_condition, Unset) - else self.market_condition.to_dict() - ) - - optional_data: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.optional_data, Unset) - else self.optional_data.to_dict() - ) - - order_flags = self.order_flags - - order_updates: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.order_updates, Unset): - order_updates = [] - for order_updates_item_data in self.order_updates: - order_updates_item = order_updates_item_data.to_dict() - order_updates.append(order_updates_item) - - ord_type: Unset | str = ( - UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value - ) - - origination_type: Unset | str = ( - UNSET - if isinstance(self.origination_type, Unset) - else self.origination_type.value - ) - - parent_ord_id = self.parent_ord_id - - price = self.price - - price_type: Unset | str = ( - UNSET if isinstance(self.price_type, Unset) else self.price_type.value - ) - - qty = self.qty - - route = self.route - - source = self.source - - source_address = self.source_address - - submit_ts = self.submit_ts - - tag = self.tag - - text = self.text - - tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value - - user_id = self.user_id - - trader_id = self.trader_id - - ord_status: Unset | str = ( - UNSET if isinstance(self.ord_status, Unset) else self.ord_status.value - ) - - avg_price = self.avg_price - - claimed_by = self.claimed_by - - last_price = self.last_price - - last_qty = self.last_qty - - last_market = self.last_market - - leaves_qty = self.leaves_qty - - cum_qty = self.cum_qty - - transact_ts = self.transact_ts - - working_qty = self.working_qty - - has_busts = self.has_busts - - has_corrects = self.has_corrects - - has_notes = self.has_notes - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if algo is not UNSET: - field_dict["algo"] = algo - if aux_price is not UNSET: - field_dict["auxPrice"] = aux_price - if clearing_info is not UNSET: - field_dict["clearingInfo"] = clearing_info - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if header is not UNSET: - field_dict["header"] = header - if id_ is not UNSET: - field_dict["id"] = id - if incoming_cl_ord_id is not UNSET: - field_dict["incomingClOrdId"] = incoming_cl_ord_id - if incoming_ord_id is not UNSET: - field_dict["incomingOrdId"] = incoming_ord_id - if instructions is not UNSET: - field_dict["instructions"] = instructions - if legs is not UNSET: - field_dict["legs"] = legs - if market_condition is not UNSET: - field_dict["marketCondition"] = market_condition - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if order_flags is not UNSET: - field_dict["orderFlags"] = order_flags - if order_updates is not UNSET: - field_dict["orderUpdates"] = order_updates - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if origination_type is not UNSET: - field_dict["originationType"] = origination_type - if parent_ord_id is not UNSET: - field_dict["parentOrdId"] = parent_ord_id - if price is not UNSET: - field_dict["price"] = price - if price_type is not UNSET: - field_dict["priceType"] = price_type - if qty is not UNSET: - field_dict["qty"] = qty - if route is not UNSET: - field_dict["route"] = route - if source is not UNSET: - field_dict["source"] = source - if source_address is not UNSET: - field_dict["sourceAddress"] = source_address - if submit_ts is not UNSET: - field_dict["submitTs"] = submit_ts - if tag is not UNSET: - field_dict["tag"] = tag - if text is not UNSET: - field_dict["text"] = text - if tif is not UNSET: - field_dict["tif"] = tif - if user_id is not UNSET: - field_dict["userId"] = user_id - if trader_id is not UNSET: - field_dict["traderId"] = trader_id - if ord_status is not UNSET: - field_dict["ordStatus"] = ord_status - if avg_price is not UNSET: - field_dict["avgPrice"] = avg_price - if claimed_by is not UNSET: - field_dict["claimedBy"] = claimed_by - if last_price is not UNSET: - field_dict["lastPrice"] = last_price - if last_qty is not UNSET: - field_dict["lastQty"] = last_qty - if last_market is not UNSET: - field_dict["lastMarket"] = last_market - if leaves_qty is not UNSET: - field_dict["leavesQty"] = leaves_qty - if cum_qty is not UNSET: - field_dict["cumQty"] = cum_qty - if transact_ts is not UNSET: - field_dict["transactTs"] = transact_ts - if working_qty is not UNSET: - field_dict["workingQty"] = working_qty - if has_busts is not UNSET: - field_dict["hasBusts"] = has_busts - if has_corrects is not UNSET: - field_dict["hasCorrects"] = has_corrects - if has_notes is not UNSET: - field_dict["hasNotes"] = has_notes - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - _algo = d.pop("algo", UNSET) - algo: Unset | MultiLegOrderAlgo = ( - UNSET if isinstance(_algo, Unset) else MultiLegOrderAlgo.from_dict(_algo) - ) - - aux_price = d.pop("auxPrice", UNSET) - - _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo = ( - UNSET - if isinstance(_clearing_info, Unset) - else ClearingInfo.from_dict(_clearing_info) - ) - - cur_ord_id = d.pop("curOrdId", UNSET) - - _header = d.pop("header", UNSET) - header: Unset | Header = ( - UNSET if isinstance(_header, Unset) else Header.from_dict(_header) - ) - - id_ = d.pop("id", UNSET) - - incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) - - incoming_ord_id = d.pop("incomingOrdId", UNSET) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - legs = [] - _legs = d.pop("legs", UNSET) - for legs_item_data in _legs or []: - legs_item = MultiLegOrderLeg.from_dict(legs_item_data) - - legs.append(legs_item) - - _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | MultiLegOrderMarketCondition = ( - UNSET - if isinstance(_market_condition, Unset) - else MultiLegOrderMarketCondition.from_dict(_market_condition) - ) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | MultiLegOrderOptionalData = ( - UNSET - if isinstance(_optional_data, Unset) - else MultiLegOrderOptionalData.from_dict(_optional_data) - ) - - order_flags = d.pop("orderFlags", UNSET) - - order_updates = [] - _order_updates = d.pop("orderUpdates", UNSET) - for order_updates_item_data in _order_updates or []: - order_updates_item = OrderUpdateEvent.from_dict(order_updates_item_data) - - order_updates.append(order_updates_item) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType = ( - UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) - ) - - _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType = ( - UNSET - if isinstance(_origination_type, Unset) - else OriginationType(_origination_type) - ) - - parent_ord_id = d.pop("parentOrdId", UNSET) - - price = d.pop("price", UNSET) - - _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType = ( - UNSET if isinstance(_price_type, Unset) else PriceType(_price_type) - ) - - qty = d.pop("qty", UNSET) - - route = d.pop("route", UNSET) - - source = d.pop("source", UNSET) - - source_address = d.pop("sourceAddress", UNSET) - - submit_ts = d.pop("submitTs", UNSET) - - tag = d.pop("tag", UNSET) - - text = d.pop("text", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) - - user_id = d.pop("userId", UNSET) - - trader_id = d.pop("traderId", UNSET) - - _ord_status = d.pop("ordStatus", UNSET) - ord_status: Unset | OrdStatus = ( - UNSET if isinstance(_ord_status, Unset) else OrdStatus(_ord_status) - ) - - avg_price = d.pop("avgPrice", UNSET) - - claimed_by = d.pop("claimedBy", UNSET) - - last_price = d.pop("lastPrice", UNSET) - - last_qty = d.pop("lastQty", UNSET) - - last_market = d.pop("lastMarket", UNSET) - - leaves_qty = d.pop("leavesQty", UNSET) - - cum_qty = d.pop("cumQty", UNSET) - - transact_ts = d.pop("transactTs", UNSET) - - working_qty = d.pop("workingQty", UNSET) - - has_busts = d.pop("hasBusts", UNSET) - - has_corrects = d.pop("hasCorrects", UNSET) - - has_notes = d.pop("hasNotes", UNSET) - - multi_leg_order = cls( - account_id=account_id, - algo=algo, - aux_price=aux_price, - clearing_info=clearing_info, - cur_ord_id=cur_ord_id, - header=header, - id_=id_, - incoming_cl_ord_id=incoming_cl_ord_id, - incoming_ord_id=incoming_ord_id, - instructions=instructions, - legs=legs, - market_condition=market_condition, - optional_data=optional_data, - order_flags=order_flags, - order_updates=order_updates, - ord_type=ord_type, - origination_type=origination_type, - parent_ord_id=parent_ord_id, - price=price, - price_type=price_type, - qty=qty, - route=route, - source=source, - source_address=source_address, - submit_ts=submit_ts, - tag=tag, - text=text, - tif=tif, - user_id=user_id, - trader_id=trader_id, - ord_status=ord_status, - avg_price=avg_price, - claimed_by=claimed_by, - last_price=last_price, - last_qty=last_qty, - last_market=last_market, - leaves_qty=leaves_qty, - cum_qty=cum_qty, - transact_ts=transact_ts, - working_qty=working_qty, - has_busts=has_busts, - has_corrects=has_corrects, - has_notes=has_notes, - ) - - return multi_leg_order diff --git a/openapi_project/openapi_package/models/multi_leg_order_algo.py b/openapi_project/openapi_package/models/multi_leg_order_algo.py deleted file mode 100644 index fd48d7730..000000000 --- a/openapi_project/openapi_package/models/multi_leg_order_algo.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="MultiLegOrderAlgo") - - -@_attrs_define -class MultiLegOrderAlgo: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - multi_leg_order_algo = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - multi_leg_order_algo.additional_properties = additional_properties - return multi_leg_order_algo - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py deleted file mode 100644 index a42d3e14d..000000000 --- a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request.py +++ /dev/null @@ -1,348 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.origination_type import OriginationType -from openapi_project.openapi_package.models.price_type import PriceType -from openapi_project.openapi_package.models.side import Side -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_algo import MultiLegOrderCancelReplaceRequestAlgo - from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_optional_data import MultiLegOrderCancelReplaceRequestOptionalData - from openapi_project.openapi_package.models.header import Header - from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request_market_condition import MultiLegOrderCancelReplaceRequestMarketCondition - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - - -T = TypeVar("T", bound="MultiLegOrderCancelReplaceRequest") - - -@_attrs_define -class MultiLegOrderCancelReplaceRequest: - """ - Attributes: - algo (Unset | MultiLegOrderCancelReplaceRequestAlgo): - aux_price (Unset | float): - clearing_info (Unset | ClearingInfo): - cur_ord_id (Unset | str): - header (Unset | Header): - incoming_cl_ord_id (Unset | str): - incoming_orig_cl_ord_id (Unset | str): - instructions (Unset | list[OrderInstruction]): - optional_data (Unset | MultiLegOrderCancelReplaceRequestOptionalData): - market_condition (Unset | MultiLegOrderCancelReplaceRequestMarketCondition): - ord_type (Unset | OrdType): - origination_type (Unset | OriginationType): - perm_ord_id (Unset | str): - price (Unset | float): - price_type (Unset | PriceType): - qty (Unset | float): - req_ord_id (Unset | str): - side (Unset | Side): - source (Unset | str): - submit_ts (Unset | str): - tag (Unset | str): - text (Unset | str): - tif (Unset | Tif): - trader_id (Unset | str): - user_id (Unset | int): - """ - - algo: Unset | MultiLegOrderCancelReplaceRequestAlgo = UNSET - aux_price: Unset | float = UNSET - clearing_info: Unset | ClearingInfo = UNSET - cur_ord_id: Unset | str = UNSET - header: Unset | Header = UNSET - incoming_cl_ord_id: Unset | str = UNSET - incoming_orig_cl_ord_id: Unset | str = UNSET - instructions: Unset | list[OrderInstruction] = UNSET - optional_data: Unset | MultiLegOrderCancelReplaceRequestOptionalData = UNSET - market_condition: Unset | MultiLegOrderCancelReplaceRequestMarketCondition = UNSET - ord_type: Unset | OrdType = UNSET - origination_type: Unset | OriginationType = UNSET - perm_ord_id: Unset | str = UNSET - price: Unset | float = UNSET - price_type: Unset | PriceType = UNSET - qty: Unset | float = UNSET - req_ord_id: Unset | str = UNSET - side: Unset | Side = UNSET - source: Unset | str = UNSET - submit_ts: Unset | str = UNSET - tag: Unset | str = UNSET - text: Unset | str = UNSET - tif: Unset | Tif = UNSET - trader_id: Unset | str = UNSET - user_id: Unset | int = UNSET - - def to_dict(self) -> dict[str, Any]: - algo: Unset | dict[str, Any] = ( - UNSET if isinstance(self.algo, Unset) else self.algo.to_dict() - ) - - aux_price = self.aux_price - - clearing_info: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.clearing_info, Unset) - else self.clearing_info.to_dict() - ) - - cur_ord_id = self.cur_ord_id - - header: Unset | dict[str, Any] = ( - UNSET if isinstance(self.header, Unset) else self.header.to_dict() - ) - - incoming_cl_ord_id = self.incoming_cl_ord_id - - incoming_orig_cl_ord_id = self.incoming_orig_cl_ord_id - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - optional_data: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.optional_data, Unset) - else self.optional_data.to_dict() - ) - - market_condition: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.market_condition, Unset) - else self.market_condition.to_dict() - ) - - ord_type: Unset | str = ( - UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value - ) - - origination_type: Unset | str = ( - UNSET - if isinstance(self.origination_type, Unset) - else self.origination_type.value - ) - - perm_ord_id = self.perm_ord_id - - price = self.price - - price_type: Unset | str = ( - UNSET if isinstance(self.price_type, Unset) else self.price_type.value - ) - - qty = self.qty - - req_ord_id = self.req_ord_id - - side: Unset | str = UNSET if isinstance(self.side, Unset) else self.side.value - - source = self.source - - submit_ts = self.submit_ts - - tag = self.tag - - text = self.text - - tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value - - trader_id = self.trader_id - - user_id = self.user_id - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if algo is not UNSET: - field_dict["algo"] = algo - if aux_price is not UNSET: - field_dict["auxPrice"] = aux_price - if clearing_info is not UNSET: - field_dict["clearingInfo"] = clearing_info - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if header is not UNSET: - field_dict["header"] = header - if incoming_cl_ord_id is not UNSET: - field_dict["incomingClOrdId"] = incoming_cl_ord_id - if incoming_orig_cl_ord_id is not UNSET: - field_dict["incomingOrigClOrdId"] = incoming_orig_cl_ord_id - if instructions is not UNSET: - field_dict["instructions"] = instructions - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if market_condition is not UNSET: - field_dict["marketCondition"] = market_condition - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if origination_type is not UNSET: - field_dict["originationType"] = origination_type - if perm_ord_id is not UNSET: - field_dict["permOrdId"] = perm_ord_id - if price is not UNSET: - field_dict["price"] = price - if price_type is not UNSET: - field_dict["priceType"] = price_type - if qty is not UNSET: - field_dict["qty"] = qty - if req_ord_id is not UNSET: - field_dict["reqOrdId"] = req_ord_id - if side is not UNSET: - field_dict["side"] = side - if source is not UNSET: - field_dict["source"] = source - if submit_ts is not UNSET: - field_dict["submitTs"] = submit_ts - if tag is not UNSET: - field_dict["tag"] = tag - if text is not UNSET: - field_dict["text"] = text - if tif is not UNSET: - field_dict["tif"] = tif - if trader_id is not UNSET: - field_dict["traderId"] = trader_id - if user_id is not UNSET: - field_dict["userId"] = user_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _algo = d.pop("algo", UNSET) - algo: Unset | MultiLegOrderCancelReplaceRequestAlgo = ( - UNSET - if isinstance(_algo, Unset) - else MultiLegOrderCancelReplaceRequestAlgo.from_dict(_algo) - ) - - aux_price = d.pop("auxPrice", UNSET) - - _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo = ( - UNSET - if isinstance(_clearing_info, Unset) - else ClearingInfo.from_dict(_clearing_info) - ) - - cur_ord_id = d.pop("curOrdId", UNSET) - - _header = d.pop("header", UNSET) - header: Unset | Header = ( - UNSET if isinstance(_header, Unset) else Header.from_dict(_header) - ) - - incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) - - incoming_orig_cl_ord_id = d.pop("incomingOrigClOrdId", UNSET) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | MultiLegOrderCancelReplaceRequestOptionalData = ( - UNSET - if isinstance(_optional_data, Unset) - else MultiLegOrderCancelReplaceRequestOptionalData.from_dict(_optional_data) - ) - - _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | MultiLegOrderCancelReplaceRequestMarketCondition = ( - UNSET - if isinstance(_market_condition, Unset) - else MultiLegOrderCancelReplaceRequestMarketCondition.from_dict( - _market_condition - ) - ) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType = ( - UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) - ) - - _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType = ( - UNSET - if isinstance(_origination_type, Unset) - else OriginationType(_origination_type) - ) - - perm_ord_id = d.pop("permOrdId", UNSET) - - price = d.pop("price", UNSET) - - _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType = ( - UNSET if isinstance(_price_type, Unset) else PriceType(_price_type) - ) - - qty = d.pop("qty", UNSET) - - req_ord_id = d.pop("reqOrdId", UNSET) - - _side = d.pop("side", UNSET) - side: Unset | Side = UNSET if isinstance(_side, Unset) else Side(_side) - - source = d.pop("source", UNSET) - - submit_ts = d.pop("submitTs", UNSET) - - tag = d.pop("tag", UNSET) - - text = d.pop("text", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) - - trader_id = d.pop("traderId", UNSET) - - user_id = d.pop("userId", UNSET) - - multi_leg_order_cancel_replace_request = cls( - algo=algo, - aux_price=aux_price, - clearing_info=clearing_info, - cur_ord_id=cur_ord_id, - header=header, - incoming_cl_ord_id=incoming_cl_ord_id, - incoming_orig_cl_ord_id=incoming_orig_cl_ord_id, - instructions=instructions, - optional_data=optional_data, - market_condition=market_condition, - ord_type=ord_type, - origination_type=origination_type, - perm_ord_id=perm_ord_id, - price=price, - price_type=price_type, - qty=qty, - req_ord_id=req_ord_id, - side=side, - source=source, - submit_ts=submit_ts, - tag=tag, - text=text, - tif=tif, - trader_id=trader_id, - user_id=user_id, - ) - - return multi_leg_order_cancel_replace_request diff --git a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py deleted file mode 100644 index 8e15402fd..000000000 --- a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_algo.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="MultiLegOrderCancelReplaceRequestAlgo") - - -@_attrs_define -class MultiLegOrderCancelReplaceRequestAlgo: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - multi_leg_order_cancel_replace_request_algo = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - multi_leg_order_cancel_replace_request_algo.additional_properties = ( - additional_properties - ) - return multi_leg_order_cancel_replace_request_algo - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py deleted file mode 100644 index 870320ac7..000000000 --- a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_market_condition.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="MultiLegOrderCancelReplaceRequestMarketCondition") - - -@_attrs_define -class MultiLegOrderCancelReplaceRequestMarketCondition: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - multi_leg_order_cancel_replace_request_market_condition = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - multi_leg_order_cancel_replace_request_market_condition.additional_properties = ( - additional_properties - ) - return multi_leg_order_cancel_replace_request_market_condition - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py deleted file mode 100644 index 3b668b038..000000000 --- a/openapi_project/openapi_package/models/multi_leg_order_cancel_replace_request_optional_data.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="MultiLegOrderCancelReplaceRequestOptionalData") - - -@_attrs_define -class MultiLegOrderCancelReplaceRequestOptionalData: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - multi_leg_order_cancel_replace_request_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - multi_leg_order_cancel_replace_request_optional_data.additional_properties = ( - additional_properties - ) - return multi_leg_order_cancel_replace_request_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross.py b/openapi_project/openapi_package/models/multi_leg_order_cross.py deleted file mode 100644 index f32046c2b..000000000 --- a/openapi_project/openapi_package/models/multi_leg_order_cross.py +++ /dev/null @@ -1,460 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.cross_type import CrossType -from openapi_project.openapi_package.models.ord_status import OrdStatus -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.origination_type import OriginationType -from openapi_project.openapi_package.models.price_type import PriceType -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.multi_leg_order_cross_optional_data import MultiLegOrderCrossOptionalData - from openapi_project.openapi_package.models.multi_leg_order_cross_algo import MultiLegOrderCrossAlgo - from openapi_project.openapi_package.models.multi_leg_order_cross_market_condition import MultiLegOrderCrossMarketCondition - from openapi_project.openapi_package.models.header import Header - from openapi_project.openapi_package.models.multi_leg_order_cross_allocation import MultiLegOrderCrossAllocation - - -T = TypeVar("T", bound="MultiLegOrderCross") - - -@_attrs_define -class MultiLegOrderCross: - """ - Attributes: - account_id (Unset | int): - algo (Unset | MultiLegOrderCrossAlgo): - allocations (Unset | list[MultiLegOrderCrossAllocation]): - cross_type (Unset | CrossType): - cur_ord_id (Unset | str): - header (Unset | Header): - id_ (Unset | str): - incoming_cl_ord_id (Unset | str): - incoming_ord_id (Unset | str): - instructions (Unset | list[OrderInstruction]): - market_condition (Unset | MultiLegOrderCrossMarketCondition): - optional_data (Unset | MultiLegOrderCrossOptionalData): - order_flags (Unset | int): - order_updates (Unset | list[OrderUpdateEvent]): - ord_type (Unset | OrdType): - origination_type (Unset | OriginationType): - parent_ord_id (Unset | str): - price (Unset | float): - price_type (Unset | PriceType): - qty (Unset | float): - route (Unset | str): - source (Unset | str): - source_address (Unset | str): - submit_ts (Unset | str): - tag (Unset | str): - text (Unset | str): - tif (Unset | Tif): - user_id (Unset | int): - trader_id (Unset | str): - claimed_by (Unset | str): - ord_status (Unset | OrdStatus): - transact_ts (Unset | str): - has_busts (Unset | bool): - has_corrects (Unset | bool): - has_notes (Unset | bool): - """ - - account_id: Unset | int = UNSET - algo: Unset | MultiLegOrderCrossAlgo = UNSET - allocations: Unset | list[MultiLegOrderCrossAllocation] = UNSET - cross_type: Unset | CrossType = UNSET - cur_ord_id: Unset | str = UNSET - header: Unset | Header = UNSET - id_: Unset | str = UNSET - incoming_cl_ord_id: Unset | str = UNSET - incoming_ord_id: Unset | str = UNSET - instructions: Unset | list[OrderInstruction] = UNSET - market_condition: Unset | MultiLegOrderCrossMarketCondition = UNSET - optional_data: Unset | MultiLegOrderCrossOptionalData = UNSET - order_flags: Unset | int = UNSET - order_updates: Unset | list[OrderUpdateEvent] = UNSET - ord_type: Unset | OrdType = UNSET - origination_type: Unset | OriginationType = UNSET - parent_ord_id: Unset | str = UNSET - price: Unset | float = UNSET - price_type: Unset | PriceType = UNSET - qty: Unset | float = UNSET - route: Unset | str = UNSET - source: Unset | str = UNSET - source_address: Unset | str = UNSET - submit_ts: Unset | str = UNSET - tag: Unset | str = UNSET - text: Unset | str = UNSET - tif: Unset | Tif = UNSET - user_id: Unset | int = UNSET - trader_id: Unset | str = UNSET - claimed_by: Unset | str = UNSET - ord_status: Unset | OrdStatus = UNSET - transact_ts: Unset | str = UNSET - has_busts: Unset | bool = UNSET - has_corrects: Unset | bool = UNSET - has_notes: Unset | bool = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - algo: Unset | dict[str, Any] = ( - UNSET if isinstance(self.algo, Unset) else self.algo.to_dict() - ) - - allocations: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.allocations, Unset): - allocations = [] - for allocations_item_data in self.allocations: - allocations_item = allocations_item_data.to_dict() - allocations.append(allocations_item) - - cross_type: Unset | str = ( - UNSET if isinstance(self.cross_type, Unset) else self.cross_type.value - ) - - cur_ord_id = self.cur_ord_id - - header: Unset | dict[str, Any] = ( - UNSET if isinstance(self.header, Unset) else self.header.to_dict() - ) - - id_ = self.id_ - - incoming_cl_ord_id = self.incoming_cl_ord_id - - incoming_ord_id = self.incoming_ord_id - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - market_condition: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.market_condition, Unset) - else self.market_condition.to_dict() - ) - - optional_data: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.optional_data, Unset) - else self.optional_data.to_dict() - ) - - order_flags = self.order_flags - - order_updates: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.order_updates, Unset): - order_updates = [] - for order_updates_item_data in self.order_updates: - order_updates_item = order_updates_item_data.to_dict() - order_updates.append(order_updates_item) - - ord_type: Unset | str = ( - UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value - ) - - origination_type: Unset | str = ( - UNSET - if isinstance(self.origination_type, Unset) - else self.origination_type.value - ) - - parent_ord_id = self.parent_ord_id - - price = self.price - - price_type: Unset | str = ( - UNSET if isinstance(self.price_type, Unset) else self.price_type.value - ) - - qty = self.qty - - route = self.route - - source = self.source - - source_address = self.source_address - - submit_ts = self.submit_ts - - tag = self.tag - - text = self.text - - tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value - - user_id = self.user_id - - trader_id = self.trader_id - - claimed_by = self.claimed_by - - ord_status: Unset | str = ( - UNSET if isinstance(self.ord_status, Unset) else self.ord_status.value - ) - - transact_ts = self.transact_ts - - has_busts = self.has_busts - - has_corrects = self.has_corrects - - has_notes = self.has_notes - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if algo is not UNSET: - field_dict["algo"] = algo - if allocations is not UNSET: - field_dict["allocations"] = allocations - if cross_type is not UNSET: - field_dict["crossType"] = cross_type - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if header is not UNSET: - field_dict["header"] = header - if id_ is not UNSET: - field_dict["id"] = id - if incoming_cl_ord_id is not UNSET: - field_dict["incomingClOrdId"] = incoming_cl_ord_id - if incoming_ord_id is not UNSET: - field_dict["incomingOrdId"] = incoming_ord_id - if instructions is not UNSET: - field_dict["instructions"] = instructions - if market_condition is not UNSET: - field_dict["marketCondition"] = market_condition - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if order_flags is not UNSET: - field_dict["orderFlags"] = order_flags - if order_updates is not UNSET: - field_dict["orderUpdates"] = order_updates - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if origination_type is not UNSET: - field_dict["originationType"] = origination_type - if parent_ord_id is not UNSET: - field_dict["parentOrdId"] = parent_ord_id - if price is not UNSET: - field_dict["price"] = price - if price_type is not UNSET: - field_dict["priceType"] = price_type - if qty is not UNSET: - field_dict["qty"] = qty - if route is not UNSET: - field_dict["route"] = route - if source is not UNSET: - field_dict["source"] = source - if source_address is not UNSET: - field_dict["sourceAddress"] = source_address - if submit_ts is not UNSET: - field_dict["submitTs"] = submit_ts - if tag is not UNSET: - field_dict["tag"] = tag - if text is not UNSET: - field_dict["text"] = text - if tif is not UNSET: - field_dict["tif"] = tif - if user_id is not UNSET: - field_dict["userId"] = user_id - if trader_id is not UNSET: - field_dict["traderId"] = trader_id - if claimed_by is not UNSET: - field_dict["claimedBy"] = claimed_by - if ord_status is not UNSET: - field_dict["ordStatus"] = ord_status - if transact_ts is not UNSET: - field_dict["transactTs"] = transact_ts - if has_busts is not UNSET: - field_dict["hasBusts"] = has_busts - if has_corrects is not UNSET: - field_dict["hasCorrects"] = has_corrects - if has_notes is not UNSET: - field_dict["hasNotes"] = has_notes - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - _algo = d.pop("algo", UNSET) - algo: Unset | MultiLegOrderCrossAlgo = ( - UNSET - if isinstance(_algo, Unset) - else MultiLegOrderCrossAlgo.from_dict(_algo) - ) - - allocations = [] - _allocations = d.pop("allocations", UNSET) - for allocations_item_data in _allocations or []: - allocations_item = MultiLegOrderCrossAllocation.from_dict( - allocations_item_data - ) - - allocations.append(allocations_item) - - _cross_type = d.pop("crossType", UNSET) - cross_type: Unset | CrossType = ( - UNSET if isinstance(_cross_type, Unset) else CrossType(_cross_type) - ) - - cur_ord_id = d.pop("curOrdId", UNSET) - - _header = d.pop("header", UNSET) - header: Unset | Header = ( - UNSET if isinstance(_header, Unset) else Header.from_dict(_header) - ) - - id_ = d.pop("id", UNSET) - - incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) - - incoming_ord_id = d.pop("incomingOrdId", UNSET) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | MultiLegOrderCrossMarketCondition = ( - UNSET - if isinstance(_market_condition, Unset) - else MultiLegOrderCrossMarketCondition.from_dict(_market_condition) - ) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | MultiLegOrderCrossOptionalData = ( - UNSET - if isinstance(_optional_data, Unset) - else MultiLegOrderCrossOptionalData.from_dict(_optional_data) - ) - - order_flags = d.pop("orderFlags", UNSET) - - order_updates = [] - _order_updates = d.pop("orderUpdates", UNSET) - for order_updates_item_data in _order_updates or []: - order_updates_item = OrderUpdateEvent.from_dict(order_updates_item_data) - - order_updates.append(order_updates_item) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType = ( - UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) - ) - - _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType = ( - UNSET - if isinstance(_origination_type, Unset) - else OriginationType(_origination_type) - ) - - parent_ord_id = d.pop("parentOrdId", UNSET) - - price = d.pop("price", UNSET) - - _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType = ( - UNSET if isinstance(_price_type, Unset) else PriceType(_price_type) - ) - - qty = d.pop("qty", UNSET) - - route = d.pop("route", UNSET) - - source = d.pop("source", UNSET) - - source_address = d.pop("sourceAddress", UNSET) - - submit_ts = d.pop("submitTs", UNSET) - - tag = d.pop("tag", UNSET) - - text = d.pop("text", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) - - user_id = d.pop("userId", UNSET) - - trader_id = d.pop("traderId", UNSET) - - claimed_by = d.pop("claimedBy", UNSET) - - _ord_status = d.pop("ordStatus", UNSET) - ord_status: Unset | OrdStatus = ( - UNSET if isinstance(_ord_status, Unset) else OrdStatus(_ord_status) - ) - - transact_ts = d.pop("transactTs", UNSET) - - has_busts = d.pop("hasBusts", UNSET) - - has_corrects = d.pop("hasCorrects", UNSET) - - has_notes = d.pop("hasNotes", UNSET) - - multi_leg_order_cross = cls( - account_id=account_id, - algo=algo, - allocations=allocations, - cross_type=cross_type, - cur_ord_id=cur_ord_id, - header=header, - id_=id_, - incoming_cl_ord_id=incoming_cl_ord_id, - incoming_ord_id=incoming_ord_id, - instructions=instructions, - market_condition=market_condition, - optional_data=optional_data, - order_flags=order_flags, - order_updates=order_updates, - ord_type=ord_type, - origination_type=origination_type, - parent_ord_id=parent_ord_id, - price=price, - price_type=price_type, - qty=qty, - route=route, - source=source, - source_address=source_address, - submit_ts=submit_ts, - tag=tag, - text=text, - tif=tif, - user_id=user_id, - trader_id=trader_id, - claimed_by=claimed_by, - ord_status=ord_status, - transact_ts=transact_ts, - has_busts=has_busts, - has_corrects=has_corrects, - has_notes=has_notes, - ) - - return multi_leg_order_cross diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py b/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py deleted file mode 100644 index 32f374b7b..000000000 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_algo.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="MultiLegOrderCrossAlgo") - - -@_attrs_define -class MultiLegOrderCrossAlgo: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - multi_leg_order_cross_algo = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - multi_leg_order_cross_algo.additional_properties = additional_properties - return multi_leg_order_cross_algo - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py deleted file mode 100644 index 1af9fb964..000000000 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation.py +++ /dev/null @@ -1,256 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.cross_side_type import CrossSideType -from openapi_project.openapi_package.models.ord_status import OrdStatus -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.multi_leg_order_cross_allocation_optional_data import MultiLegOrderCrossAllocationOptionalData - from openapi_project.openapi_package.models.multi_leg_order_leg import MultiLegOrderLeg - - -T = TypeVar("T", bound="MultiLegOrderCrossAllocation") - - -@_attrs_define -class MultiLegOrderCrossAllocation: - """ - Attributes: - account_id (Unset | int): - clearing_info (Unset | ClearingInfo): - id_ (Unset | str): - instructions (Unset | list[OrderInstruction]): - legs (Unset | list[MultiLegOrderLeg]): - optional_data (Unset | MultiLegOrderCrossAllocationOptionalData): - qty (Unset | float): - side_type (Unset | CrossSideType): - avg_price (Unset | float): - last_price (Unset | float): - last_qty (Unset | float): - last_market (Unset | str): - leaves_qty (Unset | float): - cum_qty (Unset | float): - transact_ts (Unset | str): - ord_status (Unset | OrdStatus): - incoming_cl_ord_id (Unset | str): - incoming_ord_id (Unset | str): - """ - - account_id: Unset | int = UNSET - clearing_info: Unset | ClearingInfo = UNSET - id_: Unset | str = UNSET - instructions: Unset | list[OrderInstruction] = UNSET - legs: Unset | list[MultiLegOrderLeg] = UNSET - optional_data: Unset | MultiLegOrderCrossAllocationOptionalData = UNSET - qty: Unset | float = UNSET - side_type: Unset | CrossSideType = UNSET - avg_price: Unset | float = UNSET - last_price: Unset | float = UNSET - last_qty: Unset | float = UNSET - last_market: Unset | str = UNSET - leaves_qty: Unset | float = UNSET - cum_qty: Unset | float = UNSET - transact_ts: Unset | str = UNSET - ord_status: Unset | OrdStatus = UNSET - incoming_cl_ord_id: Unset | str = UNSET - incoming_ord_id: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - clearing_info: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.clearing_info, Unset) - else self.clearing_info.to_dict() - ) - - id_ = self.id_ - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - legs: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.legs, Unset): - legs = [] - for legs_item_data in self.legs: - legs_item = legs_item_data.to_dict() - legs.append(legs_item) - - optional_data: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.optional_data, Unset) - else self.optional_data.to_dict() - ) - - qty = self.qty - - side_type: Unset | str = ( - UNSET if isinstance(self.side_type, Unset) else self.side_type.value - ) - - avg_price = self.avg_price - - last_price = self.last_price - - last_qty = self.last_qty - - last_market = self.last_market - - leaves_qty = self.leaves_qty - - cum_qty = self.cum_qty - - transact_ts = self.transact_ts - - ord_status: Unset | str = ( - UNSET if isinstance(self.ord_status, Unset) else self.ord_status.value - ) - - incoming_cl_ord_id = self.incoming_cl_ord_id - - incoming_ord_id = self.incoming_ord_id - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if clearing_info is not UNSET: - field_dict["clearingInfo"] = clearing_info - if id_ is not UNSET: - field_dict["id"] = id - if instructions is not UNSET: - field_dict["instructions"] = instructions - if legs is not UNSET: - field_dict["legs"] = legs - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if qty is not UNSET: - field_dict["qty"] = qty - if side_type is not UNSET: - field_dict["sideType"] = side_type - if avg_price is not UNSET: - field_dict["avgPrice"] = avg_price - if last_price is not UNSET: - field_dict["lastPrice"] = last_price - if last_qty is not UNSET: - field_dict["lastQty"] = last_qty - if last_market is not UNSET: - field_dict["lastMarket"] = last_market - if leaves_qty is not UNSET: - field_dict["leavesQty"] = leaves_qty - if cum_qty is not UNSET: - field_dict["cumQty"] = cum_qty - if transact_ts is not UNSET: - field_dict["transactTs"] = transact_ts - if ord_status is not UNSET: - field_dict["ordStatus"] = ord_status - if incoming_cl_ord_id is not UNSET: - field_dict["incomingClOrdId"] = incoming_cl_ord_id - if incoming_ord_id is not UNSET: - field_dict["incomingOrdId"] = incoming_ord_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo = ( - UNSET - if isinstance(_clearing_info, Unset) - else ClearingInfo.from_dict(_clearing_info) - ) - - id_ = d.pop("id", UNSET) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - legs = [] - _legs = d.pop("legs", UNSET) - for legs_item_data in _legs or []: - legs_item = MultiLegOrderLeg.from_dict(legs_item_data) - - legs.append(legs_item) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | MultiLegOrderCrossAllocationOptionalData = ( - UNSET - if isinstance(_optional_data, Unset) - else MultiLegOrderCrossAllocationOptionalData.from_dict(_optional_data) - ) - - qty = d.pop("qty", UNSET) - - _side_type = d.pop("sideType", UNSET) - side_type: Unset | CrossSideType = ( - UNSET if isinstance(_side_type, Unset) else CrossSideType(_side_type) - ) - - avg_price = d.pop("avgPrice", UNSET) - - last_price = d.pop("lastPrice", UNSET) - - last_qty = d.pop("lastQty", UNSET) - - last_market = d.pop("lastMarket", UNSET) - - leaves_qty = d.pop("leavesQty", UNSET) - - cum_qty = d.pop("cumQty", UNSET) - - transact_ts = d.pop("transactTs", UNSET) - - _ord_status = d.pop("ordStatus", UNSET) - ord_status: Unset | OrdStatus = ( - UNSET if isinstance(_ord_status, Unset) else OrdStatus(_ord_status) - ) - - incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) - - incoming_ord_id = d.pop("incomingOrdId", UNSET) - - multi_leg_order_cross_allocation = cls( - account_id=account_id, - clearing_info=clearing_info, - id_=id_, - instructions=instructions, - legs=legs, - optional_data=optional_data, - qty=qty, - side_type=side_type, - avg_price=avg_price, - last_price=last_price, - last_qty=last_qty, - last_market=last_market, - leaves_qty=leaves_qty, - cum_qty=cum_qty, - transact_ts=transact_ts, - ord_status=ord_status, - incoming_cl_ord_id=incoming_cl_ord_id, - incoming_ord_id=incoming_ord_id, - ) - - return multi_leg_order_cross_allocation diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py deleted file mode 100644 index 98af9b7cf..000000000 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_allocation_optional_data.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="MultiLegOrderCrossAllocationOptionalData") - - -@_attrs_define -class MultiLegOrderCrossAllocationOptionalData: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - multi_leg_order_cross_allocation_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - multi_leg_order_cross_allocation_optional_data.additional_properties = ( - additional_properties - ) - return multi_leg_order_cross_allocation_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py b/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py deleted file mode 100644 index 3a0cae696..000000000 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_market_condition.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="MultiLegOrderCrossMarketCondition") - - -@_attrs_define -class MultiLegOrderCrossMarketCondition: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - multi_leg_order_cross_market_condition = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - multi_leg_order_cross_market_condition.additional_properties = ( - additional_properties - ) - return multi_leg_order_cross_market_condition - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py deleted file mode 100644 index 95eb1fdaf..000000000 --- a/openapi_project/openapi_package/models/multi_leg_order_cross_optional_data.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="MultiLegOrderCrossOptionalData") - - -@_attrs_define -class MultiLegOrderCrossOptionalData: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - multi_leg_order_cross_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - multi_leg_order_cross_optional_data.additional_properties = ( - additional_properties - ) - return multi_leg_order_cross_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/multi_leg_order_leg.py b/openapi_project/openapi_package/models/multi_leg_order_leg.py deleted file mode 100644 index af2db0cfd..000000000 --- a/openapi_project/openapi_package/models/multi_leg_order_leg.py +++ /dev/null @@ -1,249 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.position_effect import PositionEffect -from openapi_project.openapi_package.models.side import Side -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent - from openapi_project.openapi_package.models.multi_leg_order_leg_optional_data import MultiLegOrderLegOptionalData - from openapi_project.openapi_package.models.security import Security - from openapi_project.openapi_package.models.multi_leg_order_leg_market_condition import MultiLegOrderLegMarketCondition -T = TypeVar("T", bound="MultiLegOrderLeg") - - -@_attrs_define -class MultiLegOrderLeg: - """ - Attributes: - id_ (Unset | str): - market_condition (Unset | MultiLegOrderLegMarketCondition): - optional_data (Unset | MultiLegOrderLegOptionalData): - order_updates (Unset | list[OrderUpdateEvent]): - position_effect (Unset | PositionEffect): - price (Unset | float): - qty (Unset | float): - ratio (Unset | int): - security (Unset | Security): - side (Unset | Side): - symbol (Unset | str): - avg_price (Unset | float): - last_price (Unset | float): - last_qty (Unset | float): - last_market (Unset | str): - leaves_qty (Unset | float): - cum_qty (Unset | float): - transact_ts (Unset | str): - """ - - id_: Unset | str = UNSET - market_condition: Unset | MultiLegOrderLegMarketCondition = UNSET - optional_data: Unset | MultiLegOrderLegOptionalData = UNSET - order_updates: Unset | list[OrderUpdateEvent] = UNSET - position_effect: Unset | PositionEffect = UNSET - price: Unset | float = UNSET - qty: Unset | float = UNSET - ratio: Unset | int = UNSET - security: Unset | Security = UNSET - side: Unset | Side = UNSET - symbol: Unset | str = UNSET - avg_price: Unset | float = UNSET - last_price: Unset | float = UNSET - last_qty: Unset | float = UNSET - last_market: Unset | str = UNSET - leaves_qty: Unset | float = UNSET - cum_qty: Unset | float = UNSET - transact_ts: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - id_ = self.id_ - - market_condition: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.market_condition, Unset) - else self.market_condition.to_dict() - ) - - optional_data: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.optional_data, Unset) - else self.optional_data.to_dict() - ) - - order_updates: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.order_updates, Unset): - order_updates = [] - for order_updates_item_data in self.order_updates: - order_updates_item = order_updates_item_data.to_dict() - order_updates.append(order_updates_item) - - position_effect: Unset | str = ( - UNSET - if isinstance(self.position_effect, Unset) - else self.position_effect.value - ) - - price = self.price - - qty = self.qty - - ratio = self.ratio - - security: Unset | dict[str, Any] = ( - UNSET if isinstance(self.security, Unset) else self.security.to_dict() - ) - - side: Unset | str = UNSET if isinstance(self.side, Unset) else self.side.value - - symbol = self.symbol - - avg_price = self.avg_price - - last_price = self.last_price - - last_qty = self.last_qty - - last_market = self.last_market - - leaves_qty = self.leaves_qty - - cum_qty = self.cum_qty - - transact_ts = self.transact_ts - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if id_ is not UNSET: - field_dict["id"] = id - if market_condition is not UNSET: - field_dict["marketCondition"] = market_condition - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if order_updates is not UNSET: - field_dict["orderUpdates"] = order_updates - if position_effect is not UNSET: - field_dict["positionEffect"] = position_effect - if price is not UNSET: - field_dict["price"] = price - if qty is not UNSET: - field_dict["qty"] = qty - if ratio is not UNSET: - field_dict["ratio"] = ratio - if security is not UNSET: - field_dict["security"] = security - if side is not UNSET: - field_dict["side"] = side - if symbol is not UNSET: - field_dict["symbol"] = symbol - if avg_price is not UNSET: - field_dict["avgPrice"] = avg_price - if last_price is not UNSET: - field_dict["lastPrice"] = last_price - if last_qty is not UNSET: - field_dict["lastQty"] = last_qty - if last_market is not UNSET: - field_dict["lastMarket"] = last_market - if leaves_qty is not UNSET: - field_dict["leavesQty"] = leaves_qty - if cum_qty is not UNSET: - field_dict["cumQty"] = cum_qty - if transact_ts is not UNSET: - field_dict["transactTs"] = transact_ts - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - id_ = d.pop("id", UNSET) - - _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | MultiLegOrderLegMarketCondition = ( - UNSET - if isinstance(_market_condition, Unset) - else MultiLegOrderLegMarketCondition.from_dict(_market_condition) - ) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | MultiLegOrderLegOptionalData = ( - UNSET - if isinstance(_optional_data, Unset) - else MultiLegOrderLegOptionalData.from_dict(_optional_data) - ) - - order_updates = [] - _order_updates = d.pop("orderUpdates", UNSET) - for order_updates_item_data in _order_updates or []: - order_updates_item = OrderUpdateEvent.from_dict(order_updates_item_data) - - order_updates.append(order_updates_item) - - _position_effect = d.pop("positionEffect", UNSET) - position_effect: Unset | PositionEffect = ( - UNSET - if isinstance(_position_effect, Unset) - else PositionEffect(_position_effect) - ) - - price = d.pop("price", UNSET) - - qty = d.pop("qty", UNSET) - - ratio = d.pop("ratio", UNSET) - - _security = d.pop("security", UNSET) - security: Unset | Security = ( - UNSET if isinstance(_security, Unset) else Security.from_dict(_security) - ) - - _side = d.pop("side", UNSET) - side: Unset | Side = UNSET if isinstance(_side, Unset) else Side(_side) - - symbol = d.pop("symbol", UNSET) - - avg_price = d.pop("avgPrice", UNSET) - - last_price = d.pop("lastPrice", UNSET) - - last_qty = d.pop("lastQty", UNSET) - - last_market = d.pop("lastMarket", UNSET) - - leaves_qty = d.pop("leavesQty", UNSET) - - cum_qty = d.pop("cumQty", UNSET) - - transact_ts = d.pop("transactTs", UNSET) - - multi_leg_order_leg = cls( - id_=id_, - market_condition=market_condition, - optional_data=optional_data, - order_updates=order_updates, - position_effect=position_effect, - price=price, - qty=qty, - ratio=ratio, - security=security, - side=side, - symbol=symbol, - avg_price=avg_price, - last_price=last_price, - last_qty=last_qty, - last_market=last_market, - leaves_qty=leaves_qty, - cum_qty=cum_qty, - transact_ts=transact_ts, - ) - - return multi_leg_order_leg diff --git a/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py b/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py deleted file mode 100644 index 4681957cc..000000000 --- a/openapi_project/openapi_package/models/multi_leg_order_leg_market_condition.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="MultiLegOrderLegMarketCondition") - - -@_attrs_define -class MultiLegOrderLegMarketCondition: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - multi_leg_order_leg_market_condition = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - multi_leg_order_leg_market_condition.additional_properties = ( - additional_properties - ) - return multi_leg_order_leg_market_condition - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py deleted file mode 100644 index a098fce45..000000000 --- a/openapi_project/openapi_package/models/multi_leg_order_leg_optional_data.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="MultiLegOrderLegOptionalData") - - -@_attrs_define -class MultiLegOrderLegOptionalData: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - multi_leg_order_leg_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - multi_leg_order_leg_optional_data.additional_properties = additional_properties - return multi_leg_order_leg_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/multi_leg_order_market_condition.py b/openapi_project/openapi_package/models/multi_leg_order_market_condition.py deleted file mode 100644 index aeb0d4b6e..000000000 --- a/openapi_project/openapi_package/models/multi_leg_order_market_condition.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="MultiLegOrderMarketCondition") - - -@_attrs_define -class MultiLegOrderMarketCondition: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - multi_leg_order_market_condition = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - multi_leg_order_market_condition.additional_properties = additional_properties - return multi_leg_order_market_condition - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/multi_leg_order_optional_data.py b/openapi_project/openapi_package/models/multi_leg_order_optional_data.py deleted file mode 100644 index b02a0ec60..000000000 --- a/openapi_project/openapi_package/models/multi_leg_order_optional_data.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="MultiLegOrderOptionalData") - - -@_attrs_define -class MultiLegOrderOptionalData: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - multi_leg_order_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - multi_leg_order_optional_data.additional_properties = additional_properties - return multi_leg_order_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/multi_leg_reporting_type.py b/openapi_project/openapi_package/models/multi_leg_reporting_type.py deleted file mode 100644 index 3bfe5e229..000000000 --- a/openapi_project/openapi_package/models/multi_leg_reporting_type.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class MultiLegReportingType(str, Enum): - MULTI_LEG_REPORTING_TYPE_LEG = "MULTI_LEG_REPORTING_TYPE_LEG" - MULTI_LEG_REPORTING_TYPE_PARENT = "MULTI_LEG_REPORTING_TYPE_PARENT" - MULTI_LEG_REPORTING_TYPE_SINGLE = "MULTI_LEG_REPORTING_TYPE_SINGLE" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/numeric_display_format.py b/openapi_project/openapi_package/models/numeric_display_format.py deleted file mode 100644 index f28c58032..000000000 --- a/openapi_project/openapi_package/models/numeric_display_format.py +++ /dev/null @@ -1,32 +0,0 @@ -from enum import Enum - - -class NumericDisplayFormat(str, Enum): - NUMERIC_DISPLAY_FORMAT_AUTO = "NUMERIC_DISPLAY_FORMAT_AUTO" - NUMERIC_DISPLAY_FORMAT_DECIMAL_00 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_00" - NUMERIC_DISPLAY_FORMAT_DECIMAL_01 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_01" - NUMERIC_DISPLAY_FORMAT_DECIMAL_02 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_02" - NUMERIC_DISPLAY_FORMAT_DECIMAL_03 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_03" - NUMERIC_DISPLAY_FORMAT_DECIMAL_04 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_04" - NUMERIC_DISPLAY_FORMAT_DECIMAL_05 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_05" - NUMERIC_DISPLAY_FORMAT_DECIMAL_06 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_06" - NUMERIC_DISPLAY_FORMAT_DECIMAL_07 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_07" - NUMERIC_DISPLAY_FORMAT_DECIMAL_08 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_08" - NUMERIC_DISPLAY_FORMAT_DECIMAL_09 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_09" - NUMERIC_DISPLAY_FORMAT_DECIMAL_10 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_10" - NUMERIC_DISPLAY_FORMAT_DECIMAL_11 = "NUMERIC_DISPLAY_FORMAT_DECIMAL_11" - NUMERIC_DISPLAY_FORMAT_FRACTIONAL_128TH = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_128TH" - NUMERIC_DISPLAY_FORMAT_FRACTIONAL_16TH = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_16TH" - NUMERIC_DISPLAY_FORMAT_FRACTIONAL_256TH = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_256TH" - NUMERIC_DISPLAY_FORMAT_FRACTIONAL_32ND = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_32ND" - NUMERIC_DISPLAY_FORMAT_FRACTIONAL_512ND = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_512ND" - NUMERIC_DISPLAY_FORMAT_FRACTIONAL_64TH = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_64TH" - NUMERIC_DISPLAY_FORMAT_FRACTIONAL_8TH = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_8TH" - NUMERIC_DISPLAY_FORMAT_FRACTIONAL_HALF = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_HALF" - NUMERIC_DISPLAY_FORMAT_FRACTIONAL_QUARTER = ( - "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_QUARTER" - ) - NUMERIC_DISPLAY_FORMAT_FRACTIONAL_WHOLE = "NUMERIC_DISPLAY_FORMAT_FRACTIONAL_WHOLE" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/option.py b/openapi_project/openapi_package/models/option.py deleted file mode 100644 index 70a69e1d1..000000000 --- a/openapi_project/openapi_package/models/option.py +++ /dev/null @@ -1,395 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.models.exchange_code import ExchangeCode -from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat -from openapi_project.openapi_package.models.option_expiration_style import OptionExpirationStyle -from openapi_project.openapi_package.models.put_call import PutCall -from openapi_project.openapi_package.models.security_category import SecurityCategory -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.option_aliases import OptionAliases - from openapi_project.openapi_package.models.option_root import OptionRoot - from openapi_project.openapi_package.models.date import Date - - -T = TypeVar("T", bound="Option") - - -@_attrs_define -class Option: - """ - Attributes: - aliases (Unset | OptionAliases): - currency (Unset | Currency): - listed_dt (Unset | Date): - delisted_dt (Unset | Date): - description (Unset | str): - exchange_id (Unset | int): - id_ (Unset | int): - multiplier (Unset | float): - price_base_factor (Unset | float): - price_display_factor (Unset | float): - price_display_format (Unset | NumericDisplayFormat): - qty_display_factor (Unset | float): - qty_display_format (Unset | NumericDisplayFormat): - security_category (Unset | SecurityCategory): - symbol (Unset | str): - tick_rule (Unset | str): - tick_size (Unset | float): - tick_value (Unset | float): - traded_exchanges (Unset | list[ExchangeCode]): - expiration_dt (Unset | Date): - expiration_style (Unset | OptionExpirationStyle): - first_trade_dt (Unset | Date): - last_trade_dt (Unset | Date): - put_call (Unset | PutCall): - root (Unset | OptionRoot): - strike (Unset | float): - underlying (Unset | str): - """ - - aliases: Unset | OptionAliases = UNSET - currency: Unset | Currency = UNSET - listed_dt: Unset | Date = UNSET - delisted_dt: Unset | Date = UNSET - description: Unset | str = UNSET - exchange_id: Unset | int = UNSET - id_: Unset | int = UNSET - multiplier: Unset | float = UNSET - price_base_factor: Unset | float = UNSET - price_display_factor: Unset | float = UNSET - price_display_format: Unset | NumericDisplayFormat = UNSET - qty_display_factor: Unset | float = UNSET - qty_display_format: Unset | NumericDisplayFormat = UNSET - security_category: Unset | SecurityCategory = UNSET - symbol: Unset | str = UNSET - tick_rule: Unset | str = UNSET - tick_size: Unset | float = UNSET - tick_value: Unset | float = UNSET - traded_exchanges: Unset | list[ExchangeCode] = UNSET - expiration_dt: Unset | Date = UNSET - expiration_style: Unset | OptionExpirationStyle = UNSET - first_trade_dt: Unset | Date = UNSET - last_trade_dt: Unset | Date = UNSET - put_call: Unset | PutCall = UNSET - root: Unset | OptionRoot = UNSET - strike: Unset | float = UNSET - underlying: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = ( - UNSET if isinstance(self.aliases, Unset) else self.aliases.to_dict() - ) - - currency: Unset | str = ( - UNSET if isinstance(self.currency, Unset) else self.currency.value - ) - - listed_dt: Unset | dict[str, Any] = ( - UNSET if isinstance(self.listed_dt, Unset) else self.listed_dt.to_dict() - ) - - delisted_dt: Unset | dict[str, Any] = ( - UNSET if isinstance(self.delisted_dt, Unset) else self.delisted_dt.to_dict() - ) - - description = self.description - - exchange_id = self.exchange_id - - id_ = self.id_ - - multiplier = self.multiplier - - price_base_factor = self.price_base_factor - - price_display_factor = self.price_display_factor - - price_display_format: Unset | str = ( - UNSET - if isinstance(self.price_display_format, Unset) - else self.price_display_format.value - ) - - qty_display_factor = self.qty_display_factor - - qty_display_format: Unset | str = ( - UNSET - if isinstance(self.qty_display_format, Unset) - else self.qty_display_format.value - ) - - security_category: Unset | str = ( - UNSET - if isinstance(self.security_category, Unset) - else self.security_category.value - ) - - symbol = self.symbol - - tick_rule = self.tick_rule - - tick_size = self.tick_size - - tick_value = self.tick_value - - traded_exchanges: Unset | list[str] = UNSET - if not isinstance(self.traded_exchanges, Unset): - traded_exchanges = [] - for traded_exchanges_item_data in self.traded_exchanges: - traded_exchanges_item = traded_exchanges_item_data.value - traded_exchanges.append(traded_exchanges_item) - - expiration_dt: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.expiration_dt, Unset) - else self.expiration_dt.to_dict() - ) - - expiration_style: Unset | str = ( - UNSET - if isinstance(self.expiration_style, Unset) - else self.expiration_style.value - ) - - first_trade_dt: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.first_trade_dt, Unset) - else self.first_trade_dt.to_dict() - ) - - last_trade_dt: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.last_trade_dt, Unset) - else self.last_trade_dt.to_dict() - ) - - put_call: Unset | str = ( - UNSET if isinstance(self.put_call, Unset) else self.put_call.value - ) - - root: Unset | dict[str, Any] = ( - UNSET if isinstance(self.root, Unset) else self.root.to_dict() - ) - - strike = self.strike - - underlying = self.underlying - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if aliases is not UNSET: - field_dict["aliases"] = aliases - if currency is not UNSET: - field_dict["currency"] = currency - if listed_dt is not UNSET: - field_dict["listedDt"] = listed_dt - if delisted_dt is not UNSET: - field_dict["delistedDt"] = delisted_dt - if description is not UNSET: - field_dict["description"] = description - if exchange_id is not UNSET: - field_dict["exchangeId"] = exchange_id - if id_ is not UNSET: - field_dict["id"] = id - if multiplier is not UNSET: - field_dict["multiplier"] = multiplier - if price_base_factor is not UNSET: - field_dict["priceBaseFactor"] = price_base_factor - if price_display_factor is not UNSET: - field_dict["priceDisplayFactor"] = price_display_factor - if price_display_format is not UNSET: - field_dict["priceDisplayFormat"] = price_display_format - if qty_display_factor is not UNSET: - field_dict["qtyDisplayFactor"] = qty_display_factor - if qty_display_format is not UNSET: - field_dict["qtyDisplayFormat"] = qty_display_format - if security_category is not UNSET: - field_dict["securityCategory"] = security_category - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tick_rule is not UNSET: - field_dict["tickRule"] = tick_rule - if tick_size is not UNSET: - field_dict["tickSize"] = tick_size - if tick_value is not UNSET: - field_dict["tickValue"] = tick_value - if traded_exchanges is not UNSET: - field_dict["tradedExchanges"] = traded_exchanges - if expiration_dt is not UNSET: - field_dict["expirationDt"] = expiration_dt - if expiration_style is not UNSET: - field_dict["expirationStyle"] = expiration_style - if first_trade_dt is not UNSET: - field_dict["firstTradeDt"] = first_trade_dt - if last_trade_dt is not UNSET: - field_dict["lastTradeDt"] = last_trade_dt - if put_call is not UNSET: - field_dict["putCall"] = put_call - if root is not UNSET: - field_dict["root"] = root - if strike is not UNSET: - field_dict["strike"] = strike - if underlying is not UNSET: - field_dict["underlying"] = underlying - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _aliases = d.pop("aliases", UNSET) - aliases: Unset | OptionAliases = ( - UNSET if isinstance(_aliases, Unset) else OptionAliases.from_dict(_aliases) - ) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency = ( - UNSET if isinstance(_currency, Unset) else Currency(_currency) - ) - - _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date = ( - UNSET if isinstance(_listed_dt, Unset) else Date.from_dict(_listed_dt) - ) - - _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date = ( - UNSET if isinstance(_delisted_dt, Unset) else Date.from_dict(_delisted_dt) - ) - - description = d.pop("description", UNSET) - - exchange_id = d.pop("exchangeId", UNSET) - - id_ = d.pop("id", UNSET) - - multiplier = d.pop("multiplier", UNSET) - - price_base_factor = d.pop("priceBaseFactor", UNSET) - - price_display_factor = d.pop("priceDisplayFactor", UNSET) - - _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat = ( - UNSET - if isinstance(_price_display_format, Unset) - else NumericDisplayFormat(_price_display_format) - ) - - qty_display_factor = d.pop("qtyDisplayFactor", UNSET) - - _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat = ( - UNSET - if isinstance(_qty_display_format, Unset) - else NumericDisplayFormat(_qty_display_format) - ) - - _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory = ( - UNSET - if isinstance(_security_category, Unset) - else SecurityCategory(_security_category) - ) - - symbol = d.pop("symbol", UNSET) - - tick_rule = d.pop("tickRule", UNSET) - - tick_size = d.pop("tickSize", UNSET) - - tick_value = d.pop("tickValue", UNSET) - - traded_exchanges = [] - _traded_exchanges = d.pop("tradedExchanges", UNSET) - for traded_exchanges_item_data in _traded_exchanges or []: - traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) - - traded_exchanges.append(traded_exchanges_item) - - _expiration_dt = d.pop("expirationDt", UNSET) - expiration_dt: Unset | Date = ( - UNSET - if isinstance(_expiration_dt, Unset) - else Date.from_dict(_expiration_dt) - ) - - _expiration_style = d.pop("expirationStyle", UNSET) - expiration_style: Unset | OptionExpirationStyle = ( - UNSET - if isinstance(_expiration_style, Unset) - else OptionExpirationStyle(_expiration_style) - ) - - _first_trade_dt = d.pop("firstTradeDt", UNSET) - first_trade_dt: Unset | Date = ( - UNSET - if isinstance(_first_trade_dt, Unset) - else Date.from_dict(_first_trade_dt) - ) - - _last_trade_dt = d.pop("lastTradeDt", UNSET) - last_trade_dt: Unset | Date = ( - UNSET - if isinstance(_last_trade_dt, Unset) - else Date.from_dict(_last_trade_dt) - ) - - _put_call = d.pop("putCall", UNSET) - put_call: Unset | PutCall = ( - UNSET if isinstance(_put_call, Unset) else PutCall(_put_call) - ) - - _root = d.pop("root", UNSET) - root: Unset | OptionRoot = ( - UNSET if isinstance(_root, Unset) else OptionRoot.from_dict(_root) - ) - - strike = d.pop("strike", UNSET) - - underlying = d.pop("underlying", UNSET) - - option = cls( - aliases=aliases, - currency=currency, - listed_dt=listed_dt, - delisted_dt=delisted_dt, - description=description, - exchange_id=exchange_id, - id_=id_, - multiplier=multiplier, - price_base_factor=price_base_factor, - price_display_factor=price_display_factor, - price_display_format=price_display_format, - qty_display_factor=qty_display_factor, - qty_display_format=qty_display_format, - security_category=security_category, - symbol=symbol, - tick_rule=tick_rule, - tick_size=tick_size, - tick_value=tick_value, - traded_exchanges=traded_exchanges, - expiration_dt=expiration_dt, - expiration_style=expiration_style, - first_trade_dt=first_trade_dt, - last_trade_dt=last_trade_dt, - put_call=put_call, - root=root, - strike=strike, - underlying=underlying, - ) - - return option diff --git a/openapi_project/openapi_package/models/option_aliases.py b/openapi_project/openapi_package/models/option_aliases.py deleted file mode 100644 index 067b8a3d6..000000000 --- a/openapi_project/openapi_package/models/option_aliases.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="OptionAliases") - - -@_attrs_define -class OptionAliases: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - option_aliases = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - option_aliases.additional_properties = additional_properties - return option_aliases - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_at_time_quote_format.py b/openapi_project/openapi_package/models/option_at_time_quote_format.py new file mode 100644 index 000000000..11603db46 --- /dev/null +++ b/openapi_project/openapi_package/models/option_at_time_quote_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionAtTimeQuoteFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_at_time_quote_response_200.py b/openapi_project/openapi_package/models/option_at_time_quote_response_200.py new file mode 100644 index 000000000..d6f4d277b --- /dev/null +++ b/openapi_project/openapi_package/models/option_at_time_quote_response_200.py @@ -0,0 +1,216 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionAtTimeQuoteResponse200") + + + +@_attrs_define +class OptionAtTimeQuoteResponse200: + """ + Attributes: + symbol (list[str]): + ask_size (list[int]): + ask_condition (list[int]): + strike (list[float]): + right (list[str]): + bid_size (list[int]): + ask_exchange (list[int]): + bid_exchange (list[int]): + ask (list[float]): + expiration (list[str]): + bid (list[float]): + bid_condition (list[int]): + timestamp (list[str]): + """ + + symbol: list[str] + ask_size: list[int] + ask_condition: list[int] + strike: list[float] + right: list[str] + bid_size: list[int] + ask_exchange: list[int] + bid_exchange: list[int] + ask: list[float] + expiration: list[str] + bid: list[float] + bid_condition: list[int] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + ask_size = self.ask_size + + + + ask_condition = self.ask_condition + + + + strike = self.strike + + + + right = self.right + + + + bid_size = self.bid_size + + + + ask_exchange = self.ask_exchange + + + + bid_exchange = self.bid_exchange + + + + ask = self.ask + + + + expiration = self.expiration + + + + bid = self.bid + + + + bid_condition = self.bid_condition + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "ask_size": ask_size, + "ask_condition": ask_condition, + "strike": strike, + "right": right, + "bid_size": bid_size, + "ask_exchange": ask_exchange, + "bid_exchange": bid_exchange, + "ask": ask, + "expiration": expiration, + "bid": bid, + "bid_condition": bid_condition, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + ask_size = cast(list[int], d.pop("ask_size")) + + + ask_condition = cast(list[int], d.pop("ask_condition")) + + + strike = cast(list[float], d.pop("strike")) + + + right = cast(list[str], d.pop("right")) + + + bid_size = cast(list[int], d.pop("bid_size")) + + + ask_exchange = cast(list[int], d.pop("ask_exchange")) + + + bid_exchange = cast(list[int], d.pop("bid_exchange")) + + + ask = cast(list[float], d.pop("ask")) + + + expiration = cast(list[str], d.pop("expiration")) + + + bid = cast(list[float], d.pop("bid")) + + + bid_condition = cast(list[int], d.pop("bid_condition")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + option_at_time_quote_response_200 = cls( + symbol=symbol, + ask_size=ask_size, + ask_condition=ask_condition, + strike=strike, + right=right, + bid_size=bid_size, + ask_exchange=ask_exchange, + bid_exchange=bid_exchange, + ask=ask, + expiration=expiration, + bid=bid, + bid_condition=bid_condition, + timestamp=timestamp, + ) + + + + option_at_time_quote_response_200.additional_properties = d + return option_at_time_quote_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_at_time_quote_right.py b/openapi_project/openapi_package/models/option_at_time_quote_right.py new file mode 100644 index 000000000..7999fd8c9 --- /dev/null +++ b/openapi_project/openapi_package/models/option_at_time_quote_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionAtTimeQuoteRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_at_time_trade_format.py b/openapi_project/openapi_package/models/option_at_time_trade_format.py new file mode 100644 index 000000000..5f735a163 --- /dev/null +++ b/openapi_project/openapi_package/models/option_at_time_trade_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionAtTimeTradeFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_at_time_trade_response_200.py b/openapi_project/openapi_package/models/option_at_time_trade_response_200.py new file mode 100644 index 000000000..99ce63425 --- /dev/null +++ b/openapi_project/openapi_package/models/option_at_time_trade_response_200.py @@ -0,0 +1,227 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionAtTimeTradeResponse200") + + + +@_attrs_define +class OptionAtTimeTradeResponse200: + """ + Attributes: + symbol (list[str]): + strike (list[float]): + right (list[str]): + sequence (list[int]): + condition (list[int]): + size (list[int]): + price (list[float]): + ext_condition2 (list[int]): + ext_condition1 (list[int]): + expiration (list[str]): + ext_condition4 (list[int]): + exchange (list[int]): + ext_condition3 (list[int]): + timestamp (list[str]): + """ + + symbol: list[str] + strike: list[float] + right: list[str] + sequence: list[int] + condition: list[int] + size: list[int] + price: list[float] + ext_condition2: list[int] + ext_condition1: list[int] + expiration: list[str] + ext_condition4: list[int] + exchange: list[int] + ext_condition3: list[int] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + strike = self.strike + + + + right = self.right + + + + sequence = self.sequence + + + + condition = self.condition + + + + size = self.size + + + + price = self.price + + + + ext_condition2 = self.ext_condition2 + + + + ext_condition1 = self.ext_condition1 + + + + expiration = self.expiration + + + + ext_condition4 = self.ext_condition4 + + + + exchange = self.exchange + + + + ext_condition3 = self.ext_condition3 + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "strike": strike, + "right": right, + "sequence": sequence, + "condition": condition, + "size": size, + "price": price, + "ext_condition2": ext_condition2, + "ext_condition1": ext_condition1, + "expiration": expiration, + "ext_condition4": ext_condition4, + "exchange": exchange, + "ext_condition3": ext_condition3, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + strike = cast(list[float], d.pop("strike")) + + + right = cast(list[str], d.pop("right")) + + + sequence = cast(list[int], d.pop("sequence")) + + + condition = cast(list[int], d.pop("condition")) + + + size = cast(list[int], d.pop("size")) + + + price = cast(list[float], d.pop("price")) + + + ext_condition2 = cast(list[int], d.pop("ext_condition2")) + + + ext_condition1 = cast(list[int], d.pop("ext_condition1")) + + + expiration = cast(list[str], d.pop("expiration")) + + + ext_condition4 = cast(list[int], d.pop("ext_condition4")) + + + exchange = cast(list[int], d.pop("exchange")) + + + ext_condition3 = cast(list[int], d.pop("ext_condition3")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + option_at_time_trade_response_200 = cls( + symbol=symbol, + strike=strike, + right=right, + sequence=sequence, + condition=condition, + size=size, + price=price, + ext_condition2=ext_condition2, + ext_condition1=ext_condition1, + expiration=expiration, + ext_condition4=ext_condition4, + exchange=exchange, + ext_condition3=ext_condition3, + timestamp=timestamp, + ) + + + + option_at_time_trade_response_200.additional_properties = d + return option_at_time_trade_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_at_time_trade_right.py b/openapi_project/openapi_package/models/option_at_time_trade_right.py new file mode 100644 index 000000000..e7382eb6e --- /dev/null +++ b/openapi_project/openapi_package/models/option_at_time_trade_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionAtTimeTradeRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_chain.py b/openapi_project/openapi_package/models/option_chain.py deleted file mode 100644 index d77daa0ff..000000000 --- a/openapi_project/openapi_package/models/option_chain.py +++ /dev/null @@ -1,125 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.option_chain_options import OptionChainOptions - from openapi_project.openapi_package.models.security import Security - from openapi_project.openapi_package.models.option_chain_roots import OptionChainRoots - from openapi_project.openapi_package.models.option_series import OptionSeries - - -T = TypeVar("T", bound="OptionChain") - - -@_attrs_define -class OptionChain: - """ - Attributes: - underlying (Unset | Security): - roots (Unset | OptionChainRoots): - options (Unset | OptionChainOptions): - option_series (Unset | list[OptionSeries]): - post (Unset | str): - station (Unset | str): - """ - - underlying: Unset | Security = UNSET - roots: Unset | OptionChainRoots = UNSET - options: Unset | OptionChainOptions = UNSET - option_series: Unset | list[OptionSeries] = UNSET - post: Unset | str = UNSET - station: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - underlying: Unset | dict[str, Any] = ( - UNSET if isinstance(self.underlying, Unset) else self.underlying.to_dict() - ) - - roots: Unset | dict[str, Any] = ( - UNSET if isinstance(self.roots, Unset) else self.roots.to_dict() - ) - - options: Unset | dict[str, Any] = ( - UNSET if isinstance(self.options, Unset) else self.options.to_dict() - ) - - option_series: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.option_series, Unset): - option_series = [] - for option_series_item_data in self.option_series: - option_series_item = option_series_item_data.to_dict() - option_series.append(option_series_item) - - post = self.post - - station = self.station - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if underlying is not UNSET: - field_dict["underlying"] = underlying - if roots is not UNSET: - field_dict["roots"] = roots - if options is not UNSET: - field_dict["options"] = options - if option_series is not UNSET: - field_dict["optionSeries"] = option_series - if post is not UNSET: - field_dict["post"] = post - if station is not UNSET: - field_dict["station"] = station - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _underlying = d.pop("underlying", UNSET) - underlying: Unset | Security = ( - UNSET if isinstance(_underlying, Unset) else Security.from_dict(_underlying) - ) - - _roots = d.pop("roots", UNSET) - roots: Unset | OptionChainRoots = ( - UNSET if isinstance(_roots, Unset) else OptionChainRoots.from_dict(_roots) - ) - - _options = d.pop("options", UNSET) - options: Unset | OptionChainOptions = ( - UNSET - if isinstance(_options, Unset) - else OptionChainOptions.from_dict(_options) - ) - - option_series = [] - _option_series = d.pop("optionSeries", UNSET) - for option_series_item_data in _option_series or []: - option_series_item = OptionSeries.from_dict(option_series_item_data) - - option_series.append(option_series_item) - - post = d.pop("post", UNSET) - - station = d.pop("station", UNSET) - - option_chain = cls( - underlying=underlying, - roots=roots, - options=options, - option_series=option_series, - post=post, - station=station, - ) - - return option_chain diff --git a/openapi_project/openapi_package/models/option_chain_option.py b/openapi_project/openapi_package/models/option_chain_option.py deleted file mode 100644 index e8a310a8f..000000000 --- a/openapi_project/openapi_package/models/option_chain_option.py +++ /dev/null @@ -1,220 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.exchange_code import ExchangeCode -from openapi_project.openapi_package.models.put_call import PutCall -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.option_chain_option_aliases import OptionChainOptionAliases - from openapi_project.openapi_package.models.date import Date - - -T = TypeVar("T", bound="OptionChainOption") - - -@_attrs_define -class OptionChainOption: - """ - Attributes: - aliases (Unset | OptionChainOptionAliases): - listed_dt (Unset | Date): - delisted_dt (Unset | Date): - description (Unset | str): - exchange_id (Unset | int): - id_ (Unset | int): - tick_rule (Unset | str): - tick_size (Unset | float): - tick_value (Unset | float): - traded_exchanges (Unset | list[ExchangeCode]): - first_trade_dt (Unset | Date): - last_trade_dt (Unset | Date): - put_call (Unset | PutCall): - strike (Unset | float): - """ - - aliases: Unset | OptionChainOptionAliases = UNSET - listed_dt: Unset | Date = UNSET - delisted_dt: Unset | Date = UNSET - description: Unset | str = UNSET - exchange_id: Unset | int = UNSET - id_: Unset | int = UNSET - tick_rule: Unset | str = UNSET - tick_size: Unset | float = UNSET - tick_value: Unset | float = UNSET - traded_exchanges: Unset | list[ExchangeCode] = UNSET - first_trade_dt: Unset | Date = UNSET - last_trade_dt: Unset | Date = UNSET - put_call: Unset | PutCall = UNSET - strike: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = ( - UNSET if isinstance(self.aliases, Unset) else self.aliases.to_dict() - ) - - listed_dt: Unset | dict[str, Any] = ( - UNSET if isinstance(self.listed_dt, Unset) else self.listed_dt.to_dict() - ) - - delisted_dt: Unset | dict[str, Any] = ( - UNSET if isinstance(self.delisted_dt, Unset) else self.delisted_dt.to_dict() - ) - - description = self.description - - exchange_id = self.exchange_id - - id_ = self.id_ - - tick_rule = self.tick_rule - - tick_size = self.tick_size - - tick_value = self.tick_value - - traded_exchanges: Unset | list[str] = UNSET - if not isinstance(self.traded_exchanges, Unset): - traded_exchanges = [] - for traded_exchanges_item_data in self.traded_exchanges: - traded_exchanges_item = traded_exchanges_item_data.value - traded_exchanges.append(traded_exchanges_item) - - first_trade_dt: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.first_trade_dt, Unset) - else self.first_trade_dt.to_dict() - ) - - last_trade_dt: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.last_trade_dt, Unset) - else self.last_trade_dt.to_dict() - ) - - put_call: Unset | str = ( - UNSET if isinstance(self.put_call, Unset) else self.put_call.value - ) - - strike = self.strike - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if aliases is not UNSET: - field_dict["aliases"] = aliases - if listed_dt is not UNSET: - field_dict["listedDt"] = listed_dt - if delisted_dt is not UNSET: - field_dict["delistedDt"] = delisted_dt - if description is not UNSET: - field_dict["description"] = description - if exchange_id is not UNSET: - field_dict["exchangeId"] = exchange_id - if id_ is not UNSET: - field_dict["id"] = id - if tick_rule is not UNSET: - field_dict["tickRule"] = tick_rule - if tick_size is not UNSET: - field_dict["tickSize"] = tick_size - if tick_value is not UNSET: - field_dict["tickValue"] = tick_value - if traded_exchanges is not UNSET: - field_dict["tradedExchanges"] = traded_exchanges - if first_trade_dt is not UNSET: - field_dict["firstTradeDt"] = first_trade_dt - if last_trade_dt is not UNSET: - field_dict["lastTradeDt"] = last_trade_dt - if put_call is not UNSET: - field_dict["putCall"] = put_call - if strike is not UNSET: - field_dict["strike"] = strike - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _aliases = d.pop("aliases", UNSET) - aliases: Unset | OptionChainOptionAliases = ( - UNSET - if isinstance(_aliases, Unset) - else OptionChainOptionAliases.from_dict(_aliases) - ) - - _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date = ( - UNSET if isinstance(_listed_dt, Unset) else Date.from_dict(_listed_dt) - ) - - _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date = ( - UNSET if isinstance(_delisted_dt, Unset) else Date.from_dict(_delisted_dt) - ) - - description = d.pop("description", UNSET) - - exchange_id = d.pop("exchangeId", UNSET) - - id_ = d.pop("id", UNSET) - - tick_rule = d.pop("tickRule", UNSET) - - tick_size = d.pop("tickSize", UNSET) - - tick_value = d.pop("tickValue", UNSET) - - traded_exchanges = [] - _traded_exchanges = d.pop("tradedExchanges", UNSET) - for traded_exchanges_item_data in _traded_exchanges or []: - traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) - - traded_exchanges.append(traded_exchanges_item) - - _first_trade_dt = d.pop("firstTradeDt", UNSET) - first_trade_dt: Unset | Date = ( - UNSET - if isinstance(_first_trade_dt, Unset) - else Date.from_dict(_first_trade_dt) - ) - - _last_trade_dt = d.pop("lastTradeDt", UNSET) - last_trade_dt: Unset | Date = ( - UNSET - if isinstance(_last_trade_dt, Unset) - else Date.from_dict(_last_trade_dt) - ) - - _put_call = d.pop("putCall", UNSET) - put_call: Unset | PutCall = ( - UNSET if isinstance(_put_call, Unset) else PutCall(_put_call) - ) - - strike = d.pop("strike", UNSET) - - option_chain_option = cls( - aliases=aliases, - listed_dt=listed_dt, - delisted_dt=delisted_dt, - description=description, - exchange_id=exchange_id, - id_=id_, - tick_rule=tick_rule, - tick_size=tick_size, - tick_value=tick_value, - traded_exchanges=traded_exchanges, - first_trade_dt=first_trade_dt, - last_trade_dt=last_trade_dt, - put_call=put_call, - strike=strike, - ) - - return option_chain_option diff --git a/openapi_project/openapi_package/models/option_chain_option_aliases.py b/openapi_project/openapi_package/models/option_chain_option_aliases.py deleted file mode 100644 index 24c78de95..000000000 --- a/openapi_project/openapi_package/models/option_chain_option_aliases.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="OptionChainOptionAliases") - - -@_attrs_define -class OptionChainOptionAliases: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - option_chain_option_aliases = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - option_chain_option_aliases.additional_properties = additional_properties - return option_chain_option_aliases - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_chain_options.py b/openapi_project/openapi_package/models/option_chain_options.py deleted file mode 100644 index 1fb9619ca..000000000 --- a/openapi_project/openapi_package/models/option_chain_options.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.option_chain_option import OptionChainOption - - -T = TypeVar("T", bound="OptionChainOptions") - - -@_attrs_define -class OptionChainOptions: - """ """ - - additional_properties: dict[str, OptionChainOption] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - { - prop_name: prop.to_dict() - for prop_name, prop in self.additional_properties.items() - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - option_chain_options = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = OptionChainOption.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - option_chain_options.additional_properties = additional_properties - return option_chain_options - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> OptionChainOption: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: OptionChainOption) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_chain_roots.py b/openapi_project/openapi_package/models/option_chain_roots.py deleted file mode 100644 index 8537d42bc..000000000 --- a/openapi_project/openapi_package/models/option_chain_roots.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.option_root import OptionRoot - - -T = TypeVar("T", bound="OptionChainRoots") - - -@_attrs_define -class OptionChainRoots: - """ """ - - additional_properties: dict[str, OptionRoot] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - { - prop_name: prop.to_dict() - for prop_name, prop in self.additional_properties.items() - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - option_chain_roots = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - additional_property = OptionRoot.from_dict(prop_dict) - - additional_properties[prop_name] = additional_property - - option_chain_roots.additional_properties = additional_properties - return option_chain_roots - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> OptionRoot: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: OptionRoot) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_exercise_style.py b/openapi_project/openapi_package/models/option_exercise_style.py deleted file mode 100644 index 147be4d65..000000000 --- a/openapi_project/openapi_package/models/option_exercise_style.py +++ /dev/null @@ -1,11 +0,0 @@ -from enum import Enum - - -class OptionExerciseStyle(str, Enum): - OPTION_EXERCISE_STYLE_AMERICAN = "OPTION_EXERCISE_STYLE_AMERICAN" - OPTION_EXERCISE_STYLE_BERMUDAN = "OPTION_EXERCISE_STYLE_BERMUDAN" - OPTION_EXERCISE_STYLE_EUROPEAN = "OPTION_EXERCISE_STYLE_EUROPEAN" - OPTION_EXERCISE_STYLE_UNDEFINED = "OPTION_EXERCISE_STYLE_UNDEFINED" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/option_expiration_style.py b/openapi_project/openapi_package/models/option_expiration_style.py deleted file mode 100644 index bf0ad8c56..000000000 --- a/openapi_project/openapi_package/models/option_expiration_style.py +++ /dev/null @@ -1,19 +0,0 @@ -from enum import Enum - - -class OptionExpirationStyle(str, Enum): - OPTION_EXPIRATION_STYLE_DAILY = "OPTION_EXPIRATION_STYLE_DAILY" - OPTION_EXPIRATION_STYLE_E_O_M = "OPTION_EXPIRATION_STYLE_E_O_M" - OPTION_EXPIRATION_STYLE_LEAP = "OPTION_EXPIRATION_STYLE_LEAP" - OPTION_EXPIRATION_STYLE_MONTHLY = "OPTION_EXPIRATION_STYLE_MONTHLY" - OPTION_EXPIRATION_STYLE_QUARTERLY = "OPTION_EXPIRATION_STYLE_QUARTERLY" - OPTION_EXPIRATION_STYLE_UNKNOWN = "OPTION_EXPIRATION_STYLE_UNKNOWN" - OPTION_EXPIRATION_STYLE_WEEKLY = "OPTION_EXPIRATION_STYLE_WEEKLY" - OPTION_EXPIRATION_STYLE_WK1 = "OPTION_EXPIRATION_STYLE_WK1" - OPTION_EXPIRATION_STYLE_WK2 = "OPTION_EXPIRATION_STYLE_WK2" - OPTION_EXPIRATION_STYLE_WK3 = "OPTION_EXPIRATION_STYLE_WK3" - OPTION_EXPIRATION_STYLE_WK4 = "OPTION_EXPIRATION_STYLE_WK4" - OPTION_EXPIRATION_STYLE_WK5 = "OPTION_EXPIRATION_STYLE_WK5" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_eod_format.py b/openapi_project/openapi_package/models/option_history_eod_format.py new file mode 100644 index 000000000..add62dfdc --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_eod_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryEodFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_eod_response_200.py b/openapi_project/openapi_package/models/option_history_eod_response_200.py new file mode 100644 index 000000000..30db74b0d --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_eod_response_200.py @@ -0,0 +1,293 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionHistoryEodResponse200") + + + +@_attrs_define +class OptionHistoryEodResponse200: + """ + Attributes: + symbol (list[str]): + ask_size (list[int]): + last_trade (list[str]): + created (list[str]): + ask_condition (list[int]): + strike (list[float]): + count (list[int]): + right (list[str]): + volume (list[int]): + high (list[float]): + low (list[float]): + bid_size (list[int]): + ask_exchange (list[int]): + bid_exchange (list[int]): + ask (list[float]): + expiration (list[str]): + bid (list[float]): + bid_condition (list[int]): + close (list[float]): + open_ (list[float]): + """ + + symbol: list[str] + ask_size: list[int] + last_trade: list[str] + created: list[str] + ask_condition: list[int] + strike: list[float] + count: list[int] + right: list[str] + volume: list[int] + high: list[float] + low: list[float] + bid_size: list[int] + ask_exchange: list[int] + bid_exchange: list[int] + ask: list[float] + expiration: list[str] + bid: list[float] + bid_condition: list[int] + close: list[float] + open_: list[float] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + ask_size = self.ask_size + + + + last_trade = self.last_trade + + + + created = self.created + + + + ask_condition = self.ask_condition + + + + strike = self.strike + + + + count = self.count + + + + right = self.right + + + + volume = self.volume + + + + high = self.high + + + + low = self.low + + + + bid_size = self.bid_size + + + + ask_exchange = self.ask_exchange + + + + bid_exchange = self.bid_exchange + + + + ask = self.ask + + + + expiration = self.expiration + + + + bid = self.bid + + + + bid_condition = self.bid_condition + + + + close = self.close + + + + open_ = self.open_ + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "ask_size": ask_size, + "last_trade": last_trade, + "created": created, + "ask_condition": ask_condition, + "strike": strike, + "count": count, + "right": right, + "volume": volume, + "high": high, + "low": low, + "bid_size": bid_size, + "ask_exchange": ask_exchange, + "bid_exchange": bid_exchange, + "ask": ask, + "expiration": expiration, + "bid": bid, + "bid_condition": bid_condition, + "close": close, + "open": open_, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + ask_size = cast(list[int], d.pop("ask_size")) + + + last_trade = cast(list[str], d.pop("last_trade")) + + + created = cast(list[str], d.pop("created")) + + + ask_condition = cast(list[int], d.pop("ask_condition")) + + + strike = cast(list[float], d.pop("strike")) + + + count = cast(list[int], d.pop("count")) + + + right = cast(list[str], d.pop("right")) + + + volume = cast(list[int], d.pop("volume")) + + + high = cast(list[float], d.pop("high")) + + + low = cast(list[float], d.pop("low")) + + + bid_size = cast(list[int], d.pop("bid_size")) + + + ask_exchange = cast(list[int], d.pop("ask_exchange")) + + + bid_exchange = cast(list[int], d.pop("bid_exchange")) + + + ask = cast(list[float], d.pop("ask")) + + + expiration = cast(list[str], d.pop("expiration")) + + + bid = cast(list[float], d.pop("bid")) + + + bid_condition = cast(list[int], d.pop("bid_condition")) + + + close = cast(list[float], d.pop("close")) + + + open_ = cast(list[float], d.pop("open")) + + + option_history_eod_response_200 = cls( + symbol=symbol, + ask_size=ask_size, + last_trade=last_trade, + created=created, + ask_condition=ask_condition, + strike=strike, + count=count, + right=right, + volume=volume, + high=high, + low=low, + bid_size=bid_size, + ask_exchange=ask_exchange, + bid_exchange=bid_exchange, + ask=ask, + expiration=expiration, + bid=bid, + bid_condition=bid_condition, + close=close, + open_=open_, + ) + + + + option_history_eod_response_200.additional_properties = d + return option_history_eod_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_history_eod_right.py b/openapi_project/openapi_package/models/option_history_eod_right.py new file mode 100644 index 000000000..f16a3916a --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_eod_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryEodRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_all_format.py b/openapi_project/openapi_package/models/option_history_greeks_all_format.py new file mode 100644 index 000000000..1a4132579 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_all_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryGreeksAllFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_all_interval.py b/openapi_project/openapi_package/models/option_history_greeks_all_interval.py new file mode 100644 index 000000000..86fcb2505 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_all_interval.py @@ -0,0 +1,21 @@ +from enum import Enum + +class OptionHistoryGreeksAllInterval(str, Enum): + TICK = "tick" + VALUE_1 = "10ms" + VALUE_10 = "5m" + VALUE_11 = "10m" + VALUE_12 = "15m" + VALUE_13 = "30m" + VALUE_14 = "1h" + VALUE_2 = "100ms" + VALUE_3 = "500ms" + VALUE_4 = "1s" + VALUE_5 = "5s" + VALUE_6 = "10s" + VALUE_7 = "15s" + VALUE_8 = "30s" + VALUE_9 = "1m" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_all_rate_type.py b/openapi_project/openapi_package/models/option_history_greeks_all_rate_type.py new file mode 100644 index 000000000..24d58ccba --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_all_rate_type.py @@ -0,0 +1,18 @@ +from enum import Enum + +class OptionHistoryGreeksAllRateType(str, Enum): + SOFR = "sofr" + TREASURY_M1 = "treasury_m1" + TREASURY_M3 = "treasury_m3" + TREASURY_M6 = "treasury_m6" + TREASURY_Y1 = "treasury_y1" + TREASURY_Y10 = "treasury_y10" + TREASURY_Y2 = "treasury_y2" + TREASURY_Y20 = "treasury_y20" + TREASURY_Y3 = "treasury_y3" + TREASURY_Y30 = "treasury_y30" + TREASURY_Y5 = "treasury_y5" + TREASURY_Y7 = "treasury_y7" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_all_response_200.py b/openapi_project/openapi_package/models/option_history_greeks_all_response_200.py new file mode 100644 index 000000000..050c12433 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_all_response_200.py @@ -0,0 +1,414 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionHistoryGreeksAllResponse200") + + + +@_attrs_define +class OptionHistoryGreeksAllResponse200: + """ + Attributes: + symbol (list[str]): + dual_delta (list[float]): + color (list[float]): + zomma (list[float]): + delta (list[float]): + implied_vol (list[float]): + theta (list[float]): + d1 (list[float]): + speed (list[float]): + d2 (list[float]): + epsilon (list[float]): + lambda_ (list[float]): + vomma (list[float]): + underlying_timestamp (list[str]): + timestamp (list[str]): + underlying_price (list[float]): + strike (list[float]): + vera (list[float]): + right (list[str]): + veta (list[float]): + iv_error (list[float]): + ultima (list[float]): + charm (list[float]): + ask (list[float]): + rho (list[float]): + expiration (list[str]): + vanna (list[float]): + dual_gamma (list[float]): + bid (list[float]): + vega (list[float]): + gamma (list[float]): + """ + + symbol: list[str] + dual_delta: list[float] + color: list[float] + zomma: list[float] + delta: list[float] + implied_vol: list[float] + theta: list[float] + d1: list[float] + speed: list[float] + d2: list[float] + epsilon: list[float] + lambda_: list[float] + vomma: list[float] + underlying_timestamp: list[str] + timestamp: list[str] + underlying_price: list[float] + strike: list[float] + vera: list[float] + right: list[str] + veta: list[float] + iv_error: list[float] + ultima: list[float] + charm: list[float] + ask: list[float] + rho: list[float] + expiration: list[str] + vanna: list[float] + dual_gamma: list[float] + bid: list[float] + vega: list[float] + gamma: list[float] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + dual_delta = self.dual_delta + + + + color = self.color + + + + zomma = self.zomma + + + + delta = self.delta + + + + implied_vol = self.implied_vol + + + + theta = self.theta + + + + d1 = self.d1 + + + + speed = self.speed + + + + d2 = self.d2 + + + + epsilon = self.epsilon + + + + lambda_ = self.lambda_ + + + + vomma = self.vomma + + + + underlying_timestamp = self.underlying_timestamp + + + + timestamp = self.timestamp + + + + underlying_price = self.underlying_price + + + + strike = self.strike + + + + vera = self.vera + + + + right = self.right + + + + veta = self.veta + + + + iv_error = self.iv_error + + + + ultima = self.ultima + + + + charm = self.charm + + + + ask = self.ask + + + + rho = self.rho + + + + expiration = self.expiration + + + + vanna = self.vanna + + + + dual_gamma = self.dual_gamma + + + + bid = self.bid + + + + vega = self.vega + + + + gamma = self.gamma + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "dual_delta": dual_delta, + "color": color, + "zomma": zomma, + "delta": delta, + "implied_vol": implied_vol, + "theta": theta, + "d1": d1, + "speed": speed, + "d2": d2, + "epsilon": epsilon, + "lambda": lambda_, + "vomma": vomma, + "underlying_timestamp": underlying_timestamp, + "timestamp": timestamp, + "underlying_price": underlying_price, + "strike": strike, + "vera": vera, + "right": right, + "veta": veta, + "iv_error": iv_error, + "ultima": ultima, + "charm": charm, + "ask": ask, + "rho": rho, + "expiration": expiration, + "vanna": vanna, + "dual_gamma": dual_gamma, + "bid": bid, + "vega": vega, + "gamma": gamma, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + dual_delta = cast(list[float], d.pop("dual_delta")) + + + color = cast(list[float], d.pop("color")) + + + zomma = cast(list[float], d.pop("zomma")) + + + delta = cast(list[float], d.pop("delta")) + + + implied_vol = cast(list[float], d.pop("implied_vol")) + + + theta = cast(list[float], d.pop("theta")) + + + d1 = cast(list[float], d.pop("d1")) + + + speed = cast(list[float], d.pop("speed")) + + + d2 = cast(list[float], d.pop("d2")) + + + epsilon = cast(list[float], d.pop("epsilon")) + + + lambda_ = cast(list[float], d.pop("lambda")) + + + vomma = cast(list[float], d.pop("vomma")) + + + underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + underlying_price = cast(list[float], d.pop("underlying_price")) + + + strike = cast(list[float], d.pop("strike")) + + + vera = cast(list[float], d.pop("vera")) + + + right = cast(list[str], d.pop("right")) + + + veta = cast(list[float], d.pop("veta")) + + + iv_error = cast(list[float], d.pop("iv_error")) + + + ultima = cast(list[float], d.pop("ultima")) + + + charm = cast(list[float], d.pop("charm")) + + + ask = cast(list[float], d.pop("ask")) + + + rho = cast(list[float], d.pop("rho")) + + + expiration = cast(list[str], d.pop("expiration")) + + + vanna = cast(list[float], d.pop("vanna")) + + + dual_gamma = cast(list[float], d.pop("dual_gamma")) + + + bid = cast(list[float], d.pop("bid")) + + + vega = cast(list[float], d.pop("vega")) + + + gamma = cast(list[float], d.pop("gamma")) + + + option_history_greeks_all_response_200 = cls( + symbol=symbol, + dual_delta=dual_delta, + color=color, + zomma=zomma, + delta=delta, + implied_vol=implied_vol, + theta=theta, + d1=d1, + speed=speed, + d2=d2, + epsilon=epsilon, + lambda_=lambda_, + vomma=vomma, + underlying_timestamp=underlying_timestamp, + timestamp=timestamp, + underlying_price=underlying_price, + strike=strike, + vera=vera, + right=right, + veta=veta, + iv_error=iv_error, + ultima=ultima, + charm=charm, + ask=ask, + rho=rho, + expiration=expiration, + vanna=vanna, + dual_gamma=dual_gamma, + bid=bid, + vega=vega, + gamma=gamma, + ) + + + + option_history_greeks_all_response_200.additional_properties = d + return option_history_greeks_all_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_history_greeks_all_right.py b/openapi_project/openapi_package/models/option_history_greeks_all_right.py new file mode 100644 index 000000000..0bc111ae7 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_all_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryGreeksAllRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_eod_format.py b/openapi_project/openapi_package/models/option_history_greeks_eod_format.py new file mode 100644 index 000000000..f0964a4f8 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_eod_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryGreeksEodFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_eod_rate_type.py b/openapi_project/openapi_package/models/option_history_greeks_eod_rate_type.py new file mode 100644 index 000000000..546a6ce84 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_eod_rate_type.py @@ -0,0 +1,18 @@ +from enum import Enum + +class OptionHistoryGreeksEodRateType(str, Enum): + SOFR = "sofr" + TREASURY_M1 = "treasury_m1" + TREASURY_M3 = "treasury_m3" + TREASURY_M6 = "treasury_m6" + TREASURY_Y1 = "treasury_y1" + TREASURY_Y10 = "treasury_y10" + TREASURY_Y2 = "treasury_y2" + TREASURY_Y20 = "treasury_y20" + TREASURY_Y3 = "treasury_y3" + TREASURY_Y30 = "treasury_y30" + TREASURY_Y5 = "treasury_y5" + TREASURY_Y7 = "treasury_y7" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_eod_response_200.py b/openapi_project/openapi_package/models/option_history_greeks_eod_response_200.py new file mode 100644 index 000000000..f6665a85f --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_eod_response_200.py @@ -0,0 +1,546 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionHistoryGreeksEodResponse200") + + + +@_attrs_define +class OptionHistoryGreeksEodResponse200: + """ + Attributes: + symbol (list[str]): + ask_size (list[int]): + dual_delta (list[float]): + color (list[float]): + zomma (list[float]): + delta (list[float]): + implied_vol (list[float]): + theta (list[float]): + d1 (list[float]): + speed (list[float]): + d2 (list[float]): + epsilon (list[float]): + high (list[float]): + lambda_ (list[float]): + low (list[float]): + ask_exchange (list[int]): + bid_exchange (list[int]): + vomma (list[float]): + bid_condition (list[int]): + underlying_timestamp (list[str]): + close (list[float]): + timestamp (list[str]): + underlying_price (list[float]): + ask_condition (list[int]): + strike (list[float]): + count (list[int]): + vera (list[float]): + right (list[str]): + veta (list[float]): + iv_error (list[float]): + ultima (list[float]): + volume (list[int]): + charm (list[float]): + bid_size (list[int]): + ask (list[float]): + rho (list[float]): + expiration (list[str]): + vanna (list[float]): + dual_gamma (list[float]): + bid (list[float]): + open_ (list[float]): + vega (list[float]): + gamma (list[float]): + """ + + symbol: list[str] + ask_size: list[int] + dual_delta: list[float] + color: list[float] + zomma: list[float] + delta: list[float] + implied_vol: list[float] + theta: list[float] + d1: list[float] + speed: list[float] + d2: list[float] + epsilon: list[float] + high: list[float] + lambda_: list[float] + low: list[float] + ask_exchange: list[int] + bid_exchange: list[int] + vomma: list[float] + bid_condition: list[int] + underlying_timestamp: list[str] + close: list[float] + timestamp: list[str] + underlying_price: list[float] + ask_condition: list[int] + strike: list[float] + count: list[int] + vera: list[float] + right: list[str] + veta: list[float] + iv_error: list[float] + ultima: list[float] + volume: list[int] + charm: list[float] + bid_size: list[int] + ask: list[float] + rho: list[float] + expiration: list[str] + vanna: list[float] + dual_gamma: list[float] + bid: list[float] + open_: list[float] + vega: list[float] + gamma: list[float] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + ask_size = self.ask_size + + + + dual_delta = self.dual_delta + + + + color = self.color + + + + zomma = self.zomma + + + + delta = self.delta + + + + implied_vol = self.implied_vol + + + + theta = self.theta + + + + d1 = self.d1 + + + + speed = self.speed + + + + d2 = self.d2 + + + + epsilon = self.epsilon + + + + high = self.high + + + + lambda_ = self.lambda_ + + + + low = self.low + + + + ask_exchange = self.ask_exchange + + + + bid_exchange = self.bid_exchange + + + + vomma = self.vomma + + + + bid_condition = self.bid_condition + + + + underlying_timestamp = self.underlying_timestamp + + + + close = self.close + + + + timestamp = self.timestamp + + + + underlying_price = self.underlying_price + + + + ask_condition = self.ask_condition + + + + strike = self.strike + + + + count = self.count + + + + vera = self.vera + + + + right = self.right + + + + veta = self.veta + + + + iv_error = self.iv_error + + + + ultima = self.ultima + + + + volume = self.volume + + + + charm = self.charm + + + + bid_size = self.bid_size + + + + ask = self.ask + + + + rho = self.rho + + + + expiration = self.expiration + + + + vanna = self.vanna + + + + dual_gamma = self.dual_gamma + + + + bid = self.bid + + + + open_ = self.open_ + + + + vega = self.vega + + + + gamma = self.gamma + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "ask_size": ask_size, + "dual_delta": dual_delta, + "color": color, + "zomma": zomma, + "delta": delta, + "implied_vol": implied_vol, + "theta": theta, + "d1": d1, + "speed": speed, + "d2": d2, + "epsilon": epsilon, + "high": high, + "lambda": lambda_, + "low": low, + "ask_exchange": ask_exchange, + "bid_exchange": bid_exchange, + "vomma": vomma, + "bid_condition": bid_condition, + "underlying_timestamp": underlying_timestamp, + "close": close, + "timestamp": timestamp, + "underlying_price": underlying_price, + "ask_condition": ask_condition, + "strike": strike, + "count": count, + "vera": vera, + "right": right, + "veta": veta, + "iv_error": iv_error, + "ultima": ultima, + "volume": volume, + "charm": charm, + "bid_size": bid_size, + "ask": ask, + "rho": rho, + "expiration": expiration, + "vanna": vanna, + "dual_gamma": dual_gamma, + "bid": bid, + "open": open_, + "vega": vega, + "gamma": gamma, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + ask_size = cast(list[int], d.pop("ask_size")) + + + dual_delta = cast(list[float], d.pop("dual_delta")) + + + color = cast(list[float], d.pop("color")) + + + zomma = cast(list[float], d.pop("zomma")) + + + delta = cast(list[float], d.pop("delta")) + + + implied_vol = cast(list[float], d.pop("implied_vol")) + + + theta = cast(list[float], d.pop("theta")) + + + d1 = cast(list[float], d.pop("d1")) + + + speed = cast(list[float], d.pop("speed")) + + + d2 = cast(list[float], d.pop("d2")) + + + epsilon = cast(list[float], d.pop("epsilon")) + + + high = cast(list[float], d.pop("high")) + + + lambda_ = cast(list[float], d.pop("lambda")) + + + low = cast(list[float], d.pop("low")) + + + ask_exchange = cast(list[int], d.pop("ask_exchange")) + + + bid_exchange = cast(list[int], d.pop("bid_exchange")) + + + vomma = cast(list[float], d.pop("vomma")) + + + bid_condition = cast(list[int], d.pop("bid_condition")) + + + underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) + + + close = cast(list[float], d.pop("close")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + underlying_price = cast(list[float], d.pop("underlying_price")) + + + ask_condition = cast(list[int], d.pop("ask_condition")) + + + strike = cast(list[float], d.pop("strike")) + + + count = cast(list[int], d.pop("count")) + + + vera = cast(list[float], d.pop("vera")) + + + right = cast(list[str], d.pop("right")) + + + veta = cast(list[float], d.pop("veta")) + + + iv_error = cast(list[float], d.pop("iv_error")) + + + ultima = cast(list[float], d.pop("ultima")) + + + volume = cast(list[int], d.pop("volume")) + + + charm = cast(list[float], d.pop("charm")) + + + bid_size = cast(list[int], d.pop("bid_size")) + + + ask = cast(list[float], d.pop("ask")) + + + rho = cast(list[float], d.pop("rho")) + + + expiration = cast(list[str], d.pop("expiration")) + + + vanna = cast(list[float], d.pop("vanna")) + + + dual_gamma = cast(list[float], d.pop("dual_gamma")) + + + bid = cast(list[float], d.pop("bid")) + + + open_ = cast(list[float], d.pop("open")) + + + vega = cast(list[float], d.pop("vega")) + + + gamma = cast(list[float], d.pop("gamma")) + + + option_history_greeks_eod_response_200 = cls( + symbol=symbol, + ask_size=ask_size, + dual_delta=dual_delta, + color=color, + zomma=zomma, + delta=delta, + implied_vol=implied_vol, + theta=theta, + d1=d1, + speed=speed, + d2=d2, + epsilon=epsilon, + high=high, + lambda_=lambda_, + low=low, + ask_exchange=ask_exchange, + bid_exchange=bid_exchange, + vomma=vomma, + bid_condition=bid_condition, + underlying_timestamp=underlying_timestamp, + close=close, + timestamp=timestamp, + underlying_price=underlying_price, + ask_condition=ask_condition, + strike=strike, + count=count, + vera=vera, + right=right, + veta=veta, + iv_error=iv_error, + ultima=ultima, + volume=volume, + charm=charm, + bid_size=bid_size, + ask=ask, + rho=rho, + expiration=expiration, + vanna=vanna, + dual_gamma=dual_gamma, + bid=bid, + open_=open_, + vega=vega, + gamma=gamma, + ) + + + + option_history_greeks_eod_response_200.additional_properties = d + return option_history_greeks_eod_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_history_greeks_eod_right.py b/openapi_project/openapi_package/models/option_history_greeks_eod_right.py new file mode 100644 index 000000000..49602daeb --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_eod_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryGreeksEodRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_first_order_format.py b/openapi_project/openapi_package/models/option_history_greeks_first_order_format.py new file mode 100644 index 000000000..535b01c58 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_first_order_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryGreeksFirstOrderFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_first_order_interval.py b/openapi_project/openapi_package/models/option_history_greeks_first_order_interval.py new file mode 100644 index 000000000..d1056cc19 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_first_order_interval.py @@ -0,0 +1,21 @@ +from enum import Enum + +class OptionHistoryGreeksFirstOrderInterval(str, Enum): + TICK = "tick" + VALUE_1 = "10ms" + VALUE_10 = "5m" + VALUE_11 = "10m" + VALUE_12 = "15m" + VALUE_13 = "30m" + VALUE_14 = "1h" + VALUE_2 = "100ms" + VALUE_3 = "500ms" + VALUE_4 = "1s" + VALUE_5 = "5s" + VALUE_6 = "10s" + VALUE_7 = "15s" + VALUE_8 = "30s" + VALUE_9 = "1m" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_first_order_rate_type.py b/openapi_project/openapi_package/models/option_history_greeks_first_order_rate_type.py new file mode 100644 index 000000000..9c36e72e9 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_first_order_rate_type.py @@ -0,0 +1,18 @@ +from enum import Enum + +class OptionHistoryGreeksFirstOrderRateType(str, Enum): + SOFR = "sofr" + TREASURY_M1 = "treasury_m1" + TREASURY_M3 = "treasury_m3" + TREASURY_M6 = "treasury_m6" + TREASURY_Y1 = "treasury_y1" + TREASURY_Y10 = "treasury_y10" + TREASURY_Y2 = "treasury_y2" + TREASURY_Y20 = "treasury_y20" + TREASURY_Y3 = "treasury_y3" + TREASURY_Y30 = "treasury_y30" + TREASURY_Y5 = "treasury_y5" + TREASURY_Y7 = "treasury_y7" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_first_order_response_200.py b/openapi_project/openapi_package/models/option_history_greeks_first_order_response_200.py new file mode 100644 index 000000000..1b30f6ca5 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_first_order_response_200.py @@ -0,0 +1,260 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionHistoryGreeksFirstOrderResponse200") + + + +@_attrs_define +class OptionHistoryGreeksFirstOrderResponse200: + """ + Attributes: + symbol (list[str]): + underlying_price (list[float]): + strike (list[float]): + delta (list[float]): + right (list[str]): + implied_vol (list[float]): + theta (list[float]): + iv_error (list[float]): + epsilon (list[float]): + lambda_ (list[float]): + ask (list[float]): + rho (list[float]): + expiration (list[str]): + bid (list[float]): + underlying_timestamp (list[str]): + vega (list[float]): + timestamp (list[str]): + """ + + symbol: list[str] + underlying_price: list[float] + strike: list[float] + delta: list[float] + right: list[str] + implied_vol: list[float] + theta: list[float] + iv_error: list[float] + epsilon: list[float] + lambda_: list[float] + ask: list[float] + rho: list[float] + expiration: list[str] + bid: list[float] + underlying_timestamp: list[str] + vega: list[float] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + underlying_price = self.underlying_price + + + + strike = self.strike + + + + delta = self.delta + + + + right = self.right + + + + implied_vol = self.implied_vol + + + + theta = self.theta + + + + iv_error = self.iv_error + + + + epsilon = self.epsilon + + + + lambda_ = self.lambda_ + + + + ask = self.ask + + + + rho = self.rho + + + + expiration = self.expiration + + + + bid = self.bid + + + + underlying_timestamp = self.underlying_timestamp + + + + vega = self.vega + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "underlying_price": underlying_price, + "strike": strike, + "delta": delta, + "right": right, + "implied_vol": implied_vol, + "theta": theta, + "iv_error": iv_error, + "epsilon": epsilon, + "lambda": lambda_, + "ask": ask, + "rho": rho, + "expiration": expiration, + "bid": bid, + "underlying_timestamp": underlying_timestamp, + "vega": vega, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + underlying_price = cast(list[float], d.pop("underlying_price")) + + + strike = cast(list[float], d.pop("strike")) + + + delta = cast(list[float], d.pop("delta")) + + + right = cast(list[str], d.pop("right")) + + + implied_vol = cast(list[float], d.pop("implied_vol")) + + + theta = cast(list[float], d.pop("theta")) + + + iv_error = cast(list[float], d.pop("iv_error")) + + + epsilon = cast(list[float], d.pop("epsilon")) + + + lambda_ = cast(list[float], d.pop("lambda")) + + + ask = cast(list[float], d.pop("ask")) + + + rho = cast(list[float], d.pop("rho")) + + + expiration = cast(list[str], d.pop("expiration")) + + + bid = cast(list[float], d.pop("bid")) + + + underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) + + + vega = cast(list[float], d.pop("vega")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + option_history_greeks_first_order_response_200 = cls( + symbol=symbol, + underlying_price=underlying_price, + strike=strike, + delta=delta, + right=right, + implied_vol=implied_vol, + theta=theta, + iv_error=iv_error, + epsilon=epsilon, + lambda_=lambda_, + ask=ask, + rho=rho, + expiration=expiration, + bid=bid, + underlying_timestamp=underlying_timestamp, + vega=vega, + timestamp=timestamp, + ) + + + + option_history_greeks_first_order_response_200.additional_properties = d + return option_history_greeks_first_order_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_history_greeks_first_order_right.py b/openapi_project/openapi_package/models/option_history_greeks_first_order_right.py new file mode 100644 index 000000000..c5a605366 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_first_order_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryGreeksFirstOrderRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_implied_volatility_format.py b/openapi_project/openapi_package/models/option_history_greeks_implied_volatility_format.py new file mode 100644 index 000000000..c070ff426 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_implied_volatility_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryGreeksImpliedVolatilityFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_implied_volatility_interval.py b/openapi_project/openapi_package/models/option_history_greeks_implied_volatility_interval.py new file mode 100644 index 000000000..dddb254d4 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_implied_volatility_interval.py @@ -0,0 +1,21 @@ +from enum import Enum + +class OptionHistoryGreeksImpliedVolatilityInterval(str, Enum): + TICK = "tick" + VALUE_1 = "10ms" + VALUE_10 = "5m" + VALUE_11 = "10m" + VALUE_12 = "15m" + VALUE_13 = "30m" + VALUE_14 = "1h" + VALUE_2 = "100ms" + VALUE_3 = "500ms" + VALUE_4 = "1s" + VALUE_5 = "5s" + VALUE_6 = "10s" + VALUE_7 = "15s" + VALUE_8 = "30s" + VALUE_9 = "1m" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_implied_volatility_rate_type.py b/openapi_project/openapi_package/models/option_history_greeks_implied_volatility_rate_type.py new file mode 100644 index 000000000..3eb437040 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_implied_volatility_rate_type.py @@ -0,0 +1,18 @@ +from enum import Enum + +class OptionHistoryGreeksImpliedVolatilityRateType(str, Enum): + SOFR = "sofr" + TREASURY_M1 = "treasury_m1" + TREASURY_M3 = "treasury_m3" + TREASURY_M6 = "treasury_m6" + TREASURY_Y1 = "treasury_y1" + TREASURY_Y10 = "treasury_y10" + TREASURY_Y2 = "treasury_y2" + TREASURY_Y20 = "treasury_y20" + TREASURY_Y3 = "treasury_y3" + TREASURY_Y30 = "treasury_y30" + TREASURY_Y5 = "treasury_y5" + TREASURY_Y7 = "treasury_y7" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_implied_volatility_response_200.py b/openapi_project/openapi_package/models/option_history_greeks_implied_volatility_response_200.py new file mode 100644 index 000000000..87845ba8b --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_implied_volatility_response_200.py @@ -0,0 +1,227 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionHistoryGreeksImpliedVolatilityResponse200") + + + +@_attrs_define +class OptionHistoryGreeksImpliedVolatilityResponse200: + """ + Attributes: + symbol (list[str]): + underlying_price (list[float]): + strike (list[float]): + right (list[str]): + implied_vol (list[float]): + iv_error (list[float]): + bid_implied_vol (list[float]): + ask (list[float]): + midpoint (list[float]): + expiration (list[str]): + ask_implied_vol (list[float]): + bid (list[float]): + underlying_timestamp (list[str]): + timestamp (list[str]): + """ + + symbol: list[str] + underlying_price: list[float] + strike: list[float] + right: list[str] + implied_vol: list[float] + iv_error: list[float] + bid_implied_vol: list[float] + ask: list[float] + midpoint: list[float] + expiration: list[str] + ask_implied_vol: list[float] + bid: list[float] + underlying_timestamp: list[str] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + underlying_price = self.underlying_price + + + + strike = self.strike + + + + right = self.right + + + + implied_vol = self.implied_vol + + + + iv_error = self.iv_error + + + + bid_implied_vol = self.bid_implied_vol + + + + ask = self.ask + + + + midpoint = self.midpoint + + + + expiration = self.expiration + + + + ask_implied_vol = self.ask_implied_vol + + + + bid = self.bid + + + + underlying_timestamp = self.underlying_timestamp + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "underlying_price": underlying_price, + "strike": strike, + "right": right, + "implied_vol": implied_vol, + "iv_error": iv_error, + "bid_implied_vol": bid_implied_vol, + "ask": ask, + "midpoint": midpoint, + "expiration": expiration, + "ask_implied_vol": ask_implied_vol, + "bid": bid, + "underlying_timestamp": underlying_timestamp, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + underlying_price = cast(list[float], d.pop("underlying_price")) + + + strike = cast(list[float], d.pop("strike")) + + + right = cast(list[str], d.pop("right")) + + + implied_vol = cast(list[float], d.pop("implied_vol")) + + + iv_error = cast(list[float], d.pop("iv_error")) + + + bid_implied_vol = cast(list[float], d.pop("bid_implied_vol")) + + + ask = cast(list[float], d.pop("ask")) + + + midpoint = cast(list[float], d.pop("midpoint")) + + + expiration = cast(list[str], d.pop("expiration")) + + + ask_implied_vol = cast(list[float], d.pop("ask_implied_vol")) + + + bid = cast(list[float], d.pop("bid")) + + + underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + option_history_greeks_implied_volatility_response_200 = cls( + symbol=symbol, + underlying_price=underlying_price, + strike=strike, + right=right, + implied_vol=implied_vol, + iv_error=iv_error, + bid_implied_vol=bid_implied_vol, + ask=ask, + midpoint=midpoint, + expiration=expiration, + ask_implied_vol=ask_implied_vol, + bid=bid, + underlying_timestamp=underlying_timestamp, + timestamp=timestamp, + ) + + + + option_history_greeks_implied_volatility_response_200.additional_properties = d + return option_history_greeks_implied_volatility_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_history_greeks_implied_volatility_right.py b/openapi_project/openapi_package/models/option_history_greeks_implied_volatility_right.py new file mode 100644 index 000000000..f9faa3c31 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_implied_volatility_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryGreeksImpliedVolatilityRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_second_order_format.py b/openapi_project/openapi_package/models/option_history_greeks_second_order_format.py new file mode 100644 index 000000000..6dad6198b --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_second_order_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryGreeksSecondOrderFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_second_order_interval.py b/openapi_project/openapi_package/models/option_history_greeks_second_order_interval.py new file mode 100644 index 000000000..40b139817 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_second_order_interval.py @@ -0,0 +1,21 @@ +from enum import Enum + +class OptionHistoryGreeksSecondOrderInterval(str, Enum): + TICK = "tick" + VALUE_1 = "10ms" + VALUE_10 = "5m" + VALUE_11 = "10m" + VALUE_12 = "15m" + VALUE_13 = "30m" + VALUE_14 = "1h" + VALUE_2 = "100ms" + VALUE_3 = "500ms" + VALUE_4 = "1s" + VALUE_5 = "5s" + VALUE_6 = "10s" + VALUE_7 = "15s" + VALUE_8 = "30s" + VALUE_9 = "1m" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_second_order_rate_type.py b/openapi_project/openapi_package/models/option_history_greeks_second_order_rate_type.py new file mode 100644 index 000000000..4ab12dbf2 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_second_order_rate_type.py @@ -0,0 +1,18 @@ +from enum import Enum + +class OptionHistoryGreeksSecondOrderRateType(str, Enum): + SOFR = "sofr" + TREASURY_M1 = "treasury_m1" + TREASURY_M3 = "treasury_m3" + TREASURY_M6 = "treasury_m6" + TREASURY_Y1 = "treasury_y1" + TREASURY_Y10 = "treasury_y10" + TREASURY_Y2 = "treasury_y2" + TREASURY_Y20 = "treasury_y20" + TREASURY_Y3 = "treasury_y3" + TREASURY_Y30 = "treasury_y30" + TREASURY_Y5 = "treasury_y5" + TREASURY_Y7 = "treasury_y7" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_second_order_response_200.py b/openapi_project/openapi_package/models/option_history_greeks_second_order_response_200.py new file mode 100644 index 000000000..0f4c0ace3 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_second_order_response_200.py @@ -0,0 +1,249 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionHistoryGreeksSecondOrderResponse200") + + + +@_attrs_define +class OptionHistoryGreeksSecondOrderResponse200: + """ + Attributes: + symbol (list[str]): + underlying_price (list[float]): + strike (list[float]): + right (list[str]): + veta (list[float]): + implied_vol (list[float]): + iv_error (list[float]): + charm (list[float]): + ask (list[float]): + expiration (list[str]): + vanna (list[float]): + vomma (list[float]): + bid (list[float]): + underlying_timestamp (list[str]): + gamma (list[float]): + timestamp (list[str]): + """ + + symbol: list[str] + underlying_price: list[float] + strike: list[float] + right: list[str] + veta: list[float] + implied_vol: list[float] + iv_error: list[float] + charm: list[float] + ask: list[float] + expiration: list[str] + vanna: list[float] + vomma: list[float] + bid: list[float] + underlying_timestamp: list[str] + gamma: list[float] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + underlying_price = self.underlying_price + + + + strike = self.strike + + + + right = self.right + + + + veta = self.veta + + + + implied_vol = self.implied_vol + + + + iv_error = self.iv_error + + + + charm = self.charm + + + + ask = self.ask + + + + expiration = self.expiration + + + + vanna = self.vanna + + + + vomma = self.vomma + + + + bid = self.bid + + + + underlying_timestamp = self.underlying_timestamp + + + + gamma = self.gamma + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "underlying_price": underlying_price, + "strike": strike, + "right": right, + "veta": veta, + "implied_vol": implied_vol, + "iv_error": iv_error, + "charm": charm, + "ask": ask, + "expiration": expiration, + "vanna": vanna, + "vomma": vomma, + "bid": bid, + "underlying_timestamp": underlying_timestamp, + "gamma": gamma, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + underlying_price = cast(list[float], d.pop("underlying_price")) + + + strike = cast(list[float], d.pop("strike")) + + + right = cast(list[str], d.pop("right")) + + + veta = cast(list[float], d.pop("veta")) + + + implied_vol = cast(list[float], d.pop("implied_vol")) + + + iv_error = cast(list[float], d.pop("iv_error")) + + + charm = cast(list[float], d.pop("charm")) + + + ask = cast(list[float], d.pop("ask")) + + + expiration = cast(list[str], d.pop("expiration")) + + + vanna = cast(list[float], d.pop("vanna")) + + + vomma = cast(list[float], d.pop("vomma")) + + + bid = cast(list[float], d.pop("bid")) + + + underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) + + + gamma = cast(list[float], d.pop("gamma")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + option_history_greeks_second_order_response_200 = cls( + symbol=symbol, + underlying_price=underlying_price, + strike=strike, + right=right, + veta=veta, + implied_vol=implied_vol, + iv_error=iv_error, + charm=charm, + ask=ask, + expiration=expiration, + vanna=vanna, + vomma=vomma, + bid=bid, + underlying_timestamp=underlying_timestamp, + gamma=gamma, + timestamp=timestamp, + ) + + + + option_history_greeks_second_order_response_200.additional_properties = d + return option_history_greeks_second_order_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_history_greeks_second_order_right.py b/openapi_project/openapi_package/models/option_history_greeks_second_order_right.py new file mode 100644 index 000000000..b450742ac --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_second_order_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryGreeksSecondOrderRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_third_order_format.py b/openapi_project/openapi_package/models/option_history_greeks_third_order_format.py new file mode 100644 index 000000000..a1beade39 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_third_order_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryGreeksThirdOrderFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_third_order_interval.py b/openapi_project/openapi_package/models/option_history_greeks_third_order_interval.py new file mode 100644 index 000000000..abb2ff006 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_third_order_interval.py @@ -0,0 +1,21 @@ +from enum import Enum + +class OptionHistoryGreeksThirdOrderInterval(str, Enum): + TICK = "tick" + VALUE_1 = "10ms" + VALUE_10 = "5m" + VALUE_11 = "10m" + VALUE_12 = "15m" + VALUE_13 = "30m" + VALUE_14 = "1h" + VALUE_2 = "100ms" + VALUE_3 = "500ms" + VALUE_4 = "1s" + VALUE_5 = "5s" + VALUE_6 = "10s" + VALUE_7 = "15s" + VALUE_8 = "30s" + VALUE_9 = "1m" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_third_order_rate_type.py b/openapi_project/openapi_package/models/option_history_greeks_third_order_rate_type.py new file mode 100644 index 000000000..17707720e --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_third_order_rate_type.py @@ -0,0 +1,18 @@ +from enum import Enum + +class OptionHistoryGreeksThirdOrderRateType(str, Enum): + SOFR = "sofr" + TREASURY_M1 = "treasury_m1" + TREASURY_M3 = "treasury_m3" + TREASURY_M6 = "treasury_m6" + TREASURY_Y1 = "treasury_y1" + TREASURY_Y10 = "treasury_y10" + TREASURY_Y2 = "treasury_y2" + TREASURY_Y20 = "treasury_y20" + TREASURY_Y3 = "treasury_y3" + TREASURY_Y30 = "treasury_y30" + TREASURY_Y5 = "treasury_y5" + TREASURY_Y7 = "treasury_y7" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_third_order_response_200.py b/openapi_project/openapi_package/models/option_history_greeks_third_order_response_200.py new file mode 100644 index 000000000..1f14a1ce2 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_third_order_response_200.py @@ -0,0 +1,238 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionHistoryGreeksThirdOrderResponse200") + + + +@_attrs_define +class OptionHistoryGreeksThirdOrderResponse200: + """ + Attributes: + symbol (list[str]): + underlying_price (list[float]): + color (list[float]): + strike (list[float]): + zomma (list[float]): + right (list[str]): + implied_vol (list[float]): + iv_error (list[float]): + speed (list[float]): + ultima (list[float]): + ask (list[float]): + expiration (list[str]): + bid (list[float]): + underlying_timestamp (list[str]): + timestamp (list[str]): + """ + + symbol: list[str] + underlying_price: list[float] + color: list[float] + strike: list[float] + zomma: list[float] + right: list[str] + implied_vol: list[float] + iv_error: list[float] + speed: list[float] + ultima: list[float] + ask: list[float] + expiration: list[str] + bid: list[float] + underlying_timestamp: list[str] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + underlying_price = self.underlying_price + + + + color = self.color + + + + strike = self.strike + + + + zomma = self.zomma + + + + right = self.right + + + + implied_vol = self.implied_vol + + + + iv_error = self.iv_error + + + + speed = self.speed + + + + ultima = self.ultima + + + + ask = self.ask + + + + expiration = self.expiration + + + + bid = self.bid + + + + underlying_timestamp = self.underlying_timestamp + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "underlying_price": underlying_price, + "color": color, + "strike": strike, + "zomma": zomma, + "right": right, + "implied_vol": implied_vol, + "iv_error": iv_error, + "speed": speed, + "ultima": ultima, + "ask": ask, + "expiration": expiration, + "bid": bid, + "underlying_timestamp": underlying_timestamp, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + underlying_price = cast(list[float], d.pop("underlying_price")) + + + color = cast(list[float], d.pop("color")) + + + strike = cast(list[float], d.pop("strike")) + + + zomma = cast(list[float], d.pop("zomma")) + + + right = cast(list[str], d.pop("right")) + + + implied_vol = cast(list[float], d.pop("implied_vol")) + + + iv_error = cast(list[float], d.pop("iv_error")) + + + speed = cast(list[float], d.pop("speed")) + + + ultima = cast(list[float], d.pop("ultima")) + + + ask = cast(list[float], d.pop("ask")) + + + expiration = cast(list[str], d.pop("expiration")) + + + bid = cast(list[float], d.pop("bid")) + + + underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + option_history_greeks_third_order_response_200 = cls( + symbol=symbol, + underlying_price=underlying_price, + color=color, + strike=strike, + zomma=zomma, + right=right, + implied_vol=implied_vol, + iv_error=iv_error, + speed=speed, + ultima=ultima, + ask=ask, + expiration=expiration, + bid=bid, + underlying_timestamp=underlying_timestamp, + timestamp=timestamp, + ) + + + + option_history_greeks_third_order_response_200.additional_properties = d + return option_history_greeks_third_order_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_history_greeks_third_order_right.py b/openapi_project/openapi_package/models/option_history_greeks_third_order_right.py new file mode 100644 index 000000000..8ef6716e5 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_third_order_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryGreeksThirdOrderRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_ohlc_format.py b/openapi_project/openapi_package/models/option_history_ohlc_format.py new file mode 100644 index 000000000..9ba196379 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_ohlc_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryOhlcFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_ohlc_interval.py b/openapi_project/openapi_package/models/option_history_ohlc_interval.py new file mode 100644 index 000000000..2ebbbef8f --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_ohlc_interval.py @@ -0,0 +1,21 @@ +from enum import Enum + +class OptionHistoryOhlcInterval(str, Enum): + TICK = "tick" + VALUE_1 = "10ms" + VALUE_10 = "5m" + VALUE_11 = "10m" + VALUE_12 = "15m" + VALUE_13 = "30m" + VALUE_14 = "1h" + VALUE_2 = "100ms" + VALUE_3 = "500ms" + VALUE_4 = "1s" + VALUE_5 = "5s" + VALUE_6 = "10s" + VALUE_7 = "15s" + VALUE_8 = "30s" + VALUE_9 = "1m" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_ohlc_response_200.py b/openapi_project/openapi_package/models/option_history_ohlc_response_200.py new file mode 100644 index 000000000..e092d9b9e --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_ohlc_response_200.py @@ -0,0 +1,205 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionHistoryOhlcResponse200") + + + +@_attrs_define +class OptionHistoryOhlcResponse200: + """ + Attributes: + volume (list[int]): + symbol (list[str]): + high (list[float]): + low (list[float]): + strike (list[float]): + vwap (list[float]): + count (list[int]): + expiration (list[str]): + right (list[str]): + close (list[float]): + open_ (list[float]): + timestamp (list[str]): + """ + + volume: list[int] + symbol: list[str] + high: list[float] + low: list[float] + strike: list[float] + vwap: list[float] + count: list[int] + expiration: list[str] + right: list[str] + close: list[float] + open_: list[float] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + volume = self.volume + + + + symbol = self.symbol + + + + high = self.high + + + + low = self.low + + + + strike = self.strike + + + + vwap = self.vwap + + + + count = self.count + + + + expiration = self.expiration + + + + right = self.right + + + + close = self.close + + + + open_ = self.open_ + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "volume": volume, + "symbol": symbol, + "high": high, + "low": low, + "strike": strike, + "vwap": vwap, + "count": count, + "expiration": expiration, + "right": right, + "close": close, + "open": open_, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + volume = cast(list[int], d.pop("volume")) + + + symbol = cast(list[str], d.pop("symbol")) + + + high = cast(list[float], d.pop("high")) + + + low = cast(list[float], d.pop("low")) + + + strike = cast(list[float], d.pop("strike")) + + + vwap = cast(list[float], d.pop("vwap")) + + + count = cast(list[int], d.pop("count")) + + + expiration = cast(list[str], d.pop("expiration")) + + + right = cast(list[str], d.pop("right")) + + + close = cast(list[float], d.pop("close")) + + + open_ = cast(list[float], d.pop("open")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + option_history_ohlc_response_200 = cls( + volume=volume, + symbol=symbol, + high=high, + low=low, + strike=strike, + vwap=vwap, + count=count, + expiration=expiration, + right=right, + close=close, + open_=open_, + timestamp=timestamp, + ) + + + + option_history_ohlc_response_200.additional_properties = d + return option_history_ohlc_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_history_ohlc_right.py b/openapi_project/openapi_package/models/option_history_ohlc_right.py new file mode 100644 index 000000000..1d425eb47 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_ohlc_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryOhlcRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_open_interest_format.py b/openapi_project/openapi_package/models/option_history_open_interest_format.py new file mode 100644 index 000000000..51cc69a26 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_open_interest_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryOpenInterestFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_open_interest_response_200.py b/openapi_project/openapi_package/models/option_history_open_interest_response_200.py new file mode 100644 index 000000000..457231650 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_open_interest_response_200.py @@ -0,0 +1,139 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionHistoryOpenInterestResponse200") + + + +@_attrs_define +class OptionHistoryOpenInterestResponse200: + """ + Attributes: + symbol (list[str]): + strike (list[float]): + open_interest (list[int]): + expiration (list[str]): + right (list[str]): + timestamp (list[str]): + """ + + symbol: list[str] + strike: list[float] + open_interest: list[int] + expiration: list[str] + right: list[str] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + strike = self.strike + + + + open_interest = self.open_interest + + + + expiration = self.expiration + + + + right = self.right + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "strike": strike, + "open_interest": open_interest, + "expiration": expiration, + "right": right, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + strike = cast(list[float], d.pop("strike")) + + + open_interest = cast(list[int], d.pop("open_interest")) + + + expiration = cast(list[str], d.pop("expiration")) + + + right = cast(list[str], d.pop("right")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + option_history_open_interest_response_200 = cls( + symbol=symbol, + strike=strike, + open_interest=open_interest, + expiration=expiration, + right=right, + timestamp=timestamp, + ) + + + + option_history_open_interest_response_200.additional_properties = d + return option_history_open_interest_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_history_open_interest_right.py b/openapi_project/openapi_package/models/option_history_open_interest_right.py new file mode 100644 index 000000000..dbdb9a035 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_open_interest_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryOpenInterestRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_quote_format.py b/openapi_project/openapi_package/models/option_history_quote_format.py new file mode 100644 index 000000000..97952d9a7 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_quote_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryQuoteFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_quote_interval.py b/openapi_project/openapi_package/models/option_history_quote_interval.py new file mode 100644 index 000000000..3a9565477 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_quote_interval.py @@ -0,0 +1,21 @@ +from enum import Enum + +class OptionHistoryQuoteInterval(str, Enum): + TICK = "tick" + VALUE_1 = "10ms" + VALUE_10 = "5m" + VALUE_11 = "10m" + VALUE_12 = "15m" + VALUE_13 = "30m" + VALUE_14 = "1h" + VALUE_2 = "100ms" + VALUE_3 = "500ms" + VALUE_4 = "1s" + VALUE_5 = "5s" + VALUE_6 = "10s" + VALUE_7 = "15s" + VALUE_8 = "30s" + VALUE_9 = "1m" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_quote_response_200.py b/openapi_project/openapi_package/models/option_history_quote_response_200.py new file mode 100644 index 000000000..5d622601e --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_quote_response_200.py @@ -0,0 +1,216 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionHistoryQuoteResponse200") + + + +@_attrs_define +class OptionHistoryQuoteResponse200: + """ + Attributes: + symbol (list[str]): + ask_size (list[int]): + ask_condition (list[int]): + strike (list[float]): + right (list[str]): + bid_size (list[int]): + ask_exchange (list[int]): + bid_exchange (list[int]): + ask (list[float]): + expiration (list[str]): + bid (list[float]): + bid_condition (list[int]): + timestamp (list[str]): + """ + + symbol: list[str] + ask_size: list[int] + ask_condition: list[int] + strike: list[float] + right: list[str] + bid_size: list[int] + ask_exchange: list[int] + bid_exchange: list[int] + ask: list[float] + expiration: list[str] + bid: list[float] + bid_condition: list[int] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + ask_size = self.ask_size + + + + ask_condition = self.ask_condition + + + + strike = self.strike + + + + right = self.right + + + + bid_size = self.bid_size + + + + ask_exchange = self.ask_exchange + + + + bid_exchange = self.bid_exchange + + + + ask = self.ask + + + + expiration = self.expiration + + + + bid = self.bid + + + + bid_condition = self.bid_condition + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "ask_size": ask_size, + "ask_condition": ask_condition, + "strike": strike, + "right": right, + "bid_size": bid_size, + "ask_exchange": ask_exchange, + "bid_exchange": bid_exchange, + "ask": ask, + "expiration": expiration, + "bid": bid, + "bid_condition": bid_condition, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + ask_size = cast(list[int], d.pop("ask_size")) + + + ask_condition = cast(list[int], d.pop("ask_condition")) + + + strike = cast(list[float], d.pop("strike")) + + + right = cast(list[str], d.pop("right")) + + + bid_size = cast(list[int], d.pop("bid_size")) + + + ask_exchange = cast(list[int], d.pop("ask_exchange")) + + + bid_exchange = cast(list[int], d.pop("bid_exchange")) + + + ask = cast(list[float], d.pop("ask")) + + + expiration = cast(list[str], d.pop("expiration")) + + + bid = cast(list[float], d.pop("bid")) + + + bid_condition = cast(list[int], d.pop("bid_condition")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + option_history_quote_response_200 = cls( + symbol=symbol, + ask_size=ask_size, + ask_condition=ask_condition, + strike=strike, + right=right, + bid_size=bid_size, + ask_exchange=ask_exchange, + bid_exchange=bid_exchange, + ask=ask, + expiration=expiration, + bid=bid, + bid_condition=bid_condition, + timestamp=timestamp, + ) + + + + option_history_quote_response_200.additional_properties = d + return option_history_quote_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_history_quote_right.py b/openapi_project/openapi_package/models/option_history_quote_right.py new file mode 100644 index 000000000..e070d7a48 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_quote_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryQuoteRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_trade_format.py b/openapi_project/openapi_package/models/option_history_trade_format.py new file mode 100644 index 000000000..4b7517081 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_trade_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryTradeFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_all_format.py b/openapi_project/openapi_package/models/option_history_trade_greeks_all_format.py new file mode 100644 index 000000000..8e01682bc --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_all_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryTradeGreeksAllFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_all_rate_type.py b/openapi_project/openapi_package/models/option_history_trade_greeks_all_rate_type.py new file mode 100644 index 000000000..70305c766 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_all_rate_type.py @@ -0,0 +1,18 @@ +from enum import Enum + +class OptionHistoryTradeGreeksAllRateType(str, Enum): + SOFR = "sofr" + TREASURY_M1 = "treasury_m1" + TREASURY_M3 = "treasury_m3" + TREASURY_M6 = "treasury_m6" + TREASURY_Y1 = "treasury_y1" + TREASURY_Y10 = "treasury_y10" + TREASURY_Y2 = "treasury_y2" + TREASURY_Y20 = "treasury_y20" + TREASURY_Y3 = "treasury_y3" + TREASURY_Y30 = "treasury_y30" + TREASURY_Y5 = "treasury_y5" + TREASURY_Y7 = "treasury_y7" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_all_response_200.py b/openapi_project/openapi_package/models/option_history_trade_greeks_all_response_200.py new file mode 100644 index 000000000..8ab9b954f --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_all_response_200.py @@ -0,0 +1,491 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionHistoryTradeGreeksAllResponse200") + + + +@_attrs_define +class OptionHistoryTradeGreeksAllResponse200: + """ + Attributes: + symbol (list[str]): + dual_delta (list[float]): + color (list[float]): + zomma (list[float]): + delta (list[float]): + implied_vol (list[float]): + theta (list[float]): + d1 (list[float]): + speed (list[float]): + d2 (list[float]): + epsilon (list[float]): + lambda_ (list[float]): + price (list[float]): + ext_condition2 (list[int]): + ext_condition1 (list[int]): + ext_condition4 (list[int]): + vomma (list[float]): + ext_condition3 (list[int]): + underlying_timestamp (list[str]): + timestamp (list[str]): + underlying_price (list[float]): + strike (list[float]): + vera (list[float]): + right (list[str]): + veta (list[float]): + iv_error (list[float]): + ultima (list[float]): + sequence (list[int]): + condition (list[int]): + size (list[int]): + charm (list[float]): + rho (list[float]): + expiration (list[str]): + exchange (list[int]): + vanna (list[float]): + dual_gamma (list[float]): + vega (list[float]): + gamma (list[float]): + """ + + symbol: list[str] + dual_delta: list[float] + color: list[float] + zomma: list[float] + delta: list[float] + implied_vol: list[float] + theta: list[float] + d1: list[float] + speed: list[float] + d2: list[float] + epsilon: list[float] + lambda_: list[float] + price: list[float] + ext_condition2: list[int] + ext_condition1: list[int] + ext_condition4: list[int] + vomma: list[float] + ext_condition3: list[int] + underlying_timestamp: list[str] + timestamp: list[str] + underlying_price: list[float] + strike: list[float] + vera: list[float] + right: list[str] + veta: list[float] + iv_error: list[float] + ultima: list[float] + sequence: list[int] + condition: list[int] + size: list[int] + charm: list[float] + rho: list[float] + expiration: list[str] + exchange: list[int] + vanna: list[float] + dual_gamma: list[float] + vega: list[float] + gamma: list[float] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + dual_delta = self.dual_delta + + + + color = self.color + + + + zomma = self.zomma + + + + delta = self.delta + + + + implied_vol = self.implied_vol + + + + theta = self.theta + + + + d1 = self.d1 + + + + speed = self.speed + + + + d2 = self.d2 + + + + epsilon = self.epsilon + + + + lambda_ = self.lambda_ + + + + price = self.price + + + + ext_condition2 = self.ext_condition2 + + + + ext_condition1 = self.ext_condition1 + + + + ext_condition4 = self.ext_condition4 + + + + vomma = self.vomma + + + + ext_condition3 = self.ext_condition3 + + + + underlying_timestamp = self.underlying_timestamp + + + + timestamp = self.timestamp + + + + underlying_price = self.underlying_price + + + + strike = self.strike + + + + vera = self.vera + + + + right = self.right + + + + veta = self.veta + + + + iv_error = self.iv_error + + + + ultima = self.ultima + + + + sequence = self.sequence + + + + condition = self.condition + + + + size = self.size + + + + charm = self.charm + + + + rho = self.rho + + + + expiration = self.expiration + + + + exchange = self.exchange + + + + vanna = self.vanna + + + + dual_gamma = self.dual_gamma + + + + vega = self.vega + + + + gamma = self.gamma + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "dual_delta": dual_delta, + "color": color, + "zomma": zomma, + "delta": delta, + "implied_vol": implied_vol, + "theta": theta, + "d1": d1, + "speed": speed, + "d2": d2, + "epsilon": epsilon, + "lambda": lambda_, + "price": price, + "ext_condition2": ext_condition2, + "ext_condition1": ext_condition1, + "ext_condition4": ext_condition4, + "vomma": vomma, + "ext_condition3": ext_condition3, + "underlying_timestamp": underlying_timestamp, + "timestamp": timestamp, + "underlying_price": underlying_price, + "strike": strike, + "vera": vera, + "right": right, + "veta": veta, + "iv_error": iv_error, + "ultima": ultima, + "sequence": sequence, + "condition": condition, + "size": size, + "charm": charm, + "rho": rho, + "expiration": expiration, + "exchange": exchange, + "vanna": vanna, + "dual_gamma": dual_gamma, + "vega": vega, + "gamma": gamma, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + dual_delta = cast(list[float], d.pop("dual_delta")) + + + color = cast(list[float], d.pop("color")) + + + zomma = cast(list[float], d.pop("zomma")) + + + delta = cast(list[float], d.pop("delta")) + + + implied_vol = cast(list[float], d.pop("implied_vol")) + + + theta = cast(list[float], d.pop("theta")) + + + d1 = cast(list[float], d.pop("d1")) + + + speed = cast(list[float], d.pop("speed")) + + + d2 = cast(list[float], d.pop("d2")) + + + epsilon = cast(list[float], d.pop("epsilon")) + + + lambda_ = cast(list[float], d.pop("lambda")) + + + price = cast(list[float], d.pop("price")) + + + ext_condition2 = cast(list[int], d.pop("ext_condition2")) + + + ext_condition1 = cast(list[int], d.pop("ext_condition1")) + + + ext_condition4 = cast(list[int], d.pop("ext_condition4")) + + + vomma = cast(list[float], d.pop("vomma")) + + + ext_condition3 = cast(list[int], d.pop("ext_condition3")) + + + underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + underlying_price = cast(list[float], d.pop("underlying_price")) + + + strike = cast(list[float], d.pop("strike")) + + + vera = cast(list[float], d.pop("vera")) + + + right = cast(list[str], d.pop("right")) + + + veta = cast(list[float], d.pop("veta")) + + + iv_error = cast(list[float], d.pop("iv_error")) + + + ultima = cast(list[float], d.pop("ultima")) + + + sequence = cast(list[int], d.pop("sequence")) + + + condition = cast(list[int], d.pop("condition")) + + + size = cast(list[int], d.pop("size")) + + + charm = cast(list[float], d.pop("charm")) + + + rho = cast(list[float], d.pop("rho")) + + + expiration = cast(list[str], d.pop("expiration")) + + + exchange = cast(list[int], d.pop("exchange")) + + + vanna = cast(list[float], d.pop("vanna")) + + + dual_gamma = cast(list[float], d.pop("dual_gamma")) + + + vega = cast(list[float], d.pop("vega")) + + + gamma = cast(list[float], d.pop("gamma")) + + + option_history_trade_greeks_all_response_200 = cls( + symbol=symbol, + dual_delta=dual_delta, + color=color, + zomma=zomma, + delta=delta, + implied_vol=implied_vol, + theta=theta, + d1=d1, + speed=speed, + d2=d2, + epsilon=epsilon, + lambda_=lambda_, + price=price, + ext_condition2=ext_condition2, + ext_condition1=ext_condition1, + ext_condition4=ext_condition4, + vomma=vomma, + ext_condition3=ext_condition3, + underlying_timestamp=underlying_timestamp, + timestamp=timestamp, + underlying_price=underlying_price, + strike=strike, + vera=vera, + right=right, + veta=veta, + iv_error=iv_error, + ultima=ultima, + sequence=sequence, + condition=condition, + size=size, + charm=charm, + rho=rho, + expiration=expiration, + exchange=exchange, + vanna=vanna, + dual_gamma=dual_gamma, + vega=vega, + gamma=gamma, + ) + + + + option_history_trade_greeks_all_response_200.additional_properties = d + return option_history_trade_greeks_all_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_all_right.py b/openapi_project/openapi_package/models/option_history_trade_greeks_all_right.py new file mode 100644 index 000000000..599f5b673 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_all_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryTradeGreeksAllRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_first_order_format.py b/openapi_project/openapi_package/models/option_history_trade_greeks_first_order_format.py new file mode 100644 index 000000000..20182af70 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_first_order_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryTradeGreeksFirstOrderFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_first_order_rate_type.py b/openapi_project/openapi_package/models/option_history_trade_greeks_first_order_rate_type.py new file mode 100644 index 000000000..18134f910 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_first_order_rate_type.py @@ -0,0 +1,18 @@ +from enum import Enum + +class OptionHistoryTradeGreeksFirstOrderRateType(str, Enum): + SOFR = "sofr" + TREASURY_M1 = "treasury_m1" + TREASURY_M3 = "treasury_m3" + TREASURY_M6 = "treasury_m6" + TREASURY_Y1 = "treasury_y1" + TREASURY_Y10 = "treasury_y10" + TREASURY_Y2 = "treasury_y2" + TREASURY_Y20 = "treasury_y20" + TREASURY_Y3 = "treasury_y3" + TREASURY_Y30 = "treasury_y30" + TREASURY_Y5 = "treasury_y5" + TREASURY_Y7 = "treasury_y7" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_first_order_response_200.py b/openapi_project/openapi_package/models/option_history_trade_greeks_first_order_response_200.py new file mode 100644 index 000000000..ee4fd3da8 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_first_order_response_200.py @@ -0,0 +1,337 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionHistoryTradeGreeksFirstOrderResponse200") + + + +@_attrs_define +class OptionHistoryTradeGreeksFirstOrderResponse200: + """ + Attributes: + symbol (list[str]): + underlying_price (list[float]): + strike (list[float]): + delta (list[float]): + right (list[str]): + implied_vol (list[float]): + theta (list[float]): + iv_error (list[float]): + epsilon (list[float]): + sequence (list[int]): + condition (list[int]): + lambda_ (list[float]): + size (list[int]): + price (list[float]): + ext_condition2 (list[int]): + rho (list[float]): + ext_condition1 (list[int]): + expiration (list[str]): + ext_condition4 (list[int]): + exchange (list[int]): + ext_condition3 (list[int]): + underlying_timestamp (list[str]): + vega (list[float]): + timestamp (list[str]): + """ + + symbol: list[str] + underlying_price: list[float] + strike: list[float] + delta: list[float] + right: list[str] + implied_vol: list[float] + theta: list[float] + iv_error: list[float] + epsilon: list[float] + sequence: list[int] + condition: list[int] + lambda_: list[float] + size: list[int] + price: list[float] + ext_condition2: list[int] + rho: list[float] + ext_condition1: list[int] + expiration: list[str] + ext_condition4: list[int] + exchange: list[int] + ext_condition3: list[int] + underlying_timestamp: list[str] + vega: list[float] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + underlying_price = self.underlying_price + + + + strike = self.strike + + + + delta = self.delta + + + + right = self.right + + + + implied_vol = self.implied_vol + + + + theta = self.theta + + + + iv_error = self.iv_error + + + + epsilon = self.epsilon + + + + sequence = self.sequence + + + + condition = self.condition + + + + lambda_ = self.lambda_ + + + + size = self.size + + + + price = self.price + + + + ext_condition2 = self.ext_condition2 + + + + rho = self.rho + + + + ext_condition1 = self.ext_condition1 + + + + expiration = self.expiration + + + + ext_condition4 = self.ext_condition4 + + + + exchange = self.exchange + + + + ext_condition3 = self.ext_condition3 + + + + underlying_timestamp = self.underlying_timestamp + + + + vega = self.vega + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "underlying_price": underlying_price, + "strike": strike, + "delta": delta, + "right": right, + "implied_vol": implied_vol, + "theta": theta, + "iv_error": iv_error, + "epsilon": epsilon, + "sequence": sequence, + "condition": condition, + "lambda": lambda_, + "size": size, + "price": price, + "ext_condition2": ext_condition2, + "rho": rho, + "ext_condition1": ext_condition1, + "expiration": expiration, + "ext_condition4": ext_condition4, + "exchange": exchange, + "ext_condition3": ext_condition3, + "underlying_timestamp": underlying_timestamp, + "vega": vega, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + underlying_price = cast(list[float], d.pop("underlying_price")) + + + strike = cast(list[float], d.pop("strike")) + + + delta = cast(list[float], d.pop("delta")) + + + right = cast(list[str], d.pop("right")) + + + implied_vol = cast(list[float], d.pop("implied_vol")) + + + theta = cast(list[float], d.pop("theta")) + + + iv_error = cast(list[float], d.pop("iv_error")) + + + epsilon = cast(list[float], d.pop("epsilon")) + + + sequence = cast(list[int], d.pop("sequence")) + + + condition = cast(list[int], d.pop("condition")) + + + lambda_ = cast(list[float], d.pop("lambda")) + + + size = cast(list[int], d.pop("size")) + + + price = cast(list[float], d.pop("price")) + + + ext_condition2 = cast(list[int], d.pop("ext_condition2")) + + + rho = cast(list[float], d.pop("rho")) + + + ext_condition1 = cast(list[int], d.pop("ext_condition1")) + + + expiration = cast(list[str], d.pop("expiration")) + + + ext_condition4 = cast(list[int], d.pop("ext_condition4")) + + + exchange = cast(list[int], d.pop("exchange")) + + + ext_condition3 = cast(list[int], d.pop("ext_condition3")) + + + underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) + + + vega = cast(list[float], d.pop("vega")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + option_history_trade_greeks_first_order_response_200 = cls( + symbol=symbol, + underlying_price=underlying_price, + strike=strike, + delta=delta, + right=right, + implied_vol=implied_vol, + theta=theta, + iv_error=iv_error, + epsilon=epsilon, + sequence=sequence, + condition=condition, + lambda_=lambda_, + size=size, + price=price, + ext_condition2=ext_condition2, + rho=rho, + ext_condition1=ext_condition1, + expiration=expiration, + ext_condition4=ext_condition4, + exchange=exchange, + ext_condition3=ext_condition3, + underlying_timestamp=underlying_timestamp, + vega=vega, + timestamp=timestamp, + ) + + + + option_history_trade_greeks_first_order_response_200.additional_properties = d + return option_history_trade_greeks_first_order_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_first_order_right.py b/openapi_project/openapi_package/models/option_history_trade_greeks_first_order_right.py new file mode 100644 index 000000000..46f4e71be --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_first_order_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryTradeGreeksFirstOrderRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_implied_volatility_format.py b/openapi_project/openapi_package/models/option_history_trade_greeks_implied_volatility_format.py new file mode 100644 index 000000000..b8c58495c --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_implied_volatility_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryTradeGreeksImpliedVolatilityFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_implied_volatility_rate_type.py b/openapi_project/openapi_package/models/option_history_trade_greeks_implied_volatility_rate_type.py new file mode 100644 index 000000000..e32d60ba6 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_implied_volatility_rate_type.py @@ -0,0 +1,18 @@ +from enum import Enum + +class OptionHistoryTradeGreeksImpliedVolatilityRateType(str, Enum): + SOFR = "sofr" + TREASURY_M1 = "treasury_m1" + TREASURY_M3 = "treasury_m3" + TREASURY_M6 = "treasury_m6" + TREASURY_Y1 = "treasury_y1" + TREASURY_Y10 = "treasury_y10" + TREASURY_Y2 = "treasury_y2" + TREASURY_Y20 = "treasury_y20" + TREASURY_Y3 = "treasury_y3" + TREASURY_Y30 = "treasury_y30" + TREASURY_Y5 = "treasury_y5" + TREASURY_Y7 = "treasury_y7" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_implied_volatility_response_200.py b/openapi_project/openapi_package/models/option_history_trade_greeks_implied_volatility_response_200.py new file mode 100644 index 000000000..600d70261 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_implied_volatility_response_200.py @@ -0,0 +1,271 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionHistoryTradeGreeksImpliedVolatilityResponse200") + + + +@_attrs_define +class OptionHistoryTradeGreeksImpliedVolatilityResponse200: + """ + Attributes: + symbol (list[str]): + underlying_price (list[float]): + strike (list[float]): + right (list[str]): + implied_vol (list[float]): + iv_error (list[float]): + sequence (list[int]): + condition (list[int]): + size (list[int]): + price (list[float]): + ext_condition2 (list[int]): + ext_condition1 (list[int]): + expiration (list[str]): + ext_condition4 (list[int]): + exchange (list[int]): + ext_condition3 (list[int]): + underlying_timestamp (list[str]): + timestamp (list[str]): + """ + + symbol: list[str] + underlying_price: list[float] + strike: list[float] + right: list[str] + implied_vol: list[float] + iv_error: list[float] + sequence: list[int] + condition: list[int] + size: list[int] + price: list[float] + ext_condition2: list[int] + ext_condition1: list[int] + expiration: list[str] + ext_condition4: list[int] + exchange: list[int] + ext_condition3: list[int] + underlying_timestamp: list[str] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + underlying_price = self.underlying_price + + + + strike = self.strike + + + + right = self.right + + + + implied_vol = self.implied_vol + + + + iv_error = self.iv_error + + + + sequence = self.sequence + + + + condition = self.condition + + + + size = self.size + + + + price = self.price + + + + ext_condition2 = self.ext_condition2 + + + + ext_condition1 = self.ext_condition1 + + + + expiration = self.expiration + + + + ext_condition4 = self.ext_condition4 + + + + exchange = self.exchange + + + + ext_condition3 = self.ext_condition3 + + + + underlying_timestamp = self.underlying_timestamp + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "underlying_price": underlying_price, + "strike": strike, + "right": right, + "implied_vol": implied_vol, + "iv_error": iv_error, + "sequence": sequence, + "condition": condition, + "size": size, + "price": price, + "ext_condition2": ext_condition2, + "ext_condition1": ext_condition1, + "expiration": expiration, + "ext_condition4": ext_condition4, + "exchange": exchange, + "ext_condition3": ext_condition3, + "underlying_timestamp": underlying_timestamp, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + underlying_price = cast(list[float], d.pop("underlying_price")) + + + strike = cast(list[float], d.pop("strike")) + + + right = cast(list[str], d.pop("right")) + + + implied_vol = cast(list[float], d.pop("implied_vol")) + + + iv_error = cast(list[float], d.pop("iv_error")) + + + sequence = cast(list[int], d.pop("sequence")) + + + condition = cast(list[int], d.pop("condition")) + + + size = cast(list[int], d.pop("size")) + + + price = cast(list[float], d.pop("price")) + + + ext_condition2 = cast(list[int], d.pop("ext_condition2")) + + + ext_condition1 = cast(list[int], d.pop("ext_condition1")) + + + expiration = cast(list[str], d.pop("expiration")) + + + ext_condition4 = cast(list[int], d.pop("ext_condition4")) + + + exchange = cast(list[int], d.pop("exchange")) + + + ext_condition3 = cast(list[int], d.pop("ext_condition3")) + + + underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + option_history_trade_greeks_implied_volatility_response_200 = cls( + symbol=symbol, + underlying_price=underlying_price, + strike=strike, + right=right, + implied_vol=implied_vol, + iv_error=iv_error, + sequence=sequence, + condition=condition, + size=size, + price=price, + ext_condition2=ext_condition2, + ext_condition1=ext_condition1, + expiration=expiration, + ext_condition4=ext_condition4, + exchange=exchange, + ext_condition3=ext_condition3, + underlying_timestamp=underlying_timestamp, + timestamp=timestamp, + ) + + + + option_history_trade_greeks_implied_volatility_response_200.additional_properties = d + return option_history_trade_greeks_implied_volatility_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_implied_volatility_right.py b/openapi_project/openapi_package/models/option_history_trade_greeks_implied_volatility_right.py new file mode 100644 index 000000000..dafc1899d --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_implied_volatility_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryTradeGreeksImpliedVolatilityRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_second_order_format.py b/openapi_project/openapi_package/models/option_history_trade_greeks_second_order_format.py new file mode 100644 index 000000000..55a709a6f --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_second_order_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryTradeGreeksSecondOrderFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_second_order_rate_type.py b/openapi_project/openapi_package/models/option_history_trade_greeks_second_order_rate_type.py new file mode 100644 index 000000000..d9567f04e --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_second_order_rate_type.py @@ -0,0 +1,18 @@ +from enum import Enum + +class OptionHistoryTradeGreeksSecondOrderRateType(str, Enum): + SOFR = "sofr" + TREASURY_M1 = "treasury_m1" + TREASURY_M3 = "treasury_m3" + TREASURY_M6 = "treasury_m6" + TREASURY_Y1 = "treasury_y1" + TREASURY_Y10 = "treasury_y10" + TREASURY_Y2 = "treasury_y2" + TREASURY_Y20 = "treasury_y20" + TREASURY_Y3 = "treasury_y3" + TREASURY_Y30 = "treasury_y30" + TREASURY_Y5 = "treasury_y5" + TREASURY_Y7 = "treasury_y7" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_second_order_response_200.py b/openapi_project/openapi_package/models/option_history_trade_greeks_second_order_response_200.py new file mode 100644 index 000000000..ea7cda42a --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_second_order_response_200.py @@ -0,0 +1,326 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionHistoryTradeGreeksSecondOrderResponse200") + + + +@_attrs_define +class OptionHistoryTradeGreeksSecondOrderResponse200: + """ + Attributes: + symbol (list[str]): + underlying_price (list[float]): + strike (list[float]): + right (list[str]): + veta (list[float]): + implied_vol (list[float]): + iv_error (list[float]): + sequence (list[int]): + condition (list[int]): + size (list[int]): + charm (list[float]): + price (list[float]): + ext_condition2 (list[int]): + ext_condition1 (list[int]): + expiration (list[str]): + ext_condition4 (list[int]): + exchange (list[int]): + vanna (list[float]): + vomma (list[float]): + ext_condition3 (list[int]): + underlying_timestamp (list[str]): + gamma (list[float]): + timestamp (list[str]): + """ + + symbol: list[str] + underlying_price: list[float] + strike: list[float] + right: list[str] + veta: list[float] + implied_vol: list[float] + iv_error: list[float] + sequence: list[int] + condition: list[int] + size: list[int] + charm: list[float] + price: list[float] + ext_condition2: list[int] + ext_condition1: list[int] + expiration: list[str] + ext_condition4: list[int] + exchange: list[int] + vanna: list[float] + vomma: list[float] + ext_condition3: list[int] + underlying_timestamp: list[str] + gamma: list[float] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + underlying_price = self.underlying_price + + + + strike = self.strike + + + + right = self.right + + + + veta = self.veta + + + + implied_vol = self.implied_vol + + + + iv_error = self.iv_error + + + + sequence = self.sequence + + + + condition = self.condition + + + + size = self.size + + + + charm = self.charm + + + + price = self.price + + + + ext_condition2 = self.ext_condition2 + + + + ext_condition1 = self.ext_condition1 + + + + expiration = self.expiration + + + + ext_condition4 = self.ext_condition4 + + + + exchange = self.exchange + + + + vanna = self.vanna + + + + vomma = self.vomma + + + + ext_condition3 = self.ext_condition3 + + + + underlying_timestamp = self.underlying_timestamp + + + + gamma = self.gamma + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "underlying_price": underlying_price, + "strike": strike, + "right": right, + "veta": veta, + "implied_vol": implied_vol, + "iv_error": iv_error, + "sequence": sequence, + "condition": condition, + "size": size, + "charm": charm, + "price": price, + "ext_condition2": ext_condition2, + "ext_condition1": ext_condition1, + "expiration": expiration, + "ext_condition4": ext_condition4, + "exchange": exchange, + "vanna": vanna, + "vomma": vomma, + "ext_condition3": ext_condition3, + "underlying_timestamp": underlying_timestamp, + "gamma": gamma, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + underlying_price = cast(list[float], d.pop("underlying_price")) + + + strike = cast(list[float], d.pop("strike")) + + + right = cast(list[str], d.pop("right")) + + + veta = cast(list[float], d.pop("veta")) + + + implied_vol = cast(list[float], d.pop("implied_vol")) + + + iv_error = cast(list[float], d.pop("iv_error")) + + + sequence = cast(list[int], d.pop("sequence")) + + + condition = cast(list[int], d.pop("condition")) + + + size = cast(list[int], d.pop("size")) + + + charm = cast(list[float], d.pop("charm")) + + + price = cast(list[float], d.pop("price")) + + + ext_condition2 = cast(list[int], d.pop("ext_condition2")) + + + ext_condition1 = cast(list[int], d.pop("ext_condition1")) + + + expiration = cast(list[str], d.pop("expiration")) + + + ext_condition4 = cast(list[int], d.pop("ext_condition4")) + + + exchange = cast(list[int], d.pop("exchange")) + + + vanna = cast(list[float], d.pop("vanna")) + + + vomma = cast(list[float], d.pop("vomma")) + + + ext_condition3 = cast(list[int], d.pop("ext_condition3")) + + + underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) + + + gamma = cast(list[float], d.pop("gamma")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + option_history_trade_greeks_second_order_response_200 = cls( + symbol=symbol, + underlying_price=underlying_price, + strike=strike, + right=right, + veta=veta, + implied_vol=implied_vol, + iv_error=iv_error, + sequence=sequence, + condition=condition, + size=size, + charm=charm, + price=price, + ext_condition2=ext_condition2, + ext_condition1=ext_condition1, + expiration=expiration, + ext_condition4=ext_condition4, + exchange=exchange, + vanna=vanna, + vomma=vomma, + ext_condition3=ext_condition3, + underlying_timestamp=underlying_timestamp, + gamma=gamma, + timestamp=timestamp, + ) + + + + option_history_trade_greeks_second_order_response_200.additional_properties = d + return option_history_trade_greeks_second_order_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_second_order_right.py b/openapi_project/openapi_package/models/option_history_trade_greeks_second_order_right.py new file mode 100644 index 000000000..6e68db6cf --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_second_order_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryTradeGreeksSecondOrderRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_third_order_format.py b/openapi_project/openapi_package/models/option_history_trade_greeks_third_order_format.py new file mode 100644 index 000000000..d761efc8a --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_third_order_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryTradeGreeksThirdOrderFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_third_order_rate_type.py b/openapi_project/openapi_package/models/option_history_trade_greeks_third_order_rate_type.py new file mode 100644 index 000000000..e616b990b --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_third_order_rate_type.py @@ -0,0 +1,18 @@ +from enum import Enum + +class OptionHistoryTradeGreeksThirdOrderRateType(str, Enum): + SOFR = "sofr" + TREASURY_M1 = "treasury_m1" + TREASURY_M3 = "treasury_m3" + TREASURY_M6 = "treasury_m6" + TREASURY_Y1 = "treasury_y1" + TREASURY_Y10 = "treasury_y10" + TREASURY_Y2 = "treasury_y2" + TREASURY_Y20 = "treasury_y20" + TREASURY_Y3 = "treasury_y3" + TREASURY_Y30 = "treasury_y30" + TREASURY_Y5 = "treasury_y5" + TREASURY_Y7 = "treasury_y7" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_third_order_response_200.py b/openapi_project/openapi_package/models/option_history_trade_greeks_third_order_response_200.py new file mode 100644 index 000000000..10064cf07 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_third_order_response_200.py @@ -0,0 +1,315 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionHistoryTradeGreeksThirdOrderResponse200") + + + +@_attrs_define +class OptionHistoryTradeGreeksThirdOrderResponse200: + """ + Attributes: + symbol (list[str]): + underlying_price (list[float]): + color (list[float]): + strike (list[float]): + zomma (list[float]): + right (list[str]): + implied_vol (list[float]): + iv_error (list[float]): + speed (list[float]): + ultima (list[float]): + sequence (list[int]): + condition (list[int]): + size (list[int]): + price (list[float]): + ext_condition2 (list[int]): + ext_condition1 (list[int]): + expiration (list[str]): + ext_condition4 (list[int]): + exchange (list[int]): + ext_condition3 (list[int]): + underlying_timestamp (list[str]): + timestamp (list[str]): + """ + + symbol: list[str] + underlying_price: list[float] + color: list[float] + strike: list[float] + zomma: list[float] + right: list[str] + implied_vol: list[float] + iv_error: list[float] + speed: list[float] + ultima: list[float] + sequence: list[int] + condition: list[int] + size: list[int] + price: list[float] + ext_condition2: list[int] + ext_condition1: list[int] + expiration: list[str] + ext_condition4: list[int] + exchange: list[int] + ext_condition3: list[int] + underlying_timestamp: list[str] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + underlying_price = self.underlying_price + + + + color = self.color + + + + strike = self.strike + + + + zomma = self.zomma + + + + right = self.right + + + + implied_vol = self.implied_vol + + + + iv_error = self.iv_error + + + + speed = self.speed + + + + ultima = self.ultima + + + + sequence = self.sequence + + + + condition = self.condition + + + + size = self.size + + + + price = self.price + + + + ext_condition2 = self.ext_condition2 + + + + ext_condition1 = self.ext_condition1 + + + + expiration = self.expiration + + + + ext_condition4 = self.ext_condition4 + + + + exchange = self.exchange + + + + ext_condition3 = self.ext_condition3 + + + + underlying_timestamp = self.underlying_timestamp + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "underlying_price": underlying_price, + "color": color, + "strike": strike, + "zomma": zomma, + "right": right, + "implied_vol": implied_vol, + "iv_error": iv_error, + "speed": speed, + "ultima": ultima, + "sequence": sequence, + "condition": condition, + "size": size, + "price": price, + "ext_condition2": ext_condition2, + "ext_condition1": ext_condition1, + "expiration": expiration, + "ext_condition4": ext_condition4, + "exchange": exchange, + "ext_condition3": ext_condition3, + "underlying_timestamp": underlying_timestamp, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + underlying_price = cast(list[float], d.pop("underlying_price")) + + + color = cast(list[float], d.pop("color")) + + + strike = cast(list[float], d.pop("strike")) + + + zomma = cast(list[float], d.pop("zomma")) + + + right = cast(list[str], d.pop("right")) + + + implied_vol = cast(list[float], d.pop("implied_vol")) + + + iv_error = cast(list[float], d.pop("iv_error")) + + + speed = cast(list[float], d.pop("speed")) + + + ultima = cast(list[float], d.pop("ultima")) + + + sequence = cast(list[int], d.pop("sequence")) + + + condition = cast(list[int], d.pop("condition")) + + + size = cast(list[int], d.pop("size")) + + + price = cast(list[float], d.pop("price")) + + + ext_condition2 = cast(list[int], d.pop("ext_condition2")) + + + ext_condition1 = cast(list[int], d.pop("ext_condition1")) + + + expiration = cast(list[str], d.pop("expiration")) + + + ext_condition4 = cast(list[int], d.pop("ext_condition4")) + + + exchange = cast(list[int], d.pop("exchange")) + + + ext_condition3 = cast(list[int], d.pop("ext_condition3")) + + + underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + option_history_trade_greeks_third_order_response_200 = cls( + symbol=symbol, + underlying_price=underlying_price, + color=color, + strike=strike, + zomma=zomma, + right=right, + implied_vol=implied_vol, + iv_error=iv_error, + speed=speed, + ultima=ultima, + sequence=sequence, + condition=condition, + size=size, + price=price, + ext_condition2=ext_condition2, + ext_condition1=ext_condition1, + expiration=expiration, + ext_condition4=ext_condition4, + exchange=exchange, + ext_condition3=ext_condition3, + underlying_timestamp=underlying_timestamp, + timestamp=timestamp, + ) + + + + option_history_trade_greeks_third_order_response_200.additional_properties = d + return option_history_trade_greeks_third_order_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_third_order_right.py b/openapi_project/openapi_package/models/option_history_trade_greeks_third_order_right.py new file mode 100644 index 000000000..da55d85d6 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_third_order_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryTradeGreeksThirdOrderRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_trade_quote_format.py b/openapi_project/openapi_package/models/option_history_trade_quote_format.py new file mode 100644 index 000000000..008fbcf32 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_trade_quote_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryTradeQuoteFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_trade_quote_response_200.py b/openapi_project/openapi_package/models/option_history_trade_quote_response_200.py new file mode 100644 index 000000000..bf4bb26f8 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_trade_quote_response_200.py @@ -0,0 +1,326 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionHistoryTradeQuoteResponse200") + + + +@_attrs_define +class OptionHistoryTradeQuoteResponse200: + """ + Attributes: + symbol (list[str]): + ask_size (list[int]): + trade_timestamp (list[str]): + ask_condition (list[int]): + strike (list[float]): + right (list[str]): + sequence (list[int]): + condition (list[int]): + size (list[int]): + bid_size (list[int]): + ask_exchange (list[int]): + price (list[float]): + ext_condition2 (list[int]): + bid_exchange (list[int]): + ask (list[float]): + quote_timestamp (list[str]): + ext_condition1 (list[int]): + expiration (list[str]): + ext_condition4 (list[int]): + exchange (list[int]): + ext_condition3 (list[int]): + bid (list[float]): + bid_condition (list[int]): + """ + + symbol: list[str] + ask_size: list[int] + trade_timestamp: list[str] + ask_condition: list[int] + strike: list[float] + right: list[str] + sequence: list[int] + condition: list[int] + size: list[int] + bid_size: list[int] + ask_exchange: list[int] + price: list[float] + ext_condition2: list[int] + bid_exchange: list[int] + ask: list[float] + quote_timestamp: list[str] + ext_condition1: list[int] + expiration: list[str] + ext_condition4: list[int] + exchange: list[int] + ext_condition3: list[int] + bid: list[float] + bid_condition: list[int] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + ask_size = self.ask_size + + + + trade_timestamp = self.trade_timestamp + + + + ask_condition = self.ask_condition + + + + strike = self.strike + + + + right = self.right + + + + sequence = self.sequence + + + + condition = self.condition + + + + size = self.size + + + + bid_size = self.bid_size + + + + ask_exchange = self.ask_exchange + + + + price = self.price + + + + ext_condition2 = self.ext_condition2 + + + + bid_exchange = self.bid_exchange + + + + ask = self.ask + + + + quote_timestamp = self.quote_timestamp + + + + ext_condition1 = self.ext_condition1 + + + + expiration = self.expiration + + + + ext_condition4 = self.ext_condition4 + + + + exchange = self.exchange + + + + ext_condition3 = self.ext_condition3 + + + + bid = self.bid + + + + bid_condition = self.bid_condition + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "ask_size": ask_size, + "trade_timestamp": trade_timestamp, + "ask_condition": ask_condition, + "strike": strike, + "right": right, + "sequence": sequence, + "condition": condition, + "size": size, + "bid_size": bid_size, + "ask_exchange": ask_exchange, + "price": price, + "ext_condition2": ext_condition2, + "bid_exchange": bid_exchange, + "ask": ask, + "quote_timestamp": quote_timestamp, + "ext_condition1": ext_condition1, + "expiration": expiration, + "ext_condition4": ext_condition4, + "exchange": exchange, + "ext_condition3": ext_condition3, + "bid": bid, + "bid_condition": bid_condition, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + ask_size = cast(list[int], d.pop("ask_size")) + + + trade_timestamp = cast(list[str], d.pop("trade_timestamp")) + + + ask_condition = cast(list[int], d.pop("ask_condition")) + + + strike = cast(list[float], d.pop("strike")) + + + right = cast(list[str], d.pop("right")) + + + sequence = cast(list[int], d.pop("sequence")) + + + condition = cast(list[int], d.pop("condition")) + + + size = cast(list[int], d.pop("size")) + + + bid_size = cast(list[int], d.pop("bid_size")) + + + ask_exchange = cast(list[int], d.pop("ask_exchange")) + + + price = cast(list[float], d.pop("price")) + + + ext_condition2 = cast(list[int], d.pop("ext_condition2")) + + + bid_exchange = cast(list[int], d.pop("bid_exchange")) + + + ask = cast(list[float], d.pop("ask")) + + + quote_timestamp = cast(list[str], d.pop("quote_timestamp")) + + + ext_condition1 = cast(list[int], d.pop("ext_condition1")) + + + expiration = cast(list[str], d.pop("expiration")) + + + ext_condition4 = cast(list[int], d.pop("ext_condition4")) + + + exchange = cast(list[int], d.pop("exchange")) + + + ext_condition3 = cast(list[int], d.pop("ext_condition3")) + + + bid = cast(list[float], d.pop("bid")) + + + bid_condition = cast(list[int], d.pop("bid_condition")) + + + option_history_trade_quote_response_200 = cls( + symbol=symbol, + ask_size=ask_size, + trade_timestamp=trade_timestamp, + ask_condition=ask_condition, + strike=strike, + right=right, + sequence=sequence, + condition=condition, + size=size, + bid_size=bid_size, + ask_exchange=ask_exchange, + price=price, + ext_condition2=ext_condition2, + bid_exchange=bid_exchange, + ask=ask, + quote_timestamp=quote_timestamp, + ext_condition1=ext_condition1, + expiration=expiration, + ext_condition4=ext_condition4, + exchange=exchange, + ext_condition3=ext_condition3, + bid=bid, + bid_condition=bid_condition, + ) + + + + option_history_trade_quote_response_200.additional_properties = d + return option_history_trade_quote_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_history_trade_quote_right.py b/openapi_project/openapi_package/models/option_history_trade_quote_right.py new file mode 100644 index 000000000..4e2db3779 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_trade_quote_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryTradeQuoteRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_trade_response_200.py b/openapi_project/openapi_package/models/option_history_trade_response_200.py new file mode 100644 index 000000000..71fe29215 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_trade_response_200.py @@ -0,0 +1,227 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionHistoryTradeResponse200") + + + +@_attrs_define +class OptionHistoryTradeResponse200: + """ + Attributes: + symbol (list[str]): + strike (list[float]): + right (list[str]): + sequence (list[int]): + condition (list[int]): + size (list[int]): + price (list[float]): + ext_condition2 (list[int]): + ext_condition1 (list[int]): + expiration (list[str]): + ext_condition4 (list[int]): + exchange (list[int]): + ext_condition3 (list[int]): + timestamp (list[str]): + """ + + symbol: list[str] + strike: list[float] + right: list[str] + sequence: list[int] + condition: list[int] + size: list[int] + price: list[float] + ext_condition2: list[int] + ext_condition1: list[int] + expiration: list[str] + ext_condition4: list[int] + exchange: list[int] + ext_condition3: list[int] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + strike = self.strike + + + + right = self.right + + + + sequence = self.sequence + + + + condition = self.condition + + + + size = self.size + + + + price = self.price + + + + ext_condition2 = self.ext_condition2 + + + + ext_condition1 = self.ext_condition1 + + + + expiration = self.expiration + + + + ext_condition4 = self.ext_condition4 + + + + exchange = self.exchange + + + + ext_condition3 = self.ext_condition3 + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "strike": strike, + "right": right, + "sequence": sequence, + "condition": condition, + "size": size, + "price": price, + "ext_condition2": ext_condition2, + "ext_condition1": ext_condition1, + "expiration": expiration, + "ext_condition4": ext_condition4, + "exchange": exchange, + "ext_condition3": ext_condition3, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + strike = cast(list[float], d.pop("strike")) + + + right = cast(list[str], d.pop("right")) + + + sequence = cast(list[int], d.pop("sequence")) + + + condition = cast(list[int], d.pop("condition")) + + + size = cast(list[int], d.pop("size")) + + + price = cast(list[float], d.pop("price")) + + + ext_condition2 = cast(list[int], d.pop("ext_condition2")) + + + ext_condition1 = cast(list[int], d.pop("ext_condition1")) + + + expiration = cast(list[str], d.pop("expiration")) + + + ext_condition4 = cast(list[int], d.pop("ext_condition4")) + + + exchange = cast(list[int], d.pop("exchange")) + + + ext_condition3 = cast(list[int], d.pop("ext_condition3")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + option_history_trade_response_200 = cls( + symbol=symbol, + strike=strike, + right=right, + sequence=sequence, + condition=condition, + size=size, + price=price, + ext_condition2=ext_condition2, + ext_condition1=ext_condition1, + expiration=expiration, + ext_condition4=ext_condition4, + exchange=exchange, + ext_condition3=ext_condition3, + timestamp=timestamp, + ) + + + + option_history_trade_response_200.additional_properties = d + return option_history_trade_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_history_trade_right.py b/openapi_project/openapi_package/models/option_history_trade_right.py new file mode 100644 index 000000000..7a8e374f4 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_trade_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionHistoryTradeRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_list_contracts_format.py b/openapi_project/openapi_package/models/option_list_contracts_format.py new file mode 100644 index 000000000..8ec488a8c --- /dev/null +++ b/openapi_project/openapi_package/models/option_list_contracts_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionListContractsFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_list_contracts_request_type.py b/openapi_project/openapi_package/models/option_list_contracts_request_type.py new file mode 100644 index 000000000..90f0de3a2 --- /dev/null +++ b/openapi_project/openapi_package/models/option_list_contracts_request_type.py @@ -0,0 +1,8 @@ +from enum import Enum + +class OptionListContractsRequestType(str, Enum): + QUOTE = "quote" + TRADE = "trade" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_list_contracts_response_200.py b/openapi_project/openapi_package/models/option_list_contracts_response_200.py new file mode 100644 index 000000000..55266c1ba --- /dev/null +++ b/openapi_project/openapi_package/models/option_list_contracts_response_200.py @@ -0,0 +1,117 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionListContractsResponse200") + + + +@_attrs_define +class OptionListContractsResponse200: + """ + Attributes: + symbol (list[str]): + strike (list[float]): + expiration (list[str]): + right (list[str]): + """ + + symbol: list[str] + strike: list[float] + expiration: list[str] + right: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + strike = self.strike + + + + expiration = self.expiration + + + + right = self.right + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "strike": strike, + "expiration": expiration, + "right": right, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + strike = cast(list[float], d.pop("strike")) + + + expiration = cast(list[str], d.pop("expiration")) + + + right = cast(list[str], d.pop("right")) + + + option_list_contracts_response_200 = cls( + symbol=symbol, + strike=strike, + expiration=expiration, + right=right, + ) + + + + option_list_contracts_response_200.additional_properties = d + return option_list_contracts_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_list_dates_format.py b/openapi_project/openapi_package/models/option_list_dates_format.py new file mode 100644 index 000000000..0665cc5fc --- /dev/null +++ b/openapi_project/openapi_package/models/option_list_dates_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionListDatesFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_list_dates_request_type.py b/openapi_project/openapi_package/models/option_list_dates_request_type.py new file mode 100644 index 000000000..9caf17593 --- /dev/null +++ b/openapi_project/openapi_package/models/option_list_dates_request_type.py @@ -0,0 +1,8 @@ +from enum import Enum + +class OptionListDatesRequestType(str, Enum): + QUOTE = "quote" + TRADE = "trade" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_list_dates_response_200.py b/openapi_project/openapi_package/models/option_list_dates_response_200.py new file mode 100644 index 000000000..165e2aacb --- /dev/null +++ b/openapi_project/openapi_package/models/option_list_dates_response_200.py @@ -0,0 +1,128 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionListDatesResponse200") + + + +@_attrs_define +class OptionListDatesResponse200: + """ + Attributes: + date (list[str]): + symbol (list[str]): + strike (list[float]): + expiration (list[str]): + right (list[str]): + """ + + date: list[str] + symbol: list[str] + strike: list[float] + expiration: list[str] + right: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + date = self.date + + + + symbol = self.symbol + + + + strike = self.strike + + + + expiration = self.expiration + + + + right = self.right + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "date": date, + "symbol": symbol, + "strike": strike, + "expiration": expiration, + "right": right, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + date = cast(list[str], d.pop("date")) + + + symbol = cast(list[str], d.pop("symbol")) + + + strike = cast(list[float], d.pop("strike")) + + + expiration = cast(list[str], d.pop("expiration")) + + + right = cast(list[str], d.pop("right")) + + + option_list_dates_response_200 = cls( + date=date, + symbol=symbol, + strike=strike, + expiration=expiration, + right=right, + ) + + + + option_list_dates_response_200.additional_properties = d + return option_list_dates_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_list_dates_right.py b/openapi_project/openapi_package/models/option_list_dates_right.py new file mode 100644 index 000000000..c56cfe3e0 --- /dev/null +++ b/openapi_project/openapi_package/models/option_list_dates_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionListDatesRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_list_expirations_format.py b/openapi_project/openapi_package/models/option_list_expirations_format.py new file mode 100644 index 000000000..bcaa18977 --- /dev/null +++ b/openapi_project/openapi_package/models/option_list_expirations_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionListExpirationsFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_list_expirations_response_200.py b/openapi_project/openapi_package/models/option_list_expirations_response_200.py new file mode 100644 index 000000000..b739557f4 --- /dev/null +++ b/openapi_project/openapi_package/models/option_list_expirations_response_200.py @@ -0,0 +1,95 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionListExpirationsResponse200") + + + +@_attrs_define +class OptionListExpirationsResponse200: + """ + Attributes: + symbol (list[str]): + expiration (list[str]): + """ + + symbol: list[str] + expiration: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + expiration = self.expiration + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "expiration": expiration, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + expiration = cast(list[str], d.pop("expiration")) + + + option_list_expirations_response_200 = cls( + symbol=symbol, + expiration=expiration, + ) + + + + option_list_expirations_response_200.additional_properties = d + return option_list_expirations_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_list_strikes_format.py b/openapi_project/openapi_package/models/option_list_strikes_format.py new file mode 100644 index 000000000..351c527b4 --- /dev/null +++ b/openapi_project/openapi_package/models/option_list_strikes_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionListStrikesFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_list_strikes_response_200.py b/openapi_project/openapi_package/models/option_list_strikes_response_200.py new file mode 100644 index 000000000..a1e107a8b --- /dev/null +++ b/openapi_project/openapi_package/models/option_list_strikes_response_200.py @@ -0,0 +1,95 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionListStrikesResponse200") + + + +@_attrs_define +class OptionListStrikesResponse200: + """ + Attributes: + symbol (list[str]): + strike (list[float]): + """ + + symbol: list[str] + strike: list[float] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + strike = self.strike + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "strike": strike, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + strike = cast(list[float], d.pop("strike")) + + + option_list_strikes_response_200 = cls( + symbol=symbol, + strike=strike, + ) + + + + option_list_strikes_response_200.additional_properties = d + return option_list_strikes_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_list_symbols_format.py b/openapi_project/openapi_package/models/option_list_symbols_format.py new file mode 100644 index 000000000..43ee88473 --- /dev/null +++ b/openapi_project/openapi_package/models/option_list_symbols_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionListSymbolsFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_list_symbols_response_200.py b/openapi_project/openapi_package/models/option_list_symbols_response_200.py new file mode 100644 index 000000000..ef5f510e0 --- /dev/null +++ b/openapi_project/openapi_package/models/option_list_symbols_response_200.py @@ -0,0 +1,84 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionListSymbolsResponse200") + + + +@_attrs_define +class OptionListSymbolsResponse200: + """ + Attributes: + symbol (list[str]): + """ + + symbol: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + option_list_symbols_response_200 = cls( + symbol=symbol, + ) + + + + option_list_symbols_response_200.additional_properties = d + return option_list_symbols_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_root.py b/openapi_project/openapi_package/models/option_root.py deleted file mode 100644 index 73e8e7f0d..000000000 --- a/openapi_project/openapi_package/models/option_root.py +++ /dev/null @@ -1,421 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.models.exchange_code import ExchangeCode -from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat -from openapi_project.openapi_package.models.option_exercise_style import OptionExerciseStyle -from openapi_project.openapi_package.models.option_series_product_type import OptionSeriesProductType -from openapi_project.openapi_package.models.option_series_type import OptionSeriesType -from openapi_project.openapi_package.models.option_settlement_type import OptionSettlementType -from openapi_project.openapi_package.models.security_category import SecurityCategory -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.trading_session_group import TradingSessionGroup - from openapi_project.openapi_package.models.settlement_info import SettlementInfo - from openapi_project.openapi_package.models.option_root_aliases import OptionRootAliases - from openapi_project.openapi_package.models.date import Date - - -T = TypeVar("T", bound="OptionRoot") - - -@_attrs_define -class OptionRoot: - """ - Attributes: - aliases (Unset | OptionRootAliases): - currency (Unset | Currency): - listed_dt (Unset | Date): - delisted_dt (Unset | Date): - description (Unset | str): - exchange_id (Unset | int): - id_ (Unset | int): - multiplier (Unset | float): - price_base_factor (Unset | float): - price_display_factor (Unset | float): - price_display_format (Unset | NumericDisplayFormat): - qty_display_factor (Unset | float): - qty_display_format (Unset | NumericDisplayFormat): - security_category (Unset | SecurityCategory): - symbol (Unset | str): - tick_rule (Unset | str): - tick_size (Unset | float): - tick_value (Unset | float): - traded_exchanges (Unset | list[ExchangeCode]): - deliverable_per_contract (Unset | float): - exercise_style (Unset | OptionExerciseStyle): - product_type (Unset | OptionSeriesProductType): - series_type (Unset | OptionSeriesType): - settlement_infos (Unset | list[SettlementInfo]): - settlement_type (Unset | OptionSettlementType): - strike_multiplier (Unset | float): - strike_value (Unset | float): - trading_session_group (Unset | TradingSessionGroup): - underlying (Unset | str): - """ - - aliases: Unset | OptionRootAliases = UNSET - currency: Unset | Currency = UNSET - listed_dt: Unset | Date = UNSET - delisted_dt: Unset | Date = UNSET - description: Unset | str = UNSET - exchange_id: Unset | int = UNSET - id_: Unset | int = UNSET - multiplier: Unset | float = UNSET - price_base_factor: Unset | float = UNSET - price_display_factor: Unset | float = UNSET - price_display_format: Unset | NumericDisplayFormat = UNSET - qty_display_factor: Unset | float = UNSET - qty_display_format: Unset | NumericDisplayFormat = UNSET - security_category: Unset | SecurityCategory = UNSET - symbol: Unset | str = UNSET - tick_rule: Unset | str = UNSET - tick_size: Unset | float = UNSET - tick_value: Unset | float = UNSET - traded_exchanges: Unset | list[ExchangeCode] = UNSET - deliverable_per_contract: Unset | float = UNSET - exercise_style: Unset | OptionExerciseStyle = UNSET - product_type: Unset | OptionSeriesProductType = UNSET - series_type: Unset | OptionSeriesType = UNSET - settlement_infos: Unset | list[SettlementInfo] = UNSET - settlement_type: Unset | OptionSettlementType = UNSET - strike_multiplier: Unset | float = UNSET - strike_value: Unset | float = UNSET - trading_session_group: Unset | TradingSessionGroup = UNSET - underlying: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = ( - UNSET if isinstance(self.aliases, Unset) else self.aliases.to_dict() - ) - - currency: Unset | str = ( - UNSET if isinstance(self.currency, Unset) else self.currency.value - ) - - listed_dt: Unset | dict[str, Any] = ( - UNSET if isinstance(self.listed_dt, Unset) else self.listed_dt.to_dict() - ) - - delisted_dt: Unset | dict[str, Any] = ( - UNSET if isinstance(self.delisted_dt, Unset) else self.delisted_dt.to_dict() - ) - - description = self.description - - exchange_id = self.exchange_id - - id_ = self.id_ - - multiplier = self.multiplier - - price_base_factor = self.price_base_factor - - price_display_factor = self.price_display_factor - - price_display_format: Unset | str = ( - UNSET - if isinstance(self.price_display_format, Unset) - else self.price_display_format.value - ) - - qty_display_factor = self.qty_display_factor - - qty_display_format: Unset | str = ( - UNSET - if isinstance(self.qty_display_format, Unset) - else self.qty_display_format.value - ) - - security_category: Unset | str = ( - UNSET - if isinstance(self.security_category, Unset) - else self.security_category.value - ) - - symbol = self.symbol - - tick_rule = self.tick_rule - - tick_size = self.tick_size - - tick_value = self.tick_value - - traded_exchanges: Unset | list[str] = UNSET - if not isinstance(self.traded_exchanges, Unset): - traded_exchanges = [] - for traded_exchanges_item_data in self.traded_exchanges: - traded_exchanges_item = traded_exchanges_item_data.value - traded_exchanges.append(traded_exchanges_item) - - deliverable_per_contract = self.deliverable_per_contract - - exercise_style: Unset | str = ( - UNSET - if isinstance(self.exercise_style, Unset) - else self.exercise_style.value - ) - - product_type: Unset | str = ( - UNSET if isinstance(self.product_type, Unset) else self.product_type.value - ) - - series_type: Unset | str = ( - UNSET if isinstance(self.series_type, Unset) else self.series_type.value - ) - - settlement_infos: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.settlement_infos, Unset): - settlement_infos = [] - for settlement_infos_item_data in self.settlement_infos: - settlement_infos_item = settlement_infos_item_data.to_dict() - settlement_infos.append(settlement_infos_item) - - settlement_type: Unset | str = ( - UNSET - if isinstance(self.settlement_type, Unset) - else self.settlement_type.value - ) - - strike_multiplier = self.strike_multiplier - - strike_value = self.strike_value - - trading_session_group: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.trading_session_group, Unset) - else self.trading_session_group.to_dict() - ) - - underlying = self.underlying - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if aliases is not UNSET: - field_dict["aliases"] = aliases - if currency is not UNSET: - field_dict["currency"] = currency - if listed_dt is not UNSET: - field_dict["listedDt"] = listed_dt - if delisted_dt is not UNSET: - field_dict["delistedDt"] = delisted_dt - if description is not UNSET: - field_dict["description"] = description - if exchange_id is not UNSET: - field_dict["exchangeId"] = exchange_id - if id_ is not UNSET: - field_dict["id"] = id - if multiplier is not UNSET: - field_dict["multiplier"] = multiplier - if price_base_factor is not UNSET: - field_dict["priceBaseFactor"] = price_base_factor - if price_display_factor is not UNSET: - field_dict["priceDisplayFactor"] = price_display_factor - if price_display_format is not UNSET: - field_dict["priceDisplayFormat"] = price_display_format - if qty_display_factor is not UNSET: - field_dict["qtyDisplayFactor"] = qty_display_factor - if qty_display_format is not UNSET: - field_dict["qtyDisplayFormat"] = qty_display_format - if security_category is not UNSET: - field_dict["securityCategory"] = security_category - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tick_rule is not UNSET: - field_dict["tickRule"] = tick_rule - if tick_size is not UNSET: - field_dict["tickSize"] = tick_size - if tick_value is not UNSET: - field_dict["tickValue"] = tick_value - if traded_exchanges is not UNSET: - field_dict["tradedExchanges"] = traded_exchanges - if deliverable_per_contract is not UNSET: - field_dict["deliverablePerContract"] = deliverable_per_contract - if exercise_style is not UNSET: - field_dict["exerciseStyle"] = exercise_style - if product_type is not UNSET: - field_dict["productType"] = product_type - if series_type is not UNSET: - field_dict["seriesType"] = series_type - if settlement_infos is not UNSET: - field_dict["settlementInfos"] = settlement_infos - if settlement_type is not UNSET: - field_dict["settlementType"] = settlement_type - if strike_multiplier is not UNSET: - field_dict["strikeMultiplier"] = strike_multiplier - if strike_value is not UNSET: - field_dict["strikeValue"] = strike_value - if trading_session_group is not UNSET: - field_dict["tradingSessionGroup"] = trading_session_group - if underlying is not UNSET: - field_dict["underlying"] = underlying - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _aliases = d.pop("aliases", UNSET) - aliases: Unset | OptionRootAliases = ( - UNSET - if isinstance(_aliases, Unset) - else OptionRootAliases.from_dict(_aliases) - ) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency = ( - UNSET if isinstance(_currency, Unset) else Currency(_currency) - ) - - _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date = ( - UNSET if isinstance(_listed_dt, Unset) else Date.from_dict(_listed_dt) - ) - - _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date = ( - UNSET if isinstance(_delisted_dt, Unset) else Date.from_dict(_delisted_dt) - ) - - description = d.pop("description", UNSET) - - exchange_id = d.pop("exchangeId", UNSET) - - id_ = d.pop("id", UNSET) - - multiplier = d.pop("multiplier", UNSET) - - price_base_factor = d.pop("priceBaseFactor", UNSET) - - price_display_factor = d.pop("priceDisplayFactor", UNSET) - - _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat = ( - UNSET - if isinstance(_price_display_format, Unset) - else NumericDisplayFormat(_price_display_format) - ) - - qty_display_factor = d.pop("qtyDisplayFactor", UNSET) - - _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat = ( - UNSET - if isinstance(_qty_display_format, Unset) - else NumericDisplayFormat(_qty_display_format) - ) - - _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory = ( - UNSET - if isinstance(_security_category, Unset) - else SecurityCategory(_security_category) - ) - - symbol = d.pop("symbol", UNSET) - - tick_rule = d.pop("tickRule", UNSET) - - tick_size = d.pop("tickSize", UNSET) - - tick_value = d.pop("tickValue", UNSET) - - traded_exchanges = [] - _traded_exchanges = d.pop("tradedExchanges", UNSET) - for traded_exchanges_item_data in _traded_exchanges or []: - traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) - - traded_exchanges.append(traded_exchanges_item) - - deliverable_per_contract = d.pop("deliverablePerContract", UNSET) - - _exercise_style = d.pop("exerciseStyle", UNSET) - exercise_style: Unset | OptionExerciseStyle = ( - UNSET - if isinstance(_exercise_style, Unset) - else OptionExerciseStyle(_exercise_style) - ) - - _product_type = d.pop("productType", UNSET) - product_type: Unset | OptionSeriesProductType = ( - UNSET - if isinstance(_product_type, Unset) - else OptionSeriesProductType(_product_type) - ) - - _series_type = d.pop("seriesType", UNSET) - series_type: Unset | OptionSeriesType = ( - UNSET if isinstance(_series_type, Unset) else OptionSeriesType(_series_type) - ) - - settlement_infos = [] - _settlement_infos = d.pop("settlementInfos", UNSET) - for settlement_infos_item_data in _settlement_infos or []: - settlement_infos_item = SettlementInfo.from_dict(settlement_infos_item_data) - - settlement_infos.append(settlement_infos_item) - - _settlement_type = d.pop("settlementType", UNSET) - settlement_type: Unset | OptionSettlementType = ( - UNSET - if isinstance(_settlement_type, Unset) - else OptionSettlementType(_settlement_type) - ) - - strike_multiplier = d.pop("strikeMultiplier", UNSET) - - strike_value = d.pop("strikeValue", UNSET) - - _trading_session_group = d.pop("tradingSessionGroup", UNSET) - trading_session_group: Unset | TradingSessionGroup = ( - UNSET - if isinstance(_trading_session_group, Unset) - else TradingSessionGroup.from_dict(_trading_session_group) - ) - - underlying = d.pop("underlying", UNSET) - - option_root = cls( - aliases=aliases, - currency=currency, - listed_dt=listed_dt, - delisted_dt=delisted_dt, - description=description, - exchange_id=exchange_id, - id_=id_, - multiplier=multiplier, - price_base_factor=price_base_factor, - price_display_factor=price_display_factor, - price_display_format=price_display_format, - qty_display_factor=qty_display_factor, - qty_display_format=qty_display_format, - security_category=security_category, - symbol=symbol, - tick_rule=tick_rule, - tick_size=tick_size, - tick_value=tick_value, - traded_exchanges=traded_exchanges, - deliverable_per_contract=deliverable_per_contract, - exercise_style=exercise_style, - product_type=product_type, - series_type=series_type, - settlement_infos=settlement_infos, - settlement_type=settlement_type, - strike_multiplier=strike_multiplier, - strike_value=strike_value, - trading_session_group=trading_session_group, - underlying=underlying, - ) - - return option_root diff --git a/openapi_project/openapi_package/models/option_root_aliases.py b/openapi_project/openapi_package/models/option_root_aliases.py deleted file mode 100644 index 2df24a7ba..000000000 --- a/openapi_project/openapi_package/models/option_root_aliases.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="OptionRootAliases") - - -@_attrs_define -class OptionRootAliases: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - option_root_aliases = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - option_root_aliases.additional_properties = additional_properties - return option_root_aliases - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_series.py b/openapi_project/openapi_package/models/option_series.py deleted file mode 100644 index 89caa037d..000000000 --- a/openapi_project/openapi_package/models/option_series.py +++ /dev/null @@ -1,239 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat -from openapi_project.openapi_package.models.option_expiration_style import OptionExpirationStyle -from openapi_project.openapi_package.models.option_series_type import OptionSeriesType -from openapi_project.openapi_package.models.option_settlement_type import OptionSettlementType -from openapi_project.openapi_package.models.security_category import SecurityCategory -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.date import Date - - -T = TypeVar("T", bound="OptionSeries") - - -@_attrs_define -class OptionSeries: - """ - Attributes: - expiration_dt (Unset | Date): - expiration_style (Unset | OptionExpirationStyle): - root_symbol (Unset | str): - series_type (Unset | OptionSeriesType): - settlement_type (Unset | OptionSettlementType): - option_symbols (Unset | list[str]): - currency (Unset | Currency): - multiplier (Unset | float): - price_base_factor (Unset | float): - price_display_factor (Unset | float): - price_display_format (Unset | NumericDisplayFormat): - qty_display_factor (Unset | float): - qty_display_format (Unset | NumericDisplayFormat): - security_category (Unset | SecurityCategory): - """ - - expiration_dt: Unset | Date = UNSET - expiration_style: Unset | OptionExpirationStyle = UNSET - root_symbol: Unset | str = UNSET - series_type: Unset | OptionSeriesType = UNSET - settlement_type: Unset | OptionSettlementType = UNSET - option_symbols: Unset | list[str] = UNSET - currency: Unset | Currency = UNSET - multiplier: Unset | float = UNSET - price_base_factor: Unset | float = UNSET - price_display_factor: Unset | float = UNSET - price_display_format: Unset | NumericDisplayFormat = UNSET - qty_display_factor: Unset | float = UNSET - qty_display_format: Unset | NumericDisplayFormat = UNSET - security_category: Unset | SecurityCategory = UNSET - - def to_dict(self) -> dict[str, Any]: - expiration_dt: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.expiration_dt, Unset) - else self.expiration_dt.to_dict() - ) - - expiration_style: Unset | str = ( - UNSET - if isinstance(self.expiration_style, Unset) - else self.expiration_style.value - ) - - root_symbol = self.root_symbol - - series_type: Unset | str = ( - UNSET if isinstance(self.series_type, Unset) else self.series_type.value - ) - - settlement_type: Unset | str = ( - UNSET - if isinstance(self.settlement_type, Unset) - else self.settlement_type.value - ) - - option_symbols: Unset | list[str] = UNSET - if not isinstance(self.option_symbols, Unset): - option_symbols = self.option_symbols - - currency: Unset | str = ( - UNSET if isinstance(self.currency, Unset) else self.currency.value - ) - - multiplier = self.multiplier - - price_base_factor = self.price_base_factor - - price_display_factor = self.price_display_factor - - price_display_format: Unset | str = ( - UNSET - if isinstance(self.price_display_format, Unset) - else self.price_display_format.value - ) - - qty_display_factor = self.qty_display_factor - - qty_display_format: Unset | str = ( - UNSET - if isinstance(self.qty_display_format, Unset) - else self.qty_display_format.value - ) - - security_category: Unset | str = ( - UNSET - if isinstance(self.security_category, Unset) - else self.security_category.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if expiration_dt is not UNSET: - field_dict["expirationDt"] = expiration_dt - if expiration_style is not UNSET: - field_dict["expirationStyle"] = expiration_style - if root_symbol is not UNSET: - field_dict["rootSymbol"] = root_symbol - if series_type is not UNSET: - field_dict["seriesType"] = series_type - if settlement_type is not UNSET: - field_dict["settlementType"] = settlement_type - if option_symbols is not UNSET: - field_dict["optionSymbols"] = option_symbols - if currency is not UNSET: - field_dict["currency"] = currency - if multiplier is not UNSET: - field_dict["multiplier"] = multiplier - if price_base_factor is not UNSET: - field_dict["priceBaseFactor"] = price_base_factor - if price_display_factor is not UNSET: - field_dict["priceDisplayFactor"] = price_display_factor - if price_display_format is not UNSET: - field_dict["priceDisplayFormat"] = price_display_format - if qty_display_factor is not UNSET: - field_dict["qtyDisplayFactor"] = qty_display_factor - if qty_display_format is not UNSET: - field_dict["qtyDisplayFormat"] = qty_display_format - if security_category is not UNSET: - field_dict["securityCategory"] = security_category - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _expiration_dt = d.pop("expirationDt", UNSET) - expiration_dt: Unset | Date = ( - UNSET - if isinstance(_expiration_dt, Unset) - else Date.from_dict(_expiration_dt) - ) - - _expiration_style = d.pop("expirationStyle", UNSET) - expiration_style: Unset | OptionExpirationStyle = ( - UNSET - if isinstance(_expiration_style, Unset) - else OptionExpirationStyle(_expiration_style) - ) - - root_symbol = d.pop("rootSymbol", UNSET) - - _series_type = d.pop("seriesType", UNSET) - series_type: Unset | OptionSeriesType = ( - UNSET if isinstance(_series_type, Unset) else OptionSeriesType(_series_type) - ) - - _settlement_type = d.pop("settlementType", UNSET) - settlement_type: Unset | OptionSettlementType = ( - UNSET - if isinstance(_settlement_type, Unset) - else OptionSettlementType(_settlement_type) - ) - - option_symbols = cast(list[str], d.pop("optionSymbols", UNSET)) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency = ( - UNSET if isinstance(_currency, Unset) else Currency(_currency) - ) - - multiplier = d.pop("multiplier", UNSET) - - price_base_factor = d.pop("priceBaseFactor", UNSET) - - price_display_factor = d.pop("priceDisplayFactor", UNSET) - - _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat = ( - UNSET - if isinstance(_price_display_format, Unset) - else NumericDisplayFormat(_price_display_format) - ) - - qty_display_factor = d.pop("qtyDisplayFactor", UNSET) - - _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat = ( - UNSET - if isinstance(_qty_display_format, Unset) - else NumericDisplayFormat(_qty_display_format) - ) - - _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory = ( - UNSET - if isinstance(_security_category, Unset) - else SecurityCategory(_security_category) - ) - - option_series = cls( - expiration_dt=expiration_dt, - expiration_style=expiration_style, - root_symbol=root_symbol, - series_type=series_type, - settlement_type=settlement_type, - option_symbols=option_symbols, - currency=currency, - multiplier=multiplier, - price_base_factor=price_base_factor, - price_display_factor=price_display_factor, - price_display_format=price_display_format, - qty_display_factor=qty_display_factor, - qty_display_format=qty_display_format, - security_category=security_category, - ) - - return option_series diff --git a/openapi_project/openapi_package/models/option_series_product_type.py b/openapi_project/openapi_package/models/option_series_product_type.py deleted file mode 100644 index 5fed3ad30..000000000 --- a/openapi_project/openapi_package/models/option_series_product_type.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class OptionSeriesProductType(str, Enum): - OPTION_SERIES_PRODUCT_TYPE_MICRO = "OPTION_SERIES_PRODUCT_TYPE_MICRO" - OPTION_SERIES_PRODUCT_TYPE_STANDARD = "OPTION_SERIES_PRODUCT_TYPE_STANDARD" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/option_series_type.py b/openapi_project/openapi_package/models/option_series_type.py deleted file mode 100644 index 44b47e8ea..000000000 --- a/openapi_project/openapi_package/models/option_series_type.py +++ /dev/null @@ -1,13 +0,0 @@ -from enum import Enum - - -class OptionSeriesType(str, Enum): - OPTION_SERIES_TYPE_BINARY = "OPTION_SERIES_TYPE_BINARY" - OPTION_SERIES_TYPE_FLEX = "OPTION_SERIES_TYPE_FLEX" - OPTION_SERIES_TYPE_LEAP = "OPTION_SERIES_TYPE_LEAP" - OPTION_SERIES_TYPE_RANGE = "OPTION_SERIES_TYPE_RANGE" - OPTION_SERIES_TYPE_STANDARD = "OPTION_SERIES_TYPE_STANDARD" - OPTION_SERIES_TYPE_UNKNOWN = "OPTION_SERIES_TYPE_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/option_settlement_type.py b/openapi_project/openapi_package/models/option_settlement_type.py deleted file mode 100644 index 8ff8df614..000000000 --- a/openapi_project/openapi_package/models/option_settlement_type.py +++ /dev/null @@ -1,12 +0,0 @@ -from enum import Enum - - -class OptionSettlementType(str, Enum): - OPTION_SETTLEMENT_TYPE_AM = "OPTION_SETTLEMENT_TYPE_AM" - OPTION_SETTLEMENT_TYPE_ASIAN = "OPTION_SETTLEMENT_TYPE_ASIAN" - OPTION_SETTLEMENT_TYPE_CLIQUET = "OPTION_SETTLEMENT_TYPE_CLIQUET" - OPTION_SETTLEMENT_TYPE_PM = "OPTION_SETTLEMENT_TYPE_PM" - OPTION_SETTLEMENT_TYPE_UNDEFINED = "OPTION_SETTLEMENT_TYPE_UNDEFINED" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_all_format.py b/openapi_project/openapi_package/models/option_snapshot_greeks_all_format.py new file mode 100644 index 000000000..8ff54ce3a --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_all_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionSnapshotGreeksAllFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_all_rate_type.py b/openapi_project/openapi_package/models/option_snapshot_greeks_all_rate_type.py new file mode 100644 index 000000000..cf07f3e54 --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_all_rate_type.py @@ -0,0 +1,18 @@ +from enum import Enum + +class OptionSnapshotGreeksAllRateType(str, Enum): + SOFR = "sofr" + TREASURY_M1 = "treasury_m1" + TREASURY_M3 = "treasury_m3" + TREASURY_M6 = "treasury_m6" + TREASURY_Y1 = "treasury_y1" + TREASURY_Y10 = "treasury_y10" + TREASURY_Y2 = "treasury_y2" + TREASURY_Y20 = "treasury_y20" + TREASURY_Y3 = "treasury_y3" + TREASURY_Y30 = "treasury_y30" + TREASURY_Y5 = "treasury_y5" + TREASURY_Y7 = "treasury_y7" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_all_response_200.py b/openapi_project/openapi_package/models/option_snapshot_greeks_all_response_200.py new file mode 100644 index 000000000..4d98e2223 --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_all_response_200.py @@ -0,0 +1,414 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionSnapshotGreeksAllResponse200") + + + +@_attrs_define +class OptionSnapshotGreeksAllResponse200: + """ + Attributes: + symbol (list[str]): + dual_delta (list[float]): + color (list[float]): + zomma (list[float]): + delta (list[float]): + implied_vol (list[float]): + theta (list[float]): + d1 (list[float]): + speed (list[float]): + d2 (list[float]): + epsilon (list[float]): + lambda_ (list[float]): + vomma (list[float]): + underlying_timestamp (list[str]): + timestamp (list[str]): + underlying_price (list[float]): + strike (list[float]): + vera (list[float]): + right (list[str]): + veta (list[float]): + iv_error (list[float]): + ultima (list[float]): + charm (list[float]): + ask (list[float]): + rho (list[float]): + expiration (list[str]): + vanna (list[float]): + dual_gamma (list[float]): + bid (list[float]): + vega (list[float]): + gamma (list[float]): + """ + + symbol: list[str] + dual_delta: list[float] + color: list[float] + zomma: list[float] + delta: list[float] + implied_vol: list[float] + theta: list[float] + d1: list[float] + speed: list[float] + d2: list[float] + epsilon: list[float] + lambda_: list[float] + vomma: list[float] + underlying_timestamp: list[str] + timestamp: list[str] + underlying_price: list[float] + strike: list[float] + vera: list[float] + right: list[str] + veta: list[float] + iv_error: list[float] + ultima: list[float] + charm: list[float] + ask: list[float] + rho: list[float] + expiration: list[str] + vanna: list[float] + dual_gamma: list[float] + bid: list[float] + vega: list[float] + gamma: list[float] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + dual_delta = self.dual_delta + + + + color = self.color + + + + zomma = self.zomma + + + + delta = self.delta + + + + implied_vol = self.implied_vol + + + + theta = self.theta + + + + d1 = self.d1 + + + + speed = self.speed + + + + d2 = self.d2 + + + + epsilon = self.epsilon + + + + lambda_ = self.lambda_ + + + + vomma = self.vomma + + + + underlying_timestamp = self.underlying_timestamp + + + + timestamp = self.timestamp + + + + underlying_price = self.underlying_price + + + + strike = self.strike + + + + vera = self.vera + + + + right = self.right + + + + veta = self.veta + + + + iv_error = self.iv_error + + + + ultima = self.ultima + + + + charm = self.charm + + + + ask = self.ask + + + + rho = self.rho + + + + expiration = self.expiration + + + + vanna = self.vanna + + + + dual_gamma = self.dual_gamma + + + + bid = self.bid + + + + vega = self.vega + + + + gamma = self.gamma + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "dual_delta": dual_delta, + "color": color, + "zomma": zomma, + "delta": delta, + "implied_vol": implied_vol, + "theta": theta, + "d1": d1, + "speed": speed, + "d2": d2, + "epsilon": epsilon, + "lambda": lambda_, + "vomma": vomma, + "underlying_timestamp": underlying_timestamp, + "timestamp": timestamp, + "underlying_price": underlying_price, + "strike": strike, + "vera": vera, + "right": right, + "veta": veta, + "iv_error": iv_error, + "ultima": ultima, + "charm": charm, + "ask": ask, + "rho": rho, + "expiration": expiration, + "vanna": vanna, + "dual_gamma": dual_gamma, + "bid": bid, + "vega": vega, + "gamma": gamma, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + dual_delta = cast(list[float], d.pop("dual_delta")) + + + color = cast(list[float], d.pop("color")) + + + zomma = cast(list[float], d.pop("zomma")) + + + delta = cast(list[float], d.pop("delta")) + + + implied_vol = cast(list[float], d.pop("implied_vol")) + + + theta = cast(list[float], d.pop("theta")) + + + d1 = cast(list[float], d.pop("d1")) + + + speed = cast(list[float], d.pop("speed")) + + + d2 = cast(list[float], d.pop("d2")) + + + epsilon = cast(list[float], d.pop("epsilon")) + + + lambda_ = cast(list[float], d.pop("lambda")) + + + vomma = cast(list[float], d.pop("vomma")) + + + underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + underlying_price = cast(list[float], d.pop("underlying_price")) + + + strike = cast(list[float], d.pop("strike")) + + + vera = cast(list[float], d.pop("vera")) + + + right = cast(list[str], d.pop("right")) + + + veta = cast(list[float], d.pop("veta")) + + + iv_error = cast(list[float], d.pop("iv_error")) + + + ultima = cast(list[float], d.pop("ultima")) + + + charm = cast(list[float], d.pop("charm")) + + + ask = cast(list[float], d.pop("ask")) + + + rho = cast(list[float], d.pop("rho")) + + + expiration = cast(list[str], d.pop("expiration")) + + + vanna = cast(list[float], d.pop("vanna")) + + + dual_gamma = cast(list[float], d.pop("dual_gamma")) + + + bid = cast(list[float], d.pop("bid")) + + + vega = cast(list[float], d.pop("vega")) + + + gamma = cast(list[float], d.pop("gamma")) + + + option_snapshot_greeks_all_response_200 = cls( + symbol=symbol, + dual_delta=dual_delta, + color=color, + zomma=zomma, + delta=delta, + implied_vol=implied_vol, + theta=theta, + d1=d1, + speed=speed, + d2=d2, + epsilon=epsilon, + lambda_=lambda_, + vomma=vomma, + underlying_timestamp=underlying_timestamp, + timestamp=timestamp, + underlying_price=underlying_price, + strike=strike, + vera=vera, + right=right, + veta=veta, + iv_error=iv_error, + ultima=ultima, + charm=charm, + ask=ask, + rho=rho, + expiration=expiration, + vanna=vanna, + dual_gamma=dual_gamma, + bid=bid, + vega=vega, + gamma=gamma, + ) + + + + option_snapshot_greeks_all_response_200.additional_properties = d + return option_snapshot_greeks_all_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_all_right.py b/openapi_project/openapi_package/models/option_snapshot_greeks_all_right.py new file mode 100644 index 000000000..cedc0aa94 --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_all_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionSnapshotGreeksAllRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_first_order_format.py b/openapi_project/openapi_package/models/option_snapshot_greeks_first_order_format.py new file mode 100644 index 000000000..9ab441ba2 --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_first_order_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionSnapshotGreeksFirstOrderFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_first_order_rate_type.py b/openapi_project/openapi_package/models/option_snapshot_greeks_first_order_rate_type.py new file mode 100644 index 000000000..89a1ee0bf --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_first_order_rate_type.py @@ -0,0 +1,18 @@ +from enum import Enum + +class OptionSnapshotGreeksFirstOrderRateType(str, Enum): + SOFR = "sofr" + TREASURY_M1 = "treasury_m1" + TREASURY_M3 = "treasury_m3" + TREASURY_M6 = "treasury_m6" + TREASURY_Y1 = "treasury_y1" + TREASURY_Y10 = "treasury_y10" + TREASURY_Y2 = "treasury_y2" + TREASURY_Y20 = "treasury_y20" + TREASURY_Y3 = "treasury_y3" + TREASURY_Y30 = "treasury_y30" + TREASURY_Y5 = "treasury_y5" + TREASURY_Y7 = "treasury_y7" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_first_order_response_200.py b/openapi_project/openapi_package/models/option_snapshot_greeks_first_order_response_200.py new file mode 100644 index 000000000..fa6a4bafb --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_first_order_response_200.py @@ -0,0 +1,260 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionSnapshotGreeksFirstOrderResponse200") + + + +@_attrs_define +class OptionSnapshotGreeksFirstOrderResponse200: + """ + Attributes: + symbol (list[str]): + underlying_price (list[float]): + strike (list[float]): + delta (list[float]): + right (list[str]): + implied_vol (list[float]): + theta (list[float]): + iv_error (list[float]): + epsilon (list[float]): + lambda_ (list[float]): + ask (list[float]): + rho (list[float]): + expiration (list[str]): + bid (list[float]): + underlying_timestamp (list[str]): + vega (list[float]): + timestamp (list[str]): + """ + + symbol: list[str] + underlying_price: list[float] + strike: list[float] + delta: list[float] + right: list[str] + implied_vol: list[float] + theta: list[float] + iv_error: list[float] + epsilon: list[float] + lambda_: list[float] + ask: list[float] + rho: list[float] + expiration: list[str] + bid: list[float] + underlying_timestamp: list[str] + vega: list[float] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + underlying_price = self.underlying_price + + + + strike = self.strike + + + + delta = self.delta + + + + right = self.right + + + + implied_vol = self.implied_vol + + + + theta = self.theta + + + + iv_error = self.iv_error + + + + epsilon = self.epsilon + + + + lambda_ = self.lambda_ + + + + ask = self.ask + + + + rho = self.rho + + + + expiration = self.expiration + + + + bid = self.bid + + + + underlying_timestamp = self.underlying_timestamp + + + + vega = self.vega + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "underlying_price": underlying_price, + "strike": strike, + "delta": delta, + "right": right, + "implied_vol": implied_vol, + "theta": theta, + "iv_error": iv_error, + "epsilon": epsilon, + "lambda": lambda_, + "ask": ask, + "rho": rho, + "expiration": expiration, + "bid": bid, + "underlying_timestamp": underlying_timestamp, + "vega": vega, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + underlying_price = cast(list[float], d.pop("underlying_price")) + + + strike = cast(list[float], d.pop("strike")) + + + delta = cast(list[float], d.pop("delta")) + + + right = cast(list[str], d.pop("right")) + + + implied_vol = cast(list[float], d.pop("implied_vol")) + + + theta = cast(list[float], d.pop("theta")) + + + iv_error = cast(list[float], d.pop("iv_error")) + + + epsilon = cast(list[float], d.pop("epsilon")) + + + lambda_ = cast(list[float], d.pop("lambda")) + + + ask = cast(list[float], d.pop("ask")) + + + rho = cast(list[float], d.pop("rho")) + + + expiration = cast(list[str], d.pop("expiration")) + + + bid = cast(list[float], d.pop("bid")) + + + underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) + + + vega = cast(list[float], d.pop("vega")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + option_snapshot_greeks_first_order_response_200 = cls( + symbol=symbol, + underlying_price=underlying_price, + strike=strike, + delta=delta, + right=right, + implied_vol=implied_vol, + theta=theta, + iv_error=iv_error, + epsilon=epsilon, + lambda_=lambda_, + ask=ask, + rho=rho, + expiration=expiration, + bid=bid, + underlying_timestamp=underlying_timestamp, + vega=vega, + timestamp=timestamp, + ) + + + + option_snapshot_greeks_first_order_response_200.additional_properties = d + return option_snapshot_greeks_first_order_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_first_order_right.py b/openapi_project/openapi_package/models/option_snapshot_greeks_first_order_right.py new file mode 100644 index 000000000..fc01ef505 --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_first_order_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionSnapshotGreeksFirstOrderRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_implied_volatility_format.py b/openapi_project/openapi_package/models/option_snapshot_greeks_implied_volatility_format.py new file mode 100644 index 000000000..99fcf1a5c --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_implied_volatility_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionSnapshotGreeksImpliedVolatilityFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_implied_volatility_rate_type.py b/openapi_project/openapi_package/models/option_snapshot_greeks_implied_volatility_rate_type.py new file mode 100644 index 000000000..1457ef18a --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_implied_volatility_rate_type.py @@ -0,0 +1,18 @@ +from enum import Enum + +class OptionSnapshotGreeksImpliedVolatilityRateType(str, Enum): + SOFR = "sofr" + TREASURY_M1 = "treasury_m1" + TREASURY_M3 = "treasury_m3" + TREASURY_M6 = "treasury_m6" + TREASURY_Y1 = "treasury_y1" + TREASURY_Y10 = "treasury_y10" + TREASURY_Y2 = "treasury_y2" + TREASURY_Y20 = "treasury_y20" + TREASURY_Y3 = "treasury_y3" + TREASURY_Y30 = "treasury_y30" + TREASURY_Y5 = "treasury_y5" + TREASURY_Y7 = "treasury_y7" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_implied_volatility_response_200.py b/openapi_project/openapi_package/models/option_snapshot_greeks_implied_volatility_response_200.py new file mode 100644 index 000000000..14acc1f2f --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_implied_volatility_response_200.py @@ -0,0 +1,194 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionSnapshotGreeksImpliedVolatilityResponse200") + + + +@_attrs_define +class OptionSnapshotGreeksImpliedVolatilityResponse200: + """ + Attributes: + symbol (list[str]): + underlying_price (list[float]): + strike (list[float]): + ask (list[float]): + expiration (list[str]): + right (list[str]): + implied_vol (list[float]): + bid (list[float]): + underlying_timestamp (list[str]): + iv_error (list[float]): + timestamp (list[str]): + """ + + symbol: list[str] + underlying_price: list[float] + strike: list[float] + ask: list[float] + expiration: list[str] + right: list[str] + implied_vol: list[float] + bid: list[float] + underlying_timestamp: list[str] + iv_error: list[float] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + underlying_price = self.underlying_price + + + + strike = self.strike + + + + ask = self.ask + + + + expiration = self.expiration + + + + right = self.right + + + + implied_vol = self.implied_vol + + + + bid = self.bid + + + + underlying_timestamp = self.underlying_timestamp + + + + iv_error = self.iv_error + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "underlying_price": underlying_price, + "strike": strike, + "ask": ask, + "expiration": expiration, + "right": right, + "implied_vol": implied_vol, + "bid": bid, + "underlying_timestamp": underlying_timestamp, + "iv_error": iv_error, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + underlying_price = cast(list[float], d.pop("underlying_price")) + + + strike = cast(list[float], d.pop("strike")) + + + ask = cast(list[float], d.pop("ask")) + + + expiration = cast(list[str], d.pop("expiration")) + + + right = cast(list[str], d.pop("right")) + + + implied_vol = cast(list[float], d.pop("implied_vol")) + + + bid = cast(list[float], d.pop("bid")) + + + underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) + + + iv_error = cast(list[float], d.pop("iv_error")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + option_snapshot_greeks_implied_volatility_response_200 = cls( + symbol=symbol, + underlying_price=underlying_price, + strike=strike, + ask=ask, + expiration=expiration, + right=right, + implied_vol=implied_vol, + bid=bid, + underlying_timestamp=underlying_timestamp, + iv_error=iv_error, + timestamp=timestamp, + ) + + + + option_snapshot_greeks_implied_volatility_response_200.additional_properties = d + return option_snapshot_greeks_implied_volatility_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_implied_volatility_right.py b/openapi_project/openapi_package/models/option_snapshot_greeks_implied_volatility_right.py new file mode 100644 index 000000000..734d9afe8 --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_implied_volatility_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionSnapshotGreeksImpliedVolatilityRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_second_order_format.py b/openapi_project/openapi_package/models/option_snapshot_greeks_second_order_format.py new file mode 100644 index 000000000..1d0ef5d57 --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_second_order_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionSnapshotGreeksSecondOrderFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_second_order_rate_type.py b/openapi_project/openapi_package/models/option_snapshot_greeks_second_order_rate_type.py new file mode 100644 index 000000000..a4624ac36 --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_second_order_rate_type.py @@ -0,0 +1,18 @@ +from enum import Enum + +class OptionSnapshotGreeksSecondOrderRateType(str, Enum): + SOFR = "sofr" + TREASURY_M1 = "treasury_m1" + TREASURY_M3 = "treasury_m3" + TREASURY_M6 = "treasury_m6" + TREASURY_Y1 = "treasury_y1" + TREASURY_Y10 = "treasury_y10" + TREASURY_Y2 = "treasury_y2" + TREASURY_Y20 = "treasury_y20" + TREASURY_Y3 = "treasury_y3" + TREASURY_Y30 = "treasury_y30" + TREASURY_Y5 = "treasury_y5" + TREASURY_Y7 = "treasury_y7" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_second_order_response_200.py b/openapi_project/openapi_package/models/option_snapshot_greeks_second_order_response_200.py new file mode 100644 index 000000000..8005c1460 --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_second_order_response_200.py @@ -0,0 +1,249 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionSnapshotGreeksSecondOrderResponse200") + + + +@_attrs_define +class OptionSnapshotGreeksSecondOrderResponse200: + """ + Attributes: + symbol (list[str]): + underlying_price (list[float]): + strike (list[float]): + right (list[str]): + veta (list[float]): + implied_vol (list[float]): + iv_error (list[float]): + charm (list[float]): + ask (list[float]): + expiration (list[str]): + vanna (list[float]): + vomma (list[float]): + bid (list[float]): + underlying_timestamp (list[str]): + gamma (list[float]): + timestamp (list[str]): + """ + + symbol: list[str] + underlying_price: list[float] + strike: list[float] + right: list[str] + veta: list[float] + implied_vol: list[float] + iv_error: list[float] + charm: list[float] + ask: list[float] + expiration: list[str] + vanna: list[float] + vomma: list[float] + bid: list[float] + underlying_timestamp: list[str] + gamma: list[float] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + underlying_price = self.underlying_price + + + + strike = self.strike + + + + right = self.right + + + + veta = self.veta + + + + implied_vol = self.implied_vol + + + + iv_error = self.iv_error + + + + charm = self.charm + + + + ask = self.ask + + + + expiration = self.expiration + + + + vanna = self.vanna + + + + vomma = self.vomma + + + + bid = self.bid + + + + underlying_timestamp = self.underlying_timestamp + + + + gamma = self.gamma + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "underlying_price": underlying_price, + "strike": strike, + "right": right, + "veta": veta, + "implied_vol": implied_vol, + "iv_error": iv_error, + "charm": charm, + "ask": ask, + "expiration": expiration, + "vanna": vanna, + "vomma": vomma, + "bid": bid, + "underlying_timestamp": underlying_timestamp, + "gamma": gamma, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + underlying_price = cast(list[float], d.pop("underlying_price")) + + + strike = cast(list[float], d.pop("strike")) + + + right = cast(list[str], d.pop("right")) + + + veta = cast(list[float], d.pop("veta")) + + + implied_vol = cast(list[float], d.pop("implied_vol")) + + + iv_error = cast(list[float], d.pop("iv_error")) + + + charm = cast(list[float], d.pop("charm")) + + + ask = cast(list[float], d.pop("ask")) + + + expiration = cast(list[str], d.pop("expiration")) + + + vanna = cast(list[float], d.pop("vanna")) + + + vomma = cast(list[float], d.pop("vomma")) + + + bid = cast(list[float], d.pop("bid")) + + + underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) + + + gamma = cast(list[float], d.pop("gamma")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + option_snapshot_greeks_second_order_response_200 = cls( + symbol=symbol, + underlying_price=underlying_price, + strike=strike, + right=right, + veta=veta, + implied_vol=implied_vol, + iv_error=iv_error, + charm=charm, + ask=ask, + expiration=expiration, + vanna=vanna, + vomma=vomma, + bid=bid, + underlying_timestamp=underlying_timestamp, + gamma=gamma, + timestamp=timestamp, + ) + + + + option_snapshot_greeks_second_order_response_200.additional_properties = d + return option_snapshot_greeks_second_order_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_second_order_right.py b/openapi_project/openapi_package/models/option_snapshot_greeks_second_order_right.py new file mode 100644 index 000000000..c2ee3873e --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_second_order_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionSnapshotGreeksSecondOrderRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_third_order_format.py b/openapi_project/openapi_package/models/option_snapshot_greeks_third_order_format.py new file mode 100644 index 000000000..5459766aa --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_third_order_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionSnapshotGreeksThirdOrderFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_third_order_rate_type.py b/openapi_project/openapi_package/models/option_snapshot_greeks_third_order_rate_type.py new file mode 100644 index 000000000..3e7806dcd --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_third_order_rate_type.py @@ -0,0 +1,18 @@ +from enum import Enum + +class OptionSnapshotGreeksThirdOrderRateType(str, Enum): + SOFR = "sofr" + TREASURY_M1 = "treasury_m1" + TREASURY_M3 = "treasury_m3" + TREASURY_M6 = "treasury_m6" + TREASURY_Y1 = "treasury_y1" + TREASURY_Y10 = "treasury_y10" + TREASURY_Y2 = "treasury_y2" + TREASURY_Y20 = "treasury_y20" + TREASURY_Y3 = "treasury_y3" + TREASURY_Y30 = "treasury_y30" + TREASURY_Y5 = "treasury_y5" + TREASURY_Y7 = "treasury_y7" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_third_order_response_200.py b/openapi_project/openapi_package/models/option_snapshot_greeks_third_order_response_200.py new file mode 100644 index 000000000..f704b1b2a --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_third_order_response_200.py @@ -0,0 +1,238 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionSnapshotGreeksThirdOrderResponse200") + + + +@_attrs_define +class OptionSnapshotGreeksThirdOrderResponse200: + """ + Attributes: + symbol (list[str]): + underlying_price (list[float]): + color (list[float]): + strike (list[float]): + zomma (list[float]): + right (list[str]): + implied_vol (list[float]): + iv_error (list[float]): + speed (list[float]): + ultima (list[float]): + ask (list[float]): + expiration (list[str]): + bid (list[float]): + underlying_timestamp (list[str]): + timestamp (list[str]): + """ + + symbol: list[str] + underlying_price: list[float] + color: list[float] + strike: list[float] + zomma: list[float] + right: list[str] + implied_vol: list[float] + iv_error: list[float] + speed: list[float] + ultima: list[float] + ask: list[float] + expiration: list[str] + bid: list[float] + underlying_timestamp: list[str] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + underlying_price = self.underlying_price + + + + color = self.color + + + + strike = self.strike + + + + zomma = self.zomma + + + + right = self.right + + + + implied_vol = self.implied_vol + + + + iv_error = self.iv_error + + + + speed = self.speed + + + + ultima = self.ultima + + + + ask = self.ask + + + + expiration = self.expiration + + + + bid = self.bid + + + + underlying_timestamp = self.underlying_timestamp + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "underlying_price": underlying_price, + "color": color, + "strike": strike, + "zomma": zomma, + "right": right, + "implied_vol": implied_vol, + "iv_error": iv_error, + "speed": speed, + "ultima": ultima, + "ask": ask, + "expiration": expiration, + "bid": bid, + "underlying_timestamp": underlying_timestamp, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + underlying_price = cast(list[float], d.pop("underlying_price")) + + + color = cast(list[float], d.pop("color")) + + + strike = cast(list[float], d.pop("strike")) + + + zomma = cast(list[float], d.pop("zomma")) + + + right = cast(list[str], d.pop("right")) + + + implied_vol = cast(list[float], d.pop("implied_vol")) + + + iv_error = cast(list[float], d.pop("iv_error")) + + + speed = cast(list[float], d.pop("speed")) + + + ultima = cast(list[float], d.pop("ultima")) + + + ask = cast(list[float], d.pop("ask")) + + + expiration = cast(list[str], d.pop("expiration")) + + + bid = cast(list[float], d.pop("bid")) + + + underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + option_snapshot_greeks_third_order_response_200 = cls( + symbol=symbol, + underlying_price=underlying_price, + color=color, + strike=strike, + zomma=zomma, + right=right, + implied_vol=implied_vol, + iv_error=iv_error, + speed=speed, + ultima=ultima, + ask=ask, + expiration=expiration, + bid=bid, + underlying_timestamp=underlying_timestamp, + timestamp=timestamp, + ) + + + + option_snapshot_greeks_third_order_response_200.additional_properties = d + return option_snapshot_greeks_third_order_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_third_order_right.py b/openapi_project/openapi_package/models/option_snapshot_greeks_third_order_right.py new file mode 100644 index 000000000..c12a89af4 --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_third_order_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionSnapshotGreeksThirdOrderRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_ohlc_format.py b/openapi_project/openapi_package/models/option_snapshot_ohlc_format.py new file mode 100644 index 000000000..2a73df2a0 --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_ohlc_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionSnapshotOhlcFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_ohlc_response_200.py b/openapi_project/openapi_package/models/option_snapshot_ohlc_response_200.py new file mode 100644 index 000000000..3023f862d --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_ohlc_response_200.py @@ -0,0 +1,194 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionSnapshotOhlcResponse200") + + + +@_attrs_define +class OptionSnapshotOhlcResponse200: + """ + Attributes: + volume (list[int]): + symbol (list[str]): + high (list[float]): + low (list[float]): + strike (list[float]): + count (list[int]): + expiration (list[str]): + right (list[str]): + close (list[float]): + open_ (list[float]): + timestamp (list[str]): + """ + + volume: list[int] + symbol: list[str] + high: list[float] + low: list[float] + strike: list[float] + count: list[int] + expiration: list[str] + right: list[str] + close: list[float] + open_: list[float] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + volume = self.volume + + + + symbol = self.symbol + + + + high = self.high + + + + low = self.low + + + + strike = self.strike + + + + count = self.count + + + + expiration = self.expiration + + + + right = self.right + + + + close = self.close + + + + open_ = self.open_ + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "volume": volume, + "symbol": symbol, + "high": high, + "low": low, + "strike": strike, + "count": count, + "expiration": expiration, + "right": right, + "close": close, + "open": open_, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + volume = cast(list[int], d.pop("volume")) + + + symbol = cast(list[str], d.pop("symbol")) + + + high = cast(list[float], d.pop("high")) + + + low = cast(list[float], d.pop("low")) + + + strike = cast(list[float], d.pop("strike")) + + + count = cast(list[int], d.pop("count")) + + + expiration = cast(list[str], d.pop("expiration")) + + + right = cast(list[str], d.pop("right")) + + + close = cast(list[float], d.pop("close")) + + + open_ = cast(list[float], d.pop("open")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + option_snapshot_ohlc_response_200 = cls( + volume=volume, + symbol=symbol, + high=high, + low=low, + strike=strike, + count=count, + expiration=expiration, + right=right, + close=close, + open_=open_, + timestamp=timestamp, + ) + + + + option_snapshot_ohlc_response_200.additional_properties = d + return option_snapshot_ohlc_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_snapshot_ohlc_right.py b/openapi_project/openapi_package/models/option_snapshot_ohlc_right.py new file mode 100644 index 000000000..11340679d --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_ohlc_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionSnapshotOhlcRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_open_interest_format.py b/openapi_project/openapi_package/models/option_snapshot_open_interest_format.py new file mode 100644 index 000000000..398a7be2a --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_open_interest_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionSnapshotOpenInterestFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_open_interest_response_200.py b/openapi_project/openapi_package/models/option_snapshot_open_interest_response_200.py new file mode 100644 index 000000000..20e2c9be6 --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_open_interest_response_200.py @@ -0,0 +1,139 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionSnapshotOpenInterestResponse200") + + + +@_attrs_define +class OptionSnapshotOpenInterestResponse200: + """ + Attributes: + symbol (list[str]): + strike (list[float]): + open_interest (list[int]): + expiration (list[str]): + right (list[str]): + timestamp (list[str]): + """ + + symbol: list[str] + strike: list[float] + open_interest: list[int] + expiration: list[str] + right: list[str] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + strike = self.strike + + + + open_interest = self.open_interest + + + + expiration = self.expiration + + + + right = self.right + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "strike": strike, + "open_interest": open_interest, + "expiration": expiration, + "right": right, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + strike = cast(list[float], d.pop("strike")) + + + open_interest = cast(list[int], d.pop("open_interest")) + + + expiration = cast(list[str], d.pop("expiration")) + + + right = cast(list[str], d.pop("right")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + option_snapshot_open_interest_response_200 = cls( + symbol=symbol, + strike=strike, + open_interest=open_interest, + expiration=expiration, + right=right, + timestamp=timestamp, + ) + + + + option_snapshot_open_interest_response_200.additional_properties = d + return option_snapshot_open_interest_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_snapshot_open_interest_right.py b/openapi_project/openapi_package/models/option_snapshot_open_interest_right.py new file mode 100644 index 000000000..f87b86ce1 --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_open_interest_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionSnapshotOpenInterestRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_quote_format.py b/openapi_project/openapi_package/models/option_snapshot_quote_format.py new file mode 100644 index 000000000..1ef21150b --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_quote_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionSnapshotQuoteFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_quote_response_200.py b/openapi_project/openapi_package/models/option_snapshot_quote_response_200.py new file mode 100644 index 000000000..f564f014f --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_quote_response_200.py @@ -0,0 +1,216 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionSnapshotQuoteResponse200") + + + +@_attrs_define +class OptionSnapshotQuoteResponse200: + """ + Attributes: + symbol (list[str]): + ask_size (list[int]): + ask_condition (list[int]): + strike (list[float]): + right (list[str]): + bid_size (list[int]): + ask_exchange (list[int]): + bid_exchange (list[int]): + ask (list[float]): + expiration (list[str]): + bid (list[float]): + bid_condition (list[int]): + timestamp (list[str]): + """ + + symbol: list[str] + ask_size: list[int] + ask_condition: list[int] + strike: list[float] + right: list[str] + bid_size: list[int] + ask_exchange: list[int] + bid_exchange: list[int] + ask: list[float] + expiration: list[str] + bid: list[float] + bid_condition: list[int] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + ask_size = self.ask_size + + + + ask_condition = self.ask_condition + + + + strike = self.strike + + + + right = self.right + + + + bid_size = self.bid_size + + + + ask_exchange = self.ask_exchange + + + + bid_exchange = self.bid_exchange + + + + ask = self.ask + + + + expiration = self.expiration + + + + bid = self.bid + + + + bid_condition = self.bid_condition + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "ask_size": ask_size, + "ask_condition": ask_condition, + "strike": strike, + "right": right, + "bid_size": bid_size, + "ask_exchange": ask_exchange, + "bid_exchange": bid_exchange, + "ask": ask, + "expiration": expiration, + "bid": bid, + "bid_condition": bid_condition, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + ask_size = cast(list[int], d.pop("ask_size")) + + + ask_condition = cast(list[int], d.pop("ask_condition")) + + + strike = cast(list[float], d.pop("strike")) + + + right = cast(list[str], d.pop("right")) + + + bid_size = cast(list[int], d.pop("bid_size")) + + + ask_exchange = cast(list[int], d.pop("ask_exchange")) + + + bid_exchange = cast(list[int], d.pop("bid_exchange")) + + + ask = cast(list[float], d.pop("ask")) + + + expiration = cast(list[str], d.pop("expiration")) + + + bid = cast(list[float], d.pop("bid")) + + + bid_condition = cast(list[int], d.pop("bid_condition")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + option_snapshot_quote_response_200 = cls( + symbol=symbol, + ask_size=ask_size, + ask_condition=ask_condition, + strike=strike, + right=right, + bid_size=bid_size, + ask_exchange=ask_exchange, + bid_exchange=bid_exchange, + ask=ask, + expiration=expiration, + bid=bid, + bid_condition=bid_condition, + timestamp=timestamp, + ) + + + + option_snapshot_quote_response_200.additional_properties = d + return option_snapshot_quote_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_snapshot_quote_right.py b/openapi_project/openapi_package/models/option_snapshot_quote_right.py new file mode 100644 index 000000000..15f363cea --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_quote_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionSnapshotQuoteRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_trade_format.py b/openapi_project/openapi_package/models/option_snapshot_trade_format.py new file mode 100644 index 000000000..7dfe2a341 --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_trade_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionSnapshotTradeFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_trade_response_200.py b/openapi_project/openapi_package/models/option_snapshot_trade_response_200.py new file mode 100644 index 000000000..0f6a2910f --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_trade_response_200.py @@ -0,0 +1,227 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="OptionSnapshotTradeResponse200") + + + +@_attrs_define +class OptionSnapshotTradeResponse200: + """ + Attributes: + symbol (list[str]): + strike (list[float]): + right (list[str]): + sequence (list[int]): + condition (list[int]): + size (list[int]): + price (list[float]): + ext_condition2 (list[int]): + ext_condition1 (list[int]): + expiration (list[str]): + ext_condition4 (list[int]): + exchange (list[int]): + ext_condition3 (list[int]): + timestamp (list[str]): + """ + + symbol: list[str] + strike: list[float] + right: list[str] + sequence: list[int] + condition: list[int] + size: list[int] + price: list[float] + ext_condition2: list[int] + ext_condition1: list[int] + expiration: list[str] + ext_condition4: list[int] + exchange: list[int] + ext_condition3: list[int] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + strike = self.strike + + + + right = self.right + + + + sequence = self.sequence + + + + condition = self.condition + + + + size = self.size + + + + price = self.price + + + + ext_condition2 = self.ext_condition2 + + + + ext_condition1 = self.ext_condition1 + + + + expiration = self.expiration + + + + ext_condition4 = self.ext_condition4 + + + + exchange = self.exchange + + + + ext_condition3 = self.ext_condition3 + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "strike": strike, + "right": right, + "sequence": sequence, + "condition": condition, + "size": size, + "price": price, + "ext_condition2": ext_condition2, + "ext_condition1": ext_condition1, + "expiration": expiration, + "ext_condition4": ext_condition4, + "exchange": exchange, + "ext_condition3": ext_condition3, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + strike = cast(list[float], d.pop("strike")) + + + right = cast(list[str], d.pop("right")) + + + sequence = cast(list[int], d.pop("sequence")) + + + condition = cast(list[int], d.pop("condition")) + + + size = cast(list[int], d.pop("size")) + + + price = cast(list[float], d.pop("price")) + + + ext_condition2 = cast(list[int], d.pop("ext_condition2")) + + + ext_condition1 = cast(list[int], d.pop("ext_condition1")) + + + expiration = cast(list[str], d.pop("expiration")) + + + ext_condition4 = cast(list[int], d.pop("ext_condition4")) + + + exchange = cast(list[int], d.pop("exchange")) + + + ext_condition3 = cast(list[int], d.pop("ext_condition3")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + option_snapshot_trade_response_200 = cls( + symbol=symbol, + strike=strike, + right=right, + sequence=sequence, + condition=condition, + size=size, + price=price, + ext_condition2=ext_condition2, + ext_condition1=ext_condition1, + expiration=expiration, + ext_condition4=ext_condition4, + exchange=exchange, + ext_condition3=ext_condition3, + timestamp=timestamp, + ) + + + + option_snapshot_trade_response_200.additional_properties = d + return option_snapshot_trade_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_snapshot_trade_right.py b/openapi_project/openapi_package/models/option_snapshot_trade_right.py new file mode 100644 index 000000000..612c9a86b --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_trade_right.py @@ -0,0 +1,9 @@ +from enum import Enum + +class OptionSnapshotTradeRight(str, Enum): + BOTH = "both" + CALL = "call" + PUT = "put" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/ord_status.py b/openapi_project/openapi_package/models/ord_status.py deleted file mode 100644 index 920d81f37..000000000 --- a/openapi_project/openapi_package/models/ord_status.py +++ /dev/null @@ -1,30 +0,0 @@ -from enum import Enum - - -class OrdStatus(str, Enum): - ORD_STATUS_ACCEPTED = "ORD_STATUS_ACCEPTED" - ORD_STATUS_ACCEPTED_FOR_BIDDING = "ORD_STATUS_ACCEPTED_FOR_BIDDING" - ORD_STATUS_CANCELED = "ORD_STATUS_CANCELED" - ORD_STATUS_DECLINED = "ORD_STATUS_DECLINED" - ORD_STATUS_DONE_FOR_DAY = "ORD_STATUS_DONE_FOR_DAY" - ORD_STATUS_EXPIRED = "ORD_STATUS_EXPIRED" - ORD_STATUS_FILLED = "ORD_STATUS_FILLED" - ORD_STATUS_NEW = "ORD_STATUS_NEW" - ORD_STATUS_PARTIALLY_FILLED = "ORD_STATUS_PARTIALLY_FILLED" - ORD_STATUS_PENDING_CANCEL = "ORD_STATUS_PENDING_CANCEL" - ORD_STATUS_PENDING_NEW = "ORD_STATUS_PENDING_NEW" - ORD_STATUS_PENDING_REPLACE = "ORD_STATUS_PENDING_REPLACE" - ORD_STATUS_PUSHED = "ORD_STATUS_PUSHED" - ORD_STATUS_QUEUED = "ORD_STATUS_QUEUED" - ORD_STATUS_REJECTED = "ORD_STATUS_REJECTED" - ORD_STATUS_REPLACED = "ORD_STATUS_REPLACED" - ORD_STATUS_REPRESENTED = "ORD_STATUS_REPRESENTED" - ORD_STATUS_STAGED = "ORD_STATUS_STAGED" - ORD_STATUS_STOPPED = "ORD_STATUS_STOPPED" - ORD_STATUS_SUSPENDED = "ORD_STATUS_SUSPENDED" - ORD_STATUS_TIMED_OUT = "ORD_STATUS_TIMED_OUT" - ORD_STATUS_UNKNOWN = "ORD_STATUS_UNKNOWN" - ORD_STATUS_WORKING = "ORD_STATUS_WORKING" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/ord_type.py b/openapi_project/openapi_package/models/ord_type.py deleted file mode 100644 index 4ef641095..000000000 --- a/openapi_project/openapi_package/models/ord_type.py +++ /dev/null @@ -1,14 +0,0 @@ -from enum import Enum - - -class OrdType(str, Enum): - ORD_TYPE_LIMIT = "ORD_TYPE_LIMIT" - ORD_TYPE_MARKET = "ORD_TYPE_MARKET" - ORD_TYPE_MARKET_IF_TOUCHED = "ORD_TYPE_MARKET_IF_TOUCHED" - ORD_TYPE_PEGGED = "ORD_TYPE_PEGGED" - ORD_TYPE_STOP = "ORD_TYPE_STOP" - ORD_TYPE_STOP_LIMIT = "ORD_TYPE_STOP_LIMIT" - ORD_TYPE_UNKNOWN = "ORD_TYPE_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/order.py b/openapi_project/openapi_package/models/order.py deleted file mode 100644 index ede301b16..000000000 --- a/openapi_project/openapi_package/models/order.py +++ /dev/null @@ -1,566 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.ord_status import OrdStatus -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.origination_type import OriginationType -from openapi_project.openapi_package.models.position_effect import PositionEffect -from openapi_project.openapi_package.models.price_type import PriceType -from openapi_project.openapi_package.models.side import Side -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.security import Security - from openapi_project.openapi_package.models.header import Header - from openapi_project.openapi_package.models.order_market_condition import OrderMarketCondition - from openapi_project.openapi_package.models.order_optional_data import OrderOptionalData - from openapi_project.openapi_package.models.order_algo import OrderAlgo - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - - -T = TypeVar("T", bound="Order") - - -@_attrs_define -class Order: - """ - Attributes: - account_id (Unset | int): - algo (Unset | OrderAlgo): - aux_price (Unset | float): - clearing_info (Unset | ClearingInfo): - cur_ord_id (Unset | str): - header (Unset | Header): - id_ (Unset | str): - incoming_cl_ord_id (Unset | str): - incoming_ord_id (Unset | str): - instructions (Unset | list[OrderInstruction]): - market_condition (Unset | OrderMarketCondition): - optional_data (Unset | OrderOptionalData): - order_flags (Unset | int): - order_updates (Unset | list[OrderUpdateEvent]): - ord_type (Unset | OrdType): - origination_type (Unset | OriginationType): - parent_ord_id (Unset | str): - position_effect (Unset | PositionEffect): - price (Unset | float): - price_type (Unset | PriceType): - qty (Unset | float): - route (Unset | str): - security (Unset | Security): - side (Unset | Side): - source (Unset | str): - source_address (Unset | str): - submit_ts (Unset | str): - symbol (Unset | str): - tag (Unset | str): - text (Unset | str): - tif (Unset | Tif): - trader_id (Unset | str): - user_id (Unset | int): - ord_status (Unset | OrdStatus): - avg_price (Unset | float): - claimed_by (Unset | str): - last_price (Unset | float): - last_qty (Unset | float): - last_market (Unset | str): - leaves_qty (Unset | float): - cum_qty (Unset | float): - transact_ts (Unset | str): - working_qty (Unset | float): - has_busts (Unset | bool): - has_corrects (Unset | bool): - has_notes (Unset | bool): - """ - - account_id: Unset | int = UNSET - algo: Unset | OrderAlgo = UNSET - aux_price: Unset | float = UNSET - clearing_info: Unset | ClearingInfo = UNSET - cur_ord_id: Unset | str = UNSET - header: Unset | Header = UNSET - id_: Unset | str = UNSET - incoming_cl_ord_id: Unset | str = UNSET - incoming_ord_id: Unset | str = UNSET - instructions: Unset | list[OrderInstruction] = UNSET - market_condition: Unset | OrderMarketCondition = UNSET - optional_data: Unset | OrderOptionalData = UNSET - order_flags: Unset | int = UNSET - order_updates: Unset | list[OrderUpdateEvent] = UNSET - ord_type: Unset | OrdType = UNSET - origination_type: Unset | OriginationType = UNSET - parent_ord_id: Unset | str = UNSET - position_effect: Unset | PositionEffect = UNSET - price: Unset | float = UNSET - price_type: Unset | PriceType = UNSET - qty: Unset | float = UNSET - route: Unset | str = UNSET - security: Unset | Security = UNSET - side: Unset | Side = UNSET - source: Unset | str = UNSET - source_address: Unset | str = UNSET - submit_ts: Unset | str = UNSET - symbol: Unset | str = UNSET - tag: Unset | str = UNSET - text: Unset | str = UNSET - tif: Unset | Tif = UNSET - trader_id: Unset | str = UNSET - user_id: Unset | int = UNSET - ord_status: Unset | OrdStatus = UNSET - avg_price: Unset | float = UNSET - claimed_by: Unset | str = UNSET - last_price: Unset | float = UNSET - last_qty: Unset | float = UNSET - last_market: Unset | str = UNSET - leaves_qty: Unset | float = UNSET - cum_qty: Unset | float = UNSET - transact_ts: Unset | str = UNSET - working_qty: Unset | float = UNSET - has_busts: Unset | bool = UNSET - has_corrects: Unset | bool = UNSET - has_notes: Unset | bool = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - algo: Unset | dict[str, Any] = ( - UNSET if isinstance(self.algo, Unset) else self.algo.to_dict() - ) - - aux_price = self.aux_price - - clearing_info: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.clearing_info, Unset) - else self.clearing_info.to_dict() - ) - - cur_ord_id = self.cur_ord_id - - header: Unset | dict[str, Any] = ( - UNSET if isinstance(self.header, Unset) else self.header.to_dict() - ) - - id_ = self.id_ - - incoming_cl_ord_id = self.incoming_cl_ord_id - - incoming_ord_id = self.incoming_ord_id - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - market_condition: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.market_condition, Unset) - else self.market_condition.to_dict() - ) - - optional_data: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.optional_data, Unset) - else self.optional_data.to_dict() - ) - - order_flags = self.order_flags - - order_updates: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.order_updates, Unset): - order_updates = [] - for order_updates_item_data in self.order_updates: - order_updates_item = order_updates_item_data.to_dict() - order_updates.append(order_updates_item) - - ord_type: Unset | str = ( - UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value - ) - - origination_type: Unset | str = ( - UNSET - if isinstance(self.origination_type, Unset) - else self.origination_type.value - ) - - parent_ord_id = self.parent_ord_id - - position_effect: Unset | str = ( - UNSET - if isinstance(self.position_effect, Unset) - else self.position_effect.value - ) - - price = self.price - - price_type: Unset | str = ( - UNSET if isinstance(self.price_type, Unset) else self.price_type.value - ) - - qty = self.qty - - route = self.route - - security: Unset | dict[str, Any] = ( - UNSET if isinstance(self.security, Unset) else self.security.to_dict() - ) - - side: Unset | str = UNSET if isinstance(self.side, Unset) else self.side.value - - source = self.source - - source_address = self.source_address - - submit_ts = self.submit_ts - - symbol = self.symbol - - tag = self.tag - - text = self.text - - tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value - - trader_id = self.trader_id - - user_id = self.user_id - - ord_status: Unset | str = ( - UNSET if isinstance(self.ord_status, Unset) else self.ord_status.value - ) - - avg_price = self.avg_price - - claimed_by = self.claimed_by - - last_price = self.last_price - - last_qty = self.last_qty - - last_market = self.last_market - - leaves_qty = self.leaves_qty - - cum_qty = self.cum_qty - - transact_ts = self.transact_ts - - working_qty = self.working_qty - - has_busts = self.has_busts - - has_corrects = self.has_corrects - - has_notes = self.has_notes - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if algo is not UNSET: - field_dict["algo"] = algo - if aux_price is not UNSET: - field_dict["auxPrice"] = aux_price - if clearing_info is not UNSET: - field_dict["clearingInfo"] = clearing_info - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if header is not UNSET: - field_dict["header"] = header - if id_ is not UNSET: - field_dict["id"] = id - if incoming_cl_ord_id is not UNSET: - field_dict["incomingClOrdId"] = incoming_cl_ord_id - if incoming_ord_id is not UNSET: - field_dict["incomingOrdId"] = incoming_ord_id - if instructions is not UNSET: - field_dict["instructions"] = instructions - if market_condition is not UNSET: - field_dict["marketCondition"] = market_condition - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if order_flags is not UNSET: - field_dict["orderFlags"] = order_flags - if order_updates is not UNSET: - field_dict["orderUpdates"] = order_updates - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if origination_type is not UNSET: - field_dict["originationType"] = origination_type - if parent_ord_id is not UNSET: - field_dict["parentOrdId"] = parent_ord_id - if position_effect is not UNSET: - field_dict["positionEffect"] = position_effect - if price is not UNSET: - field_dict["price"] = price - if price_type is not UNSET: - field_dict["priceType"] = price_type - if qty is not UNSET: - field_dict["qty"] = qty - if route is not UNSET: - field_dict["route"] = route - if security is not UNSET: - field_dict["security"] = security - if side is not UNSET: - field_dict["side"] = side - if source is not UNSET: - field_dict["source"] = source - if source_address is not UNSET: - field_dict["sourceAddress"] = source_address - if submit_ts is not UNSET: - field_dict["submitTs"] = submit_ts - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tag is not UNSET: - field_dict["tag"] = tag - if text is not UNSET: - field_dict["text"] = text - if tif is not UNSET: - field_dict["tif"] = tif - if trader_id is not UNSET: - field_dict["traderId"] = trader_id - if user_id is not UNSET: - field_dict["userId"] = user_id - if ord_status is not UNSET: - field_dict["ordStatus"] = ord_status - if avg_price is not UNSET: - field_dict["avgPrice"] = avg_price - if claimed_by is not UNSET: - field_dict["claimedBy"] = claimed_by - if last_price is not UNSET: - field_dict["lastPrice"] = last_price - if last_qty is not UNSET: - field_dict["lastQty"] = last_qty - if last_market is not UNSET: - field_dict["lastMarket"] = last_market - if leaves_qty is not UNSET: - field_dict["leavesQty"] = leaves_qty - if cum_qty is not UNSET: - field_dict["cumQty"] = cum_qty - if transact_ts is not UNSET: - field_dict["transactTs"] = transact_ts - if working_qty is not UNSET: - field_dict["workingQty"] = working_qty - if has_busts is not UNSET: - field_dict["hasBusts"] = has_busts - if has_corrects is not UNSET: - field_dict["hasCorrects"] = has_corrects - if has_notes is not UNSET: - field_dict["hasNotes"] = has_notes - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - _algo = d.pop("algo", UNSET) - algo: Unset | OrderAlgo = ( - UNSET if isinstance(_algo, Unset) else OrderAlgo.from_dict(_algo) - ) - - aux_price = d.pop("auxPrice", UNSET) - - _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo = ( - UNSET - if isinstance(_clearing_info, Unset) - else ClearingInfo.from_dict(_clearing_info) - ) - - cur_ord_id = d.pop("curOrdId", UNSET) - - _header = d.pop("header", UNSET) - header: Unset | Header = ( - UNSET if isinstance(_header, Unset) else Header.from_dict(_header) - ) - - id_ = d.pop("id", UNSET) - - incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) - - incoming_ord_id = d.pop("incomingOrdId", UNSET) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | OrderMarketCondition = ( - UNSET - if isinstance(_market_condition, Unset) - else OrderMarketCondition.from_dict(_market_condition) - ) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | OrderOptionalData = ( - UNSET - if isinstance(_optional_data, Unset) - else OrderOptionalData.from_dict(_optional_data) - ) - - order_flags = d.pop("orderFlags", UNSET) - - order_updates = [] - _order_updates = d.pop("orderUpdates", UNSET) - for order_updates_item_data in _order_updates or []: - order_updates_item = OrderUpdateEvent.from_dict(order_updates_item_data) - - order_updates.append(order_updates_item) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType = ( - UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) - ) - - _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType = ( - UNSET - if isinstance(_origination_type, Unset) - else OriginationType(_origination_type) - ) - - parent_ord_id = d.pop("parentOrdId", UNSET) - - _position_effect = d.pop("positionEffect", UNSET) - position_effect: Unset | PositionEffect = ( - UNSET - if isinstance(_position_effect, Unset) - else PositionEffect(_position_effect) - ) - - price = d.pop("price", UNSET) - - _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType = ( - UNSET if isinstance(_price_type, Unset) else PriceType(_price_type) - ) - - qty = d.pop("qty", UNSET) - - route = d.pop("route", UNSET) - - _security = d.pop("security", UNSET) - security: Unset | Security = ( - UNSET if isinstance(_security, Unset) else Security.from_dict(_security) - ) - - _side = d.pop("side", UNSET) - side: Unset | Side = UNSET if isinstance(_side, Unset) else Side(_side) - - source = d.pop("source", UNSET) - - source_address = d.pop("sourceAddress", UNSET) - - submit_ts = d.pop("submitTs", UNSET) - - symbol = d.pop("symbol", UNSET) - - tag = d.pop("tag", UNSET) - - text = d.pop("text", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) - - trader_id = d.pop("traderId", UNSET) - - user_id = d.pop("userId", UNSET) - - _ord_status = d.pop("ordStatus", UNSET) - ord_status: Unset | OrdStatus = ( - UNSET if isinstance(_ord_status, Unset) else OrdStatus(_ord_status) - ) - - avg_price = d.pop("avgPrice", UNSET) - - claimed_by = d.pop("claimedBy", UNSET) - - last_price = d.pop("lastPrice", UNSET) - - last_qty = d.pop("lastQty", UNSET) - - last_market = d.pop("lastMarket", UNSET) - - leaves_qty = d.pop("leavesQty", UNSET) - - cum_qty = d.pop("cumQty", UNSET) - - transact_ts = d.pop("transactTs", UNSET) - - working_qty = d.pop("workingQty", UNSET) - - has_busts = d.pop("hasBusts", UNSET) - - has_corrects = d.pop("hasCorrects", UNSET) - - has_notes = d.pop("hasNotes", UNSET) - - order = cls( - account_id=account_id, - algo=algo, - aux_price=aux_price, - clearing_info=clearing_info, - cur_ord_id=cur_ord_id, - header=header, - id_=id_, - incoming_cl_ord_id=incoming_cl_ord_id, - incoming_ord_id=incoming_ord_id, - instructions=instructions, - market_condition=market_condition, - optional_data=optional_data, - order_flags=order_flags, - order_updates=order_updates, - ord_type=ord_type, - origination_type=origination_type, - parent_ord_id=parent_ord_id, - position_effect=position_effect, - price=price, - price_type=price_type, - qty=qty, - route=route, - security=security, - side=side, - source=source, - source_address=source_address, - submit_ts=submit_ts, - symbol=symbol, - tag=tag, - text=text, - tif=tif, - trader_id=trader_id, - user_id=user_id, - ord_status=ord_status, - avg_price=avg_price, - claimed_by=claimed_by, - last_price=last_price, - last_qty=last_qty, - last_market=last_market, - leaves_qty=leaves_qty, - cum_qty=cum_qty, - transact_ts=transact_ts, - working_qty=working_qty, - has_busts=has_busts, - has_corrects=has_corrects, - has_notes=has_notes, - ) - - return order diff --git a/openapi_project/openapi_package/models/order_algo.py b/openapi_project/openapi_package/models/order_algo.py deleted file mode 100644 index 298a18451..000000000 --- a/openapi_project/openapi_package/models/order_algo.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="OrderAlgo") - - -@_attrs_define -class OrderAlgo: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_algo = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_algo.additional_properties = additional_properties - return order_algo - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/order_cancel_reject.py b/openapi_project/openapi_package/models/order_cancel_reject.py deleted file mode 100644 index 826787949..000000000 --- a/openapi_project/openapi_package/models/order_cancel_reject.py +++ /dev/null @@ -1,193 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.cxl_rej_response_to import CxlRejResponseTo -from openapi_project.openapi_package.models.ord_status import OrdStatus -from openapi_project.openapi_package.models.origination_type import OriginationType -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_cancel_reject_optional_data import OrderCancelRejectOptionalData - - -T = TypeVar("T", bound="OrderCancelReject") - - -@_attrs_define -class OrderCancelReject: - """ - Attributes: - cur_ord_id (Unset | str): - incoming_cl_ord_id (Unset | str): - incoming_orig_cl_ord_id (Unset | str): - ord_status (Unset | OrdStatus): - optional_data (Unset | OrderCancelRejectOptionalData): - origination_type (Unset | OriginationType): - perm_ord_id (Unset | str): - req_ord_id (Unset | str): - source (Unset | str): - text (Unset | str): - trader_id (Unset | str): - transact_ts (Unset | str): - cxl_rej_response_to (Unset | CxlRejResponseTo): - """ - - cur_ord_id: Unset | str = UNSET - incoming_cl_ord_id: Unset | str = UNSET - incoming_orig_cl_ord_id: Unset | str = UNSET - ord_status: Unset | OrdStatus = UNSET - optional_data: Unset | OrderCancelRejectOptionalData = UNSET - origination_type: Unset | OriginationType = UNSET - perm_ord_id: Unset | str = UNSET - req_ord_id: Unset | str = UNSET - source: Unset | str = UNSET - text: Unset | str = UNSET - trader_id: Unset | str = UNSET - transact_ts: Unset | str = UNSET - cxl_rej_response_to: Unset | CxlRejResponseTo = UNSET - - def to_dict(self) -> dict[str, Any]: - cur_ord_id = self.cur_ord_id - - incoming_cl_ord_id = self.incoming_cl_ord_id - - incoming_orig_cl_ord_id = self.incoming_orig_cl_ord_id - - ord_status: Unset | str = ( - UNSET if isinstance(self.ord_status, Unset) else self.ord_status.value - ) - - optional_data: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.optional_data, Unset) - else self.optional_data.to_dict() - ) - - origination_type: Unset | str = ( - UNSET - if isinstance(self.origination_type, Unset) - else self.origination_type.value - ) - - perm_ord_id = self.perm_ord_id - - req_ord_id = self.req_ord_id - - source = self.source - - text = self.text - - trader_id = self.trader_id - - transact_ts = self.transact_ts - - cxl_rej_response_to: Unset | str = ( - UNSET - if isinstance(self.cxl_rej_response_to, Unset) - else self.cxl_rej_response_to.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if incoming_cl_ord_id is not UNSET: - field_dict["incomingClOrdId"] = incoming_cl_ord_id - if incoming_orig_cl_ord_id is not UNSET: - field_dict["incomingOrigClOrdId"] = incoming_orig_cl_ord_id - if ord_status is not UNSET: - field_dict["ordStatus"] = ord_status - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if origination_type is not UNSET: - field_dict["originationType"] = origination_type - if perm_ord_id is not UNSET: - field_dict["permOrdId"] = perm_ord_id - if req_ord_id is not UNSET: - field_dict["reqOrdId"] = req_ord_id - if source is not UNSET: - field_dict["source"] = source - if text is not UNSET: - field_dict["text"] = text - if trader_id is not UNSET: - field_dict["traderId"] = trader_id - if transact_ts is not UNSET: - field_dict["transactTs"] = transact_ts - if cxl_rej_response_to is not UNSET: - field_dict["cxlRejResponseTo"] = cxl_rej_response_to - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - cur_ord_id = d.pop("curOrdId", UNSET) - - incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) - - incoming_orig_cl_ord_id = d.pop("incomingOrigClOrdId", UNSET) - - _ord_status = d.pop("ordStatus", UNSET) - ord_status: Unset | OrdStatus = ( - UNSET if isinstance(_ord_status, Unset) else OrdStatus(_ord_status) - ) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | OrderCancelRejectOptionalData = ( - UNSET - if isinstance(_optional_data, Unset) - else OrderCancelRejectOptionalData.from_dict(_optional_data) - ) - - _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType = ( - UNSET - if isinstance(_origination_type, Unset) - else OriginationType(_origination_type) - ) - - perm_ord_id = d.pop("permOrdId", UNSET) - - req_ord_id = d.pop("reqOrdId", UNSET) - - source = d.pop("source", UNSET) - - text = d.pop("text", UNSET) - - trader_id = d.pop("traderId", UNSET) - - transact_ts = d.pop("transactTs", UNSET) - - _cxl_rej_response_to = d.pop("cxlRejResponseTo", UNSET) - cxl_rej_response_to: Unset | CxlRejResponseTo = ( - UNSET - if isinstance(_cxl_rej_response_to, Unset) - else CxlRejResponseTo(_cxl_rej_response_to) - ) - - order_cancel_reject = cls( - cur_ord_id=cur_ord_id, - incoming_cl_ord_id=incoming_cl_ord_id, - incoming_orig_cl_ord_id=incoming_orig_cl_ord_id, - ord_status=ord_status, - optional_data=optional_data, - origination_type=origination_type, - perm_ord_id=perm_ord_id, - req_ord_id=req_ord_id, - source=source, - text=text, - trader_id=trader_id, - transact_ts=transact_ts, - cxl_rej_response_to=cxl_rej_response_to, - ) - - return order_cancel_reject diff --git a/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py b/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py deleted file mode 100644 index 5f998b411..000000000 --- a/openapi_project/openapi_package/models/order_cancel_reject_optional_data.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="OrderCancelRejectOptionalData") - - -@_attrs_define -class OrderCancelRejectOptionalData: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_cancel_reject_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_cancel_reject_optional_data.additional_properties = additional_properties - return order_cancel_reject_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/order_cancel_replace_request.py b/openapi_project/openapi_package/models/order_cancel_replace_request.py deleted file mode 100644 index 54ad04607..000000000 --- a/openapi_project/openapi_package/models/order_cancel_replace_request.py +++ /dev/null @@ -1,328 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.origination_type import OriginationType -from openapi_project.openapi_package.models.price_type import PriceType -from openapi_project.openapi_package.models.side import Side -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.order_cancel_replace_request_optional_data import OrderCancelReplaceRequestOptionalData - from openapi_project.openapi_package.models.order_cancel_replace_request_market_condition import OrderCancelReplaceRequestMarketCondition - from openapi_project.openapi_package.models.header import Header - from openapi_project.openapi_package.models.order_cancel_replace_request_algo import OrderCancelReplaceRequestAlgo - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - - -T = TypeVar("T", bound="OrderCancelReplaceRequest") - - -@_attrs_define -class OrderCancelReplaceRequest: - """ - Attributes: - algo (Unset | OrderCancelReplaceRequestAlgo): - aux_price (Unset | float): - clearing_info (Unset | ClearingInfo): - cur_ord_id (Unset | str): - header (Unset | Header): - incoming_cl_ord_id (Unset | str): - incoming_orig_cl_ord_id (Unset | str): - instructions (Unset | list[OrderInstruction]): - optional_data (Unset | OrderCancelReplaceRequestOptionalData): - market_condition (Unset | OrderCancelReplaceRequestMarketCondition): - ord_type (Unset | OrdType): - origination_type (Unset | OriginationType): - perm_ord_id (Unset | str): - price (Unset | float): - price_type (Unset | PriceType): - qty (Unset | float): - req_ord_id (Unset | str): - side (Unset | Side): - source (Unset | str): - submit_ts (Unset | str): - tif (Unset | Tif): - trader_id (Unset | str): - user_id (Unset | int): - """ - - algo: Unset | OrderCancelReplaceRequestAlgo = UNSET - aux_price: Unset | float = UNSET - clearing_info: Unset | ClearingInfo = UNSET - cur_ord_id: Unset | str = UNSET - header: Unset | Header = UNSET - incoming_cl_ord_id: Unset | str = UNSET - incoming_orig_cl_ord_id: Unset | str = UNSET - instructions: Unset | list[OrderInstruction] = UNSET - optional_data: Unset | OrderCancelReplaceRequestOptionalData = UNSET - market_condition: Unset | OrderCancelReplaceRequestMarketCondition = UNSET - ord_type: Unset | OrdType = UNSET - origination_type: Unset | OriginationType = UNSET - perm_ord_id: Unset | str = UNSET - price: Unset | float = UNSET - price_type: Unset | PriceType = UNSET - qty: Unset | float = UNSET - req_ord_id: Unset | str = UNSET - side: Unset | Side = UNSET - source: Unset | str = UNSET - submit_ts: Unset | str = UNSET - tif: Unset | Tif = UNSET - trader_id: Unset | str = UNSET - user_id: Unset | int = UNSET - - def to_dict(self) -> dict[str, Any]: - algo: Unset | dict[str, Any] = ( - UNSET if isinstance(self.algo, Unset) else self.algo.to_dict() - ) - - aux_price = self.aux_price - - clearing_info: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.clearing_info, Unset) - else self.clearing_info.to_dict() - ) - - cur_ord_id = self.cur_ord_id - - header: Unset | dict[str, Any] = ( - UNSET if isinstance(self.header, Unset) else self.header.to_dict() - ) - - incoming_cl_ord_id = self.incoming_cl_ord_id - - incoming_orig_cl_ord_id = self.incoming_orig_cl_ord_id - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - optional_data: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.optional_data, Unset) - else self.optional_data.to_dict() - ) - - market_condition: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.market_condition, Unset) - else self.market_condition.to_dict() - ) - - ord_type: Unset | str = ( - UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value - ) - - origination_type: Unset | str = ( - UNSET - if isinstance(self.origination_type, Unset) - else self.origination_type.value - ) - - perm_ord_id = self.perm_ord_id - - price = self.price - - price_type: Unset | str = ( - UNSET if isinstance(self.price_type, Unset) else self.price_type.value - ) - - qty = self.qty - - req_ord_id = self.req_ord_id - - side: Unset | str = UNSET if isinstance(self.side, Unset) else self.side.value - - source = self.source - - submit_ts = self.submit_ts - - tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value - - trader_id = self.trader_id - - user_id = self.user_id - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if algo is not UNSET: - field_dict["algo"] = algo - if aux_price is not UNSET: - field_dict["auxPrice"] = aux_price - if clearing_info is not UNSET: - field_dict["clearingInfo"] = clearing_info - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if header is not UNSET: - field_dict["header"] = header - if incoming_cl_ord_id is not UNSET: - field_dict["incomingClOrdId"] = incoming_cl_ord_id - if incoming_orig_cl_ord_id is not UNSET: - field_dict["incomingOrigClOrdId"] = incoming_orig_cl_ord_id - if instructions is not UNSET: - field_dict["instructions"] = instructions - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if market_condition is not UNSET: - field_dict["marketCondition"] = market_condition - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if origination_type is not UNSET: - field_dict["originationType"] = origination_type - if perm_ord_id is not UNSET: - field_dict["permOrdId"] = perm_ord_id - if price is not UNSET: - field_dict["price"] = price - if price_type is not UNSET: - field_dict["priceType"] = price_type - if qty is not UNSET: - field_dict["qty"] = qty - if req_ord_id is not UNSET: - field_dict["reqOrdId"] = req_ord_id - if side is not UNSET: - field_dict["side"] = side - if source is not UNSET: - field_dict["source"] = source - if submit_ts is not UNSET: - field_dict["submitTs"] = submit_ts - if tif is not UNSET: - field_dict["tif"] = tif - if trader_id is not UNSET: - field_dict["traderId"] = trader_id - if user_id is not UNSET: - field_dict["userId"] = user_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _algo = d.pop("algo", UNSET) - algo: Unset | OrderCancelReplaceRequestAlgo = ( - UNSET - if isinstance(_algo, Unset) - else OrderCancelReplaceRequestAlgo.from_dict(_algo) - ) - - aux_price = d.pop("auxPrice", UNSET) - - _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo = ( - UNSET - if isinstance(_clearing_info, Unset) - else ClearingInfo.from_dict(_clearing_info) - ) - - cur_ord_id = d.pop("curOrdId", UNSET) - - _header = d.pop("header", UNSET) - header: Unset | Header = ( - UNSET if isinstance(_header, Unset) else Header.from_dict(_header) - ) - - incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) - - incoming_orig_cl_ord_id = d.pop("incomingOrigClOrdId", UNSET) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | OrderCancelReplaceRequestOptionalData = ( - UNSET - if isinstance(_optional_data, Unset) - else OrderCancelReplaceRequestOptionalData.from_dict(_optional_data) - ) - - _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | OrderCancelReplaceRequestMarketCondition = ( - UNSET - if isinstance(_market_condition, Unset) - else OrderCancelReplaceRequestMarketCondition.from_dict(_market_condition) - ) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType = ( - UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) - ) - - _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType = ( - UNSET - if isinstance(_origination_type, Unset) - else OriginationType(_origination_type) - ) - - perm_ord_id = d.pop("permOrdId", UNSET) - - price = d.pop("price", UNSET) - - _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType = ( - UNSET if isinstance(_price_type, Unset) else PriceType(_price_type) - ) - - qty = d.pop("qty", UNSET) - - req_ord_id = d.pop("reqOrdId", UNSET) - - _side = d.pop("side", UNSET) - side: Unset | Side = UNSET if isinstance(_side, Unset) else Side(_side) - - source = d.pop("source", UNSET) - - submit_ts = d.pop("submitTs", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) - - trader_id = d.pop("traderId", UNSET) - - user_id = d.pop("userId", UNSET) - - order_cancel_replace_request = cls( - algo=algo, - aux_price=aux_price, - clearing_info=clearing_info, - cur_ord_id=cur_ord_id, - header=header, - incoming_cl_ord_id=incoming_cl_ord_id, - incoming_orig_cl_ord_id=incoming_orig_cl_ord_id, - instructions=instructions, - optional_data=optional_data, - market_condition=market_condition, - ord_type=ord_type, - origination_type=origination_type, - perm_ord_id=perm_ord_id, - price=price, - price_type=price_type, - qty=qty, - req_ord_id=req_ord_id, - side=side, - source=source, - submit_ts=submit_ts, - tif=tif, - trader_id=trader_id, - user_id=user_id, - ) - - return order_cancel_replace_request diff --git a/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py b/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py deleted file mode 100644 index 0005e8bb1..000000000 --- a/openapi_project/openapi_package/models/order_cancel_replace_request_algo.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="OrderCancelReplaceRequestAlgo") - - -@_attrs_define -class OrderCancelReplaceRequestAlgo: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_cancel_replace_request_algo = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_cancel_replace_request_algo.additional_properties = additional_properties - return order_cancel_replace_request_algo - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py b/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py deleted file mode 100644 index b5f504ec1..000000000 --- a/openapi_project/openapi_package/models/order_cancel_replace_request_market_condition.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="OrderCancelReplaceRequestMarketCondition") - - -@_attrs_define -class OrderCancelReplaceRequestMarketCondition: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_cancel_replace_request_market_condition = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_cancel_replace_request_market_condition.additional_properties = ( - additional_properties - ) - return order_cancel_replace_request_market_condition - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py b/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py deleted file mode 100644 index 0142ef858..000000000 --- a/openapi_project/openapi_package/models/order_cancel_replace_request_optional_data.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="OrderCancelReplaceRequestOptionalData") - - -@_attrs_define -class OrderCancelReplaceRequestOptionalData: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_cancel_replace_request_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_cancel_replace_request_optional_data.additional_properties = ( - additional_properties - ) - return order_cancel_replace_request_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/order_cancel_request.py b/openapi_project/openapi_package/models/order_cancel_request.py deleted file mode 100644 index 93bace420..000000000 --- a/openapi_project/openapi_package/models/order_cancel_request.py +++ /dev/null @@ -1,177 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.origination_type import OriginationType -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.order_cancel_request_optional_data import OrderCancelRequestOptionalData -T = TypeVar("T", bound="OrderCancelRequest") - - -@_attrs_define -class OrderCancelRequest: - """ - Attributes: - cur_ord_id (Unset | str): - incoming_cl_ord_id (Unset | str): - incoming_orig_cl_ord_id (Unset | str): - instructions (Unset | list[OrderInstruction]): - optional_data (Unset | OrderCancelRequestOptionalData): - origination_type (Unset | OriginationType): - perm_ord_id (Unset | str): - req_ord_id (Unset | str): - source (Unset | str): - submit_ts (Unset | str): - trader_id (Unset | str): - user_id (Unset | int): - """ - - cur_ord_id: Unset | str = UNSET - incoming_cl_ord_id: Unset | str = UNSET - incoming_orig_cl_ord_id: Unset | str = UNSET - instructions: Unset | list[OrderInstruction] = UNSET - optional_data: Unset | OrderCancelRequestOptionalData = UNSET - origination_type: Unset | OriginationType = UNSET - perm_ord_id: Unset | str = UNSET - req_ord_id: Unset | str = UNSET - source: Unset | str = UNSET - submit_ts: Unset | str = UNSET - trader_id: Unset | str = UNSET - user_id: Unset | int = UNSET - - def to_dict(self) -> dict[str, Any]: - cur_ord_id = self.cur_ord_id - - incoming_cl_ord_id = self.incoming_cl_ord_id - - incoming_orig_cl_ord_id = self.incoming_orig_cl_ord_id - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - optional_data: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.optional_data, Unset) - else self.optional_data.to_dict() - ) - - origination_type: Unset | str = ( - UNSET - if isinstance(self.origination_type, Unset) - else self.origination_type.value - ) - - perm_ord_id = self.perm_ord_id - - req_ord_id = self.req_ord_id - - source = self.source - - submit_ts = self.submit_ts - - trader_id = self.trader_id - - user_id = self.user_id - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if incoming_cl_ord_id is not UNSET: - field_dict["incomingClOrdId"] = incoming_cl_ord_id - if incoming_orig_cl_ord_id is not UNSET: - field_dict["incomingOrigClOrdId"] = incoming_orig_cl_ord_id - if instructions is not UNSET: - field_dict["instructions"] = instructions - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if origination_type is not UNSET: - field_dict["originationType"] = origination_type - if perm_ord_id is not UNSET: - field_dict["permOrdId"] = perm_ord_id - if req_ord_id is not UNSET: - field_dict["reqOrdId"] = req_ord_id - if source is not UNSET: - field_dict["source"] = source - if submit_ts is not UNSET: - field_dict["submitTs"] = submit_ts - if trader_id is not UNSET: - field_dict["traderId"] = trader_id - if user_id is not UNSET: - field_dict["userId"] = user_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - cur_ord_id = d.pop("curOrdId", UNSET) - - incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) - - incoming_orig_cl_ord_id = d.pop("incomingOrigClOrdId", UNSET) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | OrderCancelRequestOptionalData = ( - UNSET - if isinstance(_optional_data, Unset) - else OrderCancelRequestOptionalData.from_dict(_optional_data) - ) - - _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType = ( - UNSET - if isinstance(_origination_type, Unset) - else OriginationType(_origination_type) - ) - - perm_ord_id = d.pop("permOrdId", UNSET) - - req_ord_id = d.pop("reqOrdId", UNSET) - - source = d.pop("source", UNSET) - - submit_ts = d.pop("submitTs", UNSET) - - trader_id = d.pop("traderId", UNSET) - - user_id = d.pop("userId", UNSET) - - order_cancel_request = cls( - cur_ord_id=cur_ord_id, - incoming_cl_ord_id=incoming_cl_ord_id, - incoming_orig_cl_ord_id=incoming_orig_cl_ord_id, - instructions=instructions, - optional_data=optional_data, - origination_type=origination_type, - perm_ord_id=perm_ord_id, - req_ord_id=req_ord_id, - source=source, - submit_ts=submit_ts, - trader_id=trader_id, - user_id=user_id, - ) - - return order_cancel_request diff --git a/openapi_project/openapi_package/models/order_cancel_request_optional_data.py b/openapi_project/openapi_package/models/order_cancel_request_optional_data.py deleted file mode 100644 index 32e9a251d..000000000 --- a/openapi_project/openapi_package/models/order_cancel_request_optional_data.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="OrderCancelRequestOptionalData") - - -@_attrs_define -class OrderCancelRequestOptionalData: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_cancel_request_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_cancel_request_optional_data.additional_properties = additional_properties - return order_cancel_request_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/order_cross.py b/openapi_project/openapi_package/models/order_cross.py deleted file mode 100644 index ba9fc477c..000000000 --- a/openapi_project/openapi_package/models/order_cross.py +++ /dev/null @@ -1,480 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.cross_type import CrossType -from openapi_project.openapi_package.models.ord_status import OrdStatus -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.origination_type import OriginationType -from openapi_project.openapi_package.models.price_type import PriceType -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_update_event import OrderUpdateEvent - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.order_cross_market_condition import OrderCrossMarketCondition - from openapi_project.openapi_package.models.order_cross_optional_data import OrderCrossOptionalData - from openapi_project.openapi_package.models.security import Security - from openapi_project.openapi_package.models.order_cross_allocation import OrderCrossAllocation - from openapi_project.openapi_package.models.header import Header - from openapi_project.openapi_package.models.order_cross_algo import OrderCrossAlgo - - -T = TypeVar("T", bound="OrderCross") - - -@_attrs_define -class OrderCross: - """ - Attributes: - account_id (Unset | int): - algo (Unset | OrderCrossAlgo): - allocations (Unset | list[OrderCrossAllocation]): - cross_type (Unset | CrossType): - cur_ord_id (Unset | str): - header (Unset | Header): - id_ (Unset | str): - incoming_cl_ord_id (Unset | str): - incoming_ord_id (Unset | str): - instructions (Unset | list[OrderInstruction]): - market_condition (Unset | OrderCrossMarketCondition): - optional_data (Unset | OrderCrossOptionalData): - order_flags (Unset | int): - order_updates (Unset | list[OrderUpdateEvent]): - ord_type (Unset | OrdType): - origination_type (Unset | OriginationType): - parent_ord_id (Unset | str): - price (Unset | float): - price_type (Unset | PriceType): - qty (Unset | float): - route (Unset | str): - security (Unset | Security): - source (Unset | str): - source_address (Unset | str): - submit_ts (Unset | str): - symbol (Unset | str): - tag (Unset | str): - text (Unset | str): - tif (Unset | Tif): - user_id (Unset | int): - trader_id (Unset | str): - ord_status (Unset | OrdStatus): - claimed_by (Unset | str): - transact_ts (Unset | str): - has_busts (Unset | bool): - has_corrects (Unset | bool): - has_notes (Unset | bool): - """ - - account_id: Unset | int = UNSET - algo: Unset | OrderCrossAlgo = UNSET - allocations: Unset | list[OrderCrossAllocation] = UNSET - cross_type: Unset | CrossType = UNSET - cur_ord_id: Unset | str = UNSET - header: Unset | Header = UNSET - id_: Unset | str = UNSET - incoming_cl_ord_id: Unset | str = UNSET - incoming_ord_id: Unset | str = UNSET - instructions: Unset | list[OrderInstruction] = UNSET - market_condition: Unset | OrderCrossMarketCondition = UNSET - optional_data: Unset | OrderCrossOptionalData = UNSET - order_flags: Unset | int = UNSET - order_updates: Unset | list[OrderUpdateEvent] = UNSET - ord_type: Unset | OrdType = UNSET - origination_type: Unset | OriginationType = UNSET - parent_ord_id: Unset | str = UNSET - price: Unset | float = UNSET - price_type: Unset | PriceType = UNSET - qty: Unset | float = UNSET - route: Unset | str = UNSET - security: Unset | Security = UNSET - source: Unset | str = UNSET - source_address: Unset | str = UNSET - submit_ts: Unset | str = UNSET - symbol: Unset | str = UNSET - tag: Unset | str = UNSET - text: Unset | str = UNSET - tif: Unset | Tif = UNSET - user_id: Unset | int = UNSET - trader_id: Unset | str = UNSET - ord_status: Unset | OrdStatus = UNSET - claimed_by: Unset | str = UNSET - transact_ts: Unset | str = UNSET - has_busts: Unset | bool = UNSET - has_corrects: Unset | bool = UNSET - has_notes: Unset | bool = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - algo: Unset | dict[str, Any] = ( - UNSET if isinstance(self.algo, Unset) else self.algo.to_dict() - ) - - allocations: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.allocations, Unset): - allocations = [] - for allocations_item_data in self.allocations: - allocations_item = allocations_item_data.to_dict() - allocations.append(allocations_item) - - cross_type: Unset | str = ( - UNSET if isinstance(self.cross_type, Unset) else self.cross_type.value - ) - - cur_ord_id = self.cur_ord_id - - header: Unset | dict[str, Any] = ( - UNSET if isinstance(self.header, Unset) else self.header.to_dict() - ) - - id_ = self.id_ - - incoming_cl_ord_id = self.incoming_cl_ord_id - - incoming_ord_id = self.incoming_ord_id - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - market_condition: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.market_condition, Unset) - else self.market_condition.to_dict() - ) - - optional_data: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.optional_data, Unset) - else self.optional_data.to_dict() - ) - - order_flags = self.order_flags - - order_updates: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.order_updates, Unset): - order_updates = [] - for order_updates_item_data in self.order_updates: - order_updates_item = order_updates_item_data.to_dict() - order_updates.append(order_updates_item) - - ord_type: Unset | str = ( - UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value - ) - - origination_type: Unset | str = ( - UNSET - if isinstance(self.origination_type, Unset) - else self.origination_type.value - ) - - parent_ord_id = self.parent_ord_id - - price = self.price - - price_type: Unset | str = ( - UNSET if isinstance(self.price_type, Unset) else self.price_type.value - ) - - qty = self.qty - - route = self.route - - security: Unset | dict[str, Any] = ( - UNSET if isinstance(self.security, Unset) else self.security.to_dict() - ) - - source = self.source - - source_address = self.source_address - - submit_ts = self.submit_ts - - symbol = self.symbol - - tag = self.tag - - text = self.text - - tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value - - user_id = self.user_id - - trader_id = self.trader_id - - ord_status: Unset | str = ( - UNSET if isinstance(self.ord_status, Unset) else self.ord_status.value - ) - - claimed_by = self.claimed_by - - transact_ts = self.transact_ts - - has_busts = self.has_busts - - has_corrects = self.has_corrects - - has_notes = self.has_notes - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if algo is not UNSET: - field_dict["algo"] = algo - if allocations is not UNSET: - field_dict["allocations"] = allocations - if cross_type is not UNSET: - field_dict["crossType"] = cross_type - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if header is not UNSET: - field_dict["header"] = header - if id_ is not UNSET: - field_dict["id"] = id - if incoming_cl_ord_id is not UNSET: - field_dict["incomingClOrdId"] = incoming_cl_ord_id - if incoming_ord_id is not UNSET: - field_dict["incomingOrdId"] = incoming_ord_id - if instructions is not UNSET: - field_dict["instructions"] = instructions - if market_condition is not UNSET: - field_dict["marketCondition"] = market_condition - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if order_flags is not UNSET: - field_dict["orderFlags"] = order_flags - if order_updates is not UNSET: - field_dict["orderUpdates"] = order_updates - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if origination_type is not UNSET: - field_dict["originationType"] = origination_type - if parent_ord_id is not UNSET: - field_dict["parentOrdId"] = parent_ord_id - if price is not UNSET: - field_dict["price"] = price - if price_type is not UNSET: - field_dict["priceType"] = price_type - if qty is not UNSET: - field_dict["qty"] = qty - if route is not UNSET: - field_dict["route"] = route - if security is not UNSET: - field_dict["security"] = security - if source is not UNSET: - field_dict["source"] = source - if source_address is not UNSET: - field_dict["sourceAddress"] = source_address - if submit_ts is not UNSET: - field_dict["submitTs"] = submit_ts - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tag is not UNSET: - field_dict["tag"] = tag - if text is not UNSET: - field_dict["text"] = text - if tif is not UNSET: - field_dict["tif"] = tif - if user_id is not UNSET: - field_dict["userId"] = user_id - if trader_id is not UNSET: - field_dict["traderId"] = trader_id - if ord_status is not UNSET: - field_dict["ordStatus"] = ord_status - if claimed_by is not UNSET: - field_dict["claimedBy"] = claimed_by - if transact_ts is not UNSET: - field_dict["transactTs"] = transact_ts - if has_busts is not UNSET: - field_dict["hasBusts"] = has_busts - if has_corrects is not UNSET: - field_dict["hasCorrects"] = has_corrects - if has_notes is not UNSET: - field_dict["hasNotes"] = has_notes - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - _algo = d.pop("algo", UNSET) - algo: Unset | OrderCrossAlgo = ( - UNSET if isinstance(_algo, Unset) else OrderCrossAlgo.from_dict(_algo) - ) - - allocations = [] - _allocations = d.pop("allocations", UNSET) - for allocations_item_data in _allocations or []: - allocations_item = OrderCrossAllocation.from_dict(allocations_item_data) - - allocations.append(allocations_item) - - _cross_type = d.pop("crossType", UNSET) - cross_type: Unset | CrossType = ( - UNSET if isinstance(_cross_type, Unset) else CrossType(_cross_type) - ) - - cur_ord_id = d.pop("curOrdId", UNSET) - - _header = d.pop("header", UNSET) - header: Unset | Header = ( - UNSET if isinstance(_header, Unset) else Header.from_dict(_header) - ) - - id_ = d.pop("id", UNSET) - - incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) - - incoming_ord_id = d.pop("incomingOrdId", UNSET) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - _market_condition = d.pop("marketCondition", UNSET) - market_condition: Unset | OrderCrossMarketCondition = ( - UNSET - if isinstance(_market_condition, Unset) - else OrderCrossMarketCondition.from_dict(_market_condition) - ) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | OrderCrossOptionalData = ( - UNSET - if isinstance(_optional_data, Unset) - else OrderCrossOptionalData.from_dict(_optional_data) - ) - - order_flags = d.pop("orderFlags", UNSET) - - order_updates = [] - _order_updates = d.pop("orderUpdates", UNSET) - for order_updates_item_data in _order_updates or []: - order_updates_item = OrderUpdateEvent.from_dict(order_updates_item_data) - - order_updates.append(order_updates_item) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType = ( - UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) - ) - - _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType = ( - UNSET - if isinstance(_origination_type, Unset) - else OriginationType(_origination_type) - ) - - parent_ord_id = d.pop("parentOrdId", UNSET) - - price = d.pop("price", UNSET) - - _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType = ( - UNSET if isinstance(_price_type, Unset) else PriceType(_price_type) - ) - - qty = d.pop("qty", UNSET) - - route = d.pop("route", UNSET) - - _security = d.pop("security", UNSET) - security: Unset | Security = ( - UNSET if isinstance(_security, Unset) else Security.from_dict(_security) - ) - - source = d.pop("source", UNSET) - - source_address = d.pop("sourceAddress", UNSET) - - submit_ts = d.pop("submitTs", UNSET) - - symbol = d.pop("symbol", UNSET) - - tag = d.pop("tag", UNSET) - - text = d.pop("text", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) - - user_id = d.pop("userId", UNSET) - - trader_id = d.pop("traderId", UNSET) - - _ord_status = d.pop("ordStatus", UNSET) - ord_status: Unset | OrdStatus = ( - UNSET if isinstance(_ord_status, Unset) else OrdStatus(_ord_status) - ) - - claimed_by = d.pop("claimedBy", UNSET) - - transact_ts = d.pop("transactTs", UNSET) - - has_busts = d.pop("hasBusts", UNSET) - - has_corrects = d.pop("hasCorrects", UNSET) - - has_notes = d.pop("hasNotes", UNSET) - - order_cross = cls( - account_id=account_id, - algo=algo, - allocations=allocations, - cross_type=cross_type, - cur_ord_id=cur_ord_id, - header=header, - id_=id_, - incoming_cl_ord_id=incoming_cl_ord_id, - incoming_ord_id=incoming_ord_id, - instructions=instructions, - market_condition=market_condition, - optional_data=optional_data, - order_flags=order_flags, - order_updates=order_updates, - ord_type=ord_type, - origination_type=origination_type, - parent_ord_id=parent_ord_id, - price=price, - price_type=price_type, - qty=qty, - route=route, - security=security, - source=source, - source_address=source_address, - submit_ts=submit_ts, - symbol=symbol, - tag=tag, - text=text, - tif=tif, - user_id=user_id, - trader_id=trader_id, - ord_status=ord_status, - claimed_by=claimed_by, - transact_ts=transact_ts, - has_busts=has_busts, - has_corrects=has_corrects, - has_notes=has_notes, - ) - - return order_cross diff --git a/openapi_project/openapi_package/models/order_cross_algo.py b/openapi_project/openapi_package/models/order_cross_algo.py deleted file mode 100644 index 89a5a5e63..000000000 --- a/openapi_project/openapi_package/models/order_cross_algo.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="OrderCrossAlgo") - - -@_attrs_define -class OrderCrossAlgo: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_cross_algo = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_cross_algo.additional_properties = additional_properties - return order_cross_algo - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/order_cross_allocation.py b/openapi_project/openapi_package/models/order_cross_allocation.py deleted file mode 100644 index 7b512a3c2..000000000 --- a/openapi_project/openapi_package/models/order_cross_allocation.py +++ /dev/null @@ -1,257 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.cross_side_type import CrossSideType -from openapi_project.openapi_package.models.ord_status import OrdStatus -from openapi_project.openapi_package.models.position_effect import PositionEffect -from openapi_project.openapi_package.models.side import Side -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.order_cross_allocation_optional_data import OrderCrossAllocationOptionalData - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - - -T = TypeVar("T", bound="OrderCrossAllocation") - - -@_attrs_define -class OrderCrossAllocation: - """ - Attributes: - account_id (Unset | int): - clearing_info (Unset | ClearingInfo): - id_ (Unset | str): - incoming_ord_id (Unset | str): - instructions (Unset | list[OrderInstruction]): - optional_data (Unset | OrderCrossAllocationOptionalData): - position_effect (Unset | PositionEffect): - qty (Unset | float): - side (Unset | Side): - side_type (Unset | CrossSideType): - avg_price (Unset | float): - last_price (Unset | float): - last_qty (Unset | float): - last_market (Unset | str): - leaves_qty (Unset | float): - cum_qty (Unset | float): - transact_ts (Unset | str): - ord_status (Unset | OrdStatus): - """ - - account_id: Unset | int = UNSET - clearing_info: Unset | ClearingInfo = UNSET - id_: Unset | str = UNSET - incoming_ord_id: Unset | str = UNSET - instructions: Unset | list[OrderInstruction] = UNSET - optional_data: Unset | OrderCrossAllocationOptionalData = UNSET - position_effect: Unset | PositionEffect = UNSET - qty: Unset | float = UNSET - side: Unset | Side = UNSET - side_type: Unset | CrossSideType = UNSET - avg_price: Unset | float = UNSET - last_price: Unset | float = UNSET - last_qty: Unset | float = UNSET - last_market: Unset | str = UNSET - leaves_qty: Unset | float = UNSET - cum_qty: Unset | float = UNSET - transact_ts: Unset | str = UNSET - ord_status: Unset | OrdStatus = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - clearing_info: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.clearing_info, Unset) - else self.clearing_info.to_dict() - ) - - id_ = self.id_ - - incoming_ord_id = self.incoming_ord_id - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - optional_data: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.optional_data, Unset) - else self.optional_data.to_dict() - ) - - position_effect: Unset | str = ( - UNSET - if isinstance(self.position_effect, Unset) - else self.position_effect.value - ) - - qty = self.qty - - side: Unset | str = UNSET if isinstance(self.side, Unset) else self.side.value - - side_type: Unset | str = ( - UNSET if isinstance(self.side_type, Unset) else self.side_type.value - ) - - avg_price = self.avg_price - - last_price = self.last_price - - last_qty = self.last_qty - - last_market = self.last_market - - leaves_qty = self.leaves_qty - - cum_qty = self.cum_qty - - transact_ts = self.transact_ts - - ord_status: Unset | str = ( - UNSET if isinstance(self.ord_status, Unset) else self.ord_status.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if clearing_info is not UNSET: - field_dict["clearingInfo"] = clearing_info - if id_ is not UNSET: - field_dict["id"] = id - if incoming_ord_id is not UNSET: - field_dict["incomingOrdId"] = incoming_ord_id - if instructions is not UNSET: - field_dict["instructions"] = instructions - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if position_effect is not UNSET: - field_dict["positionEffect"] = position_effect - if qty is not UNSET: - field_dict["qty"] = qty - if side is not UNSET: - field_dict["side"] = side - if side_type is not UNSET: - field_dict["sideType"] = side_type - if avg_price is not UNSET: - field_dict["avgPrice"] = avg_price - if last_price is not UNSET: - field_dict["lastPrice"] = last_price - if last_qty is not UNSET: - field_dict["lastQty"] = last_qty - if last_market is not UNSET: - field_dict["lastMarket"] = last_market - if leaves_qty is not UNSET: - field_dict["leavesQty"] = leaves_qty - if cum_qty is not UNSET: - field_dict["cumQty"] = cum_qty - if transact_ts is not UNSET: - field_dict["transactTs"] = transact_ts - if ord_status is not UNSET: - field_dict["ordStatus"] = ord_status - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo = ( - UNSET - if isinstance(_clearing_info, Unset) - else ClearingInfo.from_dict(_clearing_info) - ) - - id_ = d.pop("id", UNSET) - - incoming_ord_id = d.pop("incomingOrdId", UNSET) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | OrderCrossAllocationOptionalData = ( - UNSET - if isinstance(_optional_data, Unset) - else OrderCrossAllocationOptionalData.from_dict(_optional_data) - ) - - _position_effect = d.pop("positionEffect", UNSET) - position_effect: Unset | PositionEffect = ( - UNSET - if isinstance(_position_effect, Unset) - else PositionEffect(_position_effect) - ) - - qty = d.pop("qty", UNSET) - - _side = d.pop("side", UNSET) - side: Unset | Side = UNSET if isinstance(_side, Unset) else Side(_side) - - _side_type = d.pop("sideType", UNSET) - side_type: Unset | CrossSideType = ( - UNSET if isinstance(_side_type, Unset) else CrossSideType(_side_type) - ) - - avg_price = d.pop("avgPrice", UNSET) - - last_price = d.pop("lastPrice", UNSET) - - last_qty = d.pop("lastQty", UNSET) - - last_market = d.pop("lastMarket", UNSET) - - leaves_qty = d.pop("leavesQty", UNSET) - - cum_qty = d.pop("cumQty", UNSET) - - transact_ts = d.pop("transactTs", UNSET) - - _ord_status = d.pop("ordStatus", UNSET) - ord_status: Unset | OrdStatus = ( - UNSET if isinstance(_ord_status, Unset) else OrdStatus(_ord_status) - ) - - order_cross_allocation = cls( - account_id=account_id, - clearing_info=clearing_info, - id_=id_, - incoming_ord_id=incoming_ord_id, - instructions=instructions, - optional_data=optional_data, - position_effect=position_effect, - qty=qty, - side=side, - side_type=side_type, - avg_price=avg_price, - last_price=last_price, - last_qty=last_qty, - last_market=last_market, - leaves_qty=leaves_qty, - cum_qty=cum_qty, - transact_ts=transact_ts, - ord_status=ord_status, - ) - - return order_cross_allocation diff --git a/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py b/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py deleted file mode 100644 index f3f6374de..000000000 --- a/openapi_project/openapi_package/models/order_cross_allocation_optional_data.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="OrderCrossAllocationOptionalData") - - -@_attrs_define -class OrderCrossAllocationOptionalData: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_cross_allocation_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_cross_allocation_optional_data.additional_properties = ( - additional_properties - ) - return order_cross_allocation_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/order_cross_market_condition.py b/openapi_project/openapi_package/models/order_cross_market_condition.py deleted file mode 100644 index 5eb7d9749..000000000 --- a/openapi_project/openapi_package/models/order_cross_market_condition.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="OrderCrossMarketCondition") - - -@_attrs_define -class OrderCrossMarketCondition: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_cross_market_condition = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_cross_market_condition.additional_properties = additional_properties - return order_cross_market_condition - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/order_cross_optional_data.py b/openapi_project/openapi_package/models/order_cross_optional_data.py deleted file mode 100644 index 83004bc55..000000000 --- a/openapi_project/openapi_package/models/order_cross_optional_data.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="OrderCrossOptionalData") - - -@_attrs_define -class OrderCrossOptionalData: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_cross_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_cross_optional_data.additional_properties = additional_properties - return order_cross_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/order_delete.py b/openapi_project/openapi_package/models/order_delete.py deleted file mode 100644 index 7c066ce5d..000000000 --- a/openapi_project/openapi_package/models/order_delete.py +++ /dev/null @@ -1,114 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.origination_type import OriginationType -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_delete_optional_data import OrderDeleteOptionalData - - -T = TypeVar("T", bound="OrderDelete") - - -@_attrs_define -class OrderDelete: - """ - Attributes: - cur_ord_id (Unset | str): - optional_data (Unset | OrderDeleteOptionalData): - origination_type (Unset | OriginationType): - perm_ord_id (Unset | str): - trader_id (Unset | str): - submit_ts (Unset | str): - """ - - cur_ord_id: Unset | str = UNSET - optional_data: Unset | OrderDeleteOptionalData = UNSET - origination_type: Unset | OriginationType = UNSET - perm_ord_id: Unset | str = UNSET - trader_id: Unset | str = UNSET - submit_ts: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - cur_ord_id = self.cur_ord_id - - optional_data: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.optional_data, Unset) - else self.optional_data.to_dict() - ) - - origination_type: Unset | str = ( - UNSET - if isinstance(self.origination_type, Unset) - else self.origination_type.value - ) - - perm_ord_id = self.perm_ord_id - - trader_id = self.trader_id - - submit_ts = self.submit_ts - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if origination_type is not UNSET: - field_dict["originationType"] = origination_type - if perm_ord_id is not UNSET: - field_dict["permOrdId"] = perm_ord_id - if trader_id is not UNSET: - field_dict["traderId"] = trader_id - if submit_ts is not UNSET: - field_dict["submitTs"] = submit_ts - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - cur_ord_id = d.pop("curOrdId", UNSET) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | OrderDeleteOptionalData = ( - UNSET - if isinstance(_optional_data, Unset) - else OrderDeleteOptionalData.from_dict(_optional_data) - ) - - _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType = ( - UNSET - if isinstance(_origination_type, Unset) - else OriginationType(_origination_type) - ) - - perm_ord_id = d.pop("permOrdId", UNSET) - - trader_id = d.pop("traderId", UNSET) - - submit_ts = d.pop("submitTs", UNSET) - - order_delete = cls( - cur_ord_id=cur_ord_id, - optional_data=optional_data, - origination_type=origination_type, - perm_ord_id=perm_ord_id, - trader_id=trader_id, - submit_ts=submit_ts, - ) - - return order_delete diff --git a/openapi_project/openapi_package/models/order_delete_optional_data.py b/openapi_project/openapi_package/models/order_delete_optional_data.py deleted file mode 100644 index fc70a5e19..000000000 --- a/openapi_project/openapi_package/models/order_delete_optional_data.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="OrderDeleteOptionalData") - - -@_attrs_define -class OrderDeleteOptionalData: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_delete_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_delete_optional_data.additional_properties = additional_properties - return order_delete_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/order_instruction.py b/openapi_project/openapi_package/models/order_instruction.py deleted file mode 100644 index 12baff755..000000000 --- a/openapi_project/openapi_package/models/order_instruction.py +++ /dev/null @@ -1,61 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.order_instruction_type import OrderInstructionType -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="OrderInstruction") - - -@_attrs_define -class OrderInstruction: - """ - Attributes: - type_ (Unset | OrderInstructionType): - value (Unset | str): - """ - - type_: Unset | OrderInstructionType = UNSET - value: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - type_: Unset | str = ( - UNSET if isinstance(self.type_, Unset) else self.type_.value - ) - - value = self.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if type_ is not UNSET: - field_dict["type"] = type_ - if value is not UNSET: - field_dict["value"] = value - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _type_ = d.pop("type", UNSET) - type_: Unset | OrderInstructionType = ( - UNSET if isinstance(_type_, Unset) else OrderInstructionType(_type_) - ) - - value = d.pop("value", UNSET) - - order_instruction = cls( - type_=type_, - value=value, - ) - - return order_instruction diff --git a/openapi_project/openapi_package/models/order_instruction_type.py b/openapi_project/openapi_package/models/order_instruction_type.py deleted file mode 100644 index 2dc45378a..000000000 --- a/openapi_project/openapi_package/models/order_instruction_type.py +++ /dev/null @@ -1,91 +0,0 @@ -from enum import Enum - - -class OrderInstructionType(str, Enum): - ORDER_INSTRUCTION_TYPE_ALL_OR_NONE = "ORDER_INSTRUCTION_TYPE_ALL_OR_NONE" - ORDER_INSTRUCTION_TYPE_AUCTION_ID = "ORDER_INSTRUCTION_TYPE_AUCTION_ID" - ORDER_INSTRUCTION_TYPE_AUTO_MATCH = "ORDER_INSTRUCTION_TYPE_AUTO_MATCH" - ORDER_INSTRUCTION_TYPE_AUTO_MATCH_PRICE = "ORDER_INSTRUCTION_TYPE_AUTO_MATCH_PRICE" - ORDER_INSTRUCTION_TYPE_BROKER_PERCENTAGE = ( - "ORDER_INSTRUCTION_TYPE_BROKER_PERCENTAGE" - ) - ORDER_INSTRUCTION_TYPE_CLIENT_ID = "ORDER_INSTRUCTION_TYPE_CLIENT_ID" - ORDER_INSTRUCTION_TYPE_COMMISSION = "ORDER_INSTRUCTION_TYPE_COMMISSION" - ORDER_INSTRUCTION_TYPE_COMPRESSION = "ORDER_INSTRUCTION_TYPE_COMPRESSION" - ORDER_INSTRUCTION_TYPE_CROSS_PRIORITIZATION = ( - "ORDER_INSTRUCTION_TYPE_CROSS_PRIORITIZATION" - ) - ORDER_INSTRUCTION_TYPE_DO_NOT_REDUCE = "ORDER_INSTRUCTION_TYPE_DO_NOT_REDUCE" - ORDER_INSTRUCTION_TYPE_DO_NOT_ROUTE = "ORDER_INSTRUCTION_TYPE_DO_NOT_ROUTE" - ORDER_INSTRUCTION_TYPE_DROP = "ORDER_INSTRUCTION_TYPE_DROP" - ORDER_INSTRUCTION_TYPE_EQUITY_BUY_CLEARING_FIRM = ( - "ORDER_INSTRUCTION_TYPE_EQUITY_BUY_CLEARING_FIRM" - ) - ORDER_INSTRUCTION_TYPE_EQUITY_EX_DESTINATION = ( - "ORDER_INSTRUCTION_TYPE_EQUITY_EX_DESTINATION" - ) - ORDER_INSTRUCTION_TYPE_EQUITY_PARTY_ID = "ORDER_INSTRUCTION_TYPE_EQUITY_PARTY_ID" - ORDER_INSTRUCTION_TYPE_EQUITY_SELL_CLEARING_FIRM = ( - "ORDER_INSTRUCTION_TYPE_EQUITY_SELL_CLEARING_FIRM" - ) - ORDER_INSTRUCTION_TYPE_EQUITY_TRADE_PRICE = ( - "ORDER_INSTRUCTION_TYPE_EQUITY_TRADE_PRICE" - ) - ORDER_INSTRUCTION_TYPE_EQUITY_TRADE_SIZE = ( - "ORDER_INSTRUCTION_TYPE_EQUITY_TRADE_SIZE" - ) - ORDER_INSTRUCTION_TYPE_EQUITY_TRADE_VENUE = ( - "ORDER_INSTRUCTION_TYPE_EQUITY_TRADE_VENUE" - ) - ORDER_INSTRUCTION_TYPE_EQUITY_TRANSACT_TS = ( - "ORDER_INSTRUCTION_TYPE_EQUITY_TRANSACT_TS" - ) - ORDER_INSTRUCTION_TYPE_FLEX_AUCTION_DURATION = ( - "ORDER_INSTRUCTION_TYPE_FLEX_AUCTION_DURATION" - ) - ORDER_INSTRUCTION_TYPE_FLEX_HEDGE_EXEC_INST = ( - "ORDER_INSTRUCTION_TYPE_FLEX_HEDGE_EXEC_INST" - ) - ORDER_INSTRUCTION_TYPE_FLEX_PRE_FACIL_PRICE = ( - "ORDER_INSTRUCTION_TYPE_FLEX_PRE_FACIL_PRICE" - ) - ORDER_INSTRUCTION_TYPE_FREQUENT_TRADER = "ORDER_INSTRUCTION_TYPE_FREQUENT_TRADER" - ORDER_INSTRUCTION_TYPE_FREQUENT_TRADER_ID = ( - "ORDER_INSTRUCTION_TYPE_FREQUENT_TRADER_ID" - ) - ORDER_INSTRUCTION_TYPE_GOOD_TILL_DATE = "ORDER_INSTRUCTION_TYPE_GOOD_TILL_DATE" - ORDER_INSTRUCTION_TYPE_HELD = "ORDER_INSTRUCTION_TYPE_HELD" - ORDER_INSTRUCTION_TYPE_INTERMARKET_SWEEP = ( - "ORDER_INSTRUCTION_TYPE_INTERMARKET_SWEEP" - ) - ORDER_INSTRUCTION_TYPE_LAST_PRIORITY = "ORDER_INSTRUCTION_TYPE_LAST_PRIORITY" - ORDER_INSTRUCTION_TYPE_MAX_FLOOR = "ORDER_INSTRUCTION_TYPE_MAX_FLOOR" - ORDER_INSTRUCTION_TYPE_MIN_QTY = "ORDER_INSTRUCTION_TYPE_MIN_QTY" - ORDER_INSTRUCTION_TYPE_NONE = "ORDER_INSTRUCTION_TYPE_NONE" - ORDER_INSTRUCTION_TYPE_NOT_HELD = "ORDER_INSTRUCTION_TYPE_NOT_HELD" - ORDER_INSTRUCTION_TYPE_NO_COA = "ORDER_INSTRUCTION_TYPE_NO_COA" - ORDER_INSTRUCTION_TYPE_ORDER_ORIGIN = "ORDER_INSTRUCTION_TYPE_ORDER_ORIGIN" - ORDER_INSTRUCTION_TYPE_O_R_S = "ORDER_INSTRUCTION_TYPE_O_R_S" - ORDER_INSTRUCTION_TYPE_PEG_DIFFERENCE = "ORDER_INSTRUCTION_TYPE_PEG_DIFFERENCE" - ORDER_INSTRUCTION_TYPE_PEG_TYPE = "ORDER_INSTRUCTION_TYPE_PEG_TYPE" - ORDER_INSTRUCTION_TYPE_PHLX_QCC = "ORDER_INSTRUCTION_TYPE_PHLX_QCC" - ORDER_INSTRUCTION_TYPE_PREFERRED_M_M = "ORDER_INSTRUCTION_TYPE_PREFERRED_M_M" - ORDER_INSTRUCTION_TYPE_REPRESENT = "ORDER_INSTRUCTION_TYPE_REPRESENT" - ORDER_INSTRUCTION_TYPE_ROUTE_STRATEGY = "ORDER_INSTRUCTION_TYPE_ROUTE_STRATEGY" - ORDER_INSTRUCTION_TYPE_ROUTING_FIRM_ID = "ORDER_INSTRUCTION_TYPE_ROUTING_FIRM_ID" - ORDER_INSTRUCTION_TYPE_ROUTING_INST = "ORDER_INSTRUCTION_TYPE_ROUTING_INST" - ORDER_INSTRUCTION_TYPE_SESSION_ELIGIBILITY = ( - "ORDER_INSTRUCTION_TYPE_SESSION_ELIGIBILITY" - ) - ORDER_INSTRUCTION_TYPE_SETTLEMENT_LIQUIDITY = ( - "ORDER_INSTRUCTION_TYPE_SETTLEMENT_LIQUIDITY" - ) - ORDER_INSTRUCTION_TYPE_SOLICITED = "ORDER_INSTRUCTION_TYPE_SOLICITED" - ORDER_INSTRUCTION_TYPE_SPX_COMBO = "ORDER_INSTRUCTION_TYPE_SPX_COMBO" - ORDER_INSTRUCTION_TYPE_STEP_UP_PX = "ORDER_INSTRUCTION_TYPE_STEP_UP_PX" - ORDER_INSTRUCTION_TYPE_STRATEGY_ID = "ORDER_INSTRUCTION_TYPE_STRATEGY_ID" - ORDER_INSTRUCTION_TYPE_SWEEP = "ORDER_INSTRUCTION_TYPE_SWEEP" - ORDER_INSTRUCTION_TYPE_TIED_HEDGE = "ORDER_INSTRUCTION_TYPE_TIED_HEDGE" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/order_market_condition.py b/openapi_project/openapi_package/models/order_market_condition.py deleted file mode 100644 index 0cbc064c2..000000000 --- a/openapi_project/openapi_package/models/order_market_condition.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="OrderMarketCondition") - - -@_attrs_define -class OrderMarketCondition: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_market_condition = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_market_condition.additional_properties = additional_properties - return order_market_condition - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/order_optional_data.py b/openapi_project/openapi_package/models/order_optional_data.py deleted file mode 100644 index f28efe4e8..000000000 --- a/openapi_project/openapi_package/models/order_optional_data.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="OrderOptionalData") - - -@_attrs_define -class OrderOptionalData: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_optional_data.additional_properties = additional_properties - return order_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/order_type.py b/openapi_project/openapi_package/models/order_type.py deleted file mode 100644 index f59ced1fa..000000000 --- a/openapi_project/openapi_package/models/order_type.py +++ /dev/null @@ -1,12 +0,0 @@ -from enum import Enum - - -class OrderType(str, Enum): - ORDER_TYPE_MULTI_LEG_ORDER = "ORDER_TYPE_MULTI_LEG_ORDER" - ORDER_TYPE_MULTI_LEG_ORDER_CROSS = "ORDER_TYPE_MULTI_LEG_ORDER_CROSS" - ORDER_TYPE_ORDER = "ORDER_TYPE_ORDER" - ORDER_TYPE_ORDER_CROSS = "ORDER_TYPE_ORDER_CROSS" - ORDER_TYPE_UNKNOWN = "ORDER_TYPE_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/order_update.py b/openapi_project/openapi_package/models/order_update.py deleted file mode 100644 index fe44f3d3c..000000000 --- a/openapi_project/openapi_package/models/order_update.py +++ /dev/null @@ -1,606 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.exec_type import ExecType -from openapi_project.openapi_package.models.multi_leg_reporting_type import MultiLegReportingType -from openapi_project.openapi_package.models.ord_status import OrdStatus -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.origination_type import OriginationType -from openapi_project.openapi_package.models.position_effect import PositionEffect -from openapi_project.openapi_package.models.price_type import PriceType -from openapi_project.openapi_package.models.side import Side -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_update_optional_data import OrderUpdateOptionalData - from openapi_project.openapi_package.models.security import Security - from openapi_project.openapi_package.models.order_instruction import OrderInstruction - from openapi_project.openapi_package.models.header import Header - from openapi_project.openapi_package.models.order_update_algo import OrderUpdateAlgo - from openapi_project.openapi_package.models.clearing_info import ClearingInfo - - -T = TypeVar("T", bound="OrderUpdate") - - -@_attrs_define -class OrderUpdate: - """ - Attributes: - account_id (Unset | int): - algo (Unset | OrderUpdateAlgo): - alloc_id (Unset | str): - aux_price (Unset | float): - avg_price (Unset | float): - clearing_info (Unset | ClearingInfo): - commission (Unset | float): - cum_qty (Unset | float): - cur_ord_id (Unset | str): - exec_broker (Unset | str): - exec_id (Unset | str): - exec_ref_id (Unset | str): - exec_type (Unset | ExecType): - fee1 (Unset | float): - fee2 (Unset | float): - header (Unset | Header): - incoming_cl_ord_id (Unset | str): - incoming_ord_id (Unset | str): - incoming_orig_cl_ord_id (Unset | str): - instructions (Unset | list[OrderInstruction]): - last_market (Unset | str): - last_price (Unset | float): - last_qty (Unset | float): - leaves_qty (Unset | float): - leg_id (Unset | str): - liquidity_flag (Unset | str): - multi_leg_reporting_type (Unset | MultiLegReportingType): - notes (Unset | str): - optional_data (Unset | OrderUpdateOptionalData): - order_flags (Unset | int): - ord_status (Unset | OrdStatus): - ord_type (Unset | OrdType): - origination_type (Unset | OriginationType): - orig_ord_id (Unset | str): - parent_ord_id (Unset | str): - perm_ord_id (Unset | str): - position_effect (Unset | PositionEffect): - price (Unset | float): - price_type (Unset | PriceType): - qty (Unset | float): - route (Unset | str): - security (Unset | Security): - side (Unset | Side): - source (Unset | str): - symbol (Unset | str): - tag (Unset | str): - text (Unset | str): - tif (Unset | Tif): - trader_id (Unset | str): - transact_ts (Unset | str): - working_qty (Unset | float): - """ - - account_id: Unset | int = UNSET - algo: Unset | OrderUpdateAlgo = UNSET - alloc_id: Unset | str = UNSET - aux_price: Unset | float = UNSET - avg_price: Unset | float = UNSET - clearing_info: Unset | ClearingInfo = UNSET - commission: Unset | float = UNSET - cum_qty: Unset | float = UNSET - cur_ord_id: Unset | str = UNSET - exec_broker: Unset | str = UNSET - exec_id: Unset | str = UNSET - exec_ref_id: Unset | str = UNSET - exec_type: Unset | ExecType = UNSET - fee1: Unset | float = UNSET - fee2: Unset | float = UNSET - header: Unset | Header = UNSET - incoming_cl_ord_id: Unset | str = UNSET - incoming_ord_id: Unset | str = UNSET - incoming_orig_cl_ord_id: Unset | str = UNSET - instructions: Unset | list[OrderInstruction] = UNSET - last_market: Unset | str = UNSET - last_price: Unset | float = UNSET - last_qty: Unset | float = UNSET - leaves_qty: Unset | float = UNSET - leg_id: Unset | str = UNSET - liquidity_flag: Unset | str = UNSET - multi_leg_reporting_type: Unset | MultiLegReportingType = UNSET - notes: Unset | str = UNSET - optional_data: Unset | OrderUpdateOptionalData = UNSET - order_flags: Unset | int = UNSET - ord_status: Unset | OrdStatus = UNSET - ord_type: Unset | OrdType = UNSET - origination_type: Unset | OriginationType = UNSET - orig_ord_id: Unset | str = UNSET - parent_ord_id: Unset | str = UNSET - perm_ord_id: Unset | str = UNSET - position_effect: Unset | PositionEffect = UNSET - price: Unset | float = UNSET - price_type: Unset | PriceType = UNSET - qty: Unset | float = UNSET - route: Unset | str = UNSET - security: Unset | Security = UNSET - side: Unset | Side = UNSET - source: Unset | str = UNSET - symbol: Unset | str = UNSET - tag: Unset | str = UNSET - text: Unset | str = UNSET - tif: Unset | Tif = UNSET - trader_id: Unset | str = UNSET - transact_ts: Unset | str = UNSET - working_qty: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - algo: Unset | dict[str, Any] = ( - UNSET if isinstance(self.algo, Unset) else self.algo.to_dict() - ) - - alloc_id = self.alloc_id - - aux_price = self.aux_price - - avg_price = self.avg_price - - clearing_info: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.clearing_info, Unset) - else self.clearing_info.to_dict() - ) - - commission = self.commission - - cum_qty = self.cum_qty - - cur_ord_id = self.cur_ord_id - - exec_broker = self.exec_broker - - exec_id = self.exec_id - - exec_ref_id = self.exec_ref_id - - exec_type: Unset | str = ( - UNSET if isinstance(self.exec_type, Unset) else self.exec_type.value - ) - - fee1 = self.fee1 - - fee2 = self.fee2 - - header: Unset | dict[str, Any] = ( - UNSET if isinstance(self.header, Unset) else self.header.to_dict() - ) - - incoming_cl_ord_id = self.incoming_cl_ord_id - - incoming_ord_id = self.incoming_ord_id - - incoming_orig_cl_ord_id = self.incoming_orig_cl_ord_id - - instructions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.instructions, Unset): - instructions = [] - for instructions_item_data in self.instructions: - instructions_item = instructions_item_data.to_dict() - instructions.append(instructions_item) - - last_market = self.last_market - - last_price = self.last_price - - last_qty = self.last_qty - - leaves_qty = self.leaves_qty - - leg_id = self.leg_id - - liquidity_flag = self.liquidity_flag - - multi_leg_reporting_type: Unset | str = ( - UNSET - if isinstance(self.multi_leg_reporting_type, Unset) - else self.multi_leg_reporting_type.value - ) - - notes = self.notes - - optional_data: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.optional_data, Unset) - else self.optional_data.to_dict() - ) - - order_flags = self.order_flags - - ord_status: Unset | str = ( - UNSET if isinstance(self.ord_status, Unset) else self.ord_status.value - ) - - ord_type: Unset | str = ( - UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value - ) - - origination_type: Unset | str = ( - UNSET - if isinstance(self.origination_type, Unset) - else self.origination_type.value - ) - - orig_ord_id = self.orig_ord_id - - parent_ord_id = self.parent_ord_id - - perm_ord_id = self.perm_ord_id - - position_effect: Unset | str = ( - UNSET - if isinstance(self.position_effect, Unset) - else self.position_effect.value - ) - - price = self.price - - price_type: Unset | str = ( - UNSET if isinstance(self.price_type, Unset) else self.price_type.value - ) - - qty = self.qty - - route = self.route - - security: Unset | dict[str, Any] = ( - UNSET if isinstance(self.security, Unset) else self.security.to_dict() - ) - - side: Unset | str = UNSET if isinstance(self.side, Unset) else self.side.value - - source = self.source - - symbol = self.symbol - - tag = self.tag - - text = self.text - - tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value - - trader_id = self.trader_id - - transact_ts = self.transact_ts - - working_qty = self.working_qty - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if algo is not UNSET: - field_dict["Algo"] = algo - if alloc_id is not UNSET: - field_dict["allocId"] = alloc_id - if aux_price is not UNSET: - field_dict["auxPrice"] = aux_price - if avg_price is not UNSET: - field_dict["avgPrice"] = avg_price - if clearing_info is not UNSET: - field_dict["clearingInfo"] = clearing_info - if commission is not UNSET: - field_dict["commission"] = commission - if cum_qty is not UNSET: - field_dict["cumQty"] = cum_qty - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if exec_broker is not UNSET: - field_dict["execBroker"] = exec_broker - if exec_id is not UNSET: - field_dict["execId"] = exec_id - if exec_ref_id is not UNSET: - field_dict["execRefId"] = exec_ref_id - if exec_type is not UNSET: - field_dict["execType"] = exec_type - if fee1 is not UNSET: - field_dict["fee1"] = fee1 - if fee2 is not UNSET: - field_dict["fee2"] = fee2 - if header is not UNSET: - field_dict["header"] = header - if incoming_cl_ord_id is not UNSET: - field_dict["incomingClOrdId"] = incoming_cl_ord_id - if incoming_ord_id is not UNSET: - field_dict["incomingOrdId"] = incoming_ord_id - if incoming_orig_cl_ord_id is not UNSET: - field_dict["incomingOrigClOrdId"] = incoming_orig_cl_ord_id - if instructions is not UNSET: - field_dict["instructions"] = instructions - if last_market is not UNSET: - field_dict["lastMarket"] = last_market - if last_price is not UNSET: - field_dict["lastPrice"] = last_price - if last_qty is not UNSET: - field_dict["lastQty"] = last_qty - if leaves_qty is not UNSET: - field_dict["leavesQty"] = leaves_qty - if leg_id is not UNSET: - field_dict["legId"] = leg_id - if liquidity_flag is not UNSET: - field_dict["liquidityFlag"] = liquidity_flag - if multi_leg_reporting_type is not UNSET: - field_dict["multiLegReportingType"] = multi_leg_reporting_type - if notes is not UNSET: - field_dict["Notes"] = notes - if optional_data is not UNSET: - field_dict["optionalData"] = optional_data - if order_flags is not UNSET: - field_dict["orderFlags"] = order_flags - if ord_status is not UNSET: - field_dict["ordStatus"] = ord_status - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if origination_type is not UNSET: - field_dict["originationType"] = origination_type - if orig_ord_id is not UNSET: - field_dict["origOrdId"] = orig_ord_id - if parent_ord_id is not UNSET: - field_dict["parentOrdId"] = parent_ord_id - if perm_ord_id is not UNSET: - field_dict["permOrdId"] = perm_ord_id - if position_effect is not UNSET: - field_dict["positionEffect"] = position_effect - if price is not UNSET: - field_dict["price"] = price - if price_type is not UNSET: - field_dict["priceType"] = price_type - if qty is not UNSET: - field_dict["qty"] = qty - if route is not UNSET: - field_dict["route"] = route - if security is not UNSET: - field_dict["security"] = security - if side is not UNSET: - field_dict["side"] = side - if source is not UNSET: - field_dict["source"] = source - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tag is not UNSET: - field_dict["tag"] = tag - if text is not UNSET: - field_dict["text"] = text - if tif is not UNSET: - field_dict["tif"] = tif - if trader_id is not UNSET: - field_dict["traderId"] = trader_id - if transact_ts is not UNSET: - field_dict["transactTs"] = transact_ts - if working_qty is not UNSET: - field_dict["workingQty"] = working_qty - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - _algo = d.pop("Algo", UNSET) - algo: Unset | OrderUpdateAlgo = ( - UNSET if isinstance(_algo, Unset) else OrderUpdateAlgo.from_dict(_algo) - ) - - alloc_id = d.pop("allocId", UNSET) - - aux_price = d.pop("auxPrice", UNSET) - - avg_price = d.pop("avgPrice", UNSET) - - _clearing_info = d.pop("clearingInfo", UNSET) - clearing_info: Unset | ClearingInfo = ( - UNSET - if isinstance(_clearing_info, Unset) - else ClearingInfo.from_dict(_clearing_info) - ) - - commission = d.pop("commission", UNSET) - - cum_qty = d.pop("cumQty", UNSET) - - cur_ord_id = d.pop("curOrdId", UNSET) - - exec_broker = d.pop("execBroker", UNSET) - - exec_id = d.pop("execId", UNSET) - - exec_ref_id = d.pop("execRefId", UNSET) - - _exec_type = d.pop("execType", UNSET) - exec_type: Unset | ExecType = ( - UNSET if isinstance(_exec_type, Unset) else ExecType(_exec_type) - ) - - fee1 = d.pop("fee1", UNSET) - - fee2 = d.pop("fee2", UNSET) - - _header = d.pop("header", UNSET) - header: Unset | Header = ( - UNSET if isinstance(_header, Unset) else Header.from_dict(_header) - ) - - incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) - - incoming_ord_id = d.pop("incomingOrdId", UNSET) - - incoming_orig_cl_ord_id = d.pop("incomingOrigClOrdId", UNSET) - - instructions = [] - _instructions = d.pop("instructions", UNSET) - for instructions_item_data in _instructions or []: - instructions_item = OrderInstruction.from_dict(instructions_item_data) - - instructions.append(instructions_item) - - last_market = d.pop("lastMarket", UNSET) - - last_price = d.pop("lastPrice", UNSET) - - last_qty = d.pop("lastQty", UNSET) - - leaves_qty = d.pop("leavesQty", UNSET) - - leg_id = d.pop("legId", UNSET) - - liquidity_flag = d.pop("liquidityFlag", UNSET) - - _multi_leg_reporting_type = d.pop("multiLegReportingType", UNSET) - multi_leg_reporting_type: Unset | MultiLegReportingType = ( - UNSET - if isinstance(_multi_leg_reporting_type, Unset) - else MultiLegReportingType(_multi_leg_reporting_type) - ) - - notes = d.pop("Notes", UNSET) - - _optional_data = d.pop("optionalData", UNSET) - optional_data: Unset | OrderUpdateOptionalData = ( - UNSET - if isinstance(_optional_data, Unset) - else OrderUpdateOptionalData.from_dict(_optional_data) - ) - - order_flags = d.pop("orderFlags", UNSET) - - _ord_status = d.pop("ordStatus", UNSET) - ord_status: Unset | OrdStatus = ( - UNSET if isinstance(_ord_status, Unset) else OrdStatus(_ord_status) - ) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType = ( - UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) - ) - - _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType = ( - UNSET - if isinstance(_origination_type, Unset) - else OriginationType(_origination_type) - ) - - orig_ord_id = d.pop("origOrdId", UNSET) - - parent_ord_id = d.pop("parentOrdId", UNSET) - - perm_ord_id = d.pop("permOrdId", UNSET) - - _position_effect = d.pop("positionEffect", UNSET) - position_effect: Unset | PositionEffect = ( - UNSET - if isinstance(_position_effect, Unset) - else PositionEffect(_position_effect) - ) - - price = d.pop("price", UNSET) - - _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType = ( - UNSET if isinstance(_price_type, Unset) else PriceType(_price_type) - ) - - qty = d.pop("qty", UNSET) - - route = d.pop("route", UNSET) - - _security = d.pop("security", UNSET) - security: Unset | Security = ( - UNSET if isinstance(_security, Unset) else Security.from_dict(_security) - ) - - _side = d.pop("side", UNSET) - side: Unset | Side = UNSET if isinstance(_side, Unset) else Side(_side) - - source = d.pop("source", UNSET) - - symbol = d.pop("symbol", UNSET) - - tag = d.pop("tag", UNSET) - - text = d.pop("text", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) - - trader_id = d.pop("traderId", UNSET) - - transact_ts = d.pop("transactTs", UNSET) - - working_qty = d.pop("workingQty", UNSET) - - order_update = cls( - account_id=account_id, - algo=algo, - alloc_id=alloc_id, - aux_price=aux_price, - avg_price=avg_price, - clearing_info=clearing_info, - commission=commission, - cum_qty=cum_qty, - cur_ord_id=cur_ord_id, - exec_broker=exec_broker, - exec_id=exec_id, - exec_ref_id=exec_ref_id, - exec_type=exec_type, - fee1=fee1, - fee2=fee2, - header=header, - incoming_cl_ord_id=incoming_cl_ord_id, - incoming_ord_id=incoming_ord_id, - incoming_orig_cl_ord_id=incoming_orig_cl_ord_id, - instructions=instructions, - last_market=last_market, - last_price=last_price, - last_qty=last_qty, - leaves_qty=leaves_qty, - leg_id=leg_id, - liquidity_flag=liquidity_flag, - multi_leg_reporting_type=multi_leg_reporting_type, - notes=notes, - optional_data=optional_data, - order_flags=order_flags, - ord_status=ord_status, - ord_type=ord_type, - origination_type=origination_type, - orig_ord_id=orig_ord_id, - parent_ord_id=parent_ord_id, - perm_ord_id=perm_ord_id, - position_effect=position_effect, - price=price, - price_type=price_type, - qty=qty, - route=route, - security=security, - side=side, - source=source, - symbol=symbol, - tag=tag, - text=text, - tif=tif, - trader_id=trader_id, - transact_ts=transact_ts, - working_qty=working_qty, - ) - - return order_update diff --git a/openapi_project/openapi_package/models/order_update_algo.py b/openapi_project/openapi_package/models/order_update_algo.py deleted file mode 100644 index fca1af30f..000000000 --- a/openapi_project/openapi_package/models/order_update_algo.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="OrderUpdateAlgo") - - -@_attrs_define -class OrderUpdateAlgo: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_update_algo = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_update_algo.additional_properties = additional_properties - return order_update_algo - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/order_update_event.py b/openapi_project/openapi_package/models/order_update_event.py deleted file mode 100644 index 88afe5b3d..000000000 --- a/openapi_project/openapi_package/models/order_update_event.py +++ /dev/null @@ -1,179 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.order_cancel_reject import OrderCancelReject - from openapi_project.openapi_package.models.order_cancel_request import OrderCancelRequest - from openapi_project.openapi_package.models.multi_leg_order_cancel_replace_request import MultiLegOrderCancelReplaceRequest - from openapi_project.openapi_package.models.order_delete import OrderDelete - from openapi_project.openapi_package.models.execution import Execution - from openapi_project.openapi_package.models.order_update import OrderUpdate - from openapi_project.openapi_package.models.order_cancel_replace_request import OrderCancelReplaceRequest - - -T = TypeVar("T", bound="OrderUpdateEvent") - - -@_attrs_define -class OrderUpdateEvent: - """ - Attributes: - order_cancel_request (Unset | OrderCancelRequest): - order_cancel_replace_request (Unset | OrderCancelReplaceRequest): - multi_leg_order_cancel_replace_request (Unset | MultiLegOrderCancelReplaceRequest): - execution (Unset | Execution): - order_update (Unset | OrderUpdate): - order_delete (Unset | OrderDelete): - order_cancel_reject (Unset | OrderCancelReject): - """ - - order_cancel_request: Unset | OrderCancelRequest = UNSET - order_cancel_replace_request: Unset | OrderCancelReplaceRequest = UNSET - multi_leg_order_cancel_replace_request: ( - Unset | MultiLegOrderCancelReplaceRequest - ) = UNSET - execution: Unset | Execution = UNSET - order_update: Unset | OrderUpdate = UNSET - order_delete: Unset | OrderDelete = UNSET - order_cancel_reject: Unset | OrderCancelReject = UNSET - - def to_dict(self) -> dict[str, Any]: - order_cancel_request: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.order_cancel_request, Unset) - else self.order_cancel_request.to_dict() - ) - - order_cancel_replace_request: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.order_cancel_replace_request, Unset) - else self.order_cancel_replace_request.to_dict() - ) - - multi_leg_order_cancel_replace_request: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.multi_leg_order_cancel_replace_request, Unset) - else self.multi_leg_order_cancel_replace_request.to_dict() - ) - - execution: Unset | dict[str, Any] = ( - UNSET if isinstance(self.execution, Unset) else self.execution.to_dict() - ) - - order_update: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.order_update, Unset) - else self.order_update.to_dict() - ) - - order_delete: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.order_delete, Unset) - else self.order_delete.to_dict() - ) - - order_cancel_reject: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.order_cancel_reject, Unset) - else self.order_cancel_reject.to_dict() - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if order_cancel_request is not UNSET: - field_dict["orderCancelRequest"] = order_cancel_request - if order_cancel_replace_request is not UNSET: - field_dict["orderCancelReplaceRequest"] = order_cancel_replace_request - if multi_leg_order_cancel_replace_request is not UNSET: - field_dict["multiLegOrderCancelReplaceRequest"] = ( - multi_leg_order_cancel_replace_request - ) - if execution is not UNSET: - field_dict["execution"] = execution - if order_update is not UNSET: - field_dict["orderUpdate"] = order_update - if order_delete is not UNSET: - field_dict["orderDelete"] = order_delete - if order_cancel_reject is not UNSET: - field_dict["orderCancelReject"] = order_cancel_reject - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _order_cancel_request = d.pop("orderCancelRequest", UNSET) - order_cancel_request: Unset | OrderCancelRequest = ( - UNSET - if isinstance(_order_cancel_request, Unset) - else OrderCancelRequest.from_dict(_order_cancel_request) - ) - - _order_cancel_replace_request = d.pop("orderCancelReplaceRequest", UNSET) - order_cancel_replace_request: Unset | OrderCancelReplaceRequest = ( - UNSET - if isinstance(_order_cancel_replace_request, Unset) - else OrderCancelReplaceRequest.from_dict(_order_cancel_replace_request) - ) - - _multi_leg_order_cancel_replace_request = d.pop( - "multiLegOrderCancelReplaceRequest", UNSET - ) - multi_leg_order_cancel_replace_request: ( - Unset | MultiLegOrderCancelReplaceRequest - ) = ( - UNSET - if isinstance(_multi_leg_order_cancel_replace_request, Unset) - else MultiLegOrderCancelReplaceRequest.from_dict( - _multi_leg_order_cancel_replace_request - ) - ) - - _execution = d.pop("execution", UNSET) - execution: Unset | Execution = ( - UNSET if isinstance(_execution, Unset) else Execution.from_dict(_execution) - ) - - _order_update = d.pop("orderUpdate", UNSET) - order_update: Unset | OrderUpdate = ( - UNSET - if isinstance(_order_update, Unset) - else OrderUpdate.from_dict(_order_update) - ) - - _order_delete = d.pop("orderDelete", UNSET) - order_delete: Unset | OrderDelete = ( - UNSET - if isinstance(_order_delete, Unset) - else OrderDelete.from_dict(_order_delete) - ) - - _order_cancel_reject = d.pop("orderCancelReject", UNSET) - order_cancel_reject: Unset | OrderCancelReject = ( - UNSET - if isinstance(_order_cancel_reject, Unset) - else OrderCancelReject.from_dict(_order_cancel_reject) - ) - - order_update_event = cls( - order_cancel_request=order_cancel_request, - order_cancel_replace_request=order_cancel_replace_request, - multi_leg_order_cancel_replace_request=multi_leg_order_cancel_replace_request, - execution=execution, - order_update=order_update, - order_delete=order_delete, - order_cancel_reject=order_cancel_reject, - ) - - return order_update_event diff --git a/openapi_project/openapi_package/models/order_update_optional_data.py b/openapi_project/openapi_package/models/order_update_optional_data.py deleted file mode 100644 index 0dc26cab8..000000000 --- a/openapi_project/openapi_package/models/order_update_optional_data.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="OrderUpdateOptionalData") - - -@_attrs_define -class OrderUpdateOptionalData: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - order_update_optional_data = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - order_update_optional_data.additional_properties = additional_properties - return order_update_optional_data - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/origination_type.py b/openapi_project/openapi_package/models/origination_type.py deleted file mode 100644 index e8e7a27f4..000000000 --- a/openapi_project/openapi_package/models/origination_type.py +++ /dev/null @@ -1,39 +0,0 @@ -from enum import Enum - - -class OriginationType(str, Enum): - ORIGINATION_TYPE_ADMINISTRATIVE = "ORIGINATION_TYPE_ADMINISTRATIVE" - ORIGINATION_TYPE_API_CHILD_ORDER = "ORIGINATION_TYPE_API_CHILD_ORDER" - ORIGINATION_TYPE_API_ORDER = "ORIGINATION_TYPE_API_ORDER" - ORIGINATION_TYPE_API_ORDER_CANCEL_REPLACE_REQUEST = ( - "ORIGINATION_TYPE_API_ORDER_CANCEL_REPLACE_REQUEST" - ) - ORIGINATION_TYPE_API_ORDER_CANCEL_REQUEST = ( - "ORIGINATION_TYPE_API_ORDER_CANCEL_REQUEST" - ) - ORIGINATION_TYPE_API_PARENT_ORDER = "ORIGINATION_TYPE_API_PARENT_ORDER" - ORIGINATION_TYPE_FIX_FROM_STREET_CHILD_ORDER = ( - "ORIGINATION_TYPE_FIX_FROM_STREET_CHILD_ORDER" - ) - ORIGINATION_TYPE_FIX_FROM_STREET_DROP = "ORIGINATION_TYPE_FIX_FROM_STREET_DROP" - ORIGINATION_TYPE_FIX_FROM_STREET_DROP_ORDER_UPDATE = ( - "ORIGINATION_TYPE_FIX_FROM_STREET_DROP_ORDER_UPDATE" - ) - ORIGINATION_TYPE_FIX_FROM_STREET_ORDER = "ORIGINATION_TYPE_FIX_FROM_STREET_ORDER" - ORIGINATION_TYPE_FIX_FROM_STREET_ORDER_CANCEL_REPLACE_REQUEST = ( - "ORIGINATION_TYPE_FIX_FROM_STREET_ORDER_CANCEL_REPLACE_REQUEST" - ) - ORIGINATION_TYPE_FIX_FROM_STREET_ORDER_CANCEL_REQUEST = ( - "ORIGINATION_TYPE_FIX_FROM_STREET_ORDER_CANCEL_REQUEST" - ) - ORIGINATION_TYPE_FIX_FROM_STREET_ORDER_UPDATE = ( - "ORIGINATION_TYPE_FIX_FROM_STREET_ORDER_UPDATE" - ) - ORIGINATION_TYPE_FIX_FROM_STREET_PARENT_ORDER = ( - "ORIGINATION_TYPE_FIX_FROM_STREET_PARENT_ORDER" - ) - ORIGINATION_TYPE_ORDER_MANAGER = "ORIGINATION_TYPE_ORDER_MANAGER" - ORIGINATION_TYPE_UNKNOWN = "ORIGINATION_TYPE_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/position.py b/openapi_project/openapi_package/models/position.py deleted file mode 100644 index 72c15bcf9..000000000 --- a/openapi_project/openapi_package/models/position.py +++ /dev/null @@ -1,199 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="Position") - - -@_attrs_define -class Position: - """ - Attributes: - account_id (Unset | int): - symbol (Unset | str): - avg_cost (Unset | float): - marked_cost (Unset | float): - net_qty (Unset | float): - notional_value (Unset | float): - opening_cost (Unset | float): - opening_qty (Unset | float): - realized_pn_l (Unset | float): - trading_avg_cost (Unset | float): - trading_buy_avg_price (Unset | float): - trading_buy_qty (Unset | float): - trading_net_qty (Unset | float): - trading_sell_avg_price (Unset | float): - trading_sell_qty (Unset | float): - trading_sell_qty_long (Unset | float): - trading_sell_qty_short (Unset | float): - transact_ts (Unset | str): - """ - - account_id: Unset | int = UNSET - symbol: Unset | str = UNSET - avg_cost: Unset | float = UNSET - marked_cost: Unset | float = UNSET - net_qty: Unset | float = UNSET - notional_value: Unset | float = UNSET - opening_cost: Unset | float = UNSET - opening_qty: Unset | float = UNSET - realized_pn_l: Unset | float = UNSET - trading_avg_cost: Unset | float = UNSET - trading_buy_avg_price: Unset | float = UNSET - trading_buy_qty: Unset | float = UNSET - trading_net_qty: Unset | float = UNSET - trading_sell_avg_price: Unset | float = UNSET - trading_sell_qty: Unset | float = UNSET - trading_sell_qty_long: Unset | float = UNSET - trading_sell_qty_short: Unset | float = UNSET - transact_ts: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - symbol = self.symbol - - avg_cost = self.avg_cost - - marked_cost = self.marked_cost - - net_qty = self.net_qty - - notional_value = self.notional_value - - opening_cost = self.opening_cost - - opening_qty = self.opening_qty - - realized_pn_l = self.realized_pn_l - - trading_avg_cost = self.trading_avg_cost - - trading_buy_avg_price = self.trading_buy_avg_price - - trading_buy_qty = self.trading_buy_qty - - trading_net_qty = self.trading_net_qty - - trading_sell_avg_price = self.trading_sell_avg_price - - trading_sell_qty = self.trading_sell_qty - - trading_sell_qty_long = self.trading_sell_qty_long - - trading_sell_qty_short = self.trading_sell_qty_short - - transact_ts = self.transact_ts - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if symbol is not UNSET: - field_dict["symbol"] = symbol - if avg_cost is not UNSET: - field_dict["avgCost"] = avg_cost - if marked_cost is not UNSET: - field_dict["markedCost"] = marked_cost - if net_qty is not UNSET: - field_dict["netQty"] = net_qty - if notional_value is not UNSET: - field_dict["notionalValue"] = notional_value - if opening_cost is not UNSET: - field_dict["openingCost"] = opening_cost - if opening_qty is not UNSET: - field_dict["openingQty"] = opening_qty - if realized_pn_l is not UNSET: - field_dict["realizedPnL"] = realized_pn_l - if trading_avg_cost is not UNSET: - field_dict["tradingAvgCost"] = trading_avg_cost - if trading_buy_avg_price is not UNSET: - field_dict["tradingBuyAvgPrice"] = trading_buy_avg_price - if trading_buy_qty is not UNSET: - field_dict["tradingBuyQty"] = trading_buy_qty - if trading_net_qty is not UNSET: - field_dict["tradingNetQty"] = trading_net_qty - if trading_sell_avg_price is not UNSET: - field_dict["tradingSellAvgPrice"] = trading_sell_avg_price - if trading_sell_qty is not UNSET: - field_dict["tradingSellQty"] = trading_sell_qty - if trading_sell_qty_long is not UNSET: - field_dict["tradingSellQtyLong"] = trading_sell_qty_long - if trading_sell_qty_short is not UNSET: - field_dict["tradingSellQtyShort"] = trading_sell_qty_short - if transact_ts is not UNSET: - field_dict["transactTs"] = transact_ts - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - symbol = d.pop("symbol", UNSET) - - avg_cost = d.pop("avgCost", UNSET) - - marked_cost = d.pop("markedCost", UNSET) - - net_qty = d.pop("netQty", UNSET) - - notional_value = d.pop("notionalValue", UNSET) - - opening_cost = d.pop("openingCost", UNSET) - - opening_qty = d.pop("openingQty", UNSET) - - realized_pn_l = d.pop("realizedPnL", UNSET) - - trading_avg_cost = d.pop("tradingAvgCost", UNSET) - - trading_buy_avg_price = d.pop("tradingBuyAvgPrice", UNSET) - - trading_buy_qty = d.pop("tradingBuyQty", UNSET) - - trading_net_qty = d.pop("tradingNetQty", UNSET) - - trading_sell_avg_price = d.pop("tradingSellAvgPrice", UNSET) - - trading_sell_qty = d.pop("tradingSellQty", UNSET) - - trading_sell_qty_long = d.pop("tradingSellQtyLong", UNSET) - - trading_sell_qty_short = d.pop("tradingSellQtyShort", UNSET) - - transact_ts = d.pop("transactTs", UNSET) - - position = cls( - account_id=account_id, - symbol=symbol, - avg_cost=avg_cost, - marked_cost=marked_cost, - net_qty=net_qty, - notional_value=notional_value, - opening_cost=opening_cost, - opening_qty=opening_qty, - realized_pn_l=realized_pn_l, - trading_avg_cost=trading_avg_cost, - trading_buy_avg_price=trading_buy_avg_price, - trading_buy_qty=trading_buy_qty, - trading_net_qty=trading_net_qty, - trading_sell_avg_price=trading_sell_avg_price, - trading_sell_qty=trading_sell_qty, - trading_sell_qty_long=trading_sell_qty_long, - trading_sell_qty_short=trading_sell_qty_short, - transact_ts=transact_ts, - ) - - return position diff --git a/openapi_project/openapi_package/models/position_analysis.py b/openapi_project/openapi_package/models/position_analysis.py deleted file mode 100644 index e6a2aa483..000000000 --- a/openapi_project/openapi_package/models/position_analysis.py +++ /dev/null @@ -1,79 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.scenario_theo import ScenarioTheo - from openapi_project.openapi_package.models.position_theo import PositionTheo - - -T = TypeVar("T", bound="PositionAnalysis") - - -@_attrs_define -class PositionAnalysis: - """ - Attributes: - position_theo (Unset | PositionTheo): - scenario_theos (Unset | list[ScenarioTheo]): - """ - - position_theo: Unset | PositionTheo = UNSET - scenario_theos: Unset | list[ScenarioTheo] = UNSET - - def to_dict(self) -> dict[str, Any]: - position_theo: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.position_theo, Unset) - else self.position_theo.to_dict() - ) - - scenario_theos: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.scenario_theos, Unset): - scenario_theos = [] - for scenario_theos_item_data in self.scenario_theos: - scenario_theos_item = scenario_theos_item_data.to_dict() - scenario_theos.append(scenario_theos_item) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if position_theo is not UNSET: - field_dict["positionTheo"] = position_theo - if scenario_theos is not UNSET: - field_dict["scenarioTheos"] = scenario_theos - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _position_theo = d.pop("positionTheo", UNSET) - position_theo: Unset | PositionTheo = ( - UNSET - if isinstance(_position_theo, Unset) - else PositionTheo.from_dict(_position_theo) - ) - - scenario_theos = [] - _scenario_theos = d.pop("scenarioTheos", UNSET) - for scenario_theos_item_data in _scenario_theos or []: - scenario_theos_item = ScenarioTheo.from_dict(scenario_theos_item_data) - - scenario_theos.append(scenario_theos_item) - - position_analysis = cls( - position_theo=position_theo, - scenario_theos=scenario_theos, - ) - - return position_analysis diff --git a/openapi_project/openapi_package/models/position_effect.py b/openapi_project/openapi_package/models/position_effect.py deleted file mode 100644 index 0441467a8..000000000 --- a/openapi_project/openapi_package/models/position_effect.py +++ /dev/null @@ -1,11 +0,0 @@ -from enum import Enum - - -class PositionEffect(str, Enum): - POSITION_EFFECT_AUTO = "POSITION_EFFECT_AUTO" - POSITION_EFFECT_CLOSE = "POSITION_EFFECT_CLOSE" - POSITION_EFFECT_NONE = "POSITION_EFFECT_NONE" - POSITION_EFFECT_OPEN = "POSITION_EFFECT_OPEN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/position_source.py b/openapi_project/openapi_package/models/position_source.py deleted file mode 100644 index 881fcceaa..000000000 --- a/openapi_project/openapi_package/models/position_source.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class PositionSource(str, Enum): - POSITION_SOURCE_FROM_PORTFOLIO = "POSITION_SOURCE_FROM_PORTFOLIO" - POSITION_SOURCE_FROM_REQUEST = "POSITION_SOURCE_FROM_REQUEST" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/position_theo.py b/openapi_project/openapi_package/models/position_theo.py deleted file mode 100644 index aa920a3df..000000000 --- a/openapi_project/openapi_package/models/position_theo.py +++ /dev/null @@ -1,210 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.position_theo_leg import PositionTheoLeg - - -T = TypeVar("T", bound="PositionTheo") - - -@_attrs_define -class PositionTheo: - """ - Attributes: - as_of_ts (Unset | str): - delta (Unset | float): - gamma (Unset | float): - legs (Unset | list[PositionTheoLeg]): - max_loss (Unset | float): - max_loss_lsd (Unset | list[float]): - max_profit (Unset | float): - max_profit_lsd (Unset | list[float]): - prem (Unset | float): - price (Unset | float): - profit (Unset | float): - profit_probability (Unset | list[float]): - rho (Unset | float): - theta (Unset | float): - total_value (Unset | float): - vega (Unset | float): - volatility (Unset | float): - """ - - as_of_ts: Unset | str = UNSET - delta: Unset | float = UNSET - gamma: Unset | float = UNSET - legs: Unset | list[PositionTheoLeg] = UNSET - max_loss: Unset | float = UNSET - max_loss_lsd: Unset | list[float] = UNSET - max_profit: Unset | float = UNSET - max_profit_lsd: Unset | list[float] = UNSET - prem: Unset | float = UNSET - price: Unset | float = UNSET - profit: Unset | float = UNSET - profit_probability: Unset | list[float] = UNSET - rho: Unset | float = UNSET - theta: Unset | float = UNSET - total_value: Unset | float = UNSET - vega: Unset | float = UNSET - volatility: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - as_of_ts = self.as_of_ts - - delta = self.delta - - gamma = self.gamma - - legs: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.legs, Unset): - legs = [] - for legs_item_data in self.legs: - legs_item = legs_item_data.to_dict() - legs.append(legs_item) - - max_loss = self.max_loss - - max_loss_lsd: Unset | list[float] = UNSET - if not isinstance(self.max_loss_lsd, Unset): - max_loss_lsd = self.max_loss_lsd - - max_profit = self.max_profit - - max_profit_lsd: Unset | list[float] = UNSET - if not isinstance(self.max_profit_lsd, Unset): - max_profit_lsd = self.max_profit_lsd - - prem = self.prem - - price = self.price - - profit = self.profit - - profit_probability: Unset | list[float] = UNSET - if not isinstance(self.profit_probability, Unset): - profit_probability = self.profit_probability - - rho = self.rho - - theta = self.theta - - total_value = self.total_value - - vega = self.vega - - volatility = self.volatility - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if as_of_ts is not UNSET: - field_dict["asOfTs"] = as_of_ts - if delta is not UNSET: - field_dict["delta"] = delta - if gamma is not UNSET: - field_dict["gamma"] = gamma - if legs is not UNSET: - field_dict["legs"] = legs - if max_loss is not UNSET: - field_dict["maxLoss"] = max_loss - if max_loss_lsd is not UNSET: - field_dict["maxLossLsd"] = max_loss_lsd - if max_profit is not UNSET: - field_dict["maxProfit"] = max_profit - if max_profit_lsd is not UNSET: - field_dict["maxProfitLsd"] = max_profit_lsd - if prem is not UNSET: - field_dict["prem"] = prem - if price is not UNSET: - field_dict["price"] = price - if profit is not UNSET: - field_dict["profit"] = profit - if profit_probability is not UNSET: - field_dict["profitProbability"] = profit_probability - if rho is not UNSET: - field_dict["rho"] = rho - if theta is not UNSET: - field_dict["theta"] = theta - if total_value is not UNSET: - field_dict["totalValue"] = total_value - if vega is not UNSET: - field_dict["vega"] = vega - if volatility is not UNSET: - field_dict["volatility"] = volatility - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - as_of_ts = d.pop("asOfTs", UNSET) - - delta = d.pop("delta", UNSET) - - gamma = d.pop("gamma", UNSET) - - legs = [] - _legs = d.pop("legs", UNSET) - for legs_item_data in _legs or []: - legs_item = PositionTheoLeg.from_dict(legs_item_data) - - legs.append(legs_item) - - max_loss = d.pop("maxLoss", UNSET) - - max_loss_lsd = cast(list[float], d.pop("maxLossLsd", UNSET)) - - max_profit = d.pop("maxProfit", UNSET) - - max_profit_lsd = cast(list[float], d.pop("maxProfitLsd", UNSET)) - - prem = d.pop("prem", UNSET) - - price = d.pop("price", UNSET) - - profit = d.pop("profit", UNSET) - - profit_probability = cast(list[float], d.pop("profitProbability", UNSET)) - - rho = d.pop("rho", UNSET) - - theta = d.pop("theta", UNSET) - - total_value = d.pop("totalValue", UNSET) - - vega = d.pop("vega", UNSET) - - volatility = d.pop("volatility", UNSET) - - position_theo = cls( - as_of_ts=as_of_ts, - delta=delta, - gamma=gamma, - legs=legs, - max_loss=max_loss, - max_loss_lsd=max_loss_lsd, - max_profit=max_profit, - max_profit_lsd=max_profit_lsd, - prem=prem, - price=price, - profit=profit, - profit_probability=profit_probability, - rho=rho, - theta=theta, - total_value=total_value, - vega=vega, - volatility=volatility, - ) - - return position_theo diff --git a/openapi_project/openapi_package/models/position_theo_leg.py b/openapi_project/openapi_package/models/position_theo_leg.py deleted file mode 100644 index 483117f62..000000000 --- a/openapi_project/openapi_package/models/position_theo_leg.py +++ /dev/null @@ -1,161 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - - -T = TypeVar("T", bound="PositionTheoLeg") - - -@_attrs_define -class PositionTheoLeg: - """ - Attributes: - delta (Unset | float): - gamma (Unset | float): - max_loss (Unset | float): - max_loss_lsd (Unset | list[float]): - max_profit (Unset | float): - max_profit_lsd (Unset | list[float]): - prem (Unset | float): - profit (Unset | float): - profit_probability (Unset | list[float]): - rho (Unset | float): - theta (Unset | float): - vega (Unset | float): - volatility (Unset | float): - """ - - delta: Unset | float = UNSET - gamma: Unset | float = UNSET - max_loss: Unset | float = UNSET - max_loss_lsd: Unset | list[float] = UNSET - max_profit: Unset | float = UNSET - max_profit_lsd: Unset | list[float] = UNSET - prem: Unset | float = UNSET - profit: Unset | float = UNSET - profit_probability: Unset | list[float] = UNSET - rho: Unset | float = UNSET - theta: Unset | float = UNSET - vega: Unset | float = UNSET - volatility: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - delta = self.delta - - gamma = self.gamma - - max_loss = self.max_loss - - max_loss_lsd: Unset | list[float] = UNSET - if not isinstance(self.max_loss_lsd, Unset): - max_loss_lsd = self.max_loss_lsd - - max_profit = self.max_profit - - max_profit_lsd: Unset | list[float] = UNSET - if not isinstance(self.max_profit_lsd, Unset): - max_profit_lsd = self.max_profit_lsd - - prem = self.prem - - profit = self.profit - - profit_probability: Unset | list[float] = UNSET - if not isinstance(self.profit_probability, Unset): - profit_probability = self.profit_probability - - rho = self.rho - - theta = self.theta - - vega = self.vega - - volatility = self.volatility - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if delta is not UNSET: - field_dict["delta"] = delta - if gamma is not UNSET: - field_dict["gamma"] = gamma - if max_loss is not UNSET: - field_dict["maxLoss"] = max_loss - if max_loss_lsd is not UNSET: - field_dict["maxLossLsd"] = max_loss_lsd - if max_profit is not UNSET: - field_dict["maxProfit"] = max_profit - if max_profit_lsd is not UNSET: - field_dict["maxProfitLsd"] = max_profit_lsd - if prem is not UNSET: - field_dict["prem"] = prem - if profit is not UNSET: - field_dict["profit"] = profit - if profit_probability is not UNSET: - field_dict["profitProbability"] = profit_probability - if rho is not UNSET: - field_dict["rho"] = rho - if theta is not UNSET: - field_dict["theta"] = theta - if vega is not UNSET: - field_dict["vega"] = vega - if volatility is not UNSET: - field_dict["volatility"] = volatility - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - delta = d.pop("delta", UNSET) - - gamma = d.pop("gamma", UNSET) - - max_loss = d.pop("maxLoss", UNSET) - - max_loss_lsd = cast(list[float], d.pop("maxLossLsd", UNSET)) - - max_profit = d.pop("maxProfit", UNSET) - - max_profit_lsd = cast(list[float], d.pop("maxProfitLsd", UNSET)) - - prem = d.pop("prem", UNSET) - - profit = d.pop("profit", UNSET) - - profit_probability = cast(list[float], d.pop("profitProbability", UNSET)) - - rho = d.pop("rho", UNSET) - - theta = d.pop("theta", UNSET) - - vega = d.pop("vega", UNSET) - - volatility = d.pop("volatility", UNSET) - - position_theo_leg = cls( - delta=delta, - gamma=gamma, - max_loss=max_loss, - max_loss_lsd=max_loss_lsd, - max_profit=max_profit, - max_profit_lsd=max_profit_lsd, - prem=prem, - profit=profit, - profit_probability=profit_probability, - rho=rho, - theta=theta, - vega=vega, - volatility=volatility, - ) - - return position_theo_leg diff --git a/openapi_project/openapi_package/models/price_type.py b/openapi_project/openapi_package/models/price_type.py deleted file mode 100644 index c277980ed..000000000 --- a/openapi_project/openapi_package/models/price_type.py +++ /dev/null @@ -1,14 +0,0 @@ -from enum import Enum - - -class PriceType(str, Enum): - PRICE_TYPE_CABINET = "PRICE_TYPE_CABINET" - PRICE_TYPE_D_A_C = "PRICE_TYPE_D_A_C" - PRICE_TYPE_FIXED_AMT = "PRICE_TYPE_FIXED_AMT" - PRICE_TYPE_PERCENTAGE = "PRICE_TYPE_PERCENTAGE" - PRICE_TYPE_PER_UNIT = "PRICE_TYPE_PER_UNIT" - PRICE_TYPE_UNKNOWN = "PRICE_TYPE_UNKNOWN" - PRICE_TYPE_YIELD = "PRICE_TYPE_YIELD" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/product_group.py b/openapi_project/openapi_package/models/product_group.py deleted file mode 100644 index aa90857b8..000000000 --- a/openapi_project/openapi_package/models/product_group.py +++ /dev/null @@ -1,19 +0,0 @@ -from enum import Enum - - -class ProductGroup(str, Enum): - PRODUCT_GROUP_AGRICULTURAL = "PRODUCT_GROUP_AGRICULTURAL" - PRODUCT_GROUP_ALTERNATIVE_MARKETS = "PRODUCT_GROUP_ALTERNATIVE_MARKETS" - PRODUCT_GROUP_CURRENCY = "PRODUCT_GROUP_CURRENCY" - PRODUCT_GROUP_ENERGY = "PRODUCT_GROUP_ENERGY" - PRODUCT_GROUP_EQUITIES = "PRODUCT_GROUP_EQUITIES" - PRODUCT_GROUP_FINANCIAL = "PRODUCT_GROUP_FINANCIAL" - PRODUCT_GROUP_INDEX = "PRODUCT_GROUP_INDEX" - PRODUCT_GROUP_INTEREST_RATE = "PRODUCT_GROUP_INTEREST_RATE" - PRODUCT_GROUP_METAL = "PRODUCT_GROUP_METAL" - PRODUCT_GROUP_REAL_ESTATE = "PRODUCT_GROUP_REAL_ESTATE" - PRODUCT_GROUP_UNKNOWN = "PRODUCT_GROUP_UNKNOWN" - PRODUCT_GROUP_WEATHER = "PRODUCT_GROUP_WEATHER" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/product_sub_group.py b/openapi_project/openapi_package/models/product_sub_group.py deleted file mode 100644 index 5acb9ee95..000000000 --- a/openapi_project/openapi_package/models/product_sub_group.py +++ /dev/null @@ -1,8 +0,0 @@ -from enum import Enum - - -class ProductSubGroup(str, Enum): - PRODUCT_SUB_GROUP_UNKNOWN = "PRODUCT_SUB_GROUP_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/put_call.py b/openapi_project/openapi_package/models/put_call.py deleted file mode 100644 index 680cfcf36..000000000 --- a/openapi_project/openapi_package/models/put_call.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class PutCall(str, Enum): - PUT_CALL_CALL = "PUT_CALL_CALL" - PUT_CALL_PUT = "PUT_CALL_PUT" - PUT_CALL_UNDEFINED = "PUT_CALL_UNDEFINED" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/risk_calculation_type.py b/openapi_project/openapi_package/models/risk_calculation_type.py deleted file mode 100644 index 1b51d3094..000000000 --- a/openapi_project/openapi_package/models/risk_calculation_type.py +++ /dev/null @@ -1,11 +0,0 @@ -from enum import Enum - - -class RiskCalculationType(str, Enum): - RISK_CALCULATION_TYPE_ACCOUNT = "RISK_CALCULATION_TYPE_ACCOUNT" - RISK_CALCULATION_TYPE_TRADING_FIRM = "RISK_CALCULATION_TYPE_TRADING_FIRM" - RISK_CALCULATION_TYPE_UNKNOWN = "RISK_CALCULATION_TYPE_UNKNOWN" - RISK_CALCULATION_TYPE_USER = "RISK_CALCULATION_TYPE_USER" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/risk_eval_mode.py b/openapi_project/openapi_package/models/risk_eval_mode.py deleted file mode 100644 index c44b177fd..000000000 --- a/openapi_project/openapi_package/models/risk_eval_mode.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class RiskEvalMode(str, Enum): - RISK_EVAL_MODE_END_OF_DAY = "RISK_EVAL_MODE_END_OF_DAY" - RISK_EVAL_MODE_REAL_TIME = "RISK_EVAL_MODE_REAL_TIME" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/risk_radar_account_group.py b/openapi_project/openapi_package/models/risk_radar_account_group.py deleted file mode 100644 index 05f592fb0..000000000 --- a/openapi_project/openapi_package/models/risk_radar_account_group.py +++ /dev/null @@ -1,115 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.risk_radar_product_group import RiskRadarProductGroup - from openapi_project.openapi_package.models.shock_value import ShockValue - - -T = TypeVar("T", bound="RiskRadarAccountGroup") - - -@_attrs_define -class RiskRadarAccountGroup: - """ - Attributes: - account_id (Unset | int): - currency (Unset | Currency): - nav (Unset | float): - product_groups (Unset | list[RiskRadarProductGroup]): - shock_values (Unset | list[ShockValue]): - """ - - account_id: Unset | int = UNSET - currency: Unset | Currency = UNSET - nav: Unset | float = UNSET - product_groups: Unset | list[RiskRadarProductGroup] = UNSET - shock_values: Unset | list[ShockValue] = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - currency: Unset | str = ( - UNSET if isinstance(self.currency, Unset) else self.currency.value - ) - - nav = self.nav - - product_groups: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.product_groups, Unset): - product_groups = [] - for product_groups_item_data in self.product_groups: - product_groups_item = product_groups_item_data.to_dict() - product_groups.append(product_groups_item) - - shock_values: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.shock_values, Unset): - shock_values = [] - for shock_values_item_data in self.shock_values: - shock_values_item = shock_values_item_data.to_dict() - shock_values.append(shock_values_item) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if currency is not UNSET: - field_dict["currency"] = currency - if nav is not UNSET: - field_dict["nav"] = nav - if product_groups is not UNSET: - field_dict["productGroups"] = product_groups - if shock_values is not UNSET: - field_dict["shockValues"] = shock_values - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency = ( - UNSET if isinstance(_currency, Unset) else Currency(_currency) - ) - - nav = d.pop("nav", UNSET) - - product_groups = [] - _product_groups = d.pop("productGroups", UNSET) - for product_groups_item_data in _product_groups or []: - product_groups_item = RiskRadarProductGroup.from_dict( - product_groups_item_data - ) - - product_groups.append(product_groups_item) - - shock_values = [] - _shock_values = d.pop("shockValues", UNSET) - for shock_values_item_data in _shock_values or []: - shock_values_item = ShockValue.from_dict(shock_values_item_data) - - shock_values.append(shock_values_item) - - risk_radar_account_group = cls( - account_id=account_id, - currency=currency, - nav=nav, - product_groups=product_groups, - shock_values=shock_values, - ) - - return risk_radar_account_group diff --git a/openapi_project/openapi_package/models/risk_radar_class_group.py b/openapi_project/openapi_package/models/risk_radar_class_group.py deleted file mode 100644 index 47b538312..000000000 --- a/openapi_project/openapi_package/models/risk_radar_class_group.py +++ /dev/null @@ -1,181 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.shock_value import ShockValue - from openapi_project.openapi_package.models.risk_radar_position import RiskRadarPosition - - -T = TypeVar("T", bound="RiskRadarClassGroup") - - -@_attrs_define -class RiskRadarClassGroup: - """ - Attributes: - delta (Unset | float): - dollar_delta (Unset | float): - dollar_gamma (Unset | float): - gamma (Unset | float): - nav (Unset | float): - price (Unset | float): - rho (Unset | float): - shock_keys (Unset | list[float]): - shock_values (Unset | list[ShockValue]): - symbol (Unset | str): - theta (Unset | float): - vega (Unset | float): - positions (Unset | list[RiskRadarPosition]): - """ - - delta: Unset | float = UNSET - dollar_delta: Unset | float = UNSET - dollar_gamma: Unset | float = UNSET - gamma: Unset | float = UNSET - nav: Unset | float = UNSET - price: Unset | float = UNSET - rho: Unset | float = UNSET - shock_keys: Unset | list[float] = UNSET - shock_values: Unset | list[ShockValue] = UNSET - symbol: Unset | str = UNSET - theta: Unset | float = UNSET - vega: Unset | float = UNSET - positions: Unset | list[RiskRadarPosition] = UNSET - - def to_dict(self) -> dict[str, Any]: - delta = self.delta - - dollar_delta = self.dollar_delta - - dollar_gamma = self.dollar_gamma - - gamma = self.gamma - - nav = self.nav - - price = self.price - - rho = self.rho - - shock_keys: Unset | list[float] = UNSET - if not isinstance(self.shock_keys, Unset): - shock_keys = self.shock_keys - - shock_values: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.shock_values, Unset): - shock_values = [] - for shock_values_item_data in self.shock_values: - shock_values_item = shock_values_item_data.to_dict() - shock_values.append(shock_values_item) - - symbol = self.symbol - - theta = self.theta - - vega = self.vega - - positions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.positions, Unset): - positions = [] - for positions_item_data in self.positions: - positions_item = positions_item_data.to_dict() - positions.append(positions_item) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if delta is not UNSET: - field_dict["delta"] = delta - if dollar_delta is not UNSET: - field_dict["dollarDelta"] = dollar_delta - if dollar_gamma is not UNSET: - field_dict["dollarGamma"] = dollar_gamma - if gamma is not UNSET: - field_dict["gamma"] = gamma - if nav is not UNSET: - field_dict["nav"] = nav - if price is not UNSET: - field_dict["price"] = price - if rho is not UNSET: - field_dict["rho"] = rho - if shock_keys is not UNSET: - field_dict["shockKeys"] = shock_keys - if shock_values is not UNSET: - field_dict["shockValues"] = shock_values - if symbol is not UNSET: - field_dict["symbol"] = symbol - if theta is not UNSET: - field_dict["theta"] = theta - if vega is not UNSET: - field_dict["vega"] = vega - if positions is not UNSET: - field_dict["positions"] = positions - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - delta = d.pop("delta", UNSET) - - dollar_delta = d.pop("dollarDelta", UNSET) - - dollar_gamma = d.pop("dollarGamma", UNSET) - - gamma = d.pop("gamma", UNSET) - - nav = d.pop("nav", UNSET) - - price = d.pop("price", UNSET) - - rho = d.pop("rho", UNSET) - - shock_keys = cast(list[float], d.pop("shockKeys", UNSET)) - - shock_values = [] - _shock_values = d.pop("shockValues", UNSET) - for shock_values_item_data in _shock_values or []: - shock_values_item = ShockValue.from_dict(shock_values_item_data) - - shock_values.append(shock_values_item) - - symbol = d.pop("symbol", UNSET) - - theta = d.pop("theta", UNSET) - - vega = d.pop("vega", UNSET) - - positions = [] - _positions = d.pop("positions", UNSET) - for positions_item_data in _positions or []: - positions_item = RiskRadarPosition.from_dict(positions_item_data) - - positions.append(positions_item) - - risk_radar_class_group = cls( - delta=delta, - dollar_delta=dollar_delta, - dollar_gamma=dollar_gamma, - gamma=gamma, - nav=nav, - price=price, - rho=rho, - shock_keys=shock_keys, - shock_values=shock_values, - symbol=symbol, - theta=theta, - vega=vega, - positions=positions, - ) - - return risk_radar_class_group diff --git a/openapi_project/openapi_package/models/risk_radar_data.py b/openapi_project/openapi_package/models/risk_radar_data.py deleted file mode 100644 index 40f588b67..000000000 --- a/openapi_project/openapi_package/models/risk_radar_data.py +++ /dev/null @@ -1,71 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.risk_radar_account_group import RiskRadarAccountGroup - - -T = TypeVar("T", bound="RiskRadarData") - - -@_attrs_define -class RiskRadarData: - """ - Attributes: - risks_result (Unset | list[RiskRadarAccountGroup]): - shock_keys (Unset | list[str]): - """ - - risks_result: Unset | list[RiskRadarAccountGroup] = UNSET - shock_keys: Unset | list[str] = UNSET - - def to_dict(self) -> dict[str, Any]: - risks_result: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.risks_result, Unset): - risks_result = [] - for risks_result_item_data in self.risks_result: - risks_result_item = risks_result_item_data.to_dict() - risks_result.append(risks_result_item) - - shock_keys: Unset | list[str] = UNSET - if not isinstance(self.shock_keys, Unset): - shock_keys = self.shock_keys - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if risks_result is not UNSET: - field_dict["risksResult"] = risks_result - if shock_keys is not UNSET: - field_dict["shockKeys"] = shock_keys - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - risks_result = [] - _risks_result = d.pop("risksResult", UNSET) - for risks_result_item_data in _risks_result or []: - risks_result_item = RiskRadarAccountGroup.from_dict(risks_result_item_data) - - risks_result.append(risks_result_item) - - shock_keys = cast(list[str], d.pop("shockKeys", UNSET)) - - risk_radar_data = cls( - risks_result=risks_result, - shock_keys=shock_keys, - ) - - return risk_radar_data diff --git a/openapi_project/openapi_package/models/risk_radar_position.py b/openapi_project/openapi_package/models/risk_radar_position.py deleted file mode 100644 index a25b548ba..000000000 --- a/openapi_project/openapi_package/models/risk_radar_position.py +++ /dev/null @@ -1,186 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.shock_value import ShockValue - - -T = TypeVar("T", bound="RiskRadarPosition") - - -@_attrs_define -class RiskRadarPosition: - """ - Attributes: - delta (Unset | float): - dollar_delta (Unset | float): - dollar_gamma (Unset | float): - gamma (Unset | float): - nav (Unset | float): - price (Unset | float): - p_zero (Unset | float): - rho (Unset | float): - shock_values (Unset | list[ShockValue]): - symbol (Unset | str): - theta (Unset | float): - vega (Unset | float): - rpg_root (Unset | str): - qty (Unset | float): - implied_volatility (Unset | float): - """ - - delta: Unset | float = UNSET - dollar_delta: Unset | float = UNSET - dollar_gamma: Unset | float = UNSET - gamma: Unset | float = UNSET - nav: Unset | float = UNSET - price: Unset | float = UNSET - p_zero: Unset | float = UNSET - rho: Unset | float = UNSET - shock_values: Unset | list[ShockValue] = UNSET - symbol: Unset | str = UNSET - theta: Unset | float = UNSET - vega: Unset | float = UNSET - rpg_root: Unset | str = UNSET - qty: Unset | float = UNSET - implied_volatility: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - delta = self.delta - - dollar_delta = self.dollar_delta - - dollar_gamma = self.dollar_gamma - - gamma = self.gamma - - nav = self.nav - - price = self.price - - p_zero = self.p_zero - - rho = self.rho - - shock_values: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.shock_values, Unset): - shock_values = [] - for shock_values_item_data in self.shock_values: - shock_values_item = shock_values_item_data.to_dict() - shock_values.append(shock_values_item) - - symbol = self.symbol - - theta = self.theta - - vega = self.vega - - rpg_root = self.rpg_root - - qty = self.qty - - implied_volatility = self.implied_volatility - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if delta is not UNSET: - field_dict["delta"] = delta - if dollar_delta is not UNSET: - field_dict["dollarDelta"] = dollar_delta - if dollar_gamma is not UNSET: - field_dict["dollarGamma"] = dollar_gamma - if gamma is not UNSET: - field_dict["gamma"] = gamma - if nav is not UNSET: - field_dict["nav"] = nav - if price is not UNSET: - field_dict["price"] = price - if p_zero is not UNSET: - field_dict["pZero"] = p_zero - if rho is not UNSET: - field_dict["rho"] = rho - if shock_values is not UNSET: - field_dict["shockValues"] = shock_values - if symbol is not UNSET: - field_dict["symbol"] = symbol - if theta is not UNSET: - field_dict["theta"] = theta - if vega is not UNSET: - field_dict["vega"] = vega - if rpg_root is not UNSET: - field_dict["rpgRoot"] = rpg_root - if qty is not UNSET: - field_dict["qty"] = qty - if implied_volatility is not UNSET: - field_dict["impliedVolatility"] = implied_volatility - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - delta = d.pop("delta", UNSET) - - dollar_delta = d.pop("dollarDelta", UNSET) - - dollar_gamma = d.pop("dollarGamma", UNSET) - - gamma = d.pop("gamma", UNSET) - - nav = d.pop("nav", UNSET) - - price = d.pop("price", UNSET) - - p_zero = d.pop("pZero", UNSET) - - rho = d.pop("rho", UNSET) - - shock_values = [] - _shock_values = d.pop("shockValues", UNSET) - for shock_values_item_data in _shock_values or []: - shock_values_item = ShockValue.from_dict(shock_values_item_data) - - shock_values.append(shock_values_item) - - symbol = d.pop("symbol", UNSET) - - theta = d.pop("theta", UNSET) - - vega = d.pop("vega", UNSET) - - rpg_root = d.pop("rpgRoot", UNSET) - - qty = d.pop("qty", UNSET) - - implied_volatility = d.pop("impliedVolatility", UNSET) - - risk_radar_position = cls( - delta=delta, - dollar_delta=dollar_delta, - dollar_gamma=dollar_gamma, - gamma=gamma, - nav=nav, - price=price, - p_zero=p_zero, - rho=rho, - shock_values=shock_values, - symbol=symbol, - theta=theta, - vega=vega, - rpg_root=rpg_root, - qty=qty, - implied_volatility=implied_volatility, - ) - - return risk_radar_position diff --git a/openapi_project/openapi_package/models/risk_radar_product_group.py b/openapi_project/openapi_package/models/risk_radar_product_group.py deleted file mode 100644 index 01272726c..000000000 --- a/openapi_project/openapi_package/models/risk_radar_product_group.py +++ /dev/null @@ -1,107 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.risk_radar_class_group import RiskRadarClassGroup - from openapi_project.openapi_package.models.shock_value import ShockValue - - -T = TypeVar("T", bound="RiskRadarProductGroup") - - -@_attrs_define -class RiskRadarProductGroup: - """ - Attributes: - group (Unset | str): - nav (Unset | float): - class_groups (Unset | list[RiskRadarClassGroup]): - product_id (Unset | str): - shock_values (Unset | list[ShockValue]): - """ - - group: Unset | str = UNSET - nav: Unset | float = UNSET - class_groups: Unset | list[RiskRadarClassGroup] = UNSET - product_id: Unset | str = UNSET - shock_values: Unset | list[ShockValue] = UNSET - - def to_dict(self) -> dict[str, Any]: - group = self.group - - nav = self.nav - - class_groups: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.class_groups, Unset): - class_groups = [] - for class_groups_item_data in self.class_groups: - class_groups_item = class_groups_item_data.to_dict() - class_groups.append(class_groups_item) - - product_id = self.product_id - - shock_values: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.shock_values, Unset): - shock_values = [] - for shock_values_item_data in self.shock_values: - shock_values_item = shock_values_item_data.to_dict() - shock_values.append(shock_values_item) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if group is not UNSET: - field_dict["group"] = group - if nav is not UNSET: - field_dict["nav"] = nav - if class_groups is not UNSET: - field_dict["classGroups"] = class_groups - if product_id is not UNSET: - field_dict["productId"] = product_id - if shock_values is not UNSET: - field_dict["shockValues"] = shock_values - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - group = d.pop("group", UNSET) - - nav = d.pop("nav", UNSET) - - class_groups = [] - _class_groups = d.pop("classGroups", UNSET) - for class_groups_item_data in _class_groups or []: - class_groups_item = RiskRadarClassGroup.from_dict(class_groups_item_data) - - class_groups.append(class_groups_item) - - product_id = d.pop("productId", UNSET) - - shock_values = [] - _shock_values = d.pop("shockValues", UNSET) - for shock_values_item_data in _shock_values or []: - shock_values_item = ShockValue.from_dict(shock_values_item_data) - - shock_values.append(shock_values_item) - - risk_radar_product_group = cls( - group=group, - nav=nav, - class_groups=class_groups, - product_id=product_id, - shock_values=shock_values, - ) - - return risk_radar_product_group diff --git a/openapi_project/openapi_package/models/risk_radar_request.py b/openapi_project/openapi_package/models/risk_radar_request.py deleted file mode 100644 index 80f3c404e..000000000 --- a/openapi_project/openapi_package/models/risk_radar_request.py +++ /dev/null @@ -1,198 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.position_source import PositionSource -from openapi_project.openapi_package.models.risk_eval_mode import RiskEvalMode -from openapi_project.openapi_package.models.risk_radar_scenario_order import RiskRadarScenarioOrder -from openapi_project.openapi_package.models.volatility_shock_skew import VolatilityShockSkew -from openapi_project.openapi_package.models.volatility_shock_type import VolatilityShockType -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.risk_radar_request_position_list import RiskRadarRequestPositionList - - -T = TypeVar("T", bound="RiskRadarRequest") - - -@_attrs_define -class RiskRadarRequest: - """ - Attributes: - account_ids (Unset | list[int]): - positions_by_account_id (Unset | list[RiskRadarRequestPositionList]): - source (Unset | PositionSource): - range_ (Unset | float): - timestep (Unset | str): - scenario_order (Unset | RiskRadarScenarioOrder): - eval_mode (Unset | RiskEvalMode): - implied_volatility (Unset | float): - volatility_shock_skew (Unset | VolatilityShockSkew): - volatility_shock_type (Unset | VolatilityShockType): - exclude_expired_contracts (Unset | bool): - """ - - account_ids: Unset | list[int] = UNSET - positions_by_account_id: Unset | list[RiskRadarRequestPositionList] = UNSET - source: Unset | PositionSource = UNSET - range_: Unset | float = UNSET - timestep: Unset | str = UNSET - scenario_order: Unset | RiskRadarScenarioOrder = UNSET - eval_mode: Unset | RiskEvalMode = UNSET - implied_volatility: Unset | float = UNSET - volatility_shock_skew: Unset | VolatilityShockSkew = UNSET - volatility_shock_type: Unset | VolatilityShockType = UNSET - exclude_expired_contracts: Unset | bool = UNSET - - def to_dict(self) -> dict[str, Any]: - account_ids: Unset | list[int] = UNSET - if not isinstance(self.account_ids, Unset): - account_ids = self.account_ids - - positions_by_account_id: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.positions_by_account_id, Unset): - positions_by_account_id = [] - for positions_by_account_id_item_data in self.positions_by_account_id: - positions_by_account_id_item = ( - positions_by_account_id_item_data.to_dict() - ) - positions_by_account_id.append(positions_by_account_id_item) - - source: Unset | str = ( - UNSET if isinstance(self.source, Unset) else self.source.value - ) - - range_ = self.range_ - - timestep = self.timestep - - scenario_order: Unset | str = ( - UNSET - if isinstance(self.scenario_order, Unset) - else self.scenario_order.value - ) - - eval_mode: Unset | str = ( - UNSET if isinstance(self.eval_mode, Unset) else self.eval_mode.value - ) - - implied_volatility = self.implied_volatility - - volatility_shock_skew: Unset | str = ( - UNSET - if isinstance(self.volatility_shock_skew, Unset) - else self.volatility_shock_skew.value - ) - - volatility_shock_type: Unset | str = ( - UNSET - if isinstance(self.volatility_shock_type, Unset) - else self.volatility_shock_type.value - ) - - exclude_expired_contracts = self.exclude_expired_contracts - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_ids is not UNSET: - field_dict["accountIds"] = account_ids - if positions_by_account_id is not UNSET: - field_dict["positionsByAccountId"] = positions_by_account_id - if source is not UNSET: - field_dict["source"] = source - if range_ is not UNSET: - field_dict["range"] = range_ - if timestep is not UNSET: - field_dict["timestep"] = timestep - if scenario_order is not UNSET: - field_dict["scenarioOrder"] = scenario_order - if eval_mode is not UNSET: - field_dict["evalMode"] = eval_mode - if implied_volatility is not UNSET: - field_dict["impliedVolatility"] = implied_volatility - if volatility_shock_skew is not UNSET: - field_dict["volatilityShockSkew"] = volatility_shock_skew - if volatility_shock_type is not UNSET: - field_dict["volatilityShockType"] = volatility_shock_type - if exclude_expired_contracts is not UNSET: - field_dict["excludeExpiredContracts"] = exclude_expired_contracts - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_ids = cast(list[int], d.pop("accountIds", UNSET)) - - positions_by_account_id = [] - _positions_by_account_id = d.pop("positionsByAccountId", UNSET) - for positions_by_account_id_item_data in _positions_by_account_id or []: - positions_by_account_id_item = RiskRadarRequestPositionList.from_dict( - positions_by_account_id_item_data - ) - - positions_by_account_id.append(positions_by_account_id_item) - - _source = d.pop("source", UNSET) - source: Unset | PositionSource = ( - UNSET if isinstance(_source, Unset) else PositionSource(_source) - ) - - range_ = d.pop("range", UNSET) - - timestep = d.pop("timestep", UNSET) - - _scenario_order = d.pop("scenarioOrder", UNSET) - scenario_order: Unset | RiskRadarScenarioOrder = ( - UNSET - if isinstance(_scenario_order, Unset) - else RiskRadarScenarioOrder(_scenario_order) - ) - - _eval_mode = d.pop("evalMode", UNSET) - eval_mode: Unset | RiskEvalMode = ( - UNSET if isinstance(_eval_mode, Unset) else RiskEvalMode(_eval_mode) - ) - - implied_volatility = d.pop("impliedVolatility", UNSET) - - _volatility_shock_skew = d.pop("volatilityShockSkew", UNSET) - volatility_shock_skew: Unset | VolatilityShockSkew = ( - UNSET - if isinstance(_volatility_shock_skew, Unset) - else VolatilityShockSkew(_volatility_shock_skew) - ) - - _volatility_shock_type = d.pop("volatilityShockType", UNSET) - volatility_shock_type: Unset | VolatilityShockType = ( - UNSET - if isinstance(_volatility_shock_type, Unset) - else VolatilityShockType(_volatility_shock_type) - ) - - exclude_expired_contracts = d.pop("excludeExpiredContracts", UNSET) - - risk_radar_request = cls( - account_ids=account_ids, - positions_by_account_id=positions_by_account_id, - source=source, - range_=range_, - timestep=timestep, - scenario_order=scenario_order, - eval_mode=eval_mode, - implied_volatility=implied_volatility, - volatility_shock_skew=volatility_shock_skew, - volatility_shock_type=volatility_shock_type, - exclude_expired_contracts=exclude_expired_contracts, - ) - - return risk_radar_request diff --git a/openapi_project/openapi_package/models/risk_radar_request_position.py b/openapi_project/openapi_package/models/risk_radar_request_position.py deleted file mode 100644 index 100e12e1a..000000000 --- a/openapi_project/openapi_package/models/risk_radar_request_position.py +++ /dev/null @@ -1,64 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="RiskRadarRequestPosition") - - -@_attrs_define -class RiskRadarRequestPosition: - """ - Attributes: - is_simulated_position (Unset | bool): - qty (Unset | float): - symbol (Unset | str): - """ - - is_simulated_position: Unset | bool = UNSET - qty: Unset | float = UNSET - symbol: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - is_simulated_position = self.is_simulated_position - - qty = self.qty - - symbol = self.symbol - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if is_simulated_position is not UNSET: - field_dict["isSimulatedPosition"] = is_simulated_position - if qty is not UNSET: - field_dict["qty"] = qty - if symbol is not UNSET: - field_dict["symbol"] = symbol - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - is_simulated_position = d.pop("isSimulatedPosition", UNSET) - - qty = d.pop("qty", UNSET) - - symbol = d.pop("symbol", UNSET) - - risk_radar_request_position = cls( - is_simulated_position=is_simulated_position, - qty=qty, - symbol=symbol, - ) - - return risk_radar_request_position diff --git a/openapi_project/openapi_package/models/risk_radar_request_position_list.py b/openapi_project/openapi_package/models/risk_radar_request_position_list.py deleted file mode 100644 index 0c5838907..000000000 --- a/openapi_project/openapi_package/models/risk_radar_request_position_list.py +++ /dev/null @@ -1,69 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.risk_radar_request_position import RiskRadarRequestPosition - - -T = TypeVar("T", bound="RiskRadarRequestPositionList") - - -@_attrs_define -class RiskRadarRequestPositionList: - """ - Attributes: - account_id (Unset | int): - positions (Unset | list[RiskRadarRequestPosition]): - """ - - account_id: Unset | int = UNSET - positions: Unset | list[RiskRadarRequestPosition] = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - positions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.positions, Unset): - positions = [] - for positions_item_data in self.positions: - positions_item = positions_item_data.to_dict() - positions.append(positions_item) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if positions is not UNSET: - field_dict["positions"] = positions - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - positions = [] - _positions = d.pop("positions", UNSET) - for positions_item_data in _positions or []: - positions_item = RiskRadarRequestPosition.from_dict(positions_item_data) - - positions.append(positions_item) - - risk_radar_request_position_list = cls( - account_id=account_id, - positions=positions, - ) - - return risk_radar_request_position_list diff --git a/openapi_project/openapi_package/models/risk_radar_response.py b/openapi_project/openapi_package/models/risk_radar_response.py deleted file mode 100644 index e159a3dbd..000000000 --- a/openapi_project/openapi_package/models/risk_radar_response.py +++ /dev/null @@ -1,79 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.risk_radar_data import RiskRadarData - - -T = TypeVar("T", bound="RiskRadarResponse") - - -@_attrs_define -class RiskRadarResponse: - """ - Attributes: - result (Unset | RiskRadarData): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - result: Unset | RiskRadarData = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - result: Unset | dict[str, Any] = ( - UNSET if isinstance(self.result, Unset) else self.result.to_dict() - ) - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if result is not UNSET: - field_dict["result"] = result - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _result = d.pop("result", UNSET) - result: Unset | RiskRadarData = ( - UNSET if isinstance(_result, Unset) else RiskRadarData.from_dict(_result) - ) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - risk_radar_response = cls( - result=result, - error_message=error_message, - status_code=status_code, - ) - - return risk_radar_response diff --git a/openapi_project/openapi_package/models/risk_radar_scenario_order.py b/openapi_project/openapi_package/models/risk_radar_scenario_order.py deleted file mode 100644 index 99a247430..000000000 --- a/openapi_project/openapi_package/models/risk_radar_scenario_order.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class RiskRadarScenarioOrder(str, Enum): - RISK_RADAR_SCENARIO_ORDER_SHOCK_FIRST = "RISK_RADAR_SCENARIO_ORDER_SHOCK_FIRST" - RISK_RADAR_SCENARIO_ORDER_STEP_FIRST = "RISK_RADAR_SCENARIO_ORDER_STEP_FIRST" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/risk_reject.py b/openapi_project/openapi_package/models/risk_reject.py deleted file mode 100644 index 29f1db93a..000000000 --- a/openapi_project/openapi_package/models/risk_reject.py +++ /dev/null @@ -1,143 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.risk_calculation_type import RiskCalculationType -from openapi_project.openapi_package.models.risk_reject_type import RiskRejectType -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="RiskReject") - - -@_attrs_define -class RiskReject: - """ - Attributes: - account_id (Unset | int): - guid (Unset | str): - id_ (Unset | int): - is_overridden (Unset | bool): - message (Unset | str): - order_id (Unset | str): - transact_ts (Unset | str): - calculation_type (Unset | RiskCalculationType): - reject_type (Unset | RiskRejectType): - user_id (Unset | int): - """ - - account_id: Unset | int = UNSET - guid: Unset | str = UNSET - id_: Unset | int = UNSET - is_overridden: Unset | bool = UNSET - message: Unset | str = UNSET - order_id: Unset | str = UNSET - transact_ts: Unset | str = UNSET - calculation_type: Unset | RiskCalculationType = UNSET - reject_type: Unset | RiskRejectType = UNSET - user_id: Unset | int = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - guid = self.guid - - id_ = self.id_ - - is_overridden = self.is_overridden - - message = self.message - - order_id = self.order_id - - transact_ts = self.transact_ts - - calculation_type: Unset | str = ( - UNSET - if isinstance(self.calculation_type, Unset) - else self.calculation_type.value - ) - - reject_type: Unset | str = ( - UNSET if isinstance(self.reject_type, Unset) else self.reject_type.value - ) - - user_id = self.user_id - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if guid is not UNSET: - field_dict["guid"] = guid - if id_ is not UNSET: - field_dict["id"] = id - if is_overridden is not UNSET: - field_dict["isOverridden"] = is_overridden - if message is not UNSET: - field_dict["message"] = message - if order_id is not UNSET: - field_dict["orderId"] = order_id - if transact_ts is not UNSET: - field_dict["transactTs"] = transact_ts - if calculation_type is not UNSET: - field_dict["calculationType"] = calculation_type - if reject_type is not UNSET: - field_dict["rejectType"] = reject_type - if user_id is not UNSET: - field_dict["userId"] = user_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - guid = d.pop("guid", UNSET) - - id_ = d.pop("id", UNSET) - - is_overridden = d.pop("isOverridden", UNSET) - - message = d.pop("message", UNSET) - - order_id = d.pop("orderId", UNSET) - - transact_ts = d.pop("transactTs", UNSET) - - _calculation_type = d.pop("calculationType", UNSET) - calculation_type: Unset | RiskCalculationType = ( - UNSET - if isinstance(_calculation_type, Unset) - else RiskCalculationType(_calculation_type) - ) - - _reject_type = d.pop("rejectType", UNSET) - reject_type: Unset | RiskRejectType = ( - UNSET if isinstance(_reject_type, Unset) else RiskRejectType(_reject_type) - ) - - user_id = d.pop("userId", UNSET) - - risk_reject = cls( - account_id=account_id, - guid=guid, - id_=id_, - is_overridden=is_overridden, - message=message, - order_id=order_id, - transact_ts=transact_ts, - calculation_type=calculation_type, - reject_type=reject_type, - user_id=user_id, - ) - - return risk_reject diff --git a/openapi_project/openapi_package/models/risk_reject_type.py b/openapi_project/openapi_package/models/risk_reject_type.py deleted file mode 100644 index eed836c58..000000000 --- a/openapi_project/openapi_package/models/risk_reject_type.py +++ /dev/null @@ -1,120 +0,0 @@ -from enum import Enum - - -class RiskRejectType(str, Enum): - RISK_REJECT_TYPE_ACCOUNT_INACTIVE = "RISK_REJECT_TYPE_ACCOUNT_INACTIVE" - RISK_REJECT_TYPE_ACCOUNT_IN_LIQUIDATION = "RISK_REJECT_TYPE_ACCOUNT_IN_LIQUIDATION" - RISK_REJECT_TYPE_ACCOUNT_MAX_LOSS = "RISK_REJECT_TYPE_ACCOUNT_MAX_LOSS" - RISK_REJECT_TYPE_ALLOW_CRYPTO_ORDER_MARKET = ( - "RISK_REJECT_TYPE_ALLOW_CRYPTO_ORDER_MARKET" - ) - RISK_REJECT_TYPE_ALLOW_EQ_ORDER_LONG_SALE = ( - "RISK_REJECT_TYPE_ALLOW_EQ_ORDER_LONG_SALE" - ) - RISK_REJECT_TYPE_ALLOW_EQ_ORDER_MARKET = "RISK_REJECT_TYPE_ALLOW_EQ_ORDER_MARKET" - RISK_REJECT_TYPE_ALLOW_FUT_ORDER_MARKET = "RISK_REJECT_TYPE_ALLOW_FUT_ORDER_MARKET" - RISK_REJECT_TYPE_ALLOW_LOCATE_ID_FOR_EASY_TO_BORROW = ( - "RISK_REJECT_TYPE_ALLOW_LOCATE_ID_FOR_EASY_TO_BORROW" - ) - RISK_REJECT_TYPE_ALLOW_OPT_ORDER_MARKET = "RISK_REJECT_TYPE_ALLOW_OPT_ORDER_MARKET" - RISK_REJECT_TYPE_ALLOW_OPT_ORDER_SELL_TO_OPEN = ( - "RISK_REJECT_TYPE_ALLOW_OPT_ORDER_SELL_TO_OPEN" - ) - RISK_REJECT_TYPE_ALLOW_ORDER_WASH_TRADES = ( - "RISK_REJECT_TYPE_ALLOW_ORDER_WASH_TRADES" - ) - RISK_REJECT_TYPE_BUYING_POWER = "RISK_REJECT_TYPE_BUYING_POWER" - RISK_REJECT_TYPE_CRYPTO_MAX_GROSS_NOTIONAL_DAY = ( - "RISK_REJECT_TYPE_CRYPTO_MAX_GROSS_NOTIONAL_DAY" - ) - RISK_REJECT_TYPE_CRYPTO_MAX_GROSS_QTY_DAY = ( - "RISK_REJECT_TYPE_CRYPTO_MAX_GROSS_QTY_DAY" - ) - RISK_REJECT_TYPE_CRYPTO_MAX_NET_POSITION = ( - "RISK_REJECT_TYPE_CRYPTO_MAX_NET_POSITION" - ) - RISK_REJECT_TYPE_CRYPTO_MAX_NET_QTY_DAY = "RISK_REJECT_TYPE_CRYPTO_MAX_NET_QTY_DAY" - RISK_REJECT_TYPE_CRYPTO_ORDER_MAX_NOTIONAL = ( - "RISK_REJECT_TYPE_CRYPTO_ORDER_MAX_NOTIONAL" - ) - RISK_REJECT_TYPE_CRYPTO_ORDER_MAX_QTY = "RISK_REJECT_TYPE_CRYPTO_ORDER_MAX_QTY" - RISK_REJECT_TYPE_CRYPTO_ORDER_WARN_NOTIONAL = ( - "RISK_REJECT_TYPE_CRYPTO_ORDER_WARN_NOTIONAL" - ) - RISK_REJECT_TYPE_CRYPTO_ORDER_WARN_QTY = "RISK_REJECT_TYPE_CRYPTO_ORDER_WARN_QTY" - RISK_REJECT_TYPE_CRYPTO_WARN_GROSS_NOTIONAL_DAY = ( - "RISK_REJECT_TYPE_CRYPTO_WARN_GROSS_NOTIONAL_DAY" - ) - RISK_REJECT_TYPE_CRYPTO_WARN_GROSS_QTY_DAY = ( - "RISK_REJECT_TYPE_CRYPTO_WARN_GROSS_QTY_DAY" - ) - RISK_REJECT_TYPE_CRYPTO_WARN_NET_POSITION = ( - "RISK_REJECT_TYPE_CRYPTO_WARN_NET_POSITION" - ) - RISK_REJECT_TYPE_CRYPTO_WARN_NET_QTY_DAY = ( - "RISK_REJECT_TYPE_CRYPTO_WARN_NET_QTY_DAY" - ) - RISK_REJECT_TYPE_EQ_MAX_GROSS_NOTIONAL_DAY = ( - "RISK_REJECT_TYPE_EQ_MAX_GROSS_NOTIONAL_DAY" - ) - RISK_REJECT_TYPE_EQ_MAX_GROSS_QTY_DAY = "RISK_REJECT_TYPE_EQ_MAX_GROSS_QTY_DAY" - RISK_REJECT_TYPE_EQ_MAX_NET_POSITION = "RISK_REJECT_TYPE_EQ_MAX_NET_POSITION" - RISK_REJECT_TYPE_EQ_MAX_NET_QTY_DAY = "RISK_REJECT_TYPE_EQ_MAX_NET_QTY_DAY" - RISK_REJECT_TYPE_EQ_ORDER_MAX_NOTIONAL = "RISK_REJECT_TYPE_EQ_ORDER_MAX_NOTIONAL" - RISK_REJECT_TYPE_EQ_ORDER_MAX_QTY = "RISK_REJECT_TYPE_EQ_ORDER_MAX_QTY" - RISK_REJECT_TYPE_EQ_ORDER_WARN_NOTIONAL = "RISK_REJECT_TYPE_EQ_ORDER_WARN_NOTIONAL" - RISK_REJECT_TYPE_EQ_ORDER_WARN_QTY = "RISK_REJECT_TYPE_EQ_ORDER_WARN_QTY" - RISK_REJECT_TYPE_EQ_WARN_GROSS_NOTIONAL_DAY = ( - "RISK_REJECT_TYPE_EQ_WARN_GROSS_NOTIONAL_DAY" - ) - RISK_REJECT_TYPE_EQ_WARN_GROSS_QTY_DAY = "RISK_REJECT_TYPE_EQ_WARN_GROSS_QTY_DAY" - RISK_REJECT_TYPE_EQ_WARN_NET_POSITION = "RISK_REJECT_TYPE_EQ_WARN_NET_POSITION" - RISK_REJECT_TYPE_EQ_WARN_NET_QTY_DAY = "RISK_REJECT_TYPE_EQ_WARN_NET_QTY_DAY" - RISK_REJECT_TYPE_FUT_MAX_GROSS_NOTIONAL_DAY = ( - "RISK_REJECT_TYPE_FUT_MAX_GROSS_NOTIONAL_DAY" - ) - RISK_REJECT_TYPE_FUT_MAX_GROSS_QTY_DAY = "RISK_REJECT_TYPE_FUT_MAX_GROSS_QTY_DAY" - RISK_REJECT_TYPE_FUT_MAX_NET_POSITION = "RISK_REJECT_TYPE_FUT_MAX_NET_POSITION" - RISK_REJECT_TYPE_FUT_MAX_NET_QTY_DAY = "RISK_REJECT_TYPE_FUT_MAX_NET_QTY_DAY" - RISK_REJECT_TYPE_FUT_ORDER_MAX_NOTIONAL = "RISK_REJECT_TYPE_FUT_ORDER_MAX_NOTIONAL" - RISK_REJECT_TYPE_FUT_ORDER_MAX_QTY = "RISK_REJECT_TYPE_FUT_ORDER_MAX_QTY" - RISK_REJECT_TYPE_FUT_ORDER_WARN_NOTIONAL = ( - "RISK_REJECT_TYPE_FUT_ORDER_WARN_NOTIONAL" - ) - RISK_REJECT_TYPE_FUT_ORDER_WARN_QTY = "RISK_REJECT_TYPE_FUT_ORDER_WARN_QTY" - RISK_REJECT_TYPE_FUT_WARN_GROSS_NOTIONAL_DAY = ( - "RISK_REJECT_TYPE_FUT_WARN_GROSS_NOTIONAL_DAY" - ) - RISK_REJECT_TYPE_FUT_WARN_GROSS_QTY_DAY = "RISK_REJECT_TYPE_FUT_WARN_GROSS_QTY_DAY" - RISK_REJECT_TYPE_FUT_WARN_NET_POSITION = "RISK_REJECT_TYPE_FUT_WARN_NET_POSITION" - RISK_REJECT_TYPE_FUT_WARN_NET_QTY_DAY = "RISK_REJECT_TYPE_FUT_WARN_NET_QTY_DAY" - RISK_REJECT_TYPE_GTC_ORDER_NOT_ALLOWED = "RISK_REJECT_TYPE_GTC_ORDER_NOT_ALLOWED" - RISK_REJECT_TYPE_HARD_TO_BORROW = "RISK_REJECT_TYPE_HARD_TO_BORROW" - RISK_REJECT_TYPE_INVALID_ORD_TYPE = "RISK_REJECT_TYPE_INVALID_ORD_TYPE" - RISK_REJECT_TYPE_INVALID_SIDE = "RISK_REJECT_TYPE_INVALID_SIDE" - RISK_REJECT_TYPE_OPT_MAX_GROSS_NOTIONAL_DAY = ( - "RISK_REJECT_TYPE_OPT_MAX_GROSS_NOTIONAL_DAY" - ) - RISK_REJECT_TYPE_OPT_MAX_GROSS_QTY_DAY = "RISK_REJECT_TYPE_OPT_MAX_GROSS_QTY_DAY" - RISK_REJECT_TYPE_OPT_MAX_NET_POSITION = "RISK_REJECT_TYPE_OPT_MAX_NET_POSITION" - RISK_REJECT_TYPE_OPT_MAX_NET_QTY_DAY = "RISK_REJECT_TYPE_OPT_MAX_NET_QTY_DAY" - RISK_REJECT_TYPE_OPT_ORDER_MAX_NOTIONAL = "RISK_REJECT_TYPE_OPT_ORDER_MAX_NOTIONAL" - RISK_REJECT_TYPE_OPT_ORDER_MAX_QTY = "RISK_REJECT_TYPE_OPT_ORDER_MAX_QTY" - RISK_REJECT_TYPE_OPT_ORDER_WARN_NOTIONAL = ( - "RISK_REJECT_TYPE_OPT_ORDER_WARN_NOTIONAL" - ) - RISK_REJECT_TYPE_OPT_ORDER_WARN_QTY = "RISK_REJECT_TYPE_OPT_ORDER_WARN_QTY" - RISK_REJECT_TYPE_OPT_WARN_GROSS_NOTIONAL_DAY = ( - "RISK_REJECT_TYPE_OPT_WARN_GROSS_NOTIONAL_DAY" - ) - RISK_REJECT_TYPE_OPT_WARN_GROSS_QTY_DAY = "RISK_REJECT_TYPE_OPT_WARN_GROSS_QTY_DAY" - RISK_REJECT_TYPE_OPT_WARN_NET_POSITION = "RISK_REJECT_TYPE_OPT_WARN_NET_POSITION" - RISK_REJECT_TYPE_OPT_WARN_NET_QTY_DAY = "RISK_REJECT_TYPE_OPT_WARN_NET_QTY_DAY" - RISK_REJECT_TYPE_ORDER_MAX_THRESHOLD_BREACHED = ( - "RISK_REJECT_TYPE_ORDER_MAX_THRESHOLD_BREACHED" - ) - RISK_REJECT_TYPE_RESTRICTED_SECURITY = "RISK_REJECT_TYPE_RESTRICTED_SECURITY" - RISK_REJECT_TYPE_SECURITY_NOT_SUPPORTED = "RISK_REJECT_TYPE_SECURITY_NOT_SUPPORTED" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/route.py b/openapi_project/openapi_package/models/route.py deleted file mode 100644 index dcd9dfc87..000000000 --- a/openapi_project/openapi_package/models/route.py +++ /dev/null @@ -1,174 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.models.order_type import OrderType -from openapi_project.openapi_package.models.route_type import RouteType -from openapi_project.openapi_package.models.security_type import SecurityType -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.route_property import RouteProperty - - -T = TypeVar("T", bound="Route") - - -@_attrs_define -class Route: - """ - Attributes: - id_ (Unset | int): - algo_schema (Unset | str): - currency (Unset | Currency): - is_enabled (Unset | bool): - name (Unset | str): - order_type (Unset | OrderType): - route_properties (Unset | list[RouteProperty]): - security_type (Unset | SecurityType): - type_ (Unset | RouteType): - ui_schema (Unset | str): - venue (Unset | str): - """ - - id_: Unset | int = UNSET - algo_schema: Unset | str = UNSET - currency: Unset | Currency = UNSET - is_enabled: Unset | bool = UNSET - name: Unset | str = UNSET - order_type: Unset | OrderType = UNSET - route_properties: Unset | list[RouteProperty] = UNSET - security_type: Unset | SecurityType = UNSET - type_: Unset | RouteType = UNSET - ui_schema: Unset | str = UNSET - venue: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - id_ = self.id_ - - algo_schema = self.algo_schema - - currency: Unset | str = ( - UNSET if isinstance(self.currency, Unset) else self.currency.value - ) - - is_enabled = self.is_enabled - - name = self.name - - order_type: Unset | str = ( - UNSET if isinstance(self.order_type, Unset) else self.order_type.value - ) - - route_properties: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.route_properties, Unset): - route_properties = [] - for route_properties_item_data in self.route_properties: - route_properties_item = route_properties_item_data.to_dict() - route_properties.append(route_properties_item) - - security_type: Unset | str = ( - UNSET if isinstance(self.security_type, Unset) else self.security_type.value - ) - - type_: Unset | str = ( - UNSET if isinstance(self.type_, Unset) else self.type_.value - ) - - ui_schema = self.ui_schema - - venue = self.venue - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if id_ is not UNSET: - field_dict["id"] = id - if algo_schema is not UNSET: - field_dict["algoSchema"] = algo_schema - if currency is not UNSET: - field_dict["currency"] = currency - if is_enabled is not UNSET: - field_dict["isEnabled"] = is_enabled - if name is not UNSET: - field_dict["name"] = name - if order_type is not UNSET: - field_dict["orderType"] = order_type - if route_properties is not UNSET: - field_dict["routeProperties"] = route_properties - if security_type is not UNSET: - field_dict["securityType"] = security_type - if type_ is not UNSET: - field_dict["type"] = type_ - if ui_schema is not UNSET: - field_dict["uiSchema"] = ui_schema - if venue is not UNSET: - field_dict["venue"] = venue - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - id_ = d.pop("id", UNSET) - - algo_schema = d.pop("algoSchema", UNSET) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency = ( - UNSET if isinstance(_currency, Unset) else Currency(_currency) - ) - - is_enabled = d.pop("isEnabled", UNSET) - - name = d.pop("name", UNSET) - - _order_type = d.pop("orderType", UNSET) - order_type: Unset | OrderType = ( - UNSET if isinstance(_order_type, Unset) else OrderType(_order_type) - ) - - route_properties = [] - _route_properties = d.pop("routeProperties", UNSET) - for route_properties_item_data in _route_properties or []: - route_properties_item = RouteProperty.from_dict(route_properties_item_data) - - route_properties.append(route_properties_item) - - _security_type = d.pop("securityType", UNSET) - security_type: Unset | SecurityType = ( - UNSET if isinstance(_security_type, Unset) else SecurityType(_security_type) - ) - - _type_ = d.pop("type", UNSET) - type_: Unset | RouteType = ( - UNSET if isinstance(_type_, Unset) else RouteType(_type_) - ) - - ui_schema = d.pop("uiSchema", UNSET) - - venue = d.pop("venue", UNSET) - - route = cls( - id_=id_, - algo_schema=algo_schema, - currency=currency, - is_enabled=is_enabled, - name=name, - order_type=order_type, - route_properties=route_properties, - security_type=security_type, - type_=type_, - ui_schema=ui_schema, - venue=venue, - ) - - return route diff --git a/openapi_project/openapi_package/models/route_applicability.py b/openapi_project/openapi_package/models/route_applicability.py deleted file mode 100644 index e319d15bf..000000000 --- a/openapi_project/openapi_package/models/route_applicability.py +++ /dev/null @@ -1,121 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.models.order_type import OrderType -from openapi_project.openapi_package.models.security_type import SecurityType -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - - -T = TypeVar("T", bound="RouteApplicability") - - -@_attrs_define -class RouteApplicability: - """ - Attributes: - user_id (Unset | int): - account_id (Unset | int): - security_type (Unset | SecurityType): - currency (Unset | Currency): - exchange_id (Unset | int): - order_type (Unset | OrderType): - route_ids (Unset | list[int]): - """ - - user_id: Unset | int = UNSET - account_id: Unset | int = UNSET - security_type: Unset | SecurityType = UNSET - currency: Unset | Currency = UNSET - exchange_id: Unset | int = UNSET - order_type: Unset | OrderType = UNSET - route_ids: Unset | list[int] = UNSET - - def to_dict(self) -> dict[str, Any]: - user_id = self.user_id - - account_id = self.account_id - - security_type: Unset | str = ( - UNSET if isinstance(self.security_type, Unset) else self.security_type.value - ) - - currency: Unset | str = ( - UNSET if isinstance(self.currency, Unset) else self.currency.value - ) - - exchange_id = self.exchange_id - - order_type: Unset | str = ( - UNSET if isinstance(self.order_type, Unset) else self.order_type.value - ) - - route_ids: Unset | list[int] = UNSET - if not isinstance(self.route_ids, Unset): - route_ids = self.route_ids - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if user_id is not UNSET: - field_dict["userId"] = user_id - if account_id is not UNSET: - field_dict["accountId"] = account_id - if security_type is not UNSET: - field_dict["securityType"] = security_type - if currency is not UNSET: - field_dict["currency"] = currency - if exchange_id is not UNSET: - field_dict["exchangeId"] = exchange_id - if order_type is not UNSET: - field_dict["orderType"] = order_type - if route_ids is not UNSET: - field_dict["routeIds"] = route_ids - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - user_id = d.pop("userId", UNSET) - - account_id = d.pop("accountId", UNSET) - - _security_type = d.pop("securityType", UNSET) - security_type: Unset | SecurityType = ( - UNSET if isinstance(_security_type, Unset) else SecurityType(_security_type) - ) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency = ( - UNSET if isinstance(_currency, Unset) else Currency(_currency) - ) - - exchange_id = d.pop("exchangeId", UNSET) - - _order_type = d.pop("orderType", UNSET) - order_type: Unset | OrderType = ( - UNSET if isinstance(_order_type, Unset) else OrderType(_order_type) - ) - - route_ids = cast(list[int], d.pop("routeIds", UNSET)) - - route_applicability = cls( - user_id=user_id, - account_id=account_id, - security_type=security_type, - currency=currency, - exchange_id=exchange_id, - order_type=order_type, - route_ids=route_ids, - ) - - return route_applicability diff --git a/openapi_project/openapi_package/models/route_property.py b/openapi_project/openapi_package/models/route_property.py deleted file mode 100644 index 3209bc386..000000000 --- a/openapi_project/openapi_package/models/route_property.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.route_property_type import RoutePropertyType -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="RouteProperty") - - -@_attrs_define -class RouteProperty: - """ - Attributes: - id_ (Unset | int): - type_ (Unset | RoutePropertyType): - value (Unset | str): - """ - - id_: Unset | int = UNSET - type_: Unset | RoutePropertyType = UNSET - value: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - id_ = self.id_ - - type_: Unset | str = ( - UNSET if isinstance(self.type_, Unset) else self.type_.value - ) - - value = self.value - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if id_ is not UNSET: - field_dict["id"] = id - if type_ is not UNSET: - field_dict["type"] = type_ - if value is not UNSET: - field_dict["value"] = value - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - id_ = d.pop("id", UNSET) - - _type_ = d.pop("type", UNSET) - type_: Unset | RoutePropertyType = ( - UNSET if isinstance(_type_, Unset) else RoutePropertyType(_type_) - ) - - value = d.pop("value", UNSET) - - route_property = cls( - id_=id_, - type_=type_, - value=value, - ) - - return route_property diff --git a/openapi_project/openapi_package/models/route_property_type.py b/openapi_project/openapi_package/models/route_property_type.py deleted file mode 100644 index df376dcfa..000000000 --- a/openapi_project/openapi_package/models/route_property_type.py +++ /dev/null @@ -1,19 +0,0 @@ -from enum import Enum - - -class RoutePropertyType(str, Enum): - ROUTE_PROPERTY_TYPE_CONTINGENCY = "ROUTE_PROPERTY_TYPE_CONTINGENCY" - ROUTE_PROPERTY_TYPE_CROSS_TYPE = "ROUTE_PROPERTY_TYPE_CROSS_TYPE" - ROUTE_PROPERTY_TYPE_EQUITY_EX_DESTINATION = ( - "ROUTE_PROPERTY_TYPE_EQUITY_EX_DESTINATION" - ) - ROUTE_PROPERTY_TYPE_INSTRUCTION = "ROUTE_PROPERTY_TYPE_INSTRUCTION" - ROUTE_PROPERTY_TYPE_ORDER_TYPE = "ROUTE_PROPERTY_TYPE_ORDER_TYPE" - ROUTE_PROPERTY_TYPE_PERMISSION = "ROUTE_PROPERTY_TYPE_PERMISSION" - ROUTE_PROPERTY_TYPE_SESSION_ELIGIBILITY = "ROUTE_PROPERTY_TYPE_SESSION_ELIGIBILITY" - ROUTE_PROPERTY_TYPE_STRATEGY_ID = "ROUTE_PROPERTY_TYPE_STRATEGY_ID" - ROUTE_PROPERTY_TYPE_TIF = "ROUTE_PROPERTY_TYPE_TIF" - ROUTE_PROPERTY_TYPE_UNKNOWN = "ROUTE_PROPERTY_TYPE_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/route_type.py b/openapi_project/openapi_package/models/route_type.py deleted file mode 100644 index d8faa457c..000000000 --- a/openapi_project/openapi_package/models/route_type.py +++ /dev/null @@ -1,16 +0,0 @@ -from enum import Enum - - -class RouteType(str, Enum): - ROUTE_TYPE_ALGO = "ROUTE_TYPE_ALGO" - ROUTE_TYPE_AWAY = "ROUTE_TYPE_AWAY" - ROUTE_TYPE_BROKER = "ROUTE_TYPE_BROKER" - ROUTE_TYPE_CBOE = "ROUTE_TYPE_CBOE" - ROUTE_TYPE_DMA = "ROUTE_TYPE_DMA" - ROUTE_TYPE_MANUAL = "ROUTE_TYPE_MANUAL" - ROUTE_TYPE_P2P = "ROUTE_TYPE_P2P" - ROUTE_TYPE_PAR = "ROUTE_TYPE_PAR" - ROUTE_TYPE_STAGE = "ROUTE_TYPE_STAGE" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/routing_session_group.py b/openapi_project/openapi_package/models/routing_session_group.py deleted file mode 100644 index cacd39f90..000000000 --- a/openapi_project/openapi_package/models/routing_session_group.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.routing_session_group_type import RoutingSessionGroupType -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="RoutingSessionGroup") - - -@_attrs_define -class RoutingSessionGroup: - """ - Attributes: - id_ (Unset | int): - name (Unset | str): - type_ (Unset | RoutingSessionGroupType): - """ - - id_: Unset | int = UNSET - name: Unset | str = UNSET - type_: Unset | RoutingSessionGroupType = UNSET - - def to_dict(self) -> dict[str, Any]: - id_ = self.id_ - - name = self.name - - type_: Unset | str = ( - UNSET if isinstance(self.type_, Unset) else self.type_.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if id_ is not UNSET: - field_dict["id"] = id - if name is not UNSET: - field_dict["name"] = name - if type_ is not UNSET: - field_dict["type"] = type_ - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - id_ = d.pop("id", UNSET) - - name = d.pop("name", UNSET) - - _type_ = d.pop("type", UNSET) - type_: Unset | RoutingSessionGroupType = ( - UNSET if isinstance(_type_, Unset) else RoutingSessionGroupType(_type_) - ) - - routing_session_group = cls( - id_=id_, - name=name, - type_=type_, - ) - - return routing_session_group diff --git a/openapi_project/openapi_package/models/routing_session_group_type.py b/openapi_project/openapi_package/models/routing_session_group_type.py deleted file mode 100644 index 1eba5b629..000000000 --- a/openapi_project/openapi_package/models/routing_session_group_type.py +++ /dev/null @@ -1,15 +0,0 @@ -from enum import Enum - - -class RoutingSessionGroupType(str, Enum): - ROUTING_SESSION_GROUP_TYPE_AWAY = "ROUTING_SESSION_GROUP_TYPE_AWAY" - ROUTING_SESSION_GROUP_TYPE_BROKER = "ROUTING_SESSION_GROUP_TYPE_BROKER" - ROUTING_SESSION_GROUP_TYPE_EXCHANGE = "ROUTING_SESSION_GROUP_TYPE_EXCHANGE" - ROUTING_SESSION_GROUP_TYPE_MANUAL = "ROUTING_SESSION_GROUP_TYPE_MANUAL" - ROUTING_SESSION_GROUP_TYPE_P2P = "ROUTING_SESSION_GROUP_TYPE_P2P" - ROUTING_SESSION_GROUP_TYPE_PAR = "ROUTING_SESSION_GROUP_TYPE_PAR" - ROUTING_SESSION_GROUP_TYPE_STAGE = "ROUTING_SESSION_GROUP_TYPE_STAGE" - ROUTING_SESSION_GROUP_TYPE_UNKNOWN = "ROUTING_SESSION_GROUP_TYPE_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/scenario.py b/openapi_project/openapi_package/models/scenario.py deleted file mode 100644 index 1386436d5..000000000 --- a/openapi_project/openapi_package/models/scenario.py +++ /dev/null @@ -1,86 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.scenario_leg import ScenarioLeg - from openapi_project.openapi_package.models.scenario_position import ScenarioPosition - - -T = TypeVar("T", bound="Scenario") - - -@_attrs_define -class Scenario: - """ - Attributes: - price (Unset | float): - legs (Unset | list[ScenarioLeg]): - position (Unset | ScenarioPosition): - """ - - price: Unset | float = UNSET - legs: Unset | list[ScenarioLeg] = UNSET - position: Unset | ScenarioPosition = UNSET - - def to_dict(self) -> dict[str, Any]: - price = self.price - - legs: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.legs, Unset): - legs = [] - for legs_item_data in self.legs: - legs_item = legs_item_data.to_dict() - legs.append(legs_item) - - position: Unset | dict[str, Any] = ( - UNSET if isinstance(self.position, Unset) else self.position.to_dict() - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if price is not UNSET: - field_dict["price"] = price - if legs is not UNSET: - field_dict["legs"] = legs - if position is not UNSET: - field_dict["position"] = position - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - price = d.pop("price", UNSET) - - legs = [] - _legs = d.pop("legs", UNSET) - for legs_item_data in _legs or []: - legs_item = ScenarioLeg.from_dict(legs_item_data) - - legs.append(legs_item) - - _position = d.pop("position", UNSET) - position: Unset | ScenarioPosition = ( - UNSET - if isinstance(_position, Unset) - else ScenarioPosition.from_dict(_position) - ) - - scenario = cls( - price=price, - legs=legs, - position=position, - ) - - return scenario diff --git a/openapi_project/openapi_package/models/scenario_leg.py b/openapi_project/openapi_package/models/scenario_leg.py deleted file mode 100644 index a68d680d0..000000000 --- a/openapi_project/openapi_package/models/scenario_leg.py +++ /dev/null @@ -1,118 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="ScenarioLeg") - - -@_attrs_define -class ScenarioLeg: - """ - Attributes: - delta (Unset | float): - gamma (Unset | float): - prem (Unset | float): - profit (Unset | float): - rho (Unset | float): - theta (Unset | float): - total_value (Unset | float): - vega (Unset | float): - volatility (Unset | float): - """ - - delta: Unset | float = UNSET - gamma: Unset | float = UNSET - prem: Unset | float = UNSET - profit: Unset | float = UNSET - rho: Unset | float = UNSET - theta: Unset | float = UNSET - total_value: Unset | float = UNSET - vega: Unset | float = UNSET - volatility: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - delta = self.delta - - gamma = self.gamma - - prem = self.prem - - profit = self.profit - - rho = self.rho - - theta = self.theta - - total_value = self.total_value - - vega = self.vega - - volatility = self.volatility - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if delta is not UNSET: - field_dict["delta"] = delta - if gamma is not UNSET: - field_dict["gamma"] = gamma - if prem is not UNSET: - field_dict["prem"] = prem - if profit is not UNSET: - field_dict["profit"] = profit - if rho is not UNSET: - field_dict["rho"] = rho - if theta is not UNSET: - field_dict["theta"] = theta - if total_value is not UNSET: - field_dict["totalValue"] = total_value - if vega is not UNSET: - field_dict["vega"] = vega - if volatility is not UNSET: - field_dict["volatility"] = volatility - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - delta = d.pop("delta", UNSET) - - gamma = d.pop("gamma", UNSET) - - prem = d.pop("prem", UNSET) - - profit = d.pop("profit", UNSET) - - rho = d.pop("rho", UNSET) - - theta = d.pop("theta", UNSET) - - total_value = d.pop("totalValue", UNSET) - - vega = d.pop("vega", UNSET) - - volatility = d.pop("volatility", UNSET) - - scenario_leg = cls( - delta=delta, - gamma=gamma, - prem=prem, - profit=profit, - rho=rho, - theta=theta, - total_value=total_value, - vega=vega, - volatility=volatility, - ) - - return scenario_leg diff --git a/openapi_project/openapi_package/models/scenario_position.py b/openapi_project/openapi_package/models/scenario_position.py deleted file mode 100644 index 799aee014..000000000 --- a/openapi_project/openapi_package/models/scenario_position.py +++ /dev/null @@ -1,118 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="ScenarioPosition") - - -@_attrs_define -class ScenarioPosition: - """ - Attributes: - delta (Unset | float): - gamma (Unset | float): - prem (Unset | float): - profit (Unset | float): - rho (Unset | float): - theta (Unset | float): - total_value (Unset | float): - vega (Unset | float): - volatility (Unset | float): - """ - - delta: Unset | float = UNSET - gamma: Unset | float = UNSET - prem: Unset | float = UNSET - profit: Unset | float = UNSET - rho: Unset | float = UNSET - theta: Unset | float = UNSET - total_value: Unset | float = UNSET - vega: Unset | float = UNSET - volatility: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - delta = self.delta - - gamma = self.gamma - - prem = self.prem - - profit = self.profit - - rho = self.rho - - theta = self.theta - - total_value = self.total_value - - vega = self.vega - - volatility = self.volatility - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if delta is not UNSET: - field_dict["delta"] = delta - if gamma is not UNSET: - field_dict["gamma"] = gamma - if prem is not UNSET: - field_dict["prem"] = prem - if profit is not UNSET: - field_dict["profit"] = profit - if rho is not UNSET: - field_dict["rho"] = rho - if theta is not UNSET: - field_dict["theta"] = theta - if total_value is not UNSET: - field_dict["totalValue"] = total_value - if vega is not UNSET: - field_dict["vega"] = vega - if volatility is not UNSET: - field_dict["volatility"] = volatility - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - delta = d.pop("delta", UNSET) - - gamma = d.pop("gamma", UNSET) - - prem = d.pop("prem", UNSET) - - profit = d.pop("profit", UNSET) - - rho = d.pop("rho", UNSET) - - theta = d.pop("theta", UNSET) - - total_value = d.pop("totalValue", UNSET) - - vega = d.pop("vega", UNSET) - - volatility = d.pop("volatility", UNSET) - - scenario_position = cls( - delta=delta, - gamma=gamma, - prem=prem, - profit=profit, - rho=rho, - theta=theta, - total_value=total_value, - vega=vega, - volatility=volatility, - ) - - return scenario_position diff --git a/openapi_project/openapi_package/models/scenario_theo.py b/openapi_project/openapi_package/models/scenario_theo.py deleted file mode 100644 index aed5e8df4..000000000 --- a/openapi_project/openapi_package/models/scenario_theo.py +++ /dev/null @@ -1,78 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.scenario import Scenario - - -T = TypeVar("T", bound="ScenarioTheo") - - -@_attrs_define -class ScenarioTheo: - """ - Attributes: - as_of_ts (Unset | str): - as_of_eval_expiry (Unset | bool): - scenarios (Unset | list[Scenario]): - """ - - as_of_ts: Unset | str = UNSET - as_of_eval_expiry: Unset | bool = UNSET - scenarios: Unset | list[Scenario] = UNSET - - def to_dict(self) -> dict[str, Any]: - as_of_ts = self.as_of_ts - - as_of_eval_expiry = self.as_of_eval_expiry - - scenarios: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.scenarios, Unset): - scenarios = [] - for scenarios_item_data in self.scenarios: - scenarios_item = scenarios_item_data.to_dict() - scenarios.append(scenarios_item) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if as_of_ts is not UNSET: - field_dict["asOfTs"] = as_of_ts - if as_of_eval_expiry is not UNSET: - field_dict["asOfEvalExpiry"] = as_of_eval_expiry - if scenarios is not UNSET: - field_dict["scenarios"] = scenarios - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - as_of_ts = d.pop("asOfTs", UNSET) - - as_of_eval_expiry = d.pop("asOfEvalExpiry", UNSET) - - scenarios = [] - _scenarios = d.pop("scenarios", UNSET) - for scenarios_item_data in _scenarios or []: - scenarios_item = Scenario.from_dict(scenarios_item_data) - - scenarios.append(scenarios_item) - - scenario_theo = cls( - as_of_ts=as_of_ts, - as_of_eval_expiry=as_of_eval_expiry, - scenarios=scenarios, - ) - - return scenario_theo diff --git a/openapi_project/openapi_package/models/search_order_history_response.py b/openapi_project/openapi_package/models/search_order_history_response.py deleted file mode 100644 index 3ab516668..000000000 --- a/openapi_project/openapi_package/models/search_order_history_response.py +++ /dev/null @@ -1,84 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.generic_order import GenericOrder - - -T = TypeVar("T", bound="SearchOrderHistoryResponse") - - -@_attrs_define -class SearchOrderHistoryResponse: - """ - Attributes: - orders (Unset | list[GenericOrder]): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - orders: Unset | list[GenericOrder] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - orders: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.orders, Unset): - orders = [] - for orders_item_data in self.orders: - orders_item = orders_item_data.to_dict() - orders.append(orders_item) - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if orders is not UNSET: - field_dict["orders"] = orders - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - orders = [] - _orders = d.pop("orders", UNSET) - for orders_item_data in _orders or []: - orders_item = GenericOrder.from_dict(orders_item_data) - - orders.append(orders_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - search_order_history_response = cls( - orders=orders, - error_message=error_message, - status_code=status_code, - ) - - return search_order_history_response diff --git a/openapi_project/openapi_package/models/security.py b/openapi_project/openapi_package/models/security.py deleted file mode 100644 index 30c99864d..000000000 --- a/openapi_project/openapi_package/models/security.py +++ /dev/null @@ -1,198 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.option_root import OptionRoot - from openapi_project.openapi_package.models.future import Future - from openapi_project.openapi_package.models.index import Index - from openapi_project.openapi_package.models.stock import Stock - from openapi_project.openapi_package.models.future_root import FutureRoot - from openapi_project.openapi_package.models.fx import Fx - from openapi_project.openapi_package.models.future_spread import FutureSpread - from openapi_project.openapi_package.models.flex_option import FlexOption - from openapi_project.openapi_package.models.option import Option - from openapi_project.openapi_package.models.crypto import Crypto - - -T = TypeVar("T", bound="Security") - - -@_attrs_define -class Security: - """ - Attributes: - stock (Unset | Stock): - option (Unset | Option): - option_root (Unset | OptionRoot): - future (Unset | Future): - future_root (Unset | FutureRoot): - index (Unset | Index): - future_spread (Unset | FutureSpread): - fx (Unset | Fx): - crypto (Unset | Crypto): - flex_option (Unset | FlexOption): - """ - - stock: Unset | Stock = UNSET - option: Unset | Option = UNSET - option_root: Unset | OptionRoot = UNSET - future: Unset | Future = UNSET - future_root: Unset | FutureRoot = UNSET - index: Unset | Index = UNSET - future_spread: Unset | FutureSpread = UNSET - fx: Unset | Fx = UNSET - crypto: Unset | Crypto = UNSET - flex_option: Unset | FlexOption = UNSET - - def to_dict(self) -> dict[str, Any]: - stock: Unset | dict[str, Any] = ( - UNSET if isinstance(self.stock, Unset) else self.stock.to_dict() - ) - - option: Unset | dict[str, Any] = ( - UNSET if isinstance(self.option, Unset) else self.option.to_dict() - ) - - option_root: Unset | dict[str, Any] = ( - UNSET if isinstance(self.option_root, Unset) else self.option_root.to_dict() - ) - - future: Unset | dict[str, Any] = ( - UNSET if isinstance(self.future, Unset) else self.future.to_dict() - ) - - future_root: Unset | dict[str, Any] = ( - UNSET if isinstance(self.future_root, Unset) else self.future_root.to_dict() - ) - - index: Unset | dict[str, Any] = ( - UNSET if isinstance(self.index, Unset) else self.index.to_dict() - ) - - future_spread: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.future_spread, Unset) - else self.future_spread.to_dict() - ) - - fx: Unset | dict[str, Any] = ( - UNSET if isinstance(self.fx, Unset) else self.fx.to_dict() - ) - - crypto: Unset | dict[str, Any] = ( - UNSET if isinstance(self.crypto, Unset) else self.crypto.to_dict() - ) - - flex_option: Unset | dict[str, Any] = ( - UNSET if isinstance(self.flex_option, Unset) else self.flex_option.to_dict() - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if stock is not UNSET: - field_dict["stock"] = stock - if option is not UNSET: - field_dict["option"] = option - if option_root is not UNSET: - field_dict["optionRoot"] = option_root - if future is not UNSET: - field_dict["future"] = future - if future_root is not UNSET: - field_dict["futureRoot"] = future_root - if index is not UNSET: - field_dict["index"] = index - if future_spread is not UNSET: - field_dict["futureSpread"] = future_spread - if fx is not UNSET: - field_dict["fx"] = fx - if crypto is not UNSET: - field_dict["crypto"] = crypto - if flex_option is not UNSET: - field_dict["flexOption"] = flex_option - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _stock = d.pop("stock", UNSET) - stock: Unset | Stock = ( - UNSET if isinstance(_stock, Unset) else Stock.from_dict(_stock) - ) - - _option = d.pop("option", UNSET) - option: Unset | Option = ( - UNSET if isinstance(_option, Unset) else Option.from_dict(_option) - ) - - _option_root = d.pop("optionRoot", UNSET) - option_root: Unset | OptionRoot = ( - UNSET - if isinstance(_option_root, Unset) - else OptionRoot.from_dict(_option_root) - ) - - _future = d.pop("future", UNSET) - future: Unset | Future = ( - UNSET if isinstance(_future, Unset) else Future.from_dict(_future) - ) - - _future_root = d.pop("futureRoot", UNSET) - future_root: Unset | FutureRoot = ( - UNSET - if isinstance(_future_root, Unset) - else FutureRoot.from_dict(_future_root) - ) - - _index = d.pop("index", UNSET) - index: Unset | Index = ( - UNSET if isinstance(_index, Unset) else Index.from_dict(_index) - ) - - _future_spread = d.pop("futureSpread", UNSET) - future_spread: Unset | FutureSpread = ( - UNSET - if isinstance(_future_spread, Unset) - else FutureSpread.from_dict(_future_spread) - ) - - _fx = d.pop("fx", UNSET) - fx: Unset | Fx = UNSET if isinstance(_fx, Unset) else Fx.from_dict(_fx) - - _crypto = d.pop("crypto", UNSET) - crypto: Unset | Crypto = ( - UNSET if isinstance(_crypto, Unset) else Crypto.from_dict(_crypto) - ) - - _flex_option = d.pop("flexOption", UNSET) - flex_option: Unset | FlexOption = ( - UNSET - if isinstance(_flex_option, Unset) - else FlexOption.from_dict(_flex_option) - ) - - security = cls( - stock=stock, - option=option, - option_root=option_root, - future=future, - future_root=future_root, - index=index, - future_spread=future_spread, - fx=fx, - crypto=crypto, - flex_option=flex_option, - ) - - return security diff --git a/openapi_project/openapi_package/models/security_category.py b/openapi_project/openapi_package/models/security_category.py deleted file mode 100644 index 2d7108ca9..000000000 --- a/openapi_project/openapi_package/models/security_category.py +++ /dev/null @@ -1,39 +0,0 @@ -from enum import Enum - - -class SecurityCategory(str, Enum): - SECURITY_CATEGORY_ADR = "SECURITY_CATEGORY_ADR" - SECURITY_CATEGORY_COMMON_STOCK = "SECURITY_CATEGORY_COMMON_STOCK" - SECURITY_CATEGORY_CONVERTIBLE = "SECURITY_CATEGORY_CONVERTIBLE" - SECURITY_CATEGORY_CORPORATE_BOND = "SECURITY_CATEGORY_CORPORATE_BOND" - SECURITY_CATEGORY_CRYPTO = "SECURITY_CATEGORY_CRYPTO" - SECURITY_CATEGORY_DEBENTURE = "SECURITY_CATEGORY_DEBENTURE" - SECURITY_CATEGORY_EQUITY_OPTION = "SECURITY_CATEGORY_EQUITY_OPTION" - SECURITY_CATEGORY_ETF = "SECURITY_CATEGORY_ETF" - SECURITY_CATEGORY_ETN = "SECURITY_CATEGORY_ETN" - SECURITY_CATEGORY_FLEX_OPTION = "SECURITY_CATEGORY_FLEX_OPTION" - SECURITY_CATEGORY_FUTURE = "SECURITY_CATEGORY_FUTURE" - SECURITY_CATEGORY_FUTURE_OPTION = "SECURITY_CATEGORY_FUTURE_OPTION" - SECURITY_CATEGORY_FUTURE_ROOT = "SECURITY_CATEGORY_FUTURE_ROOT" - SECURITY_CATEGORY_FUTURE_SPREAD = "SECURITY_CATEGORY_FUTURE_SPREAD" - SECURITY_CATEGORY_FX = "SECURITY_CATEGORY_FX" - SECURITY_CATEGORY_INDEX = "SECURITY_CATEGORY_INDEX" - SECURITY_CATEGORY_INDEX_OPTION = "SECURITY_CATEGORY_INDEX_OPTION" - SECURITY_CATEGORY_INSTALLMENT_RECEIPT = "SECURITY_CATEGORY_INSTALLMENT_RECEIPT" - SECURITY_CATEGORY_MUNICIPAL_BOND = "SECURITY_CATEGORY_MUNICIPAL_BOND" - SECURITY_CATEGORY_MUTUAL_FUND = "SECURITY_CATEGORY_MUTUAL_FUND" - SECURITY_CATEGORY_NOTE = "SECURITY_CATEGORY_NOTE" - SECURITY_CATEGORY_OPTION_ROOT = "SECURITY_CATEGORY_OPTION_ROOT" - SECURITY_CATEGORY_PREFERRED_STOCK = "SECURITY_CATEGORY_PREFERRED_STOCK" - SECURITY_CATEGORY_RIGHT = "SECURITY_CATEGORY_RIGHT" - SECURITY_CATEGORY_TEST = "SECURITY_CATEGORY_TEST" - SECURITY_CATEGORY_TREASURY_BILL = "SECURITY_CATEGORY_TREASURY_BILL" - SECURITY_CATEGORY_TRUST_UNIT = "SECURITY_CATEGORY_TRUST_UNIT" - SECURITY_CATEGORY_UNIT = "SECURITY_CATEGORY_UNIT" - SECURITY_CATEGORY_UNKNOWN = "SECURITY_CATEGORY_UNKNOWN" - SECURITY_CATEGORY_WARRANT = "SECURITY_CATEGORY_WARRANT" - SECURITY_CATEGORY_WHEN_DISTRIBUTED = "SECURITY_CATEGORY_WHEN_DISTRIBUTED" - SECURITY_CATEGORY_WHEN_ISSUED = "SECURITY_CATEGORY_WHEN_ISSUED" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/security_type.py b/openapi_project/openapi_package/models/security_type.py deleted file mode 100644 index 891a6dcbc..000000000 --- a/openapi_project/openapi_package/models/security_type.py +++ /dev/null @@ -1,19 +0,0 @@ -from enum import Enum - - -class SecurityType(str, Enum): - SECURITY_TYPE_BOND = "SECURITY_TYPE_BOND" - SECURITY_TYPE_CRYPTO = "SECURITY_TYPE_CRYPTO" - SECURITY_TYPE_FLEX_OPTION = "SECURITY_TYPE_FLEX_OPTION" - SECURITY_TYPE_FUTURE = "SECURITY_TYPE_FUTURE" - SECURITY_TYPE_FUTURE_ROOT = "SECURITY_TYPE_FUTURE_ROOT" - SECURITY_TYPE_FUTURE_SPREAD = "SECURITY_TYPE_FUTURE_SPREAD" - SECURITY_TYPE_FX = "SECURITY_TYPE_FX" - SECURITY_TYPE_INDEX = "SECURITY_TYPE_INDEX" - SECURITY_TYPE_OPTION = "SECURITY_TYPE_OPTION" - SECURITY_TYPE_OPTION_ROOT = "SECURITY_TYPE_OPTION_ROOT" - SECURITY_TYPE_STOCK = "SECURITY_TYPE_STOCK" - SECURITY_TYPE_UNKNOWN = "SECURITY_TYPE_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/settlement_deliverable_type.py b/openapi_project/openapi_package/models/settlement_deliverable_type.py deleted file mode 100644 index 0163027b4..000000000 --- a/openapi_project/openapi_package/models/settlement_deliverable_type.py +++ /dev/null @@ -1,11 +0,0 @@ -from enum import Enum - - -class SettlementDeliverableType(str, Enum): - SETTLEMENT_DELIVERABLE_TYPE_CASH = "SETTLEMENT_DELIVERABLE_TYPE_CASH" - SETTLEMENT_DELIVERABLE_TYPE_PHYSICAL = "SETTLEMENT_DELIVERABLE_TYPE_PHYSICAL" - SETTLEMENT_DELIVERABLE_TYPE_UNDEFINED = "SETTLEMENT_DELIVERABLE_TYPE_UNDEFINED" - SETTLEMENT_DELIVERABLE_TYPE_UNDERLYING = "SETTLEMENT_DELIVERABLE_TYPE_UNDERLYING" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/settlement_info.py b/openapi_project/openapi_package/models/settlement_info.py deleted file mode 100644 index 33cdac094..000000000 --- a/openapi_project/openapi_package/models/settlement_info.py +++ /dev/null @@ -1,74 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.settlement_deliverable_type import SettlementDeliverableType -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="SettlementInfo") - - -@_attrs_define -class SettlementInfo: - """ - Attributes: - amount (Unset | float): - symbol (Unset | str): - deliverable_type (Unset | SettlementDeliverableType): - """ - - amount: Unset | float = UNSET - symbol: Unset | str = UNSET - deliverable_type: Unset | SettlementDeliverableType = UNSET - - def to_dict(self) -> dict[str, Any]: - amount = self.amount - - symbol = self.symbol - - deliverable_type: Unset | str = ( - UNSET - if isinstance(self.deliverable_type, Unset) - else self.deliverable_type.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if amount is not UNSET: - field_dict["amount"] = amount - if symbol is not UNSET: - field_dict["symbol"] = symbol - if deliverable_type is not UNSET: - field_dict["deliverableType"] = deliverable_type - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - amount = d.pop("amount", UNSET) - - symbol = d.pop("symbol", UNSET) - - _deliverable_type = d.pop("deliverableType", UNSET) - deliverable_type: Unset | SettlementDeliverableType = ( - UNSET - if isinstance(_deliverable_type, Unset) - else SettlementDeliverableType(_deliverable_type) - ) - - settlement_info = cls( - amount=amount, - symbol=symbol, - deliverable_type=deliverable_type, - ) - - return settlement_info diff --git a/openapi_project/openapi_package/models/shock_value.py b/openapi_project/openapi_package/models/shock_value.py deleted file mode 100644 index e46b7f5f6..000000000 --- a/openapi_project/openapi_package/models/shock_value.py +++ /dev/null @@ -1,100 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.shock_value_flags import ShockValueFlags - - -T = TypeVar("T", bound="ShockValue") - - -@_attrs_define -class ShockValue: - """ - Attributes: - delta (Unset | float): - dollar_delta (Unset | float): - pn_l (Unset | float): - nav (Unset | float): - volatility (Unset | float): - flags (Unset | ShockValueFlags): - """ - - delta: Unset | float = UNSET - dollar_delta: Unset | float = UNSET - pn_l: Unset | float = UNSET - nav: Unset | float = UNSET - volatility: Unset | float = UNSET - flags: Unset | ShockValueFlags = UNSET - - def to_dict(self) -> dict[str, Any]: - delta = self.delta - - dollar_delta = self.dollar_delta - - pn_l = self.pn_l - - nav = self.nav - - volatility = self.volatility - - flags: Unset | dict[str, Any] = ( - UNSET if isinstance(self.flags, Unset) else self.flags.to_dict() - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if delta is not UNSET: - field_dict["delta"] = delta - if dollar_delta is not UNSET: - field_dict["dollarDelta"] = dollar_delta - if pn_l is not UNSET: - field_dict["pnL"] = pn_l - if nav is not UNSET: - field_dict["nav"] = nav - if volatility is not UNSET: - field_dict["volatility"] = volatility - if flags is not UNSET: - field_dict["flags"] = flags - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - delta = d.pop("delta", UNSET) - - dollar_delta = d.pop("dollarDelta", UNSET) - - pn_l = d.pop("pnL", UNSET) - - nav = d.pop("nav", UNSET) - - volatility = d.pop("volatility", UNSET) - - _flags = d.pop("flags", UNSET) - flags: Unset | ShockValueFlags = ( - UNSET if isinstance(_flags, Unset) else ShockValueFlags.from_dict(_flags) - ) - - shock_value = cls( - delta=delta, - dollar_delta=dollar_delta, - pn_l=pn_l, - nav=nav, - volatility=volatility, - flags=flags, - ) - - return shock_value diff --git a/openapi_project/openapi_package/models/shock_value_flags.py b/openapi_project/openapi_package/models/shock_value_flags.py deleted file mode 100644 index 81619005f..000000000 --- a/openapi_project/openapi_package/models/shock_value_flags.py +++ /dev/null @@ -1,64 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="ShockValueFlags") - - -@_attrs_define -class ShockValueFlags: - """ - Attributes: - expired (Unset | bool): - exercised (Unset | bool): - delivered (Unset | bool): - """ - - expired: Unset | bool = UNSET - exercised: Unset | bool = UNSET - delivered: Unset | bool = UNSET - - def to_dict(self) -> dict[str, Any]: - expired = self.expired - - exercised = self.exercised - - delivered = self.delivered - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if expired is not UNSET: - field_dict["expired"] = expired - if exercised is not UNSET: - field_dict["exercised"] = exercised - if delivered is not UNSET: - field_dict["delivered"] = delivered - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - expired = d.pop("expired", UNSET) - - exercised = d.pop("exercised", UNSET) - - delivered = d.pop("delivered", UNSET) - - shock_value_flags = cls( - expired=expired, - exercised=exercised, - delivered=delivered, - ) - - return shock_value_flags diff --git a/openapi_project/openapi_package/models/side.py b/openapi_project/openapi_package/models/side.py deleted file mode 100644 index c85e0bf27..000000000 --- a/openapi_project/openapi_package/models/side.py +++ /dev/null @@ -1,13 +0,0 @@ -from enum import Enum - - -class Side(str, Enum): - SIDE_BUY = "SIDE_BUY" - SIDE_CROSS = "SIDE_CROSS" - SIDE_NOT_SPECIFIED = "SIDE_NOT_SPECIFIED" - SIDE_SELL = "SIDE_SELL" - SIDE_SELL_SHORT = "SIDE_SELL_SHORT" - SIDE_SELL_SHORT_EXEMPT = "SIDE_SELL_SHORT_EXEMPT" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/spread_leg_side.py b/openapi_project/openapi_package/models/spread_leg_side.py deleted file mode 100644 index af9adc8ff..000000000 --- a/openapi_project/openapi_package/models/spread_leg_side.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class SpreadLegSide(str, Enum): - SPREAD_LEG_SIDE_BUY = "SPREAD_LEG_SIDE_BUY" - SPREAD_LEG_SIDE_SELL = "SPREAD_LEG_SIDE_SELL" - SPREAD_LEG_SIDE_UNKNOWN = "SPREAD_LEG_SIDE_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/spread_leg_type.py b/openapi_project/openapi_package/models/spread_leg_type.py deleted file mode 100644 index a6813e623..000000000 --- a/openapi_project/openapi_package/models/spread_leg_type.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class SpreadLegType(str, Enum): - SPREAD_LEG_TYPE_OUTRIGHT = "SPREAD_LEG_TYPE_OUTRIGHT" - SPREAD_LEG_TYPE_UNKNOWN = "SPREAD_LEG_TYPE_UNKNOWN" - SPREAD_LEG_TYPE_VOLATILITY = "SPREAD_LEG_TYPE_VOLATILITY" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/status.py b/openapi_project/openapi_package/models/status.py deleted file mode 100644 index 24f966b83..000000000 --- a/openapi_project/openapi_package/models/status.py +++ /dev/null @@ -1,78 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.any_model import AnyModel - - -T = TypeVar("T", bound="Status") - - -@_attrs_define -class Status: - """ - Attributes: - code (Unset | int): - message (Unset | str): - details (Unset | list[AnyModel]): - """ - - code: Unset | int = UNSET - message: Unset | str = UNSET - details: Unset | list[AnyModel] = UNSET - - def to_dict(self) -> dict[str, Any]: - code = self.code - - message = self.message - - details: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.details, Unset): - details = [] - for details_item_data in self.details: - details_item = details_item_data.to_dict() - details.append(details_item) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if code is not UNSET: - field_dict["code"] = code - if message is not UNSET: - field_dict["message"] = message - if details is not UNSET: - field_dict["details"] = details - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - code = d.pop("code", UNSET) - - message = d.pop("message", UNSET) - - details = [] - _details = d.pop("details", UNSET) - for details_item_data in _details or []: - details_item = AnyModel.from_dict(details_item_data) - - details.append(details_item) - - status = cls( - code=code, - message=message, - details=details, - ) - - return status diff --git a/openapi_project/openapi_package/models/status_code.py b/openapi_project/openapi_package/models/status_code.py deleted file mode 100644 index 3f7c54600..000000000 --- a/openapi_project/openapi_package/models/status_code.py +++ /dev/null @@ -1,19 +0,0 @@ -from enum import Enum - - -class StatusCode(str, Enum): - STATUS_CODE_DISCONNECTED = "STATUS_CODE_DISCONNECTED" - STATUS_CODE_ERROR = "STATUS_CODE_ERROR" - STATUS_CODE_NOT_AUTHORIZED = "STATUS_CODE_NOT_AUTHORIZED" - STATUS_CODE_NOT_CONNECTED = "STATUS_CODE_NOT_CONNECTED" - STATUS_CODE_NOT_FOUND = "STATUS_CODE_NOT_FOUND" - STATUS_CODE_NOT_UPDATED = "STATUS_CODE_NOT_UPDATED" - STATUS_CODE_OK = "STATUS_CODE_OK" - STATUS_CODE_PEER_ALREADY_EXISTS = "STATUS_CODE_PEER_ALREADY_EXISTS" - STATUS_CODE_SERVER_BUSY = "STATUS_CODE_SERVER_BUSY" - STATUS_CODE_SERVER_ERROR = "STATUS_CODE_SERVER_ERROR" - STATUS_CODE_TIMEOUT = "STATUS_CODE_TIMEOUT" - STATUS_CODE_VALIDATION_ERROR = "STATUS_CODE_VALIDATION_ERROR" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/stock.py b/openapi_project/openapi_package/models/stock.py deleted file mode 100644 index 1cf6f8e21..000000000 --- a/openapi_project/openapi_package/models/stock.py +++ /dev/null @@ -1,310 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.models.exchange_code import ExchangeCode -from openapi_project.openapi_package.models.numeric_display_format import NumericDisplayFormat -from openapi_project.openapi_package.models.security_category import SecurityCategory -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.date import Date - from openapi_project.openapi_package.models.stock_aliases import StockAliases - - -T = TypeVar("T", bound="Stock") - - -@_attrs_define -class Stock: - """ - Attributes: - aliases (Unset | StockAliases): - currency (Unset | Currency): - listed_dt (Unset | Date): - delisted_dt (Unset | Date): - description (Unset | str): - exchange_id (Unset | int): - id_ (Unset | int): - multiplier (Unset | float): - price_base_factor (Unset | float): - price_display_factor (Unset | float): - price_display_format (Unset | NumericDisplayFormat): - qty_display_factor (Unset | float): - qty_display_format (Unset | NumericDisplayFormat): - security_category (Unset | SecurityCategory): - symbol (Unset | str): - tick_rule (Unset | str): - tick_size (Unset | float): - tick_value (Unset | float): - traded_exchanges (Unset | list[ExchangeCode]): - category (Unset | str): - industry (Unset | str): - lot_size (Unset | int): - sector (Unset | str): - """ - - aliases: Unset | StockAliases = UNSET - currency: Unset | Currency = UNSET - listed_dt: Unset | Date = UNSET - delisted_dt: Unset | Date = UNSET - description: Unset | str = UNSET - exchange_id: Unset | int = UNSET - id_: Unset | int = UNSET - multiplier: Unset | float = UNSET - price_base_factor: Unset | float = UNSET - price_display_factor: Unset | float = UNSET - price_display_format: Unset | NumericDisplayFormat = UNSET - qty_display_factor: Unset | float = UNSET - qty_display_format: Unset | NumericDisplayFormat = UNSET - security_category: Unset | SecurityCategory = UNSET - symbol: Unset | str = UNSET - tick_rule: Unset | str = UNSET - tick_size: Unset | float = UNSET - tick_value: Unset | float = UNSET - traded_exchanges: Unset | list[ExchangeCode] = UNSET - category: Unset | str = UNSET - industry: Unset | str = UNSET - lot_size: Unset | int = UNSET - sector: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - aliases: Unset | dict[str, Any] = ( - UNSET if isinstance(self.aliases, Unset) else self.aliases.to_dict() - ) - - currency: Unset | str = ( - UNSET if isinstance(self.currency, Unset) else self.currency.value - ) - - listed_dt: Unset | dict[str, Any] = ( - UNSET if isinstance(self.listed_dt, Unset) else self.listed_dt.to_dict() - ) - - delisted_dt: Unset | dict[str, Any] = ( - UNSET if isinstance(self.delisted_dt, Unset) else self.delisted_dt.to_dict() - ) - - description = self.description - - exchange_id = self.exchange_id - - id_ = self.id_ - - multiplier = self.multiplier - - price_base_factor = self.price_base_factor - - price_display_factor = self.price_display_factor - - price_display_format: Unset | str = ( - UNSET - if isinstance(self.price_display_format, Unset) - else self.price_display_format.value - ) - - qty_display_factor = self.qty_display_factor - - qty_display_format: Unset | str = ( - UNSET - if isinstance(self.qty_display_format, Unset) - else self.qty_display_format.value - ) - - security_category: Unset | str = ( - UNSET - if isinstance(self.security_category, Unset) - else self.security_category.value - ) - - symbol = self.symbol - - tick_rule = self.tick_rule - - tick_size = self.tick_size - - tick_value = self.tick_value - - traded_exchanges: Unset | list[str] = UNSET - if not isinstance(self.traded_exchanges, Unset): - traded_exchanges = [] - for traded_exchanges_item_data in self.traded_exchanges: - traded_exchanges_item = traded_exchanges_item_data.value - traded_exchanges.append(traded_exchanges_item) - - category = self.category - - industry = self.industry - - lot_size = self.lot_size - - sector = self.sector - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if aliases is not UNSET: - field_dict["aliases"] = aliases - if currency is not UNSET: - field_dict["currency"] = currency - if listed_dt is not UNSET: - field_dict["listedDt"] = listed_dt - if delisted_dt is not UNSET: - field_dict["delistedDt"] = delisted_dt - if description is not UNSET: - field_dict["description"] = description - if exchange_id is not UNSET: - field_dict["exchangeId"] = exchange_id - if id_ is not UNSET: - field_dict["id"] = id - if multiplier is not UNSET: - field_dict["multiplier"] = multiplier - if price_base_factor is not UNSET: - field_dict["priceBaseFactor"] = price_base_factor - if price_display_factor is not UNSET: - field_dict["priceDisplayFactor"] = price_display_factor - if price_display_format is not UNSET: - field_dict["priceDisplayFormat"] = price_display_format - if qty_display_factor is not UNSET: - field_dict["qtyDisplayFactor"] = qty_display_factor - if qty_display_format is not UNSET: - field_dict["qtyDisplayFormat"] = qty_display_format - if security_category is not UNSET: - field_dict["securityCategory"] = security_category - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tick_rule is not UNSET: - field_dict["tickRule"] = tick_rule - if tick_size is not UNSET: - field_dict["tickSize"] = tick_size - if tick_value is not UNSET: - field_dict["tickValue"] = tick_value - if traded_exchanges is not UNSET: - field_dict["tradedExchanges"] = traded_exchanges - if category is not UNSET: - field_dict["category"] = category - if industry is not UNSET: - field_dict["industry"] = industry - if lot_size is not UNSET: - field_dict["lotSize"] = lot_size - if sector is not UNSET: - field_dict["sector"] = sector - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - _aliases = d.pop("aliases", UNSET) - aliases: Unset | StockAliases = ( - UNSET if isinstance(_aliases, Unset) else StockAliases.from_dict(_aliases) - ) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency = ( - UNSET if isinstance(_currency, Unset) else Currency(_currency) - ) - - _listed_dt = d.pop("listedDt", UNSET) - listed_dt: Unset | Date = ( - UNSET if isinstance(_listed_dt, Unset) else Date.from_dict(_listed_dt) - ) - - _delisted_dt = d.pop("delistedDt", UNSET) - delisted_dt: Unset | Date = ( - UNSET if isinstance(_delisted_dt, Unset) else Date.from_dict(_delisted_dt) - ) - - description = d.pop("description", UNSET) - - exchange_id = d.pop("exchangeId", UNSET) - - id_ = d.pop("id", UNSET) - - multiplier = d.pop("multiplier", UNSET) - - price_base_factor = d.pop("priceBaseFactor", UNSET) - - price_display_factor = d.pop("priceDisplayFactor", UNSET) - - _price_display_format = d.pop("priceDisplayFormat", UNSET) - price_display_format: Unset | NumericDisplayFormat = ( - UNSET - if isinstance(_price_display_format, Unset) - else NumericDisplayFormat(_price_display_format) - ) - - qty_display_factor = d.pop("qtyDisplayFactor", UNSET) - - _qty_display_format = d.pop("qtyDisplayFormat", UNSET) - qty_display_format: Unset | NumericDisplayFormat = ( - UNSET - if isinstance(_qty_display_format, Unset) - else NumericDisplayFormat(_qty_display_format) - ) - - _security_category = d.pop("securityCategory", UNSET) - security_category: Unset | SecurityCategory = ( - UNSET - if isinstance(_security_category, Unset) - else SecurityCategory(_security_category) - ) - - symbol = d.pop("symbol", UNSET) - - tick_rule = d.pop("tickRule", UNSET) - - tick_size = d.pop("tickSize", UNSET) - - tick_value = d.pop("tickValue", UNSET) - - traded_exchanges = [] - _traded_exchanges = d.pop("tradedExchanges", UNSET) - for traded_exchanges_item_data in _traded_exchanges or []: - traded_exchanges_item = ExchangeCode(traded_exchanges_item_data) - - traded_exchanges.append(traded_exchanges_item) - - category = d.pop("category", UNSET) - - industry = d.pop("industry", UNSET) - - lot_size = d.pop("lotSize", UNSET) - - sector = d.pop("sector", UNSET) - - stock = cls( - aliases=aliases, - currency=currency, - listed_dt=listed_dt, - delisted_dt=delisted_dt, - description=description, - exchange_id=exchange_id, - id_=id_, - multiplier=multiplier, - price_base_factor=price_base_factor, - price_display_factor=price_display_factor, - price_display_format=price_display_format, - qty_display_factor=qty_display_factor, - qty_display_format=qty_display_format, - security_category=security_category, - symbol=symbol, - tick_rule=tick_rule, - tick_size=tick_size, - tick_value=tick_value, - traded_exchanges=traded_exchanges, - category=category, - industry=industry, - lot_size=lot_size, - sector=sector, - ) - - return stock diff --git a/openapi_project/openapi_package/models/stock_aliases.py b/openapi_project/openapi_package/models/stock_aliases.py deleted file mode 100644 index 46376c056..000000000 --- a/openapi_project/openapi_package/models/stock_aliases.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast, Union - - -T = TypeVar("T", bound="StockAliases") - - -@_attrs_define -class StockAliases: - """ """ - - additional_properties: dict[str, Union[None, str]] = _attrs_field( - init=False, factory=dict - ) - - def to_dict(self) -> dict[str, Any]: - - field_dict: dict[str, Any] = {} - field_dict.update( - {prop_name: prop for prop_name, prop in self.additional_properties.items()} - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - stock_aliases = cls() - - additional_properties = {} - for prop_name, prop_dict in d.items(): - - def _parse_additional_property(data: object) -> Union[None, str]: - if data is None: - return data - return cast(Union[None, str], data) - - additional_property = _parse_additional_property(prop_dict) - - additional_properties[prop_name] = additional_property - - stock_aliases.additional_properties = additional_properties - return stock_aliases - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Union[None, str]: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Union[None, str]) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/stock_at_time_quote_format.py b/openapi_project/openapi_package/models/stock_at_time_quote_format.py new file mode 100644 index 000000000..ca3441f67 --- /dev/null +++ b/openapi_project/openapi_package/models/stock_at_time_quote_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class StockAtTimeQuoteFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_at_time_quote_response_200.py b/openapi_project/openapi_package/models/stock_at_time_quote_response_200.py new file mode 100644 index 000000000..4c6dde99c --- /dev/null +++ b/openapi_project/openapi_package/models/stock_at_time_quote_response_200.py @@ -0,0 +1,172 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="StockAtTimeQuoteResponse200") + + + +@_attrs_define +class StockAtTimeQuoteResponse200: + """ + Attributes: + ask_size (list[int]): + bid_size (list[int]): + ask_exchange (list[int]): + ask_condition (list[int]): + bid_exchange (list[int]): + ask (list[float]): + bid (list[float]): + bid_condition (list[int]): + timestamp (list[str]): + """ + + ask_size: list[int] + bid_size: list[int] + ask_exchange: list[int] + ask_condition: list[int] + bid_exchange: list[int] + ask: list[float] + bid: list[float] + bid_condition: list[int] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + ask_size = self.ask_size + + + + bid_size = self.bid_size + + + + ask_exchange = self.ask_exchange + + + + ask_condition = self.ask_condition + + + + bid_exchange = self.bid_exchange + + + + ask = self.ask + + + + bid = self.bid + + + + bid_condition = self.bid_condition + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "ask_size": ask_size, + "bid_size": bid_size, + "ask_exchange": ask_exchange, + "ask_condition": ask_condition, + "bid_exchange": bid_exchange, + "ask": ask, + "bid": bid, + "bid_condition": bid_condition, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + ask_size = cast(list[int], d.pop("ask_size")) + + + bid_size = cast(list[int], d.pop("bid_size")) + + + ask_exchange = cast(list[int], d.pop("ask_exchange")) + + + ask_condition = cast(list[int], d.pop("ask_condition")) + + + bid_exchange = cast(list[int], d.pop("bid_exchange")) + + + ask = cast(list[float], d.pop("ask")) + + + bid = cast(list[float], d.pop("bid")) + + + bid_condition = cast(list[int], d.pop("bid_condition")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + stock_at_time_quote_response_200 = cls( + ask_size=ask_size, + bid_size=bid_size, + ask_exchange=ask_exchange, + ask_condition=ask_condition, + bid_exchange=bid_exchange, + ask=ask, + bid=bid, + bid_condition=bid_condition, + timestamp=timestamp, + ) + + + + stock_at_time_quote_response_200.additional_properties = d + return stock_at_time_quote_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/stock_at_time_quote_venue.py b/openapi_project/openapi_package/models/stock_at_time_quote_venue.py new file mode 100644 index 000000000..9b175eb0b --- /dev/null +++ b/openapi_project/openapi_package/models/stock_at_time_quote_venue.py @@ -0,0 +1,8 @@ +from enum import Enum + +class StockAtTimeQuoteVenue(str, Enum): + NQB = "nqb" + UTP_CTA = "utp_cta" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_at_time_trade_format.py b/openapi_project/openapi_package/models/stock_at_time_trade_format.py new file mode 100644 index 000000000..670971fb0 --- /dev/null +++ b/openapi_project/openapi_package/models/stock_at_time_trade_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class StockAtTimeTradeFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_at_time_trade_response_200.py b/openapi_project/openapi_package/models/stock_at_time_trade_response_200.py new file mode 100644 index 000000000..3318d2bb8 --- /dev/null +++ b/openapi_project/openapi_package/models/stock_at_time_trade_response_200.py @@ -0,0 +1,183 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="StockAtTimeTradeResponse200") + + + +@_attrs_define +class StockAtTimeTradeResponse200: + """ + Attributes: + sequence (list[int]): + condition (list[int]): + size (list[int]): + price (list[float]): + ext_condition2 (list[int]): + ext_condition1 (list[int]): + ext_condition4 (list[int]): + exchange (list[int]): + ext_condition3 (list[int]): + timestamp (list[str]): + """ + + sequence: list[int] + condition: list[int] + size: list[int] + price: list[float] + ext_condition2: list[int] + ext_condition1: list[int] + ext_condition4: list[int] + exchange: list[int] + ext_condition3: list[int] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + sequence = self.sequence + + + + condition = self.condition + + + + size = self.size + + + + price = self.price + + + + ext_condition2 = self.ext_condition2 + + + + ext_condition1 = self.ext_condition1 + + + + ext_condition4 = self.ext_condition4 + + + + exchange = self.exchange + + + + ext_condition3 = self.ext_condition3 + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "sequence": sequence, + "condition": condition, + "size": size, + "price": price, + "ext_condition2": ext_condition2, + "ext_condition1": ext_condition1, + "ext_condition4": ext_condition4, + "exchange": exchange, + "ext_condition3": ext_condition3, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + sequence = cast(list[int], d.pop("sequence")) + + + condition = cast(list[int], d.pop("condition")) + + + size = cast(list[int], d.pop("size")) + + + price = cast(list[float], d.pop("price")) + + + ext_condition2 = cast(list[int], d.pop("ext_condition2")) + + + ext_condition1 = cast(list[int], d.pop("ext_condition1")) + + + ext_condition4 = cast(list[int], d.pop("ext_condition4")) + + + exchange = cast(list[int], d.pop("exchange")) + + + ext_condition3 = cast(list[int], d.pop("ext_condition3")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + stock_at_time_trade_response_200 = cls( + sequence=sequence, + condition=condition, + size=size, + price=price, + ext_condition2=ext_condition2, + ext_condition1=ext_condition1, + ext_condition4=ext_condition4, + exchange=exchange, + ext_condition3=ext_condition3, + timestamp=timestamp, + ) + + + + stock_at_time_trade_response_200.additional_properties = d + return stock_at_time_trade_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/stock_at_time_trade_venue.py b/openapi_project/openapi_package/models/stock_at_time_trade_venue.py new file mode 100644 index 000000000..a370a37d8 --- /dev/null +++ b/openapi_project/openapi_package/models/stock_at_time_trade_venue.py @@ -0,0 +1,8 @@ +from enum import Enum + +class StockAtTimeTradeVenue(str, Enum): + NQB = "nqb" + UTP_CTA = "utp_cta" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_history_eod_format.py b/openapi_project/openapi_package/models/stock_history_eod_format.py new file mode 100644 index 000000000..f16dde623 --- /dev/null +++ b/openapi_project/openapi_package/models/stock_history_eod_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class StockHistoryEodFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_history_eod_response_200.py b/openapi_project/openapi_package/models/stock_history_eod_response_200.py new file mode 100644 index 000000000..94754c5fb --- /dev/null +++ b/openapi_project/openapi_package/models/stock_history_eod_response_200.py @@ -0,0 +1,249 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="StockHistoryEodResponse200") + + + +@_attrs_define +class StockHistoryEodResponse200: + """ + Attributes: + ask_size (list[int]): + last_trade (list[str]): + created (list[str]): + ask_condition (list[int]): + count (list[int]): + volume (list[int]): + high (list[float]): + low (list[float]): + bid_size (list[int]): + ask_exchange (list[int]): + bid_exchange (list[int]): + ask (list[float]): + bid (list[float]): + bid_condition (list[int]): + close (list[float]): + open_ (list[float]): + """ + + ask_size: list[int] + last_trade: list[str] + created: list[str] + ask_condition: list[int] + count: list[int] + volume: list[int] + high: list[float] + low: list[float] + bid_size: list[int] + ask_exchange: list[int] + bid_exchange: list[int] + ask: list[float] + bid: list[float] + bid_condition: list[int] + close: list[float] + open_: list[float] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + ask_size = self.ask_size + + + + last_trade = self.last_trade + + + + created = self.created + + + + ask_condition = self.ask_condition + + + + count = self.count + + + + volume = self.volume + + + + high = self.high + + + + low = self.low + + + + bid_size = self.bid_size + + + + ask_exchange = self.ask_exchange + + + + bid_exchange = self.bid_exchange + + + + ask = self.ask + + + + bid = self.bid + + + + bid_condition = self.bid_condition + + + + close = self.close + + + + open_ = self.open_ + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "ask_size": ask_size, + "last_trade": last_trade, + "created": created, + "ask_condition": ask_condition, + "count": count, + "volume": volume, + "high": high, + "low": low, + "bid_size": bid_size, + "ask_exchange": ask_exchange, + "bid_exchange": bid_exchange, + "ask": ask, + "bid": bid, + "bid_condition": bid_condition, + "close": close, + "open": open_, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + ask_size = cast(list[int], d.pop("ask_size")) + + + last_trade = cast(list[str], d.pop("last_trade")) + + + created = cast(list[str], d.pop("created")) + + + ask_condition = cast(list[int], d.pop("ask_condition")) + + + count = cast(list[int], d.pop("count")) + + + volume = cast(list[int], d.pop("volume")) + + + high = cast(list[float], d.pop("high")) + + + low = cast(list[float], d.pop("low")) + + + bid_size = cast(list[int], d.pop("bid_size")) + + + ask_exchange = cast(list[int], d.pop("ask_exchange")) + + + bid_exchange = cast(list[int], d.pop("bid_exchange")) + + + ask = cast(list[float], d.pop("ask")) + + + bid = cast(list[float], d.pop("bid")) + + + bid_condition = cast(list[int], d.pop("bid_condition")) + + + close = cast(list[float], d.pop("close")) + + + open_ = cast(list[float], d.pop("open")) + + + stock_history_eod_response_200 = cls( + ask_size=ask_size, + last_trade=last_trade, + created=created, + ask_condition=ask_condition, + count=count, + volume=volume, + high=high, + low=low, + bid_size=bid_size, + ask_exchange=ask_exchange, + bid_exchange=bid_exchange, + ask=ask, + bid=bid, + bid_condition=bid_condition, + close=close, + open_=open_, + ) + + + + stock_history_eod_response_200.additional_properties = d + return stock_history_eod_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/stock_history_ohlc_format.py b/openapi_project/openapi_package/models/stock_history_ohlc_format.py new file mode 100644 index 000000000..90e0c5eb5 --- /dev/null +++ b/openapi_project/openapi_package/models/stock_history_ohlc_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class StockHistoryOhlcFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_history_ohlc_interval.py b/openapi_project/openapi_package/models/stock_history_ohlc_interval.py new file mode 100644 index 000000000..3fc9a1475 --- /dev/null +++ b/openapi_project/openapi_package/models/stock_history_ohlc_interval.py @@ -0,0 +1,21 @@ +from enum import Enum + +class StockHistoryOhlcInterval(str, Enum): + TICK = "tick" + VALUE_1 = "10ms" + VALUE_10 = "5m" + VALUE_11 = "10m" + VALUE_12 = "15m" + VALUE_13 = "30m" + VALUE_14 = "1h" + VALUE_2 = "100ms" + VALUE_3 = "500ms" + VALUE_4 = "1s" + VALUE_5 = "5s" + VALUE_6 = "10s" + VALUE_7 = "15s" + VALUE_8 = "30s" + VALUE_9 = "1m" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_history_ohlc_response_200.py b/openapi_project/openapi_package/models/stock_history_ohlc_response_200.py new file mode 100644 index 000000000..8e7da1373 --- /dev/null +++ b/openapi_project/openapi_package/models/stock_history_ohlc_response_200.py @@ -0,0 +1,161 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="StockHistoryOhlcResponse200") + + + +@_attrs_define +class StockHistoryOhlcResponse200: + """ + Attributes: + volume (list[int]): + high (list[float]): + low (list[float]): + vwap (list[float]): + count (list[int]): + close (list[float]): + open_ (list[float]): + timestamp (list[str]): + """ + + volume: list[int] + high: list[float] + low: list[float] + vwap: list[float] + count: list[int] + close: list[float] + open_: list[float] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + volume = self.volume + + + + high = self.high + + + + low = self.low + + + + vwap = self.vwap + + + + count = self.count + + + + close = self.close + + + + open_ = self.open_ + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "volume": volume, + "high": high, + "low": low, + "vwap": vwap, + "count": count, + "close": close, + "open": open_, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + volume = cast(list[int], d.pop("volume")) + + + high = cast(list[float], d.pop("high")) + + + low = cast(list[float], d.pop("low")) + + + vwap = cast(list[float], d.pop("vwap")) + + + count = cast(list[int], d.pop("count")) + + + close = cast(list[float], d.pop("close")) + + + open_ = cast(list[float], d.pop("open")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + stock_history_ohlc_response_200 = cls( + volume=volume, + high=high, + low=low, + vwap=vwap, + count=count, + close=close, + open_=open_, + timestamp=timestamp, + ) + + + + stock_history_ohlc_response_200.additional_properties = d + return stock_history_ohlc_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/stock_history_ohlc_venue.py b/openapi_project/openapi_package/models/stock_history_ohlc_venue.py new file mode 100644 index 000000000..14cdeda1e --- /dev/null +++ b/openapi_project/openapi_package/models/stock_history_ohlc_venue.py @@ -0,0 +1,8 @@ +from enum import Enum + +class StockHistoryOhlcVenue(str, Enum): + NQB = "nqb" + UTP_CTA = "utp_cta" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_history_quote_format.py b/openapi_project/openapi_package/models/stock_history_quote_format.py new file mode 100644 index 000000000..012e21af2 --- /dev/null +++ b/openapi_project/openapi_package/models/stock_history_quote_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class StockHistoryQuoteFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_history_quote_interval.py b/openapi_project/openapi_package/models/stock_history_quote_interval.py new file mode 100644 index 000000000..6bd02b890 --- /dev/null +++ b/openapi_project/openapi_package/models/stock_history_quote_interval.py @@ -0,0 +1,21 @@ +from enum import Enum + +class StockHistoryQuoteInterval(str, Enum): + TICK = "tick" + VALUE_1 = "10ms" + VALUE_10 = "5m" + VALUE_11 = "10m" + VALUE_12 = "15m" + VALUE_13 = "30m" + VALUE_14 = "1h" + VALUE_2 = "100ms" + VALUE_3 = "500ms" + VALUE_4 = "1s" + VALUE_5 = "5s" + VALUE_6 = "10s" + VALUE_7 = "15s" + VALUE_8 = "30s" + VALUE_9 = "1m" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_history_quote_response_200.py b/openapi_project/openapi_package/models/stock_history_quote_response_200.py new file mode 100644 index 000000000..d6631eef2 --- /dev/null +++ b/openapi_project/openapi_package/models/stock_history_quote_response_200.py @@ -0,0 +1,172 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="StockHistoryQuoteResponse200") + + + +@_attrs_define +class StockHistoryQuoteResponse200: + """ + Attributes: + ask_size (list[int]): + bid_size (list[int]): + ask_exchange (list[int]): + ask_condition (list[int]): + bid_exchange (list[int]): + ask (list[float]): + bid (list[float]): + bid_condition (list[int]): + timestamp (list[str]): + """ + + ask_size: list[int] + bid_size: list[int] + ask_exchange: list[int] + ask_condition: list[int] + bid_exchange: list[int] + ask: list[float] + bid: list[float] + bid_condition: list[int] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + ask_size = self.ask_size + + + + bid_size = self.bid_size + + + + ask_exchange = self.ask_exchange + + + + ask_condition = self.ask_condition + + + + bid_exchange = self.bid_exchange + + + + ask = self.ask + + + + bid = self.bid + + + + bid_condition = self.bid_condition + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "ask_size": ask_size, + "bid_size": bid_size, + "ask_exchange": ask_exchange, + "ask_condition": ask_condition, + "bid_exchange": bid_exchange, + "ask": ask, + "bid": bid, + "bid_condition": bid_condition, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + ask_size = cast(list[int], d.pop("ask_size")) + + + bid_size = cast(list[int], d.pop("bid_size")) + + + ask_exchange = cast(list[int], d.pop("ask_exchange")) + + + ask_condition = cast(list[int], d.pop("ask_condition")) + + + bid_exchange = cast(list[int], d.pop("bid_exchange")) + + + ask = cast(list[float], d.pop("ask")) + + + bid = cast(list[float], d.pop("bid")) + + + bid_condition = cast(list[int], d.pop("bid_condition")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + stock_history_quote_response_200 = cls( + ask_size=ask_size, + bid_size=bid_size, + ask_exchange=ask_exchange, + ask_condition=ask_condition, + bid_exchange=bid_exchange, + ask=ask, + bid=bid, + bid_condition=bid_condition, + timestamp=timestamp, + ) + + + + stock_history_quote_response_200.additional_properties = d + return stock_history_quote_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/stock_history_quote_venue.py b/openapi_project/openapi_package/models/stock_history_quote_venue.py new file mode 100644 index 000000000..bc294e35f --- /dev/null +++ b/openapi_project/openapi_package/models/stock_history_quote_venue.py @@ -0,0 +1,8 @@ +from enum import Enum + +class StockHistoryQuoteVenue(str, Enum): + NQB = "nqb" + UTP_CTA = "utp_cta" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_history_trade_format.py b/openapi_project/openapi_package/models/stock_history_trade_format.py new file mode 100644 index 000000000..89cf2bb5e --- /dev/null +++ b/openapi_project/openapi_package/models/stock_history_trade_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class StockHistoryTradeFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_history_trade_quote_format.py b/openapi_project/openapi_package/models/stock_history_trade_quote_format.py new file mode 100644 index 000000000..af1a72470 --- /dev/null +++ b/openapi_project/openapi_package/models/stock_history_trade_quote_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class StockHistoryTradeQuoteFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_history_trade_quote_venue.py b/openapi_project/openapi_package/models/stock_history_trade_quote_venue.py new file mode 100644 index 000000000..976e9fb4c --- /dev/null +++ b/openapi_project/openapi_package/models/stock_history_trade_quote_venue.py @@ -0,0 +1,8 @@ +from enum import Enum + +class StockHistoryTradeQuoteVenue(str, Enum): + NQB = "nqb" + UTP_CTA = "utp_cta" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_history_trade_venue.py b/openapi_project/openapi_package/models/stock_history_trade_venue.py new file mode 100644 index 000000000..68004b183 --- /dev/null +++ b/openapi_project/openapi_package/models/stock_history_trade_venue.py @@ -0,0 +1,8 @@ +from enum import Enum + +class StockHistoryTradeVenue(str, Enum): + NQB = "nqb" + UTP_CTA = "utp_cta" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_list_dates_format.py b/openapi_project/openapi_package/models/stock_list_dates_format.py new file mode 100644 index 000000000..eeabec953 --- /dev/null +++ b/openapi_project/openapi_package/models/stock_list_dates_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class StockListDatesFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_list_dates_request_type.py b/openapi_project/openapi_package/models/stock_list_dates_request_type.py new file mode 100644 index 000000000..4b2f84d2b --- /dev/null +++ b/openapi_project/openapi_package/models/stock_list_dates_request_type.py @@ -0,0 +1,8 @@ +from enum import Enum + +class StockListDatesRequestType(str, Enum): + QUOTE = "quote" + TRADE = "trade" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_list_dates_response_200.py b/openapi_project/openapi_package/models/stock_list_dates_response_200.py new file mode 100644 index 000000000..63f96bcdd --- /dev/null +++ b/openapi_project/openapi_package/models/stock_list_dates_response_200.py @@ -0,0 +1,95 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="StockListDatesResponse200") + + + +@_attrs_define +class StockListDatesResponse200: + """ + Attributes: + date (list[str]): + symbol (list[str]): + """ + + date: list[str] + symbol: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + date = self.date + + + + symbol = self.symbol + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "date": date, + "symbol": symbol, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + date = cast(list[str], d.pop("date")) + + + symbol = cast(list[str], d.pop("symbol")) + + + stock_list_dates_response_200 = cls( + date=date, + symbol=symbol, + ) + + + + stock_list_dates_response_200.additional_properties = d + return stock_list_dates_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/stock_list_symbols_format.py b/openapi_project/openapi_package/models/stock_list_symbols_format.py new file mode 100644 index 000000000..e0954ac1c --- /dev/null +++ b/openapi_project/openapi_package/models/stock_list_symbols_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class StockListSymbolsFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_list_symbols_response_200.py b/openapi_project/openapi_package/models/stock_list_symbols_response_200.py new file mode 100644 index 000000000..6c6576ed8 --- /dev/null +++ b/openapi_project/openapi_package/models/stock_list_symbols_response_200.py @@ -0,0 +1,84 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="StockListSymbolsResponse200") + + + +@_attrs_define +class StockListSymbolsResponse200: + """ + Attributes: + symbol (list[str]): + """ + + symbol: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + stock_list_symbols_response_200 = cls( + symbol=symbol, + ) + + + + stock_list_symbols_response_200.additional_properties = d + return stock_list_symbols_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/stock_snapshot_ohlc_format.py b/openapi_project/openapi_package/models/stock_snapshot_ohlc_format.py new file mode 100644 index 000000000..0bd5f4924 --- /dev/null +++ b/openapi_project/openapi_package/models/stock_snapshot_ohlc_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class StockSnapshotOhlcFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_snapshot_ohlc_response_200.py b/openapi_project/openapi_package/models/stock_snapshot_ohlc_response_200.py new file mode 100644 index 000000000..0ae4ce883 --- /dev/null +++ b/openapi_project/openapi_package/models/stock_snapshot_ohlc_response_200.py @@ -0,0 +1,161 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="StockSnapshotOhlcResponse200") + + + +@_attrs_define +class StockSnapshotOhlcResponse200: + """ + Attributes: + volume (list[int]): + symbol (list[str]): + high (list[float]): + low (list[float]): + count (list[int]): + close (list[float]): + open_ (list[float]): + timestamp (list[str]): + """ + + volume: list[int] + symbol: list[str] + high: list[float] + low: list[float] + count: list[int] + close: list[float] + open_: list[float] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + volume = self.volume + + + + symbol = self.symbol + + + + high = self.high + + + + low = self.low + + + + count = self.count + + + + close = self.close + + + + open_ = self.open_ + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "volume": volume, + "symbol": symbol, + "high": high, + "low": low, + "count": count, + "close": close, + "open": open_, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + volume = cast(list[int], d.pop("volume")) + + + symbol = cast(list[str], d.pop("symbol")) + + + high = cast(list[float], d.pop("high")) + + + low = cast(list[float], d.pop("low")) + + + count = cast(list[int], d.pop("count")) + + + close = cast(list[float], d.pop("close")) + + + open_ = cast(list[float], d.pop("open")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + stock_snapshot_ohlc_response_200 = cls( + volume=volume, + symbol=symbol, + high=high, + low=low, + count=count, + close=close, + open_=open_, + timestamp=timestamp, + ) + + + + stock_snapshot_ohlc_response_200.additional_properties = d + return stock_snapshot_ohlc_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/stock_snapshot_ohlc_venue.py b/openapi_project/openapi_package/models/stock_snapshot_ohlc_venue.py new file mode 100644 index 000000000..9b5bac47d --- /dev/null +++ b/openapi_project/openapi_package/models/stock_snapshot_ohlc_venue.py @@ -0,0 +1,8 @@ +from enum import Enum + +class StockSnapshotOhlcVenue(str, Enum): + NQB = "nqb" + UTP_CTA = "utp_cta" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_snapshot_quote_format.py b/openapi_project/openapi_package/models/stock_snapshot_quote_format.py new file mode 100644 index 000000000..21b3ba63b --- /dev/null +++ b/openapi_project/openapi_package/models/stock_snapshot_quote_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class StockSnapshotQuoteFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_snapshot_quote_response_200.py b/openapi_project/openapi_package/models/stock_snapshot_quote_response_200.py new file mode 100644 index 000000000..afce33477 --- /dev/null +++ b/openapi_project/openapi_package/models/stock_snapshot_quote_response_200.py @@ -0,0 +1,183 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="StockSnapshotQuoteResponse200") + + + +@_attrs_define +class StockSnapshotQuoteResponse200: + """ + Attributes: + symbol (list[str]): + ask_size (list[int]): + bid_size (list[int]): + ask_exchange (list[int]): + ask_condition (list[int]): + bid_exchange (list[int]): + ask (list[float]): + bid (list[float]): + bid_condition (list[int]): + timestamp (list[str]): + """ + + symbol: list[str] + ask_size: list[int] + bid_size: list[int] + ask_exchange: list[int] + ask_condition: list[int] + bid_exchange: list[int] + ask: list[float] + bid: list[float] + bid_condition: list[int] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + ask_size = self.ask_size + + + + bid_size = self.bid_size + + + + ask_exchange = self.ask_exchange + + + + ask_condition = self.ask_condition + + + + bid_exchange = self.bid_exchange + + + + ask = self.ask + + + + bid = self.bid + + + + bid_condition = self.bid_condition + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "ask_size": ask_size, + "bid_size": bid_size, + "ask_exchange": ask_exchange, + "ask_condition": ask_condition, + "bid_exchange": bid_exchange, + "ask": ask, + "bid": bid, + "bid_condition": bid_condition, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + ask_size = cast(list[int], d.pop("ask_size")) + + + bid_size = cast(list[int], d.pop("bid_size")) + + + ask_exchange = cast(list[int], d.pop("ask_exchange")) + + + ask_condition = cast(list[int], d.pop("ask_condition")) + + + bid_exchange = cast(list[int], d.pop("bid_exchange")) + + + ask = cast(list[float], d.pop("ask")) + + + bid = cast(list[float], d.pop("bid")) + + + bid_condition = cast(list[int], d.pop("bid_condition")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + stock_snapshot_quote_response_200 = cls( + symbol=symbol, + ask_size=ask_size, + bid_size=bid_size, + ask_exchange=ask_exchange, + ask_condition=ask_condition, + bid_exchange=bid_exchange, + ask=ask, + bid=bid, + bid_condition=bid_condition, + timestamp=timestamp, + ) + + + + stock_snapshot_quote_response_200.additional_properties = d + return stock_snapshot_quote_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/stock_snapshot_quote_venue.py b/openapi_project/openapi_package/models/stock_snapshot_quote_venue.py new file mode 100644 index 000000000..aebe1c4f0 --- /dev/null +++ b/openapi_project/openapi_package/models/stock_snapshot_quote_venue.py @@ -0,0 +1,8 @@ +from enum import Enum + +class StockSnapshotQuoteVenue(str, Enum): + NQB = "nqb" + UTP_CTA = "utp_cta" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_snapshot_trade_format.py b/openapi_project/openapi_package/models/stock_snapshot_trade_format.py new file mode 100644 index 000000000..56b90743e --- /dev/null +++ b/openapi_project/openapi_package/models/stock_snapshot_trade_format.py @@ -0,0 +1,9 @@ +from enum import Enum + +class StockSnapshotTradeFormat(str, Enum): + CSV = "csv" + JSON = "json" + NDJSON = "ndjson" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_snapshot_trade_response_200.py b/openapi_project/openapi_package/models/stock_snapshot_trade_response_200.py new file mode 100644 index 000000000..510f47fbb --- /dev/null +++ b/openapi_project/openapi_package/models/stock_snapshot_trade_response_200.py @@ -0,0 +1,139 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="StockSnapshotTradeResponse200") + + + +@_attrs_define +class StockSnapshotTradeResponse200: + """ + Attributes: + symbol (list[str]): + sequence (list[int]): + condition (list[int]): + size (list[int]): + price (list[float]): + timestamp (list[str]): + """ + + symbol: list[str] + sequence: list[int] + condition: list[int] + size: list[int] + price: list[float] + timestamp: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + + + sequence = self.sequence + + + + condition = self.condition + + + + size = self.size + + + + price = self.price + + + + timestamp = self.timestamp + + + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "sequence": sequence, + "condition": condition, + "size": size, + "price": price, + "timestamp": timestamp, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = cast(list[str], d.pop("symbol")) + + + sequence = cast(list[int], d.pop("sequence")) + + + condition = cast(list[int], d.pop("condition")) + + + size = cast(list[int], d.pop("size")) + + + price = cast(list[float], d.pop("price")) + + + timestamp = cast(list[str], d.pop("timestamp")) + + + stock_snapshot_trade_response_200 = cls( + symbol=symbol, + sequence=sequence, + condition=condition, + size=size, + price=price, + timestamp=timestamp, + ) + + + + stock_snapshot_trade_response_200.additional_properties = d + return stock_snapshot_trade_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/stock_snapshot_trade_venue.py b/openapi_project/openapi_package/models/stock_snapshot_trade_venue.py new file mode 100644 index 000000000..41fb48c43 --- /dev/null +++ b/openapi_project/openapi_package/models/stock_snapshot_trade_venue.py @@ -0,0 +1,8 @@ +from enum import Enum + +class StockSnapshotTradeVenue(str, Enum): + NQB = "nqb" + UTP_CTA = "utp_cta" + + def __str__(self) -> str: + return str(self.value) diff --git a/openapi_project/openapi_package/models/tif.py b/openapi_project/openapi_package/models/tif.py deleted file mode 100644 index ef5cc26ce..000000000 --- a/openapi_project/openapi_package/models/tif.py +++ /dev/null @@ -1,17 +0,0 @@ -from enum import Enum - - -class Tif(str, Enum): - TIF_CLO = "TIF_CLO" - TIF_DAY = "TIF_DAY" - TIF_ETH = "TIF_ETH" - TIF_FOK = "TIF_FOK" - TIF_GTC = "TIF_GTC" - TIF_GTD = "TIF_GTD" - TIF_GTX = "TIF_GTX" - TIF_IOC = "TIF_IOC" - TIF_OPG = "TIF_OPG" - TIF_UNKNOWN = "TIF_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/time_of_day.py b/openapi_project/openapi_package/models/time_of_day.py deleted file mode 100644 index 1c547e247..000000000 --- a/openapi_project/openapi_package/models/time_of_day.py +++ /dev/null @@ -1,73 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="TimeOfDay") - - -@_attrs_define -class TimeOfDay: - """ - Attributes: - hours (Unset | int): - minutes (Unset | int): - seconds (Unset | int): - nanos (Unset | int): - """ - - hours: Unset | int = UNSET - minutes: Unset | int = UNSET - seconds: Unset | int = UNSET - nanos: Unset | int = UNSET - - def to_dict(self) -> dict[str, Any]: - hours = self.hours - - minutes = self.minutes - - seconds = self.seconds - - nanos = self.nanos - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if hours is not UNSET: - field_dict["hours"] = hours - if minutes is not UNSET: - field_dict["minutes"] = minutes - if seconds is not UNSET: - field_dict["seconds"] = seconds - if nanos is not UNSET: - field_dict["nanos"] = nanos - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - hours = d.pop("hours", UNSET) - - minutes = d.pop("minutes", UNSET) - - seconds = d.pop("seconds", UNSET) - - nanos = d.pop("nanos", UNSET) - - time_of_day = cls( - hours=hours, - minutes=minutes, - seconds=seconds, - nanos=nanos, - ) - - return time_of_day diff --git a/openapi_project/openapi_package/models/tims_class_group.py b/openapi_project/openapi_package/models/tims_class_group.py deleted file mode 100644 index 410ab7002..000000000 --- a/openapi_project/openapi_package/models/tims_class_group.py +++ /dev/null @@ -1,206 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.tims_position_group import TimsPositionGroup - - -T = TypeVar("T", bound="TimsClassGroup") - - -@_attrs_define -class TimsClassGroup: - """ - Attributes: - delta (Unset | float): - dollar_delta (Unset | float): - dollar_gamma (Unset | float): - gamma (Unset | float): - hc (Unset | float): - hc_min (Unset | float): - long_nav (Unset | float): - margin_req (Unset | float): - nav (Unset | float): - pn_l (Unset | list[float]): - positions (Unset | list[TimsPositionGroup]): - product_group (Unset | str): - rho (Unset | float): - short_nav (Unset | float): - symbol (Unset | str): - theta (Unset | float): - vega (Unset | float): - """ - - delta: Unset | float = UNSET - dollar_delta: Unset | float = UNSET - dollar_gamma: Unset | float = UNSET - gamma: Unset | float = UNSET - hc: Unset | float = UNSET - hc_min: Unset | float = UNSET - long_nav: Unset | float = UNSET - margin_req: Unset | float = UNSET - nav: Unset | float = UNSET - pn_l: Unset | list[float] = UNSET - positions: Unset | list[TimsPositionGroup] = UNSET - product_group: Unset | str = UNSET - rho: Unset | float = UNSET - short_nav: Unset | float = UNSET - symbol: Unset | str = UNSET - theta: Unset | float = UNSET - vega: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - delta = self.delta - - dollar_delta = self.dollar_delta - - dollar_gamma = self.dollar_gamma - - gamma = self.gamma - - hc = self.hc - - hc_min = self.hc_min - - long_nav = self.long_nav - - margin_req = self.margin_req - - nav = self.nav - - pn_l: Unset | list[float] = UNSET - if not isinstance(self.pn_l, Unset): - pn_l = self.pn_l - - positions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.positions, Unset): - positions = [] - for positions_item_data in self.positions: - positions_item = positions_item_data.to_dict() - positions.append(positions_item) - - product_group = self.product_group - - rho = self.rho - - short_nav = self.short_nav - - symbol = self.symbol - - theta = self.theta - - vega = self.vega - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if delta is not UNSET: - field_dict["delta"] = delta - if dollar_delta is not UNSET: - field_dict["dollarDelta"] = dollar_delta - if dollar_gamma is not UNSET: - field_dict["dollarGamma"] = dollar_gamma - if gamma is not UNSET: - field_dict["gamma"] = gamma - if hc is not UNSET: - field_dict["hc"] = hc - if hc_min is not UNSET: - field_dict["hcMin"] = hc_min - if long_nav is not UNSET: - field_dict["longNav"] = long_nav - if margin_req is not UNSET: - field_dict["marginReq"] = margin_req - if nav is not UNSET: - field_dict["nav"] = nav - if pn_l is not UNSET: - field_dict["pnL"] = pn_l - if positions is not UNSET: - field_dict["positions"] = positions - if product_group is not UNSET: - field_dict["productGroup"] = product_group - if rho is not UNSET: - field_dict["rho"] = rho - if short_nav is not UNSET: - field_dict["shortNav"] = short_nav - if symbol is not UNSET: - field_dict["symbol"] = symbol - if theta is not UNSET: - field_dict["theta"] = theta - if vega is not UNSET: - field_dict["vega"] = vega - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - delta = d.pop("delta", UNSET) - - dollar_delta = d.pop("dollarDelta", UNSET) - - dollar_gamma = d.pop("dollarGamma", UNSET) - - gamma = d.pop("gamma", UNSET) - - hc = d.pop("hc", UNSET) - - hc_min = d.pop("hcMin", UNSET) - - long_nav = d.pop("longNav", UNSET) - - margin_req = d.pop("marginReq", UNSET) - - nav = d.pop("nav", UNSET) - - pn_l = cast(list[float], d.pop("pnL", UNSET)) - - positions = [] - _positions = d.pop("positions", UNSET) - for positions_item_data in _positions or []: - positions_item = TimsPositionGroup.from_dict(positions_item_data) - - positions.append(positions_item) - - product_group = d.pop("productGroup", UNSET) - - rho = d.pop("rho", UNSET) - - short_nav = d.pop("shortNav", UNSET) - - symbol = d.pop("symbol", UNSET) - - theta = d.pop("theta", UNSET) - - vega = d.pop("vega", UNSET) - - tims_class_group = cls( - delta=delta, - dollar_delta=dollar_delta, - dollar_gamma=dollar_gamma, - gamma=gamma, - hc=hc, - hc_min=hc_min, - long_nav=long_nav, - margin_req=margin_req, - nav=nav, - pn_l=pn_l, - positions=positions, - product_group=product_group, - rho=rho, - short_nav=short_nav, - symbol=symbol, - theta=theta, - vega=vega, - ) - - return tims_class_group diff --git a/openapi_project/openapi_package/models/tims_margin_data.py b/openapi_project/openapi_package/models/tims_margin_data.py deleted file mode 100644 index 76561e035..000000000 --- a/openapi_project/openapi_package/models/tims_margin_data.py +++ /dev/null @@ -1,221 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.currency import Currency -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.tims_product_group import TimsProductGroup - from openapi_project.openapi_package.models.tims_class_group import TimsClassGroup - - -T = TypeVar("T", bound="TimsMarginData") - - -@_attrs_define -class TimsMarginData: - """ - Attributes: - account_type (Unset | str): - class_group_count (Unset | int): - class_groups (Unset | list[TimsClassGroup]): - currency (Unset | Currency): - dollar_delta (Unset | float): - dollar_gamma (Unset | float): - long_nav (Unset | float): - margin_req (Unset | float): - nav (Unset | float): - porfolio_group_count (Unset | int): - position_group_count (Unset | int): - product_group_count (Unset | int): - product_groups (Unset | list[TimsProductGroup]): - rho (Unset | float): - short_nav (Unset | float): - theta (Unset | float): - vega (Unset | float): - """ - - account_type: Unset | str = UNSET - class_group_count: Unset | int = UNSET - class_groups: Unset | list[TimsClassGroup] = UNSET - currency: Unset | Currency = UNSET - dollar_delta: Unset | float = UNSET - dollar_gamma: Unset | float = UNSET - long_nav: Unset | float = UNSET - margin_req: Unset | float = UNSET - nav: Unset | float = UNSET - porfolio_group_count: Unset | int = UNSET - position_group_count: Unset | int = UNSET - product_group_count: Unset | int = UNSET - product_groups: Unset | list[TimsProductGroup] = UNSET - rho: Unset | float = UNSET - short_nav: Unset | float = UNSET - theta: Unset | float = UNSET - vega: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - account_type = self.account_type - - class_group_count = self.class_group_count - - class_groups: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.class_groups, Unset): - class_groups = [] - for class_groups_item_data in self.class_groups: - class_groups_item = class_groups_item_data.to_dict() - class_groups.append(class_groups_item) - - currency: Unset | str = ( - UNSET if isinstance(self.currency, Unset) else self.currency.value - ) - - dollar_delta = self.dollar_delta - - dollar_gamma = self.dollar_gamma - - long_nav = self.long_nav - - margin_req = self.margin_req - - nav = self.nav - - porfolio_group_count = self.porfolio_group_count - - position_group_count = self.position_group_count - - product_group_count = self.product_group_count - - product_groups: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.product_groups, Unset): - product_groups = [] - for product_groups_item_data in self.product_groups: - product_groups_item = product_groups_item_data.to_dict() - product_groups.append(product_groups_item) - - rho = self.rho - - short_nav = self.short_nav - - theta = self.theta - - vega = self.vega - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_type is not UNSET: - field_dict["accountType"] = account_type - if class_group_count is not UNSET: - field_dict["classGroupCount"] = class_group_count - if class_groups is not UNSET: - field_dict["classGroups"] = class_groups - if currency is not UNSET: - field_dict["currency"] = currency - if dollar_delta is not UNSET: - field_dict["dollarDelta"] = dollar_delta - if dollar_gamma is not UNSET: - field_dict["dollarGamma"] = dollar_gamma - if long_nav is not UNSET: - field_dict["longNav"] = long_nav - if margin_req is not UNSET: - field_dict["marginReq"] = margin_req - if nav is not UNSET: - field_dict["nav"] = nav - if porfolio_group_count is not UNSET: - field_dict["porfolioGroupCount"] = porfolio_group_count - if position_group_count is not UNSET: - field_dict["positionGroupCount"] = position_group_count - if product_group_count is not UNSET: - field_dict["productGroupCount"] = product_group_count - if product_groups is not UNSET: - field_dict["productGroups"] = product_groups - if rho is not UNSET: - field_dict["rho"] = rho - if short_nav is not UNSET: - field_dict["shortNav"] = short_nav - if theta is not UNSET: - field_dict["theta"] = theta - if vega is not UNSET: - field_dict["vega"] = vega - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_type = d.pop("accountType", UNSET) - - class_group_count = d.pop("classGroupCount", UNSET) - - class_groups = [] - _class_groups = d.pop("classGroups", UNSET) - for class_groups_item_data in _class_groups or []: - class_groups_item = TimsClassGroup.from_dict(class_groups_item_data) - - class_groups.append(class_groups_item) - - _currency = d.pop("currency", UNSET) - currency: Unset | Currency = ( - UNSET if isinstance(_currency, Unset) else Currency(_currency) - ) - - dollar_delta = d.pop("dollarDelta", UNSET) - - dollar_gamma = d.pop("dollarGamma", UNSET) - - long_nav = d.pop("longNav", UNSET) - - margin_req = d.pop("marginReq", UNSET) - - nav = d.pop("nav", UNSET) - - porfolio_group_count = d.pop("porfolioGroupCount", UNSET) - - position_group_count = d.pop("positionGroupCount", UNSET) - - product_group_count = d.pop("productGroupCount", UNSET) - - product_groups = [] - _product_groups = d.pop("productGroups", UNSET) - for product_groups_item_data in _product_groups or []: - product_groups_item = TimsProductGroup.from_dict(product_groups_item_data) - - product_groups.append(product_groups_item) - - rho = d.pop("rho", UNSET) - - short_nav = d.pop("shortNav", UNSET) - - theta = d.pop("theta", UNSET) - - vega = d.pop("vega", UNSET) - - tims_margin_data = cls( - account_type=account_type, - class_group_count=class_group_count, - class_groups=class_groups, - currency=currency, - dollar_delta=dollar_delta, - dollar_gamma=dollar_gamma, - long_nav=long_nav, - margin_req=margin_req, - nav=nav, - porfolio_group_count=porfolio_group_count, - position_group_count=position_group_count, - product_group_count=product_group_count, - product_groups=product_groups, - rho=rho, - short_nav=short_nav, - theta=theta, - vega=vega, - ) - - return tims_margin_data diff --git a/openapi_project/openapi_package/models/tims_position_group.py b/openapi_project/openapi_package/models/tims_position_group.py deleted file mode 100644 index 6a1cf0c90..000000000 --- a/openapi_project/openapi_package/models/tims_position_group.py +++ /dev/null @@ -1,166 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - - -T = TypeVar("T", bound="TimsPositionGroup") - - -@_attrs_define -class TimsPositionGroup: - """ - Attributes: - delta (Unset | float): - gamma (Unset | float): - hc_min (Unset | float): - hc_minval (Unset | float): - margin_req (Unset | float): - nav (Unset | float): - pn_l (Unset | list[float]): - price (Unset | float): - qty (Unset | float): - rho (Unset | float): - rpg_root (Unset | str): - symbol (Unset | str): - theta (Unset | float): - vega (Unset | float): - """ - - delta: Unset | float = UNSET - gamma: Unset | float = UNSET - hc_min: Unset | float = UNSET - hc_minval: Unset | float = UNSET - margin_req: Unset | float = UNSET - nav: Unset | float = UNSET - pn_l: Unset | list[float] = UNSET - price: Unset | float = UNSET - qty: Unset | float = UNSET - rho: Unset | float = UNSET - rpg_root: Unset | str = UNSET - symbol: Unset | str = UNSET - theta: Unset | float = UNSET - vega: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - delta = self.delta - - gamma = self.gamma - - hc_min = self.hc_min - - hc_minval = self.hc_minval - - margin_req = self.margin_req - - nav = self.nav - - pn_l: Unset | list[float] = UNSET - if not isinstance(self.pn_l, Unset): - pn_l = self.pn_l - - price = self.price - - qty = self.qty - - rho = self.rho - - rpg_root = self.rpg_root - - symbol = self.symbol - - theta = self.theta - - vega = self.vega - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if delta is not UNSET: - field_dict["delta"] = delta - if gamma is not UNSET: - field_dict["gamma"] = gamma - if hc_min is not UNSET: - field_dict["hcMin"] = hc_min - if hc_minval is not UNSET: - field_dict["hcMinval"] = hc_minval - if margin_req is not UNSET: - field_dict["marginReq"] = margin_req - if nav is not UNSET: - field_dict["nav"] = nav - if pn_l is not UNSET: - field_dict["pnL"] = pn_l - if price is not UNSET: - field_dict["price"] = price - if qty is not UNSET: - field_dict["qty"] = qty - if rho is not UNSET: - field_dict["rho"] = rho - if rpg_root is not UNSET: - field_dict["rpgRoot"] = rpg_root - if symbol is not UNSET: - field_dict["symbol"] = symbol - if theta is not UNSET: - field_dict["theta"] = theta - if vega is not UNSET: - field_dict["vega"] = vega - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - delta = d.pop("delta", UNSET) - - gamma = d.pop("gamma", UNSET) - - hc_min = d.pop("hcMin", UNSET) - - hc_minval = d.pop("hcMinval", UNSET) - - margin_req = d.pop("marginReq", UNSET) - - nav = d.pop("nav", UNSET) - - pn_l = cast(list[float], d.pop("pnL", UNSET)) - - price = d.pop("price", UNSET) - - qty = d.pop("qty", UNSET) - - rho = d.pop("rho", UNSET) - - rpg_root = d.pop("rpgRoot", UNSET) - - symbol = d.pop("symbol", UNSET) - - theta = d.pop("theta", UNSET) - - vega = d.pop("vega", UNSET) - - tims_position_group = cls( - delta=delta, - gamma=gamma, - hc_min=hc_min, - hc_minval=hc_minval, - margin_req=margin_req, - nav=nav, - pn_l=pn_l, - price=price, - qty=qty, - rho=rho, - rpg_root=rpg_root, - symbol=symbol, - theta=theta, - vega=vega, - ) - - return tims_position_group diff --git a/openapi_project/openapi_package/models/tims_product_group.py b/openapi_project/openapi_package/models/tims_product_group.py deleted file mode 100644 index 78d91c275..000000000 --- a/openapi_project/openapi_package/models/tims_product_group.py +++ /dev/null @@ -1,184 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - - -T = TypeVar("T", bound="TimsProductGroup") - - -@_attrs_define -class TimsProductGroup: - """ - Attributes: - delta (Unset | float): - dollar_delta (Unset | float): - dollar_gamma (Unset | float): - gamma (Unset | float): - group (Unset | str): - hc (Unset | float): - hc_min (Unset | float): - long_nav (Unset | float): - margin_req (Unset | float): - nav (Unset | float): - pn_l_range (Unset | list[float]): - portfolio_group (Unset | str): - rho (Unset | float): - short_nav (Unset | float): - theta (Unset | float): - vega (Unset | float): - """ - - delta: Unset | float = UNSET - dollar_delta: Unset | float = UNSET - dollar_gamma: Unset | float = UNSET - gamma: Unset | float = UNSET - group: Unset | str = UNSET - hc: Unset | float = UNSET - hc_min: Unset | float = UNSET - long_nav: Unset | float = UNSET - margin_req: Unset | float = UNSET - nav: Unset | float = UNSET - pn_l_range: Unset | list[float] = UNSET - portfolio_group: Unset | str = UNSET - rho: Unset | float = UNSET - short_nav: Unset | float = UNSET - theta: Unset | float = UNSET - vega: Unset | float = UNSET - - def to_dict(self) -> dict[str, Any]: - delta = self.delta - - dollar_delta = self.dollar_delta - - dollar_gamma = self.dollar_gamma - - gamma = self.gamma - - group = self.group - - hc = self.hc - - hc_min = self.hc_min - - long_nav = self.long_nav - - margin_req = self.margin_req - - nav = self.nav - - pn_l_range: Unset | list[float] = UNSET - if not isinstance(self.pn_l_range, Unset): - pn_l_range = self.pn_l_range - - portfolio_group = self.portfolio_group - - rho = self.rho - - short_nav = self.short_nav - - theta = self.theta - - vega = self.vega - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if delta is not UNSET: - field_dict["delta"] = delta - if dollar_delta is not UNSET: - field_dict["dollarDelta"] = dollar_delta - if dollar_gamma is not UNSET: - field_dict["dollarGamma"] = dollar_gamma - if gamma is not UNSET: - field_dict["gamma"] = gamma - if group is not UNSET: - field_dict["group"] = group - if hc is not UNSET: - field_dict["hc"] = hc - if hc_min is not UNSET: - field_dict["hcMin"] = hc_min - if long_nav is not UNSET: - field_dict["longNav"] = long_nav - if margin_req is not UNSET: - field_dict["marginReq"] = margin_req - if nav is not UNSET: - field_dict["nav"] = nav - if pn_l_range is not UNSET: - field_dict["pnLRange"] = pn_l_range - if portfolio_group is not UNSET: - field_dict["portfolioGroup"] = portfolio_group - if rho is not UNSET: - field_dict["rho"] = rho - if short_nav is not UNSET: - field_dict["shortNav"] = short_nav - if theta is not UNSET: - field_dict["theta"] = theta - if vega is not UNSET: - field_dict["vega"] = vega - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - delta = d.pop("delta", UNSET) - - dollar_delta = d.pop("dollarDelta", UNSET) - - dollar_gamma = d.pop("dollarGamma", UNSET) - - gamma = d.pop("gamma", UNSET) - - group = d.pop("group", UNSET) - - hc = d.pop("hc", UNSET) - - hc_min = d.pop("hcMin", UNSET) - - long_nav = d.pop("longNav", UNSET) - - margin_req = d.pop("marginReq", UNSET) - - nav = d.pop("nav", UNSET) - - pn_l_range = cast(list[float], d.pop("pnLRange", UNSET)) - - portfolio_group = d.pop("portfolioGroup", UNSET) - - rho = d.pop("rho", UNSET) - - short_nav = d.pop("shortNav", UNSET) - - theta = d.pop("theta", UNSET) - - vega = d.pop("vega", UNSET) - - tims_product_group = cls( - delta=delta, - dollar_delta=dollar_delta, - dollar_gamma=dollar_gamma, - gamma=gamma, - group=group, - hc=hc, - hc_min=hc_min, - long_nav=long_nav, - margin_req=margin_req, - nav=nav, - pn_l_range=pn_l_range, - portfolio_group=portfolio_group, - rho=rho, - short_nav=short_nav, - theta=theta, - vega=vega, - ) - - return tims_product_group diff --git a/openapi_project/openapi_package/models/trade_confirm.py b/openapi_project/openapi_package/models/trade_confirm.py deleted file mode 100644 index 4ff0fdd1a..000000000 --- a/openapi_project/openapi_package/models/trade_confirm.py +++ /dev/null @@ -1,927 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.capacity_code import CapacityCode -from openapi_project.openapi_package.models.clearing_range import ClearingRange -from openapi_project.openapi_package.models.cross_side_type import CrossSideType -from openapi_project.openapi_package.models.cross_type import CrossType -from openapi_project.openapi_package.models.exec_type import ExecType -from openapi_project.openapi_package.models.multi_leg_reporting_type import MultiLegReportingType -from openapi_project.openapi_package.models.option_exercise_style import OptionExerciseStyle -from openapi_project.openapi_package.models.option_settlement_type import OptionSettlementType -from openapi_project.openapi_package.models.ord_type import OrdType -from openapi_project.openapi_package.models.origination_type import OriginationType -from openapi_project.openapi_package.models.position_effect import PositionEffect -from openapi_project.openapi_package.models.price_type import PriceType -from openapi_project.openapi_package.models.put_call import PutCall -from openapi_project.openapi_package.models.security_type import SecurityType -from openapi_project.openapi_package.models.side import Side -from openapi_project.openapi_package.models.tif import Tif -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.date import Date - - -T = TypeVar("T", bound="TradeConfirm") - - -@_attrs_define -class TradeConfirm: - """ - Attributes: - account_id (Unset | int): - account_name (Unset | str): - alloc_id (Unset | str): - alloc_qty (Unset | float): - aux_price (Unset | float): - avg_price (Unset | float): - billing_code (Unset | str): - capacity (Unset | CapacityCode): - clearing_account (Unset | str): - clearing_range (Unset | ClearingRange): - client_id (Unset | str): - cmta (Unset | str): - commission (Unset | float): - cross_side_type (Unset | CrossSideType): - cross_type (Unset | CrossType): - cum_qty (Unset | float): - cur_ord_id (Unset | str): - deliver_to_compid (Unset | str): - deliver_to_subid (Unset | str): - description (Unset | str): - drop (Unset | bool): - efid (Unset | str): - exec_broker (Unset | str): - exec_id (Unset | str): - exec_ref_id (Unset | str): - exec_type (Unset | ExecType): - exercise_style (Unset | OptionExerciseStyle): - expiration_dt (Unset | Date): - fee1 (Unset | float): - fee2 (Unset | float): - frequent_trader_id (Unset | str): - give_up (Unset | str): - id_ (Unset | int): - incoming_cl_ord_id (Unset | str): - incoming_ord_id (Unset | str): - incoming_orig_clord_id (Unset | str): - last_market (Unset | str): - last_price (Unset | float): - last_qty (Unset | float): - leaves_qty (Unset | float): - leg_id (Unset | str): - liquidity_flag (Unset | str): - locate_id (Unset | str): - mpid (Unset | str): - multi_leg_reportingtype (Unset | MultiLegReportingType): - ord_type (Unset | OrdType): - origination_type (Unset | OriginationType): - orig_ord_id (Unset | str): - parent_ord_id (Unset | str): - perm_ord_id (Unset | str): - position_effect (Unset | PositionEffect): - price (Unset | float): - price_type (Unset | PriceType): - put_call (Unset | PutCall): - qty (Unset | float): - req_ord_id (Unset | str): - root (Unset | str): - route (Unset | str): - routing_session (Unset | str): - security_type (Unset | SecurityType): - settlement_type (Unset | OptionSettlementType): - side (Unset | Side): - source (Unset | str): - source_address (Unset | str): - strategy_id (Unset | str): - strike (Unset | float): - symbol (Unset | str): - tag (Unset | str): - tag1 (Unset | str): - target_comp_id (Unset | str): - target_sub_id (Unset | str): - text (Unset | str): - tif (Unset | Tif): - traded_dt (Unset | Date): - trader_id (Unset | str): - trading_firm_id (Unset | int): - transact_ts (Unset | str): - underlying (Unset | str): - user_id (Unset | int): - working_qty (Unset | float): - multiplier (Unset | float): - dac_delta (Unset | float): - dac_reference_price (Unset | float): - manual_fill_time (Unset | str): - """ - - account_id: Unset | int = UNSET - account_name: Unset | str = UNSET - alloc_id: Unset | str = UNSET - alloc_qty: Unset | float = UNSET - aux_price: Unset | float = UNSET - avg_price: Unset | float = UNSET - billing_code: Unset | str = UNSET - capacity: Unset | CapacityCode = UNSET - clearing_account: Unset | str = UNSET - clearing_range: Unset | ClearingRange = UNSET - client_id: Unset | str = UNSET - cmta: Unset | str = UNSET - commission: Unset | float = UNSET - cross_side_type: Unset | CrossSideType = UNSET - cross_type: Unset | CrossType = UNSET - cum_qty: Unset | float = UNSET - cur_ord_id: Unset | str = UNSET - deliver_to_compid: Unset | str = UNSET - deliver_to_subid: Unset | str = UNSET - description: Unset | str = UNSET - drop: Unset | bool = UNSET - efid: Unset | str = UNSET - exec_broker: Unset | str = UNSET - exec_id: Unset | str = UNSET - exec_ref_id: Unset | str = UNSET - exec_type: Unset | ExecType = UNSET - exercise_style: Unset | OptionExerciseStyle = UNSET - expiration_dt: Unset | Date = UNSET - fee1: Unset | float = UNSET - fee2: Unset | float = UNSET - frequent_trader_id: Unset | str = UNSET - give_up: Unset | str = UNSET - id_: Unset | int = UNSET - incoming_cl_ord_id: Unset | str = UNSET - incoming_ord_id: Unset | str = UNSET - incoming_orig_clord_id: Unset | str = UNSET - last_market: Unset | str = UNSET - last_price: Unset | float = UNSET - last_qty: Unset | float = UNSET - leaves_qty: Unset | float = UNSET - leg_id: Unset | str = UNSET - liquidity_flag: Unset | str = UNSET - locate_id: Unset | str = UNSET - mpid: Unset | str = UNSET - multi_leg_reportingtype: Unset | MultiLegReportingType = UNSET - ord_type: Unset | OrdType = UNSET - origination_type: Unset | OriginationType = UNSET - orig_ord_id: Unset | str = UNSET - parent_ord_id: Unset | str = UNSET - perm_ord_id: Unset | str = UNSET - position_effect: Unset | PositionEffect = UNSET - price: Unset | float = UNSET - price_type: Unset | PriceType = UNSET - put_call: Unset | PutCall = UNSET - qty: Unset | float = UNSET - req_ord_id: Unset | str = UNSET - root: Unset | str = UNSET - route: Unset | str = UNSET - routing_session: Unset | str = UNSET - security_type: Unset | SecurityType = UNSET - settlement_type: Unset | OptionSettlementType = UNSET - side: Unset | Side = UNSET - source: Unset | str = UNSET - source_address: Unset | str = UNSET - strategy_id: Unset | str = UNSET - strike: Unset | float = UNSET - symbol: Unset | str = UNSET - tag: Unset | str = UNSET - tag1: Unset | str = UNSET - target_comp_id: Unset | str = UNSET - target_sub_id: Unset | str = UNSET - text: Unset | str = UNSET - tif: Unset | Tif = UNSET - traded_dt: Unset | Date = UNSET - trader_id: Unset | str = UNSET - trading_firm_id: Unset | int = UNSET - transact_ts: Unset | str = UNSET - underlying: Unset | str = UNSET - user_id: Unset | int = UNSET - working_qty: Unset | float = UNSET - multiplier: Unset | float = UNSET - dac_delta: Unset | float = UNSET - dac_reference_price: Unset | float = UNSET - manual_fill_time: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - - account_name = self.account_name - - alloc_id = self.alloc_id - - alloc_qty = self.alloc_qty - - aux_price = self.aux_price - - avg_price = self.avg_price - - billing_code = self.billing_code - - capacity: Unset | str = ( - UNSET if isinstance(self.capacity, Unset) else self.capacity.value - ) - - clearing_account = self.clearing_account - - clearing_range: Unset | str = ( - UNSET - if isinstance(self.clearing_range, Unset) - else self.clearing_range.value - ) - - client_id = self.client_id - - cmta = self.cmta - - commission = self.commission - - cross_side_type: Unset | str = ( - UNSET - if isinstance(self.cross_side_type, Unset) - else self.cross_side_type.value - ) - - cross_type: Unset | str = ( - UNSET if isinstance(self.cross_type, Unset) else self.cross_type.value - ) - - cum_qty = self.cum_qty - - cur_ord_id = self.cur_ord_id - - deliver_to_compid = self.deliver_to_compid - - deliver_to_subid = self.deliver_to_subid - - description = self.description - - drop = self.drop - - efid = self.efid - - exec_broker = self.exec_broker - - exec_id = self.exec_id - - exec_ref_id = self.exec_ref_id - - exec_type: Unset | str = ( - UNSET if isinstance(self.exec_type, Unset) else self.exec_type.value - ) - - exercise_style: Unset | str = ( - UNSET - if isinstance(self.exercise_style, Unset) - else self.exercise_style.value - ) - - expiration_dt: Unset | dict[str, Any] = ( - UNSET - if isinstance(self.expiration_dt, Unset) - else self.expiration_dt.to_dict() - ) - - fee1 = self.fee1 - - fee2 = self.fee2 - - frequent_trader_id = self.frequent_trader_id - - give_up = self.give_up - - id_ = self.id_ - - incoming_cl_ord_id = self.incoming_cl_ord_id - - incoming_ord_id = self.incoming_ord_id - - incoming_orig_clord_id = self.incoming_orig_clord_id - - last_market = self.last_market - - last_price = self.last_price - - last_qty = self.last_qty - - leaves_qty = self.leaves_qty - - leg_id = self.leg_id - - liquidity_flag = self.liquidity_flag - - locate_id = self.locate_id - - mpid = self.mpid - - multi_leg_reportingtype: Unset | str = ( - UNSET - if isinstance(self.multi_leg_reportingtype, Unset) - else self.multi_leg_reportingtype.value - ) - - ord_type: Unset | str = ( - UNSET if isinstance(self.ord_type, Unset) else self.ord_type.value - ) - - origination_type: Unset | str = ( - UNSET - if isinstance(self.origination_type, Unset) - else self.origination_type.value - ) - - orig_ord_id = self.orig_ord_id - - parent_ord_id = self.parent_ord_id - - perm_ord_id = self.perm_ord_id - - position_effect: Unset | str = ( - UNSET - if isinstance(self.position_effect, Unset) - else self.position_effect.value - ) - - price = self.price - - price_type: Unset | str = ( - UNSET if isinstance(self.price_type, Unset) else self.price_type.value - ) - - put_call: Unset | str = ( - UNSET if isinstance(self.put_call, Unset) else self.put_call.value - ) - - qty = self.qty - - req_ord_id = self.req_ord_id - - root = self.root - - route = self.route - - routing_session = self.routing_session - - security_type: Unset | str = ( - UNSET if isinstance(self.security_type, Unset) else self.security_type.value - ) - - settlement_type: Unset | str = ( - UNSET - if isinstance(self.settlement_type, Unset) - else self.settlement_type.value - ) - - side: Unset | str = UNSET if isinstance(self.side, Unset) else self.side.value - - source = self.source - - source_address = self.source_address - - strategy_id = self.strategy_id - - strike = self.strike - - symbol = self.symbol - - tag = self.tag - - tag1 = self.tag1 - - target_comp_id = self.target_comp_id - - target_sub_id = self.target_sub_id - - text = self.text - - tif: Unset | str = UNSET if isinstance(self.tif, Unset) else self.tif.value - - traded_dt: Unset | dict[str, Any] = ( - UNSET if isinstance(self.traded_dt, Unset) else self.traded_dt.to_dict() - ) - - trader_id = self.trader_id - - trading_firm_id = self.trading_firm_id - - transact_ts = self.transact_ts - - underlying = self.underlying - - user_id = self.user_id - - working_qty = self.working_qty - - multiplier = self.multiplier - - dac_delta = self.dac_delta - - dac_reference_price = self.dac_reference_price - - manual_fill_time = self.manual_fill_time - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if account_id is not UNSET: - field_dict["accountId"] = account_id - if account_name is not UNSET: - field_dict["accountName"] = account_name - if alloc_id is not UNSET: - field_dict["allocId"] = alloc_id - if alloc_qty is not UNSET: - field_dict["allocQty"] = alloc_qty - if aux_price is not UNSET: - field_dict["auxPrice"] = aux_price - if avg_price is not UNSET: - field_dict["avgPrice"] = avg_price - if billing_code is not UNSET: - field_dict["billingCode"] = billing_code - if capacity is not UNSET: - field_dict["capacity"] = capacity - if clearing_account is not UNSET: - field_dict["clearingAccount"] = clearing_account - if clearing_range is not UNSET: - field_dict["clearingRange"] = clearing_range - if client_id is not UNSET: - field_dict["clientId"] = client_id - if cmta is not UNSET: - field_dict["cmta"] = cmta - if commission is not UNSET: - field_dict["commission"] = commission - if cross_side_type is not UNSET: - field_dict["crossSideType"] = cross_side_type - if cross_type is not UNSET: - field_dict["crossType"] = cross_type - if cum_qty is not UNSET: - field_dict["cumQty"] = cum_qty - if cur_ord_id is not UNSET: - field_dict["curOrdId"] = cur_ord_id - if deliver_to_compid is not UNSET: - field_dict["deliverToCompid"] = deliver_to_compid - if deliver_to_subid is not UNSET: - field_dict["deliverToSubid"] = deliver_to_subid - if description is not UNSET: - field_dict["description"] = description - if drop is not UNSET: - field_dict["drop"] = drop - if efid is not UNSET: - field_dict["efid"] = efid - if exec_broker is not UNSET: - field_dict["execBroker"] = exec_broker - if exec_id is not UNSET: - field_dict["execId"] = exec_id - if exec_ref_id is not UNSET: - field_dict["execRefId"] = exec_ref_id - if exec_type is not UNSET: - field_dict["execType"] = exec_type - if exercise_style is not UNSET: - field_dict["exerciseStyle"] = exercise_style - if expiration_dt is not UNSET: - field_dict["expirationDt"] = expiration_dt - if fee1 is not UNSET: - field_dict["fee1"] = fee1 - if fee2 is not UNSET: - field_dict["fee2"] = fee2 - if frequent_trader_id is not UNSET: - field_dict["frequentTraderId"] = frequent_trader_id - if give_up is not UNSET: - field_dict["giveUp"] = give_up - if id_ is not UNSET: - field_dict["id"] = id - if incoming_cl_ord_id is not UNSET: - field_dict["incomingClOrdId"] = incoming_cl_ord_id - if incoming_ord_id is not UNSET: - field_dict["incomingOrdId"] = incoming_ord_id - if incoming_orig_clord_id is not UNSET: - field_dict["incomingOrigClordId"] = incoming_orig_clord_id - if last_market is not UNSET: - field_dict["lastMarket"] = last_market - if last_price is not UNSET: - field_dict["lastPrice"] = last_price - if last_qty is not UNSET: - field_dict["lastQty"] = last_qty - if leaves_qty is not UNSET: - field_dict["leavesQty"] = leaves_qty - if leg_id is not UNSET: - field_dict["legId"] = leg_id - if liquidity_flag is not UNSET: - field_dict["liquidityFlag"] = liquidity_flag - if locate_id is not UNSET: - field_dict["locateId"] = locate_id - if mpid is not UNSET: - field_dict["mpid"] = mpid - if multi_leg_reportingtype is not UNSET: - field_dict["multiLegReportingtype"] = multi_leg_reportingtype - if ord_type is not UNSET: - field_dict["ordType"] = ord_type - if origination_type is not UNSET: - field_dict["originationType"] = origination_type - if orig_ord_id is not UNSET: - field_dict["origOrdId"] = orig_ord_id - if parent_ord_id is not UNSET: - field_dict["parentOrdId"] = parent_ord_id - if perm_ord_id is not UNSET: - field_dict["permOrdId"] = perm_ord_id - if position_effect is not UNSET: - field_dict["positionEffect"] = position_effect - if price is not UNSET: - field_dict["price"] = price - if price_type is not UNSET: - field_dict["priceType"] = price_type - if put_call is not UNSET: - field_dict["putCall"] = put_call - if qty is not UNSET: - field_dict["qty"] = qty - if req_ord_id is not UNSET: - field_dict["reqOrdId"] = req_ord_id - if root is not UNSET: - field_dict["root"] = root - if route is not UNSET: - field_dict["route"] = route - if routing_session is not UNSET: - field_dict["routingSession"] = routing_session - if security_type is not UNSET: - field_dict["securityType"] = security_type - if settlement_type is not UNSET: - field_dict["settlementType"] = settlement_type - if side is not UNSET: - field_dict["side"] = side - if source is not UNSET: - field_dict["source"] = source - if source_address is not UNSET: - field_dict["sourceAddress"] = source_address - if strategy_id is not UNSET: - field_dict["strategyId"] = strategy_id - if strike is not UNSET: - field_dict["strike"] = strike - if symbol is not UNSET: - field_dict["symbol"] = symbol - if tag is not UNSET: - field_dict["tag"] = tag - if tag1 is not UNSET: - field_dict["tag1"] = tag1 - if target_comp_id is not UNSET: - field_dict["targetCompId"] = target_comp_id - if target_sub_id is not UNSET: - field_dict["targetSubId"] = target_sub_id - if text is not UNSET: - field_dict["text"] = text - if tif is not UNSET: - field_dict["tif"] = tif - if traded_dt is not UNSET: - field_dict["tradedDt"] = traded_dt - if trader_id is not UNSET: - field_dict["traderId"] = trader_id - if trading_firm_id is not UNSET: - field_dict["tradingFirmId"] = trading_firm_id - if transact_ts is not UNSET: - field_dict["transactTs"] = transact_ts - if underlying is not UNSET: - field_dict["underlying"] = underlying - if user_id is not UNSET: - field_dict["userId"] = user_id - if working_qty is not UNSET: - field_dict["workingQty"] = working_qty - if multiplier is not UNSET: - field_dict["multiplier"] = multiplier - if dac_delta is not UNSET: - field_dict["dacDelta"] = dac_delta - if dac_reference_price is not UNSET: - field_dict["dacReferencePrice"] = dac_reference_price - if manual_fill_time is not UNSET: - field_dict["manualFillTime"] = manual_fill_time - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - account_id = d.pop("accountId", UNSET) - - account_name = d.pop("accountName", UNSET) - - alloc_id = d.pop("allocId", UNSET) - - alloc_qty = d.pop("allocQty", UNSET) - - aux_price = d.pop("auxPrice", UNSET) - - avg_price = d.pop("avgPrice", UNSET) - - billing_code = d.pop("billingCode", UNSET) - - _capacity = d.pop("capacity", UNSET) - capacity: Unset | CapacityCode = ( - UNSET if isinstance(_capacity, Unset) else CapacityCode(_capacity) - ) - - clearing_account = d.pop("clearingAccount", UNSET) - - _clearing_range = d.pop("clearingRange", UNSET) - clearing_range: Unset | ClearingRange = ( - UNSET - if isinstance(_clearing_range, Unset) - else ClearingRange(_clearing_range) - ) - - client_id = d.pop("clientId", UNSET) - - cmta = d.pop("cmta", UNSET) - - commission = d.pop("commission", UNSET) - - _cross_side_type = d.pop("crossSideType", UNSET) - cross_side_type: Unset | CrossSideType = ( - UNSET - if isinstance(_cross_side_type, Unset) - else CrossSideType(_cross_side_type) - ) - - _cross_type = d.pop("crossType", UNSET) - cross_type: Unset | CrossType = ( - UNSET if isinstance(_cross_type, Unset) else CrossType(_cross_type) - ) - - cum_qty = d.pop("cumQty", UNSET) - - cur_ord_id = d.pop("curOrdId", UNSET) - - deliver_to_compid = d.pop("deliverToCompid", UNSET) - - deliver_to_subid = d.pop("deliverToSubid", UNSET) - - description = d.pop("description", UNSET) - - drop = d.pop("drop", UNSET) - - efid = d.pop("efid", UNSET) - - exec_broker = d.pop("execBroker", UNSET) - - exec_id = d.pop("execId", UNSET) - - exec_ref_id = d.pop("execRefId", UNSET) - - _exec_type = d.pop("execType", UNSET) - exec_type: Unset | ExecType = ( - UNSET if isinstance(_exec_type, Unset) else ExecType(_exec_type) - ) - - _exercise_style = d.pop("exerciseStyle", UNSET) - exercise_style: Unset | OptionExerciseStyle = ( - UNSET - if isinstance(_exercise_style, Unset) - else OptionExerciseStyle(_exercise_style) - ) - - _expiration_dt = d.pop("expirationDt", UNSET) - expiration_dt: Unset | Date = ( - UNSET - if isinstance(_expiration_dt, Unset) - else Date.from_dict(_expiration_dt) - ) - - fee1 = d.pop("fee1", UNSET) - - fee2 = d.pop("fee2", UNSET) - - frequent_trader_id = d.pop("frequentTraderId", UNSET) - - give_up = d.pop("giveUp", UNSET) - - id_ = d.pop("id", UNSET) - - incoming_cl_ord_id = d.pop("incomingClOrdId", UNSET) - - incoming_ord_id = d.pop("incomingOrdId", UNSET) - - incoming_orig_clord_id = d.pop("incomingOrigClordId", UNSET) - - last_market = d.pop("lastMarket", UNSET) - - last_price = d.pop("lastPrice", UNSET) - - last_qty = d.pop("lastQty", UNSET) - - leaves_qty = d.pop("leavesQty", UNSET) - - leg_id = d.pop("legId", UNSET) - - liquidity_flag = d.pop("liquidityFlag", UNSET) - - locate_id = d.pop("locateId", UNSET) - - mpid = d.pop("mpid", UNSET) - - _multi_leg_reportingtype = d.pop("multiLegReportingtype", UNSET) - multi_leg_reportingtype: Unset | MultiLegReportingType = ( - UNSET - if isinstance(_multi_leg_reportingtype, Unset) - else MultiLegReportingType(_multi_leg_reportingtype) - ) - - _ord_type = d.pop("ordType", UNSET) - ord_type: Unset | OrdType = ( - UNSET if isinstance(_ord_type, Unset) else OrdType(_ord_type) - ) - - _origination_type = d.pop("originationType", UNSET) - origination_type: Unset | OriginationType = ( - UNSET - if isinstance(_origination_type, Unset) - else OriginationType(_origination_type) - ) - - orig_ord_id = d.pop("origOrdId", UNSET) - - parent_ord_id = d.pop("parentOrdId", UNSET) - - perm_ord_id = d.pop("permOrdId", UNSET) - - _position_effect = d.pop("positionEffect", UNSET) - position_effect: Unset | PositionEffect = ( - UNSET - if isinstance(_position_effect, Unset) - else PositionEffect(_position_effect) - ) - - price = d.pop("price", UNSET) - - _price_type = d.pop("priceType", UNSET) - price_type: Unset | PriceType = ( - UNSET if isinstance(_price_type, Unset) else PriceType(_price_type) - ) - - _put_call = d.pop("putCall", UNSET) - put_call: Unset | PutCall = ( - UNSET if isinstance(_put_call, Unset) else PutCall(_put_call) - ) - - qty = d.pop("qty", UNSET) - - req_ord_id = d.pop("reqOrdId", UNSET) - - root = d.pop("root", UNSET) - - route = d.pop("route", UNSET) - - routing_session = d.pop("routingSession", UNSET) - - _security_type = d.pop("securityType", UNSET) - security_type: Unset | SecurityType = ( - UNSET if isinstance(_security_type, Unset) else SecurityType(_security_type) - ) - - _settlement_type = d.pop("settlementType", UNSET) - settlement_type: Unset | OptionSettlementType = ( - UNSET - if isinstance(_settlement_type, Unset) - else OptionSettlementType(_settlement_type) - ) - - _side = d.pop("side", UNSET) - side: Unset | Side = UNSET if isinstance(_side, Unset) else Side(_side) - - source = d.pop("source", UNSET) - - source_address = d.pop("sourceAddress", UNSET) - - strategy_id = d.pop("strategyId", UNSET) - - strike = d.pop("strike", UNSET) - - symbol = d.pop("symbol", UNSET) - - tag = d.pop("tag", UNSET) - - tag1 = d.pop("tag1", UNSET) - - target_comp_id = d.pop("targetCompId", UNSET) - - target_sub_id = d.pop("targetSubId", UNSET) - - text = d.pop("text", UNSET) - - _tif = d.pop("tif", UNSET) - tif: Unset | Tif = UNSET if isinstance(_tif, Unset) else Tif(_tif) - - _traded_dt = d.pop("tradedDt", UNSET) - traded_dt: Unset | Date = ( - UNSET if isinstance(_traded_dt, Unset) else Date.from_dict(_traded_dt) - ) - - trader_id = d.pop("traderId", UNSET) - - trading_firm_id = d.pop("tradingFirmId", UNSET) - - transact_ts = d.pop("transactTs", UNSET) - - underlying = d.pop("underlying", UNSET) - - user_id = d.pop("userId", UNSET) - - working_qty = d.pop("workingQty", UNSET) - - multiplier = d.pop("multiplier", UNSET) - - dac_delta = d.pop("dacDelta", UNSET) - - dac_reference_price = d.pop("dacReferencePrice", UNSET) - - manual_fill_time = d.pop("manualFillTime", UNSET) - - trade_confirm = cls( - account_id=account_id, - account_name=account_name, - alloc_id=alloc_id, - alloc_qty=alloc_qty, - aux_price=aux_price, - avg_price=avg_price, - billing_code=billing_code, - capacity=capacity, - clearing_account=clearing_account, - clearing_range=clearing_range, - client_id=client_id, - cmta=cmta, - commission=commission, - cross_side_type=cross_side_type, - cross_type=cross_type, - cum_qty=cum_qty, - cur_ord_id=cur_ord_id, - deliver_to_compid=deliver_to_compid, - deliver_to_subid=deliver_to_subid, - description=description, - drop=drop, - efid=efid, - exec_broker=exec_broker, - exec_id=exec_id, - exec_ref_id=exec_ref_id, - exec_type=exec_type, - exercise_style=exercise_style, - expiration_dt=expiration_dt, - fee1=fee1, - fee2=fee2, - frequent_trader_id=frequent_trader_id, - give_up=give_up, - id_=id_, - incoming_cl_ord_id=incoming_cl_ord_id, - incoming_ord_id=incoming_ord_id, - incoming_orig_clord_id=incoming_orig_clord_id, - last_market=last_market, - last_price=last_price, - last_qty=last_qty, - leaves_qty=leaves_qty, - leg_id=leg_id, - liquidity_flag=liquidity_flag, - locate_id=locate_id, - mpid=mpid, - multi_leg_reportingtype=multi_leg_reportingtype, - ord_type=ord_type, - origination_type=origination_type, - orig_ord_id=orig_ord_id, - parent_ord_id=parent_ord_id, - perm_ord_id=perm_ord_id, - position_effect=position_effect, - price=price, - price_type=price_type, - put_call=put_call, - qty=qty, - req_ord_id=req_ord_id, - root=root, - route=route, - routing_session=routing_session, - security_type=security_type, - settlement_type=settlement_type, - side=side, - source=source, - source_address=source_address, - strategy_id=strategy_id, - strike=strike, - symbol=symbol, - tag=tag, - tag1=tag1, - target_comp_id=target_comp_id, - target_sub_id=target_sub_id, - text=text, - tif=tif, - traded_dt=traded_dt, - trader_id=trader_id, - trading_firm_id=trading_firm_id, - transact_ts=transact_ts, - underlying=underlying, - user_id=user_id, - working_qty=working_qty, - multiplier=multiplier, - dac_delta=dac_delta, - dac_reference_price=dac_reference_price, - manual_fill_time=manual_fill_time, - ) - - return trade_confirm diff --git a/openapi_project/openapi_package/models/trading_firm.py b/openapi_project/openapi_package/models/trading_firm.py deleted file mode 100644 index 45909f3d1..000000000 --- a/openapi_project/openapi_package/models/trading_firm.py +++ /dev/null @@ -1,73 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="TradingFirm") - - -@_attrs_define -class TradingFirm: - """ - Attributes: - id_ (Unset | int): - eq_mpid (Unset | str): - name (Unset | str): - occ_clearing_number (Unset | str): - """ - - id_: Unset | int = UNSET - eq_mpid: Unset | str = UNSET - name: Unset | str = UNSET - occ_clearing_number: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - id_ = self.id_ - - eq_mpid = self.eq_mpid - - name = self.name - - occ_clearing_number = self.occ_clearing_number - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if id_ is not UNSET: - field_dict["id"] = id - if eq_mpid is not UNSET: - field_dict["eqMpid"] = eq_mpid - if name is not UNSET: - field_dict["name"] = name - if occ_clearing_number is not UNSET: - field_dict["occClearingNumber"] = occ_clearing_number - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - id_ = d.pop("id", UNSET) - - eq_mpid = d.pop("eqMpid", UNSET) - - name = d.pop("name", UNSET) - - occ_clearing_number = d.pop("occClearingNumber", UNSET) - - trading_firm = cls( - id_=id_, - eq_mpid=eq_mpid, - name=name, - occ_clearing_number=occ_clearing_number, - ) - - return trading_firm diff --git a/openapi_project/openapi_package/models/trading_firm_slim.py b/openapi_project/openapi_package/models/trading_firm_slim.py deleted file mode 100644 index f65ed9b8e..000000000 --- a/openapi_project/openapi_package/models/trading_firm_slim.py +++ /dev/null @@ -1,55 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="TradingFirmSlim") - - -@_attrs_define -class TradingFirmSlim: - """ - Attributes: - id_ (Unset | int): - name (Unset | str): - """ - - id_: Unset | int = UNSET - name: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - id_ = self.id_ - - name = self.name - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if id_ is not UNSET: - field_dict["id"] = id - if name is not UNSET: - field_dict["name"] = name - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - id_ = d.pop("id", UNSET) - - name = d.pop("name", UNSET) - - trading_firm_slim = cls( - id_=id_, - name=name, - ) - - return trading_firm_slim diff --git a/openapi_project/openapi_package/models/trading_holiday.py b/openapi_project/openapi_package/models/trading_holiday.py deleted file mode 100644 index 973e1df3b..000000000 --- a/openapi_project/openapi_package/models/trading_holiday.py +++ /dev/null @@ -1,97 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.country import Country -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.date import Date - - -T = TypeVar("T", bound="TradingHoliday") - - -@_attrs_define -class TradingHoliday: - """ - Attributes: - id_ (Unset | int): - country (Unset | Country): - date (Unset | Date): - description (Unset | str): - is_early_close (Unset | bool): - """ - - id_: Unset | int = UNSET - country: Unset | Country = UNSET - date: Unset | Date = UNSET - description: Unset | str = UNSET - is_early_close: Unset | bool = UNSET - - def to_dict(self) -> dict[str, Any]: - id_ = self.id_ - - country: Unset | str = ( - UNSET if isinstance(self.country, Unset) else self.country.value - ) - - date: Unset | dict[str, Any] = ( - UNSET if isinstance(self.date, Unset) else self.date.to_dict() - ) - - description = self.description - - is_early_close = self.is_early_close - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if id_ is not UNSET: - field_dict["id"] = id - if country is not UNSET: - field_dict["country"] = country - if date is not UNSET: - field_dict["date"] = date - if description is not UNSET: - field_dict["description"] = description - if is_early_close is not UNSET: - field_dict["isEarlyClose"] = is_early_close - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - id_ = d.pop("id", UNSET) - - _country = d.pop("country", UNSET) - country: Unset | Country = ( - UNSET if isinstance(_country, Unset) else Country(_country) - ) - - _date = d.pop("date", UNSET) - date: Unset | Date = ( - UNSET if isinstance(_date, Unset) else Date.from_dict(_date) - ) - - description = d.pop("description", UNSET) - - is_early_close = d.pop("isEarlyClose", UNSET) - - trading_holiday = cls( - id_=id_, - country=country, - date=date, - description=description, - is_early_close=is_early_close, - ) - - return trading_holiday diff --git a/openapi_project/openapi_package/models/trading_session.py b/openapi_project/openapi_package/models/trading_session.py deleted file mode 100644 index 7017bef05..000000000 --- a/openapi_project/openapi_package/models/trading_session.py +++ /dev/null @@ -1,107 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.time_of_day import TimeOfDay - - -T = TypeVar("T", bound="TradingSession") - - -@_attrs_define -class TradingSession: - """ - Attributes: - days_of_the_week (Unset | str): - end_time (Unset | TimeOfDay): - id_ (Unset | int): - name (Unset | str): - start_time (Unset | TimeOfDay): - trading_session_group_id (Unset | int): - """ - - days_of_the_week: Unset | str = UNSET - end_time: Unset | TimeOfDay = UNSET - id_: Unset | int = UNSET - name: Unset | str = UNSET - start_time: Unset | TimeOfDay = UNSET - trading_session_group_id: Unset | int = UNSET - - def to_dict(self) -> dict[str, Any]: - days_of_the_week = self.days_of_the_week - - end_time: Unset | dict[str, Any] = ( - UNSET if isinstance(self.end_time, Unset) else self.end_time.to_dict() - ) - - id_ = self.id_ - - name = self.name - - start_time: Unset | dict[str, Any] = ( - UNSET if isinstance(self.start_time, Unset) else self.start_time.to_dict() - ) - - trading_session_group_id = self.trading_session_group_id - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if days_of_the_week is not UNSET: - field_dict["daysOfTheWeek"] = days_of_the_week - if end_time is not UNSET: - field_dict["endTime"] = end_time - if id_ is not UNSET: - field_dict["id"] = id - if name is not UNSET: - field_dict["name"] = name - if start_time is not UNSET: - field_dict["startTime"] = start_time - if trading_session_group_id is not UNSET: - field_dict["tradingSessionGroupId"] = trading_session_group_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - days_of_the_week = d.pop("daysOfTheWeek", UNSET) - - _end_time = d.pop("endTime", UNSET) - end_time: Unset | TimeOfDay = ( - UNSET if isinstance(_end_time, Unset) else TimeOfDay.from_dict(_end_time) - ) - - id_ = d.pop("id", UNSET) - - name = d.pop("name", UNSET) - - _start_time = d.pop("startTime", UNSET) - start_time: Unset | TimeOfDay = ( - UNSET - if isinstance(_start_time, Unset) - else TimeOfDay.from_dict(_start_time) - ) - - trading_session_group_id = d.pop("tradingSessionGroupId", UNSET) - - trading_session = cls( - days_of_the_week=days_of_the_week, - end_time=end_time, - id_=id_, - name=name, - start_time=start_time, - trading_session_group_id=trading_session_group_id, - ) - - return trading_session diff --git a/openapi_project/openapi_package/models/trading_session_group.py b/openapi_project/openapi_package/models/trading_session_group.py deleted file mode 100644 index 7150fa503..000000000 --- a/openapi_project/openapi_package/models/trading_session_group.py +++ /dev/null @@ -1,78 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.trading_session import TradingSession - - -T = TypeVar("T", bound="TradingSessionGroup") - - -@_attrs_define -class TradingSessionGroup: - """ - Attributes: - id_ (Unset | int): - name (Unset | str): - sessions (Unset | list[TradingSession]): - """ - - id_: Unset | int = UNSET - name: Unset | str = UNSET - sessions: Unset | list[TradingSession] = UNSET - - def to_dict(self) -> dict[str, Any]: - id_ = self.id_ - - name = self.name - - sessions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.sessions, Unset): - sessions = [] - for sessions_item_data in self.sessions: - sessions_item = sessions_item_data.to_dict() - sessions.append(sessions_item) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if id_ is not UNSET: - field_dict["id"] = id - if name is not UNSET: - field_dict["name"] = name - if sessions is not UNSET: - field_dict["sessions"] = sessions - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - id_ = d.pop("id", UNSET) - - name = d.pop("name", UNSET) - - sessions = [] - _sessions = d.pop("sessions", UNSET) - for sessions_item_data in _sessions or []: - sessions_item = TradingSession.from_dict(sessions_item_data) - - sessions.append(sessions_item) - - trading_session_group = cls( - id_=id_, - name=name, - sessions=sessions, - ) - - return trading_session_group diff --git a/openapi_project/openapi_package/models/user.py b/openapi_project/openapi_package/models/user.py deleted file mode 100644 index 04a303b4a..000000000 --- a/openapi_project/openapi_package/models/user.py +++ /dev/null @@ -1,236 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, BinaryIO, Generator, TextIO, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field -from openapi_project.openapi_package.models.user_location import UserLocation -from openapi_project.openapi_package.models.user_status import UserStatus -from openapi_project.openapi_package.models.user_type import UserType -from openapi_project.openapi_package.types import UNSET, Unset - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.user_permission import UserPermission - - -T = TypeVar("T", bound="User") - - -@_attrs_define -class User: - """ - Attributes: - domain (Unset | str): - email (Unset | str): - first_name (Unset | str): - id_ (Unset | int): - is_locked_out (Unset | bool): - last_name (Unset | str): - location (Unset | UserLocation): - phone_primary (Unset | str): - phone_secondary (Unset | str): - region (Unset | str): - region_code (Unset | str): - status (Unset | UserStatus): - trading_firm_id (Unset | int): - type_ (Unset | UserType): - user_name (Unset | str): - city (Unset | str): - permissions (Unset | list[UserPermission]): - setup_ticket (Unset | str): - large_trader_id (Unset | str): - """ - - domain: Unset | str = UNSET - email: Unset | str = UNSET - first_name: Unset | str = UNSET - id_: Unset | int = UNSET - is_locked_out: Unset | bool = UNSET - last_name: Unset | str = UNSET - location: Unset | UserLocation = UNSET - phone_primary: Unset | str = UNSET - phone_secondary: Unset | str = UNSET - region: Unset | str = UNSET - region_code: Unset | str = UNSET - status: Unset | UserStatus = UNSET - trading_firm_id: Unset | int = UNSET - type_: Unset | UserType = UNSET - user_name: Unset | str = UNSET - city: Unset | str = UNSET - permissions: Unset | list[UserPermission] = UNSET - setup_ticket: Unset | str = UNSET - large_trader_id: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - domain = self.domain - - email = self.email - - first_name = self.first_name - - id_ = self.id_ - - is_locked_out = self.is_locked_out - - last_name = self.last_name - - location: Unset | str = ( - UNSET if isinstance(self.location, Unset) else self.location.value - ) - - phone_primary = self.phone_primary - - phone_secondary = self.phone_secondary - - region = self.region - - region_code = self.region_code - - status: Unset | str = ( - UNSET if isinstance(self.status, Unset) else self.status.value - ) - - trading_firm_id = self.trading_firm_id - - type_: Unset | str = ( - UNSET if isinstance(self.type_, Unset) else self.type_.value - ) - - user_name = self.user_name - - city = self.city - - permissions: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.permissions, Unset): - permissions = [] - for permissions_item_data in self.permissions: - permissions_item = permissions_item_data.to_dict() - permissions.append(permissions_item) - - setup_ticket = self.setup_ticket - - large_trader_id = self.large_trader_id - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if domain is not UNSET: - field_dict["domain"] = domain - if email is not UNSET: - field_dict["email"] = email - if first_name is not UNSET: - field_dict["firstName"] = first_name - if id_ is not UNSET: - field_dict["id"] = id - if is_locked_out is not UNSET: - field_dict["isLockedOut"] = is_locked_out - if last_name is not UNSET: - field_dict["lastName"] = last_name - if location is not UNSET: - field_dict["location"] = location - if phone_primary is not UNSET: - field_dict["phonePrimary"] = phone_primary - if phone_secondary is not UNSET: - field_dict["phoneSecondary"] = phone_secondary - if region is not UNSET: - field_dict["region"] = region - if region_code is not UNSET: - field_dict["regionCode"] = region_code - if status is not UNSET: - field_dict["status"] = status - if trading_firm_id is not UNSET: - field_dict["tradingFirmId"] = trading_firm_id - if type_ is not UNSET: - field_dict["type"] = type_ - if user_name is not UNSET: - field_dict["userName"] = user_name - if city is not UNSET: - field_dict["city"] = city - if permissions is not UNSET: - field_dict["permissions"] = permissions - if setup_ticket is not UNSET: - field_dict["setupTicket"] = setup_ticket - if large_trader_id is not UNSET: - field_dict["largeTraderId"] = large_trader_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - domain = d.pop("domain", UNSET) - - email = d.pop("email", UNSET) - - first_name = d.pop("firstName", UNSET) - - id_ = d.pop("id", UNSET) - - is_locked_out = d.pop("isLockedOut", UNSET) - - last_name = d.pop("lastName", UNSET) - - _location = d.pop("location", UNSET) - location: Unset | UserLocation = ( - UNSET if isinstance(_location, Unset) else UserLocation(_location) - ) - - phone_primary = d.pop("phonePrimary", UNSET) - - phone_secondary = d.pop("phoneSecondary", UNSET) - - region = d.pop("region", UNSET) - - region_code = d.pop("regionCode", UNSET) - - _status = d.pop("status", UNSET) - status: Unset | UserStatus = ( - UNSET if isinstance(_status, Unset) else UserStatus(_status) - ) - - trading_firm_id = d.pop("tradingFirmId", UNSET) - - _type_ = d.pop("type", UNSET) - type_: Unset | UserType = ( - UNSET if isinstance(_type_, Unset) else UserType(_type_) - ) - - user_name = d.pop("userName", UNSET) - - city = d.pop("city", UNSET) - - permissions = [] - _permissions = d.pop("permissions", UNSET) - for permissions_item_data in _permissions or []: - permissions_item = UserPermission.from_dict(permissions_item_data) - - permissions.append(permissions_item) - - setup_ticket = d.pop("setupTicket", UNSET) - - large_trader_id = d.pop("largeTraderId", UNSET) - - user = cls( - domain=domain, - email=email, - first_name=first_name, - id_=id_, - is_locked_out=is_locked_out, - last_name=last_name, - location=location, - phone_primary=phone_primary, - phone_secondary=phone_secondary, - region=region, - region_code=region_code, - status=status, - trading_firm_id=trading_firm_id, - type_=type_, - user_name=user_name, - city=city, - permissions=permissions, - setup_ticket=setup_ticket, - large_trader_id=large_trader_id, - ) - - return user diff --git a/openapi_project/openapi_package/models/user_location.py b/openapi_project/openapi_package/models/user_location.py deleted file mode 100644 index 73fba2ea4..000000000 --- a/openapi_project/openapi_package/models/user_location.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class UserLocation(str, Enum): - USER_LOCATION_OFF_FLOOR = "USER_LOCATION_OFF_FLOOR" - USER_LOCATION_ON_FLOOR = "USER_LOCATION_ON_FLOOR" - USER_LOCATION_UNKNOWN = "USER_LOCATION_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/user_permission.py b/openapi_project/openapi_package/models/user_permission.py deleted file mode 100644 index 3fb492f4c..000000000 --- a/openapi_project/openapi_package/models/user_permission.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.claim_type import ClaimType -from openapi_project.openapi_package.types import UNSET, Unset - - -T = TypeVar("T", bound="UserPermission") - - -@_attrs_define -class UserPermission: - """ - Attributes: - claim (Unset | str): - claim_type (Unset | ClaimType): - description (Unset | str): - """ - - claim: Unset | str = UNSET - claim_type: Unset | ClaimType = UNSET - description: Unset | str = UNSET - - def to_dict(self) -> dict[str, Any]: - claim = self.claim - - claim_type: Unset | str = ( - UNSET if isinstance(self.claim_type, Unset) else self.claim_type.value - ) - - description = self.description - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if claim is not UNSET: - field_dict["claim"] = claim - if claim_type is not UNSET: - field_dict["claimType"] = claim_type - if description is not UNSET: - field_dict["description"] = description - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - claim = d.pop("claim", UNSET) - - _claim_type = d.pop("claimType", UNSET) - claim_type: Unset | ClaimType = ( - UNSET if isinstance(_claim_type, Unset) else ClaimType(_claim_type) - ) - - description = d.pop("description", UNSET) - - user_permission = cls( - claim=claim, - claim_type=claim_type, - description=description, - ) - - return user_permission diff --git a/openapi_project/openapi_package/models/user_status.py b/openapi_project/openapi_package/models/user_status.py deleted file mode 100644 index 88da2b504..000000000 --- a/openapi_project/openapi_package/models/user_status.py +++ /dev/null @@ -1,12 +0,0 @@ -from enum import Enum - - -class UserStatus(str, Enum): - USER_STATUS_ACTIVE = "USER_STATUS_ACTIVE" - USER_STATUS_DELETED = "USER_STATUS_DELETED" - USER_STATUS_DISABLED = "USER_STATUS_DISABLED" - USER_STATUS_UNKNOWN = "USER_STATUS_UNKNOWN" - USER_STATUS_VIEW_ONLY = "USER_STATUS_VIEW_ONLY" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/user_type.py b/openapi_project/openapi_package/models/user_type.py deleted file mode 100644 index 95a3da9d0..000000000 --- a/openapi_project/openapi_package/models/user_type.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class UserType(str, Enum): - USER_TYPE_API = "USER_TYPE_API" - USER_TYPE_GUI = "USER_TYPE_GUI" - USER_TYPE_UNKNOWN = "USER_TYPE_UNKNOWN" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/validate_risk_response.py b/openapi_project/openapi_package/models/validate_risk_response.py deleted file mode 100644 index 5752fa2fa..000000000 --- a/openapi_project/openapi_package/models/validate_risk_response.py +++ /dev/null @@ -1,93 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from openapi_project.openapi_package.models.status_code import StatusCode -from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast - -if TYPE_CHECKING: - from openapi_project.openapi_package.models.risk_reject import RiskReject - - -T = TypeVar("T", bound="ValidateRiskResponse") - - -@_attrs_define -class ValidateRiskResponse: - """ - Attributes: - is_valid (Unset | bool): - risk_rejects (Unset | list[RiskReject]): - error_message (Unset | str): - status_code (Unset | StatusCode): - """ - - is_valid: Unset | bool = UNSET - risk_rejects: Unset | list[RiskReject] = UNSET - error_message: Unset | str = UNSET - status_code: Unset | StatusCode = UNSET - - def to_dict(self) -> dict[str, Any]: - is_valid = self.is_valid - - risk_rejects: Unset | list[dict[str, Any]] = UNSET - if not isinstance(self.risk_rejects, Unset): - risk_rejects = [] - for risk_rejects_item_data in self.risk_rejects: - risk_rejects_item = risk_rejects_item_data.to_dict() - risk_rejects.append(risk_rejects_item) - - error_message = self.error_message - - status_code: Unset | str = ( - UNSET if isinstance(self.status_code, Unset) else self.status_code.value - ) - - field_dict: dict[str, Any] = {} - - field_dict.update({}) - if is_valid is not UNSET: - field_dict["isValid"] = is_valid - if risk_rejects is not UNSET: - field_dict["riskRejects"] = risk_rejects - if error_message is not UNSET: - field_dict["errorMessage"] = error_message - if status_code is not UNSET: - field_dict["statusCode"] = status_code - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - is_valid = d.pop("isValid", UNSET) - - risk_rejects = [] - _risk_rejects = d.pop("riskRejects", UNSET) - for risk_rejects_item_data in _risk_rejects or []: - risk_rejects_item = RiskReject.from_dict(risk_rejects_item_data) - - risk_rejects.append(risk_rejects_item) - - error_message = d.pop("errorMessage", UNSET) - - _status_code = d.pop("statusCode", UNSET) - status_code: Unset | StatusCode = ( - UNSET if isinstance(_status_code, Unset) else StatusCode(_status_code) - ) - - validate_risk_response = cls( - is_valid=is_valid, - risk_rejects=risk_rejects, - error_message=error_message, - status_code=status_code, - ) - - return validate_risk_response diff --git a/openapi_project/openapi_package/models/volatility_shock_skew.py b/openapi_project/openapi_package/models/volatility_shock_skew.py deleted file mode 100644 index ba182d91a..000000000 --- a/openapi_project/openapi_package/models/volatility_shock_skew.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class VolatilityShockSkew(str, Enum): - VOLATILITY_SHOCK_SKEW_STICKY_DELTA = "VOLATILITY_SHOCK_SKEW_STICKY_DELTA" - VOLATILITY_SHOCK_SKEW_STICKY_STRIKE = "VOLATILITY_SHOCK_SKEW_STICKY_STRIKE" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/models/volatility_shock_type.py b/openapi_project/openapi_package/models/volatility_shock_type.py deleted file mode 100644 index 4757c0b0c..000000000 --- a/openapi_project/openapi_package/models/volatility_shock_type.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class VolatilityShockType(str, Enum): - VOLATILITY_SHOCK_TYPE_ABSOLUTE = "VOLATILITY_SHOCK_TYPE_ABSOLUTE" - VOLATILITY_SHOCK_TYPE_RELATIVE = "VOLATILITY_SHOCK_TYPE_RELATIVE" - - def __str__(self) -> str: - return str(self.value) diff --git a/openapi_project/openapi_package/types.py b/openapi_project/openapi_package/types.py index 6911ee49e..12cd8c0dd 100644 --- a/openapi_project/openapi_package/types.py +++ b/openapi_project/openapi_package/types.py @@ -1,4 +1,4 @@ -"""Contains some shared types for properties""" +""" Contains some shared types for properties """ from collections.abc import Mapping, MutableMapping from http import HTTPStatus @@ -18,24 +18,22 @@ def __bool__(self) -> Literal[False]: FileContent = IO[bytes] | bytes | str FileTypes = ( # (filename, file (or bytes), content_type) - tuple[str | None, FileContent, str | None] - | + tuple[str | None, FileContent, str | None] | # (filename, file (or bytes), content_type, headers) tuple[str | None, FileContent, str | None, Mapping[str, str]] ) RequestFiles = list[tuple[str, FileTypes]] - @define class File: - """Contains information for file uploads""" + """ Contains information for file uploads """ payload: BinaryIO file_name: str | None = None mime_type: str | None = None def to_tuple(self) -> FileTypes: - """Return a tuple representation that httpx will accept for multipart/form-data""" + """ Return a tuple representation that httpx will accept for multipart/form-data """ return self.file_name, self.payload, self.mime_type @@ -44,7 +42,7 @@ def to_tuple(self) -> FileTypes: @define class Response(Generic[T]): - """A response from an endpoint""" + """ A response from an endpoint """ status_code: HTTPStatus content: bytes From 41d7985be9d5fe735db0eef5eb0692c46dfee369 Mon Sep 17 00:00:00 2001 From: Itay Bavly Date: Thu, 11 Sep 2025 11:05:37 -0400 Subject: [PATCH 13/16] json --- openapi/openapi.cleaned.yaml | 4 +--- .../api/index/index_at_time_price.py | 18 +++++++-------- .../api/index/index_history_eod.py | 18 +++++++-------- .../api/index/index_history_ohlc.py | 18 +++++++-------- .../api/index/index_history_price.py | 18 +++++++-------- .../api/index/index_list_dates.py | 18 +++++++-------- .../api/index/index_list_symbols.py | 18 +++++++-------- .../api/index/index_snapshot_ohlc.py | 18 +++++++-------- .../api/index/index_snapshot_price.py | 18 +++++++-------- .../api/option/option_at_time_quote.py | 18 +++++++-------- .../api/option/option_at_time_trade.py | 18 +++++++-------- .../api/option/option_history_eod.py | 18 +++++++-------- .../api/option/option_history_greeks_all.py | 18 +++++++-------- .../api/option/option_history_greeks_eod.py | 18 +++++++-------- .../option_history_greeks_first_order.py | 18 +++++++-------- ...ption_history_greeks_implied_volatility.py | 18 +++++++-------- .../option_history_greeks_second_order.py | 18 +++++++-------- .../option_history_greeks_third_order.py | 18 +++++++-------- .../api/option/option_history_ohlc.py | 18 +++++++-------- .../option/option_history_open_interest.py | 18 +++++++-------- .../api/option/option_history_quote.py | 18 +++++++-------- .../api/option/option_history_trade.py | 18 +++++++-------- .../option/option_history_trade_greeks_all.py | 18 +++++++-------- ...option_history_trade_greeks_first_order.py | 18 +++++++-------- ...history_trade_greeks_implied_volatility.py | 18 +++++++-------- ...ption_history_trade_greeks_second_order.py | 18 +++++++-------- ...option_history_trade_greeks_third_order.py | 18 +++++++-------- .../api/option/option_history_trade_quote.py | 18 +++++++-------- .../api/option/option_list_contracts.py | 18 +++++++-------- .../api/option/option_list_dates.py | 18 +++++++-------- .../api/option/option_list_expirations.py | 22 ++++++++----------- .../api/option/option_list_strikes.py | 18 +++++++-------- .../api/option/option_list_symbols.py | 18 +++++++-------- .../api/option/option_snapshot_greeks_all.py | 18 +++++++-------- .../option_snapshot_greeks_first_order.py | 18 +++++++-------- ...tion_snapshot_greeks_implied_volatility.py | 18 +++++++-------- .../option_snapshot_greeks_second_order.py | 18 +++++++-------- .../option_snapshot_greeks_third_order.py | 18 +++++++-------- .../api/option/option_snapshot_ohlc.py | 18 +++++++-------- .../option/option_snapshot_open_interest.py | 18 +++++++-------- .../api/option/option_snapshot_quote.py | 18 +++++++-------- .../api/option/option_snapshot_trade.py | 18 +++++++-------- .../api/stock/stock_at_time_quote.py | 18 +++++++-------- .../api/stock/stock_at_time_trade.py | 18 +++++++-------- .../api/stock/stock_history_eod.py | 18 +++++++-------- .../api/stock/stock_history_ohlc.py | 18 +++++++-------- .../api/stock/stock_history_quote.py | 18 +++++++-------- .../api/stock/stock_history_trade.py | 10 ++++----- .../api/stock/stock_history_trade_quote.py | 10 ++++----- .../api/stock/stock_list_dates.py | 18 +++++++-------- .../api/stock/stock_list_symbols.py | 18 +++++++-------- .../api/stock/stock_snapshot_ohlc.py | 18 +++++++-------- .../api/stock/stock_snapshot_quote.py | 18 +++++++-------- .../api/stock/stock_snapshot_trade.py | 18 +++++++-------- .../models/index_at_time_price_format.py | 2 -- .../models/index_history_eod_format.py | 2 -- .../models/index_history_ohlc_format.py | 2 -- .../models/index_history_price_format.py | 2 -- .../models/index_list_dates_format.py | 2 -- .../models/index_list_symbols_format.py | 2 -- .../models/index_snapshot_ohlc_format.py | 2 -- .../models/index_snapshot_price_format.py | 2 -- .../models/option_at_time_quote_format.py | 2 -- .../models/option_at_time_trade_format.py | 2 -- .../models/option_history_eod_format.py | 2 -- .../option_history_greeks_all_format.py | 2 -- .../option_history_greeks_eod_format.py | 2 -- ...ption_history_greeks_first_order_format.py | 2 -- ...istory_greeks_implied_volatility_format.py | 2 -- ...tion_history_greeks_second_order_format.py | 2 -- ...ption_history_greeks_third_order_format.py | 2 -- .../models/option_history_ohlc_format.py | 2 -- .../option_history_open_interest_format.py | 2 -- .../models/option_history_quote_format.py | 2 -- .../models/option_history_trade_format.py | 2 -- .../option_history_trade_greeks_all_format.py | 2 -- ...history_trade_greeks_first_order_format.py | 2 -- ..._trade_greeks_implied_volatility_format.py | 2 -- ...istory_trade_greeks_second_order_format.py | 2 -- ...history_trade_greeks_third_order_format.py | 2 -- .../option_history_trade_quote_format.py | 2 -- .../models/option_list_contracts_format.py | 2 -- .../models/option_list_dates_format.py | 2 -- .../models/option_list_expirations_format.py | 2 -- .../models/option_list_strikes_format.py | 2 -- .../models/option_list_symbols_format.py | 2 -- .../option_snapshot_greeks_all_format.py | 2 -- ...tion_snapshot_greeks_first_order_format.py | 2 -- ...apshot_greeks_implied_volatility_format.py | 2 -- ...ion_snapshot_greeks_second_order_format.py | 2 -- ...tion_snapshot_greeks_third_order_format.py | 2 -- .../models/option_snapshot_ohlc_format.py | 2 -- .../option_snapshot_open_interest_format.py | 2 -- .../models/option_snapshot_quote_format.py | 2 -- .../models/option_snapshot_trade_format.py | 2 -- .../models/stock_at_time_quote_format.py | 2 -- .../models/stock_at_time_trade_format.py | 2 -- .../models/stock_history_eod_format.py | 2 -- .../models/stock_history_ohlc_format.py | 2 -- .../models/stock_history_quote_format.py | 2 -- .../models/stock_history_trade_format.py | 2 -- .../stock_history_trade_quote_format.py | 2 -- .../models/stock_list_dates_format.py | 2 -- .../models/stock_list_symbols_format.py | 2 -- .../models/stock_snapshot_ohlc_format.py | 2 -- .../models/stock_snapshot_quote_format.py | 2 -- .../models/stock_snapshot_trade_format.py | 2 -- 107 files changed, 470 insertions(+), 582 deletions(-) diff --git a/openapi/openapi.cleaned.yaml b/openapi/openapi.cleaned.yaml index dbc16d4b8..34f240145 100644 --- a/openapi/openapi.cleaned.yaml +++ b/openapi/openapi.cleaned.yaml @@ -8228,10 +8228,8 @@ components: schema: type: string enum: - - csv - json - - ndjson - default: ndjson + default: json rate_type: name: rate_type diff --git a/openapi_project/openapi_package/api/index/index_at_time_price.py b/openapi_project/openapi_package/api/index/index_at_time_price.py index 00e10d05d..55625ddb6 100644 --- a/openapi_project/openapi_package/api/index/index_at_time_price.py +++ b/openapi_project/openapi_package/api/index/index_at_time_price.py @@ -22,7 +22,7 @@ def _get_kwargs( start_date: datetime.date, end_date: datetime.date, time_of_day: str, - format_: Unset | IndexAtTimePriceFormat = IndexAtTimePriceFormat.NDJSON, + format_: Unset | IndexAtTimePriceFormat = IndexAtTimePriceFormat.JSON, ) -> dict[str, Any]: @@ -88,7 +88,7 @@ def sync_detailed( start_date: datetime.date, end_date: datetime.date, time_of_day: str, - format_: Unset | IndexAtTimePriceFormat = IndexAtTimePriceFormat.NDJSON, + format_: Unset | IndexAtTimePriceFormat = IndexAtTimePriceFormat.JSON, ) -> Response[IndexAtTimePriceResponse200]: """ Price @@ -103,7 +103,7 @@ def sync_detailed( start_date (datetime.date): end_date (datetime.date): time_of_day (str): - format_ (Unset | IndexAtTimePriceFormat): Default: IndexAtTimePriceFormat.NDJSON. + format_ (Unset | IndexAtTimePriceFormat): Default: IndexAtTimePriceFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -136,7 +136,7 @@ def sync( start_date: datetime.date, end_date: datetime.date, time_of_day: str, - format_: Unset | IndexAtTimePriceFormat = IndexAtTimePriceFormat.NDJSON, + format_: Unset | IndexAtTimePriceFormat = IndexAtTimePriceFormat.JSON, ) -> IndexAtTimePriceResponse200 | None: """ Price @@ -151,7 +151,7 @@ def sync( start_date (datetime.date): end_date (datetime.date): time_of_day (str): - format_ (Unset | IndexAtTimePriceFormat): Default: IndexAtTimePriceFormat.NDJSON. + format_ (Unset | IndexAtTimePriceFormat): Default: IndexAtTimePriceFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -179,7 +179,7 @@ async def asyncio_detailed( start_date: datetime.date, end_date: datetime.date, time_of_day: str, - format_: Unset | IndexAtTimePriceFormat = IndexAtTimePriceFormat.NDJSON, + format_: Unset | IndexAtTimePriceFormat = IndexAtTimePriceFormat.JSON, ) -> Response[IndexAtTimePriceResponse200]: """ Price @@ -194,7 +194,7 @@ async def asyncio_detailed( start_date (datetime.date): end_date (datetime.date): time_of_day (str): - format_ (Unset | IndexAtTimePriceFormat): Default: IndexAtTimePriceFormat.NDJSON. + format_ (Unset | IndexAtTimePriceFormat): Default: IndexAtTimePriceFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -227,7 +227,7 @@ async def asyncio( start_date: datetime.date, end_date: datetime.date, time_of_day: str, - format_: Unset | IndexAtTimePriceFormat = IndexAtTimePriceFormat.NDJSON, + format_: Unset | IndexAtTimePriceFormat = IndexAtTimePriceFormat.JSON, ) -> IndexAtTimePriceResponse200 | None: """ Price @@ -242,7 +242,7 @@ async def asyncio( start_date (datetime.date): end_date (datetime.date): time_of_day (str): - format_ (Unset | IndexAtTimePriceFormat): Default: IndexAtTimePriceFormat.NDJSON. + format_ (Unset | IndexAtTimePriceFormat): Default: IndexAtTimePriceFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/index/index_history_eod.py b/openapi_project/openapi_package/api/index/index_history_eod.py index a31097e38..f12741710 100644 --- a/openapi_project/openapi_package/api/index/index_history_eod.py +++ b/openapi_project/openapi_package/api/index/index_history_eod.py @@ -21,7 +21,7 @@ def _get_kwargs( symbol: str, start_date: datetime.date, end_date: datetime.date, - format_: Unset | IndexHistoryEodFormat = IndexHistoryEodFormat.NDJSON, + format_: Unset | IndexHistoryEodFormat = IndexHistoryEodFormat.JSON, ) -> dict[str, Any]: @@ -84,7 +84,7 @@ def sync_detailed( symbol: str, start_date: datetime.date, end_date: datetime.date, - format_: Unset | IndexHistoryEodFormat = IndexHistoryEodFormat.NDJSON, + format_: Unset | IndexHistoryEodFormat = IndexHistoryEodFormat.JSON, ) -> Response[IndexHistoryEodResponse200]: """ End of Day @@ -96,7 +96,7 @@ def sync_detailed( symbol (str): start_date (datetime.date): end_date (datetime.date): - format_ (Unset | IndexHistoryEodFormat): Default: IndexHistoryEodFormat.NDJSON. + format_ (Unset | IndexHistoryEodFormat): Default: IndexHistoryEodFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -127,7 +127,7 @@ def sync( symbol: str, start_date: datetime.date, end_date: datetime.date, - format_: Unset | IndexHistoryEodFormat = IndexHistoryEodFormat.NDJSON, + format_: Unset | IndexHistoryEodFormat = IndexHistoryEodFormat.JSON, ) -> IndexHistoryEodResponse200 | None: """ End of Day @@ -139,7 +139,7 @@ def sync( symbol (str): start_date (datetime.date): end_date (datetime.date): - format_ (Unset | IndexHistoryEodFormat): Default: IndexHistoryEodFormat.NDJSON. + format_ (Unset | IndexHistoryEodFormat): Default: IndexHistoryEodFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -165,7 +165,7 @@ async def asyncio_detailed( symbol: str, start_date: datetime.date, end_date: datetime.date, - format_: Unset | IndexHistoryEodFormat = IndexHistoryEodFormat.NDJSON, + format_: Unset | IndexHistoryEodFormat = IndexHistoryEodFormat.JSON, ) -> Response[IndexHistoryEodResponse200]: """ End of Day @@ -177,7 +177,7 @@ async def asyncio_detailed( symbol (str): start_date (datetime.date): end_date (datetime.date): - format_ (Unset | IndexHistoryEodFormat): Default: IndexHistoryEodFormat.NDJSON. + format_ (Unset | IndexHistoryEodFormat): Default: IndexHistoryEodFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -208,7 +208,7 @@ async def asyncio( symbol: str, start_date: datetime.date, end_date: datetime.date, - format_: Unset | IndexHistoryEodFormat = IndexHistoryEodFormat.NDJSON, + format_: Unset | IndexHistoryEodFormat = IndexHistoryEodFormat.JSON, ) -> IndexHistoryEodResponse200 | None: """ End of Day @@ -220,7 +220,7 @@ async def asyncio( symbol (str): start_date (datetime.date): end_date (datetime.date): - format_ (Unset | IndexHistoryEodFormat): Default: IndexHistoryEodFormat.NDJSON. + format_ (Unset | IndexHistoryEodFormat): Default: IndexHistoryEodFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/index/index_history_ohlc.py b/openapi_project/openapi_package/api/index/index_history_ohlc.py index de332d7d4..d5f5a2ce7 100644 --- a/openapi_project/openapi_package/api/index/index_history_ohlc.py +++ b/openapi_project/openapi_package/api/index/index_history_ohlc.py @@ -25,7 +25,7 @@ def _get_kwargs( interval: IndexHistoryOhlcInterval = IndexHistoryOhlcInterval.VALUE_4, start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', - format_: Unset | IndexHistoryOhlcFormat = IndexHistoryOhlcFormat.NDJSON, + format_: Unset | IndexHistoryOhlcFormat = IndexHistoryOhlcFormat.JSON, ) -> dict[str, Any]: @@ -98,7 +98,7 @@ def sync_detailed( interval: IndexHistoryOhlcInterval = IndexHistoryOhlcInterval.VALUE_4, start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', - format_: Unset | IndexHistoryOhlcFormat = IndexHistoryOhlcFormat.NDJSON, + format_: Unset | IndexHistoryOhlcFormat = IndexHistoryOhlcFormat.JSON, ) -> Response[IndexHistoryOhlcResponse200]: """ Open High Low Close @@ -116,7 +116,7 @@ def sync_detailed( interval (IndexHistoryOhlcInterval): Default: IndexHistoryOhlcInterval.VALUE_4. start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. - format_ (Unset | IndexHistoryOhlcFormat): Default: IndexHistoryOhlcFormat.NDJSON. + format_ (Unset | IndexHistoryOhlcFormat): Default: IndexHistoryOhlcFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -153,7 +153,7 @@ def sync( interval: IndexHistoryOhlcInterval = IndexHistoryOhlcInterval.VALUE_4, start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', - format_: Unset | IndexHistoryOhlcFormat = IndexHistoryOhlcFormat.NDJSON, + format_: Unset | IndexHistoryOhlcFormat = IndexHistoryOhlcFormat.JSON, ) -> IndexHistoryOhlcResponse200 | None: """ Open High Low Close @@ -171,7 +171,7 @@ def sync( interval (IndexHistoryOhlcInterval): Default: IndexHistoryOhlcInterval.VALUE_4. start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. - format_ (Unset | IndexHistoryOhlcFormat): Default: IndexHistoryOhlcFormat.NDJSON. + format_ (Unset | IndexHistoryOhlcFormat): Default: IndexHistoryOhlcFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -203,7 +203,7 @@ async def asyncio_detailed( interval: IndexHistoryOhlcInterval = IndexHistoryOhlcInterval.VALUE_4, start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', - format_: Unset | IndexHistoryOhlcFormat = IndexHistoryOhlcFormat.NDJSON, + format_: Unset | IndexHistoryOhlcFormat = IndexHistoryOhlcFormat.JSON, ) -> Response[IndexHistoryOhlcResponse200]: """ Open High Low Close @@ -221,7 +221,7 @@ async def asyncio_detailed( interval (IndexHistoryOhlcInterval): Default: IndexHistoryOhlcInterval.VALUE_4. start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. - format_ (Unset | IndexHistoryOhlcFormat): Default: IndexHistoryOhlcFormat.NDJSON. + format_ (Unset | IndexHistoryOhlcFormat): Default: IndexHistoryOhlcFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -258,7 +258,7 @@ async def asyncio( interval: IndexHistoryOhlcInterval = IndexHistoryOhlcInterval.VALUE_4, start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', - format_: Unset | IndexHistoryOhlcFormat = IndexHistoryOhlcFormat.NDJSON, + format_: Unset | IndexHistoryOhlcFormat = IndexHistoryOhlcFormat.JSON, ) -> IndexHistoryOhlcResponse200 | None: """ Open High Low Close @@ -276,7 +276,7 @@ async def asyncio( interval (IndexHistoryOhlcInterval): Default: IndexHistoryOhlcInterval.VALUE_4. start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. - format_ (Unset | IndexHistoryOhlcFormat): Default: IndexHistoryOhlcFormat.NDJSON. + format_ (Unset | IndexHistoryOhlcFormat): Default: IndexHistoryOhlcFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/index/index_history_price.py b/openapi_project/openapi_package/api/index/index_history_price.py index 691935411..b37429a6c 100644 --- a/openapi_project/openapi_package/api/index/index_history_price.py +++ b/openapi_project/openapi_package/api/index/index_history_price.py @@ -24,7 +24,7 @@ def _get_kwargs( start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', interval: IndexHistoryPriceInterval = IndexHistoryPriceInterval.VALUE_4, - format_: Unset | IndexHistoryPriceFormat = IndexHistoryPriceFormat.NDJSON, + format_: Unset | IndexHistoryPriceFormat = IndexHistoryPriceFormat.JSON, ) -> dict[str, Any]: @@ -93,7 +93,7 @@ def sync_detailed( start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', interval: IndexHistoryPriceInterval = IndexHistoryPriceInterval.VALUE_4, - format_: Unset | IndexHistoryPriceFormat = IndexHistoryPriceFormat.NDJSON, + format_: Unset | IndexHistoryPriceFormat = IndexHistoryPriceFormat.JSON, ) -> Response[IndexHistoryPriceResponse200]: """ Price @@ -112,7 +112,7 @@ def sync_detailed( start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. interval (IndexHistoryPriceInterval): Default: IndexHistoryPriceInterval.VALUE_4. - format_ (Unset | IndexHistoryPriceFormat): Default: IndexHistoryPriceFormat.NDJSON. + format_ (Unset | IndexHistoryPriceFormat): Default: IndexHistoryPriceFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -147,7 +147,7 @@ def sync( start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', interval: IndexHistoryPriceInterval = IndexHistoryPriceInterval.VALUE_4, - format_: Unset | IndexHistoryPriceFormat = IndexHistoryPriceFormat.NDJSON, + format_: Unset | IndexHistoryPriceFormat = IndexHistoryPriceFormat.JSON, ) -> IndexHistoryPriceResponse200 | None: """ Price @@ -166,7 +166,7 @@ def sync( start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. interval (IndexHistoryPriceInterval): Default: IndexHistoryPriceInterval.VALUE_4. - format_ (Unset | IndexHistoryPriceFormat): Default: IndexHistoryPriceFormat.NDJSON. + format_ (Unset | IndexHistoryPriceFormat): Default: IndexHistoryPriceFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -196,7 +196,7 @@ async def asyncio_detailed( start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', interval: IndexHistoryPriceInterval = IndexHistoryPriceInterval.VALUE_4, - format_: Unset | IndexHistoryPriceFormat = IndexHistoryPriceFormat.NDJSON, + format_: Unset | IndexHistoryPriceFormat = IndexHistoryPriceFormat.JSON, ) -> Response[IndexHistoryPriceResponse200]: """ Price @@ -215,7 +215,7 @@ async def asyncio_detailed( start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. interval (IndexHistoryPriceInterval): Default: IndexHistoryPriceInterval.VALUE_4. - format_ (Unset | IndexHistoryPriceFormat): Default: IndexHistoryPriceFormat.NDJSON. + format_ (Unset | IndexHistoryPriceFormat): Default: IndexHistoryPriceFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -250,7 +250,7 @@ async def asyncio( start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', interval: IndexHistoryPriceInterval = IndexHistoryPriceInterval.VALUE_4, - format_: Unset | IndexHistoryPriceFormat = IndexHistoryPriceFormat.NDJSON, + format_: Unset | IndexHistoryPriceFormat = IndexHistoryPriceFormat.JSON, ) -> IndexHistoryPriceResponse200 | None: """ Price @@ -269,7 +269,7 @@ async def asyncio( start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. interval (IndexHistoryPriceInterval): Default: IndexHistoryPriceInterval.VALUE_4. - format_ (Unset | IndexHistoryPriceFormat): Default: IndexHistoryPriceFormat.NDJSON. + format_ (Unset | IndexHistoryPriceFormat): Default: IndexHistoryPriceFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/index/index_list_dates.py b/openapi_project/openapi_package/api/index/index_list_dates.py index 7db666853..abaf0bf4a 100644 --- a/openapi_project/openapi_package/api/index/index_list_dates.py +++ b/openapi_project/openapi_package/api/index/index_list_dates.py @@ -17,7 +17,7 @@ def _get_kwargs( *, symbol: list[str], - format_: Unset | IndexListDatesFormat = IndexListDatesFormat.NDJSON, + format_: Unset | IndexListDatesFormat = IndexListDatesFormat.JSON, ) -> dict[str, Any]: @@ -75,7 +75,7 @@ def sync_detailed( *, client: AuthenticatedClient | Client, symbol: list[str], - format_: Unset | IndexListDatesFormat = IndexListDatesFormat.NDJSON, + format_: Unset | IndexListDatesFormat = IndexListDatesFormat.JSON, ) -> Response[IndexListDatesResponse200]: """ Dates @@ -85,7 +85,7 @@ def sync_detailed( Args: symbol (list[str]): - format_ (Unset | IndexListDatesFormat): Default: IndexListDatesFormat.NDJSON. + format_ (Unset | IndexListDatesFormat): Default: IndexListDatesFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -112,7 +112,7 @@ def sync( *, client: AuthenticatedClient | Client, symbol: list[str], - format_: Unset | IndexListDatesFormat = IndexListDatesFormat.NDJSON, + format_: Unset | IndexListDatesFormat = IndexListDatesFormat.JSON, ) -> IndexListDatesResponse200 | None: """ Dates @@ -122,7 +122,7 @@ def sync( Args: symbol (list[str]): - format_ (Unset | IndexListDatesFormat): Default: IndexListDatesFormat.NDJSON. + format_ (Unset | IndexListDatesFormat): Default: IndexListDatesFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -144,7 +144,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient | Client, symbol: list[str], - format_: Unset | IndexListDatesFormat = IndexListDatesFormat.NDJSON, + format_: Unset | IndexListDatesFormat = IndexListDatesFormat.JSON, ) -> Response[IndexListDatesResponse200]: """ Dates @@ -154,7 +154,7 @@ async def asyncio_detailed( Args: symbol (list[str]): - format_ (Unset | IndexListDatesFormat): Default: IndexListDatesFormat.NDJSON. + format_ (Unset | IndexListDatesFormat): Default: IndexListDatesFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -181,7 +181,7 @@ async def asyncio( *, client: AuthenticatedClient | Client, symbol: list[str], - format_: Unset | IndexListDatesFormat = IndexListDatesFormat.NDJSON, + format_: Unset | IndexListDatesFormat = IndexListDatesFormat.JSON, ) -> IndexListDatesResponse200 | None: """ Dates @@ -191,7 +191,7 @@ async def asyncio( Args: symbol (list[str]): - format_ (Unset | IndexListDatesFormat): Default: IndexListDatesFormat.NDJSON. + format_ (Unset | IndexListDatesFormat): Default: IndexListDatesFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/index/index_list_symbols.py b/openapi_project/openapi_package/api/index/index_list_symbols.py index aaef70cf5..9b4d5f212 100644 --- a/openapi_project/openapi_package/api/index/index_list_symbols.py +++ b/openapi_project/openapi_package/api/index/index_list_symbols.py @@ -16,7 +16,7 @@ def _get_kwargs( *, - format_: Unset | IndexListSymbolsFormat = IndexListSymbolsFormat.NDJSON, + format_: Unset | IndexListSymbolsFormat = IndexListSymbolsFormat.JSON, ) -> dict[str, Any]: @@ -68,7 +68,7 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient | Client, - format_: Unset | IndexListSymbolsFormat = IndexListSymbolsFormat.NDJSON, + format_: Unset | IndexListSymbolsFormat = IndexListSymbolsFormat.JSON, ) -> Response[IndexListSymbolsResponse200]: """ Symbols @@ -78,7 +78,7 @@ def sync_detailed( endpoint is updated overnight. Args: - format_ (Unset | IndexListSymbolsFormat): Default: IndexListSymbolsFormat.NDJSON. + format_ (Unset | IndexListSymbolsFormat): Default: IndexListSymbolsFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -103,7 +103,7 @@ def sync_detailed( def sync( *, client: AuthenticatedClient | Client, - format_: Unset | IndexListSymbolsFormat = IndexListSymbolsFormat.NDJSON, + format_: Unset | IndexListSymbolsFormat = IndexListSymbolsFormat.JSON, ) -> IndexListSymbolsResponse200 | None: """ Symbols @@ -113,7 +113,7 @@ def sync( endpoint is updated overnight. Args: - format_ (Unset | IndexListSymbolsFormat): Default: IndexListSymbolsFormat.NDJSON. + format_ (Unset | IndexListSymbolsFormat): Default: IndexListSymbolsFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -133,7 +133,7 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient | Client, - format_: Unset | IndexListSymbolsFormat = IndexListSymbolsFormat.NDJSON, + format_: Unset | IndexListSymbolsFormat = IndexListSymbolsFormat.JSON, ) -> Response[IndexListSymbolsResponse200]: """ Symbols @@ -143,7 +143,7 @@ async def asyncio_detailed( endpoint is updated overnight. Args: - format_ (Unset | IndexListSymbolsFormat): Default: IndexListSymbolsFormat.NDJSON. + format_ (Unset | IndexListSymbolsFormat): Default: IndexListSymbolsFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -168,7 +168,7 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient | Client, - format_: Unset | IndexListSymbolsFormat = IndexListSymbolsFormat.NDJSON, + format_: Unset | IndexListSymbolsFormat = IndexListSymbolsFormat.JSON, ) -> IndexListSymbolsResponse200 | None: """ Symbols @@ -178,7 +178,7 @@ async def asyncio( endpoint is updated overnight. Args: - format_ (Unset | IndexListSymbolsFormat): Default: IndexListSymbolsFormat.NDJSON. + format_ (Unset | IndexListSymbolsFormat): Default: IndexListSymbolsFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/index/index_snapshot_ohlc.py b/openapi_project/openapi_package/api/index/index_snapshot_ohlc.py index 6a58a68ab..be4931b22 100644 --- a/openapi_project/openapi_package/api/index/index_snapshot_ohlc.py +++ b/openapi_project/openapi_package/api/index/index_snapshot_ohlc.py @@ -17,7 +17,7 @@ def _get_kwargs( *, symbol: list[str], - format_: Unset | IndexSnapshotOhlcFormat = IndexSnapshotOhlcFormat.NDJSON, + format_: Unset | IndexSnapshotOhlcFormat = IndexSnapshotOhlcFormat.JSON, ) -> dict[str, Any]: @@ -75,7 +75,7 @@ def sync_detailed( *, client: AuthenticatedClient | Client, symbol: list[str], - format_: Unset | IndexSnapshotOhlcFormat = IndexSnapshotOhlcFormat.NDJSON, + format_: Unset | IndexSnapshotOhlcFormat = IndexSnapshotOhlcFormat.JSON, ) -> Response[IndexSnapshotOhlcResponse200]: """ Open High Low Close @@ -86,7 +86,7 @@ def sync_detailed( Args: symbol (list[str]): - format_ (Unset | IndexSnapshotOhlcFormat): Default: IndexSnapshotOhlcFormat.NDJSON. + format_ (Unset | IndexSnapshotOhlcFormat): Default: IndexSnapshotOhlcFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -113,7 +113,7 @@ def sync( *, client: AuthenticatedClient | Client, symbol: list[str], - format_: Unset | IndexSnapshotOhlcFormat = IndexSnapshotOhlcFormat.NDJSON, + format_: Unset | IndexSnapshotOhlcFormat = IndexSnapshotOhlcFormat.JSON, ) -> IndexSnapshotOhlcResponse200 | None: """ Open High Low Close @@ -124,7 +124,7 @@ def sync( Args: symbol (list[str]): - format_ (Unset | IndexSnapshotOhlcFormat): Default: IndexSnapshotOhlcFormat.NDJSON. + format_ (Unset | IndexSnapshotOhlcFormat): Default: IndexSnapshotOhlcFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -146,7 +146,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient | Client, symbol: list[str], - format_: Unset | IndexSnapshotOhlcFormat = IndexSnapshotOhlcFormat.NDJSON, + format_: Unset | IndexSnapshotOhlcFormat = IndexSnapshotOhlcFormat.JSON, ) -> Response[IndexSnapshotOhlcResponse200]: """ Open High Low Close @@ -157,7 +157,7 @@ async def asyncio_detailed( Args: symbol (list[str]): - format_ (Unset | IndexSnapshotOhlcFormat): Default: IndexSnapshotOhlcFormat.NDJSON. + format_ (Unset | IndexSnapshotOhlcFormat): Default: IndexSnapshotOhlcFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -184,7 +184,7 @@ async def asyncio( *, client: AuthenticatedClient | Client, symbol: list[str], - format_: Unset | IndexSnapshotOhlcFormat = IndexSnapshotOhlcFormat.NDJSON, + format_: Unset | IndexSnapshotOhlcFormat = IndexSnapshotOhlcFormat.JSON, ) -> IndexSnapshotOhlcResponse200 | None: """ Open High Low Close @@ -195,7 +195,7 @@ async def asyncio( Args: symbol (list[str]): - format_ (Unset | IndexSnapshotOhlcFormat): Default: IndexSnapshotOhlcFormat.NDJSON. + format_ (Unset | IndexSnapshotOhlcFormat): Default: IndexSnapshotOhlcFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/index/index_snapshot_price.py b/openapi_project/openapi_package/api/index/index_snapshot_price.py index 620f9c67e..19e3c0d8d 100644 --- a/openapi_project/openapi_package/api/index/index_snapshot_price.py +++ b/openapi_project/openapi_package/api/index/index_snapshot_price.py @@ -17,7 +17,7 @@ def _get_kwargs( *, symbol: list[str], - format_: Unset | IndexSnapshotPriceFormat = IndexSnapshotPriceFormat.NDJSON, + format_: Unset | IndexSnapshotPriceFormat = IndexSnapshotPriceFormat.JSON, ) -> dict[str, Any]: @@ -75,7 +75,7 @@ def sync_detailed( *, client: AuthenticatedClient | Client, symbol: list[str], - format_: Unset | IndexSnapshotPriceFormat = IndexSnapshotPriceFormat.NDJSON, + format_: Unset | IndexSnapshotPriceFormat = IndexSnapshotPriceFormat.JSON, ) -> Response[IndexSnapshotPriceResponse200]: """ Price @@ -86,7 +86,7 @@ def sync_detailed( Args: symbol (list[str]): - format_ (Unset | IndexSnapshotPriceFormat): Default: IndexSnapshotPriceFormat.NDJSON. + format_ (Unset | IndexSnapshotPriceFormat): Default: IndexSnapshotPriceFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -113,7 +113,7 @@ def sync( *, client: AuthenticatedClient | Client, symbol: list[str], - format_: Unset | IndexSnapshotPriceFormat = IndexSnapshotPriceFormat.NDJSON, + format_: Unset | IndexSnapshotPriceFormat = IndexSnapshotPriceFormat.JSON, ) -> IndexSnapshotPriceResponse200 | None: """ Price @@ -124,7 +124,7 @@ def sync( Args: symbol (list[str]): - format_ (Unset | IndexSnapshotPriceFormat): Default: IndexSnapshotPriceFormat.NDJSON. + format_ (Unset | IndexSnapshotPriceFormat): Default: IndexSnapshotPriceFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -146,7 +146,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient | Client, symbol: list[str], - format_: Unset | IndexSnapshotPriceFormat = IndexSnapshotPriceFormat.NDJSON, + format_: Unset | IndexSnapshotPriceFormat = IndexSnapshotPriceFormat.JSON, ) -> Response[IndexSnapshotPriceResponse200]: """ Price @@ -157,7 +157,7 @@ async def asyncio_detailed( Args: symbol (list[str]): - format_ (Unset | IndexSnapshotPriceFormat): Default: IndexSnapshotPriceFormat.NDJSON. + format_ (Unset | IndexSnapshotPriceFormat): Default: IndexSnapshotPriceFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -184,7 +184,7 @@ async def asyncio( *, client: AuthenticatedClient | Client, symbol: list[str], - format_: Unset | IndexSnapshotPriceFormat = IndexSnapshotPriceFormat.NDJSON, + format_: Unset | IndexSnapshotPriceFormat = IndexSnapshotPriceFormat.JSON, ) -> IndexSnapshotPriceResponse200 | None: """ Price @@ -195,7 +195,7 @@ async def asyncio( Args: symbol (list[str]): - format_ (Unset | IndexSnapshotPriceFormat): Default: IndexSnapshotPriceFormat.NDJSON. + format_ (Unset | IndexSnapshotPriceFormat): Default: IndexSnapshotPriceFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_at_time_quote.py b/openapi_project/openapi_package/api/option/option_at_time_quote.py index 1bc767b2b..a885f3541 100644 --- a/openapi_project/openapi_package/api/option/option_at_time_quote.py +++ b/openapi_project/openapi_package/api/option/option_at_time_quote.py @@ -26,7 +26,7 @@ def _get_kwargs( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionAtTimeQuoteRight = OptionAtTimeQuoteRight.BOTH, - format_: Unset | OptionAtTimeQuoteFormat = OptionAtTimeQuoteFormat.NDJSON, + format_: Unset | OptionAtTimeQuoteFormat = OptionAtTimeQuoteFormat.JSON, ) -> dict[str, Any]: @@ -104,7 +104,7 @@ def sync_detailed( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionAtTimeQuoteRight = OptionAtTimeQuoteRight.BOTH, - format_: Unset | OptionAtTimeQuoteFormat = OptionAtTimeQuoteFormat.NDJSON, + format_: Unset | OptionAtTimeQuoteFormat = OptionAtTimeQuoteFormat.JSON, ) -> Response[OptionAtTimeQuoteResponse200]: """ Quote @@ -121,7 +121,7 @@ def sync_detailed( expiration (datetime.date): strike (Unset | str): Default: '*'. right (Unset | OptionAtTimeQuoteRight): Default: OptionAtTimeQuoteRight.BOTH. - format_ (Unset | OptionAtTimeQuoteFormat): Default: OptionAtTimeQuoteFormat.NDJSON. + format_ (Unset | OptionAtTimeQuoteFormat): Default: OptionAtTimeQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -160,7 +160,7 @@ def sync( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionAtTimeQuoteRight = OptionAtTimeQuoteRight.BOTH, - format_: Unset | OptionAtTimeQuoteFormat = OptionAtTimeQuoteFormat.NDJSON, + format_: Unset | OptionAtTimeQuoteFormat = OptionAtTimeQuoteFormat.JSON, ) -> OptionAtTimeQuoteResponse200 | None: """ Quote @@ -177,7 +177,7 @@ def sync( expiration (datetime.date): strike (Unset | str): Default: '*'. right (Unset | OptionAtTimeQuoteRight): Default: OptionAtTimeQuoteRight.BOTH. - format_ (Unset | OptionAtTimeQuoteFormat): Default: OptionAtTimeQuoteFormat.NDJSON. + format_ (Unset | OptionAtTimeQuoteFormat): Default: OptionAtTimeQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -211,7 +211,7 @@ async def asyncio_detailed( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionAtTimeQuoteRight = OptionAtTimeQuoteRight.BOTH, - format_: Unset | OptionAtTimeQuoteFormat = OptionAtTimeQuoteFormat.NDJSON, + format_: Unset | OptionAtTimeQuoteFormat = OptionAtTimeQuoteFormat.JSON, ) -> Response[OptionAtTimeQuoteResponse200]: """ Quote @@ -228,7 +228,7 @@ async def asyncio_detailed( expiration (datetime.date): strike (Unset | str): Default: '*'. right (Unset | OptionAtTimeQuoteRight): Default: OptionAtTimeQuoteRight.BOTH. - format_ (Unset | OptionAtTimeQuoteFormat): Default: OptionAtTimeQuoteFormat.NDJSON. + format_ (Unset | OptionAtTimeQuoteFormat): Default: OptionAtTimeQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -267,7 +267,7 @@ async def asyncio( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionAtTimeQuoteRight = OptionAtTimeQuoteRight.BOTH, - format_: Unset | OptionAtTimeQuoteFormat = OptionAtTimeQuoteFormat.NDJSON, + format_: Unset | OptionAtTimeQuoteFormat = OptionAtTimeQuoteFormat.JSON, ) -> OptionAtTimeQuoteResponse200 | None: """ Quote @@ -284,7 +284,7 @@ async def asyncio( expiration (datetime.date): strike (Unset | str): Default: '*'. right (Unset | OptionAtTimeQuoteRight): Default: OptionAtTimeQuoteRight.BOTH. - format_ (Unset | OptionAtTimeQuoteFormat): Default: OptionAtTimeQuoteFormat.NDJSON. + format_ (Unset | OptionAtTimeQuoteFormat): Default: OptionAtTimeQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_at_time_trade.py b/openapi_project/openapi_package/api/option/option_at_time_trade.py index 773cb6b39..fac67967e 100644 --- a/openapi_project/openapi_package/api/option/option_at_time_trade.py +++ b/openapi_project/openapi_package/api/option/option_at_time_trade.py @@ -26,7 +26,7 @@ def _get_kwargs( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionAtTimeTradeRight = OptionAtTimeTradeRight.BOTH, - format_: Unset | OptionAtTimeTradeFormat = OptionAtTimeTradeFormat.NDJSON, + format_: Unset | OptionAtTimeTradeFormat = OptionAtTimeTradeFormat.JSON, ) -> dict[str, Any]: @@ -104,7 +104,7 @@ def sync_detailed( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionAtTimeTradeRight = OptionAtTimeTradeRight.BOTH, - format_: Unset | OptionAtTimeTradeFormat = OptionAtTimeTradeFormat.NDJSON, + format_: Unset | OptionAtTimeTradeFormat = OptionAtTimeTradeFormat.JSON, ) -> Response[OptionAtTimeTradeResponse200]: """ Trade @@ -125,7 +125,7 @@ def sync_detailed( expiration (datetime.date): strike (Unset | str): Default: '*'. right (Unset | OptionAtTimeTradeRight): Default: OptionAtTimeTradeRight.BOTH. - format_ (Unset | OptionAtTimeTradeFormat): Default: OptionAtTimeTradeFormat.NDJSON. + format_ (Unset | OptionAtTimeTradeFormat): Default: OptionAtTimeTradeFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -164,7 +164,7 @@ def sync( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionAtTimeTradeRight = OptionAtTimeTradeRight.BOTH, - format_: Unset | OptionAtTimeTradeFormat = OptionAtTimeTradeFormat.NDJSON, + format_: Unset | OptionAtTimeTradeFormat = OptionAtTimeTradeFormat.JSON, ) -> OptionAtTimeTradeResponse200 | None: """ Trade @@ -185,7 +185,7 @@ def sync( expiration (datetime.date): strike (Unset | str): Default: '*'. right (Unset | OptionAtTimeTradeRight): Default: OptionAtTimeTradeRight.BOTH. - format_ (Unset | OptionAtTimeTradeFormat): Default: OptionAtTimeTradeFormat.NDJSON. + format_ (Unset | OptionAtTimeTradeFormat): Default: OptionAtTimeTradeFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -219,7 +219,7 @@ async def asyncio_detailed( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionAtTimeTradeRight = OptionAtTimeTradeRight.BOTH, - format_: Unset | OptionAtTimeTradeFormat = OptionAtTimeTradeFormat.NDJSON, + format_: Unset | OptionAtTimeTradeFormat = OptionAtTimeTradeFormat.JSON, ) -> Response[OptionAtTimeTradeResponse200]: """ Trade @@ -240,7 +240,7 @@ async def asyncio_detailed( expiration (datetime.date): strike (Unset | str): Default: '*'. right (Unset | OptionAtTimeTradeRight): Default: OptionAtTimeTradeRight.BOTH. - format_ (Unset | OptionAtTimeTradeFormat): Default: OptionAtTimeTradeFormat.NDJSON. + format_ (Unset | OptionAtTimeTradeFormat): Default: OptionAtTimeTradeFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -279,7 +279,7 @@ async def asyncio( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionAtTimeTradeRight = OptionAtTimeTradeRight.BOTH, - format_: Unset | OptionAtTimeTradeFormat = OptionAtTimeTradeFormat.NDJSON, + format_: Unset | OptionAtTimeTradeFormat = OptionAtTimeTradeFormat.JSON, ) -> OptionAtTimeTradeResponse200 | None: """ Trade @@ -300,7 +300,7 @@ async def asyncio( expiration (datetime.date): strike (Unset | str): Default: '*'. right (Unset | OptionAtTimeTradeRight): Default: OptionAtTimeTradeRight.BOTH. - format_ (Unset | OptionAtTimeTradeFormat): Default: OptionAtTimeTradeFormat.NDJSON. + format_ (Unset | OptionAtTimeTradeFormat): Default: OptionAtTimeTradeFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_history_eod.py b/openapi_project/openapi_package/api/option/option_history_eod.py index 1aa4a5912..23df3b761 100644 --- a/openapi_project/openapi_package/api/option/option_history_eod.py +++ b/openapi_project/openapi_package/api/option/option_history_eod.py @@ -25,7 +25,7 @@ def _get_kwargs( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionHistoryEodRight = OptionHistoryEodRight.BOTH, - format_: Unset | OptionHistoryEodFormat = OptionHistoryEodFormat.NDJSON, + format_: Unset | OptionHistoryEodFormat = OptionHistoryEodFormat.JSON, ) -> dict[str, Any]: @@ -100,7 +100,7 @@ def sync_detailed( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionHistoryEodRight = OptionHistoryEodRight.BOTH, - format_: Unset | OptionHistoryEodFormat = OptionHistoryEodFormat.NDJSON, + format_: Unset | OptionHistoryEodFormat = OptionHistoryEodFormat.JSON, ) -> Response[OptionHistoryEodResponse200]: """ End of Day @@ -122,7 +122,7 @@ def sync_detailed( expiration (datetime.date): strike (Unset | str): Default: '*'. right (Unset | OptionHistoryEodRight): Default: OptionHistoryEodRight.BOTH. - format_ (Unset | OptionHistoryEodFormat): Default: OptionHistoryEodFormat.NDJSON. + format_ (Unset | OptionHistoryEodFormat): Default: OptionHistoryEodFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -159,7 +159,7 @@ def sync( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionHistoryEodRight = OptionHistoryEodRight.BOTH, - format_: Unset | OptionHistoryEodFormat = OptionHistoryEodFormat.NDJSON, + format_: Unset | OptionHistoryEodFormat = OptionHistoryEodFormat.JSON, ) -> OptionHistoryEodResponse200 | None: """ End of Day @@ -181,7 +181,7 @@ def sync( expiration (datetime.date): strike (Unset | str): Default: '*'. right (Unset | OptionHistoryEodRight): Default: OptionHistoryEodRight.BOTH. - format_ (Unset | OptionHistoryEodFormat): Default: OptionHistoryEodFormat.NDJSON. + format_ (Unset | OptionHistoryEodFormat): Default: OptionHistoryEodFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -213,7 +213,7 @@ async def asyncio_detailed( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionHistoryEodRight = OptionHistoryEodRight.BOTH, - format_: Unset | OptionHistoryEodFormat = OptionHistoryEodFormat.NDJSON, + format_: Unset | OptionHistoryEodFormat = OptionHistoryEodFormat.JSON, ) -> Response[OptionHistoryEodResponse200]: """ End of Day @@ -235,7 +235,7 @@ async def asyncio_detailed( expiration (datetime.date): strike (Unset | str): Default: '*'. right (Unset | OptionHistoryEodRight): Default: OptionHistoryEodRight.BOTH. - format_ (Unset | OptionHistoryEodFormat): Default: OptionHistoryEodFormat.NDJSON. + format_ (Unset | OptionHistoryEodFormat): Default: OptionHistoryEodFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -272,7 +272,7 @@ async def asyncio( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionHistoryEodRight = OptionHistoryEodRight.BOTH, - format_: Unset | OptionHistoryEodFormat = OptionHistoryEodFormat.NDJSON, + format_: Unset | OptionHistoryEodFormat = OptionHistoryEodFormat.JSON, ) -> OptionHistoryEodResponse200 | None: """ End of Day @@ -294,7 +294,7 @@ async def asyncio( expiration (datetime.date): strike (Unset | str): Default: '*'. right (Unset | OptionHistoryEodRight): Default: OptionHistoryEodRight.BOTH. - format_ (Unset | OptionHistoryEodFormat): Default: OptionHistoryEodFormat.NDJSON. + format_ (Unset | OptionHistoryEodFormat): Default: OptionHistoryEodFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_history_greeks_all.py b/openapi_project/openapi_package/api/option/option_history_greeks_all.py index 47eac34b3..ecd86a20b 100644 --- a/openapi_project/openapi_package/api/option/option_history_greeks_all.py +++ b/openapi_project/openapi_package/api/option/option_history_greeks_all.py @@ -32,7 +32,7 @@ def _get_kwargs( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksAllRateType = OptionHistoryGreeksAllRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksAllFormat = OptionHistoryGreeksAllFormat.NDJSON, + format_: Unset | OptionHistoryGreeksAllFormat = OptionHistoryGreeksAllFormat.JSON, ) -> dict[str, Any]: @@ -124,7 +124,7 @@ def sync_detailed( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksAllRateType = OptionHistoryGreeksAllRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksAllFormat = OptionHistoryGreeksAllFormat.NDJSON, + format_: Unset | OptionHistoryGreeksAllFormat = OptionHistoryGreeksAllFormat.JSON, ) -> Response[OptionHistoryGreeksAllResponse200]: """ All Greeks @@ -152,7 +152,7 @@ def sync_detailed( OptionHistoryGreeksAllRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryGreeksAllFormat): Default: - OptionHistoryGreeksAllFormat.NDJSON. + OptionHistoryGreeksAllFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -199,7 +199,7 @@ def sync( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksAllRateType = OptionHistoryGreeksAllRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksAllFormat = OptionHistoryGreeksAllFormat.NDJSON, + format_: Unset | OptionHistoryGreeksAllFormat = OptionHistoryGreeksAllFormat.JSON, ) -> OptionHistoryGreeksAllResponse200 | None: """ All Greeks @@ -227,7 +227,7 @@ def sync( OptionHistoryGreeksAllRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryGreeksAllFormat): Default: - OptionHistoryGreeksAllFormat.NDJSON. + OptionHistoryGreeksAllFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -269,7 +269,7 @@ async def asyncio_detailed( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksAllRateType = OptionHistoryGreeksAllRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksAllFormat = OptionHistoryGreeksAllFormat.NDJSON, + format_: Unset | OptionHistoryGreeksAllFormat = OptionHistoryGreeksAllFormat.JSON, ) -> Response[OptionHistoryGreeksAllResponse200]: """ All Greeks @@ -297,7 +297,7 @@ async def asyncio_detailed( OptionHistoryGreeksAllRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryGreeksAllFormat): Default: - OptionHistoryGreeksAllFormat.NDJSON. + OptionHistoryGreeksAllFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -344,7 +344,7 @@ async def asyncio( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksAllRateType = OptionHistoryGreeksAllRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksAllFormat = OptionHistoryGreeksAllFormat.NDJSON, + format_: Unset | OptionHistoryGreeksAllFormat = OptionHistoryGreeksAllFormat.JSON, ) -> OptionHistoryGreeksAllResponse200 | None: """ All Greeks @@ -372,7 +372,7 @@ async def asyncio( OptionHistoryGreeksAllRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryGreeksAllFormat): Default: - OptionHistoryGreeksAllFormat.NDJSON. + OptionHistoryGreeksAllFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_history_greeks_eod.py b/openapi_project/openapi_package/api/option/option_history_greeks_eod.py index 98144ba85..b66fd3f2d 100644 --- a/openapi_project/openapi_package/api/option/option_history_greeks_eod.py +++ b/openapi_project/openapi_package/api/option/option_history_greeks_eod.py @@ -29,7 +29,7 @@ def _get_kwargs( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksEodRateType = OptionHistoryGreeksEodRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksEodFormat = OptionHistoryGreeksEodFormat.NDJSON, + format_: Unset | OptionHistoryGreeksEodFormat = OptionHistoryGreeksEodFormat.JSON, ) -> dict[str, Any]: @@ -115,7 +115,7 @@ def sync_detailed( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksEodRateType = OptionHistoryGreeksEodRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksEodFormat = OptionHistoryGreeksEodFormat.NDJSON, + format_: Unset | OptionHistoryGreeksEodFormat = OptionHistoryGreeksEodFormat.JSON, ) -> Response[OptionHistoryGreeksEodResponse200]: """ End of Day Greeks @@ -141,7 +141,7 @@ def sync_detailed( OptionHistoryGreeksEodRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryGreeksEodFormat): Default: - OptionHistoryGreeksEodFormat.NDJSON. + OptionHistoryGreeksEodFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -184,7 +184,7 @@ def sync( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksEodRateType = OptionHistoryGreeksEodRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksEodFormat = OptionHistoryGreeksEodFormat.NDJSON, + format_: Unset | OptionHistoryGreeksEodFormat = OptionHistoryGreeksEodFormat.JSON, ) -> OptionHistoryGreeksEodResponse200 | None: """ End of Day Greeks @@ -210,7 +210,7 @@ def sync( OptionHistoryGreeksEodRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryGreeksEodFormat): Default: - OptionHistoryGreeksEodFormat.NDJSON. + OptionHistoryGreeksEodFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -248,7 +248,7 @@ async def asyncio_detailed( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksEodRateType = OptionHistoryGreeksEodRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksEodFormat = OptionHistoryGreeksEodFormat.NDJSON, + format_: Unset | OptionHistoryGreeksEodFormat = OptionHistoryGreeksEodFormat.JSON, ) -> Response[OptionHistoryGreeksEodResponse200]: """ End of Day Greeks @@ -274,7 +274,7 @@ async def asyncio_detailed( OptionHistoryGreeksEodRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryGreeksEodFormat): Default: - OptionHistoryGreeksEodFormat.NDJSON. + OptionHistoryGreeksEodFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -317,7 +317,7 @@ async def asyncio( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksEodRateType = OptionHistoryGreeksEodRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksEodFormat = OptionHistoryGreeksEodFormat.NDJSON, + format_: Unset | OptionHistoryGreeksEodFormat = OptionHistoryGreeksEodFormat.JSON, ) -> OptionHistoryGreeksEodResponse200 | None: """ End of Day Greeks @@ -343,7 +343,7 @@ async def asyncio( OptionHistoryGreeksEodRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryGreeksEodFormat): Default: - OptionHistoryGreeksEodFormat.NDJSON. + OptionHistoryGreeksEodFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_history_greeks_first_order.py b/openapi_project/openapi_package/api/option/option_history_greeks_first_order.py index 45dc6da48..7eeb8d914 100644 --- a/openapi_project/openapi_package/api/option/option_history_greeks_first_order.py +++ b/openapi_project/openapi_package/api/option/option_history_greeks_first_order.py @@ -32,7 +32,7 @@ def _get_kwargs( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksFirstOrderRateType = OptionHistoryGreeksFirstOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksFirstOrderFormat = OptionHistoryGreeksFirstOrderFormat.NDJSON, + format_: Unset | OptionHistoryGreeksFirstOrderFormat = OptionHistoryGreeksFirstOrderFormat.JSON, ) -> dict[str, Any]: @@ -124,7 +124,7 @@ def sync_detailed( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksFirstOrderRateType = OptionHistoryGreeksFirstOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksFirstOrderFormat = OptionHistoryGreeksFirstOrderFormat.NDJSON, + format_: Unset | OptionHistoryGreeksFirstOrderFormat = OptionHistoryGreeksFirstOrderFormat.JSON, ) -> Response[OptionHistoryGreeksFirstOrderResponse200]: """ First Order Greeks @@ -153,7 +153,7 @@ def sync_detailed( OptionHistoryGreeksFirstOrderRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryGreeksFirstOrderFormat): Default: - OptionHistoryGreeksFirstOrderFormat.NDJSON. + OptionHistoryGreeksFirstOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -200,7 +200,7 @@ def sync( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksFirstOrderRateType = OptionHistoryGreeksFirstOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksFirstOrderFormat = OptionHistoryGreeksFirstOrderFormat.NDJSON, + format_: Unset | OptionHistoryGreeksFirstOrderFormat = OptionHistoryGreeksFirstOrderFormat.JSON, ) -> OptionHistoryGreeksFirstOrderResponse200 | None: """ First Order Greeks @@ -229,7 +229,7 @@ def sync( OptionHistoryGreeksFirstOrderRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryGreeksFirstOrderFormat): Default: - OptionHistoryGreeksFirstOrderFormat.NDJSON. + OptionHistoryGreeksFirstOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -271,7 +271,7 @@ async def asyncio_detailed( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksFirstOrderRateType = OptionHistoryGreeksFirstOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksFirstOrderFormat = OptionHistoryGreeksFirstOrderFormat.NDJSON, + format_: Unset | OptionHistoryGreeksFirstOrderFormat = OptionHistoryGreeksFirstOrderFormat.JSON, ) -> Response[OptionHistoryGreeksFirstOrderResponse200]: """ First Order Greeks @@ -300,7 +300,7 @@ async def asyncio_detailed( OptionHistoryGreeksFirstOrderRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryGreeksFirstOrderFormat): Default: - OptionHistoryGreeksFirstOrderFormat.NDJSON. + OptionHistoryGreeksFirstOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -347,7 +347,7 @@ async def asyncio( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksFirstOrderRateType = OptionHistoryGreeksFirstOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksFirstOrderFormat = OptionHistoryGreeksFirstOrderFormat.NDJSON, + format_: Unset | OptionHistoryGreeksFirstOrderFormat = OptionHistoryGreeksFirstOrderFormat.JSON, ) -> OptionHistoryGreeksFirstOrderResponse200 | None: """ First Order Greeks @@ -376,7 +376,7 @@ async def asyncio( OptionHistoryGreeksFirstOrderRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryGreeksFirstOrderFormat): Default: - OptionHistoryGreeksFirstOrderFormat.NDJSON. + OptionHistoryGreeksFirstOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_history_greeks_implied_volatility.py b/openapi_project/openapi_package/api/option/option_history_greeks_implied_volatility.py index 7ca92c423..44c06eb4f 100644 --- a/openapi_project/openapi_package/api/option/option_history_greeks_implied_volatility.py +++ b/openapi_project/openapi_package/api/option/option_history_greeks_implied_volatility.py @@ -32,7 +32,7 @@ def _get_kwargs( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksImpliedVolatilityRateType = OptionHistoryGreeksImpliedVolatilityRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksImpliedVolatilityFormat = OptionHistoryGreeksImpliedVolatilityFormat.NDJSON, + format_: Unset | OptionHistoryGreeksImpliedVolatilityFormat = OptionHistoryGreeksImpliedVolatilityFormat.JSON, ) -> dict[str, Any]: @@ -124,7 +124,7 @@ def sync_detailed( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksImpliedVolatilityRateType = OptionHistoryGreeksImpliedVolatilityRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksImpliedVolatilityFormat = OptionHistoryGreeksImpliedVolatilityFormat.NDJSON, + format_: Unset | OptionHistoryGreeksImpliedVolatilityFormat = OptionHistoryGreeksImpliedVolatilityFormat.JSON, ) -> Response[OptionHistoryGreeksImpliedVolatilityResponse200]: """ Implied Volatility @@ -151,7 +151,7 @@ def sync_detailed( OptionHistoryGreeksImpliedVolatilityRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryGreeksImpliedVolatilityFormat): Default: - OptionHistoryGreeksImpliedVolatilityFormat.NDJSON. + OptionHistoryGreeksImpliedVolatilityFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -198,7 +198,7 @@ def sync( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksImpliedVolatilityRateType = OptionHistoryGreeksImpliedVolatilityRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksImpliedVolatilityFormat = OptionHistoryGreeksImpliedVolatilityFormat.NDJSON, + format_: Unset | OptionHistoryGreeksImpliedVolatilityFormat = OptionHistoryGreeksImpliedVolatilityFormat.JSON, ) -> OptionHistoryGreeksImpliedVolatilityResponse200 | None: """ Implied Volatility @@ -225,7 +225,7 @@ def sync( OptionHistoryGreeksImpliedVolatilityRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryGreeksImpliedVolatilityFormat): Default: - OptionHistoryGreeksImpliedVolatilityFormat.NDJSON. + OptionHistoryGreeksImpliedVolatilityFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -267,7 +267,7 @@ async def asyncio_detailed( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksImpliedVolatilityRateType = OptionHistoryGreeksImpliedVolatilityRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksImpliedVolatilityFormat = OptionHistoryGreeksImpliedVolatilityFormat.NDJSON, + format_: Unset | OptionHistoryGreeksImpliedVolatilityFormat = OptionHistoryGreeksImpliedVolatilityFormat.JSON, ) -> Response[OptionHistoryGreeksImpliedVolatilityResponse200]: """ Implied Volatility @@ -294,7 +294,7 @@ async def asyncio_detailed( OptionHistoryGreeksImpliedVolatilityRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryGreeksImpliedVolatilityFormat): Default: - OptionHistoryGreeksImpliedVolatilityFormat.NDJSON. + OptionHistoryGreeksImpliedVolatilityFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -341,7 +341,7 @@ async def asyncio( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksImpliedVolatilityRateType = OptionHistoryGreeksImpliedVolatilityRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksImpliedVolatilityFormat = OptionHistoryGreeksImpliedVolatilityFormat.NDJSON, + format_: Unset | OptionHistoryGreeksImpliedVolatilityFormat = OptionHistoryGreeksImpliedVolatilityFormat.JSON, ) -> OptionHistoryGreeksImpliedVolatilityResponse200 | None: """ Implied Volatility @@ -368,7 +368,7 @@ async def asyncio( OptionHistoryGreeksImpliedVolatilityRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryGreeksImpliedVolatilityFormat): Default: - OptionHistoryGreeksImpliedVolatilityFormat.NDJSON. + OptionHistoryGreeksImpliedVolatilityFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_history_greeks_second_order.py b/openapi_project/openapi_package/api/option/option_history_greeks_second_order.py index 551fd3e27..10d39450c 100644 --- a/openapi_project/openapi_package/api/option/option_history_greeks_second_order.py +++ b/openapi_project/openapi_package/api/option/option_history_greeks_second_order.py @@ -32,7 +32,7 @@ def _get_kwargs( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksSecondOrderRateType = OptionHistoryGreeksSecondOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksSecondOrderFormat = OptionHistoryGreeksSecondOrderFormat.NDJSON, + format_: Unset | OptionHistoryGreeksSecondOrderFormat = OptionHistoryGreeksSecondOrderFormat.JSON, ) -> dict[str, Any]: @@ -124,7 +124,7 @@ def sync_detailed( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksSecondOrderRateType = OptionHistoryGreeksSecondOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksSecondOrderFormat = OptionHistoryGreeksSecondOrderFormat.NDJSON, + format_: Unset | OptionHistoryGreeksSecondOrderFormat = OptionHistoryGreeksSecondOrderFormat.JSON, ) -> Response[OptionHistoryGreeksSecondOrderResponse200]: """ Second Order Greeks @@ -153,7 +153,7 @@ def sync_detailed( OptionHistoryGreeksSecondOrderRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryGreeksSecondOrderFormat): Default: - OptionHistoryGreeksSecondOrderFormat.NDJSON. + OptionHistoryGreeksSecondOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -200,7 +200,7 @@ def sync( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksSecondOrderRateType = OptionHistoryGreeksSecondOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksSecondOrderFormat = OptionHistoryGreeksSecondOrderFormat.NDJSON, + format_: Unset | OptionHistoryGreeksSecondOrderFormat = OptionHistoryGreeksSecondOrderFormat.JSON, ) -> OptionHistoryGreeksSecondOrderResponse200 | None: """ Second Order Greeks @@ -229,7 +229,7 @@ def sync( OptionHistoryGreeksSecondOrderRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryGreeksSecondOrderFormat): Default: - OptionHistoryGreeksSecondOrderFormat.NDJSON. + OptionHistoryGreeksSecondOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -271,7 +271,7 @@ async def asyncio_detailed( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksSecondOrderRateType = OptionHistoryGreeksSecondOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksSecondOrderFormat = OptionHistoryGreeksSecondOrderFormat.NDJSON, + format_: Unset | OptionHistoryGreeksSecondOrderFormat = OptionHistoryGreeksSecondOrderFormat.JSON, ) -> Response[OptionHistoryGreeksSecondOrderResponse200]: """ Second Order Greeks @@ -300,7 +300,7 @@ async def asyncio_detailed( OptionHistoryGreeksSecondOrderRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryGreeksSecondOrderFormat): Default: - OptionHistoryGreeksSecondOrderFormat.NDJSON. + OptionHistoryGreeksSecondOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -347,7 +347,7 @@ async def asyncio( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksSecondOrderRateType = OptionHistoryGreeksSecondOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksSecondOrderFormat = OptionHistoryGreeksSecondOrderFormat.NDJSON, + format_: Unset | OptionHistoryGreeksSecondOrderFormat = OptionHistoryGreeksSecondOrderFormat.JSON, ) -> OptionHistoryGreeksSecondOrderResponse200 | None: """ Second Order Greeks @@ -376,7 +376,7 @@ async def asyncio( OptionHistoryGreeksSecondOrderRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryGreeksSecondOrderFormat): Default: - OptionHistoryGreeksSecondOrderFormat.NDJSON. + OptionHistoryGreeksSecondOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_history_greeks_third_order.py b/openapi_project/openapi_package/api/option/option_history_greeks_third_order.py index cfe14304a..4566df36e 100644 --- a/openapi_project/openapi_package/api/option/option_history_greeks_third_order.py +++ b/openapi_project/openapi_package/api/option/option_history_greeks_third_order.py @@ -32,7 +32,7 @@ def _get_kwargs( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksThirdOrderRateType = OptionHistoryGreeksThirdOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksThirdOrderFormat = OptionHistoryGreeksThirdOrderFormat.NDJSON, + format_: Unset | OptionHistoryGreeksThirdOrderFormat = OptionHistoryGreeksThirdOrderFormat.JSON, ) -> dict[str, Any]: @@ -124,7 +124,7 @@ def sync_detailed( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksThirdOrderRateType = OptionHistoryGreeksThirdOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksThirdOrderFormat = OptionHistoryGreeksThirdOrderFormat.NDJSON, + format_: Unset | OptionHistoryGreeksThirdOrderFormat = OptionHistoryGreeksThirdOrderFormat.JSON, ) -> Response[OptionHistoryGreeksThirdOrderResponse200]: """ Third Order Greeks @@ -153,7 +153,7 @@ def sync_detailed( OptionHistoryGreeksThirdOrderRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryGreeksThirdOrderFormat): Default: - OptionHistoryGreeksThirdOrderFormat.NDJSON. + OptionHistoryGreeksThirdOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -200,7 +200,7 @@ def sync( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksThirdOrderRateType = OptionHistoryGreeksThirdOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksThirdOrderFormat = OptionHistoryGreeksThirdOrderFormat.NDJSON, + format_: Unset | OptionHistoryGreeksThirdOrderFormat = OptionHistoryGreeksThirdOrderFormat.JSON, ) -> OptionHistoryGreeksThirdOrderResponse200 | None: """ Third Order Greeks @@ -229,7 +229,7 @@ def sync( OptionHistoryGreeksThirdOrderRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryGreeksThirdOrderFormat): Default: - OptionHistoryGreeksThirdOrderFormat.NDJSON. + OptionHistoryGreeksThirdOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -271,7 +271,7 @@ async def asyncio_detailed( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksThirdOrderRateType = OptionHistoryGreeksThirdOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksThirdOrderFormat = OptionHistoryGreeksThirdOrderFormat.NDJSON, + format_: Unset | OptionHistoryGreeksThirdOrderFormat = OptionHistoryGreeksThirdOrderFormat.JSON, ) -> Response[OptionHistoryGreeksThirdOrderResponse200]: """ Third Order Greeks @@ -300,7 +300,7 @@ async def asyncio_detailed( OptionHistoryGreeksThirdOrderRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryGreeksThirdOrderFormat): Default: - OptionHistoryGreeksThirdOrderFormat.NDJSON. + OptionHistoryGreeksThirdOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -347,7 +347,7 @@ async def asyncio( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryGreeksThirdOrderRateType = OptionHistoryGreeksThirdOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryGreeksThirdOrderFormat = OptionHistoryGreeksThirdOrderFormat.NDJSON, + format_: Unset | OptionHistoryGreeksThirdOrderFormat = OptionHistoryGreeksThirdOrderFormat.JSON, ) -> OptionHistoryGreeksThirdOrderResponse200 | None: """ Third Order Greeks @@ -376,7 +376,7 @@ async def asyncio( OptionHistoryGreeksThirdOrderRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryGreeksThirdOrderFormat): Default: - OptionHistoryGreeksThirdOrderFormat.NDJSON. + OptionHistoryGreeksThirdOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_history_ohlc.py b/openapi_project/openapi_package/api/option/option_history_ohlc.py index 4227cf608..7889fd312 100644 --- a/openapi_project/openapi_package/api/option/option_history_ohlc.py +++ b/openapi_project/openapi_package/api/option/option_history_ohlc.py @@ -28,7 +28,7 @@ def _get_kwargs( interval: OptionHistoryOhlcInterval = OptionHistoryOhlcInterval.VALUE_4, start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', - format_: Unset | OptionHistoryOhlcFormat = OptionHistoryOhlcFormat.NDJSON, + format_: Unset | OptionHistoryOhlcFormat = OptionHistoryOhlcFormat.JSON, ) -> dict[str, Any]: @@ -109,7 +109,7 @@ def sync_detailed( interval: OptionHistoryOhlcInterval = OptionHistoryOhlcInterval.VALUE_4, start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', - format_: Unset | OptionHistoryOhlcFormat = OptionHistoryOhlcFormat.NDJSON, + format_: Unset | OptionHistoryOhlcFormat = OptionHistoryOhlcFormat.JSON, ) -> Response[OptionHistoryOhlcResponse200]: """ Open High Low Close @@ -127,7 +127,7 @@ def sync_detailed( interval (OptionHistoryOhlcInterval): Default: OptionHistoryOhlcInterval.VALUE_4. start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. - format_ (Unset | OptionHistoryOhlcFormat): Default: OptionHistoryOhlcFormat.NDJSON. + format_ (Unset | OptionHistoryOhlcFormat): Default: OptionHistoryOhlcFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -168,7 +168,7 @@ def sync( interval: OptionHistoryOhlcInterval = OptionHistoryOhlcInterval.VALUE_4, start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', - format_: Unset | OptionHistoryOhlcFormat = OptionHistoryOhlcFormat.NDJSON, + format_: Unset | OptionHistoryOhlcFormat = OptionHistoryOhlcFormat.JSON, ) -> OptionHistoryOhlcResponse200 | None: """ Open High Low Close @@ -186,7 +186,7 @@ def sync( interval (OptionHistoryOhlcInterval): Default: OptionHistoryOhlcInterval.VALUE_4. start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. - format_ (Unset | OptionHistoryOhlcFormat): Default: OptionHistoryOhlcFormat.NDJSON. + format_ (Unset | OptionHistoryOhlcFormat): Default: OptionHistoryOhlcFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -222,7 +222,7 @@ async def asyncio_detailed( interval: OptionHistoryOhlcInterval = OptionHistoryOhlcInterval.VALUE_4, start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', - format_: Unset | OptionHistoryOhlcFormat = OptionHistoryOhlcFormat.NDJSON, + format_: Unset | OptionHistoryOhlcFormat = OptionHistoryOhlcFormat.JSON, ) -> Response[OptionHistoryOhlcResponse200]: """ Open High Low Close @@ -240,7 +240,7 @@ async def asyncio_detailed( interval (OptionHistoryOhlcInterval): Default: OptionHistoryOhlcInterval.VALUE_4. start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. - format_ (Unset | OptionHistoryOhlcFormat): Default: OptionHistoryOhlcFormat.NDJSON. + format_ (Unset | OptionHistoryOhlcFormat): Default: OptionHistoryOhlcFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -281,7 +281,7 @@ async def asyncio( interval: OptionHistoryOhlcInterval = OptionHistoryOhlcInterval.VALUE_4, start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', - format_: Unset | OptionHistoryOhlcFormat = OptionHistoryOhlcFormat.NDJSON, + format_: Unset | OptionHistoryOhlcFormat = OptionHistoryOhlcFormat.JSON, ) -> OptionHistoryOhlcResponse200 | None: """ Open High Low Close @@ -299,7 +299,7 @@ async def asyncio( interval (OptionHistoryOhlcInterval): Default: OptionHistoryOhlcInterval.VALUE_4. start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. - format_ (Unset | OptionHistoryOhlcFormat): Default: OptionHistoryOhlcFormat.NDJSON. + format_ (Unset | OptionHistoryOhlcFormat): Default: OptionHistoryOhlcFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_history_open_interest.py b/openapi_project/openapi_package/api/option/option_history_open_interest.py index aaf504ffb..37f433668 100644 --- a/openapi_project/openapi_package/api/option/option_history_open_interest.py +++ b/openapi_project/openapi_package/api/option/option_history_open_interest.py @@ -24,7 +24,7 @@ def _get_kwargs( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionHistoryOpenInterestRight = OptionHistoryOpenInterestRight.BOTH, - format_: Unset | OptionHistoryOpenInterestFormat = OptionHistoryOpenInterestFormat.NDJSON, + format_: Unset | OptionHistoryOpenInterestFormat = OptionHistoryOpenInterestFormat.JSON, ) -> dict[str, Any]: @@ -95,7 +95,7 @@ def sync_detailed( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionHistoryOpenInterestRight = OptionHistoryOpenInterestRight.BOTH, - format_: Unset | OptionHistoryOpenInterestFormat = OptionHistoryOpenInterestFormat.NDJSON, + format_: Unset | OptionHistoryOpenInterestFormat = OptionHistoryOpenInterestFormat.JSON, ) -> Response[OptionHistoryOpenInterestResponse200]: """ Open Interest @@ -114,7 +114,7 @@ def sync_detailed( right (Unset | OptionHistoryOpenInterestRight): Default: OptionHistoryOpenInterestRight.BOTH. format_ (Unset | OptionHistoryOpenInterestFormat): Default: - OptionHistoryOpenInterestFormat.NDJSON. + OptionHistoryOpenInterestFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -149,7 +149,7 @@ def sync( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionHistoryOpenInterestRight = OptionHistoryOpenInterestRight.BOTH, - format_: Unset | OptionHistoryOpenInterestFormat = OptionHistoryOpenInterestFormat.NDJSON, + format_: Unset | OptionHistoryOpenInterestFormat = OptionHistoryOpenInterestFormat.JSON, ) -> OptionHistoryOpenInterestResponse200 | None: """ Open Interest @@ -168,7 +168,7 @@ def sync( right (Unset | OptionHistoryOpenInterestRight): Default: OptionHistoryOpenInterestRight.BOTH. format_ (Unset | OptionHistoryOpenInterestFormat): Default: - OptionHistoryOpenInterestFormat.NDJSON. + OptionHistoryOpenInterestFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -198,7 +198,7 @@ async def asyncio_detailed( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionHistoryOpenInterestRight = OptionHistoryOpenInterestRight.BOTH, - format_: Unset | OptionHistoryOpenInterestFormat = OptionHistoryOpenInterestFormat.NDJSON, + format_: Unset | OptionHistoryOpenInterestFormat = OptionHistoryOpenInterestFormat.JSON, ) -> Response[OptionHistoryOpenInterestResponse200]: """ Open Interest @@ -217,7 +217,7 @@ async def asyncio_detailed( right (Unset | OptionHistoryOpenInterestRight): Default: OptionHistoryOpenInterestRight.BOTH. format_ (Unset | OptionHistoryOpenInterestFormat): Default: - OptionHistoryOpenInterestFormat.NDJSON. + OptionHistoryOpenInterestFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -252,7 +252,7 @@ async def asyncio( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionHistoryOpenInterestRight = OptionHistoryOpenInterestRight.BOTH, - format_: Unset | OptionHistoryOpenInterestFormat = OptionHistoryOpenInterestFormat.NDJSON, + format_: Unset | OptionHistoryOpenInterestFormat = OptionHistoryOpenInterestFormat.JSON, ) -> OptionHistoryOpenInterestResponse200 | None: """ Open Interest @@ -271,7 +271,7 @@ async def asyncio( right (Unset | OptionHistoryOpenInterestRight): Default: OptionHistoryOpenInterestRight.BOTH. format_ (Unset | OptionHistoryOpenInterestFormat): Default: - OptionHistoryOpenInterestFormat.NDJSON. + OptionHistoryOpenInterestFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_history_quote.py b/openapi_project/openapi_package/api/option/option_history_quote.py index 65374d372..a13379a44 100644 --- a/openapi_project/openapi_package/api/option/option_history_quote.py +++ b/openapi_project/openapi_package/api/option/option_history_quote.py @@ -28,7 +28,7 @@ def _get_kwargs( start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', interval: OptionHistoryQuoteInterval = OptionHistoryQuoteInterval.VALUE_4, - format_: Unset | OptionHistoryQuoteFormat = OptionHistoryQuoteFormat.NDJSON, + format_: Unset | OptionHistoryQuoteFormat = OptionHistoryQuoteFormat.JSON, ) -> dict[str, Any]: @@ -109,7 +109,7 @@ def sync_detailed( start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', interval: OptionHistoryQuoteInterval = OptionHistoryQuoteInterval.VALUE_4, - format_: Unset | OptionHistoryQuoteFormat = OptionHistoryQuoteFormat.NDJSON, + format_: Unset | OptionHistoryQuoteFormat = OptionHistoryQuoteFormat.JSON, ) -> Response[OptionHistoryQuoteResponse200]: """ Quote @@ -127,7 +127,7 @@ def sync_detailed( start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. interval (OptionHistoryQuoteInterval): Default: OptionHistoryQuoteInterval.VALUE_4. - format_ (Unset | OptionHistoryQuoteFormat): Default: OptionHistoryQuoteFormat.NDJSON. + format_ (Unset | OptionHistoryQuoteFormat): Default: OptionHistoryQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -168,7 +168,7 @@ def sync( start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', interval: OptionHistoryQuoteInterval = OptionHistoryQuoteInterval.VALUE_4, - format_: Unset | OptionHistoryQuoteFormat = OptionHistoryQuoteFormat.NDJSON, + format_: Unset | OptionHistoryQuoteFormat = OptionHistoryQuoteFormat.JSON, ) -> OptionHistoryQuoteResponse200 | None: """ Quote @@ -186,7 +186,7 @@ def sync( start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. interval (OptionHistoryQuoteInterval): Default: OptionHistoryQuoteInterval.VALUE_4. - format_ (Unset | OptionHistoryQuoteFormat): Default: OptionHistoryQuoteFormat.NDJSON. + format_ (Unset | OptionHistoryQuoteFormat): Default: OptionHistoryQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -222,7 +222,7 @@ async def asyncio_detailed( start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', interval: OptionHistoryQuoteInterval = OptionHistoryQuoteInterval.VALUE_4, - format_: Unset | OptionHistoryQuoteFormat = OptionHistoryQuoteFormat.NDJSON, + format_: Unset | OptionHistoryQuoteFormat = OptionHistoryQuoteFormat.JSON, ) -> Response[OptionHistoryQuoteResponse200]: """ Quote @@ -240,7 +240,7 @@ async def asyncio_detailed( start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. interval (OptionHistoryQuoteInterval): Default: OptionHistoryQuoteInterval.VALUE_4. - format_ (Unset | OptionHistoryQuoteFormat): Default: OptionHistoryQuoteFormat.NDJSON. + format_ (Unset | OptionHistoryQuoteFormat): Default: OptionHistoryQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -281,7 +281,7 @@ async def asyncio( start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', interval: OptionHistoryQuoteInterval = OptionHistoryQuoteInterval.VALUE_4, - format_: Unset | OptionHistoryQuoteFormat = OptionHistoryQuoteFormat.NDJSON, + format_: Unset | OptionHistoryQuoteFormat = OptionHistoryQuoteFormat.JSON, ) -> OptionHistoryQuoteResponse200 | None: """ Quote @@ -299,7 +299,7 @@ async def asyncio( start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. interval (OptionHistoryQuoteInterval): Default: OptionHistoryQuoteInterval.VALUE_4. - format_ (Unset | OptionHistoryQuoteFormat): Default: OptionHistoryQuoteFormat.NDJSON. + format_ (Unset | OptionHistoryQuoteFormat): Default: OptionHistoryQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_history_trade.py b/openapi_project/openapi_package/api/option/option_history_trade.py index 58b044b35..b0feebbef 100644 --- a/openapi_project/openapi_package/api/option/option_history_trade.py +++ b/openapi_project/openapi_package/api/option/option_history_trade.py @@ -26,7 +26,7 @@ def _get_kwargs( right: Unset | OptionHistoryTradeRight = OptionHistoryTradeRight.BOTH, start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', - format_: Unset | OptionHistoryTradeFormat = OptionHistoryTradeFormat.NDJSON, + format_: Unset | OptionHistoryTradeFormat = OptionHistoryTradeFormat.JSON, ) -> dict[str, Any]: @@ -103,7 +103,7 @@ def sync_detailed( right: Unset | OptionHistoryTradeRight = OptionHistoryTradeRight.BOTH, start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', - format_: Unset | OptionHistoryTradeFormat = OptionHistoryTradeFormat.NDJSON, + format_: Unset | OptionHistoryTradeFormat = OptionHistoryTradeFormat.JSON, ) -> Response[OptionHistoryTradeResponse200]: """ Trade @@ -122,7 +122,7 @@ def sync_detailed( right (Unset | OptionHistoryTradeRight): Default: OptionHistoryTradeRight.BOTH. start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. - format_ (Unset | OptionHistoryTradeFormat): Default: OptionHistoryTradeFormat.NDJSON. + format_ (Unset | OptionHistoryTradeFormat): Default: OptionHistoryTradeFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -161,7 +161,7 @@ def sync( right: Unset | OptionHistoryTradeRight = OptionHistoryTradeRight.BOTH, start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', - format_: Unset | OptionHistoryTradeFormat = OptionHistoryTradeFormat.NDJSON, + format_: Unset | OptionHistoryTradeFormat = OptionHistoryTradeFormat.JSON, ) -> OptionHistoryTradeResponse200 | None: """ Trade @@ -180,7 +180,7 @@ def sync( right (Unset | OptionHistoryTradeRight): Default: OptionHistoryTradeRight.BOTH. start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. - format_ (Unset | OptionHistoryTradeFormat): Default: OptionHistoryTradeFormat.NDJSON. + format_ (Unset | OptionHistoryTradeFormat): Default: OptionHistoryTradeFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -214,7 +214,7 @@ async def asyncio_detailed( right: Unset | OptionHistoryTradeRight = OptionHistoryTradeRight.BOTH, start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', - format_: Unset | OptionHistoryTradeFormat = OptionHistoryTradeFormat.NDJSON, + format_: Unset | OptionHistoryTradeFormat = OptionHistoryTradeFormat.JSON, ) -> Response[OptionHistoryTradeResponse200]: """ Trade @@ -233,7 +233,7 @@ async def asyncio_detailed( right (Unset | OptionHistoryTradeRight): Default: OptionHistoryTradeRight.BOTH. start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. - format_ (Unset | OptionHistoryTradeFormat): Default: OptionHistoryTradeFormat.NDJSON. + format_ (Unset | OptionHistoryTradeFormat): Default: OptionHistoryTradeFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -272,7 +272,7 @@ async def asyncio( right: Unset | OptionHistoryTradeRight = OptionHistoryTradeRight.BOTH, start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', - format_: Unset | OptionHistoryTradeFormat = OptionHistoryTradeFormat.NDJSON, + format_: Unset | OptionHistoryTradeFormat = OptionHistoryTradeFormat.JSON, ) -> OptionHistoryTradeResponse200 | None: """ Trade @@ -291,7 +291,7 @@ async def asyncio( right (Unset | OptionHistoryTradeRight): Default: OptionHistoryTradeRight.BOTH. start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. - format_ (Unset | OptionHistoryTradeFormat): Default: OptionHistoryTradeFormat.NDJSON. + format_ (Unset | OptionHistoryTradeFormat): Default: OptionHistoryTradeFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_history_trade_greeks_all.py b/openapi_project/openapi_package/api/option/option_history_trade_greeks_all.py index 07b2c8da7..3581cff7b 100644 --- a/openapi_project/openapi_package/api/option/option_history_trade_greeks_all.py +++ b/openapi_project/openapi_package/api/option/option_history_trade_greeks_all.py @@ -30,7 +30,7 @@ def _get_kwargs( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryTradeGreeksAllRateType = OptionHistoryTradeGreeksAllRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryTradeGreeksAllFormat = OptionHistoryTradeGreeksAllFormat.NDJSON, + format_: Unset | OptionHistoryTradeGreeksAllFormat = OptionHistoryTradeGreeksAllFormat.JSON, ) -> dict[str, Any]: @@ -118,7 +118,7 @@ def sync_detailed( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryTradeGreeksAllRateType = OptionHistoryTradeGreeksAllRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryTradeGreeksAllFormat = OptionHistoryTradeGreeksAllFormat.NDJSON, + format_: Unset | OptionHistoryTradeGreeksAllFormat = OptionHistoryTradeGreeksAllFormat.JSON, ) -> Response[OptionHistoryTradeGreeksAllResponse200]: """ All Trade Greeks @@ -143,7 +143,7 @@ def sync_detailed( OptionHistoryTradeGreeksAllRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryTradeGreeksAllFormat): Default: - OptionHistoryTradeGreeksAllFormat.NDJSON. + OptionHistoryTradeGreeksAllFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -188,7 +188,7 @@ def sync( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryTradeGreeksAllRateType = OptionHistoryTradeGreeksAllRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryTradeGreeksAllFormat = OptionHistoryTradeGreeksAllFormat.NDJSON, + format_: Unset | OptionHistoryTradeGreeksAllFormat = OptionHistoryTradeGreeksAllFormat.JSON, ) -> OptionHistoryTradeGreeksAllResponse200 | None: """ All Trade Greeks @@ -213,7 +213,7 @@ def sync( OptionHistoryTradeGreeksAllRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryTradeGreeksAllFormat): Default: - OptionHistoryTradeGreeksAllFormat.NDJSON. + OptionHistoryTradeGreeksAllFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -253,7 +253,7 @@ async def asyncio_detailed( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryTradeGreeksAllRateType = OptionHistoryTradeGreeksAllRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryTradeGreeksAllFormat = OptionHistoryTradeGreeksAllFormat.NDJSON, + format_: Unset | OptionHistoryTradeGreeksAllFormat = OptionHistoryTradeGreeksAllFormat.JSON, ) -> Response[OptionHistoryTradeGreeksAllResponse200]: """ All Trade Greeks @@ -278,7 +278,7 @@ async def asyncio_detailed( OptionHistoryTradeGreeksAllRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryTradeGreeksAllFormat): Default: - OptionHistoryTradeGreeksAllFormat.NDJSON. + OptionHistoryTradeGreeksAllFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -323,7 +323,7 @@ async def asyncio( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryTradeGreeksAllRateType = OptionHistoryTradeGreeksAllRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryTradeGreeksAllFormat = OptionHistoryTradeGreeksAllFormat.NDJSON, + format_: Unset | OptionHistoryTradeGreeksAllFormat = OptionHistoryTradeGreeksAllFormat.JSON, ) -> OptionHistoryTradeGreeksAllResponse200 | None: """ All Trade Greeks @@ -348,7 +348,7 @@ async def asyncio( OptionHistoryTradeGreeksAllRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryTradeGreeksAllFormat): Default: - OptionHistoryTradeGreeksAllFormat.NDJSON. + OptionHistoryTradeGreeksAllFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_history_trade_greeks_first_order.py b/openapi_project/openapi_package/api/option/option_history_trade_greeks_first_order.py index c974a269c..1f0064b6f 100644 --- a/openapi_project/openapi_package/api/option/option_history_trade_greeks_first_order.py +++ b/openapi_project/openapi_package/api/option/option_history_trade_greeks_first_order.py @@ -30,7 +30,7 @@ def _get_kwargs( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryTradeGreeksFirstOrderRateType = OptionHistoryTradeGreeksFirstOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryTradeGreeksFirstOrderFormat = OptionHistoryTradeGreeksFirstOrderFormat.NDJSON, + format_: Unset | OptionHistoryTradeGreeksFirstOrderFormat = OptionHistoryTradeGreeksFirstOrderFormat.JSON, ) -> dict[str, Any]: @@ -118,7 +118,7 @@ def sync_detailed( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryTradeGreeksFirstOrderRateType = OptionHistoryTradeGreeksFirstOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryTradeGreeksFirstOrderFormat = OptionHistoryTradeGreeksFirstOrderFormat.NDJSON, + format_: Unset | OptionHistoryTradeGreeksFirstOrderFormat = OptionHistoryTradeGreeksFirstOrderFormat.JSON, ) -> Response[OptionHistoryTradeGreeksFirstOrderResponse200]: """ First Order Trade Greeks @@ -143,7 +143,7 @@ def sync_detailed( OptionHistoryTradeGreeksFirstOrderRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryTradeGreeksFirstOrderFormat): Default: - OptionHistoryTradeGreeksFirstOrderFormat.NDJSON. + OptionHistoryTradeGreeksFirstOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -188,7 +188,7 @@ def sync( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryTradeGreeksFirstOrderRateType = OptionHistoryTradeGreeksFirstOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryTradeGreeksFirstOrderFormat = OptionHistoryTradeGreeksFirstOrderFormat.NDJSON, + format_: Unset | OptionHistoryTradeGreeksFirstOrderFormat = OptionHistoryTradeGreeksFirstOrderFormat.JSON, ) -> OptionHistoryTradeGreeksFirstOrderResponse200 | None: """ First Order Trade Greeks @@ -213,7 +213,7 @@ def sync( OptionHistoryTradeGreeksFirstOrderRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryTradeGreeksFirstOrderFormat): Default: - OptionHistoryTradeGreeksFirstOrderFormat.NDJSON. + OptionHistoryTradeGreeksFirstOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -253,7 +253,7 @@ async def asyncio_detailed( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryTradeGreeksFirstOrderRateType = OptionHistoryTradeGreeksFirstOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryTradeGreeksFirstOrderFormat = OptionHistoryTradeGreeksFirstOrderFormat.NDJSON, + format_: Unset | OptionHistoryTradeGreeksFirstOrderFormat = OptionHistoryTradeGreeksFirstOrderFormat.JSON, ) -> Response[OptionHistoryTradeGreeksFirstOrderResponse200]: """ First Order Trade Greeks @@ -278,7 +278,7 @@ async def asyncio_detailed( OptionHistoryTradeGreeksFirstOrderRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryTradeGreeksFirstOrderFormat): Default: - OptionHistoryTradeGreeksFirstOrderFormat.NDJSON. + OptionHistoryTradeGreeksFirstOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -323,7 +323,7 @@ async def asyncio( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryTradeGreeksFirstOrderRateType = OptionHistoryTradeGreeksFirstOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryTradeGreeksFirstOrderFormat = OptionHistoryTradeGreeksFirstOrderFormat.NDJSON, + format_: Unset | OptionHistoryTradeGreeksFirstOrderFormat = OptionHistoryTradeGreeksFirstOrderFormat.JSON, ) -> OptionHistoryTradeGreeksFirstOrderResponse200 | None: """ First Order Trade Greeks @@ -348,7 +348,7 @@ async def asyncio( OptionHistoryTradeGreeksFirstOrderRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryTradeGreeksFirstOrderFormat): Default: - OptionHistoryTradeGreeksFirstOrderFormat.NDJSON. + OptionHistoryTradeGreeksFirstOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_history_trade_greeks_implied_volatility.py b/openapi_project/openapi_package/api/option/option_history_trade_greeks_implied_volatility.py index 148afa23a..08be8e094 100644 --- a/openapi_project/openapi_package/api/option/option_history_trade_greeks_implied_volatility.py +++ b/openapi_project/openapi_package/api/option/option_history_trade_greeks_implied_volatility.py @@ -30,7 +30,7 @@ def _get_kwargs( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryTradeGreeksImpliedVolatilityRateType = OptionHistoryTradeGreeksImpliedVolatilityRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryTradeGreeksImpliedVolatilityFormat = OptionHistoryTradeGreeksImpliedVolatilityFormat.NDJSON, + format_: Unset | OptionHistoryTradeGreeksImpliedVolatilityFormat = OptionHistoryTradeGreeksImpliedVolatilityFormat.JSON, ) -> dict[str, Any]: @@ -118,7 +118,7 @@ def sync_detailed( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryTradeGreeksImpliedVolatilityRateType = OptionHistoryTradeGreeksImpliedVolatilityRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryTradeGreeksImpliedVolatilityFormat = OptionHistoryTradeGreeksImpliedVolatilityFormat.NDJSON, + format_: Unset | OptionHistoryTradeGreeksImpliedVolatilityFormat = OptionHistoryTradeGreeksImpliedVolatilityFormat.JSON, ) -> Response[OptionHistoryTradeGreeksImpliedVolatilityResponse200]: """ Trade Implied Volatility @@ -143,7 +143,7 @@ def sync_detailed( OptionHistoryTradeGreeksImpliedVolatilityRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryTradeGreeksImpliedVolatilityFormat): Default: - OptionHistoryTradeGreeksImpliedVolatilityFormat.NDJSON. + OptionHistoryTradeGreeksImpliedVolatilityFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -188,7 +188,7 @@ def sync( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryTradeGreeksImpliedVolatilityRateType = OptionHistoryTradeGreeksImpliedVolatilityRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryTradeGreeksImpliedVolatilityFormat = OptionHistoryTradeGreeksImpliedVolatilityFormat.NDJSON, + format_: Unset | OptionHistoryTradeGreeksImpliedVolatilityFormat = OptionHistoryTradeGreeksImpliedVolatilityFormat.JSON, ) -> OptionHistoryTradeGreeksImpliedVolatilityResponse200 | None: """ Trade Implied Volatility @@ -213,7 +213,7 @@ def sync( OptionHistoryTradeGreeksImpliedVolatilityRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryTradeGreeksImpliedVolatilityFormat): Default: - OptionHistoryTradeGreeksImpliedVolatilityFormat.NDJSON. + OptionHistoryTradeGreeksImpliedVolatilityFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -253,7 +253,7 @@ async def asyncio_detailed( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryTradeGreeksImpliedVolatilityRateType = OptionHistoryTradeGreeksImpliedVolatilityRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryTradeGreeksImpliedVolatilityFormat = OptionHistoryTradeGreeksImpliedVolatilityFormat.NDJSON, + format_: Unset | OptionHistoryTradeGreeksImpliedVolatilityFormat = OptionHistoryTradeGreeksImpliedVolatilityFormat.JSON, ) -> Response[OptionHistoryTradeGreeksImpliedVolatilityResponse200]: """ Trade Implied Volatility @@ -278,7 +278,7 @@ async def asyncio_detailed( OptionHistoryTradeGreeksImpliedVolatilityRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryTradeGreeksImpliedVolatilityFormat): Default: - OptionHistoryTradeGreeksImpliedVolatilityFormat.NDJSON. + OptionHistoryTradeGreeksImpliedVolatilityFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -323,7 +323,7 @@ async def asyncio( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryTradeGreeksImpliedVolatilityRateType = OptionHistoryTradeGreeksImpliedVolatilityRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryTradeGreeksImpliedVolatilityFormat = OptionHistoryTradeGreeksImpliedVolatilityFormat.NDJSON, + format_: Unset | OptionHistoryTradeGreeksImpliedVolatilityFormat = OptionHistoryTradeGreeksImpliedVolatilityFormat.JSON, ) -> OptionHistoryTradeGreeksImpliedVolatilityResponse200 | None: """ Trade Implied Volatility @@ -348,7 +348,7 @@ async def asyncio( OptionHistoryTradeGreeksImpliedVolatilityRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryTradeGreeksImpliedVolatilityFormat): Default: - OptionHistoryTradeGreeksImpliedVolatilityFormat.NDJSON. + OptionHistoryTradeGreeksImpliedVolatilityFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_history_trade_greeks_second_order.py b/openapi_project/openapi_package/api/option/option_history_trade_greeks_second_order.py index 6052b34b3..e11e000a2 100644 --- a/openapi_project/openapi_package/api/option/option_history_trade_greeks_second_order.py +++ b/openapi_project/openapi_package/api/option/option_history_trade_greeks_second_order.py @@ -30,7 +30,7 @@ def _get_kwargs( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryTradeGreeksSecondOrderRateType = OptionHistoryTradeGreeksSecondOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryTradeGreeksSecondOrderFormat = OptionHistoryTradeGreeksSecondOrderFormat.NDJSON, + format_: Unset | OptionHistoryTradeGreeksSecondOrderFormat = OptionHistoryTradeGreeksSecondOrderFormat.JSON, ) -> dict[str, Any]: @@ -118,7 +118,7 @@ def sync_detailed( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryTradeGreeksSecondOrderRateType = OptionHistoryTradeGreeksSecondOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryTradeGreeksSecondOrderFormat = OptionHistoryTradeGreeksSecondOrderFormat.NDJSON, + format_: Unset | OptionHistoryTradeGreeksSecondOrderFormat = OptionHistoryTradeGreeksSecondOrderFormat.JSON, ) -> Response[OptionHistoryTradeGreeksSecondOrderResponse200]: """ Second Order Trade Greeks @@ -143,7 +143,7 @@ def sync_detailed( OptionHistoryTradeGreeksSecondOrderRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryTradeGreeksSecondOrderFormat): Default: - OptionHistoryTradeGreeksSecondOrderFormat.NDJSON. + OptionHistoryTradeGreeksSecondOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -188,7 +188,7 @@ def sync( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryTradeGreeksSecondOrderRateType = OptionHistoryTradeGreeksSecondOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryTradeGreeksSecondOrderFormat = OptionHistoryTradeGreeksSecondOrderFormat.NDJSON, + format_: Unset | OptionHistoryTradeGreeksSecondOrderFormat = OptionHistoryTradeGreeksSecondOrderFormat.JSON, ) -> OptionHistoryTradeGreeksSecondOrderResponse200 | None: """ Second Order Trade Greeks @@ -213,7 +213,7 @@ def sync( OptionHistoryTradeGreeksSecondOrderRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryTradeGreeksSecondOrderFormat): Default: - OptionHistoryTradeGreeksSecondOrderFormat.NDJSON. + OptionHistoryTradeGreeksSecondOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -253,7 +253,7 @@ async def asyncio_detailed( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryTradeGreeksSecondOrderRateType = OptionHistoryTradeGreeksSecondOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryTradeGreeksSecondOrderFormat = OptionHistoryTradeGreeksSecondOrderFormat.NDJSON, + format_: Unset | OptionHistoryTradeGreeksSecondOrderFormat = OptionHistoryTradeGreeksSecondOrderFormat.JSON, ) -> Response[OptionHistoryTradeGreeksSecondOrderResponse200]: """ Second Order Trade Greeks @@ -278,7 +278,7 @@ async def asyncio_detailed( OptionHistoryTradeGreeksSecondOrderRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryTradeGreeksSecondOrderFormat): Default: - OptionHistoryTradeGreeksSecondOrderFormat.NDJSON. + OptionHistoryTradeGreeksSecondOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -323,7 +323,7 @@ async def asyncio( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryTradeGreeksSecondOrderRateType = OptionHistoryTradeGreeksSecondOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryTradeGreeksSecondOrderFormat = OptionHistoryTradeGreeksSecondOrderFormat.NDJSON, + format_: Unset | OptionHistoryTradeGreeksSecondOrderFormat = OptionHistoryTradeGreeksSecondOrderFormat.JSON, ) -> OptionHistoryTradeGreeksSecondOrderResponse200 | None: """ Second Order Trade Greeks @@ -348,7 +348,7 @@ async def asyncio( OptionHistoryTradeGreeksSecondOrderRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryTradeGreeksSecondOrderFormat): Default: - OptionHistoryTradeGreeksSecondOrderFormat.NDJSON. + OptionHistoryTradeGreeksSecondOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_history_trade_greeks_third_order.py b/openapi_project/openapi_package/api/option/option_history_trade_greeks_third_order.py index a862db5e9..e6578860d 100644 --- a/openapi_project/openapi_package/api/option/option_history_trade_greeks_third_order.py +++ b/openapi_project/openapi_package/api/option/option_history_trade_greeks_third_order.py @@ -30,7 +30,7 @@ def _get_kwargs( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryTradeGreeksThirdOrderRateType = OptionHistoryTradeGreeksThirdOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryTradeGreeksThirdOrderFormat = OptionHistoryTradeGreeksThirdOrderFormat.NDJSON, + format_: Unset | OptionHistoryTradeGreeksThirdOrderFormat = OptionHistoryTradeGreeksThirdOrderFormat.JSON, ) -> dict[str, Any]: @@ -118,7 +118,7 @@ def sync_detailed( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryTradeGreeksThirdOrderRateType = OptionHistoryTradeGreeksThirdOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryTradeGreeksThirdOrderFormat = OptionHistoryTradeGreeksThirdOrderFormat.NDJSON, + format_: Unset | OptionHistoryTradeGreeksThirdOrderFormat = OptionHistoryTradeGreeksThirdOrderFormat.JSON, ) -> Response[OptionHistoryTradeGreeksThirdOrderResponse200]: """ Third Order Trade Greeks @@ -143,7 +143,7 @@ def sync_detailed( OptionHistoryTradeGreeksThirdOrderRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryTradeGreeksThirdOrderFormat): Default: - OptionHistoryTradeGreeksThirdOrderFormat.NDJSON. + OptionHistoryTradeGreeksThirdOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -188,7 +188,7 @@ def sync( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryTradeGreeksThirdOrderRateType = OptionHistoryTradeGreeksThirdOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryTradeGreeksThirdOrderFormat = OptionHistoryTradeGreeksThirdOrderFormat.NDJSON, + format_: Unset | OptionHistoryTradeGreeksThirdOrderFormat = OptionHistoryTradeGreeksThirdOrderFormat.JSON, ) -> OptionHistoryTradeGreeksThirdOrderResponse200 | None: """ Third Order Trade Greeks @@ -213,7 +213,7 @@ def sync( OptionHistoryTradeGreeksThirdOrderRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryTradeGreeksThirdOrderFormat): Default: - OptionHistoryTradeGreeksThirdOrderFormat.NDJSON. + OptionHistoryTradeGreeksThirdOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -253,7 +253,7 @@ async def asyncio_detailed( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryTradeGreeksThirdOrderRateType = OptionHistoryTradeGreeksThirdOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryTradeGreeksThirdOrderFormat = OptionHistoryTradeGreeksThirdOrderFormat.NDJSON, + format_: Unset | OptionHistoryTradeGreeksThirdOrderFormat = OptionHistoryTradeGreeksThirdOrderFormat.JSON, ) -> Response[OptionHistoryTradeGreeksThirdOrderResponse200]: """ Third Order Trade Greeks @@ -278,7 +278,7 @@ async def asyncio_detailed( OptionHistoryTradeGreeksThirdOrderRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryTradeGreeksThirdOrderFormat): Default: - OptionHistoryTradeGreeksThirdOrderFormat.NDJSON. + OptionHistoryTradeGreeksThirdOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -323,7 +323,7 @@ async def asyncio( annual_dividend: Unset | float = UNSET, rate_type: Unset | OptionHistoryTradeGreeksThirdOrderRateType = OptionHistoryTradeGreeksThirdOrderRateType.SOFR, rate_value: Unset | float = UNSET, - format_: Unset | OptionHistoryTradeGreeksThirdOrderFormat = OptionHistoryTradeGreeksThirdOrderFormat.NDJSON, + format_: Unset | OptionHistoryTradeGreeksThirdOrderFormat = OptionHistoryTradeGreeksThirdOrderFormat.JSON, ) -> OptionHistoryTradeGreeksThirdOrderResponse200 | None: """ Third Order Trade Greeks @@ -348,7 +348,7 @@ async def asyncio( OptionHistoryTradeGreeksThirdOrderRateType.SOFR. rate_value (Unset | float): format_ (Unset | OptionHistoryTradeGreeksThirdOrderFormat): Default: - OptionHistoryTradeGreeksThirdOrderFormat.NDJSON. + OptionHistoryTradeGreeksThirdOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_history_trade_quote.py b/openapi_project/openapi_package/api/option/option_history_trade_quote.py index e441dfa7f..0199e3212 100644 --- a/openapi_project/openapi_package/api/option/option_history_trade_quote.py +++ b/openapi_project/openapi_package/api/option/option_history_trade_quote.py @@ -27,7 +27,7 @@ def _get_kwargs( start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', exclusive: Unset | bool = True, - format_: Unset | OptionHistoryTradeQuoteFormat = OptionHistoryTradeQuoteFormat.NDJSON, + format_: Unset | OptionHistoryTradeQuoteFormat = OptionHistoryTradeQuoteFormat.JSON, ) -> dict[str, Any]: @@ -107,7 +107,7 @@ def sync_detailed( start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', exclusive: Unset | bool = True, - format_: Unset | OptionHistoryTradeQuoteFormat = OptionHistoryTradeQuoteFormat.NDJSON, + format_: Unset | OptionHistoryTradeQuoteFormat = OptionHistoryTradeQuoteFormat.JSON, ) -> Response[OptionHistoryTradeQuoteResponse200]: """ Trade Quote @@ -130,7 +130,7 @@ def sync_detailed( end_time (Unset | str): Default: '16:00:00'. exclusive (Unset | bool): Default: True. format_ (Unset | OptionHistoryTradeQuoteFormat): Default: - OptionHistoryTradeQuoteFormat.NDJSON. + OptionHistoryTradeQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -171,7 +171,7 @@ def sync( start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', exclusive: Unset | bool = True, - format_: Unset | OptionHistoryTradeQuoteFormat = OptionHistoryTradeQuoteFormat.NDJSON, + format_: Unset | OptionHistoryTradeQuoteFormat = OptionHistoryTradeQuoteFormat.JSON, ) -> OptionHistoryTradeQuoteResponse200 | None: """ Trade Quote @@ -194,7 +194,7 @@ def sync( end_time (Unset | str): Default: '16:00:00'. exclusive (Unset | bool): Default: True. format_ (Unset | OptionHistoryTradeQuoteFormat): Default: - OptionHistoryTradeQuoteFormat.NDJSON. + OptionHistoryTradeQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -230,7 +230,7 @@ async def asyncio_detailed( start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', exclusive: Unset | bool = True, - format_: Unset | OptionHistoryTradeQuoteFormat = OptionHistoryTradeQuoteFormat.NDJSON, + format_: Unset | OptionHistoryTradeQuoteFormat = OptionHistoryTradeQuoteFormat.JSON, ) -> Response[OptionHistoryTradeQuoteResponse200]: """ Trade Quote @@ -253,7 +253,7 @@ async def asyncio_detailed( end_time (Unset | str): Default: '16:00:00'. exclusive (Unset | bool): Default: True. format_ (Unset | OptionHistoryTradeQuoteFormat): Default: - OptionHistoryTradeQuoteFormat.NDJSON. + OptionHistoryTradeQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -294,7 +294,7 @@ async def asyncio( start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', exclusive: Unset | bool = True, - format_: Unset | OptionHistoryTradeQuoteFormat = OptionHistoryTradeQuoteFormat.NDJSON, + format_: Unset | OptionHistoryTradeQuoteFormat = OptionHistoryTradeQuoteFormat.JSON, ) -> OptionHistoryTradeQuoteResponse200 | None: """ Trade Quote @@ -317,7 +317,7 @@ async def asyncio( end_time (Unset | str): Default: '16:00:00'. exclusive (Unset | bool): Default: True. format_ (Unset | OptionHistoryTradeQuoteFormat): Default: - OptionHistoryTradeQuoteFormat.NDJSON. + OptionHistoryTradeQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_list_contracts.py b/openapi_project/openapi_package/api/option/option_list_contracts.py index 99792cc0c..a1f5ddabc 100644 --- a/openapi_project/openapi_package/api/option/option_list_contracts.py +++ b/openapi_project/openapi_package/api/option/option_list_contracts.py @@ -22,7 +22,7 @@ def _get_kwargs( *, symbol: Unset | list[str] = UNSET, date: datetime.date, - format_: Unset | OptionListContractsFormat = OptionListContractsFormat.NDJSON, + format_: Unset | OptionListContractsFormat = OptionListContractsFormat.JSON, ) -> dict[str, Any]: @@ -87,7 +87,7 @@ def sync_detailed( client: AuthenticatedClient | Client, symbol: Unset | list[str] = UNSET, date: datetime.date, - format_: Unset | OptionListContractsFormat = OptionListContractsFormat.NDJSON, + format_: Unset | OptionListContractsFormat = OptionListContractsFormat.JSON, ) -> Response[OptionListContractsResponse200]: """ Contracts @@ -103,7 +103,7 @@ def sync_detailed( request_type (OptionListContractsRequestType): symbol (Unset | list[str]): date (datetime.date): - format_ (Unset | OptionListContractsFormat): Default: OptionListContractsFormat.NDJSON. + format_ (Unset | OptionListContractsFormat): Default: OptionListContractsFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -134,7 +134,7 @@ def sync( client: AuthenticatedClient | Client, symbol: Unset | list[str] = UNSET, date: datetime.date, - format_: Unset | OptionListContractsFormat = OptionListContractsFormat.NDJSON, + format_: Unset | OptionListContractsFormat = OptionListContractsFormat.JSON, ) -> OptionListContractsResponse200 | None: """ Contracts @@ -150,7 +150,7 @@ def sync( request_type (OptionListContractsRequestType): symbol (Unset | list[str]): date (datetime.date): - format_ (Unset | OptionListContractsFormat): Default: OptionListContractsFormat.NDJSON. + format_ (Unset | OptionListContractsFormat): Default: OptionListContractsFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -176,7 +176,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, symbol: Unset | list[str] = UNSET, date: datetime.date, - format_: Unset | OptionListContractsFormat = OptionListContractsFormat.NDJSON, + format_: Unset | OptionListContractsFormat = OptionListContractsFormat.JSON, ) -> Response[OptionListContractsResponse200]: """ Contracts @@ -192,7 +192,7 @@ async def asyncio_detailed( request_type (OptionListContractsRequestType): symbol (Unset | list[str]): date (datetime.date): - format_ (Unset | OptionListContractsFormat): Default: OptionListContractsFormat.NDJSON. + format_ (Unset | OptionListContractsFormat): Default: OptionListContractsFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -223,7 +223,7 @@ async def asyncio( client: AuthenticatedClient | Client, symbol: Unset | list[str] = UNSET, date: datetime.date, - format_: Unset | OptionListContractsFormat = OptionListContractsFormat.NDJSON, + format_: Unset | OptionListContractsFormat = OptionListContractsFormat.JSON, ) -> OptionListContractsResponse200 | None: """ Contracts @@ -239,7 +239,7 @@ async def asyncio( request_type (OptionListContractsRequestType): symbol (Unset | list[str]): date (datetime.date): - format_ (Unset | OptionListContractsFormat): Default: OptionListContractsFormat.NDJSON. + format_ (Unset | OptionListContractsFormat): Default: OptionListContractsFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_list_dates.py b/openapi_project/openapi_package/api/option/option_list_dates.py index a4154eabc..9d4c3746f 100644 --- a/openapi_project/openapi_package/api/option/option_list_dates.py +++ b/openapi_project/openapi_package/api/option/option_list_dates.py @@ -25,7 +25,7 @@ def _get_kwargs( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionListDatesRight = OptionListDatesRight.BOTH, - format_: Unset | OptionListDatesFormat = OptionListDatesFormat.NDJSON, + format_: Unset | OptionListDatesFormat = OptionListDatesFormat.JSON, ) -> dict[str, Any]: @@ -93,7 +93,7 @@ def sync_detailed( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionListDatesRight = OptionListDatesRight.BOTH, - format_: Unset | OptionListDatesFormat = OptionListDatesFormat.NDJSON, + format_: Unset | OptionListDatesFormat = OptionListDatesFormat.JSON, ) -> Response[OptionListDatesResponse200]: """ Dates @@ -108,7 +108,7 @@ def sync_detailed( expiration (datetime.date): strike (Unset | str): Default: '*'. right (Unset | OptionListDatesRight): Default: OptionListDatesRight.BOTH. - format_ (Unset | OptionListDatesFormat): Default: OptionListDatesFormat.NDJSON. + format_ (Unset | OptionListDatesFormat): Default: OptionListDatesFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,7 +143,7 @@ def sync( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionListDatesRight = OptionListDatesRight.BOTH, - format_: Unset | OptionListDatesFormat = OptionListDatesFormat.NDJSON, + format_: Unset | OptionListDatesFormat = OptionListDatesFormat.JSON, ) -> OptionListDatesResponse200 | None: """ Dates @@ -158,7 +158,7 @@ def sync( expiration (datetime.date): strike (Unset | str): Default: '*'. right (Unset | OptionListDatesRight): Default: OptionListDatesRight.BOTH. - format_ (Unset | OptionListDatesFormat): Default: OptionListDatesFormat.NDJSON. + format_ (Unset | OptionListDatesFormat): Default: OptionListDatesFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -188,7 +188,7 @@ async def asyncio_detailed( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionListDatesRight = OptionListDatesRight.BOTH, - format_: Unset | OptionListDatesFormat = OptionListDatesFormat.NDJSON, + format_: Unset | OptionListDatesFormat = OptionListDatesFormat.JSON, ) -> Response[OptionListDatesResponse200]: """ Dates @@ -203,7 +203,7 @@ async def asyncio_detailed( expiration (datetime.date): strike (Unset | str): Default: '*'. right (Unset | OptionListDatesRight): Default: OptionListDatesRight.BOTH. - format_ (Unset | OptionListDatesFormat): Default: OptionListDatesFormat.NDJSON. + format_ (Unset | OptionListDatesFormat): Default: OptionListDatesFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -238,7 +238,7 @@ async def asyncio( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionListDatesRight = OptionListDatesRight.BOTH, - format_: Unset | OptionListDatesFormat = OptionListDatesFormat.NDJSON, + format_: Unset | OptionListDatesFormat = OptionListDatesFormat.JSON, ) -> OptionListDatesResponse200 | None: """ Dates @@ -253,7 +253,7 @@ async def asyncio( expiration (datetime.date): strike (Unset | str): Default: '*'. right (Unset | OptionListDatesRight): Default: OptionListDatesRight.BOTH. - format_ (Unset | OptionListDatesFormat): Default: OptionListDatesFormat.NDJSON. + format_ (Unset | OptionListDatesFormat): Default: OptionListDatesFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_list_expirations.py b/openapi_project/openapi_package/api/option/option_list_expirations.py index 3ed365006..9a7e7f6ae 100644 --- a/openapi_project/openapi_package/api/option/option_list_expirations.py +++ b/openapi_project/openapi_package/api/option/option_list_expirations.py @@ -17,7 +17,7 @@ def _get_kwargs( *, symbol: list[str], - format_: Unset | OptionListExpirationsFormat = OptionListExpirationsFormat.NDJSON, + format_: Unset | OptionListExpirationsFormat = OptionListExpirationsFormat.JSON, ) -> dict[str, Any]: @@ -75,7 +75,7 @@ def sync_detailed( *, client: AuthenticatedClient | Client, symbol: list[str], - format_: Unset | OptionListExpirationsFormat = OptionListExpirationsFormat.NDJSON, + format_: Unset | OptionListExpirationsFormat = OptionListExpirationsFormat.JSON, ) -> Response[OptionListExpirationsResponse200]: """ Expirations @@ -85,8 +85,7 @@ def sync_detailed( Args: symbol (list[str]): - format_ (Unset | OptionListExpirationsFormat): Default: - OptionListExpirationsFormat.NDJSON. + format_ (Unset | OptionListExpirationsFormat): Default: OptionListExpirationsFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -113,7 +112,7 @@ def sync( *, client: AuthenticatedClient | Client, symbol: list[str], - format_: Unset | OptionListExpirationsFormat = OptionListExpirationsFormat.NDJSON, + format_: Unset | OptionListExpirationsFormat = OptionListExpirationsFormat.JSON, ) -> OptionListExpirationsResponse200 | None: """ Expirations @@ -123,8 +122,7 @@ def sync( Args: symbol (list[str]): - format_ (Unset | OptionListExpirationsFormat): Default: - OptionListExpirationsFormat.NDJSON. + format_ (Unset | OptionListExpirationsFormat): Default: OptionListExpirationsFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -146,7 +144,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient | Client, symbol: list[str], - format_: Unset | OptionListExpirationsFormat = OptionListExpirationsFormat.NDJSON, + format_: Unset | OptionListExpirationsFormat = OptionListExpirationsFormat.JSON, ) -> Response[OptionListExpirationsResponse200]: """ Expirations @@ -156,8 +154,7 @@ async def asyncio_detailed( Args: symbol (list[str]): - format_ (Unset | OptionListExpirationsFormat): Default: - OptionListExpirationsFormat.NDJSON. + format_ (Unset | OptionListExpirationsFormat): Default: OptionListExpirationsFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -184,7 +181,7 @@ async def asyncio( *, client: AuthenticatedClient | Client, symbol: list[str], - format_: Unset | OptionListExpirationsFormat = OptionListExpirationsFormat.NDJSON, + format_: Unset | OptionListExpirationsFormat = OptionListExpirationsFormat.JSON, ) -> OptionListExpirationsResponse200 | None: """ Expirations @@ -194,8 +191,7 @@ async def asyncio( Args: symbol (list[str]): - format_ (Unset | OptionListExpirationsFormat): Default: - OptionListExpirationsFormat.NDJSON. + format_ (Unset | OptionListExpirationsFormat): Default: OptionListExpirationsFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_list_strikes.py b/openapi_project/openapi_package/api/option/option_list_strikes.py index 65ef81870..bdaa52455 100644 --- a/openapi_project/openapi_package/api/option/option_list_strikes.py +++ b/openapi_project/openapi_package/api/option/option_list_strikes.py @@ -20,7 +20,7 @@ def _get_kwargs( *, symbol: list[str], expiration: datetime.date, - format_: Unset | OptionListStrikesFormat = OptionListStrikesFormat.NDJSON, + format_: Unset | OptionListStrikesFormat = OptionListStrikesFormat.JSON, ) -> dict[str, Any]: @@ -82,7 +82,7 @@ def sync_detailed( client: AuthenticatedClient | Client, symbol: list[str], expiration: datetime.date, - format_: Unset | OptionListStrikesFormat = OptionListStrikesFormat.NDJSON, + format_: Unset | OptionListStrikesFormat = OptionListStrikesFormat.JSON, ) -> Response[OptionListStrikesResponse200]: """ Strikes @@ -93,7 +93,7 @@ def sync_detailed( Args: symbol (list[str]): expiration (datetime.date): - format_ (Unset | OptionListStrikesFormat): Default: OptionListStrikesFormat.NDJSON. + format_ (Unset | OptionListStrikesFormat): Default: OptionListStrikesFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -122,7 +122,7 @@ def sync( client: AuthenticatedClient | Client, symbol: list[str], expiration: datetime.date, - format_: Unset | OptionListStrikesFormat = OptionListStrikesFormat.NDJSON, + format_: Unset | OptionListStrikesFormat = OptionListStrikesFormat.JSON, ) -> OptionListStrikesResponse200 | None: """ Strikes @@ -133,7 +133,7 @@ def sync( Args: symbol (list[str]): expiration (datetime.date): - format_ (Unset | OptionListStrikesFormat): Default: OptionListStrikesFormat.NDJSON. + format_ (Unset | OptionListStrikesFormat): Default: OptionListStrikesFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -157,7 +157,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, symbol: list[str], expiration: datetime.date, - format_: Unset | OptionListStrikesFormat = OptionListStrikesFormat.NDJSON, + format_: Unset | OptionListStrikesFormat = OptionListStrikesFormat.JSON, ) -> Response[OptionListStrikesResponse200]: """ Strikes @@ -168,7 +168,7 @@ async def asyncio_detailed( Args: symbol (list[str]): expiration (datetime.date): - format_ (Unset | OptionListStrikesFormat): Default: OptionListStrikesFormat.NDJSON. + format_ (Unset | OptionListStrikesFormat): Default: OptionListStrikesFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -197,7 +197,7 @@ async def asyncio( client: AuthenticatedClient | Client, symbol: list[str], expiration: datetime.date, - format_: Unset | OptionListStrikesFormat = OptionListStrikesFormat.NDJSON, + format_: Unset | OptionListStrikesFormat = OptionListStrikesFormat.JSON, ) -> OptionListStrikesResponse200 | None: """ Strikes @@ -208,7 +208,7 @@ async def asyncio( Args: symbol (list[str]): expiration (datetime.date): - format_ (Unset | OptionListStrikesFormat): Default: OptionListStrikesFormat.NDJSON. + format_ (Unset | OptionListStrikesFormat): Default: OptionListStrikesFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_list_symbols.py b/openapi_project/openapi_package/api/option/option_list_symbols.py index 83da7f7e2..95acca7d4 100644 --- a/openapi_project/openapi_package/api/option/option_list_symbols.py +++ b/openapi_project/openapi_package/api/option/option_list_symbols.py @@ -16,7 +16,7 @@ def _get_kwargs( *, - format_: Unset | OptionListSymbolsFormat = OptionListSymbolsFormat.NDJSON, + format_: Unset | OptionListSymbolsFormat = OptionListSymbolsFormat.JSON, ) -> dict[str, Any]: @@ -68,7 +68,7 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient | Client, - format_: Unset | OptionListSymbolsFormat = OptionListSymbolsFormat.NDJSON, + format_: Unset | OptionListSymbolsFormat = OptionListSymbolsFormat.JSON, ) -> Response[OptionListSymbolsResponse200]: """ Symbols @@ -78,7 +78,7 @@ def sync_detailed( endpoint is updated overnight. Args: - format_ (Unset | OptionListSymbolsFormat): Default: OptionListSymbolsFormat.NDJSON. + format_ (Unset | OptionListSymbolsFormat): Default: OptionListSymbolsFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -103,7 +103,7 @@ def sync_detailed( def sync( *, client: AuthenticatedClient | Client, - format_: Unset | OptionListSymbolsFormat = OptionListSymbolsFormat.NDJSON, + format_: Unset | OptionListSymbolsFormat = OptionListSymbolsFormat.JSON, ) -> OptionListSymbolsResponse200 | None: """ Symbols @@ -113,7 +113,7 @@ def sync( endpoint is updated overnight. Args: - format_ (Unset | OptionListSymbolsFormat): Default: OptionListSymbolsFormat.NDJSON. + format_ (Unset | OptionListSymbolsFormat): Default: OptionListSymbolsFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -133,7 +133,7 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient | Client, - format_: Unset | OptionListSymbolsFormat = OptionListSymbolsFormat.NDJSON, + format_: Unset | OptionListSymbolsFormat = OptionListSymbolsFormat.JSON, ) -> Response[OptionListSymbolsResponse200]: """ Symbols @@ -143,7 +143,7 @@ async def asyncio_detailed( endpoint is updated overnight. Args: - format_ (Unset | OptionListSymbolsFormat): Default: OptionListSymbolsFormat.NDJSON. + format_ (Unset | OptionListSymbolsFormat): Default: OptionListSymbolsFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -168,7 +168,7 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient | Client, - format_: Unset | OptionListSymbolsFormat = OptionListSymbolsFormat.NDJSON, + format_: Unset | OptionListSymbolsFormat = OptionListSymbolsFormat.JSON, ) -> OptionListSymbolsResponse200 | None: """ Symbols @@ -178,7 +178,7 @@ async def asyncio( endpoint is updated overnight. Args: - format_ (Unset | OptionListSymbolsFormat): Default: OptionListSymbolsFormat.NDJSON. + format_ (Unset | OptionListSymbolsFormat): Default: OptionListSymbolsFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_snapshot_greeks_all.py b/openapi_project/openapi_package/api/option/option_snapshot_greeks_all.py index 1d0bf51f2..1bd58fd7d 100644 --- a/openapi_project/openapi_package/api/option/option_snapshot_greeks_all.py +++ b/openapi_project/openapi_package/api/option/option_snapshot_greeks_all.py @@ -28,7 +28,7 @@ def _get_kwargs( rate_type: Unset | OptionSnapshotGreeksAllRateType = OptionSnapshotGreeksAllRateType.SOFR, rate_value: Unset | float = UNSET, stock_price: Unset | float = UNSET, - format_: Unset | OptionSnapshotGreeksAllFormat = OptionSnapshotGreeksAllFormat.NDJSON, + format_: Unset | OptionSnapshotGreeksAllFormat = OptionSnapshotGreeksAllFormat.JSON, ) -> dict[str, Any]: @@ -109,7 +109,7 @@ def sync_detailed( rate_type: Unset | OptionSnapshotGreeksAllRateType = OptionSnapshotGreeksAllRateType.SOFR, rate_value: Unset | float = UNSET, stock_price: Unset | float = UNSET, - format_: Unset | OptionSnapshotGreeksAllFormat = OptionSnapshotGreeksAllFormat.NDJSON, + format_: Unset | OptionSnapshotGreeksAllFormat = OptionSnapshotGreeksAllFormat.JSON, ) -> Response[OptionSnapshotGreeksAllResponse200]: """ All Greeks @@ -133,7 +133,7 @@ def sync_detailed( rate_value (Unset | float): stock_price (Unset | float): format_ (Unset | OptionSnapshotGreeksAllFormat): Default: - OptionSnapshotGreeksAllFormat.NDJSON. + OptionSnapshotGreeksAllFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -174,7 +174,7 @@ def sync( rate_type: Unset | OptionSnapshotGreeksAllRateType = OptionSnapshotGreeksAllRateType.SOFR, rate_value: Unset | float = UNSET, stock_price: Unset | float = UNSET, - format_: Unset | OptionSnapshotGreeksAllFormat = OptionSnapshotGreeksAllFormat.NDJSON, + format_: Unset | OptionSnapshotGreeksAllFormat = OptionSnapshotGreeksAllFormat.JSON, ) -> OptionSnapshotGreeksAllResponse200 | None: """ All Greeks @@ -198,7 +198,7 @@ def sync( rate_value (Unset | float): stock_price (Unset | float): format_ (Unset | OptionSnapshotGreeksAllFormat): Default: - OptionSnapshotGreeksAllFormat.NDJSON. + OptionSnapshotGreeksAllFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -234,7 +234,7 @@ async def asyncio_detailed( rate_type: Unset | OptionSnapshotGreeksAllRateType = OptionSnapshotGreeksAllRateType.SOFR, rate_value: Unset | float = UNSET, stock_price: Unset | float = UNSET, - format_: Unset | OptionSnapshotGreeksAllFormat = OptionSnapshotGreeksAllFormat.NDJSON, + format_: Unset | OptionSnapshotGreeksAllFormat = OptionSnapshotGreeksAllFormat.JSON, ) -> Response[OptionSnapshotGreeksAllResponse200]: """ All Greeks @@ -258,7 +258,7 @@ async def asyncio_detailed( rate_value (Unset | float): stock_price (Unset | float): format_ (Unset | OptionSnapshotGreeksAllFormat): Default: - OptionSnapshotGreeksAllFormat.NDJSON. + OptionSnapshotGreeksAllFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -299,7 +299,7 @@ async def asyncio( rate_type: Unset | OptionSnapshotGreeksAllRateType = OptionSnapshotGreeksAllRateType.SOFR, rate_value: Unset | float = UNSET, stock_price: Unset | float = UNSET, - format_: Unset | OptionSnapshotGreeksAllFormat = OptionSnapshotGreeksAllFormat.NDJSON, + format_: Unset | OptionSnapshotGreeksAllFormat = OptionSnapshotGreeksAllFormat.JSON, ) -> OptionSnapshotGreeksAllResponse200 | None: """ All Greeks @@ -323,7 +323,7 @@ async def asyncio( rate_value (Unset | float): stock_price (Unset | float): format_ (Unset | OptionSnapshotGreeksAllFormat): Default: - OptionSnapshotGreeksAllFormat.NDJSON. + OptionSnapshotGreeksAllFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_snapshot_greeks_first_order.py b/openapi_project/openapi_package/api/option/option_snapshot_greeks_first_order.py index 4c7019b50..5d74cd9c6 100644 --- a/openapi_project/openapi_package/api/option/option_snapshot_greeks_first_order.py +++ b/openapi_project/openapi_package/api/option/option_snapshot_greeks_first_order.py @@ -28,7 +28,7 @@ def _get_kwargs( rate_type: Unset | OptionSnapshotGreeksFirstOrderRateType = OptionSnapshotGreeksFirstOrderRateType.SOFR, rate_value: Unset | float = UNSET, stock_price: Unset | float = UNSET, - format_: Unset | OptionSnapshotGreeksFirstOrderFormat = OptionSnapshotGreeksFirstOrderFormat.NDJSON, + format_: Unset | OptionSnapshotGreeksFirstOrderFormat = OptionSnapshotGreeksFirstOrderFormat.JSON, ) -> dict[str, Any]: @@ -109,7 +109,7 @@ def sync_detailed( rate_type: Unset | OptionSnapshotGreeksFirstOrderRateType = OptionSnapshotGreeksFirstOrderRateType.SOFR, rate_value: Unset | float = UNSET, stock_price: Unset | float = UNSET, - format_: Unset | OptionSnapshotGreeksFirstOrderFormat = OptionSnapshotGreeksFirstOrderFormat.NDJSON, + format_: Unset | OptionSnapshotGreeksFirstOrderFormat = OptionSnapshotGreeksFirstOrderFormat.JSON, ) -> Response[OptionSnapshotGreeksFirstOrderResponse200]: """ First Order Greeks @@ -134,7 +134,7 @@ def sync_detailed( rate_value (Unset | float): stock_price (Unset | float): format_ (Unset | OptionSnapshotGreeksFirstOrderFormat): Default: - OptionSnapshotGreeksFirstOrderFormat.NDJSON. + OptionSnapshotGreeksFirstOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -175,7 +175,7 @@ def sync( rate_type: Unset | OptionSnapshotGreeksFirstOrderRateType = OptionSnapshotGreeksFirstOrderRateType.SOFR, rate_value: Unset | float = UNSET, stock_price: Unset | float = UNSET, - format_: Unset | OptionSnapshotGreeksFirstOrderFormat = OptionSnapshotGreeksFirstOrderFormat.NDJSON, + format_: Unset | OptionSnapshotGreeksFirstOrderFormat = OptionSnapshotGreeksFirstOrderFormat.JSON, ) -> OptionSnapshotGreeksFirstOrderResponse200 | None: """ First Order Greeks @@ -200,7 +200,7 @@ def sync( rate_value (Unset | float): stock_price (Unset | float): format_ (Unset | OptionSnapshotGreeksFirstOrderFormat): Default: - OptionSnapshotGreeksFirstOrderFormat.NDJSON. + OptionSnapshotGreeksFirstOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -236,7 +236,7 @@ async def asyncio_detailed( rate_type: Unset | OptionSnapshotGreeksFirstOrderRateType = OptionSnapshotGreeksFirstOrderRateType.SOFR, rate_value: Unset | float = UNSET, stock_price: Unset | float = UNSET, - format_: Unset | OptionSnapshotGreeksFirstOrderFormat = OptionSnapshotGreeksFirstOrderFormat.NDJSON, + format_: Unset | OptionSnapshotGreeksFirstOrderFormat = OptionSnapshotGreeksFirstOrderFormat.JSON, ) -> Response[OptionSnapshotGreeksFirstOrderResponse200]: """ First Order Greeks @@ -261,7 +261,7 @@ async def asyncio_detailed( rate_value (Unset | float): stock_price (Unset | float): format_ (Unset | OptionSnapshotGreeksFirstOrderFormat): Default: - OptionSnapshotGreeksFirstOrderFormat.NDJSON. + OptionSnapshotGreeksFirstOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -302,7 +302,7 @@ async def asyncio( rate_type: Unset | OptionSnapshotGreeksFirstOrderRateType = OptionSnapshotGreeksFirstOrderRateType.SOFR, rate_value: Unset | float = UNSET, stock_price: Unset | float = UNSET, - format_: Unset | OptionSnapshotGreeksFirstOrderFormat = OptionSnapshotGreeksFirstOrderFormat.NDJSON, + format_: Unset | OptionSnapshotGreeksFirstOrderFormat = OptionSnapshotGreeksFirstOrderFormat.JSON, ) -> OptionSnapshotGreeksFirstOrderResponse200 | None: """ First Order Greeks @@ -327,7 +327,7 @@ async def asyncio( rate_value (Unset | float): stock_price (Unset | float): format_ (Unset | OptionSnapshotGreeksFirstOrderFormat): Default: - OptionSnapshotGreeksFirstOrderFormat.NDJSON. + OptionSnapshotGreeksFirstOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_snapshot_greeks_implied_volatility.py b/openapi_project/openapi_package/api/option/option_snapshot_greeks_implied_volatility.py index 750ae8077..d80fff35c 100644 --- a/openapi_project/openapi_package/api/option/option_snapshot_greeks_implied_volatility.py +++ b/openapi_project/openapi_package/api/option/option_snapshot_greeks_implied_volatility.py @@ -28,7 +28,7 @@ def _get_kwargs( rate_type: Unset | OptionSnapshotGreeksImpliedVolatilityRateType = OptionSnapshotGreeksImpliedVolatilityRateType.SOFR, rate_value: Unset | float = UNSET, stock_price: Unset | float = UNSET, - format_: Unset | OptionSnapshotGreeksImpliedVolatilityFormat = OptionSnapshotGreeksImpliedVolatilityFormat.NDJSON, + format_: Unset | OptionSnapshotGreeksImpliedVolatilityFormat = OptionSnapshotGreeksImpliedVolatilityFormat.JSON, ) -> dict[str, Any]: @@ -109,7 +109,7 @@ def sync_detailed( rate_type: Unset | OptionSnapshotGreeksImpliedVolatilityRateType = OptionSnapshotGreeksImpliedVolatilityRateType.SOFR, rate_value: Unset | float = UNSET, stock_price: Unset | float = UNSET, - format_: Unset | OptionSnapshotGreeksImpliedVolatilityFormat = OptionSnapshotGreeksImpliedVolatilityFormat.NDJSON, + format_: Unset | OptionSnapshotGreeksImpliedVolatilityFormat = OptionSnapshotGreeksImpliedVolatilityFormat.JSON, ) -> Response[OptionSnapshotGreeksImpliedVolatilityResponse200]: """ Implied Volatility @@ -132,7 +132,7 @@ def sync_detailed( rate_value (Unset | float): stock_price (Unset | float): format_ (Unset | OptionSnapshotGreeksImpliedVolatilityFormat): Default: - OptionSnapshotGreeksImpliedVolatilityFormat.NDJSON. + OptionSnapshotGreeksImpliedVolatilityFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -173,7 +173,7 @@ def sync( rate_type: Unset | OptionSnapshotGreeksImpliedVolatilityRateType = OptionSnapshotGreeksImpliedVolatilityRateType.SOFR, rate_value: Unset | float = UNSET, stock_price: Unset | float = UNSET, - format_: Unset | OptionSnapshotGreeksImpliedVolatilityFormat = OptionSnapshotGreeksImpliedVolatilityFormat.NDJSON, + format_: Unset | OptionSnapshotGreeksImpliedVolatilityFormat = OptionSnapshotGreeksImpliedVolatilityFormat.JSON, ) -> OptionSnapshotGreeksImpliedVolatilityResponse200 | None: """ Implied Volatility @@ -196,7 +196,7 @@ def sync( rate_value (Unset | float): stock_price (Unset | float): format_ (Unset | OptionSnapshotGreeksImpliedVolatilityFormat): Default: - OptionSnapshotGreeksImpliedVolatilityFormat.NDJSON. + OptionSnapshotGreeksImpliedVolatilityFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -232,7 +232,7 @@ async def asyncio_detailed( rate_type: Unset | OptionSnapshotGreeksImpliedVolatilityRateType = OptionSnapshotGreeksImpliedVolatilityRateType.SOFR, rate_value: Unset | float = UNSET, stock_price: Unset | float = UNSET, - format_: Unset | OptionSnapshotGreeksImpliedVolatilityFormat = OptionSnapshotGreeksImpliedVolatilityFormat.NDJSON, + format_: Unset | OptionSnapshotGreeksImpliedVolatilityFormat = OptionSnapshotGreeksImpliedVolatilityFormat.JSON, ) -> Response[OptionSnapshotGreeksImpliedVolatilityResponse200]: """ Implied Volatility @@ -255,7 +255,7 @@ async def asyncio_detailed( rate_value (Unset | float): stock_price (Unset | float): format_ (Unset | OptionSnapshotGreeksImpliedVolatilityFormat): Default: - OptionSnapshotGreeksImpliedVolatilityFormat.NDJSON. + OptionSnapshotGreeksImpliedVolatilityFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -296,7 +296,7 @@ async def asyncio( rate_type: Unset | OptionSnapshotGreeksImpliedVolatilityRateType = OptionSnapshotGreeksImpliedVolatilityRateType.SOFR, rate_value: Unset | float = UNSET, stock_price: Unset | float = UNSET, - format_: Unset | OptionSnapshotGreeksImpliedVolatilityFormat = OptionSnapshotGreeksImpliedVolatilityFormat.NDJSON, + format_: Unset | OptionSnapshotGreeksImpliedVolatilityFormat = OptionSnapshotGreeksImpliedVolatilityFormat.JSON, ) -> OptionSnapshotGreeksImpliedVolatilityResponse200 | None: """ Implied Volatility @@ -319,7 +319,7 @@ async def asyncio( rate_value (Unset | float): stock_price (Unset | float): format_ (Unset | OptionSnapshotGreeksImpliedVolatilityFormat): Default: - OptionSnapshotGreeksImpliedVolatilityFormat.NDJSON. + OptionSnapshotGreeksImpliedVolatilityFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_snapshot_greeks_second_order.py b/openapi_project/openapi_package/api/option/option_snapshot_greeks_second_order.py index f088fc303..0e70c7035 100644 --- a/openapi_project/openapi_package/api/option/option_snapshot_greeks_second_order.py +++ b/openapi_project/openapi_package/api/option/option_snapshot_greeks_second_order.py @@ -28,7 +28,7 @@ def _get_kwargs( rate_type: Unset | OptionSnapshotGreeksSecondOrderRateType = OptionSnapshotGreeksSecondOrderRateType.SOFR, rate_value: Unset | float = UNSET, stock_price: Unset | float = UNSET, - format_: Unset | OptionSnapshotGreeksSecondOrderFormat = OptionSnapshotGreeksSecondOrderFormat.NDJSON, + format_: Unset | OptionSnapshotGreeksSecondOrderFormat = OptionSnapshotGreeksSecondOrderFormat.JSON, ) -> dict[str, Any]: @@ -109,7 +109,7 @@ def sync_detailed( rate_type: Unset | OptionSnapshotGreeksSecondOrderRateType = OptionSnapshotGreeksSecondOrderRateType.SOFR, rate_value: Unset | float = UNSET, stock_price: Unset | float = UNSET, - format_: Unset | OptionSnapshotGreeksSecondOrderFormat = OptionSnapshotGreeksSecondOrderFormat.NDJSON, + format_: Unset | OptionSnapshotGreeksSecondOrderFormat = OptionSnapshotGreeksSecondOrderFormat.JSON, ) -> Response[OptionSnapshotGreeksSecondOrderResponse200]: """ Second Order Greeks @@ -134,7 +134,7 @@ def sync_detailed( rate_value (Unset | float): stock_price (Unset | float): format_ (Unset | OptionSnapshotGreeksSecondOrderFormat): Default: - OptionSnapshotGreeksSecondOrderFormat.NDJSON. + OptionSnapshotGreeksSecondOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -175,7 +175,7 @@ def sync( rate_type: Unset | OptionSnapshotGreeksSecondOrderRateType = OptionSnapshotGreeksSecondOrderRateType.SOFR, rate_value: Unset | float = UNSET, stock_price: Unset | float = UNSET, - format_: Unset | OptionSnapshotGreeksSecondOrderFormat = OptionSnapshotGreeksSecondOrderFormat.NDJSON, + format_: Unset | OptionSnapshotGreeksSecondOrderFormat = OptionSnapshotGreeksSecondOrderFormat.JSON, ) -> OptionSnapshotGreeksSecondOrderResponse200 | None: """ Second Order Greeks @@ -200,7 +200,7 @@ def sync( rate_value (Unset | float): stock_price (Unset | float): format_ (Unset | OptionSnapshotGreeksSecondOrderFormat): Default: - OptionSnapshotGreeksSecondOrderFormat.NDJSON. + OptionSnapshotGreeksSecondOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -236,7 +236,7 @@ async def asyncio_detailed( rate_type: Unset | OptionSnapshotGreeksSecondOrderRateType = OptionSnapshotGreeksSecondOrderRateType.SOFR, rate_value: Unset | float = UNSET, stock_price: Unset | float = UNSET, - format_: Unset | OptionSnapshotGreeksSecondOrderFormat = OptionSnapshotGreeksSecondOrderFormat.NDJSON, + format_: Unset | OptionSnapshotGreeksSecondOrderFormat = OptionSnapshotGreeksSecondOrderFormat.JSON, ) -> Response[OptionSnapshotGreeksSecondOrderResponse200]: """ Second Order Greeks @@ -261,7 +261,7 @@ async def asyncio_detailed( rate_value (Unset | float): stock_price (Unset | float): format_ (Unset | OptionSnapshotGreeksSecondOrderFormat): Default: - OptionSnapshotGreeksSecondOrderFormat.NDJSON. + OptionSnapshotGreeksSecondOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -302,7 +302,7 @@ async def asyncio( rate_type: Unset | OptionSnapshotGreeksSecondOrderRateType = OptionSnapshotGreeksSecondOrderRateType.SOFR, rate_value: Unset | float = UNSET, stock_price: Unset | float = UNSET, - format_: Unset | OptionSnapshotGreeksSecondOrderFormat = OptionSnapshotGreeksSecondOrderFormat.NDJSON, + format_: Unset | OptionSnapshotGreeksSecondOrderFormat = OptionSnapshotGreeksSecondOrderFormat.JSON, ) -> OptionSnapshotGreeksSecondOrderResponse200 | None: """ Second Order Greeks @@ -327,7 +327,7 @@ async def asyncio( rate_value (Unset | float): stock_price (Unset | float): format_ (Unset | OptionSnapshotGreeksSecondOrderFormat): Default: - OptionSnapshotGreeksSecondOrderFormat.NDJSON. + OptionSnapshotGreeksSecondOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_snapshot_greeks_third_order.py b/openapi_project/openapi_package/api/option/option_snapshot_greeks_third_order.py index be8b9452e..3eb34608d 100644 --- a/openapi_project/openapi_package/api/option/option_snapshot_greeks_third_order.py +++ b/openapi_project/openapi_package/api/option/option_snapshot_greeks_third_order.py @@ -28,7 +28,7 @@ def _get_kwargs( rate_type: Unset | OptionSnapshotGreeksThirdOrderRateType = OptionSnapshotGreeksThirdOrderRateType.SOFR, rate_value: Unset | float = UNSET, stock_price: Unset | float = UNSET, - format_: Unset | OptionSnapshotGreeksThirdOrderFormat = OptionSnapshotGreeksThirdOrderFormat.NDJSON, + format_: Unset | OptionSnapshotGreeksThirdOrderFormat = OptionSnapshotGreeksThirdOrderFormat.JSON, ) -> dict[str, Any]: @@ -109,7 +109,7 @@ def sync_detailed( rate_type: Unset | OptionSnapshotGreeksThirdOrderRateType = OptionSnapshotGreeksThirdOrderRateType.SOFR, rate_value: Unset | float = UNSET, stock_price: Unset | float = UNSET, - format_: Unset | OptionSnapshotGreeksThirdOrderFormat = OptionSnapshotGreeksThirdOrderFormat.NDJSON, + format_: Unset | OptionSnapshotGreeksThirdOrderFormat = OptionSnapshotGreeksThirdOrderFormat.JSON, ) -> Response[OptionSnapshotGreeksThirdOrderResponse200]: """ Third Order Greeks @@ -134,7 +134,7 @@ def sync_detailed( rate_value (Unset | float): stock_price (Unset | float): format_ (Unset | OptionSnapshotGreeksThirdOrderFormat): Default: - OptionSnapshotGreeksThirdOrderFormat.NDJSON. + OptionSnapshotGreeksThirdOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -175,7 +175,7 @@ def sync( rate_type: Unset | OptionSnapshotGreeksThirdOrderRateType = OptionSnapshotGreeksThirdOrderRateType.SOFR, rate_value: Unset | float = UNSET, stock_price: Unset | float = UNSET, - format_: Unset | OptionSnapshotGreeksThirdOrderFormat = OptionSnapshotGreeksThirdOrderFormat.NDJSON, + format_: Unset | OptionSnapshotGreeksThirdOrderFormat = OptionSnapshotGreeksThirdOrderFormat.JSON, ) -> OptionSnapshotGreeksThirdOrderResponse200 | None: """ Third Order Greeks @@ -200,7 +200,7 @@ def sync( rate_value (Unset | float): stock_price (Unset | float): format_ (Unset | OptionSnapshotGreeksThirdOrderFormat): Default: - OptionSnapshotGreeksThirdOrderFormat.NDJSON. + OptionSnapshotGreeksThirdOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -236,7 +236,7 @@ async def asyncio_detailed( rate_type: Unset | OptionSnapshotGreeksThirdOrderRateType = OptionSnapshotGreeksThirdOrderRateType.SOFR, rate_value: Unset | float = UNSET, stock_price: Unset | float = UNSET, - format_: Unset | OptionSnapshotGreeksThirdOrderFormat = OptionSnapshotGreeksThirdOrderFormat.NDJSON, + format_: Unset | OptionSnapshotGreeksThirdOrderFormat = OptionSnapshotGreeksThirdOrderFormat.JSON, ) -> Response[OptionSnapshotGreeksThirdOrderResponse200]: """ Third Order Greeks @@ -261,7 +261,7 @@ async def asyncio_detailed( rate_value (Unset | float): stock_price (Unset | float): format_ (Unset | OptionSnapshotGreeksThirdOrderFormat): Default: - OptionSnapshotGreeksThirdOrderFormat.NDJSON. + OptionSnapshotGreeksThirdOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -302,7 +302,7 @@ async def asyncio( rate_type: Unset | OptionSnapshotGreeksThirdOrderRateType = OptionSnapshotGreeksThirdOrderRateType.SOFR, rate_value: Unset | float = UNSET, stock_price: Unset | float = UNSET, - format_: Unset | OptionSnapshotGreeksThirdOrderFormat = OptionSnapshotGreeksThirdOrderFormat.NDJSON, + format_: Unset | OptionSnapshotGreeksThirdOrderFormat = OptionSnapshotGreeksThirdOrderFormat.JSON, ) -> OptionSnapshotGreeksThirdOrderResponse200 | None: """ Third Order Greeks @@ -327,7 +327,7 @@ async def asyncio( rate_value (Unset | float): stock_price (Unset | float): format_ (Unset | OptionSnapshotGreeksThirdOrderFormat): Default: - OptionSnapshotGreeksThirdOrderFormat.NDJSON. + OptionSnapshotGreeksThirdOrderFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_snapshot_ohlc.py b/openapi_project/openapi_package/api/option/option_snapshot_ohlc.py index 461731fc8..82a7fdad9 100644 --- a/openapi_project/openapi_package/api/option/option_snapshot_ohlc.py +++ b/openapi_project/openapi_package/api/option/option_snapshot_ohlc.py @@ -23,7 +23,7 @@ def _get_kwargs( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionSnapshotOhlcRight = OptionSnapshotOhlcRight.BOTH, - format_: Unset | OptionSnapshotOhlcFormat = OptionSnapshotOhlcFormat.NDJSON, + format_: Unset | OptionSnapshotOhlcFormat = OptionSnapshotOhlcFormat.JSON, ) -> dict[str, Any]: @@ -90,7 +90,7 @@ def sync_detailed( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionSnapshotOhlcRight = OptionSnapshotOhlcRight.BOTH, - format_: Unset | OptionSnapshotOhlcFormat = OptionSnapshotOhlcFormat.NDJSON, + format_: Unset | OptionSnapshotOhlcFormat = OptionSnapshotOhlcFormat.JSON, ) -> Response[OptionSnapshotOhlcResponse200]: """ Open High Low Close @@ -104,7 +104,7 @@ def sync_detailed( expiration (datetime.date): strike (Unset | str): Default: '*'. right (Unset | OptionSnapshotOhlcRight): Default: OptionSnapshotOhlcRight.BOTH. - format_ (Unset | OptionSnapshotOhlcFormat): Default: OptionSnapshotOhlcFormat.NDJSON. + format_ (Unset | OptionSnapshotOhlcFormat): Default: OptionSnapshotOhlcFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -137,7 +137,7 @@ def sync( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionSnapshotOhlcRight = OptionSnapshotOhlcRight.BOTH, - format_: Unset | OptionSnapshotOhlcFormat = OptionSnapshotOhlcFormat.NDJSON, + format_: Unset | OptionSnapshotOhlcFormat = OptionSnapshotOhlcFormat.JSON, ) -> OptionSnapshotOhlcResponse200 | None: """ Open High Low Close @@ -151,7 +151,7 @@ def sync( expiration (datetime.date): strike (Unset | str): Default: '*'. right (Unset | OptionSnapshotOhlcRight): Default: OptionSnapshotOhlcRight.BOTH. - format_ (Unset | OptionSnapshotOhlcFormat): Default: OptionSnapshotOhlcFormat.NDJSON. + format_ (Unset | OptionSnapshotOhlcFormat): Default: OptionSnapshotOhlcFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -179,7 +179,7 @@ async def asyncio_detailed( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionSnapshotOhlcRight = OptionSnapshotOhlcRight.BOTH, - format_: Unset | OptionSnapshotOhlcFormat = OptionSnapshotOhlcFormat.NDJSON, + format_: Unset | OptionSnapshotOhlcFormat = OptionSnapshotOhlcFormat.JSON, ) -> Response[OptionSnapshotOhlcResponse200]: """ Open High Low Close @@ -193,7 +193,7 @@ async def asyncio_detailed( expiration (datetime.date): strike (Unset | str): Default: '*'. right (Unset | OptionSnapshotOhlcRight): Default: OptionSnapshotOhlcRight.BOTH. - format_ (Unset | OptionSnapshotOhlcFormat): Default: OptionSnapshotOhlcFormat.NDJSON. + format_ (Unset | OptionSnapshotOhlcFormat): Default: OptionSnapshotOhlcFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -226,7 +226,7 @@ async def asyncio( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionSnapshotOhlcRight = OptionSnapshotOhlcRight.BOTH, - format_: Unset | OptionSnapshotOhlcFormat = OptionSnapshotOhlcFormat.NDJSON, + format_: Unset | OptionSnapshotOhlcFormat = OptionSnapshotOhlcFormat.JSON, ) -> OptionSnapshotOhlcResponse200 | None: """ Open High Low Close @@ -240,7 +240,7 @@ async def asyncio( expiration (datetime.date): strike (Unset | str): Default: '*'. right (Unset | OptionSnapshotOhlcRight): Default: OptionSnapshotOhlcRight.BOTH. - format_ (Unset | OptionSnapshotOhlcFormat): Default: OptionSnapshotOhlcFormat.NDJSON. + format_ (Unset | OptionSnapshotOhlcFormat): Default: OptionSnapshotOhlcFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_snapshot_open_interest.py b/openapi_project/openapi_package/api/option/option_snapshot_open_interest.py index a89ca5a68..419888c2a 100644 --- a/openapi_project/openapi_package/api/option/option_snapshot_open_interest.py +++ b/openapi_project/openapi_package/api/option/option_snapshot_open_interest.py @@ -23,7 +23,7 @@ def _get_kwargs( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionSnapshotOpenInterestRight = OptionSnapshotOpenInterestRight.BOTH, - format_: Unset | OptionSnapshotOpenInterestFormat = OptionSnapshotOpenInterestFormat.NDJSON, + format_: Unset | OptionSnapshotOpenInterestFormat = OptionSnapshotOpenInterestFormat.JSON, ) -> dict[str, Any]: @@ -90,7 +90,7 @@ def sync_detailed( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionSnapshotOpenInterestRight = OptionSnapshotOpenInterestRight.BOTH, - format_: Unset | OptionSnapshotOpenInterestFormat = OptionSnapshotOpenInterestFormat.NDJSON, + format_: Unset | OptionSnapshotOpenInterestFormat = OptionSnapshotOpenInterestFormat.JSON, ) -> Response[OptionSnapshotOpenInterestResponse200]: """ Open Interest @@ -110,7 +110,7 @@ def sync_detailed( right (Unset | OptionSnapshotOpenInterestRight): Default: OptionSnapshotOpenInterestRight.BOTH. format_ (Unset | OptionSnapshotOpenInterestFormat): Default: - OptionSnapshotOpenInterestFormat.NDJSON. + OptionSnapshotOpenInterestFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,7 +143,7 @@ def sync( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionSnapshotOpenInterestRight = OptionSnapshotOpenInterestRight.BOTH, - format_: Unset | OptionSnapshotOpenInterestFormat = OptionSnapshotOpenInterestFormat.NDJSON, + format_: Unset | OptionSnapshotOpenInterestFormat = OptionSnapshotOpenInterestFormat.JSON, ) -> OptionSnapshotOpenInterestResponse200 | None: """ Open Interest @@ -163,7 +163,7 @@ def sync( right (Unset | OptionSnapshotOpenInterestRight): Default: OptionSnapshotOpenInterestRight.BOTH. format_ (Unset | OptionSnapshotOpenInterestFormat): Default: - OptionSnapshotOpenInterestFormat.NDJSON. + OptionSnapshotOpenInterestFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -191,7 +191,7 @@ async def asyncio_detailed( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionSnapshotOpenInterestRight = OptionSnapshotOpenInterestRight.BOTH, - format_: Unset | OptionSnapshotOpenInterestFormat = OptionSnapshotOpenInterestFormat.NDJSON, + format_: Unset | OptionSnapshotOpenInterestFormat = OptionSnapshotOpenInterestFormat.JSON, ) -> Response[OptionSnapshotOpenInterestResponse200]: """ Open Interest @@ -211,7 +211,7 @@ async def asyncio_detailed( right (Unset | OptionSnapshotOpenInterestRight): Default: OptionSnapshotOpenInterestRight.BOTH. format_ (Unset | OptionSnapshotOpenInterestFormat): Default: - OptionSnapshotOpenInterestFormat.NDJSON. + OptionSnapshotOpenInterestFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -244,7 +244,7 @@ async def asyncio( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionSnapshotOpenInterestRight = OptionSnapshotOpenInterestRight.BOTH, - format_: Unset | OptionSnapshotOpenInterestFormat = OptionSnapshotOpenInterestFormat.NDJSON, + format_: Unset | OptionSnapshotOpenInterestFormat = OptionSnapshotOpenInterestFormat.JSON, ) -> OptionSnapshotOpenInterestResponse200 | None: """ Open Interest @@ -264,7 +264,7 @@ async def asyncio( right (Unset | OptionSnapshotOpenInterestRight): Default: OptionSnapshotOpenInterestRight.BOTH. format_ (Unset | OptionSnapshotOpenInterestFormat): Default: - OptionSnapshotOpenInterestFormat.NDJSON. + OptionSnapshotOpenInterestFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_snapshot_quote.py b/openapi_project/openapi_package/api/option/option_snapshot_quote.py index ec2b74ed6..cc36ad3ae 100644 --- a/openapi_project/openapi_package/api/option/option_snapshot_quote.py +++ b/openapi_project/openapi_package/api/option/option_snapshot_quote.py @@ -23,7 +23,7 @@ def _get_kwargs( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionSnapshotQuoteRight = OptionSnapshotQuoteRight.BOTH, - format_: Unset | OptionSnapshotQuoteFormat = OptionSnapshotQuoteFormat.NDJSON, + format_: Unset | OptionSnapshotQuoteFormat = OptionSnapshotQuoteFormat.JSON, ) -> dict[str, Any]: @@ -90,7 +90,7 @@ def sync_detailed( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionSnapshotQuoteRight = OptionSnapshotQuoteRight.BOTH, - format_: Unset | OptionSnapshotQuoteFormat = OptionSnapshotQuoteFormat.NDJSON, + format_: Unset | OptionSnapshotQuoteFormat = OptionSnapshotQuoteFormat.JSON, ) -> Response[OptionSnapshotQuoteResponse200]: """ Quote @@ -107,7 +107,7 @@ def sync_detailed( expiration (datetime.date): strike (Unset | str): Default: '*'. right (Unset | OptionSnapshotQuoteRight): Default: OptionSnapshotQuoteRight.BOTH. - format_ (Unset | OptionSnapshotQuoteFormat): Default: OptionSnapshotQuoteFormat.NDJSON. + format_ (Unset | OptionSnapshotQuoteFormat): Default: OptionSnapshotQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -140,7 +140,7 @@ def sync( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionSnapshotQuoteRight = OptionSnapshotQuoteRight.BOTH, - format_: Unset | OptionSnapshotQuoteFormat = OptionSnapshotQuoteFormat.NDJSON, + format_: Unset | OptionSnapshotQuoteFormat = OptionSnapshotQuoteFormat.JSON, ) -> OptionSnapshotQuoteResponse200 | None: """ Quote @@ -157,7 +157,7 @@ def sync( expiration (datetime.date): strike (Unset | str): Default: '*'. right (Unset | OptionSnapshotQuoteRight): Default: OptionSnapshotQuoteRight.BOTH. - format_ (Unset | OptionSnapshotQuoteFormat): Default: OptionSnapshotQuoteFormat.NDJSON. + format_ (Unset | OptionSnapshotQuoteFormat): Default: OptionSnapshotQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -185,7 +185,7 @@ async def asyncio_detailed( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionSnapshotQuoteRight = OptionSnapshotQuoteRight.BOTH, - format_: Unset | OptionSnapshotQuoteFormat = OptionSnapshotQuoteFormat.NDJSON, + format_: Unset | OptionSnapshotQuoteFormat = OptionSnapshotQuoteFormat.JSON, ) -> Response[OptionSnapshotQuoteResponse200]: """ Quote @@ -202,7 +202,7 @@ async def asyncio_detailed( expiration (datetime.date): strike (Unset | str): Default: '*'. right (Unset | OptionSnapshotQuoteRight): Default: OptionSnapshotQuoteRight.BOTH. - format_ (Unset | OptionSnapshotQuoteFormat): Default: OptionSnapshotQuoteFormat.NDJSON. + format_ (Unset | OptionSnapshotQuoteFormat): Default: OptionSnapshotQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -235,7 +235,7 @@ async def asyncio( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionSnapshotQuoteRight = OptionSnapshotQuoteRight.BOTH, - format_: Unset | OptionSnapshotQuoteFormat = OptionSnapshotQuoteFormat.NDJSON, + format_: Unset | OptionSnapshotQuoteFormat = OptionSnapshotQuoteFormat.JSON, ) -> OptionSnapshotQuoteResponse200 | None: """ Quote @@ -252,7 +252,7 @@ async def asyncio( expiration (datetime.date): strike (Unset | str): Default: '*'. right (Unset | OptionSnapshotQuoteRight): Default: OptionSnapshotQuoteRight.BOTH. - format_ (Unset | OptionSnapshotQuoteFormat): Default: OptionSnapshotQuoteFormat.NDJSON. + format_ (Unset | OptionSnapshotQuoteFormat): Default: OptionSnapshotQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/option/option_snapshot_trade.py b/openapi_project/openapi_package/api/option/option_snapshot_trade.py index 6bc82afd2..66eb9ff4d 100644 --- a/openapi_project/openapi_package/api/option/option_snapshot_trade.py +++ b/openapi_project/openapi_package/api/option/option_snapshot_trade.py @@ -23,7 +23,7 @@ def _get_kwargs( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionSnapshotTradeRight = OptionSnapshotTradeRight.BOTH, - format_: Unset | OptionSnapshotTradeFormat = OptionSnapshotTradeFormat.NDJSON, + format_: Unset | OptionSnapshotTradeFormat = OptionSnapshotTradeFormat.JSON, ) -> dict[str, Any]: @@ -90,7 +90,7 @@ def sync_detailed( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionSnapshotTradeRight = OptionSnapshotTradeRight.BOTH, - format_: Unset | OptionSnapshotTradeFormat = OptionSnapshotTradeFormat.NDJSON, + format_: Unset | OptionSnapshotTradeFormat = OptionSnapshotTradeFormat.JSON, ) -> Response[OptionSnapshotTradeResponse200]: """ Trade @@ -106,7 +106,7 @@ def sync_detailed( expiration (datetime.date): strike (Unset | str): Default: '*'. right (Unset | OptionSnapshotTradeRight): Default: OptionSnapshotTradeRight.BOTH. - format_ (Unset | OptionSnapshotTradeFormat): Default: OptionSnapshotTradeFormat.NDJSON. + format_ (Unset | OptionSnapshotTradeFormat): Default: OptionSnapshotTradeFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,7 +139,7 @@ def sync( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionSnapshotTradeRight = OptionSnapshotTradeRight.BOTH, - format_: Unset | OptionSnapshotTradeFormat = OptionSnapshotTradeFormat.NDJSON, + format_: Unset | OptionSnapshotTradeFormat = OptionSnapshotTradeFormat.JSON, ) -> OptionSnapshotTradeResponse200 | None: """ Trade @@ -155,7 +155,7 @@ def sync( expiration (datetime.date): strike (Unset | str): Default: '*'. right (Unset | OptionSnapshotTradeRight): Default: OptionSnapshotTradeRight.BOTH. - format_ (Unset | OptionSnapshotTradeFormat): Default: OptionSnapshotTradeFormat.NDJSON. + format_ (Unset | OptionSnapshotTradeFormat): Default: OptionSnapshotTradeFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -183,7 +183,7 @@ async def asyncio_detailed( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionSnapshotTradeRight = OptionSnapshotTradeRight.BOTH, - format_: Unset | OptionSnapshotTradeFormat = OptionSnapshotTradeFormat.NDJSON, + format_: Unset | OptionSnapshotTradeFormat = OptionSnapshotTradeFormat.JSON, ) -> Response[OptionSnapshotTradeResponse200]: """ Trade @@ -199,7 +199,7 @@ async def asyncio_detailed( expiration (datetime.date): strike (Unset | str): Default: '*'. right (Unset | OptionSnapshotTradeRight): Default: OptionSnapshotTradeRight.BOTH. - format_ (Unset | OptionSnapshotTradeFormat): Default: OptionSnapshotTradeFormat.NDJSON. + format_ (Unset | OptionSnapshotTradeFormat): Default: OptionSnapshotTradeFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -232,7 +232,7 @@ async def asyncio( expiration: datetime.date, strike: Unset | str = '*', right: Unset | OptionSnapshotTradeRight = OptionSnapshotTradeRight.BOTH, - format_: Unset | OptionSnapshotTradeFormat = OptionSnapshotTradeFormat.NDJSON, + format_: Unset | OptionSnapshotTradeFormat = OptionSnapshotTradeFormat.JSON, ) -> OptionSnapshotTradeResponse200 | None: """ Trade @@ -248,7 +248,7 @@ async def asyncio( expiration (datetime.date): strike (Unset | str): Default: '*'. right (Unset | OptionSnapshotTradeRight): Default: OptionSnapshotTradeRight.BOTH. - format_ (Unset | OptionSnapshotTradeFormat): Default: OptionSnapshotTradeFormat.NDJSON. + format_ (Unset | OptionSnapshotTradeFormat): Default: OptionSnapshotTradeFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/stock/stock_at_time_quote.py b/openapi_project/openapi_package/api/stock/stock_at_time_quote.py index b13133013..361d686f9 100644 --- a/openapi_project/openapi_package/api/stock/stock_at_time_quote.py +++ b/openapi_project/openapi_package/api/stock/stock_at_time_quote.py @@ -24,7 +24,7 @@ def _get_kwargs( end_date: datetime.date, time_of_day: str, venue: Unset | StockAtTimeQuoteVenue = StockAtTimeQuoteVenue.NQB, - format_: Unset | StockAtTimeQuoteFormat = StockAtTimeQuoteFormat.NDJSON, + format_: Unset | StockAtTimeQuoteFormat = StockAtTimeQuoteFormat.JSON, ) -> dict[str, Any]: @@ -95,7 +95,7 @@ def sync_detailed( end_date: datetime.date, time_of_day: str, venue: Unset | StockAtTimeQuoteVenue = StockAtTimeQuoteVenue.NQB, - format_: Unset | StockAtTimeQuoteFormat = StockAtTimeQuoteFormat.NDJSON, + format_: Unset | StockAtTimeQuoteFormat = StockAtTimeQuoteFormat.JSON, ) -> Response[StockAtTimeQuoteResponse200]: """ Quote @@ -119,7 +119,7 @@ def sync_detailed( end_date (datetime.date): time_of_day (str): venue (Unset | StockAtTimeQuoteVenue): Default: StockAtTimeQuoteVenue.NQB. - format_ (Unset | StockAtTimeQuoteFormat): Default: StockAtTimeQuoteFormat.NDJSON. + format_ (Unset | StockAtTimeQuoteFormat): Default: StockAtTimeQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -154,7 +154,7 @@ def sync( end_date: datetime.date, time_of_day: str, venue: Unset | StockAtTimeQuoteVenue = StockAtTimeQuoteVenue.NQB, - format_: Unset | StockAtTimeQuoteFormat = StockAtTimeQuoteFormat.NDJSON, + format_: Unset | StockAtTimeQuoteFormat = StockAtTimeQuoteFormat.JSON, ) -> StockAtTimeQuoteResponse200 | None: """ Quote @@ -178,7 +178,7 @@ def sync( end_date (datetime.date): time_of_day (str): venue (Unset | StockAtTimeQuoteVenue): Default: StockAtTimeQuoteVenue.NQB. - format_ (Unset | StockAtTimeQuoteFormat): Default: StockAtTimeQuoteFormat.NDJSON. + format_ (Unset | StockAtTimeQuoteFormat): Default: StockAtTimeQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -208,7 +208,7 @@ async def asyncio_detailed( end_date: datetime.date, time_of_day: str, venue: Unset | StockAtTimeQuoteVenue = StockAtTimeQuoteVenue.NQB, - format_: Unset | StockAtTimeQuoteFormat = StockAtTimeQuoteFormat.NDJSON, + format_: Unset | StockAtTimeQuoteFormat = StockAtTimeQuoteFormat.JSON, ) -> Response[StockAtTimeQuoteResponse200]: """ Quote @@ -232,7 +232,7 @@ async def asyncio_detailed( end_date (datetime.date): time_of_day (str): venue (Unset | StockAtTimeQuoteVenue): Default: StockAtTimeQuoteVenue.NQB. - format_ (Unset | StockAtTimeQuoteFormat): Default: StockAtTimeQuoteFormat.NDJSON. + format_ (Unset | StockAtTimeQuoteFormat): Default: StockAtTimeQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -267,7 +267,7 @@ async def asyncio( end_date: datetime.date, time_of_day: str, venue: Unset | StockAtTimeQuoteVenue = StockAtTimeQuoteVenue.NQB, - format_: Unset | StockAtTimeQuoteFormat = StockAtTimeQuoteFormat.NDJSON, + format_: Unset | StockAtTimeQuoteFormat = StockAtTimeQuoteFormat.JSON, ) -> StockAtTimeQuoteResponse200 | None: """ Quote @@ -291,7 +291,7 @@ async def asyncio( end_date (datetime.date): time_of_day (str): venue (Unset | StockAtTimeQuoteVenue): Default: StockAtTimeQuoteVenue.NQB. - format_ (Unset | StockAtTimeQuoteFormat): Default: StockAtTimeQuoteFormat.NDJSON. + format_ (Unset | StockAtTimeQuoteFormat): Default: StockAtTimeQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/stock/stock_at_time_trade.py b/openapi_project/openapi_package/api/stock/stock_at_time_trade.py index e426a7a60..99d70758f 100644 --- a/openapi_project/openapi_package/api/stock/stock_at_time_trade.py +++ b/openapi_project/openapi_package/api/stock/stock_at_time_trade.py @@ -24,7 +24,7 @@ def _get_kwargs( end_date: datetime.date, time_of_day: str, venue: Unset | StockAtTimeTradeVenue = StockAtTimeTradeVenue.NQB, - format_: Unset | StockAtTimeTradeFormat = StockAtTimeTradeFormat.NDJSON, + format_: Unset | StockAtTimeTradeFormat = StockAtTimeTradeFormat.JSON, ) -> dict[str, Any]: @@ -95,7 +95,7 @@ def sync_detailed( end_date: datetime.date, time_of_day: str, venue: Unset | StockAtTimeTradeVenue = StockAtTimeTradeVenue.NQB, - format_: Unset | StockAtTimeTradeFormat = StockAtTimeTradeFormat.NDJSON, + format_: Unset | StockAtTimeTradeFormat = StockAtTimeTradeFormat.JSON, ) -> Response[StockAtTimeTradeResponse200]: """ Trade @@ -120,7 +120,7 @@ def sync_detailed( end_date (datetime.date): time_of_day (str): venue (Unset | StockAtTimeTradeVenue): Default: StockAtTimeTradeVenue.NQB. - format_ (Unset | StockAtTimeTradeFormat): Default: StockAtTimeTradeFormat.NDJSON. + format_ (Unset | StockAtTimeTradeFormat): Default: StockAtTimeTradeFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -155,7 +155,7 @@ def sync( end_date: datetime.date, time_of_day: str, venue: Unset | StockAtTimeTradeVenue = StockAtTimeTradeVenue.NQB, - format_: Unset | StockAtTimeTradeFormat = StockAtTimeTradeFormat.NDJSON, + format_: Unset | StockAtTimeTradeFormat = StockAtTimeTradeFormat.JSON, ) -> StockAtTimeTradeResponse200 | None: """ Trade @@ -180,7 +180,7 @@ def sync( end_date (datetime.date): time_of_day (str): venue (Unset | StockAtTimeTradeVenue): Default: StockAtTimeTradeVenue.NQB. - format_ (Unset | StockAtTimeTradeFormat): Default: StockAtTimeTradeFormat.NDJSON. + format_ (Unset | StockAtTimeTradeFormat): Default: StockAtTimeTradeFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -210,7 +210,7 @@ async def asyncio_detailed( end_date: datetime.date, time_of_day: str, venue: Unset | StockAtTimeTradeVenue = StockAtTimeTradeVenue.NQB, - format_: Unset | StockAtTimeTradeFormat = StockAtTimeTradeFormat.NDJSON, + format_: Unset | StockAtTimeTradeFormat = StockAtTimeTradeFormat.JSON, ) -> Response[StockAtTimeTradeResponse200]: """ Trade @@ -235,7 +235,7 @@ async def asyncio_detailed( end_date (datetime.date): time_of_day (str): venue (Unset | StockAtTimeTradeVenue): Default: StockAtTimeTradeVenue.NQB. - format_ (Unset | StockAtTimeTradeFormat): Default: StockAtTimeTradeFormat.NDJSON. + format_ (Unset | StockAtTimeTradeFormat): Default: StockAtTimeTradeFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -270,7 +270,7 @@ async def asyncio( end_date: datetime.date, time_of_day: str, venue: Unset | StockAtTimeTradeVenue = StockAtTimeTradeVenue.NQB, - format_: Unset | StockAtTimeTradeFormat = StockAtTimeTradeFormat.NDJSON, + format_: Unset | StockAtTimeTradeFormat = StockAtTimeTradeFormat.JSON, ) -> StockAtTimeTradeResponse200 | None: """ Trade @@ -295,7 +295,7 @@ async def asyncio( end_date (datetime.date): time_of_day (str): venue (Unset | StockAtTimeTradeVenue): Default: StockAtTimeTradeVenue.NQB. - format_ (Unset | StockAtTimeTradeFormat): Default: StockAtTimeTradeFormat.NDJSON. + format_ (Unset | StockAtTimeTradeFormat): Default: StockAtTimeTradeFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/stock/stock_history_eod.py b/openapi_project/openapi_package/api/stock/stock_history_eod.py index dca3ed951..3fd295471 100644 --- a/openapi_project/openapi_package/api/stock/stock_history_eod.py +++ b/openapi_project/openapi_package/api/stock/stock_history_eod.py @@ -21,7 +21,7 @@ def _get_kwargs( symbol: str, start_date: datetime.date, end_date: datetime.date, - format_: Unset | StockHistoryEodFormat = StockHistoryEodFormat.NDJSON, + format_: Unset | StockHistoryEodFormat = StockHistoryEodFormat.JSON, ) -> dict[str, Any]: @@ -84,7 +84,7 @@ def sync_detailed( symbol: str, start_date: datetime.date, end_date: datetime.date, - format_: Unset | StockHistoryEodFormat = StockHistoryEodFormat.NDJSON, + format_: Unset | StockHistoryEodFormat = StockHistoryEodFormat.JSON, ) -> Response[StockHistoryEodResponse200]: """ End of Day @@ -102,7 +102,7 @@ def sync_detailed( symbol (str): start_date (datetime.date): end_date (datetime.date): - format_ (Unset | StockHistoryEodFormat): Default: StockHistoryEodFormat.NDJSON. + format_ (Unset | StockHistoryEodFormat): Default: StockHistoryEodFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -133,7 +133,7 @@ def sync( symbol: str, start_date: datetime.date, end_date: datetime.date, - format_: Unset | StockHistoryEodFormat = StockHistoryEodFormat.NDJSON, + format_: Unset | StockHistoryEodFormat = StockHistoryEodFormat.JSON, ) -> StockHistoryEodResponse200 | None: """ End of Day @@ -151,7 +151,7 @@ def sync( symbol (str): start_date (datetime.date): end_date (datetime.date): - format_ (Unset | StockHistoryEodFormat): Default: StockHistoryEodFormat.NDJSON. + format_ (Unset | StockHistoryEodFormat): Default: StockHistoryEodFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -177,7 +177,7 @@ async def asyncio_detailed( symbol: str, start_date: datetime.date, end_date: datetime.date, - format_: Unset | StockHistoryEodFormat = StockHistoryEodFormat.NDJSON, + format_: Unset | StockHistoryEodFormat = StockHistoryEodFormat.JSON, ) -> Response[StockHistoryEodResponse200]: """ End of Day @@ -195,7 +195,7 @@ async def asyncio_detailed( symbol (str): start_date (datetime.date): end_date (datetime.date): - format_ (Unset | StockHistoryEodFormat): Default: StockHistoryEodFormat.NDJSON. + format_ (Unset | StockHistoryEodFormat): Default: StockHistoryEodFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -226,7 +226,7 @@ async def asyncio( symbol: str, start_date: datetime.date, end_date: datetime.date, - format_: Unset | StockHistoryEodFormat = StockHistoryEodFormat.NDJSON, + format_: Unset | StockHistoryEodFormat = StockHistoryEodFormat.JSON, ) -> StockHistoryEodResponse200 | None: """ End of Day @@ -244,7 +244,7 @@ async def asyncio( symbol (str): start_date (datetime.date): end_date (datetime.date): - format_ (Unset | StockHistoryEodFormat): Default: StockHistoryEodFormat.NDJSON. + format_ (Unset | StockHistoryEodFormat): Default: StockHistoryEodFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/stock/stock_history_ohlc.py b/openapi_project/openapi_package/api/stock/stock_history_ohlc.py index ce3fbc63e..c3aed7df5 100644 --- a/openapi_project/openapi_package/api/stock/stock_history_ohlc.py +++ b/openapi_project/openapi_package/api/stock/stock_history_ohlc.py @@ -26,7 +26,7 @@ def _get_kwargs( start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', venue: Unset | StockHistoryOhlcVenue = StockHistoryOhlcVenue.NQB, - format_: Unset | StockHistoryOhlcFormat = StockHistoryOhlcFormat.NDJSON, + format_: Unset | StockHistoryOhlcFormat = StockHistoryOhlcFormat.JSON, ) -> dict[str, Any]: @@ -100,7 +100,7 @@ def sync_detailed( start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', venue: Unset | StockHistoryOhlcVenue = StockHistoryOhlcVenue.NQB, - format_: Unset | StockHistoryOhlcFormat = StockHistoryOhlcFormat.NDJSON, + format_: Unset | StockHistoryOhlcFormat = StockHistoryOhlcFormat.JSON, ) -> Response[StockHistoryOhlcResponse200]: """ Open High Low Close @@ -119,7 +119,7 @@ def sync_detailed( start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. venue (Unset | StockHistoryOhlcVenue): Default: StockHistoryOhlcVenue.NQB. - format_ (Unset | StockHistoryOhlcFormat): Default: StockHistoryOhlcFormat.NDJSON. + format_ (Unset | StockHistoryOhlcFormat): Default: StockHistoryOhlcFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -156,7 +156,7 @@ def sync( start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', venue: Unset | StockHistoryOhlcVenue = StockHistoryOhlcVenue.NQB, - format_: Unset | StockHistoryOhlcFormat = StockHistoryOhlcFormat.NDJSON, + format_: Unset | StockHistoryOhlcFormat = StockHistoryOhlcFormat.JSON, ) -> StockHistoryOhlcResponse200 | None: """ Open High Low Close @@ -175,7 +175,7 @@ def sync( start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. venue (Unset | StockHistoryOhlcVenue): Default: StockHistoryOhlcVenue.NQB. - format_ (Unset | StockHistoryOhlcFormat): Default: StockHistoryOhlcFormat.NDJSON. + format_ (Unset | StockHistoryOhlcFormat): Default: StockHistoryOhlcFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -207,7 +207,7 @@ async def asyncio_detailed( start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', venue: Unset | StockHistoryOhlcVenue = StockHistoryOhlcVenue.NQB, - format_: Unset | StockHistoryOhlcFormat = StockHistoryOhlcFormat.NDJSON, + format_: Unset | StockHistoryOhlcFormat = StockHistoryOhlcFormat.JSON, ) -> Response[StockHistoryOhlcResponse200]: """ Open High Low Close @@ -226,7 +226,7 @@ async def asyncio_detailed( start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. venue (Unset | StockHistoryOhlcVenue): Default: StockHistoryOhlcVenue.NQB. - format_ (Unset | StockHistoryOhlcFormat): Default: StockHistoryOhlcFormat.NDJSON. + format_ (Unset | StockHistoryOhlcFormat): Default: StockHistoryOhlcFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -263,7 +263,7 @@ async def asyncio( start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', venue: Unset | StockHistoryOhlcVenue = StockHistoryOhlcVenue.NQB, - format_: Unset | StockHistoryOhlcFormat = StockHistoryOhlcFormat.NDJSON, + format_: Unset | StockHistoryOhlcFormat = StockHistoryOhlcFormat.JSON, ) -> StockHistoryOhlcResponse200 | None: """ Open High Low Close @@ -282,7 +282,7 @@ async def asyncio( start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. venue (Unset | StockHistoryOhlcVenue): Default: StockHistoryOhlcVenue.NQB. - format_ (Unset | StockHistoryOhlcFormat): Default: StockHistoryOhlcFormat.NDJSON. + format_ (Unset | StockHistoryOhlcFormat): Default: StockHistoryOhlcFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/stock/stock_history_quote.py b/openapi_project/openapi_package/api/stock/stock_history_quote.py index 18739f6be..dd213c5e6 100644 --- a/openapi_project/openapi_package/api/stock/stock_history_quote.py +++ b/openapi_project/openapi_package/api/stock/stock_history_quote.py @@ -26,7 +26,7 @@ def _get_kwargs( start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', venue: Unset | StockHistoryQuoteVenue = StockHistoryQuoteVenue.NQB, - format_: Unset | StockHistoryQuoteFormat = StockHistoryQuoteFormat.NDJSON, + format_: Unset | StockHistoryQuoteFormat = StockHistoryQuoteFormat.JSON, ) -> dict[str, Any]: @@ -100,7 +100,7 @@ def sync_detailed( start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', venue: Unset | StockHistoryQuoteVenue = StockHistoryQuoteVenue.NQB, - format_: Unset | StockHistoryQuoteFormat = StockHistoryQuoteFormat.NDJSON, + format_: Unset | StockHistoryQuoteFormat = StockHistoryQuoteFormat.JSON, ) -> Response[StockHistoryQuoteResponse200]: """ Quote @@ -118,7 +118,7 @@ def sync_detailed( start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. venue (Unset | StockHistoryQuoteVenue): Default: StockHistoryQuoteVenue.NQB. - format_ (Unset | StockHistoryQuoteFormat): Default: StockHistoryQuoteFormat.NDJSON. + format_ (Unset | StockHistoryQuoteFormat): Default: StockHistoryQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -155,7 +155,7 @@ def sync( start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', venue: Unset | StockHistoryQuoteVenue = StockHistoryQuoteVenue.NQB, - format_: Unset | StockHistoryQuoteFormat = StockHistoryQuoteFormat.NDJSON, + format_: Unset | StockHistoryQuoteFormat = StockHistoryQuoteFormat.JSON, ) -> StockHistoryQuoteResponse200 | None: """ Quote @@ -173,7 +173,7 @@ def sync( start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. venue (Unset | StockHistoryQuoteVenue): Default: StockHistoryQuoteVenue.NQB. - format_ (Unset | StockHistoryQuoteFormat): Default: StockHistoryQuoteFormat.NDJSON. + format_ (Unset | StockHistoryQuoteFormat): Default: StockHistoryQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -205,7 +205,7 @@ async def asyncio_detailed( start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', venue: Unset | StockHistoryQuoteVenue = StockHistoryQuoteVenue.NQB, - format_: Unset | StockHistoryQuoteFormat = StockHistoryQuoteFormat.NDJSON, + format_: Unset | StockHistoryQuoteFormat = StockHistoryQuoteFormat.JSON, ) -> Response[StockHistoryQuoteResponse200]: """ Quote @@ -223,7 +223,7 @@ async def asyncio_detailed( start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. venue (Unset | StockHistoryQuoteVenue): Default: StockHistoryQuoteVenue.NQB. - format_ (Unset | StockHistoryQuoteFormat): Default: StockHistoryQuoteFormat.NDJSON. + format_ (Unset | StockHistoryQuoteFormat): Default: StockHistoryQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -260,7 +260,7 @@ async def asyncio( start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', venue: Unset | StockHistoryQuoteVenue = StockHistoryQuoteVenue.NQB, - format_: Unset | StockHistoryQuoteFormat = StockHistoryQuoteFormat.NDJSON, + format_: Unset | StockHistoryQuoteFormat = StockHistoryQuoteFormat.JSON, ) -> StockHistoryQuoteResponse200 | None: """ Quote @@ -278,7 +278,7 @@ async def asyncio( start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. venue (Unset | StockHistoryQuoteVenue): Default: StockHistoryQuoteVenue.NQB. - format_ (Unset | StockHistoryQuoteFormat): Default: StockHistoryQuoteFormat.NDJSON. + format_ (Unset | StockHistoryQuoteFormat): Default: StockHistoryQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/stock/stock_history_trade.py b/openapi_project/openapi_package/api/stock/stock_history_trade.py index b57ac589f..e2066a10f 100644 --- a/openapi_project/openapi_package/api/stock/stock_history_trade.py +++ b/openapi_project/openapi_package/api/stock/stock_history_trade.py @@ -23,7 +23,7 @@ def _get_kwargs( start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', venue: Unset | StockHistoryTradeVenue = StockHistoryTradeVenue.NQB, - format_: Unset | StockHistoryTradeFormat = StockHistoryTradeFormat.NDJSON, + format_: Unset | StockHistoryTradeFormat = StockHistoryTradeFormat.JSON, ) -> dict[str, Any]: @@ -89,7 +89,7 @@ def sync_detailed( start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', venue: Unset | StockHistoryTradeVenue = StockHistoryTradeVenue.NQB, - format_: Unset | StockHistoryTradeFormat = StockHistoryTradeFormat.NDJSON, + format_: Unset | StockHistoryTradeFormat = StockHistoryTradeFormat.JSON, ) -> Response[Any]: """ Trade @@ -105,7 +105,7 @@ def sync_detailed( start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. venue (Unset | StockHistoryTradeVenue): Default: StockHistoryTradeVenue.NQB. - format_ (Unset | StockHistoryTradeFormat): Default: StockHistoryTradeFormat.NDJSON. + format_ (Unset | StockHistoryTradeFormat): Default: StockHistoryTradeFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -141,7 +141,7 @@ async def asyncio_detailed( start_time: Unset | str = '09:30:00', end_time: Unset | str = '16:00:00', venue: Unset | StockHistoryTradeVenue = StockHistoryTradeVenue.NQB, - format_: Unset | StockHistoryTradeFormat = StockHistoryTradeFormat.NDJSON, + format_: Unset | StockHistoryTradeFormat = StockHistoryTradeFormat.JSON, ) -> Response[Any]: """ Trade @@ -157,7 +157,7 @@ async def asyncio_detailed( start_time (Unset | str): Default: '09:30:00'. end_time (Unset | str): Default: '16:00:00'. venue (Unset | StockHistoryTradeVenue): Default: StockHistoryTradeVenue.NQB. - format_ (Unset | StockHistoryTradeFormat): Default: StockHistoryTradeFormat.NDJSON. + format_ (Unset | StockHistoryTradeFormat): Default: StockHistoryTradeFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/stock/stock_history_trade_quote.py b/openapi_project/openapi_package/api/stock/stock_history_trade_quote.py index cc18025cb..13a9508a7 100644 --- a/openapi_project/openapi_package/api/stock/stock_history_trade_quote.py +++ b/openapi_project/openapi_package/api/stock/stock_history_trade_quote.py @@ -24,7 +24,7 @@ def _get_kwargs( end_time: Unset | str = '16:00:00', exclusive: Unset | bool = True, venue: Unset | StockHistoryTradeQuoteVenue = StockHistoryTradeQuoteVenue.NQB, - format_: Unset | StockHistoryTradeQuoteFormat = StockHistoryTradeQuoteFormat.NDJSON, + format_: Unset | StockHistoryTradeQuoteFormat = StockHistoryTradeQuoteFormat.JSON, ) -> dict[str, Any]: @@ -93,7 +93,7 @@ def sync_detailed( end_time: Unset | str = '16:00:00', exclusive: Unset | bool = True, venue: Unset | StockHistoryTradeQuoteVenue = StockHistoryTradeQuoteVenue.NQB, - format_: Unset | StockHistoryTradeQuoteFormat = StockHistoryTradeQuoteFormat.NDJSON, + format_: Unset | StockHistoryTradeQuoteFormat = StockHistoryTradeQuoteFormat.JSON, ) -> Response[Any]: """ Trade Quote @@ -114,7 +114,7 @@ def sync_detailed( exclusive (Unset | bool): Default: True. venue (Unset | StockHistoryTradeQuoteVenue): Default: StockHistoryTradeQuoteVenue.NQB. format_ (Unset | StockHistoryTradeQuoteFormat): Default: - StockHistoryTradeQuoteFormat.NDJSON. + StockHistoryTradeQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -152,7 +152,7 @@ async def asyncio_detailed( end_time: Unset | str = '16:00:00', exclusive: Unset | bool = True, venue: Unset | StockHistoryTradeQuoteVenue = StockHistoryTradeQuoteVenue.NQB, - format_: Unset | StockHistoryTradeQuoteFormat = StockHistoryTradeQuoteFormat.NDJSON, + format_: Unset | StockHistoryTradeQuoteFormat = StockHistoryTradeQuoteFormat.JSON, ) -> Response[Any]: """ Trade Quote @@ -173,7 +173,7 @@ async def asyncio_detailed( exclusive (Unset | bool): Default: True. venue (Unset | StockHistoryTradeQuoteVenue): Default: StockHistoryTradeQuoteVenue.NQB. format_ (Unset | StockHistoryTradeQuoteFormat): Default: - StockHistoryTradeQuoteFormat.NDJSON. + StockHistoryTradeQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/stock/stock_list_dates.py b/openapi_project/openapi_package/api/stock/stock_list_dates.py index f422dcbf1..29da878da 100644 --- a/openapi_project/openapi_package/api/stock/stock_list_dates.py +++ b/openapi_project/openapi_package/api/stock/stock_list_dates.py @@ -19,7 +19,7 @@ def _get_kwargs( request_type: StockListDatesRequestType, *, symbol: list[str], - format_: Unset | StockListDatesFormat = StockListDatesFormat.NDJSON, + format_: Unset | StockListDatesFormat = StockListDatesFormat.JSON, ) -> dict[str, Any]: @@ -78,7 +78,7 @@ def sync_detailed( *, client: AuthenticatedClient | Client, symbol: list[str], - format_: Unset | StockListDatesFormat = StockListDatesFormat.NDJSON, + format_: Unset | StockListDatesFormat = StockListDatesFormat.JSON, ) -> Response[StockListDatesResponse200]: """ Dates @@ -89,7 +89,7 @@ def sync_detailed( Args: request_type (StockListDatesRequestType): symbol (list[str]): - format_ (Unset | StockListDatesFormat): Default: StockListDatesFormat.NDJSON. + format_ (Unset | StockListDatesFormat): Default: StockListDatesFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -118,7 +118,7 @@ def sync( *, client: AuthenticatedClient | Client, symbol: list[str], - format_: Unset | StockListDatesFormat = StockListDatesFormat.NDJSON, + format_: Unset | StockListDatesFormat = StockListDatesFormat.JSON, ) -> StockListDatesResponse200 | None: """ Dates @@ -129,7 +129,7 @@ def sync( Args: request_type (StockListDatesRequestType): symbol (list[str]): - format_ (Unset | StockListDatesFormat): Default: StockListDatesFormat.NDJSON. + format_ (Unset | StockListDatesFormat): Default: StockListDatesFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -153,7 +153,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient | Client, symbol: list[str], - format_: Unset | StockListDatesFormat = StockListDatesFormat.NDJSON, + format_: Unset | StockListDatesFormat = StockListDatesFormat.JSON, ) -> Response[StockListDatesResponse200]: """ Dates @@ -164,7 +164,7 @@ async def asyncio_detailed( Args: request_type (StockListDatesRequestType): symbol (list[str]): - format_ (Unset | StockListDatesFormat): Default: StockListDatesFormat.NDJSON. + format_ (Unset | StockListDatesFormat): Default: StockListDatesFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -193,7 +193,7 @@ async def asyncio( *, client: AuthenticatedClient | Client, symbol: list[str], - format_: Unset | StockListDatesFormat = StockListDatesFormat.NDJSON, + format_: Unset | StockListDatesFormat = StockListDatesFormat.JSON, ) -> StockListDatesResponse200 | None: """ Dates @@ -204,7 +204,7 @@ async def asyncio( Args: request_type (StockListDatesRequestType): symbol (list[str]): - format_ (Unset | StockListDatesFormat): Default: StockListDatesFormat.NDJSON. + format_ (Unset | StockListDatesFormat): Default: StockListDatesFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/stock/stock_list_symbols.py b/openapi_project/openapi_package/api/stock/stock_list_symbols.py index 82ab66417..239ead13a 100644 --- a/openapi_project/openapi_package/api/stock/stock_list_symbols.py +++ b/openapi_project/openapi_package/api/stock/stock_list_symbols.py @@ -16,7 +16,7 @@ def _get_kwargs( *, - format_: Unset | StockListSymbolsFormat = StockListSymbolsFormat.NDJSON, + format_: Unset | StockListSymbolsFormat = StockListSymbolsFormat.JSON, ) -> dict[str, Any]: @@ -68,7 +68,7 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient | Client, - format_: Unset | StockListSymbolsFormat = StockListSymbolsFormat.NDJSON, + format_: Unset | StockListSymbolsFormat = StockListSymbolsFormat.JSON, ) -> Response[StockListSymbolsResponse200]: """ Symbols @@ -78,7 +78,7 @@ def sync_detailed( endpoint is updated overnight. Args: - format_ (Unset | StockListSymbolsFormat): Default: StockListSymbolsFormat.NDJSON. + format_ (Unset | StockListSymbolsFormat): Default: StockListSymbolsFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -103,7 +103,7 @@ def sync_detailed( def sync( *, client: AuthenticatedClient | Client, - format_: Unset | StockListSymbolsFormat = StockListSymbolsFormat.NDJSON, + format_: Unset | StockListSymbolsFormat = StockListSymbolsFormat.JSON, ) -> StockListSymbolsResponse200 | None: """ Symbols @@ -113,7 +113,7 @@ def sync( endpoint is updated overnight. Args: - format_ (Unset | StockListSymbolsFormat): Default: StockListSymbolsFormat.NDJSON. + format_ (Unset | StockListSymbolsFormat): Default: StockListSymbolsFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -133,7 +133,7 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient | Client, - format_: Unset | StockListSymbolsFormat = StockListSymbolsFormat.NDJSON, + format_: Unset | StockListSymbolsFormat = StockListSymbolsFormat.JSON, ) -> Response[StockListSymbolsResponse200]: """ Symbols @@ -143,7 +143,7 @@ async def asyncio_detailed( endpoint is updated overnight. Args: - format_ (Unset | StockListSymbolsFormat): Default: StockListSymbolsFormat.NDJSON. + format_ (Unset | StockListSymbolsFormat): Default: StockListSymbolsFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -168,7 +168,7 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient | Client, - format_: Unset | StockListSymbolsFormat = StockListSymbolsFormat.NDJSON, + format_: Unset | StockListSymbolsFormat = StockListSymbolsFormat.JSON, ) -> StockListSymbolsResponse200 | None: """ Symbols @@ -178,7 +178,7 @@ async def asyncio( endpoint is updated overnight. Args: - format_ (Unset | StockListSymbolsFormat): Default: StockListSymbolsFormat.NDJSON. + format_ (Unset | StockListSymbolsFormat): Default: StockListSymbolsFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/stock/stock_snapshot_ohlc.py b/openapi_project/openapi_package/api/stock/stock_snapshot_ohlc.py index e40e0d349..df483a90f 100644 --- a/openapi_project/openapi_package/api/stock/stock_snapshot_ohlc.py +++ b/openapi_project/openapi_package/api/stock/stock_snapshot_ohlc.py @@ -19,7 +19,7 @@ def _get_kwargs( *, symbol: list[str], venue: Unset | StockSnapshotOhlcVenue = StockSnapshotOhlcVenue.NQB, - format_: Unset | StockSnapshotOhlcFormat = StockSnapshotOhlcFormat.NDJSON, + format_: Unset | StockSnapshotOhlcFormat = StockSnapshotOhlcFormat.JSON, ) -> dict[str, Any]: @@ -82,7 +82,7 @@ def sync_detailed( client: AuthenticatedClient | Client, symbol: list[str], venue: Unset | StockSnapshotOhlcVenue = StockSnapshotOhlcVenue.NQB, - format_: Unset | StockSnapshotOhlcFormat = StockSnapshotOhlcFormat.NDJSON, + format_: Unset | StockSnapshotOhlcFormat = StockSnapshotOhlcFormat.JSON, ) -> Response[StockSnapshotOhlcResponse200]: """ Open High Low Close @@ -101,7 +101,7 @@ def sync_detailed( Args: symbol (list[str]): venue (Unset | StockSnapshotOhlcVenue): Default: StockSnapshotOhlcVenue.NQB. - format_ (Unset | StockSnapshotOhlcFormat): Default: StockSnapshotOhlcFormat.NDJSON. + format_ (Unset | StockSnapshotOhlcFormat): Default: StockSnapshotOhlcFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -130,7 +130,7 @@ def sync( client: AuthenticatedClient | Client, symbol: list[str], venue: Unset | StockSnapshotOhlcVenue = StockSnapshotOhlcVenue.NQB, - format_: Unset | StockSnapshotOhlcFormat = StockSnapshotOhlcFormat.NDJSON, + format_: Unset | StockSnapshotOhlcFormat = StockSnapshotOhlcFormat.JSON, ) -> StockSnapshotOhlcResponse200 | None: """ Open High Low Close @@ -149,7 +149,7 @@ def sync( Args: symbol (list[str]): venue (Unset | StockSnapshotOhlcVenue): Default: StockSnapshotOhlcVenue.NQB. - format_ (Unset | StockSnapshotOhlcFormat): Default: StockSnapshotOhlcFormat.NDJSON. + format_ (Unset | StockSnapshotOhlcFormat): Default: StockSnapshotOhlcFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -173,7 +173,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, symbol: list[str], venue: Unset | StockSnapshotOhlcVenue = StockSnapshotOhlcVenue.NQB, - format_: Unset | StockSnapshotOhlcFormat = StockSnapshotOhlcFormat.NDJSON, + format_: Unset | StockSnapshotOhlcFormat = StockSnapshotOhlcFormat.JSON, ) -> Response[StockSnapshotOhlcResponse200]: """ Open High Low Close @@ -192,7 +192,7 @@ async def asyncio_detailed( Args: symbol (list[str]): venue (Unset | StockSnapshotOhlcVenue): Default: StockSnapshotOhlcVenue.NQB. - format_ (Unset | StockSnapshotOhlcFormat): Default: StockSnapshotOhlcFormat.NDJSON. + format_ (Unset | StockSnapshotOhlcFormat): Default: StockSnapshotOhlcFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -221,7 +221,7 @@ async def asyncio( client: AuthenticatedClient | Client, symbol: list[str], venue: Unset | StockSnapshotOhlcVenue = StockSnapshotOhlcVenue.NQB, - format_: Unset | StockSnapshotOhlcFormat = StockSnapshotOhlcFormat.NDJSON, + format_: Unset | StockSnapshotOhlcFormat = StockSnapshotOhlcFormat.JSON, ) -> StockSnapshotOhlcResponse200 | None: """ Open High Low Close @@ -240,7 +240,7 @@ async def asyncio( Args: symbol (list[str]): venue (Unset | StockSnapshotOhlcVenue): Default: StockSnapshotOhlcVenue.NQB. - format_ (Unset | StockSnapshotOhlcFormat): Default: StockSnapshotOhlcFormat.NDJSON. + format_ (Unset | StockSnapshotOhlcFormat): Default: StockSnapshotOhlcFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/stock/stock_snapshot_quote.py b/openapi_project/openapi_package/api/stock/stock_snapshot_quote.py index bbd16ce6c..faa3ee793 100644 --- a/openapi_project/openapi_package/api/stock/stock_snapshot_quote.py +++ b/openapi_project/openapi_package/api/stock/stock_snapshot_quote.py @@ -19,7 +19,7 @@ def _get_kwargs( *, symbol: list[str], venue: Unset | StockSnapshotQuoteVenue = StockSnapshotQuoteVenue.NQB, - format_: Unset | StockSnapshotQuoteFormat = StockSnapshotQuoteFormat.NDJSON, + format_: Unset | StockSnapshotQuoteFormat = StockSnapshotQuoteFormat.JSON, ) -> dict[str, Any]: @@ -82,7 +82,7 @@ def sync_detailed( client: AuthenticatedClient | Client, symbol: list[str], venue: Unset | StockSnapshotQuoteVenue = StockSnapshotQuoteVenue.NQB, - format_: Unset | StockSnapshotQuoteFormat = StockSnapshotQuoteFormat.NDJSON, + format_: Unset | StockSnapshotQuoteFormat = StockSnapshotQuoteFormat.JSON, ) -> Response[StockSnapshotQuoteResponse200]: """ Quote @@ -100,7 +100,7 @@ def sync_detailed( Args: symbol (list[str]): venue (Unset | StockSnapshotQuoteVenue): Default: StockSnapshotQuoteVenue.NQB. - format_ (Unset | StockSnapshotQuoteFormat): Default: StockSnapshotQuoteFormat.NDJSON. + format_ (Unset | StockSnapshotQuoteFormat): Default: StockSnapshotQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -129,7 +129,7 @@ def sync( client: AuthenticatedClient | Client, symbol: list[str], venue: Unset | StockSnapshotQuoteVenue = StockSnapshotQuoteVenue.NQB, - format_: Unset | StockSnapshotQuoteFormat = StockSnapshotQuoteFormat.NDJSON, + format_: Unset | StockSnapshotQuoteFormat = StockSnapshotQuoteFormat.JSON, ) -> StockSnapshotQuoteResponse200 | None: """ Quote @@ -147,7 +147,7 @@ def sync( Args: symbol (list[str]): venue (Unset | StockSnapshotQuoteVenue): Default: StockSnapshotQuoteVenue.NQB. - format_ (Unset | StockSnapshotQuoteFormat): Default: StockSnapshotQuoteFormat.NDJSON. + format_ (Unset | StockSnapshotQuoteFormat): Default: StockSnapshotQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -171,7 +171,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, symbol: list[str], venue: Unset | StockSnapshotQuoteVenue = StockSnapshotQuoteVenue.NQB, - format_: Unset | StockSnapshotQuoteFormat = StockSnapshotQuoteFormat.NDJSON, + format_: Unset | StockSnapshotQuoteFormat = StockSnapshotQuoteFormat.JSON, ) -> Response[StockSnapshotQuoteResponse200]: """ Quote @@ -189,7 +189,7 @@ async def asyncio_detailed( Args: symbol (list[str]): venue (Unset | StockSnapshotQuoteVenue): Default: StockSnapshotQuoteVenue.NQB. - format_ (Unset | StockSnapshotQuoteFormat): Default: StockSnapshotQuoteFormat.NDJSON. + format_ (Unset | StockSnapshotQuoteFormat): Default: StockSnapshotQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -218,7 +218,7 @@ async def asyncio( client: AuthenticatedClient | Client, symbol: list[str], venue: Unset | StockSnapshotQuoteVenue = StockSnapshotQuoteVenue.NQB, - format_: Unset | StockSnapshotQuoteFormat = StockSnapshotQuoteFormat.NDJSON, + format_: Unset | StockSnapshotQuoteFormat = StockSnapshotQuoteFormat.JSON, ) -> StockSnapshotQuoteResponse200 | None: """ Quote @@ -236,7 +236,7 @@ async def asyncio( Args: symbol (list[str]): venue (Unset | StockSnapshotQuoteVenue): Default: StockSnapshotQuoteVenue.NQB. - format_ (Unset | StockSnapshotQuoteFormat): Default: StockSnapshotQuoteFormat.NDJSON. + format_ (Unset | StockSnapshotQuoteFormat): Default: StockSnapshotQuoteFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/api/stock/stock_snapshot_trade.py b/openapi_project/openapi_package/api/stock/stock_snapshot_trade.py index c76ed3723..bf04836dc 100644 --- a/openapi_project/openapi_package/api/stock/stock_snapshot_trade.py +++ b/openapi_project/openapi_package/api/stock/stock_snapshot_trade.py @@ -19,7 +19,7 @@ def _get_kwargs( *, symbol: list[str], venue: Unset | StockSnapshotTradeVenue = StockSnapshotTradeVenue.NQB, - format_: Unset | StockSnapshotTradeFormat = StockSnapshotTradeFormat.NDJSON, + format_: Unset | StockSnapshotTradeFormat = StockSnapshotTradeFormat.JSON, ) -> dict[str, Any]: @@ -82,7 +82,7 @@ def sync_detailed( client: AuthenticatedClient | Client, symbol: list[str], venue: Unset | StockSnapshotTradeVenue = StockSnapshotTradeVenue.NQB, - format_: Unset | StockSnapshotTradeFormat = StockSnapshotTradeFormat.NDJSON, + format_: Unset | StockSnapshotTradeFormat = StockSnapshotTradeFormat.JSON, ) -> Response[StockSnapshotTradeResponse200]: """ Trade @@ -99,7 +99,7 @@ def sync_detailed( Args: symbol (list[str]): venue (Unset | StockSnapshotTradeVenue): Default: StockSnapshotTradeVenue.NQB. - format_ (Unset | StockSnapshotTradeFormat): Default: StockSnapshotTradeFormat.NDJSON. + format_ (Unset | StockSnapshotTradeFormat): Default: StockSnapshotTradeFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -128,7 +128,7 @@ def sync( client: AuthenticatedClient | Client, symbol: list[str], venue: Unset | StockSnapshotTradeVenue = StockSnapshotTradeVenue.NQB, - format_: Unset | StockSnapshotTradeFormat = StockSnapshotTradeFormat.NDJSON, + format_: Unset | StockSnapshotTradeFormat = StockSnapshotTradeFormat.JSON, ) -> StockSnapshotTradeResponse200 | None: """ Trade @@ -145,7 +145,7 @@ def sync( Args: symbol (list[str]): venue (Unset | StockSnapshotTradeVenue): Default: StockSnapshotTradeVenue.NQB. - format_ (Unset | StockSnapshotTradeFormat): Default: StockSnapshotTradeFormat.NDJSON. + format_ (Unset | StockSnapshotTradeFormat): Default: StockSnapshotTradeFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -169,7 +169,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, symbol: list[str], venue: Unset | StockSnapshotTradeVenue = StockSnapshotTradeVenue.NQB, - format_: Unset | StockSnapshotTradeFormat = StockSnapshotTradeFormat.NDJSON, + format_: Unset | StockSnapshotTradeFormat = StockSnapshotTradeFormat.JSON, ) -> Response[StockSnapshotTradeResponse200]: """ Trade @@ -186,7 +186,7 @@ async def asyncio_detailed( Args: symbol (list[str]): venue (Unset | StockSnapshotTradeVenue): Default: StockSnapshotTradeVenue.NQB. - format_ (Unset | StockSnapshotTradeFormat): Default: StockSnapshotTradeFormat.NDJSON. + format_ (Unset | StockSnapshotTradeFormat): Default: StockSnapshotTradeFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -215,7 +215,7 @@ async def asyncio( client: AuthenticatedClient | Client, symbol: list[str], venue: Unset | StockSnapshotTradeVenue = StockSnapshotTradeVenue.NQB, - format_: Unset | StockSnapshotTradeFormat = StockSnapshotTradeFormat.NDJSON, + format_: Unset | StockSnapshotTradeFormat = StockSnapshotTradeFormat.JSON, ) -> StockSnapshotTradeResponse200 | None: """ Trade @@ -232,7 +232,7 @@ async def asyncio( Args: symbol (list[str]): venue (Unset | StockSnapshotTradeVenue): Default: StockSnapshotTradeVenue.NQB. - format_ (Unset | StockSnapshotTradeFormat): Default: StockSnapshotTradeFormat.NDJSON. + format_ (Unset | StockSnapshotTradeFormat): Default: StockSnapshotTradeFormat.JSON. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/openapi_project/openapi_package/models/index_at_time_price_format.py b/openapi_project/openapi_package/models/index_at_time_price_format.py index 2ba3c0a8e..158ad4958 100644 --- a/openapi_project/openapi_package/models/index_at_time_price_format.py +++ b/openapi_project/openapi_package/models/index_at_time_price_format.py @@ -1,9 +1,7 @@ from enum import Enum class IndexAtTimePriceFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/index_history_eod_format.py b/openapi_project/openapi_package/models/index_history_eod_format.py index 6694acbe8..0873f867a 100644 --- a/openapi_project/openapi_package/models/index_history_eod_format.py +++ b/openapi_project/openapi_package/models/index_history_eod_format.py @@ -1,9 +1,7 @@ from enum import Enum class IndexHistoryEodFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/index_history_ohlc_format.py b/openapi_project/openapi_package/models/index_history_ohlc_format.py index a6852cb51..d960523e6 100644 --- a/openapi_project/openapi_package/models/index_history_ohlc_format.py +++ b/openapi_project/openapi_package/models/index_history_ohlc_format.py @@ -1,9 +1,7 @@ from enum import Enum class IndexHistoryOhlcFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/index_history_price_format.py b/openapi_project/openapi_package/models/index_history_price_format.py index 8b2808c5a..3335e6b83 100644 --- a/openapi_project/openapi_package/models/index_history_price_format.py +++ b/openapi_project/openapi_package/models/index_history_price_format.py @@ -1,9 +1,7 @@ from enum import Enum class IndexHistoryPriceFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/index_list_dates_format.py b/openapi_project/openapi_package/models/index_list_dates_format.py index 264a70c8a..d37f2e1c6 100644 --- a/openapi_project/openapi_package/models/index_list_dates_format.py +++ b/openapi_project/openapi_package/models/index_list_dates_format.py @@ -1,9 +1,7 @@ from enum import Enum class IndexListDatesFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/index_list_symbols_format.py b/openapi_project/openapi_package/models/index_list_symbols_format.py index d8cdbe7e4..889c630c0 100644 --- a/openapi_project/openapi_package/models/index_list_symbols_format.py +++ b/openapi_project/openapi_package/models/index_list_symbols_format.py @@ -1,9 +1,7 @@ from enum import Enum class IndexListSymbolsFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/index_snapshot_ohlc_format.py b/openapi_project/openapi_package/models/index_snapshot_ohlc_format.py index c7efd8953..5eaca7030 100644 --- a/openapi_project/openapi_package/models/index_snapshot_ohlc_format.py +++ b/openapi_project/openapi_package/models/index_snapshot_ohlc_format.py @@ -1,9 +1,7 @@ from enum import Enum class IndexSnapshotOhlcFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/index_snapshot_price_format.py b/openapi_project/openapi_package/models/index_snapshot_price_format.py index 8dfba6cad..84c50d2e7 100644 --- a/openapi_project/openapi_package/models/index_snapshot_price_format.py +++ b/openapi_project/openapi_package/models/index_snapshot_price_format.py @@ -1,9 +1,7 @@ from enum import Enum class IndexSnapshotPriceFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_at_time_quote_format.py b/openapi_project/openapi_package/models/option_at_time_quote_format.py index 11603db46..1957b3157 100644 --- a/openapi_project/openapi_package/models/option_at_time_quote_format.py +++ b/openapi_project/openapi_package/models/option_at_time_quote_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionAtTimeQuoteFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_at_time_trade_format.py b/openapi_project/openapi_package/models/option_at_time_trade_format.py index 5f735a163..62f02e761 100644 --- a/openapi_project/openapi_package/models/option_at_time_trade_format.py +++ b/openapi_project/openapi_package/models/option_at_time_trade_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionAtTimeTradeFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_eod_format.py b/openapi_project/openapi_package/models/option_history_eod_format.py index add62dfdc..273820f2c 100644 --- a/openapi_project/openapi_package/models/option_history_eod_format.py +++ b/openapi_project/openapi_package/models/option_history_eod_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionHistoryEodFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_all_format.py b/openapi_project/openapi_package/models/option_history_greeks_all_format.py index 1a4132579..c7db86d56 100644 --- a/openapi_project/openapi_package/models/option_history_greeks_all_format.py +++ b/openapi_project/openapi_package/models/option_history_greeks_all_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionHistoryGreeksAllFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_eod_format.py b/openapi_project/openapi_package/models/option_history_greeks_eod_format.py index f0964a4f8..3170d1064 100644 --- a/openapi_project/openapi_package/models/option_history_greeks_eod_format.py +++ b/openapi_project/openapi_package/models/option_history_greeks_eod_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionHistoryGreeksEodFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_first_order_format.py b/openapi_project/openapi_package/models/option_history_greeks_first_order_format.py index 535b01c58..fad075173 100644 --- a/openapi_project/openapi_package/models/option_history_greeks_first_order_format.py +++ b/openapi_project/openapi_package/models/option_history_greeks_first_order_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionHistoryGreeksFirstOrderFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_implied_volatility_format.py b/openapi_project/openapi_package/models/option_history_greeks_implied_volatility_format.py index c070ff426..80ecf0bce 100644 --- a/openapi_project/openapi_package/models/option_history_greeks_implied_volatility_format.py +++ b/openapi_project/openapi_package/models/option_history_greeks_implied_volatility_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionHistoryGreeksImpliedVolatilityFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_second_order_format.py b/openapi_project/openapi_package/models/option_history_greeks_second_order_format.py index 6dad6198b..835c39592 100644 --- a/openapi_project/openapi_package/models/option_history_greeks_second_order_format.py +++ b/openapi_project/openapi_package/models/option_history_greeks_second_order_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionHistoryGreeksSecondOrderFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_greeks_third_order_format.py b/openapi_project/openapi_package/models/option_history_greeks_third_order_format.py index a1beade39..bf4f2b8f8 100644 --- a/openapi_project/openapi_package/models/option_history_greeks_third_order_format.py +++ b/openapi_project/openapi_package/models/option_history_greeks_third_order_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionHistoryGreeksThirdOrderFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_ohlc_format.py b/openapi_project/openapi_package/models/option_history_ohlc_format.py index 9ba196379..b0a934e0f 100644 --- a/openapi_project/openapi_package/models/option_history_ohlc_format.py +++ b/openapi_project/openapi_package/models/option_history_ohlc_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionHistoryOhlcFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_open_interest_format.py b/openapi_project/openapi_package/models/option_history_open_interest_format.py index 51cc69a26..accb6e54e 100644 --- a/openapi_project/openapi_package/models/option_history_open_interest_format.py +++ b/openapi_project/openapi_package/models/option_history_open_interest_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionHistoryOpenInterestFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_quote_format.py b/openapi_project/openapi_package/models/option_history_quote_format.py index 97952d9a7..2c8c449b1 100644 --- a/openapi_project/openapi_package/models/option_history_quote_format.py +++ b/openapi_project/openapi_package/models/option_history_quote_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionHistoryQuoteFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_trade_format.py b/openapi_project/openapi_package/models/option_history_trade_format.py index 4b7517081..7528cfeae 100644 --- a/openapi_project/openapi_package/models/option_history_trade_format.py +++ b/openapi_project/openapi_package/models/option_history_trade_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionHistoryTradeFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_all_format.py b/openapi_project/openapi_package/models/option_history_trade_greeks_all_format.py index 8e01682bc..0f5634643 100644 --- a/openapi_project/openapi_package/models/option_history_trade_greeks_all_format.py +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_all_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionHistoryTradeGreeksAllFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_first_order_format.py b/openapi_project/openapi_package/models/option_history_trade_greeks_first_order_format.py index 20182af70..3967a09a4 100644 --- a/openapi_project/openapi_package/models/option_history_trade_greeks_first_order_format.py +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_first_order_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionHistoryTradeGreeksFirstOrderFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_implied_volatility_format.py b/openapi_project/openapi_package/models/option_history_trade_greeks_implied_volatility_format.py index b8c58495c..4cf2c76bc 100644 --- a/openapi_project/openapi_package/models/option_history_trade_greeks_implied_volatility_format.py +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_implied_volatility_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionHistoryTradeGreeksImpliedVolatilityFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_second_order_format.py b/openapi_project/openapi_package/models/option_history_trade_greeks_second_order_format.py index 55a709a6f..d5648b438 100644 --- a/openapi_project/openapi_package/models/option_history_trade_greeks_second_order_format.py +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_second_order_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionHistoryTradeGreeksSecondOrderFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_third_order_format.py b/openapi_project/openapi_package/models/option_history_trade_greeks_third_order_format.py index d761efc8a..f08c3f3b1 100644 --- a/openapi_project/openapi_package/models/option_history_trade_greeks_third_order_format.py +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_third_order_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionHistoryTradeGreeksThirdOrderFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_history_trade_quote_format.py b/openapi_project/openapi_package/models/option_history_trade_quote_format.py index 008fbcf32..a0e68fe18 100644 --- a/openapi_project/openapi_package/models/option_history_trade_quote_format.py +++ b/openapi_project/openapi_package/models/option_history_trade_quote_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionHistoryTradeQuoteFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_list_contracts_format.py b/openapi_project/openapi_package/models/option_list_contracts_format.py index 8ec488a8c..7bfa34f40 100644 --- a/openapi_project/openapi_package/models/option_list_contracts_format.py +++ b/openapi_project/openapi_package/models/option_list_contracts_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionListContractsFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_list_dates_format.py b/openapi_project/openapi_package/models/option_list_dates_format.py index 0665cc5fc..ac71cb25c 100644 --- a/openapi_project/openapi_package/models/option_list_dates_format.py +++ b/openapi_project/openapi_package/models/option_list_dates_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionListDatesFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_list_expirations_format.py b/openapi_project/openapi_package/models/option_list_expirations_format.py index bcaa18977..747192660 100644 --- a/openapi_project/openapi_package/models/option_list_expirations_format.py +++ b/openapi_project/openapi_package/models/option_list_expirations_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionListExpirationsFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_list_strikes_format.py b/openapi_project/openapi_package/models/option_list_strikes_format.py index 351c527b4..c834d07ed 100644 --- a/openapi_project/openapi_package/models/option_list_strikes_format.py +++ b/openapi_project/openapi_package/models/option_list_strikes_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionListStrikesFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_list_symbols_format.py b/openapi_project/openapi_package/models/option_list_symbols_format.py index 43ee88473..523470e39 100644 --- a/openapi_project/openapi_package/models/option_list_symbols_format.py +++ b/openapi_project/openapi_package/models/option_list_symbols_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionListSymbolsFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_all_format.py b/openapi_project/openapi_package/models/option_snapshot_greeks_all_format.py index 8ff54ce3a..b7423c74f 100644 --- a/openapi_project/openapi_package/models/option_snapshot_greeks_all_format.py +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_all_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionSnapshotGreeksAllFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_first_order_format.py b/openapi_project/openapi_package/models/option_snapshot_greeks_first_order_format.py index 9ab441ba2..580badfdd 100644 --- a/openapi_project/openapi_package/models/option_snapshot_greeks_first_order_format.py +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_first_order_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionSnapshotGreeksFirstOrderFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_implied_volatility_format.py b/openapi_project/openapi_package/models/option_snapshot_greeks_implied_volatility_format.py index 99fcf1a5c..5c042b5f3 100644 --- a/openapi_project/openapi_package/models/option_snapshot_greeks_implied_volatility_format.py +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_implied_volatility_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionSnapshotGreeksImpliedVolatilityFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_second_order_format.py b/openapi_project/openapi_package/models/option_snapshot_greeks_second_order_format.py index 1d0ef5d57..288c532d6 100644 --- a/openapi_project/openapi_package/models/option_snapshot_greeks_second_order_format.py +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_second_order_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionSnapshotGreeksSecondOrderFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_third_order_format.py b/openapi_project/openapi_package/models/option_snapshot_greeks_third_order_format.py index 5459766aa..038850cc1 100644 --- a/openapi_project/openapi_package/models/option_snapshot_greeks_third_order_format.py +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_third_order_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionSnapshotGreeksThirdOrderFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_ohlc_format.py b/openapi_project/openapi_package/models/option_snapshot_ohlc_format.py index 2a73df2a0..b13a25fc8 100644 --- a/openapi_project/openapi_package/models/option_snapshot_ohlc_format.py +++ b/openapi_project/openapi_package/models/option_snapshot_ohlc_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionSnapshotOhlcFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_open_interest_format.py b/openapi_project/openapi_package/models/option_snapshot_open_interest_format.py index 398a7be2a..f62abea5e 100644 --- a/openapi_project/openapi_package/models/option_snapshot_open_interest_format.py +++ b/openapi_project/openapi_package/models/option_snapshot_open_interest_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionSnapshotOpenInterestFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_quote_format.py b/openapi_project/openapi_package/models/option_snapshot_quote_format.py index 1ef21150b..3a1b5d479 100644 --- a/openapi_project/openapi_package/models/option_snapshot_quote_format.py +++ b/openapi_project/openapi_package/models/option_snapshot_quote_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionSnapshotQuoteFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/option_snapshot_trade_format.py b/openapi_project/openapi_package/models/option_snapshot_trade_format.py index 7dfe2a341..9fe82bc46 100644 --- a/openapi_project/openapi_package/models/option_snapshot_trade_format.py +++ b/openapi_project/openapi_package/models/option_snapshot_trade_format.py @@ -1,9 +1,7 @@ from enum import Enum class OptionSnapshotTradeFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_at_time_quote_format.py b/openapi_project/openapi_package/models/stock_at_time_quote_format.py index ca3441f67..e0228cec3 100644 --- a/openapi_project/openapi_package/models/stock_at_time_quote_format.py +++ b/openapi_project/openapi_package/models/stock_at_time_quote_format.py @@ -1,9 +1,7 @@ from enum import Enum class StockAtTimeQuoteFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_at_time_trade_format.py b/openapi_project/openapi_package/models/stock_at_time_trade_format.py index 670971fb0..a4b6493a3 100644 --- a/openapi_project/openapi_package/models/stock_at_time_trade_format.py +++ b/openapi_project/openapi_package/models/stock_at_time_trade_format.py @@ -1,9 +1,7 @@ from enum import Enum class StockAtTimeTradeFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_history_eod_format.py b/openapi_project/openapi_package/models/stock_history_eod_format.py index f16dde623..2d6267bb1 100644 --- a/openapi_project/openapi_package/models/stock_history_eod_format.py +++ b/openapi_project/openapi_package/models/stock_history_eod_format.py @@ -1,9 +1,7 @@ from enum import Enum class StockHistoryEodFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_history_ohlc_format.py b/openapi_project/openapi_package/models/stock_history_ohlc_format.py index 90e0c5eb5..a625e5842 100644 --- a/openapi_project/openapi_package/models/stock_history_ohlc_format.py +++ b/openapi_project/openapi_package/models/stock_history_ohlc_format.py @@ -1,9 +1,7 @@ from enum import Enum class StockHistoryOhlcFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_history_quote_format.py b/openapi_project/openapi_package/models/stock_history_quote_format.py index 012e21af2..387cd3780 100644 --- a/openapi_project/openapi_package/models/stock_history_quote_format.py +++ b/openapi_project/openapi_package/models/stock_history_quote_format.py @@ -1,9 +1,7 @@ from enum import Enum class StockHistoryQuoteFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_history_trade_format.py b/openapi_project/openapi_package/models/stock_history_trade_format.py index 89cf2bb5e..ab094e3ac 100644 --- a/openapi_project/openapi_package/models/stock_history_trade_format.py +++ b/openapi_project/openapi_package/models/stock_history_trade_format.py @@ -1,9 +1,7 @@ from enum import Enum class StockHistoryTradeFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_history_trade_quote_format.py b/openapi_project/openapi_package/models/stock_history_trade_quote_format.py index af1a72470..d0c42dcdf 100644 --- a/openapi_project/openapi_package/models/stock_history_trade_quote_format.py +++ b/openapi_project/openapi_package/models/stock_history_trade_quote_format.py @@ -1,9 +1,7 @@ from enum import Enum class StockHistoryTradeQuoteFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_list_dates_format.py b/openapi_project/openapi_package/models/stock_list_dates_format.py index eeabec953..81384ea2a 100644 --- a/openapi_project/openapi_package/models/stock_list_dates_format.py +++ b/openapi_project/openapi_package/models/stock_list_dates_format.py @@ -1,9 +1,7 @@ from enum import Enum class StockListDatesFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_list_symbols_format.py b/openapi_project/openapi_package/models/stock_list_symbols_format.py index e0954ac1c..0dbd257e6 100644 --- a/openapi_project/openapi_package/models/stock_list_symbols_format.py +++ b/openapi_project/openapi_package/models/stock_list_symbols_format.py @@ -1,9 +1,7 @@ from enum import Enum class StockListSymbolsFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_snapshot_ohlc_format.py b/openapi_project/openapi_package/models/stock_snapshot_ohlc_format.py index 0bd5f4924..1dac3424a 100644 --- a/openapi_project/openapi_package/models/stock_snapshot_ohlc_format.py +++ b/openapi_project/openapi_package/models/stock_snapshot_ohlc_format.py @@ -1,9 +1,7 @@ from enum import Enum class StockSnapshotOhlcFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_snapshot_quote_format.py b/openapi_project/openapi_package/models/stock_snapshot_quote_format.py index 21b3ba63b..49d849b0c 100644 --- a/openapi_project/openapi_package/models/stock_snapshot_quote_format.py +++ b/openapi_project/openapi_package/models/stock_snapshot_quote_format.py @@ -1,9 +1,7 @@ from enum import Enum class StockSnapshotQuoteFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) diff --git a/openapi_project/openapi_package/models/stock_snapshot_trade_format.py b/openapi_project/openapi_package/models/stock_snapshot_trade_format.py index 56b90743e..55a28b469 100644 --- a/openapi_project/openapi_package/models/stock_snapshot_trade_format.py +++ b/openapi_project/openapi_package/models/stock_snapshot_trade_format.py @@ -1,9 +1,7 @@ from enum import Enum class StockSnapshotTradeFormat(str, Enum): - CSV = "csv" JSON = "json" - NDJSON = "ndjson" def __str__(self) -> str: return str(self.value) From 48dbab3ef13fa6f8786471e351f21f641a12ff08 Mon Sep 17 00:00:00 2001 From: Itay Bavly Date: Thu, 11 Sep 2025 11:25:01 -0400 Subject: [PATCH 14/16] clean --- openapi/openapi.cleaned.yaml | 5550 +++++++++++++--------------------- openapi/preprocess_td.py | 74 +- 2 files changed, 2244 insertions(+), 3380 deletions(-) diff --git a/openapi/openapi.cleaned.yaml b/openapi/openapi.cleaned.yaml index 34f240145..c8f2abf4d 100644 --- a/openapi/openapi.cleaned.yaml +++ b/openapi/openapi.cleaned.yaml @@ -38,14 +38,14 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - required: - - symbol + type: array + items: + type: object + properties: + symbol: + type: string + required: + - symbol example: symbol: - A @@ -80,19 +80,17 @@ paths: content: application/json: schema: - type: object - properties: - date: - type: array - items: - type: string - symbol: - type: array - items: - type: string - required: - - date - - symbol + type: array + items: + type: object + properties: + date: + type: string + symbol: + type: string + required: + - date + - symbol example: date: - '2016-08-19' @@ -135,49 +133,35 @@ paths: content: application/json: schema: - type: object - properties: - volume: - type: array - items: - type: integer - symbol: - type: array - items: - type: string - high: - type: array - items: - type: number - low: - type: array - items: - type: number - count: - type: array - items: - type: integer - close: - type: array - items: - type: number - open: - type: array - items: - type: number - timestamp: - type: array - items: - type: string - required: - - volume - - symbol - - high - - low - - count - - close - - open - - timestamp + type: array + items: + type: object + properties: + volume: + type: integer + symbol: + type: string + high: + type: number + low: + type: number + count: + type: integer + close: + type: number + open: + type: number + timestamp: + type: string + required: + - volume + - symbol + - high + - low + - count + - close + - open + - timestamp example: volume: - 119656 @@ -253,39 +237,29 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - sequence: - type: array - items: - type: integer - condition: - type: array - items: - type: integer - size: - type: array - items: - type: integer - price: - type: array - items: - type: number - timestamp: - type: array - items: - type: string - required: - - symbol - - sequence - - condition - - size - - price - - timestamp + type: array + items: + type: object + properties: + symbol: + type: string + sequence: + type: integer + condition: + type: integer + size: + type: integer + price: + type: number + timestamp: + type: string + required: + - symbol + - sequence + - condition + - size + - price + - timestamp example: symbol: - AAPL @@ -327,59 +301,41 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - ask_size: - type: array - items: - type: integer - bid_size: - type: array - items: - type: integer - ask_exchange: - type: array - items: - type: integer - ask_condition: - type: array - items: - type: integer - bid_exchange: - type: array - items: - type: integer - ask: - type: array - items: - type: number - bid: - type: array - items: - type: number - bid_condition: - type: array - items: - type: integer - timestamp: - type: array - items: - type: string - required: - - symbol - - ask_size - - bid_size - - ask_exchange - - ask_condition - - bid_exchange - - ask - - bid - - bid_condition - - timestamp + type: array + items: + type: object + properties: + symbol: + type: string + ask_size: + type: integer + bid_size: + type: integer + ask_exchange: + type: integer + ask_condition: + type: integer + bid_exchange: + type: integer + ask: + type: number + bid: + type: number + bid_condition: + type: integer + timestamp: + type: string + required: + - symbol + - ask_size + - bid_size + - ask_exchange + - ask_condition + - bid_exchange + - ask + - bid + - bid_condition + - timestamp example: symbol: - CVCO @@ -469,89 +425,59 @@ paths: content: application/json: schema: - type: object - properties: - ask_size: - type: array - items: - type: integer - last_trade: - type: array - items: - type: string - created: - type: array - items: - type: string - ask_condition: - type: array - items: - type: integer - count: - type: array - items: - type: integer - volume: - type: array - items: - type: integer - high: - type: array - items: - type: number - low: - type: array - items: - type: number - bid_size: - type: array - items: - type: integer - ask_exchange: - type: array - items: - type: integer - bid_exchange: - type: array - items: - type: integer - ask: - type: array - items: - type: number - bid: - type: array - items: - type: number - bid_condition: - type: array - items: - type: integer - close: - type: array - items: - type: number - open: - type: array - items: - type: number - required: - - ask_size - - last_trade - - created - - ask_condition - - count - - volume - - high - - low - - bid_size - - ask_exchange - - bid_exchange - - ask - - bid - - bid_condition - - close - - open + type: array + items: + type: object + properties: + ask_size: + type: integer + last_trade: + type: string + created: + type: string + ask_condition: + type: integer + count: + type: integer + volume: + type: integer + high: + type: number + low: + type: number + bid_size: + type: integer + ask_exchange: + type: integer + bid_exchange: + type: integer + ask: + type: number + bid: + type: number + bid_condition: + type: integer + close: + type: number + open: + type: number + required: + - ask_size + - last_trade + - created + - ask_condition + - count + - volume + - high + - low + - bid_size + - ask_exchange + - bid_exchange + - ask + - bid + - bid_condition + - close + - open example: ask_size: - 2 @@ -679,49 +605,35 @@ paths: content: application/json: schema: - type: object - properties: - volume: - type: array - items: - type: integer - high: - type: array - items: - type: number - low: - type: array - items: - type: number - vwap: - type: array - items: - type: number - count: - type: array - items: - type: integer - close: - type: array - items: - type: number - open: - type: array - items: - type: number - timestamp: - type: array - items: - type: string - required: - - volume - - high - - low - - vwap - - count - - close - - open - - timestamp + type: array + items: + type: object + properties: + volume: + type: integer + high: + type: number + low: + type: number + vwap: + type: number + count: + type: integer + close: + type: number + open: + type: number + timestamp: + type: string + required: + - volume + - high + - low + - vwap + - count + - close + - open + - timestamp example: volume: - 3256708 @@ -828,54 +740,38 @@ paths: content: application/json: schema: - type: object - properties: - ask_size: - type: array - items: - type: integer - bid_size: - type: array - items: - type: integer - ask_exchange: - type: array - items: - type: integer - ask_condition: - type: array - items: - type: integer - bid_exchange: - type: array - items: - type: integer - ask: - type: array - items: - type: number - bid: - type: array - items: - type: number - bid_condition: - type: array - items: - type: integer - timestamp: - type: array - items: - type: string - required: - - ask_size - - bid_size - - ask_exchange - - ask_condition - - bid_exchange - - ask - - bid - - bid_condition - - timestamp + type: array + items: + type: object + properties: + ask_size: + type: integer + bid_size: + type: integer + ask_exchange: + type: integer + ask_condition: + type: integer + bid_exchange: + type: integer + ask: + type: number + bid: + type: number + bid_condition: + type: integer + timestamp: + type: string + required: + - ask_size + - bid_size + - ask_exchange + - ask_condition + - bid_exchange + - ask + - bid + - bid_condition + - timestamp example: ask_size: - 1 @@ -994,59 +890,41 @@ paths: content: application/json: schema: - type: object - properties: - sequence: - type: array - items: - type: integer - condition: - type: array - items: - type: integer - size: - type: array - items: - type: integer - price: - type: array - items: - type: number - ext_condition2: - type: array - items: - type: integer - ext_condition1: - type: array - items: - type: integer - ext_condition4: - type: array - items: - type: integer - exchange: - type: array - items: - type: integer - ext_condition3: - type: array - items: - type: integer - timestamp: - type: array - items: - type: string - required: - - sequence - - condition - - size - - price - - ext_condition2 - - ext_condition1 - - ext_condition4 - - exchange - - ext_condition3 - - timestamp + type: array + items: + type: object + properties: + sequence: + type: integer + condition: + type: integer + size: + type: integer + price: + type: number + ext_condition2: + type: integer + ext_condition1: + type: integer + ext_condition4: + type: integer + exchange: + type: integer + ext_condition3: + type: integer + timestamp: + type: string + required: + - sequence + - condition + - size + - price + - ext_condition2 + - ext_condition1 + - ext_condition4 + - exchange + - ext_condition3 + - timestamp example: sequence: - 405549 @@ -1103,54 +981,38 @@ paths: content: application/json: schema: - type: object - properties: - ask_size: - type: array - items: - type: integer - bid_size: - type: array - items: - type: integer - ask_exchange: - type: array - items: - type: integer - ask_condition: - type: array - items: - type: integer - bid_exchange: - type: array - items: - type: integer - ask: - type: array - items: - type: number - bid: - type: array - items: - type: number - bid_condition: - type: array - items: - type: integer - timestamp: - type: array - items: - type: string - required: - - ask_size - - bid_size - - ask_exchange - - ask_condition - - bid_exchange - - ask - - bid - - bid_condition - - timestamp + type: array + items: + type: object + properties: + ask_size: + type: integer + bid_size: + type: integer + ask_exchange: + type: integer + ask_condition: + type: integer + bid_exchange: + type: integer + ask: + type: number + bid: + type: number + bid_condition: + type: integer + timestamp: + type: string + required: + - ask_size + - bid_size + - ask_exchange + - ask_condition + - bid_exchange + - ask + - bid + - bid_condition + - timestamp example: ask_size: - 8 @@ -1191,14 +1053,14 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - required: - - symbol + type: array + items: + type: object + properties: + symbol: + type: string + required: + - symbol example: symbol: - A @@ -1240,34 +1102,26 @@ paths: content: application/json: schema: - type: object - properties: - date: - type: array - items: - type: string - symbol: - type: array - items: - type: string - strike: - type: array - items: - type: number - expiration: - type: array - items: - type: string - right: - type: array - items: - type: string - required: - - date - - symbol - - strike - - expiration - - right + type: array + items: + type: object + properties: + date: + type: string + symbol: + type: string + strike: + type: number + expiration: + type: string + right: + type: string + required: + - date + - symbol + - strike + - expiration + - right example: date: - '2022-09-16' @@ -1322,19 +1176,17 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - expiration: - type: array - items: - type: string - required: - - symbol - - expiration + type: array + items: + type: object + properties: + symbol: + type: string + expiration: + type: string + required: + - symbol + - expiration example: symbol: - AAPL @@ -1375,19 +1227,17 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - strike: - type: array - items: - type: number - required: - - symbol - - strike + type: array + items: + type: object + properties: + symbol: + type: string + strike: + type: number + required: + - symbol + - strike example: symbol: - AAPL @@ -1433,29 +1283,23 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - strike: - type: array - items: - type: number - expiration: - type: array - items: - type: string - right: - type: array - items: - type: string - required: - - symbol - - strike - - expiration - - right + type: array + items: + type: object + properties: + symbol: + type: string + strike: + type: number + expiration: + type: string + right: + type: string + required: + - symbol + - strike + - expiration + - right example: symbol: - ABNB @@ -1511,64 +1355,44 @@ paths: content: application/json: schema: - type: object - properties: - volume: - type: array - items: - type: integer - symbol: - type: array - items: - type: string - high: - type: array - items: - type: number - low: - type: array - items: - type: number - strike: - type: array - items: - type: number - count: - type: array - items: - type: integer - expiration: - type: array - items: - type: string - right: - type: array - items: - type: string - close: - type: array - items: - type: number - open: - type: array - items: - type: number - timestamp: - type: array - items: - type: string - required: - - volume - - symbol - - high - - low - - strike - - count - - expiration - - right - - close - - open - - timestamp + type: array + items: + type: object + properties: + volume: + type: integer + symbol: + type: string + high: + type: number + low: + type: number + strike: + type: number + count: + type: integer + expiration: + type: string + right: + type: string + close: + type: number + open: + type: number + timestamp: + type: string + required: + - volume + - symbol + - high + - low + - strike + - count + - expiration + - right + - close + - open + - timestamp example: volume: - 202 @@ -1624,79 +1448,53 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - strike: - type: array - items: - type: number - right: - type: array - items: - type: string - sequence: - type: array - items: - type: integer - condition: - type: array - items: - type: integer - size: - type: array - items: - type: integer - price: - type: array - items: - type: number - ext_condition2: - type: array - items: - type: integer - ext_condition1: - type: array - items: - type: integer - expiration: - type: array - items: - type: string - ext_condition4: - type: array - items: - type: integer - exchange: - type: array - items: - type: integer - ext_condition3: - type: array - items: - type: integer - timestamp: - type: array - items: - type: string - required: - - symbol - - strike - - right - - sequence - - condition - - size - - price - - ext_condition2 - - ext_condition1 - - expiration - - ext_condition4 - - exchange - - ext_condition3 - - timestamp + type: array + items: + type: object + properties: + symbol: + type: string + strike: + type: number + right: + type: string + sequence: + type: integer + condition: + type: integer + size: + type: integer + price: + type: number + ext_condition2: + type: integer + ext_condition1: + type: integer + expiration: + type: string + ext_condition4: + type: integer + exchange: + type: integer + ext_condition3: + type: integer + timestamp: + type: string + required: + - symbol + - strike + - right + - sequence + - condition + - size + - price + - ext_condition2 + - ext_condition1 + - expiration + - ext_condition4 + - exchange + - ext_condition3 + - timestamp example: symbol: - AAPL @@ -1758,74 +1556,50 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - ask_size: - type: array - items: - type: integer - ask_condition: - type: array - items: - type: integer - strike: - type: array - items: - type: number - right: - type: array - items: - type: string - bid_size: - type: array - items: - type: integer - ask_exchange: - type: array - items: - type: integer - bid_exchange: - type: array - items: - type: integer - ask: - type: array - items: - type: number - expiration: - type: array - items: - type: string - bid: - type: array - items: - type: number - bid_condition: - type: array - items: - type: integer - timestamp: - type: array - items: - type: string - required: - - symbol - - ask_size - - ask_condition - - strike - - right - - bid_size - - ask_exchange - - bid_exchange - - ask - - expiration - - bid - - bid_condition - - timestamp + type: array + items: + type: object + properties: + symbol: + type: string + ask_size: + type: integer + ask_condition: + type: integer + strike: + type: number + right: + type: string + bid_size: + type: integer + ask_exchange: + type: integer + bid_exchange: + type: integer + ask: + type: number + expiration: + type: string + bid: + type: number + bid_condition: + type: integer + timestamp: + type: string + required: + - symbol + - ask_size + - ask_condition + - strike + - right + - bid_size + - ask_exchange + - bid_exchange + - ask + - expiration + - bid + - bid_condition + - timestamp example: symbol: - AAPL @@ -1885,39 +1659,29 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - strike: - type: array - items: - type: number - open_interest: - type: array - items: - type: integer - expiration: - type: array - items: - type: string - right: - type: array - items: - type: string - timestamp: - type: array - items: - type: string - required: - - symbol - - strike - - open_interest - - expiration - - right - - timestamp + type: array + items: + type: object + properties: + symbol: + type: string + strike: + type: number + open_interest: + type: integer + expiration: + type: string + right: + type: string + timestamp: + type: string + required: + - symbol + - strike + - open_interest + - expiration + - right + - timestamp example: symbol: - AAPL @@ -1967,64 +1731,44 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - underlying_price: - type: array - items: - type: number - strike: - type: array - items: - type: number - ask: - type: array - items: - type: number - expiration: - type: array - items: - type: string - right: - type: array - items: - type: string - implied_vol: - type: array - items: - type: number - bid: - type: array - items: - type: number - underlying_timestamp: - type: array - items: - type: string - iv_error: - type: array - items: - type: number - timestamp: - type: array - items: - type: string - required: - - symbol - - underlying_price - - strike - - ask - - expiration - - right - - implied_vol - - bid - - underlying_timestamp - - iv_error - - timestamp + type: array + items: + type: object + properties: + symbol: + type: string + underlying_price: + type: number + strike: + type: number + ask: + type: number + expiration: + type: string + right: + type: string + implied_vol: + type: number + bid: + type: number + underlying_timestamp: + type: string + iv_error: + type: number + timestamp: + type: string + required: + - symbol + - underlying_price + - strike + - ask + - expiration + - right + - implied_vol + - bid + - underlying_timestamp + - iv_error + - timestamp example: symbol: - AAPL @@ -2084,164 +1828,104 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: + type: array + items: + type: object + properties: + symbol: + type: string + dual_delta: + type: number + color: + type: number + zomma: + type: number + delta: + type: number + implied_vol: + type: number + theta: + type: number + d1: + type: number + speed: + type: number + d2: + type: number + epsilon: + type: number + lambda: + type: number + vomma: + type: number + underlying_timestamp: + type: string + timestamp: + type: string + underlying_price: + type: number + strike: + type: number + vera: + type: number + right: + type: string + veta: + type: number + iv_error: + type: number + ultima: + type: number + charm: + type: number + ask: + type: number + rho: + type: number + expiration: type: string - dual_delta: - type: array - items: + vanna: type: number - color: - type: array - items: + dual_gamma: type: number - zomma: - type: array - items: + bid: type: number - delta: - type: array - items: + vega: type: number - implied_vol: - type: array - items: + gamma: type: number - theta: - type: array - items: - type: number - d1: - type: array - items: - type: number - speed: - type: array - items: - type: number - d2: - type: array - items: - type: number - epsilon: - type: array - items: - type: number - lambda: - type: array - items: - type: number - vomma: - type: array - items: - type: number - underlying_timestamp: - type: array - items: - type: string - timestamp: - type: array - items: - type: string - underlying_price: - type: array - items: - type: number - strike: - type: array - items: - type: number - vera: - type: array - items: - type: number - right: - type: array - items: - type: string - veta: - type: array - items: - type: number - iv_error: - type: array - items: - type: number - ultima: - type: array - items: - type: number - charm: - type: array - items: - type: number - ask: - type: array - items: - type: number - rho: - type: array - items: - type: number - expiration: - type: array - items: - type: string - vanna: - type: array - items: - type: number - dual_gamma: - type: array - items: - type: number - bid: - type: array - items: - type: number - vega: - type: array - items: - type: number - gamma: - type: array - items: - type: number - required: - - symbol - - dual_delta - - color - - zomma - - delta - - implied_vol - - theta - - d1 - - speed - - d2 - - epsilon - - lambda - - vomma - - underlying_timestamp - - timestamp - - underlying_price - - strike - - vera - - right - - veta - - iv_error - - ultima - - charm - - ask - - rho - - expiration - - vanna - - dual_gamma - - bid - - vega - - gamma + required: + - symbol + - dual_delta + - color + - zomma + - delta + - implied_vol + - theta + - d1 + - speed + - d2 + - epsilon + - lambda + - vomma + - underlying_timestamp + - timestamp + - underlying_price + - strike + - vera + - right + - veta + - iv_error + - ultima + - charm + - ask + - rho + - expiration + - vanna + - dual_gamma + - bid + - vega + - gamma example: symbol: - AAPL @@ -2341,94 +2025,62 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - underlying_price: - type: array - items: - type: number - strike: - type: array - items: - type: number - delta: - type: array - items: - type: number - right: - type: array - items: - type: string - implied_vol: - type: array - items: - type: number - theta: - type: array - items: - type: number - iv_error: - type: array - items: - type: number - epsilon: - type: array - items: - type: number - lambda: - type: array - items: - type: number - ask: - type: array - items: - type: number - rho: - type: array - items: - type: number - expiration: - type: array - items: - type: string - bid: - type: array - items: - type: number - underlying_timestamp: - type: array - items: - type: string - vega: - type: array - items: - type: number - timestamp: - type: array - items: - type: string - required: - - symbol - - underlying_price - - strike - - delta - - right - - implied_vol - - theta - - iv_error - - epsilon - - lambda - - ask - - rho - - expiration - - bid - - underlying_timestamp - - vega - - timestamp + type: array + items: + type: object + properties: + symbol: + type: string + underlying_price: + type: number + strike: + type: number + delta: + type: number + right: + type: string + implied_vol: + type: number + theta: + type: number + iv_error: + type: number + epsilon: + type: number + lambda: + type: number + ask: + type: number + rho: + type: number + expiration: + type: string + bid: + type: number + underlying_timestamp: + type: string + vega: + type: number + timestamp: + type: string + required: + - symbol + - underlying_price + - strike + - delta + - right + - implied_vol + - theta + - iv_error + - epsilon + - lambda + - ask + - rho + - expiration + - bid + - underlying_timestamp + - vega + - timestamp example: symbol: - AAPL @@ -2500,89 +2152,59 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - underlying_price: - type: array - items: - type: number - strike: - type: array - items: - type: number - right: - type: array - items: - type: string - veta: - type: array - items: - type: number - implied_vol: - type: array - items: - type: number - iv_error: - type: array - items: - type: number - charm: - type: array - items: - type: number - ask: - type: array - items: - type: number - expiration: - type: array - items: - type: string - vanna: - type: array - items: - type: number - vomma: - type: array - items: - type: number - bid: - type: array - items: - type: number - underlying_timestamp: - type: array - items: - type: string - gamma: - type: array - items: - type: number - timestamp: - type: array - items: - type: string - required: - - symbol - - underlying_price - - strike - - right - - veta - - implied_vol - - iv_error - - charm - - ask - - expiration - - vanna - - vomma - - bid - - underlying_timestamp - - gamma - - timestamp + type: array + items: + type: object + properties: + symbol: + type: string + underlying_price: + type: number + strike: + type: number + right: + type: string + veta: + type: number + implied_vol: + type: number + iv_error: + type: number + charm: + type: number + ask: + type: number + expiration: + type: string + vanna: + type: number + vomma: + type: number + bid: + type: number + underlying_timestamp: + type: string + gamma: + type: number + timestamp: + type: string + required: + - symbol + - underlying_price + - strike + - right + - veta + - implied_vol + - iv_error + - charm + - ask + - expiration + - vanna + - vomma + - bid + - underlying_timestamp + - gamma + - timestamp example: symbol: - AAPL @@ -2668,84 +2290,56 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - underlying_price: - type: array - items: - type: number - color: - type: array - items: - type: number - strike: - type: array - items: - type: number - zomma: - type: array - items: - type: number - right: - type: array - items: - type: string - implied_vol: - type: array - items: - type: number - iv_error: - type: array - items: - type: number - speed: - type: array - items: - type: number - ultima: - type: array - items: - type: number - ask: - type: array - items: - type: number - expiration: - type: array - items: - type: string - bid: - type: array - items: - type: number - underlying_timestamp: - type: array - items: - type: string - timestamp: - type: array - items: - type: string - required: - - symbol - - underlying_price - - color - - strike - - zomma - - right - - implied_vol - - iv_error - - speed - - ultima - - ask - - expiration - - bid - - underlying_timestamp - - timestamp + type: array + items: + type: object + properties: + symbol: + type: string + underlying_price: + type: number + color: + type: number + strike: + type: number + zomma: + type: number + right: + type: string + implied_vol: + type: number + iv_error: + type: number + speed: + type: number + ultima: + type: number + ask: + type: number + expiration: + type: string + bid: + type: number + underlying_timestamp: + type: string + timestamp: + type: string + required: + - symbol + - underlying_price + - color + - strike + - zomma + - right + - implied_vol + - iv_error + - speed + - ultima + - ask + - expiration + - bid + - underlying_timestamp + - timestamp example: symbol: - AAPL @@ -2827,109 +2421,71 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - ask_size: - type: array - items: - type: integer - last_trade: - type: array - items: - type: string - created: - type: array - items: - type: string - ask_condition: - type: array - items: - type: integer - strike: - type: array - items: - type: number - count: - type: array - items: - type: integer - right: - type: array - items: - type: string - volume: - type: array - items: - type: integer - high: - type: array - items: - type: number - low: - type: array - items: - type: number - bid_size: - type: array - items: - type: integer - ask_exchange: - type: array - items: - type: integer - bid_exchange: - type: array - items: - type: integer - ask: - type: array - items: - type: number - expiration: - type: array - items: - type: string - bid: - type: array - items: - type: number - bid_condition: - type: array - items: - type: integer - close: - type: array - items: - type: number - open: - type: array - items: - type: number - required: - - symbol - - ask_size - - last_trade - - created - - ask_condition - - strike - - count - - right - - volume - - high - - low - - bid_size - - ask_exchange - - bid_exchange - - ask - - expiration - - bid - - bid_condition - - close - - open + type: array + items: + type: object + properties: + symbol: + type: string + ask_size: + type: integer + last_trade: + type: string + created: + type: string + ask_condition: + type: integer + strike: + type: number + count: + type: integer + right: + type: string + volume: + type: integer + high: + type: number + low: + type: number + bid_size: + type: integer + ask_exchange: + type: integer + bid_exchange: + type: integer + ask: + type: number + expiration: + type: string + bid: + type: number + bid_condition: + type: integer + close: + type: number + open: + type: number + required: + - symbol + - ask_size + - last_trade + - created + - ask_condition + - strike + - count + - right + - volume + - high + - low + - bid_size + - ask_exchange + - bid_exchange + - ask + - expiration + - bid + - bid_condition + - close + - open example: symbol: - AAPL @@ -3002,69 +2558,47 @@ paths: content: application/json: schema: - type: object - properties: - volume: - type: array - items: - type: integer - symbol: - type: array - items: - type: string - high: - type: array - items: - type: number - low: - type: array - items: - type: number - strike: - type: array - items: - type: number - vwap: - type: array - items: - type: number - count: - type: array - items: - type: integer - expiration: - type: array - items: - type: string - right: - type: array - items: - type: string - close: - type: array - items: - type: number - open: - type: array - items: - type: number - timestamp: - type: array - items: - type: string - required: - - volume - - symbol - - high - - low - - strike - - vwap - - count - - expiration - - right - - close - - open - - timestamp + type: array + items: + type: object + properties: + volume: + type: integer + symbol: + type: string + high: + type: number + low: + type: number + strike: + type: number + vwap: + type: number + count: + type: integer + expiration: + type: string + right: + type: string + close: + type: number + open: + type: number + timestamp: + type: string + required: + - volume + - symbol + - high + - low + - strike + - vwap + - count + - expiration + - right + - close + - open + - timestamp example: volume: - 147 @@ -3173,79 +2707,53 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - strike: - type: array - items: - type: number - right: - type: array - items: - type: string - sequence: - type: array - items: - type: integer - condition: - type: array - items: - type: integer - size: - type: array - items: - type: integer - price: - type: array - items: - type: number - ext_condition2: - type: array - items: - type: integer - ext_condition1: - type: array - items: - type: integer - expiration: - type: array - items: - type: string - ext_condition4: - type: array - items: - type: integer - exchange: - type: array - items: - type: integer - ext_condition3: - type: array - items: - type: integer - timestamp: - type: array - items: - type: string - required: - - symbol - - strike - - right - - sequence - - condition - - size - - price - - ext_condition2 - - ext_condition1 - - expiration - - ext_condition4 - - exchange - - ext_condition3 - - timestamp + type: array + items: + type: object + properties: + symbol: + type: string + strike: + type: number + right: + type: string + sequence: + type: integer + condition: + type: integer + size: + type: integer + price: + type: number + ext_condition2: + type: integer + ext_condition1: + type: integer + expiration: + type: string + ext_condition4: + type: integer + exchange: + type: integer + ext_condition3: + type: integer + timestamp: + type: string + required: + - symbol + - strike + - right + - sequence + - condition + - size + - price + - ext_condition2 + - ext_condition1 + - expiration + - ext_condition4 + - exchange + - ext_condition3 + - timestamp example: symbol: - AAPL @@ -3365,74 +2873,50 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - ask_size: - type: array - items: - type: integer - ask_condition: - type: array - items: - type: integer - strike: - type: array - items: - type: number - right: - type: array - items: - type: string - bid_size: - type: array - items: - type: integer - ask_exchange: - type: array - items: - type: integer - bid_exchange: - type: array - items: - type: integer - ask: - type: array - items: - type: number - expiration: - type: array - items: - type: string - bid: - type: array - items: - type: number - bid_condition: - type: array - items: - type: integer - timestamp: - type: array - items: - type: string - required: - - symbol - - ask_size - - ask_condition - - strike - - right - - bid_size - - ask_exchange - - bid_exchange - - ask - - expiration - - bid - - bid_condition - - timestamp + type: array + items: + type: object + properties: + symbol: + type: string + ask_size: + type: integer + ask_condition: + type: integer + strike: + type: number + right: + type: string + bid_size: + type: integer + ask_exchange: + type: integer + bid_exchange: + type: integer + ask: + type: number + expiration: + type: string + bid: + type: number + bid_condition: + type: integer + timestamp: + type: string + required: + - symbol + - ask_size + - ask_condition + - strike + - right + - bid_size + - ask_exchange + - bid_exchange + - ask + - expiration + - bid + - bid_condition + - timestamp example: symbol: - AAPL @@ -3547,124 +3031,80 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - ask_size: - type: array - items: - type: integer - trade_timestamp: - type: array - items: - type: string - ask_condition: - type: array - items: - type: integer - strike: - type: array - items: - type: number - right: - type: array - items: - type: string - sequence: - type: array - items: - type: integer - condition: - type: array - items: - type: integer - size: - type: array - items: - type: integer - bid_size: - type: array - items: - type: integer - ask_exchange: - type: array - items: - type: integer - price: - type: array - items: - type: number - ext_condition2: - type: array - items: - type: integer - bid_exchange: - type: array - items: - type: integer - ask: - type: array - items: - type: number - quote_timestamp: - type: array - items: - type: string - ext_condition1: - type: array - items: - type: integer - expiration: - type: array - items: - type: string - ext_condition4: - type: array - items: - type: integer - exchange: - type: array - items: - type: integer - ext_condition3: - type: array - items: - type: integer - bid: - type: array - items: - type: number - bid_condition: - type: array - items: - type: integer - required: - - symbol - - ask_size - - trade_timestamp - - ask_condition - - strike - - right - - sequence - - condition - - size - - bid_size - - ask_exchange - - price - - ext_condition2 - - bid_exchange - - ask - - quote_timestamp - - ext_condition1 - - expiration - - ext_condition4 - - exchange - - ext_condition3 - - bid - - bid_condition + type: array + items: + type: object + properties: + symbol: + type: string + ask_size: + type: integer + trade_timestamp: + type: string + ask_condition: + type: integer + strike: + type: number + right: + type: string + sequence: + type: integer + condition: + type: integer + size: + type: integer + bid_size: + type: integer + ask_exchange: + type: integer + price: + type: number + ext_condition2: + type: integer + bid_exchange: + type: integer + ask: + type: number + quote_timestamp: + type: string + ext_condition1: + type: integer + expiration: + type: string + ext_condition4: + type: integer + exchange: + type: integer + ext_condition3: + type: integer + bid: + type: number + bid_condition: + type: integer + required: + - symbol + - ask_size + - trade_timestamp + - ask_condition + - strike + - right + - sequence + - condition + - size + - bid_size + - ask_exchange + - price + - ext_condition2 + - bid_exchange + - ask + - quote_timestamp + - ext_condition1 + - expiration + - ext_condition4 + - exchange + - ext_condition3 + - bid + - bid_condition example: symbol: - AAPL @@ -3836,39 +3276,29 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - strike: - type: array - items: - type: number - open_interest: - type: array - items: - type: integer - expiration: - type: array - items: - type: string - right: - type: array - items: - type: string - timestamp: - type: array - items: - type: string - required: - - symbol - - strike - - open_interest - - expiration - - right - - timestamp + type: array + items: + type: object + properties: + symbol: + type: string + strike: + type: number + open_interest: + type: integer + expiration: + type: string + right: + type: string + timestamp: + type: string + required: + - symbol + - strike + - open_interest + - expiration + - right + - timestamp example: symbol: - AAPL @@ -3919,224 +3349,140 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: + type: array + items: + type: object + properties: + symbol: type: string - ask_size: - type: array - items: + ask_size: type: integer - dual_delta: - type: array - items: + dual_delta: type: number - color: - type: array - items: + color: type: number - zomma: - type: array - items: + zomma: type: number - delta: - type: array - items: + delta: type: number - implied_vol: - type: array - items: + implied_vol: type: number - theta: - type: array - items: + theta: type: number - d1: - type: array - items: + d1: type: number - speed: - type: array - items: + speed: type: number - d2: - type: array - items: + d2: type: number - epsilon: - type: array - items: + epsilon: type: number - high: - type: array - items: + high: type: number - lambda: - type: array - items: + lambda: type: number - low: - type: array - items: + low: type: number - ask_exchange: - type: array - items: + ask_exchange: type: integer - bid_exchange: - type: array - items: + bid_exchange: type: integer - vomma: - type: array - items: + vomma: type: number - bid_condition: - type: array - items: - type: integer - underlying_timestamp: - type: array - items: - type: string - close: - type: array - items: - type: number - timestamp: - type: array - items: - type: string - underlying_price: - type: array - items: - type: number - ask_condition: - type: array - items: - type: integer - strike: - type: array - items: - type: number - count: - type: array - items: - type: integer - vera: - type: array - items: - type: number - right: - type: array - items: - type: string - veta: - type: array - items: - type: number - iv_error: - type: array - items: - type: number - ultima: - type: array - items: - type: number - volume: - type: array - items: - type: integer - charm: - type: array - items: - type: number - bid_size: - type: array - items: - type: integer - ask: - type: array - items: - type: number - rho: - type: array - items: - type: number - expiration: - type: array - items: - type: string - vanna: - type: array - items: - type: number - dual_gamma: - type: array - items: - type: number - bid: - type: array - items: - type: number - open: - type: array - items: - type: number - vega: - type: array - items: - type: number - gamma: - type: array - items: - type: number - required: - - symbol - - ask_size - - dual_delta - - color - - zomma - - delta - - implied_vol - - theta - - d1 - - speed - - d2 - - epsilon - - high - - lambda - - low - - ask_exchange - - bid_exchange - - vomma - - bid_condition - - underlying_timestamp - - close - - timestamp - - underlying_price - - ask_condition - - strike - - count - - vera - - right - - veta - - iv_error - - ultima - - volume - - charm - - bid_size - - ask - - rho - - expiration - - vanna - - dual_gamma - - bid - - open - - vega - - gamma + bid_condition: + type: integer + underlying_timestamp: + type: string + close: + type: number + timestamp: + type: string + underlying_price: + type: number + ask_condition: + type: integer + strike: + type: number + count: + type: integer + vera: + type: number + right: + type: string + veta: + type: number + iv_error: + type: number + ultima: + type: number + volume: + type: integer + charm: + type: number + bid_size: + type: integer + ask: + type: number + rho: + type: number + expiration: + type: string + vanna: + type: number + dual_gamma: + type: number + bid: + type: number + open: + type: number + vega: + type: number + gamma: + type: number + required: + - symbol + - ask_size + - dual_delta + - color + - zomma + - delta + - implied_vol + - theta + - d1 + - speed + - d2 + - epsilon + - high + - lambda + - low + - ask_exchange + - bid_exchange + - vomma + - bid_condition + - underlying_timestamp + - close + - timestamp + - underlying_price + - ask_condition + - strike + - count + - vera + - right + - veta + - iv_error + - ultima + - volume + - charm + - bid_size + - ask + - rho + - expiration + - vanna + - dual_gamma + - bid + - open + - vega + - gamma example: symbol: - AAPL @@ -4259,164 +3605,104 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: + type: array + items: + type: object + properties: + symbol: + type: string + dual_delta: + type: number + color: + type: number + zomma: + type: number + delta: + type: number + implied_vol: + type: number + theta: + type: number + d1: + type: number + speed: + type: number + d2: + type: number + epsilon: + type: number + lambda: + type: number + vomma: + type: number + underlying_timestamp: + type: string + timestamp: + type: string + underlying_price: + type: number + strike: + type: number + vera: + type: number + right: + type: string + veta: + type: number + iv_error: + type: number + ultima: + type: number + charm: + type: number + ask: + type: number + rho: + type: number + expiration: type: string - dual_delta: - type: array - items: + vanna: type: number - color: - type: array - items: + dual_gamma: type: number - zomma: - type: array - items: + bid: type: number - delta: - type: array - items: + vega: type: number - implied_vol: - type: array - items: + gamma: type: number - theta: - type: array - items: - type: number - d1: - type: array - items: - type: number - speed: - type: array - items: - type: number - d2: - type: array - items: - type: number - epsilon: - type: array - items: - type: number - lambda: - type: array - items: - type: number - vomma: - type: array - items: - type: number - underlying_timestamp: - type: array - items: - type: string - timestamp: - type: array - items: - type: string - underlying_price: - type: array - items: - type: number - strike: - type: array - items: - type: number - vera: - type: array - items: - type: number - right: - type: array - items: - type: string - veta: - type: array - items: - type: number - iv_error: - type: array - items: - type: number - ultima: - type: array - items: - type: number - charm: - type: array - items: - type: number - ask: - type: array - items: - type: number - rho: - type: array - items: - type: number - expiration: - type: array - items: - type: string - vanna: - type: array - items: - type: number - dual_gamma: - type: array - items: - type: number - bid: - type: array - items: - type: number - vega: - type: array - items: - type: number - gamma: - type: array - items: - type: number - required: - - symbol - - dual_delta - - color - - zomma - - delta - - implied_vol - - theta - - d1 - - speed - - d2 - - epsilon - - lambda - - vomma - - underlying_timestamp - - timestamp - - underlying_price - - strike - - vera - - right - - veta - - iv_error - - ultima - - charm - - ask - - rho - - expiration - - vanna - - dual_gamma - - bid - - vega - - gamma + required: + - symbol + - dual_delta + - color + - zomma + - delta + - implied_vol + - theta + - d1 + - speed + - d2 + - epsilon + - lambda + - vomma + - underlying_timestamp + - timestamp + - underlying_price + - strike + - vera + - right + - veta + - iv_error + - ultima + - charm + - ask + - rho + - expiration + - vanna + - dual_gamma + - bid + - vega + - gamma example: symbol: - AAPL @@ -4641,199 +3927,125 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: + type: array + items: + type: object + properties: + symbol: + type: string + dual_delta: + type: number + color: + type: number + zomma: + type: number + delta: + type: number + implied_vol: + type: number + theta: + type: number + d1: + type: number + speed: + type: number + d2: + type: number + epsilon: + type: number + lambda: + type: number + price: + type: number + ext_condition2: + type: integer + ext_condition1: + type: integer + ext_condition4: + type: integer + vomma: + type: number + ext_condition3: + type: integer + underlying_timestamp: type: string - dual_delta: - type: array - items: + timestamp: + type: string + underlying_price: type: number - color: - type: array - items: + strike: type: number - zomma: - type: array - items: + vera: type: number - delta: - type: array - items: + right: + type: string + veta: type: number - implied_vol: - type: array - items: + iv_error: type: number - theta: - type: array - items: + ultima: type: number - d1: - type: array - items: + sequence: + type: integer + condition: + type: integer + size: + type: integer + charm: type: number - speed: - type: array - items: + rho: type: number - d2: - type: array - items: + expiration: + type: string + exchange: + type: integer + vanna: type: number - epsilon: - type: array - items: + dual_gamma: type: number - lambda: - type: array - items: + vega: type: number - price: - type: array - items: + gamma: type: number - ext_condition2: - type: array - items: - type: integer - ext_condition1: - type: array - items: - type: integer - ext_condition4: - type: array - items: - type: integer - vomma: - type: array - items: - type: number - ext_condition3: - type: array - items: - type: integer - underlying_timestamp: - type: array - items: - type: string - timestamp: - type: array - items: - type: string - underlying_price: - type: array - items: - type: number - strike: - type: array - items: - type: number - vera: - type: array - items: - type: number - right: - type: array - items: - type: string - veta: - type: array - items: - type: number - iv_error: - type: array - items: - type: number - ultima: - type: array - items: - type: number - sequence: - type: array - items: - type: integer - condition: - type: array - items: - type: integer - size: - type: array - items: - type: integer - charm: - type: array - items: - type: number - rho: - type: array - items: - type: number - expiration: - type: array - items: - type: string - exchange: - type: array - items: - type: integer - vanna: - type: array - items: - type: number - dual_gamma: - type: array - items: - type: number - vega: - type: array - items: - type: number - gamma: - type: array - items: - type: number - required: - - symbol - - dual_delta - - color - - zomma - - delta - - implied_vol - - theta - - d1 - - speed - - d2 - - epsilon - - lambda - - price - - ext_condition2 - - ext_condition1 - - ext_condition4 - - vomma - - ext_condition3 - - underlying_timestamp - - timestamp - - underlying_price - - strike - - vera - - right - - veta - - iv_error - - ultima - - sequence - - condition - - size - - charm - - rho - - expiration - - exchange - - vanna - - dual_gamma - - vega - - gamma + required: + - symbol + - dual_delta + - color + - zomma + - delta + - implied_vol + - theta + - d1 + - speed + - d2 + - epsilon + - lambda + - price + - ext_condition2 + - ext_condition1 + - ext_condition4 + - vomma + - ext_condition3 + - underlying_timestamp + - timestamp + - underlying_price + - strike + - vera + - right + - veta + - iv_error + - ultima + - sequence + - condition + - size + - charm + - rho + - expiration + - exchange + - vanna + - dual_gamma + - vega + - gamma example: symbol: - AAPL @@ -5098,94 +4310,62 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - underlying_price: - type: array - items: - type: number - strike: - type: array - items: - type: number - delta: - type: array - items: - type: number - right: - type: array - items: - type: string - implied_vol: - type: array - items: - type: number - theta: - type: array - items: - type: number - iv_error: - type: array - items: - type: number - epsilon: - type: array - items: - type: number - lambda: - type: array - items: - type: number - ask: - type: array - items: - type: number - rho: - type: array - items: - type: number - expiration: - type: array - items: - type: string - bid: - type: array - items: - type: number - underlying_timestamp: - type: array - items: - type: string - vega: - type: array - items: - type: number - timestamp: - type: array - items: - type: string - required: - - symbol - - underlying_price - - strike - - delta - - right - - implied_vol - - theta - - iv_error - - epsilon - - lambda - - ask - - rho - - expiration - - bid - - underlying_timestamp - - vega - - timestamp + type: array + items: + type: object + properties: + symbol: + type: string + underlying_price: + type: number + strike: + type: number + delta: + type: number + right: + type: string + implied_vol: + type: number + theta: + type: number + iv_error: + type: number + epsilon: + type: number + lambda: + type: number + ask: + type: number + rho: + type: number + expiration: + type: string + bid: + type: number + underlying_timestamp: + type: string + vega: + type: number + timestamp: + type: string + required: + - symbol + - underlying_price + - strike + - delta + - right + - implied_vol + - theta + - iv_error + - epsilon + - lambda + - ask + - rho + - expiration + - bid + - underlying_timestamp + - vega + - timestamp example: symbol: - AAPL @@ -5327,129 +4507,83 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - underlying_price: - type: array - items: - type: number - strike: - type: array - items: - type: number - delta: - type: array - items: - type: number - right: - type: array - items: - type: string - implied_vol: - type: array - items: - type: number - theta: - type: array - items: - type: number - iv_error: - type: array - items: - type: number - epsilon: - type: array - items: - type: number - sequence: - type: array - items: - type: integer - condition: - type: array - items: - type: integer - lambda: - type: array - items: - type: number - size: - type: array - items: - type: integer - price: - type: array - items: - type: number - ext_condition2: - type: array - items: - type: integer - rho: - type: array - items: - type: number - ext_condition1: - type: array - items: - type: integer - expiration: - type: array - items: - type: string - ext_condition4: - type: array - items: - type: integer - exchange: - type: array - items: - type: integer - ext_condition3: - type: array - items: - type: integer - underlying_timestamp: - type: array - items: - type: string - vega: - type: array - items: - type: number - timestamp: - type: array - items: - type: string - required: - - symbol - - underlying_price - - strike - - delta - - right - - implied_vol - - theta - - iv_error - - epsilon - - sequence - - condition - - lambda - - size - - price - - ext_condition2 - - rho - - ext_condition1 - - expiration - - ext_condition4 - - exchange - - ext_condition3 - - underlying_timestamp - - vega - - timestamp + type: array + items: + type: object + properties: + symbol: + type: string + underlying_price: + type: number + strike: + type: number + delta: + type: number + right: + type: string + implied_vol: + type: number + theta: + type: number + iv_error: + type: number + epsilon: + type: number + sequence: + type: integer + condition: + type: integer + lambda: + type: number + size: + type: integer + price: + type: number + ext_condition2: + type: integer + rho: + type: number + ext_condition1: + type: integer + expiration: + type: string + ext_condition4: + type: integer + exchange: + type: integer + ext_condition3: + type: integer + underlying_timestamp: + type: string + vega: + type: number + timestamp: + type: string + required: + - symbol + - underlying_price + - strike + - delta + - right + - implied_vol + - theta + - iv_error + - epsilon + - sequence + - condition + - lambda + - size + - price + - ext_condition2 + - rho + - ext_condition1 + - expiration + - ext_condition4 + - exchange + - ext_condition3 + - underlying_timestamp + - vega + - timestamp example: symbol: - AAPL @@ -5630,89 +4764,59 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - underlying_price: - type: array - items: - type: number - strike: - type: array - items: - type: number - right: - type: array - items: - type: string - veta: - type: array - items: - type: number - implied_vol: - type: array - items: - type: number - iv_error: - type: array - items: - type: number - charm: - type: array - items: - type: number - ask: - type: array - items: - type: number - expiration: - type: array - items: - type: string - vanna: - type: array - items: - type: number - vomma: - type: array - items: - type: number - bid: - type: array - items: - type: number - underlying_timestamp: - type: array - items: - type: string - gamma: - type: array - items: - type: number - timestamp: - type: array - items: - type: string - required: - - symbol - - underlying_price - - strike - - right - - veta - - implied_vol - - iv_error - - charm - - ask - - expiration - - vanna - - vomma - - bid - - underlying_timestamp - - gamma - - timestamp + type: array + items: + type: object + properties: + symbol: + type: string + underlying_price: + type: number + strike: + type: number + right: + type: string + veta: + type: number + implied_vol: + type: number + iv_error: + type: number + charm: + type: number + ask: + type: number + expiration: + type: string + vanna: + type: number + vomma: + type: number + bid: + type: number + underlying_timestamp: + type: string + gamma: + type: number + timestamp: + type: string + required: + - symbol + - underlying_price + - strike + - right + - veta + - implied_vol + - iv_error + - charm + - ask + - expiration + - vanna + - vomma + - bid + - underlying_timestamp + - gamma + - timestamp example: symbol: - AAPL @@ -5848,124 +4952,80 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - underlying_price: - type: array - items: - type: number - strike: - type: array - items: - type: number - right: - type: array - items: - type: string - veta: - type: array - items: - type: number - implied_vol: - type: array - items: - type: number - iv_error: - type: array - items: - type: number - sequence: - type: array - items: - type: integer - condition: - type: array - items: - type: integer - size: - type: array - items: - type: integer - charm: - type: array - items: - type: number - price: - type: array - items: - type: number - ext_condition2: - type: array - items: - type: integer - ext_condition1: - type: array - items: - type: integer - expiration: - type: array - items: - type: string - ext_condition4: - type: array - items: - type: integer - exchange: - type: array - items: - type: integer - vanna: - type: array - items: - type: number - vomma: - type: array - items: - type: number - ext_condition3: - type: array - items: - type: integer - underlying_timestamp: - type: array - items: - type: string - gamma: - type: array - items: - type: number - timestamp: - type: array - items: - type: string - required: - - symbol - - underlying_price - - strike - - right - - veta - - implied_vol - - iv_error - - sequence - - condition - - size - - charm - - price - - ext_condition2 - - ext_condition1 - - expiration - - ext_condition4 - - exchange - - vanna - - vomma - - ext_condition3 - - underlying_timestamp - - gamma - - timestamp + type: array + items: + type: object + properties: + symbol: + type: string + underlying_price: + type: number + strike: + type: number + right: + type: string + veta: + type: number + implied_vol: + type: number + iv_error: + type: number + sequence: + type: integer + condition: + type: integer + size: + type: integer + charm: + type: number + price: + type: number + ext_condition2: + type: integer + ext_condition1: + type: integer + expiration: + type: string + ext_condition4: + type: integer + exchange: + type: integer + vanna: + type: number + vomma: + type: number + ext_condition3: + type: integer + underlying_timestamp: + type: string + gamma: + type: number + timestamp: + type: string + required: + - symbol + - underlying_price + - strike + - right + - veta + - implied_vol + - iv_error + - sequence + - condition + - size + - charm + - price + - ext_condition2 + - ext_condition1 + - expiration + - ext_condition4 + - exchange + - vanna + - vomma + - ext_condition3 + - underlying_timestamp + - gamma + - timestamp example: symbol: - AAPL @@ -6140,84 +5200,56 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - underlying_price: - type: array - items: - type: number - color: - type: array - items: - type: number - strike: - type: array - items: - type: number - zomma: - type: array - items: - type: number - right: - type: array - items: - type: string - implied_vol: - type: array - items: - type: number - iv_error: - type: array - items: - type: number - speed: - type: array - items: - type: number - ultima: - type: array - items: - type: number - ask: - type: array - items: - type: number - expiration: - type: array - items: - type: string - bid: - type: array - items: - type: number - underlying_timestamp: - type: array - items: - type: string - timestamp: - type: array - items: - type: string - required: - - symbol - - underlying_price - - color - - strike - - zomma - - right - - implied_vol - - iv_error - - speed - - ultima - - ask - - expiration - - bid - - underlying_timestamp - - timestamp + type: array + items: + type: object + properties: + symbol: + type: string + underlying_price: + type: number + color: + type: number + strike: + type: number + zomma: + type: number + right: + type: string + implied_vol: + type: number + iv_error: + type: number + speed: + type: number + ultima: + type: number + ask: + type: number + expiration: + type: string + bid: + type: number + underlying_timestamp: + type: string + timestamp: + type: string + required: + - symbol + - underlying_price + - color + - strike + - zomma + - right + - implied_vol + - iv_error + - speed + - ultima + - ask + - expiration + - bid + - underlying_timestamp + - timestamp example: symbol: - AAPL @@ -6347,119 +5379,77 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - underlying_price: - type: array - items: - type: number - color: - type: array - items: - type: number - strike: - type: array - items: - type: number - zomma: - type: array - items: - type: number - right: - type: array - items: - type: string - implied_vol: - type: array - items: - type: number - iv_error: - type: array - items: - type: number - speed: - type: array - items: - type: number - ultima: - type: array - items: - type: number - sequence: - type: array - items: - type: integer - condition: - type: array - items: - type: integer - size: - type: array - items: - type: integer - price: - type: array - items: - type: number - ext_condition2: - type: array - items: - type: integer - ext_condition1: - type: array - items: - type: integer - expiration: - type: array - items: - type: string - ext_condition4: - type: array - items: - type: integer - exchange: - type: array - items: - type: integer - ext_condition3: - type: array - items: - type: integer - underlying_timestamp: - type: array - items: - type: string - timestamp: - type: array - items: - type: string - required: - - symbol - - underlying_price - - color - - strike - - zomma - - right - - implied_vol - - iv_error - - speed - - ultima - - sequence - - condition - - size - - price - - ext_condition2 - - ext_condition1 - - expiration - - ext_condition4 - - exchange - - ext_condition3 - - underlying_timestamp - - timestamp + type: array + items: + type: object + properties: + symbol: + type: string + underlying_price: + type: number + color: + type: number + strike: + type: number + zomma: + type: number + right: + type: string + implied_vol: + type: number + iv_error: + type: number + speed: + type: number + ultima: + type: number + sequence: + type: integer + condition: + type: integer + size: + type: integer + price: + type: number + ext_condition2: + type: integer + ext_condition1: + type: integer + expiration: + type: string + ext_condition4: + type: integer + exchange: + type: integer + ext_condition3: + type: integer + underlying_timestamp: + type: string + timestamp: + type: string + required: + - symbol + - underlying_price + - color + - strike + - zomma + - right + - implied_vol + - iv_error + - speed + - ultima + - sequence + - condition + - size + - price + - ext_condition2 + - ext_condition1 + - expiration + - ext_condition4 + - exchange + - ext_condition3 + - underlying_timestamp + - timestamp example: symbol: - AAPL @@ -6628,79 +5618,53 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - underlying_price: - type: array - items: - type: number - strike: - type: array - items: - type: number - right: - type: array - items: - type: string - implied_vol: - type: array - items: - type: number - iv_error: - type: array - items: - type: number - bid_implied_vol: - type: array - items: - type: number - ask: - type: array - items: - type: number - midpoint: - type: array - items: - type: number - expiration: - type: array - items: - type: string - ask_implied_vol: - type: array - items: - type: number - bid: - type: array - items: - type: number - underlying_timestamp: - type: array - items: - type: string - timestamp: - type: array - items: - type: string - required: - - symbol - - underlying_price - - strike - - right - - implied_vol - - iv_error - - bid_implied_vol - - ask - - midpoint - - expiration - - ask_implied_vol - - bid - - underlying_timestamp - - timestamp + type: array + items: + type: object + properties: + symbol: + type: string + underlying_price: + type: number + strike: + type: number + right: + type: string + implied_vol: + type: number + iv_error: + type: number + bid_implied_vol: + type: number + ask: + type: number + midpoint: + type: number + expiration: + type: string + ask_implied_vol: + type: number + bid: + type: number + underlying_timestamp: + type: string + timestamp: + type: string + required: + - symbol + - underlying_price + - strike + - right + - implied_vol + - iv_error + - bid_implied_vol + - ask + - midpoint + - expiration + - ask_implied_vol + - bid + - underlying_timestamp + - timestamp example: symbol: - AAPL @@ -6819,99 +5783,65 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - underlying_price: - type: array - items: - type: number - strike: - type: array - items: - type: number - right: - type: array - items: - type: string - implied_vol: - type: array - items: - type: number - iv_error: - type: array - items: - type: number - sequence: - type: array - items: - type: integer - condition: - type: array - items: - type: integer - size: - type: array - items: - type: integer - price: - type: array - items: - type: number - ext_condition2: - type: array - items: - type: integer - ext_condition1: - type: array - items: - type: integer - expiration: - type: array - items: - type: string - ext_condition4: - type: array - items: - type: integer - exchange: - type: array - items: - type: integer - ext_condition3: - type: array - items: - type: integer - underlying_timestamp: - type: array - items: - type: string - timestamp: - type: array - items: - type: string - required: - - symbol - - underlying_price - - strike - - right - - implied_vol - - iv_error - - sequence - - condition - - size - - price - - ext_condition2 - - ext_condition1 - - expiration - - ext_condition4 - - exchange - - ext_condition3 - - underlying_timestamp - - timestamp + type: array + items: + type: object + properties: + symbol: + type: string + underlying_price: + type: number + strike: + type: number + right: + type: string + implied_vol: + type: number + iv_error: + type: number + sequence: + type: integer + condition: + type: integer + size: + type: integer + price: + type: number + ext_condition2: + type: integer + ext_condition1: + type: integer + expiration: + type: string + ext_condition4: + type: integer + exchange: + type: integer + ext_condition3: + type: integer + underlying_timestamp: + type: string + timestamp: + type: string + required: + - symbol + - underlying_price + - strike + - right + - implied_vol + - iv_error + - sequence + - condition + - size + - price + - ext_condition2 + - ext_condition1 + - expiration + - ext_condition4 + - exchange + - ext_condition3 + - underlying_timestamp + - timestamp example: symbol: - AAPL @@ -7053,79 +5983,53 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - strike: - type: array - items: - type: number - right: - type: array - items: - type: string - sequence: - type: array - items: - type: integer - condition: - type: array - items: - type: integer - size: - type: array - items: - type: integer - price: - type: array - items: - type: number - ext_condition2: - type: array - items: - type: integer - ext_condition1: - type: array - items: - type: integer - expiration: - type: array - items: - type: string - ext_condition4: - type: array - items: - type: integer - exchange: - type: array - items: - type: integer - ext_condition3: - type: array - items: - type: integer - timestamp: - type: array - items: - type: string - required: - - symbol - - strike - - right - - sequence - - condition - - size - - price - - ext_condition2 - - ext_condition1 - - expiration - - ext_condition4 - - exchange - - ext_condition3 - - timestamp + type: array + items: + type: object + properties: + symbol: + type: string + strike: + type: number + right: + type: string + sequence: + type: integer + condition: + type: integer + size: + type: integer + price: + type: number + ext_condition2: + type: integer + ext_condition1: + type: integer + expiration: + type: string + ext_condition4: + type: integer + exchange: + type: integer + ext_condition3: + type: integer + timestamp: + type: string + required: + - symbol + - strike + - right + - sequence + - condition + - size + - price + - ext_condition2 + - ext_condition1 + - expiration + - ext_condition4 + - exchange + - ext_condition3 + - timestamp example: symbol: - AAPL @@ -7185,74 +6089,50 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - ask_size: - type: array - items: - type: integer - ask_condition: - type: array - items: - type: integer - strike: - type: array - items: - type: number - right: - type: array - items: - type: string - bid_size: - type: array - items: - type: integer - ask_exchange: - type: array - items: - type: integer - bid_exchange: - type: array - items: - type: integer - ask: - type: array - items: - type: number - expiration: - type: array - items: - type: string - bid: - type: array - items: - type: number - bid_condition: - type: array - items: - type: integer - timestamp: - type: array - items: - type: string - required: - - symbol - - ask_size - - ask_condition - - strike - - right - - bid_size - - ask_exchange - - bid_exchange - - ask - - expiration - - bid - - bid_condition - - timestamp + type: array + items: + type: object + properties: + symbol: + type: string + ask_size: + type: integer + ask_condition: + type: integer + strike: + type: number + right: + type: string + bid_size: + type: integer + ask_exchange: + type: integer + bid_exchange: + type: integer + ask: + type: number + expiration: + type: string + bid: + type: number + bid_condition: + type: integer + timestamp: + type: string + required: + - symbol + - ask_size + - ask_condition + - strike + - right + - bid_size + - ask_exchange + - bid_exchange + - ask + - expiration + - bid + - bid_condition + - timestamp example: symbol: - AAPL @@ -7301,14 +6181,14 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - required: - - symbol + type: array + items: + type: object + properties: + symbol: + type: string + required: + - symbol example: symbol: - AASGI @@ -7338,19 +6218,17 @@ paths: content: application/json: schema: - type: object - properties: - date: - type: array - items: - type: string - symbol: - type: array - items: - type: string - required: - - date - - symbol + type: array + items: + type: object + properties: + date: + type: string + symbol: + type: string + required: + - date + - symbol example: date: - '2023-04-20' @@ -7387,49 +6265,35 @@ paths: content: application/json: schema: - type: object - properties: - volume: - type: array - items: - type: integer - symbol: - type: array - items: - type: string - high: - type: array - items: - type: number - low: - type: array - items: - type: number - count: - type: array - items: - type: integer - close: - type: array - items: - type: number - open: - type: array - items: - type: number - timestamp: - type: array - items: - type: string - required: - - volume - - symbol - - high - - low - - count - - close - - open - - timestamp + type: array + items: + type: object + properties: + volume: + type: integer + symbol: + type: string + high: + type: number + low: + type: number + count: + type: integer + close: + type: number + open: + type: number + timestamp: + type: string + required: + - volume + - symbol + - high + - low + - count + - close + - open + - timestamp example: volume: - 0 @@ -7470,24 +6334,20 @@ paths: content: application/json: schema: - type: object - properties: - symbol: - type: array - items: - type: string - price: - type: array - items: - type: number - timestamp: - type: array - items: - type: string - required: - - symbol - - price - - timestamp + type: array + items: + type: object + properties: + symbol: + type: string + price: + type: number + timestamp: + type: string + required: + - symbol + - price + - timestamp example: symbol: - SPX @@ -7522,89 +6382,59 @@ paths: content: application/json: schema: - type: object - properties: - ask_size: - type: array - items: - type: integer - last_trade: - type: array - items: - type: string - created: - type: array - items: - type: string - ask_condition: - type: array - items: - type: integer - count: - type: array - items: - type: integer - volume: - type: array - items: - type: integer - high: - type: array - items: - type: number - low: - type: array - items: - type: number - bid_size: - type: array - items: - type: integer - ask_exchange: - type: array - items: - type: integer - bid_exchange: - type: array - items: - type: integer - ask: - type: array - items: - type: number - bid: - type: array - items: - type: number - bid_condition: - type: array - items: - type: integer - close: - type: array - items: - type: number - open: - type: array - items: - type: number - required: - - ask_size - - last_trade - - created - - ask_condition - - count - - volume - - high - - low - - bid_size - - ask_exchange - - bid_exchange - - ask - - bid - - bid_condition - - close - - open + type: array + items: + type: object + properties: + ask_size: + type: integer + last_trade: + type: string + created: + type: string + ask_condition: + type: integer + count: + type: integer + volume: + type: integer + high: + type: number + low: + type: number + bid_size: + type: integer + ask_exchange: + type: integer + bid_exchange: + type: integer + ask: + type: number + bid: + type: number + bid_condition: + type: integer + close: + type: number + open: + type: number + required: + - ask_size + - last_trade + - created + - ask_condition + - count + - volume + - high + - low + - bid_size + - ask_exchange + - bid_exchange + - ask + - bid + - bid_condition + - close + - open example: ask_size: - 0 @@ -7734,49 +6564,35 @@ paths: content: application/json: schema: - type: object - properties: - volume: - type: array - items: - type: integer - high: - type: array - items: - type: number - low: - type: array - items: - type: number - vwap: - type: array - items: - type: number - count: - type: array - items: - type: integer - close: - type: array - items: - type: number - open: - type: array - items: - type: number - timestamp: - type: array - items: - type: string - required: - - volume - - high - - low - - vwap - - count - - close - - open - - timestamp + type: array + items: + type: object + properties: + volume: + type: integer + high: + type: number + low: + type: number + vwap: + type: number + count: + type: integer + close: + type: number + open: + type: number + timestamp: + type: string + required: + - volume + - high + - low + - vwap + - count + - close + - open + - timestamp example: volume: - 0 @@ -7855,19 +6671,17 @@ paths: content: application/json: schema: - type: object - properties: - price: - type: array - items: - type: number - timestamp: - type: array - items: - type: string - required: - - price - - timestamp + type: array + items: + type: object + properties: + price: + type: number + timestamp: + type: string + required: + - price + - timestamp example: price: - 0.0 @@ -7908,59 +6722,41 @@ paths: content: application/json: schema: - type: object - properties: - sequence: - type: array - items: - type: integer - condition: - type: array - items: - type: integer - size: - type: array - items: - type: integer - price: - type: array - items: - type: number - ext_condition2: - type: array - items: - type: integer - ext_condition1: - type: array - items: - type: integer - ext_condition4: - type: array - items: - type: integer - exchange: - type: array - items: - type: integer - ext_condition3: - type: array - items: - type: integer - timestamp: - type: array - items: - type: string - required: - - sequence - - condition - - size - - price - - ext_condition2 - - ext_condition1 - - ext_condition4 - - exchange - - ext_condition3 - - timestamp + type: array + items: + type: object + properties: + sequence: + type: integer + condition: + type: integer + size: + type: integer + price: + type: number + ext_condition2: + type: integer + ext_condition1: + type: integer + ext_condition4: + type: integer + exchange: + type: integer + ext_condition3: + type: integer + timestamp: + type: string + required: + - sequence + - condition + - size + - price + - ext_condition2 + - ext_condition1 + - ext_condition4 + - exchange + - ext_condition3 + - timestamp example: sequence: - 0 @@ -8228,8 +7024,10 @@ components: schema: type: string enum: + - csv - json - default: json + - ndjson + default: ndjson rate_type: name: rate_type diff --git a/openapi/preprocess_td.py b/openapi/preprocess_td.py index 34da50ff1..6dbd18040 100644 --- a/openapi/preprocess_td.py +++ b/openapi/preprocess_td.py @@ -1,14 +1,18 @@ #!/usr/bin/env python3 # preprocess_openapi.py # Usage: python preprocess_openapi.py input.yaml output.yaml + from __future__ import annotations + import sys from typing import Any + from ruamel.yaml import YAML yaml = YAML() yaml.preserve_quotes = True + def infer_item_type(x: Any) -> str: if isinstance(x, bool): return "boolean" @@ -21,11 +25,13 @@ def infer_item_type(x: Any) -> str: # default return "string" + def is_dict_of_lists(obj: Any) -> bool: if not isinstance(obj, dict) or not obj: return False return all(isinstance(v, list) for v in obj.values()) + def coerce_schema_to_object_of_arrays(example: dict[str, list[Any]]) -> dict[str, Any]: props = {} for k, v in example.items(): @@ -33,6 +39,42 @@ def coerce_schema_to_object_of_arrays(example: dict[str, list[Any]]) -> dict[str props[k] = {"type": "array", "items": {"type": item_type}} return {"type": "object", "properties": props, "required": list(example.keys())} + +def obj_of_arrays_to_array_of_obj(schema: dict) -> dict | None: + if not isinstance(schema, dict) or schema.get("type") != "object": + return None + props = schema.get("properties") + if not isinstance(props, dict) or not props: + return None + # all properties are arrays with item types + if not all( + isinstance(v, dict) + and v.get("type") == "array" + and isinstance(v.get("items"), dict) + for v in props.values() + ): + return None + row_props = {} + for k, v in props.items(): + row_props[k] = v["items"] # carry through item schema (type/format/enum/etc.) + return { + "type": "array", + "items": { + "type": "object", + "properties": row_props, + "required": list(row_props.keys()), + # optional: keep titles/descriptions if you have them + }, + } + + +def normalize_json_response_schema(json_content: dict): + schema = json_content.get("schema") + fixed = obj_of_arrays_to_array_of_obj(schema) + if fixed: + json_content["schema"] = fixed + + def try_fix_json_schema(json_content: dict[str, Any]) -> None: """ If the example is dict-of-lists, rewrite schema accordingly. @@ -50,8 +92,16 @@ def try_fix_json_schema(json_content: dict[str, Any]) -> None: # Fallback: if schema says array but provider actually returns dict-of-lists, # and we have no example, we can’t safely infer keys. Leave as-is. # If schema is object and missing properties but example present, fill them in. - if isinstance(schema, dict) and schema.get("type") == "object" and "properties" not in schema and is_dict_of_lists(example or {}): - json_content["schema"] = coerce_schema_to_object_of_arrays(example) # already handled above + if ( + isinstance(schema, dict) + and schema.get("type") == "object" + and "properties" not in schema + and is_dict_of_lists(example or {}) + ): + json_content["schema"] = coerce_schema_to_object_of_arrays( + example + ) # already handled above + def keep_only_application_json(content: dict[str, Any]) -> dict[str, Any]: if "application/json" in content: @@ -60,13 +110,22 @@ def keep_only_application_json(content: dict[str, Any]) -> dict[str, Any]: # or convert NDJSON to JSON string schema if you prefer. Here we drop. return {} + def process(doc: dict[str, Any]) -> dict[str, Any]: paths = doc.get("paths", {}) for _, path_item in paths.items(): if not isinstance(path_item, dict): continue for method, op in list(path_item.items()): - if method.lower() not in {"get", "post", "put", "patch", "delete", "options", "head"}: + if method.lower() not in { + "get", + "post", + "put", + "patch", + "delete", + "options", + "head", + }: continue responses = op.get("responses") if not isinstance(responses, dict): @@ -89,13 +148,19 @@ def process(doc: dict[str, Any]) -> dict[str, Any]: json_content = new_content.get("application/json") if isinstance(json_content, dict): try_fix_json_schema(json_content) + # 3) Normalize object-of-arrays to array-of-objects + normalize_json_response_schema(json_content) resp["content"] = new_content return doc + def main(): if len(sys.argv) != 3: - print("Usage: python preprocess_openapi.py input.yaml output.yaml", file=sys.stderr) + print( + "Usage: python preprocess_openapi.py input.yaml output.yaml", + file=sys.stderr, + ) sys.exit(2) inf, outf = sys.argv[1], sys.argv[2] with open(inf, "r", encoding="utf-8") as f: @@ -104,5 +169,6 @@ def main(): with open(outf, "w", encoding="utf-8") as f: yaml.dump(doc, f) + if __name__ == "__main__": main() From e63d944a01bf757319baf7e15bc5d5feb9a2f7bb Mon Sep 17 00:00:00 2001 From: Itay Bavly Date: Thu, 11 Sep 2025 11:25:25 -0400 Subject: [PATCH 15/16] json only --- openapi/openapi.cleaned.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/openapi/openapi.cleaned.yaml b/openapi/openapi.cleaned.yaml index c8f2abf4d..603ec3e0c 100644 --- a/openapi/openapi.cleaned.yaml +++ b/openapi/openapi.cleaned.yaml @@ -7024,10 +7024,8 @@ components: schema: type: string enum: - - csv - json - - ndjson - default: ndjson + default: json rate_type: name: rate_type From 1b81451c68106269a00544e9462c780c35ac9dc2 Mon Sep 17 00:00:00 2001 From: Itay Bavly Date: Thu, 11 Sep 2025 14:23:59 -0400 Subject: [PATCH 16/16] gen --- .../api/index/index_at_time_price.py | 29 +- .../api/index/index_history_eod.py | 29 +- .../api/index/index_history_ohlc.py | 29 +- .../api/index/index_history_price.py | 29 +- .../api/index/index_list_dates.py | 29 +- .../api/index/index_list_symbols.py | 29 +- .../api/index/index_snapshot_ohlc.py | 29 +- .../api/index/index_snapshot_price.py | 29 +- .../api/option/option_at_time_quote.py | 29 +- .../api/option/option_at_time_trade.py | 29 +- .../api/option/option_history_eod.py | 29 +- .../api/option/option_history_greeks_all.py | 29 +- .../api/option/option_history_greeks_eod.py | 29 +- .../option_history_greeks_first_order.py | 29 +- ...ption_history_greeks_implied_volatility.py | 29 +- .../option_history_greeks_second_order.py | 29 +- .../option_history_greeks_third_order.py | 29 +- .../api/option/option_history_ohlc.py | 29 +- .../option/option_history_open_interest.py | 29 +- .../api/option/option_history_quote.py | 29 +- .../api/option/option_history_trade.py | 29 +- .../option/option_history_trade_greeks_all.py | 29 +- ...option_history_trade_greeks_first_order.py | 29 +- ...history_trade_greeks_implied_volatility.py | 29 +- ...ption_history_trade_greeks_second_order.py | 29 +- ...option_history_trade_greeks_third_order.py | 29 +- .../api/option/option_history_trade_quote.py | 29 +- .../api/option/option_list_contracts.py | 29 +- .../api/option/option_list_dates.py | 29 +- .../api/option/option_list_expirations.py | 29 +- .../api/option/option_list_strikes.py | 29 +- .../api/option/option_list_symbols.py | 29 +- .../api/option/option_snapshot_greeks_all.py | 29 +- .../option_snapshot_greeks_first_order.py | 29 +- ...tion_snapshot_greeks_implied_volatility.py | 29 +- .../option_snapshot_greeks_second_order.py | 29 +- .../option_snapshot_greeks_third_order.py | 29 +- .../api/option/option_snapshot_ohlc.py | 29 +- .../option/option_snapshot_open_interest.py | 29 +- .../api/option/option_snapshot_quote.py | 29 +- .../api/option/option_snapshot_trade.py | 29 +- .../api/stock/stock_at_time_quote.py | 29 +- .../api/stock/stock_at_time_trade.py | 29 +- .../api/stock/stock_history_eod.py | 29 +- .../api/stock/stock_history_ohlc.py | 29 +- .../api/stock/stock_history_quote.py | 29 +- .../api/stock/stock_list_dates.py | 29 +- .../api/stock/stock_list_symbols.py | 29 +- .../api/stock/stock_snapshot_ohlc.py | 29 +- .../api/stock/stock_snapshot_quote.py | 29 +- .../api/stock/stock_snapshot_trade.py | 29 +- .../openapi_package/models/__init__.py | 204 +++---- ... index_at_time_price_response_200_item.py} | 101 ++-- ...=> index_history_eod_response_200_item.py} | 155 ++--- ...> index_history_ohlc_response_200_item.py} | 83 +-- ... index_history_price_response_200_item.py} | 29 +- ... => index_list_dates_response_200_item.py} | 29 +- ...> index_list_symbols_response_200_item.py} | 20 +- ... index_snapshot_ohlc_response_200_item.py} | 83 +-- ...index_snapshot_price_response_200_item.py} | 38 +- ...option_at_time_quote_response_200_item.py} | 128 ++-- ...option_at_time_trade_response_200_item.py} | 137 ++--- ...> option_history_eod_response_200_item.py} | 191 +++--- .../option_history_greeks_all_response_200.py | 414 ------------- ...on_history_greeks_all_response_200_item.py | 320 ++++++++++ .../option_history_greeks_eod_response_200.py | 546 ------------------ ...on_history_greeks_eod_response_200_item.py | 416 +++++++++++++ ...y_greeks_first_order_response_200_item.py} | 164 ++---- ...s_implied_volatility_response_200_item.py} | 137 ++--- ..._greeks_second_order_response_200_item.py} | 155 ++--- ...y_greeks_third_order_response_200_item.py} | 146 ++--- ... option_history_ohlc_response_200_item.py} | 114 ++-- ...istory_open_interest_response_200_item.py} | 65 +-- ...option_history_quote_response_200_item.py} | 128 ++-- ...n_history_trade_greeks_all_response_200.py | 491 ---------------- ...tory_trade_greeks_all_response_200_item.py | 376 ++++++++++++ ...e_greeks_first_order_response_200_item.py} | 227 +++----- ...s_implied_volatility_response_200_item.py} | 173 ++---- ..._greeks_second_order_response_200_item.py} | 218 +++---- ...e_greeks_third_order_response_200_item.py} | 209 +++---- ..._history_trade_quote_response_200_item.py} | 218 +++---- ...option_history_trade_response_200_item.py} | 137 ++--- ...ption_list_contracts_response_200_item.py} | 58 +- ...=> option_list_dates_response_200_item.py} | 53 +- ...ion_list_expirations_response_200_item.py} | 29 +- ... option_list_strikes_response_200_item.py} | 29 +- ... option_list_symbols_response_200_item.py} | 20 +- ...option_snapshot_greeks_all_response_200.py | 414 ------------- ...n_snapshot_greeks_all_response_200_item.py | 320 ++++++++++ ...t_greeks_first_order_response_200_item.py} | 164 ++---- ...s_implied_volatility_response_200_item.py} | 110 ++-- ..._greeks_second_order_response_200_item.py} | 155 ++--- ...t_greeks_third_order_response_200_item.py} | 146 ++--- ...option_snapshot_ohlc_response_200_item.py} | 121 ++-- ...apshot_open_interest_response_200_item.py} | 65 +-- ...ption_snapshot_quote_response_200_item.py} | 128 ++-- ...ption_snapshot_trade_response_200_item.py} | 137 ++--- ... stock_at_time_quote_response_200_item.py} | 92 +-- ... stock_at_time_trade_response_200_item.py} | 101 ++-- ...=> stock_history_eod_response_200_item.py} | 155 ++--- ...> stock_history_ohlc_response_200_item.py} | 83 +-- ... stock_history_quote_response_200_item.py} | 103 +--- ... => stock_list_dates_response_200_item.py} | 29 +- ...> stock_list_symbols_response_200_item.py} | 20 +- ... stock_snapshot_ohlc_response_200_item.py} | 83 +-- ...stock_snapshot_quote_response_200_item.py} | 98 ++-- ...stock_snapshot_trade_response_200_item.py} | 65 +-- 107 files changed, 4177 insertions(+), 5932 deletions(-) rename openapi_project/openapi_package/models/{index_at_time_price_response_200.py => index_at_time_price_response_200_item.py} (59%) rename openapi_project/openapi_package/models/{stock_history_eod_response_200.py => index_history_eod_response_200_item.py} (55%) rename openapi_project/openapi_package/models/{index_history_ohlc_response_200.py => index_history_ohlc_response_200_item.py} (60%) rename openapi_project/openapi_package/models/{index_history_price_response_200.py => index_history_price_response_200_item.py} (71%) rename openapi_project/openapi_package/models/{index_list_dates_response_200.py => index_list_dates_response_200_item.py} (72%) rename openapi_project/openapi_package/models/{stock_list_symbols_response_200.py => index_list_symbols_response_200_item.py} (75%) rename openapi_project/openapi_package/models/{index_snapshot_ohlc_response_200.py => index_snapshot_ohlc_response_200_item.py} (60%) rename openapi_project/openapi_package/models/{index_snapshot_price_response_200.py => index_snapshot_price_response_200_item.py} (69%) rename openapi_project/openapi_package/models/{option_at_time_quote_response_200.py => option_at_time_quote_response_200_item.py} (56%) rename openapi_project/openapi_package/models/{option_at_time_trade_response_200.py => option_at_time_trade_response_200_item.py} (56%) rename openapi_project/openapi_package/models/{option_history_eod_response_200.py => option_history_eod_response_200_item.py} (53%) delete mode 100644 openapi_project/openapi_package/models/option_history_greeks_all_response_200.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_all_response_200_item.py delete mode 100644 openapi_project/openapi_package/models/option_history_greeks_eod_response_200.py create mode 100644 openapi_project/openapi_package/models/option_history_greeks_eod_response_200_item.py rename openapi_project/openapi_package/models/{option_history_greeks_first_order_response_200.py => option_history_greeks_first_order_response_200_item.py} (54%) rename openapi_project/openapi_package/models/{option_history_greeks_implied_volatility_response_200.py => option_history_greeks_implied_volatility_response_200_item.py} (57%) rename openapi_project/openapi_package/models/{option_history_greeks_second_order_response_200.py => option_history_greeks_second_order_response_200_item.py} (55%) rename openapi_project/openapi_package/models/{option_history_greeks_third_order_response_200.py => option_history_greeks_third_order_response_200_item.py} (55%) rename openapi_project/openapi_package/models/{option_snapshot_ohlc_response_200.py => option_history_ohlc_response_200_item.py} (58%) rename openapi_project/openapi_package/models/{option_history_open_interest_response_200.py => option_history_open_interest_response_200_item.py} (62%) rename openapi_project/openapi_package/models/{option_history_quote_response_200.py => option_history_quote_response_200_item.py} (56%) delete mode 100644 openapi_project/openapi_package/models/option_history_trade_greeks_all_response_200.py create mode 100644 openapi_project/openapi_package/models/option_history_trade_greeks_all_response_200_item.py rename openapi_project/openapi_package/models/{option_history_trade_greeks_first_order_response_200.py => option_history_trade_greeks_first_order_response_200_item.py} (53%) rename openapi_project/openapi_package/models/{option_history_trade_greeks_implied_volatility_response_200.py => option_history_trade_greeks_implied_volatility_response_200_item.py} (57%) rename openapi_project/openapi_package/models/{option_history_trade_greeks_second_order_response_200.py => option_history_trade_greeks_second_order_response_200_item.py} (53%) rename openapi_project/openapi_package/models/{option_history_trade_greeks_third_order_response_200.py => option_history_trade_greeks_third_order_response_200_item.py} (54%) rename openapi_project/openapi_package/models/{option_history_trade_quote_response_200.py => option_history_trade_quote_response_200_item.py} (52%) rename openapi_project/openapi_package/models/{option_history_trade_response_200.py => option_history_trade_response_200_item.py} (56%) rename openapi_project/openapi_package/models/{option_list_dates_response_200.py => option_list_contracts_response_200_item.py} (62%) rename openapi_project/openapi_package/models/{option_list_contracts_response_200.py => option_list_dates_response_200_item.py} (67%) rename openapi_project/openapi_package/models/{option_list_expirations_response_200.py => option_list_expirations_response_200_item.py} (71%) rename openapi_project/openapi_package/models/{option_list_strikes_response_200.py => option_list_strikes_response_200_item.py} (72%) rename openapi_project/openapi_package/models/{index_list_symbols_response_200.py => option_list_symbols_response_200_item.py} (75%) delete mode 100644 openapi_project/openapi_package/models/option_snapshot_greeks_all_response_200.py create mode 100644 openapi_project/openapi_package/models/option_snapshot_greeks_all_response_200_item.py rename openapi_project/openapi_package/models/{option_snapshot_greeks_first_order_response_200.py => option_snapshot_greeks_first_order_response_200_item.py} (54%) rename openapi_project/openapi_package/models/{option_snapshot_greeks_implied_volatility_response_200.py => option_snapshot_greeks_implied_volatility_response_200_item.py} (59%) rename openapi_project/openapi_package/models/{option_snapshot_greeks_second_order_response_200.py => option_snapshot_greeks_second_order_response_200_item.py} (55%) rename openapi_project/openapi_package/models/{option_snapshot_greeks_third_order_response_200.py => option_snapshot_greeks_third_order_response_200_item.py} (55%) rename openapi_project/openapi_package/models/{option_history_ohlc_response_200.py => option_snapshot_ohlc_response_200_item.py} (55%) rename openapi_project/openapi_package/models/{option_snapshot_open_interest_response_200.py => option_snapshot_open_interest_response_200_item.py} (62%) rename openapi_project/openapi_package/models/{option_snapshot_quote_response_200.py => option_snapshot_quote_response_200_item.py} (56%) rename openapi_project/openapi_package/models/{option_snapshot_trade_response_200.py => option_snapshot_trade_response_200_item.py} (56%) rename openapi_project/openapi_package/models/{stock_history_quote_response_200.py => stock_at_time_quote_response_200_item.py} (60%) rename openapi_project/openapi_package/models/{stock_at_time_trade_response_200.py => stock_at_time_trade_response_200_item.py} (59%) rename openapi_project/openapi_package/models/{index_history_eod_response_200.py => stock_history_eod_response_200_item.py} (55%) rename openapi_project/openapi_package/models/{stock_history_ohlc_response_200.py => stock_history_ohlc_response_200_item.py} (60%) rename openapi_project/openapi_package/models/{stock_snapshot_quote_response_200.py => stock_history_quote_response_200_item.py} (56%) rename openapi_project/openapi_package/models/{stock_list_dates_response_200.py => stock_list_dates_response_200_item.py} (72%) rename openapi_project/openapi_package/models/{option_list_symbols_response_200.py => stock_list_symbols_response_200_item.py} (75%) rename openapi_project/openapi_package/models/{stock_snapshot_ohlc_response_200.py => stock_snapshot_ohlc_response_200_item.py} (60%) rename openapi_project/openapi_package/models/{stock_at_time_quote_response_200.py => stock_snapshot_quote_response_200_item.py} (60%) rename openapi_project/openapi_package/models/{stock_snapshot_trade_response_200.py => stock_snapshot_trade_response_200_item.py} (63%) diff --git a/openapi_project/openapi_package/api/index/index_at_time_price.py b/openapi_project/openapi_package/api/index/index_at_time_price.py index 55625ddb6..ddf7387ea 100644 --- a/openapi_project/openapi_package/api/index/index_at_time_price.py +++ b/openapi_project/openapi_package/api/index/index_at_time_price.py @@ -8,7 +8,7 @@ from openapi_project.openapi_package import errors from openapi_project.openapi_package.models.index_at_time_price_format import IndexAtTimePriceFormat -from openapi_project.openapi_package.models.index_at_time_price_response_200 import IndexAtTimePriceResponse200 +from openapi_project.openapi_package.models.index_at_time_price_response_200_item import IndexAtTimePriceResponse200Item from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse from typing import cast @@ -59,12 +59,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IndexAtTimePriceResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[IndexAtTimePriceResponse200Item] | None: if response.status_code == 200: - response_200 = IndexAtTimePriceResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = IndexAtTimePriceResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -72,7 +77,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[IndexAtTimePriceResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[IndexAtTimePriceResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -90,7 +95,7 @@ def sync_detailed( time_of_day: str, format_: Unset | IndexAtTimePriceFormat = IndexAtTimePriceFormat.JSON, -) -> Response[IndexAtTimePriceResponse200]: +) -> Response[list[IndexAtTimePriceResponse200Item]]: """ Price - Retrieves historical indices price reports. [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) @@ -110,7 +115,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[IndexAtTimePriceResponse200] + Response[list[IndexAtTimePriceResponse200Item]] """ @@ -138,7 +143,7 @@ def sync( time_of_day: str, format_: Unset | IndexAtTimePriceFormat = IndexAtTimePriceFormat.JSON, -) -> IndexAtTimePriceResponse200 | None: +) -> list[IndexAtTimePriceResponse200Item] | None: """ Price - Retrieves historical indices price reports. [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) @@ -158,7 +163,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - IndexAtTimePriceResponse200 + list[IndexAtTimePriceResponse200Item] """ @@ -181,7 +186,7 @@ async def asyncio_detailed( time_of_day: str, format_: Unset | IndexAtTimePriceFormat = IndexAtTimePriceFormat.JSON, -) -> Response[IndexAtTimePriceResponse200]: +) -> Response[list[IndexAtTimePriceResponse200Item]]: """ Price - Retrieves historical indices price reports. [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) @@ -201,7 +206,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[IndexAtTimePriceResponse200] + Response[list[IndexAtTimePriceResponse200Item]] """ @@ -229,7 +234,7 @@ async def asyncio( time_of_day: str, format_: Unset | IndexAtTimePriceFormat = IndexAtTimePriceFormat.JSON, -) -> IndexAtTimePriceResponse200 | None: +) -> list[IndexAtTimePriceResponse200Item] | None: """ Price - Retrieves historical indices price reports. [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) @@ -249,7 +254,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - IndexAtTimePriceResponse200 + list[IndexAtTimePriceResponse200Item] """ diff --git a/openapi_project/openapi_package/api/index/index_history_eod.py b/openapi_project/openapi_package/api/index/index_history_eod.py index f12741710..e89c72107 100644 --- a/openapi_project/openapi_package/api/index/index_history_eod.py +++ b/openapi_project/openapi_package/api/index/index_history_eod.py @@ -8,7 +8,7 @@ from openapi_project.openapi_package import errors from openapi_project.openapi_package.models.index_history_eod_format import IndexHistoryEodFormat -from openapi_project.openapi_package.models.index_history_eod_response_200 import IndexHistoryEodResponse200 +from openapi_project.openapi_package.models.index_history_eod_response_200_item import IndexHistoryEodResponse200Item from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse from typing import cast @@ -56,12 +56,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IndexHistoryEodResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[IndexHistoryEodResponse200Item] | None: if response.status_code == 200: - response_200 = IndexHistoryEodResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = IndexHistoryEodResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -69,7 +74,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[IndexHistoryEodResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[IndexHistoryEodResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -86,7 +91,7 @@ def sync_detailed( end_date: datetime.date, format_: Unset | IndexHistoryEodFormat = IndexHistoryEodFormat.JSON, -) -> Response[IndexHistoryEodResponse200]: +) -> Response[list[IndexHistoryEodResponse200Item]]: """ End of Day - Since [the indices feeds](/Articles/Data-And-Requests/The-SIPs.html) do not provide a national EOD @@ -103,7 +108,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[IndexHistoryEodResponse200] + Response[list[IndexHistoryEodResponse200Item]] """ @@ -129,7 +134,7 @@ def sync( end_date: datetime.date, format_: Unset | IndexHistoryEodFormat = IndexHistoryEodFormat.JSON, -) -> IndexHistoryEodResponse200 | None: +) -> list[IndexHistoryEodResponse200Item] | None: """ End of Day - Since [the indices feeds](/Articles/Data-And-Requests/The-SIPs.html) do not provide a national EOD @@ -146,7 +151,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - IndexHistoryEodResponse200 + list[IndexHistoryEodResponse200Item] """ @@ -167,7 +172,7 @@ async def asyncio_detailed( end_date: datetime.date, format_: Unset | IndexHistoryEodFormat = IndexHistoryEodFormat.JSON, -) -> Response[IndexHistoryEodResponse200]: +) -> Response[list[IndexHistoryEodResponse200Item]]: """ End of Day - Since [the indices feeds](/Articles/Data-And-Requests/The-SIPs.html) do not provide a national EOD @@ -184,7 +189,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[IndexHistoryEodResponse200] + Response[list[IndexHistoryEodResponse200Item]] """ @@ -210,7 +215,7 @@ async def asyncio( end_date: datetime.date, format_: Unset | IndexHistoryEodFormat = IndexHistoryEodFormat.JSON, -) -> IndexHistoryEodResponse200 | None: +) -> list[IndexHistoryEodResponse200Item] | None: """ End of Day - Since [the indices feeds](/Articles/Data-And-Requests/The-SIPs.html) do not provide a national EOD @@ -227,7 +232,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - IndexHistoryEodResponse200 + list[IndexHistoryEodResponse200Item] """ diff --git a/openapi_project/openapi_package/api/index/index_history_ohlc.py b/openapi_project/openapi_package/api/index/index_history_ohlc.py index d5f5a2ce7..05bb66851 100644 --- a/openapi_project/openapi_package/api/index/index_history_ohlc.py +++ b/openapi_project/openapi_package/api/index/index_history_ohlc.py @@ -9,7 +9,7 @@ from openapi_project.openapi_package.models.index_history_ohlc_format import IndexHistoryOhlcFormat from openapi_project.openapi_package.models.index_history_ohlc_interval import IndexHistoryOhlcInterval -from openapi_project.openapi_package.models.index_history_ohlc_response_200 import IndexHistoryOhlcResponse200 +from openapi_project.openapi_package.models.index_history_ohlc_response_200_item import IndexHistoryOhlcResponse200Item from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse from typing import cast @@ -67,12 +67,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IndexHistoryOhlcResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[IndexHistoryOhlcResponse200Item] | None: if response.status_code == 200: - response_200 = IndexHistoryOhlcResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = IndexHistoryOhlcResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -80,7 +85,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[IndexHistoryOhlcResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[IndexHistoryOhlcResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -100,7 +105,7 @@ def sync_detailed( end_time: Unset | str = '16:00:00', format_: Unset | IndexHistoryOhlcFormat = IndexHistoryOhlcFormat.JSON, -) -> Response[IndexHistoryOhlcResponse200]: +) -> Response[list[IndexHistoryOhlcResponse200Item]]: """ Open High Low Close - Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. @@ -123,7 +128,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[IndexHistoryOhlcResponse200] + Response[list[IndexHistoryOhlcResponse200Item]] """ @@ -155,7 +160,7 @@ def sync( end_time: Unset | str = '16:00:00', format_: Unset | IndexHistoryOhlcFormat = IndexHistoryOhlcFormat.JSON, -) -> IndexHistoryOhlcResponse200 | None: +) -> list[IndexHistoryOhlcResponse200Item] | None: """ Open High Low Close - Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. @@ -178,7 +183,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - IndexHistoryOhlcResponse200 + list[IndexHistoryOhlcResponse200Item] """ @@ -205,7 +210,7 @@ async def asyncio_detailed( end_time: Unset | str = '16:00:00', format_: Unset | IndexHistoryOhlcFormat = IndexHistoryOhlcFormat.JSON, -) -> Response[IndexHistoryOhlcResponse200]: +) -> Response[list[IndexHistoryOhlcResponse200Item]]: """ Open High Low Close - Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. @@ -228,7 +233,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[IndexHistoryOhlcResponse200] + Response[list[IndexHistoryOhlcResponse200Item]] """ @@ -260,7 +265,7 @@ async def asyncio( end_time: Unset | str = '16:00:00', format_: Unset | IndexHistoryOhlcFormat = IndexHistoryOhlcFormat.JSON, -) -> IndexHistoryOhlcResponse200 | None: +) -> list[IndexHistoryOhlcResponse200Item] | None: """ Open High Low Close - Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. @@ -283,7 +288,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - IndexHistoryOhlcResponse200 + list[IndexHistoryOhlcResponse200Item] """ diff --git a/openapi_project/openapi_package/api/index/index_history_price.py b/openapi_project/openapi_package/api/index/index_history_price.py index b37429a6c..97dbd2676 100644 --- a/openapi_project/openapi_package/api/index/index_history_price.py +++ b/openapi_project/openapi_package/api/index/index_history_price.py @@ -9,7 +9,7 @@ from openapi_project.openapi_package.models.index_history_price_format import IndexHistoryPriceFormat from openapi_project.openapi_package.models.index_history_price_interval import IndexHistoryPriceInterval -from openapi_project.openapi_package.models.index_history_price_response_200 import IndexHistoryPriceResponse200 +from openapi_project.openapi_package.models.index_history_price_response_200_item import IndexHistoryPriceResponse200Item from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse from typing import cast @@ -63,12 +63,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IndexHistoryPriceResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[IndexHistoryPriceResponse200Item] | None: if response.status_code == 200: - response_200 = IndexHistoryPriceResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = IndexHistoryPriceResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -76,7 +81,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[IndexHistoryPriceResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[IndexHistoryPriceResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -95,7 +100,7 @@ def sync_detailed( interval: IndexHistoryPriceInterval = IndexHistoryPriceInterval.VALUE_4, format_: Unset | IndexHistoryPriceFormat = IndexHistoryPriceFormat.JSON, -) -> Response[IndexHistoryPriceResponse200]: +) -> Response[list[IndexHistoryPriceResponse200Item]]: """ Price - Retrieves historical indices price reports. [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) @@ -119,7 +124,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[IndexHistoryPriceResponse200] + Response[list[IndexHistoryPriceResponse200Item]] """ @@ -149,7 +154,7 @@ def sync( interval: IndexHistoryPriceInterval = IndexHistoryPriceInterval.VALUE_4, format_: Unset | IndexHistoryPriceFormat = IndexHistoryPriceFormat.JSON, -) -> IndexHistoryPriceResponse200 | None: +) -> list[IndexHistoryPriceResponse200Item] | None: """ Price - Retrieves historical indices price reports. [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) @@ -173,7 +178,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - IndexHistoryPriceResponse200 + list[IndexHistoryPriceResponse200Item] """ @@ -198,7 +203,7 @@ async def asyncio_detailed( interval: IndexHistoryPriceInterval = IndexHistoryPriceInterval.VALUE_4, format_: Unset | IndexHistoryPriceFormat = IndexHistoryPriceFormat.JSON, -) -> Response[IndexHistoryPriceResponse200]: +) -> Response[list[IndexHistoryPriceResponse200Item]]: """ Price - Retrieves historical indices price reports. [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) @@ -222,7 +227,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[IndexHistoryPriceResponse200] + Response[list[IndexHistoryPriceResponse200Item]] """ @@ -252,7 +257,7 @@ async def asyncio( interval: IndexHistoryPriceInterval = IndexHistoryPriceInterval.VALUE_4, format_: Unset | IndexHistoryPriceFormat = IndexHistoryPriceFormat.JSON, -) -> IndexHistoryPriceResponse200 | None: +) -> list[IndexHistoryPriceResponse200Item] | None: """ Price - Retrieves historical indices price reports. [Exchanges](/Articles/Data-And-Requests/The-SIPs.html) @@ -276,7 +281,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - IndexHistoryPriceResponse200 + list[IndexHistoryPriceResponse200Item] """ diff --git a/openapi_project/openapi_package/api/index/index_list_dates.py b/openapi_project/openapi_package/api/index/index_list_dates.py index abaf0bf4a..bda5734b9 100644 --- a/openapi_project/openapi_package/api/index/index_list_dates.py +++ b/openapi_project/openapi_package/api/index/index_list_dates.py @@ -8,7 +8,7 @@ from openapi_project.openapi_package import errors from openapi_project.openapi_package.models.index_list_dates_format import IndexListDatesFormat -from openapi_project.openapi_package.models.index_list_dates_response_200 import IndexListDatesResponse200 +from openapi_project.openapi_package.models.index_list_dates_response_200_item import IndexListDatesResponse200Item from openapi_project.openapi_package.types import UNSET, Unset from typing import cast @@ -49,12 +49,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IndexListDatesResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[IndexListDatesResponse200Item] | None: if response.status_code == 200: - response_200 = IndexListDatesResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = IndexListDatesResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -62,7 +67,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[IndexListDatesResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[IndexListDatesResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -77,7 +82,7 @@ def sync_detailed( symbol: list[str], format_: Unset | IndexListDatesFormat = IndexListDatesFormat.JSON, -) -> Response[IndexListDatesResponse200]: +) -> Response[list[IndexListDatesResponse200Item]]: """ Dates Lists all dates of data that are available for a index with a given request type and symbol. This @@ -92,7 +97,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[IndexListDatesResponse200] + Response[list[IndexListDatesResponse200Item]] """ @@ -114,7 +119,7 @@ def sync( symbol: list[str], format_: Unset | IndexListDatesFormat = IndexListDatesFormat.JSON, -) -> IndexListDatesResponse200 | None: +) -> list[IndexListDatesResponse200Item] | None: """ Dates Lists all dates of data that are available for a index with a given request type and symbol. This @@ -129,7 +134,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - IndexListDatesResponse200 + list[IndexListDatesResponse200Item] """ @@ -146,7 +151,7 @@ async def asyncio_detailed( symbol: list[str], format_: Unset | IndexListDatesFormat = IndexListDatesFormat.JSON, -) -> Response[IndexListDatesResponse200]: +) -> Response[list[IndexListDatesResponse200Item]]: """ Dates Lists all dates of data that are available for a index with a given request type and symbol. This @@ -161,7 +166,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[IndexListDatesResponse200] + Response[list[IndexListDatesResponse200Item]] """ @@ -183,7 +188,7 @@ async def asyncio( symbol: list[str], format_: Unset | IndexListDatesFormat = IndexListDatesFormat.JSON, -) -> IndexListDatesResponse200 | None: +) -> list[IndexListDatesResponse200Item] | None: """ Dates Lists all dates of data that are available for a index with a given request type and symbol. This @@ -198,7 +203,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - IndexListDatesResponse200 + list[IndexListDatesResponse200Item] """ diff --git a/openapi_project/openapi_package/api/index/index_list_symbols.py b/openapi_project/openapi_package/api/index/index_list_symbols.py index 9b4d5f212..bd21a91a1 100644 --- a/openapi_project/openapi_package/api/index/index_list_symbols.py +++ b/openapi_project/openapi_package/api/index/index_list_symbols.py @@ -8,7 +8,7 @@ from openapi_project.openapi_package import errors from openapi_project.openapi_package.models.index_list_symbols_format import IndexListSymbolsFormat -from openapi_project.openapi_package.models.index_list_symbols_response_200 import IndexListSymbolsResponse200 +from openapi_project.openapi_package.models.index_list_symbols_response_200_item import IndexListSymbolsResponse200Item from openapi_project.openapi_package.types import UNSET, Unset from typing import cast @@ -43,12 +43,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IndexListSymbolsResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[IndexListSymbolsResponse200Item] | None: if response.status_code == 200: - response_200 = IndexListSymbolsResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = IndexListSymbolsResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -56,7 +61,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[IndexListSymbolsResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[IndexListSymbolsResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,7 +75,7 @@ def sync_detailed( client: AuthenticatedClient | Client, format_: Unset | IndexListSymbolsFormat = IndexListSymbolsFormat.JSON, -) -> Response[IndexListSymbolsResponse200]: +) -> Response[list[IndexListSymbolsResponse200Item]]: """ Symbols A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also @@ -85,7 +90,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[IndexListSymbolsResponse200] + Response[list[IndexListSymbolsResponse200Item]] """ @@ -105,7 +110,7 @@ def sync( client: AuthenticatedClient | Client, format_: Unset | IndexListSymbolsFormat = IndexListSymbolsFormat.JSON, -) -> IndexListSymbolsResponse200 | None: +) -> list[IndexListSymbolsResponse200Item] | None: """ Symbols A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also @@ -120,7 +125,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - IndexListSymbolsResponse200 + list[IndexListSymbolsResponse200Item] """ @@ -135,7 +140,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, format_: Unset | IndexListSymbolsFormat = IndexListSymbolsFormat.JSON, -) -> Response[IndexListSymbolsResponse200]: +) -> Response[list[IndexListSymbolsResponse200Item]]: """ Symbols A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also @@ -150,7 +155,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[IndexListSymbolsResponse200] + Response[list[IndexListSymbolsResponse200Item]] """ @@ -170,7 +175,7 @@ async def asyncio( client: AuthenticatedClient | Client, format_: Unset | IndexListSymbolsFormat = IndexListSymbolsFormat.JSON, -) -> IndexListSymbolsResponse200 | None: +) -> list[IndexListSymbolsResponse200Item] | None: """ Symbols A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also @@ -185,7 +190,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - IndexListSymbolsResponse200 + list[IndexListSymbolsResponse200Item] """ diff --git a/openapi_project/openapi_package/api/index/index_snapshot_ohlc.py b/openapi_project/openapi_package/api/index/index_snapshot_ohlc.py index be4931b22..4bb935faa 100644 --- a/openapi_project/openapi_package/api/index/index_snapshot_ohlc.py +++ b/openapi_project/openapi_package/api/index/index_snapshot_ohlc.py @@ -8,7 +8,7 @@ from openapi_project.openapi_package import errors from openapi_project.openapi_package.models.index_snapshot_ohlc_format import IndexSnapshotOhlcFormat -from openapi_project.openapi_package.models.index_snapshot_ohlc_response_200 import IndexSnapshotOhlcResponse200 +from openapi_project.openapi_package.models.index_snapshot_ohlc_response_200_item import IndexSnapshotOhlcResponse200Item from openapi_project.openapi_package.types import UNSET, Unset from typing import cast @@ -49,12 +49,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IndexSnapshotOhlcResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[IndexSnapshotOhlcResponse200Item] | None: if response.status_code == 200: - response_200 = IndexSnapshotOhlcResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = IndexSnapshotOhlcResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -62,7 +67,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[IndexSnapshotOhlcResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[IndexSnapshotOhlcResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -77,7 +82,7 @@ def sync_detailed( symbol: list[str], format_: Unset | IndexSnapshotOhlcFormat = IndexSnapshotOhlcFormat.JSON, -) -> Response[IndexSnapshotOhlcResponse200]: +) -> Response[list[IndexSnapshotOhlcResponse200Item]]: """ Open High Low Close - Retrieves the real-time current day OHLC. @@ -93,7 +98,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[IndexSnapshotOhlcResponse200] + Response[list[IndexSnapshotOhlcResponse200Item]] """ @@ -115,7 +120,7 @@ def sync( symbol: list[str], format_: Unset | IndexSnapshotOhlcFormat = IndexSnapshotOhlcFormat.JSON, -) -> IndexSnapshotOhlcResponse200 | None: +) -> list[IndexSnapshotOhlcResponse200Item] | None: """ Open High Low Close - Retrieves the real-time current day OHLC. @@ -131,7 +136,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - IndexSnapshotOhlcResponse200 + list[IndexSnapshotOhlcResponse200Item] """ @@ -148,7 +153,7 @@ async def asyncio_detailed( symbol: list[str], format_: Unset | IndexSnapshotOhlcFormat = IndexSnapshotOhlcFormat.JSON, -) -> Response[IndexSnapshotOhlcResponse200]: +) -> Response[list[IndexSnapshotOhlcResponse200Item]]: """ Open High Low Close - Retrieves the real-time current day OHLC. @@ -164,7 +169,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[IndexSnapshotOhlcResponse200] + Response[list[IndexSnapshotOhlcResponse200Item]] """ @@ -186,7 +191,7 @@ async def asyncio( symbol: list[str], format_: Unset | IndexSnapshotOhlcFormat = IndexSnapshotOhlcFormat.JSON, -) -> IndexSnapshotOhlcResponse200 | None: +) -> list[IndexSnapshotOhlcResponse200Item] | None: """ Open High Low Close - Retrieves the real-time current day OHLC. @@ -202,7 +207,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - IndexSnapshotOhlcResponse200 + list[IndexSnapshotOhlcResponse200Item] """ diff --git a/openapi_project/openapi_package/api/index/index_snapshot_price.py b/openapi_project/openapi_package/api/index/index_snapshot_price.py index 19e3c0d8d..8fee18d83 100644 --- a/openapi_project/openapi_package/api/index/index_snapshot_price.py +++ b/openapi_project/openapi_package/api/index/index_snapshot_price.py @@ -8,7 +8,7 @@ from openapi_project.openapi_package import errors from openapi_project.openapi_package.models.index_snapshot_price_format import IndexSnapshotPriceFormat -from openapi_project.openapi_package.models.index_snapshot_price_response_200 import IndexSnapshotPriceResponse200 +from openapi_project.openapi_package.models.index_snapshot_price_response_200_item import IndexSnapshotPriceResponse200Item from openapi_project.openapi_package.types import UNSET, Unset from typing import cast @@ -49,12 +49,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> IndexSnapshotPriceResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[IndexSnapshotPriceResponse200Item] | None: if response.status_code == 200: - response_200 = IndexSnapshotPriceResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = IndexSnapshotPriceResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -62,7 +67,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[IndexSnapshotPriceResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[IndexSnapshotPriceResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -77,7 +82,7 @@ def sync_detailed( symbol: list[str], format_: Unset | IndexSnapshotPriceFormat = IndexSnapshotPriceFormat.JSON, -) -> Response[IndexSnapshotPriceResponse200]: +) -> Response[list[IndexSnapshotPriceResponse200Item]]: """ Price - Retrieves a real-time last index price. @@ -93,7 +98,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[IndexSnapshotPriceResponse200] + Response[list[IndexSnapshotPriceResponse200Item]] """ @@ -115,7 +120,7 @@ def sync( symbol: list[str], format_: Unset | IndexSnapshotPriceFormat = IndexSnapshotPriceFormat.JSON, -) -> IndexSnapshotPriceResponse200 | None: +) -> list[IndexSnapshotPriceResponse200Item] | None: """ Price - Retrieves a real-time last index price. @@ -131,7 +136,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - IndexSnapshotPriceResponse200 + list[IndexSnapshotPriceResponse200Item] """ @@ -148,7 +153,7 @@ async def asyncio_detailed( symbol: list[str], format_: Unset | IndexSnapshotPriceFormat = IndexSnapshotPriceFormat.JSON, -) -> Response[IndexSnapshotPriceResponse200]: +) -> Response[list[IndexSnapshotPriceResponse200Item]]: """ Price - Retrieves a real-time last index price. @@ -164,7 +169,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[IndexSnapshotPriceResponse200] + Response[list[IndexSnapshotPriceResponse200Item]] """ @@ -186,7 +191,7 @@ async def asyncio( symbol: list[str], format_: Unset | IndexSnapshotPriceFormat = IndexSnapshotPriceFormat.JSON, -) -> IndexSnapshotPriceResponse200 | None: +) -> list[IndexSnapshotPriceResponse200Item] | None: """ Price - Retrieves a real-time last index price. @@ -202,7 +207,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - IndexSnapshotPriceResponse200 + list[IndexSnapshotPriceResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_at_time_quote.py b/openapi_project/openapi_package/api/option/option_at_time_quote.py index a885f3541..045103e67 100644 --- a/openapi_project/openapi_package/api/option/option_at_time_quote.py +++ b/openapi_project/openapi_package/api/option/option_at_time_quote.py @@ -8,7 +8,7 @@ from openapi_project.openapi_package import errors from openapi_project.openapi_package.models.option_at_time_quote_format import OptionAtTimeQuoteFormat -from openapi_project.openapi_package.models.option_at_time_quote_response_200 import OptionAtTimeQuoteResponse200 +from openapi_project.openapi_package.models.option_at_time_quote_response_200_item import OptionAtTimeQuoteResponse200Item from openapi_project.openapi_package.models.option_at_time_quote_right import OptionAtTimeQuoteRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -72,12 +72,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionAtTimeQuoteResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionAtTimeQuoteResponse200Item] | None: if response.status_code == 200: - response_200 = OptionAtTimeQuoteResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionAtTimeQuoteResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -85,7 +90,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionAtTimeQuoteResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionAtTimeQuoteResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -106,7 +111,7 @@ def sync_detailed( right: Unset | OptionAtTimeQuoteRight = OptionAtTimeQuoteRight.BOTH, format_: Unset | OptionAtTimeQuoteFormat = OptionAtTimeQuoteFormat.JSON, -) -> Response[OptionAtTimeQuoteResponse200]: +) -> Response[list[OptionAtTimeQuoteResponse200Item]]: """ Quote - Returns the last NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) at a @@ -128,7 +133,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionAtTimeQuoteResponse200] + Response[list[OptionAtTimeQuoteResponse200Item]] """ @@ -162,7 +167,7 @@ def sync( right: Unset | OptionAtTimeQuoteRight = OptionAtTimeQuoteRight.BOTH, format_: Unset | OptionAtTimeQuoteFormat = OptionAtTimeQuoteFormat.JSON, -) -> OptionAtTimeQuoteResponse200 | None: +) -> list[OptionAtTimeQuoteResponse200Item] | None: """ Quote - Returns the last NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) at a @@ -184,7 +189,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionAtTimeQuoteResponse200 + list[OptionAtTimeQuoteResponse200Item] """ @@ -213,7 +218,7 @@ async def asyncio_detailed( right: Unset | OptionAtTimeQuoteRight = OptionAtTimeQuoteRight.BOTH, format_: Unset | OptionAtTimeQuoteFormat = OptionAtTimeQuoteFormat.JSON, -) -> Response[OptionAtTimeQuoteResponse200]: +) -> Response[list[OptionAtTimeQuoteResponse200Item]]: """ Quote - Returns the last NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) at a @@ -235,7 +240,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionAtTimeQuoteResponse200] + Response[list[OptionAtTimeQuoteResponse200Item]] """ @@ -269,7 +274,7 @@ async def asyncio( right: Unset | OptionAtTimeQuoteRight = OptionAtTimeQuoteRight.BOTH, format_: Unset | OptionAtTimeQuoteFormat = OptionAtTimeQuoteFormat.JSON, -) -> OptionAtTimeQuoteResponse200 | None: +) -> list[OptionAtTimeQuoteResponse200Item] | None: """ Quote - Returns the last NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) at a @@ -291,7 +296,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionAtTimeQuoteResponse200 + list[OptionAtTimeQuoteResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_at_time_trade.py b/openapi_project/openapi_package/api/option/option_at_time_trade.py index fac67967e..1234359a5 100644 --- a/openapi_project/openapi_package/api/option/option_at_time_trade.py +++ b/openapi_project/openapi_package/api/option/option_at_time_trade.py @@ -8,7 +8,7 @@ from openapi_project.openapi_package import errors from openapi_project.openapi_package.models.option_at_time_trade_format import OptionAtTimeTradeFormat -from openapi_project.openapi_package.models.option_at_time_trade_response_200 import OptionAtTimeTradeResponse200 +from openapi_project.openapi_package.models.option_at_time_trade_response_200_item import OptionAtTimeTradeResponse200Item from openapi_project.openapi_package.models.option_at_time_trade_right import OptionAtTimeTradeRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -72,12 +72,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionAtTimeTradeResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionAtTimeTradeResponse200Item] | None: if response.status_code == 200: - response_200 = OptionAtTimeTradeResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionAtTimeTradeResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -85,7 +90,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionAtTimeTradeResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionAtTimeTradeResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -106,7 +111,7 @@ def sync_detailed( right: Unset | OptionAtTimeTradeRight = OptionAtTimeTradeRight.BOTH, format_: Unset | OptionAtTimeTradeFormat = OptionAtTimeTradeFormat.JSON, -) -> Response[OptionAtTimeTradeResponse200]: +) -> Response[list[OptionAtTimeTradeResponse200Item]]: """ Trade - Returns the last trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) at a @@ -132,7 +137,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionAtTimeTradeResponse200] + Response[list[OptionAtTimeTradeResponse200Item]] """ @@ -166,7 +171,7 @@ def sync( right: Unset | OptionAtTimeTradeRight = OptionAtTimeTradeRight.BOTH, format_: Unset | OptionAtTimeTradeFormat = OptionAtTimeTradeFormat.JSON, -) -> OptionAtTimeTradeResponse200 | None: +) -> list[OptionAtTimeTradeResponse200Item] | None: """ Trade - Returns the last trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) at a @@ -192,7 +197,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionAtTimeTradeResponse200 + list[OptionAtTimeTradeResponse200Item] """ @@ -221,7 +226,7 @@ async def asyncio_detailed( right: Unset | OptionAtTimeTradeRight = OptionAtTimeTradeRight.BOTH, format_: Unset | OptionAtTimeTradeFormat = OptionAtTimeTradeFormat.JSON, -) -> Response[OptionAtTimeTradeResponse200]: +) -> Response[list[OptionAtTimeTradeResponse200Item]]: """ Trade - Returns the last trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) at a @@ -247,7 +252,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionAtTimeTradeResponse200] + Response[list[OptionAtTimeTradeResponse200Item]] """ @@ -281,7 +286,7 @@ async def asyncio( right: Unset | OptionAtTimeTradeRight = OptionAtTimeTradeRight.BOTH, format_: Unset | OptionAtTimeTradeFormat = OptionAtTimeTradeFormat.JSON, -) -> OptionAtTimeTradeResponse200 | None: +) -> list[OptionAtTimeTradeResponse200Item] | None: """ Trade - Returns the last trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html) at a @@ -307,7 +312,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionAtTimeTradeResponse200 + list[OptionAtTimeTradeResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_history_eod.py b/openapi_project/openapi_package/api/option/option_history_eod.py index 23df3b761..54557e473 100644 --- a/openapi_project/openapi_package/api/option/option_history_eod.py +++ b/openapi_project/openapi_package/api/option/option_history_eod.py @@ -8,7 +8,7 @@ from openapi_project.openapi_package import errors from openapi_project.openapi_package.models.option_history_eod_format import OptionHistoryEodFormat -from openapi_project.openapi_package.models.option_history_eod_response_200 import OptionHistoryEodResponse200 +from openapi_project.openapi_package.models.option_history_eod_response_200_item import OptionHistoryEodResponse200Item from openapi_project.openapi_package.models.option_history_eod_right import OptionHistoryEodRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -69,12 +69,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryEodResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionHistoryEodResponse200Item] | None: if response.status_code == 200: - response_200 = OptionHistoryEodResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionHistoryEodResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -82,7 +87,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryEodResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionHistoryEodResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -102,7 +107,7 @@ def sync_detailed( right: Unset | OptionHistoryEodRight = OptionHistoryEodRight.BOTH, format_: Unset | OptionHistoryEodFormat = OptionHistoryEodFormat.JSON, -) -> Response[OptionHistoryEodResponse200]: +) -> Response[list[OptionHistoryEodResponse200Item]]: """ End of Day - Since [OPRA](/Articles/Data-And-Requests/The-SIPs.html) does not provide a national EOD report for @@ -129,7 +134,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryEodResponse200] + Response[list[OptionHistoryEodResponse200Item]] """ @@ -161,7 +166,7 @@ def sync( right: Unset | OptionHistoryEodRight = OptionHistoryEodRight.BOTH, format_: Unset | OptionHistoryEodFormat = OptionHistoryEodFormat.JSON, -) -> OptionHistoryEodResponse200 | None: +) -> list[OptionHistoryEodResponse200Item] | None: """ End of Day - Since [OPRA](/Articles/Data-And-Requests/The-SIPs.html) does not provide a national EOD report for @@ -188,7 +193,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryEodResponse200 + list[OptionHistoryEodResponse200Item] """ @@ -215,7 +220,7 @@ async def asyncio_detailed( right: Unset | OptionHistoryEodRight = OptionHistoryEodRight.BOTH, format_: Unset | OptionHistoryEodFormat = OptionHistoryEodFormat.JSON, -) -> Response[OptionHistoryEodResponse200]: +) -> Response[list[OptionHistoryEodResponse200Item]]: """ End of Day - Since [OPRA](/Articles/Data-And-Requests/The-SIPs.html) does not provide a national EOD report for @@ -242,7 +247,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryEodResponse200] + Response[list[OptionHistoryEodResponse200Item]] """ @@ -274,7 +279,7 @@ async def asyncio( right: Unset | OptionHistoryEodRight = OptionHistoryEodRight.BOTH, format_: Unset | OptionHistoryEodFormat = OptionHistoryEodFormat.JSON, -) -> OptionHistoryEodResponse200 | None: +) -> list[OptionHistoryEodResponse200Item] | None: """ End of Day - Since [OPRA](/Articles/Data-And-Requests/The-SIPs.html) does not provide a national EOD report for @@ -301,7 +306,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryEodResponse200 + list[OptionHistoryEodResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_history_greeks_all.py b/openapi_project/openapi_package/api/option/option_history_greeks_all.py index ecd86a20b..e68557cd5 100644 --- a/openapi_project/openapi_package/api/option/option_history_greeks_all.py +++ b/openapi_project/openapi_package/api/option/option_history_greeks_all.py @@ -10,7 +10,7 @@ from openapi_project.openapi_package.models.option_history_greeks_all_format import OptionHistoryGreeksAllFormat from openapi_project.openapi_package.models.option_history_greeks_all_interval import OptionHistoryGreeksAllInterval from openapi_project.openapi_package.models.option_history_greeks_all_rate_type import OptionHistoryGreeksAllRateType -from openapi_project.openapi_package.models.option_history_greeks_all_response_200 import OptionHistoryGreeksAllResponse200 +from openapi_project.openapi_package.models.option_history_greeks_all_response_200_item import OptionHistoryGreeksAllResponse200Item from openapi_project.openapi_package.models.option_history_greeks_all_right import OptionHistoryGreeksAllRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -88,12 +88,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryGreeksAllResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionHistoryGreeksAllResponse200Item] | None: if response.status_code == 200: - response_200 = OptionHistoryGreeksAllResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionHistoryGreeksAllResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -101,7 +106,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryGreeksAllResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionHistoryGreeksAllResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -126,7 +131,7 @@ def sync_detailed( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryGreeksAllFormat = OptionHistoryGreeksAllFormat.JSON, -) -> Response[OptionHistoryGreeksAllResponse200]: +) -> Response[list[OptionHistoryGreeksAllResponse200Item]]: """ All Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -159,7 +164,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryGreeksAllResponse200] + Response[list[OptionHistoryGreeksAllResponse200Item]] """ @@ -201,7 +206,7 @@ def sync( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryGreeksAllFormat = OptionHistoryGreeksAllFormat.JSON, -) -> OptionHistoryGreeksAllResponse200 | None: +) -> list[OptionHistoryGreeksAllResponse200Item] | None: """ All Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -234,7 +239,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryGreeksAllResponse200 + list[OptionHistoryGreeksAllResponse200Item] """ @@ -271,7 +276,7 @@ async def asyncio_detailed( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryGreeksAllFormat = OptionHistoryGreeksAllFormat.JSON, -) -> Response[OptionHistoryGreeksAllResponse200]: +) -> Response[list[OptionHistoryGreeksAllResponse200Item]]: """ All Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -304,7 +309,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryGreeksAllResponse200] + Response[list[OptionHistoryGreeksAllResponse200Item]] """ @@ -346,7 +351,7 @@ async def asyncio( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryGreeksAllFormat = OptionHistoryGreeksAllFormat.JSON, -) -> OptionHistoryGreeksAllResponse200 | None: +) -> list[OptionHistoryGreeksAllResponse200Item] | None: """ All Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -379,7 +384,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryGreeksAllResponse200 + list[OptionHistoryGreeksAllResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_history_greeks_eod.py b/openapi_project/openapi_package/api/option/option_history_greeks_eod.py index b66fd3f2d..93ffce68e 100644 --- a/openapi_project/openapi_package/api/option/option_history_greeks_eod.py +++ b/openapi_project/openapi_package/api/option/option_history_greeks_eod.py @@ -9,7 +9,7 @@ from openapi_project.openapi_package.models.option_history_greeks_eod_format import OptionHistoryGreeksEodFormat from openapi_project.openapi_package.models.option_history_greeks_eod_rate_type import OptionHistoryGreeksEodRateType -from openapi_project.openapi_package.models.option_history_greeks_eod_response_200 import OptionHistoryGreeksEodResponse200 +from openapi_project.openapi_package.models.option_history_greeks_eod_response_200_item import OptionHistoryGreeksEodResponse200Item from openapi_project.openapi_package.models.option_history_greeks_eod_right import OptionHistoryGreeksEodRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -81,12 +81,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryGreeksEodResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionHistoryGreeksEodResponse200Item] | None: if response.status_code == 200: - response_200 = OptionHistoryGreeksEodResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionHistoryGreeksEodResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -94,7 +99,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryGreeksEodResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionHistoryGreeksEodResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -117,7 +122,7 @@ def sync_detailed( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryGreeksEodFormat = OptionHistoryGreeksEodFormat.JSON, -) -> Response[OptionHistoryGreeksEodResponse200]: +) -> Response[list[OptionHistoryGreeksEodResponse200Item]]: """ End of Day Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -148,7 +153,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryGreeksEodResponse200] + Response[list[OptionHistoryGreeksEodResponse200Item]] """ @@ -186,7 +191,7 @@ def sync( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryGreeksEodFormat = OptionHistoryGreeksEodFormat.JSON, -) -> OptionHistoryGreeksEodResponse200 | None: +) -> list[OptionHistoryGreeksEodResponse200Item] | None: """ End of Day Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -217,7 +222,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryGreeksEodResponse200 + list[OptionHistoryGreeksEodResponse200Item] """ @@ -250,7 +255,7 @@ async def asyncio_detailed( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryGreeksEodFormat = OptionHistoryGreeksEodFormat.JSON, -) -> Response[OptionHistoryGreeksEodResponse200]: +) -> Response[list[OptionHistoryGreeksEodResponse200Item]]: """ End of Day Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -281,7 +286,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryGreeksEodResponse200] + Response[list[OptionHistoryGreeksEodResponse200Item]] """ @@ -319,7 +324,7 @@ async def asyncio( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryGreeksEodFormat = OptionHistoryGreeksEodFormat.JSON, -) -> OptionHistoryGreeksEodResponse200 | None: +) -> list[OptionHistoryGreeksEodResponse200Item] | None: """ End of Day Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -350,7 +355,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryGreeksEodResponse200 + list[OptionHistoryGreeksEodResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_history_greeks_first_order.py b/openapi_project/openapi_package/api/option/option_history_greeks_first_order.py index 7eeb8d914..ec5ba2bf7 100644 --- a/openapi_project/openapi_package/api/option/option_history_greeks_first_order.py +++ b/openapi_project/openapi_package/api/option/option_history_greeks_first_order.py @@ -10,7 +10,7 @@ from openapi_project.openapi_package.models.option_history_greeks_first_order_format import OptionHistoryGreeksFirstOrderFormat from openapi_project.openapi_package.models.option_history_greeks_first_order_interval import OptionHistoryGreeksFirstOrderInterval from openapi_project.openapi_package.models.option_history_greeks_first_order_rate_type import OptionHistoryGreeksFirstOrderRateType -from openapi_project.openapi_package.models.option_history_greeks_first_order_response_200 import OptionHistoryGreeksFirstOrderResponse200 +from openapi_project.openapi_package.models.option_history_greeks_first_order_response_200_item import OptionHistoryGreeksFirstOrderResponse200Item from openapi_project.openapi_package.models.option_history_greeks_first_order_right import OptionHistoryGreeksFirstOrderRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -88,12 +88,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryGreeksFirstOrderResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionHistoryGreeksFirstOrderResponse200Item] | None: if response.status_code == 200: - response_200 = OptionHistoryGreeksFirstOrderResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionHistoryGreeksFirstOrderResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -101,7 +106,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryGreeksFirstOrderResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionHistoryGreeksFirstOrderResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -126,7 +131,7 @@ def sync_detailed( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryGreeksFirstOrderFormat = OptionHistoryGreeksFirstOrderFormat.JSON, -) -> Response[OptionHistoryGreeksFirstOrderResponse200]: +) -> Response[list[OptionHistoryGreeksFirstOrderResponse200Item]]: """ First Order Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -160,7 +165,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryGreeksFirstOrderResponse200] + Response[list[OptionHistoryGreeksFirstOrderResponse200Item]] """ @@ -202,7 +207,7 @@ def sync( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryGreeksFirstOrderFormat = OptionHistoryGreeksFirstOrderFormat.JSON, -) -> OptionHistoryGreeksFirstOrderResponse200 | None: +) -> list[OptionHistoryGreeksFirstOrderResponse200Item] | None: """ First Order Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -236,7 +241,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryGreeksFirstOrderResponse200 + list[OptionHistoryGreeksFirstOrderResponse200Item] """ @@ -273,7 +278,7 @@ async def asyncio_detailed( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryGreeksFirstOrderFormat = OptionHistoryGreeksFirstOrderFormat.JSON, -) -> Response[OptionHistoryGreeksFirstOrderResponse200]: +) -> Response[list[OptionHistoryGreeksFirstOrderResponse200Item]]: """ First Order Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -307,7 +312,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryGreeksFirstOrderResponse200] + Response[list[OptionHistoryGreeksFirstOrderResponse200Item]] """ @@ -349,7 +354,7 @@ async def asyncio( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryGreeksFirstOrderFormat = OptionHistoryGreeksFirstOrderFormat.JSON, -) -> OptionHistoryGreeksFirstOrderResponse200 | None: +) -> list[OptionHistoryGreeksFirstOrderResponse200Item] | None: """ First Order Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -383,7 +388,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryGreeksFirstOrderResponse200 + list[OptionHistoryGreeksFirstOrderResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_history_greeks_implied_volatility.py b/openapi_project/openapi_package/api/option/option_history_greeks_implied_volatility.py index 44c06eb4f..b2ca83eae 100644 --- a/openapi_project/openapi_package/api/option/option_history_greeks_implied_volatility.py +++ b/openapi_project/openapi_package/api/option/option_history_greeks_implied_volatility.py @@ -10,7 +10,7 @@ from openapi_project.openapi_package.models.option_history_greeks_implied_volatility_format import OptionHistoryGreeksImpliedVolatilityFormat from openapi_project.openapi_package.models.option_history_greeks_implied_volatility_interval import OptionHistoryGreeksImpliedVolatilityInterval from openapi_project.openapi_package.models.option_history_greeks_implied_volatility_rate_type import OptionHistoryGreeksImpliedVolatilityRateType -from openapi_project.openapi_package.models.option_history_greeks_implied_volatility_response_200 import OptionHistoryGreeksImpliedVolatilityResponse200 +from openapi_project.openapi_package.models.option_history_greeks_implied_volatility_response_200_item import OptionHistoryGreeksImpliedVolatilityResponse200Item from openapi_project.openapi_package.models.option_history_greeks_implied_volatility_right import OptionHistoryGreeksImpliedVolatilityRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -88,12 +88,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryGreeksImpliedVolatilityResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionHistoryGreeksImpliedVolatilityResponse200Item] | None: if response.status_code == 200: - response_200 = OptionHistoryGreeksImpliedVolatilityResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionHistoryGreeksImpliedVolatilityResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -101,7 +106,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryGreeksImpliedVolatilityResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionHistoryGreeksImpliedVolatilityResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -126,7 +131,7 @@ def sync_detailed( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryGreeksImpliedVolatilityFormat = OptionHistoryGreeksImpliedVolatilityFormat.JSON, -) -> Response[OptionHistoryGreeksImpliedVolatilityResponse200]: +) -> Response[list[OptionHistoryGreeksImpliedVolatilityResponse200Item]]: """ Implied Volatility - Returns implied volatilies calculated using the national best bid, mid, and ask price of the @@ -158,7 +163,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryGreeksImpliedVolatilityResponse200] + Response[list[OptionHistoryGreeksImpliedVolatilityResponse200Item]] """ @@ -200,7 +205,7 @@ def sync( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryGreeksImpliedVolatilityFormat = OptionHistoryGreeksImpliedVolatilityFormat.JSON, -) -> OptionHistoryGreeksImpliedVolatilityResponse200 | None: +) -> list[OptionHistoryGreeksImpliedVolatilityResponse200Item] | None: """ Implied Volatility - Returns implied volatilies calculated using the national best bid, mid, and ask price of the @@ -232,7 +237,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryGreeksImpliedVolatilityResponse200 + list[OptionHistoryGreeksImpliedVolatilityResponse200Item] """ @@ -269,7 +274,7 @@ async def asyncio_detailed( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryGreeksImpliedVolatilityFormat = OptionHistoryGreeksImpliedVolatilityFormat.JSON, -) -> Response[OptionHistoryGreeksImpliedVolatilityResponse200]: +) -> Response[list[OptionHistoryGreeksImpliedVolatilityResponse200Item]]: """ Implied Volatility - Returns implied volatilies calculated using the national best bid, mid, and ask price of the @@ -301,7 +306,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryGreeksImpliedVolatilityResponse200] + Response[list[OptionHistoryGreeksImpliedVolatilityResponse200Item]] """ @@ -343,7 +348,7 @@ async def asyncio( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryGreeksImpliedVolatilityFormat = OptionHistoryGreeksImpliedVolatilityFormat.JSON, -) -> OptionHistoryGreeksImpliedVolatilityResponse200 | None: +) -> list[OptionHistoryGreeksImpliedVolatilityResponse200Item] | None: """ Implied Volatility - Returns implied volatilies calculated using the national best bid, mid, and ask price of the @@ -375,7 +380,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryGreeksImpliedVolatilityResponse200 + list[OptionHistoryGreeksImpliedVolatilityResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_history_greeks_second_order.py b/openapi_project/openapi_package/api/option/option_history_greeks_second_order.py index 10d39450c..57af3654e 100644 --- a/openapi_project/openapi_package/api/option/option_history_greeks_second_order.py +++ b/openapi_project/openapi_package/api/option/option_history_greeks_second_order.py @@ -10,7 +10,7 @@ from openapi_project.openapi_package.models.option_history_greeks_second_order_format import OptionHistoryGreeksSecondOrderFormat from openapi_project.openapi_package.models.option_history_greeks_second_order_interval import OptionHistoryGreeksSecondOrderInterval from openapi_project.openapi_package.models.option_history_greeks_second_order_rate_type import OptionHistoryGreeksSecondOrderRateType -from openapi_project.openapi_package.models.option_history_greeks_second_order_response_200 import OptionHistoryGreeksSecondOrderResponse200 +from openapi_project.openapi_package.models.option_history_greeks_second_order_response_200_item import OptionHistoryGreeksSecondOrderResponse200Item from openapi_project.openapi_package.models.option_history_greeks_second_order_right import OptionHistoryGreeksSecondOrderRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -88,12 +88,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryGreeksSecondOrderResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionHistoryGreeksSecondOrderResponse200Item] | None: if response.status_code == 200: - response_200 = OptionHistoryGreeksSecondOrderResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionHistoryGreeksSecondOrderResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -101,7 +106,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryGreeksSecondOrderResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionHistoryGreeksSecondOrderResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -126,7 +131,7 @@ def sync_detailed( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryGreeksSecondOrderFormat = OptionHistoryGreeksSecondOrderFormat.JSON, -) -> Response[OptionHistoryGreeksSecondOrderResponse200]: +) -> Response[list[OptionHistoryGreeksSecondOrderResponse200Item]]: """ Second Order Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -160,7 +165,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryGreeksSecondOrderResponse200] + Response[list[OptionHistoryGreeksSecondOrderResponse200Item]] """ @@ -202,7 +207,7 @@ def sync( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryGreeksSecondOrderFormat = OptionHistoryGreeksSecondOrderFormat.JSON, -) -> OptionHistoryGreeksSecondOrderResponse200 | None: +) -> list[OptionHistoryGreeksSecondOrderResponse200Item] | None: """ Second Order Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -236,7 +241,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryGreeksSecondOrderResponse200 + list[OptionHistoryGreeksSecondOrderResponse200Item] """ @@ -273,7 +278,7 @@ async def asyncio_detailed( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryGreeksSecondOrderFormat = OptionHistoryGreeksSecondOrderFormat.JSON, -) -> Response[OptionHistoryGreeksSecondOrderResponse200]: +) -> Response[list[OptionHistoryGreeksSecondOrderResponse200Item]]: """ Second Order Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -307,7 +312,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryGreeksSecondOrderResponse200] + Response[list[OptionHistoryGreeksSecondOrderResponse200Item]] """ @@ -349,7 +354,7 @@ async def asyncio( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryGreeksSecondOrderFormat = OptionHistoryGreeksSecondOrderFormat.JSON, -) -> OptionHistoryGreeksSecondOrderResponse200 | None: +) -> list[OptionHistoryGreeksSecondOrderResponse200Item] | None: """ Second Order Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -383,7 +388,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryGreeksSecondOrderResponse200 + list[OptionHistoryGreeksSecondOrderResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_history_greeks_third_order.py b/openapi_project/openapi_package/api/option/option_history_greeks_third_order.py index 4566df36e..9dd135968 100644 --- a/openapi_project/openapi_package/api/option/option_history_greeks_third_order.py +++ b/openapi_project/openapi_package/api/option/option_history_greeks_third_order.py @@ -10,7 +10,7 @@ from openapi_project.openapi_package.models.option_history_greeks_third_order_format import OptionHistoryGreeksThirdOrderFormat from openapi_project.openapi_package.models.option_history_greeks_third_order_interval import OptionHistoryGreeksThirdOrderInterval from openapi_project.openapi_package.models.option_history_greeks_third_order_rate_type import OptionHistoryGreeksThirdOrderRateType -from openapi_project.openapi_package.models.option_history_greeks_third_order_response_200 import OptionHistoryGreeksThirdOrderResponse200 +from openapi_project.openapi_package.models.option_history_greeks_third_order_response_200_item import OptionHistoryGreeksThirdOrderResponse200Item from openapi_project.openapi_package.models.option_history_greeks_third_order_right import OptionHistoryGreeksThirdOrderRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -88,12 +88,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryGreeksThirdOrderResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionHistoryGreeksThirdOrderResponse200Item] | None: if response.status_code == 200: - response_200 = OptionHistoryGreeksThirdOrderResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionHistoryGreeksThirdOrderResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -101,7 +106,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryGreeksThirdOrderResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionHistoryGreeksThirdOrderResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -126,7 +131,7 @@ def sync_detailed( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryGreeksThirdOrderFormat = OptionHistoryGreeksThirdOrderFormat.JSON, -) -> Response[OptionHistoryGreeksThirdOrderResponse200]: +) -> Response[list[OptionHistoryGreeksThirdOrderResponse200Item]]: """ Third Order Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -160,7 +165,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryGreeksThirdOrderResponse200] + Response[list[OptionHistoryGreeksThirdOrderResponse200Item]] """ @@ -202,7 +207,7 @@ def sync( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryGreeksThirdOrderFormat = OptionHistoryGreeksThirdOrderFormat.JSON, -) -> OptionHistoryGreeksThirdOrderResponse200 | None: +) -> list[OptionHistoryGreeksThirdOrderResponse200Item] | None: """ Third Order Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -236,7 +241,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryGreeksThirdOrderResponse200 + list[OptionHistoryGreeksThirdOrderResponse200Item] """ @@ -273,7 +278,7 @@ async def asyncio_detailed( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryGreeksThirdOrderFormat = OptionHistoryGreeksThirdOrderFormat.JSON, -) -> Response[OptionHistoryGreeksThirdOrderResponse200]: +) -> Response[list[OptionHistoryGreeksThirdOrderResponse200Item]]: """ Third Order Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -307,7 +312,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryGreeksThirdOrderResponse200] + Response[list[OptionHistoryGreeksThirdOrderResponse200Item]] """ @@ -349,7 +354,7 @@ async def asyncio( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryGreeksThirdOrderFormat = OptionHistoryGreeksThirdOrderFormat.JSON, -) -> OptionHistoryGreeksThirdOrderResponse200 | None: +) -> list[OptionHistoryGreeksThirdOrderResponse200Item] | None: """ Third Order Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -383,7 +388,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryGreeksThirdOrderResponse200 + list[OptionHistoryGreeksThirdOrderResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_history_ohlc.py b/openapi_project/openapi_package/api/option/option_history_ohlc.py index 7889fd312..5bbf6dc5a 100644 --- a/openapi_project/openapi_package/api/option/option_history_ohlc.py +++ b/openapi_project/openapi_package/api/option/option_history_ohlc.py @@ -9,7 +9,7 @@ from openapi_project.openapi_package.models.option_history_ohlc_format import OptionHistoryOhlcFormat from openapi_project.openapi_package.models.option_history_ohlc_interval import OptionHistoryOhlcInterval -from openapi_project.openapi_package.models.option_history_ohlc_response_200 import OptionHistoryOhlcResponse200 +from openapi_project.openapi_package.models.option_history_ohlc_response_200_item import OptionHistoryOhlcResponse200Item from openapi_project.openapi_package.models.option_history_ohlc_right import OptionHistoryOhlcRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -76,12 +76,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryOhlcResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionHistoryOhlcResponse200Item] | None: if response.status_code == 200: - response_200 = OptionHistoryOhlcResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionHistoryOhlcResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -89,7 +94,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryOhlcResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionHistoryOhlcResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -111,7 +116,7 @@ def sync_detailed( end_time: Unset | str = '16:00:00', format_: Unset | OptionHistoryOhlcFormat = OptionHistoryOhlcFormat.JSON, -) -> Response[OptionHistoryOhlcResponse200]: +) -> Response[list[OptionHistoryOhlcResponse200Item]]: """ Open High Low Close - Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. @@ -134,7 +139,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryOhlcResponse200] + Response[list[OptionHistoryOhlcResponse200Item]] """ @@ -170,7 +175,7 @@ def sync( end_time: Unset | str = '16:00:00', format_: Unset | OptionHistoryOhlcFormat = OptionHistoryOhlcFormat.JSON, -) -> OptionHistoryOhlcResponse200 | None: +) -> list[OptionHistoryOhlcResponse200Item] | None: """ Open High Low Close - Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. @@ -193,7 +198,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryOhlcResponse200 + list[OptionHistoryOhlcResponse200Item] """ @@ -224,7 +229,7 @@ async def asyncio_detailed( end_time: Unset | str = '16:00:00', format_: Unset | OptionHistoryOhlcFormat = OptionHistoryOhlcFormat.JSON, -) -> Response[OptionHistoryOhlcResponse200]: +) -> Response[list[OptionHistoryOhlcResponse200Item]]: """ Open High Low Close - Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. @@ -247,7 +252,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryOhlcResponse200] + Response[list[OptionHistoryOhlcResponse200Item]] """ @@ -283,7 +288,7 @@ async def asyncio( end_time: Unset | str = '16:00:00', format_: Unset | OptionHistoryOhlcFormat = OptionHistoryOhlcFormat.JSON, -) -> OptionHistoryOhlcResponse200 | None: +) -> list[OptionHistoryOhlcResponse200Item] | None: """ Open High Low Close - Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. @@ -306,7 +311,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryOhlcResponse200 + list[OptionHistoryOhlcResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_history_open_interest.py b/openapi_project/openapi_package/api/option/option_history_open_interest.py index 37f433668..5395f9c3a 100644 --- a/openapi_project/openapi_package/api/option/option_history_open_interest.py +++ b/openapi_project/openapi_package/api/option/option_history_open_interest.py @@ -8,7 +8,7 @@ from openapi_project.openapi_package import errors from openapi_project.openapi_package.models.option_history_open_interest_format import OptionHistoryOpenInterestFormat -from openapi_project.openapi_package.models.option_history_open_interest_response_200 import OptionHistoryOpenInterestResponse200 +from openapi_project.openapi_package.models.option_history_open_interest_response_200_item import OptionHistoryOpenInterestResponse200Item from openapi_project.openapi_package.models.option_history_open_interest_right import OptionHistoryOpenInterestRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -65,12 +65,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryOpenInterestResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionHistoryOpenInterestResponse200Item] | None: if response.status_code == 200: - response_200 = OptionHistoryOpenInterestResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionHistoryOpenInterestResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -78,7 +83,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryOpenInterestResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionHistoryOpenInterestResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -97,7 +102,7 @@ def sync_detailed( right: Unset | OptionHistoryOpenInterestRight = OptionHistoryOpenInterestRight.BOTH, format_: Unset | OptionHistoryOpenInterestFormat = OptionHistoryOpenInterestFormat.JSON, -) -> Response[OptionHistoryOpenInterestResponse200]: +) -> Response[list[OptionHistoryOpenInterestResponse200Item]]: """ Open Interest - Open Interest is normally reported once per day by [OPRA](/Articles/Data-And-Requests/The- @@ -121,7 +126,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryOpenInterestResponse200] + Response[list[OptionHistoryOpenInterestResponse200Item]] """ @@ -151,7 +156,7 @@ def sync( right: Unset | OptionHistoryOpenInterestRight = OptionHistoryOpenInterestRight.BOTH, format_: Unset | OptionHistoryOpenInterestFormat = OptionHistoryOpenInterestFormat.JSON, -) -> OptionHistoryOpenInterestResponse200 | None: +) -> list[OptionHistoryOpenInterestResponse200Item] | None: """ Open Interest - Open Interest is normally reported once per day by [OPRA](/Articles/Data-And-Requests/The- @@ -175,7 +180,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryOpenInterestResponse200 + list[OptionHistoryOpenInterestResponse200Item] """ @@ -200,7 +205,7 @@ async def asyncio_detailed( right: Unset | OptionHistoryOpenInterestRight = OptionHistoryOpenInterestRight.BOTH, format_: Unset | OptionHistoryOpenInterestFormat = OptionHistoryOpenInterestFormat.JSON, -) -> Response[OptionHistoryOpenInterestResponse200]: +) -> Response[list[OptionHistoryOpenInterestResponse200Item]]: """ Open Interest - Open Interest is normally reported once per day by [OPRA](/Articles/Data-And-Requests/The- @@ -224,7 +229,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryOpenInterestResponse200] + Response[list[OptionHistoryOpenInterestResponse200Item]] """ @@ -254,7 +259,7 @@ async def asyncio( right: Unset | OptionHistoryOpenInterestRight = OptionHistoryOpenInterestRight.BOTH, format_: Unset | OptionHistoryOpenInterestFormat = OptionHistoryOpenInterestFormat.JSON, -) -> OptionHistoryOpenInterestResponse200 | None: +) -> list[OptionHistoryOpenInterestResponse200Item] | None: """ Open Interest - Open Interest is normally reported once per day by [OPRA](/Articles/Data-And-Requests/The- @@ -278,7 +283,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryOpenInterestResponse200 + list[OptionHistoryOpenInterestResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_history_quote.py b/openapi_project/openapi_package/api/option/option_history_quote.py index a13379a44..42ac4cf89 100644 --- a/openapi_project/openapi_package/api/option/option_history_quote.py +++ b/openapi_project/openapi_package/api/option/option_history_quote.py @@ -9,7 +9,7 @@ from openapi_project.openapi_package.models.option_history_quote_format import OptionHistoryQuoteFormat from openapi_project.openapi_package.models.option_history_quote_interval import OptionHistoryQuoteInterval -from openapi_project.openapi_package.models.option_history_quote_response_200 import OptionHistoryQuoteResponse200 +from openapi_project.openapi_package.models.option_history_quote_response_200_item import OptionHistoryQuoteResponse200Item from openapi_project.openapi_package.models.option_history_quote_right import OptionHistoryQuoteRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -76,12 +76,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryQuoteResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionHistoryQuoteResponse200Item] | None: if response.status_code == 200: - response_200 = OptionHistoryQuoteResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionHistoryQuoteResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -89,7 +94,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryQuoteResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionHistoryQuoteResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -111,7 +116,7 @@ def sync_detailed( interval: OptionHistoryQuoteInterval = OptionHistoryQuoteInterval.VALUE_4, format_: Unset | OptionHistoryQuoteFormat = OptionHistoryQuoteFormat.JSON, -) -> Response[OptionHistoryQuoteResponse200]: +) -> Response[list[OptionHistoryQuoteResponse200Item]]: """ Quote - Returns every NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). @@ -134,7 +139,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryQuoteResponse200] + Response[list[OptionHistoryQuoteResponse200Item]] """ @@ -170,7 +175,7 @@ def sync( interval: OptionHistoryQuoteInterval = OptionHistoryQuoteInterval.VALUE_4, format_: Unset | OptionHistoryQuoteFormat = OptionHistoryQuoteFormat.JSON, -) -> OptionHistoryQuoteResponse200 | None: +) -> list[OptionHistoryQuoteResponse200Item] | None: """ Quote - Returns every NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). @@ -193,7 +198,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryQuoteResponse200 + list[OptionHistoryQuoteResponse200Item] """ @@ -224,7 +229,7 @@ async def asyncio_detailed( interval: OptionHistoryQuoteInterval = OptionHistoryQuoteInterval.VALUE_4, format_: Unset | OptionHistoryQuoteFormat = OptionHistoryQuoteFormat.JSON, -) -> Response[OptionHistoryQuoteResponse200]: +) -> Response[list[OptionHistoryQuoteResponse200Item]]: """ Quote - Returns every NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). @@ -247,7 +252,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryQuoteResponse200] + Response[list[OptionHistoryQuoteResponse200Item]] """ @@ -283,7 +288,7 @@ async def asyncio( interval: OptionHistoryQuoteInterval = OptionHistoryQuoteInterval.VALUE_4, format_: Unset | OptionHistoryQuoteFormat = OptionHistoryQuoteFormat.JSON, -) -> OptionHistoryQuoteResponse200 | None: +) -> list[OptionHistoryQuoteResponse200Item] | None: """ Quote - Returns every NBBO quote reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). @@ -306,7 +311,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryQuoteResponse200 + list[OptionHistoryQuoteResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_history_trade.py b/openapi_project/openapi_package/api/option/option_history_trade.py index b0feebbef..1c8a7c5e1 100644 --- a/openapi_project/openapi_package/api/option/option_history_trade.py +++ b/openapi_project/openapi_package/api/option/option_history_trade.py @@ -8,7 +8,7 @@ from openapi_project.openapi_package import errors from openapi_project.openapi_package.models.option_history_trade_format import OptionHistoryTradeFormat -from openapi_project.openapi_package.models.option_history_trade_response_200 import OptionHistoryTradeResponse200 +from openapi_project.openapi_package.models.option_history_trade_response_200_item import OptionHistoryTradeResponse200Item from openapi_project.openapi_package.models.option_history_trade_right import OptionHistoryTradeRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -71,12 +71,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryTradeResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionHistoryTradeResponse200Item] | None: if response.status_code == 200: - response_200 = OptionHistoryTradeResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionHistoryTradeResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -84,7 +89,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryTradeResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionHistoryTradeResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -105,7 +110,7 @@ def sync_detailed( end_time: Unset | str = '16:00:00', format_: Unset | OptionHistoryTradeFormat = OptionHistoryTradeFormat.JSON, -) -> Response[OptionHistoryTradeResponse200]: +) -> Response[list[OptionHistoryTradeResponse200Item]]: """ Trade - Returns every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). @@ -129,7 +134,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryTradeResponse200] + Response[list[OptionHistoryTradeResponse200Item]] """ @@ -163,7 +168,7 @@ def sync( end_time: Unset | str = '16:00:00', format_: Unset | OptionHistoryTradeFormat = OptionHistoryTradeFormat.JSON, -) -> OptionHistoryTradeResponse200 | None: +) -> list[OptionHistoryTradeResponse200Item] | None: """ Trade - Returns every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). @@ -187,7 +192,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryTradeResponse200 + list[OptionHistoryTradeResponse200Item] """ @@ -216,7 +221,7 @@ async def asyncio_detailed( end_time: Unset | str = '16:00:00', format_: Unset | OptionHistoryTradeFormat = OptionHistoryTradeFormat.JSON, -) -> Response[OptionHistoryTradeResponse200]: +) -> Response[list[OptionHistoryTradeResponse200Item]]: """ Trade - Returns every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). @@ -240,7 +245,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryTradeResponse200] + Response[list[OptionHistoryTradeResponse200Item]] """ @@ -274,7 +279,7 @@ async def asyncio( end_time: Unset | str = '16:00:00', format_: Unset | OptionHistoryTradeFormat = OptionHistoryTradeFormat.JSON, -) -> OptionHistoryTradeResponse200 | None: +) -> list[OptionHistoryTradeResponse200Item] | None: """ Trade - Returns every trade reported by [OPRA](/Articles/Data-And-Requests/The-SIPs.html). @@ -298,7 +303,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryTradeResponse200 + list[OptionHistoryTradeResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_history_trade_greeks_all.py b/openapi_project/openapi_package/api/option/option_history_trade_greeks_all.py index 3581cff7b..81711f956 100644 --- a/openapi_project/openapi_package/api/option/option_history_trade_greeks_all.py +++ b/openapi_project/openapi_package/api/option/option_history_trade_greeks_all.py @@ -9,7 +9,7 @@ from openapi_project.openapi_package.models.option_history_trade_greeks_all_format import OptionHistoryTradeGreeksAllFormat from openapi_project.openapi_package.models.option_history_trade_greeks_all_rate_type import OptionHistoryTradeGreeksAllRateType -from openapi_project.openapi_package.models.option_history_trade_greeks_all_response_200 import OptionHistoryTradeGreeksAllResponse200 +from openapi_project.openapi_package.models.option_history_trade_greeks_all_response_200_item import OptionHistoryTradeGreeksAllResponse200Item from openapi_project.openapi_package.models.option_history_trade_greeks_all_right import OptionHistoryTradeGreeksAllRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -83,12 +83,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryTradeGreeksAllResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionHistoryTradeGreeksAllResponse200Item] | None: if response.status_code == 200: - response_200 = OptionHistoryTradeGreeksAllResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionHistoryTradeGreeksAllResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -96,7 +101,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryTradeGreeksAllResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionHistoryTradeGreeksAllResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -120,7 +125,7 @@ def sync_detailed( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryTradeGreeksAllFormat = OptionHistoryTradeGreeksAllFormat.JSON, -) -> Response[OptionHistoryTradeGreeksAllResponse200]: +) -> Response[list[OptionHistoryTradeGreeksAllResponse200Item]]: """ All Trade Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -150,7 +155,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryTradeGreeksAllResponse200] + Response[list[OptionHistoryTradeGreeksAllResponse200Item]] """ @@ -190,7 +195,7 @@ def sync( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryTradeGreeksAllFormat = OptionHistoryTradeGreeksAllFormat.JSON, -) -> OptionHistoryTradeGreeksAllResponse200 | None: +) -> list[OptionHistoryTradeGreeksAllResponse200Item] | None: """ All Trade Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -220,7 +225,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryTradeGreeksAllResponse200 + list[OptionHistoryTradeGreeksAllResponse200Item] """ @@ -255,7 +260,7 @@ async def asyncio_detailed( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryTradeGreeksAllFormat = OptionHistoryTradeGreeksAllFormat.JSON, -) -> Response[OptionHistoryTradeGreeksAllResponse200]: +) -> Response[list[OptionHistoryTradeGreeksAllResponse200Item]]: """ All Trade Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -285,7 +290,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryTradeGreeksAllResponse200] + Response[list[OptionHistoryTradeGreeksAllResponse200Item]] """ @@ -325,7 +330,7 @@ async def asyncio( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryTradeGreeksAllFormat = OptionHistoryTradeGreeksAllFormat.JSON, -) -> OptionHistoryTradeGreeksAllResponse200 | None: +) -> list[OptionHistoryTradeGreeksAllResponse200Item] | None: """ All Trade Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -355,7 +360,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryTradeGreeksAllResponse200 + list[OptionHistoryTradeGreeksAllResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_history_trade_greeks_first_order.py b/openapi_project/openapi_package/api/option/option_history_trade_greeks_first_order.py index 1f0064b6f..7446681f2 100644 --- a/openapi_project/openapi_package/api/option/option_history_trade_greeks_first_order.py +++ b/openapi_project/openapi_package/api/option/option_history_trade_greeks_first_order.py @@ -9,7 +9,7 @@ from openapi_project.openapi_package.models.option_history_trade_greeks_first_order_format import OptionHistoryTradeGreeksFirstOrderFormat from openapi_project.openapi_package.models.option_history_trade_greeks_first_order_rate_type import OptionHistoryTradeGreeksFirstOrderRateType -from openapi_project.openapi_package.models.option_history_trade_greeks_first_order_response_200 import OptionHistoryTradeGreeksFirstOrderResponse200 +from openapi_project.openapi_package.models.option_history_trade_greeks_first_order_response_200_item import OptionHistoryTradeGreeksFirstOrderResponse200Item from openapi_project.openapi_package.models.option_history_trade_greeks_first_order_right import OptionHistoryTradeGreeksFirstOrderRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -83,12 +83,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryTradeGreeksFirstOrderResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionHistoryTradeGreeksFirstOrderResponse200Item] | None: if response.status_code == 200: - response_200 = OptionHistoryTradeGreeksFirstOrderResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionHistoryTradeGreeksFirstOrderResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -96,7 +101,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryTradeGreeksFirstOrderResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionHistoryTradeGreeksFirstOrderResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -120,7 +125,7 @@ def sync_detailed( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryTradeGreeksFirstOrderFormat = OptionHistoryTradeGreeksFirstOrderFormat.JSON, -) -> Response[OptionHistoryTradeGreeksFirstOrderResponse200]: +) -> Response[list[OptionHistoryTradeGreeksFirstOrderResponse200Item]]: """ First Order Trade Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -150,7 +155,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryTradeGreeksFirstOrderResponse200] + Response[list[OptionHistoryTradeGreeksFirstOrderResponse200Item]] """ @@ -190,7 +195,7 @@ def sync( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryTradeGreeksFirstOrderFormat = OptionHistoryTradeGreeksFirstOrderFormat.JSON, -) -> OptionHistoryTradeGreeksFirstOrderResponse200 | None: +) -> list[OptionHistoryTradeGreeksFirstOrderResponse200Item] | None: """ First Order Trade Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -220,7 +225,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryTradeGreeksFirstOrderResponse200 + list[OptionHistoryTradeGreeksFirstOrderResponse200Item] """ @@ -255,7 +260,7 @@ async def asyncio_detailed( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryTradeGreeksFirstOrderFormat = OptionHistoryTradeGreeksFirstOrderFormat.JSON, -) -> Response[OptionHistoryTradeGreeksFirstOrderResponse200]: +) -> Response[list[OptionHistoryTradeGreeksFirstOrderResponse200Item]]: """ First Order Trade Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -285,7 +290,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryTradeGreeksFirstOrderResponse200] + Response[list[OptionHistoryTradeGreeksFirstOrderResponse200Item]] """ @@ -325,7 +330,7 @@ async def asyncio( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryTradeGreeksFirstOrderFormat = OptionHistoryTradeGreeksFirstOrderFormat.JSON, -) -> OptionHistoryTradeGreeksFirstOrderResponse200 | None: +) -> list[OptionHistoryTradeGreeksFirstOrderResponse200Item] | None: """ First Order Trade Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -355,7 +360,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryTradeGreeksFirstOrderResponse200 + list[OptionHistoryTradeGreeksFirstOrderResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_history_trade_greeks_implied_volatility.py b/openapi_project/openapi_package/api/option/option_history_trade_greeks_implied_volatility.py index 08be8e094..c56843bae 100644 --- a/openapi_project/openapi_package/api/option/option_history_trade_greeks_implied_volatility.py +++ b/openapi_project/openapi_package/api/option/option_history_trade_greeks_implied_volatility.py @@ -9,7 +9,7 @@ from openapi_project.openapi_package.models.option_history_trade_greeks_implied_volatility_format import OptionHistoryTradeGreeksImpliedVolatilityFormat from openapi_project.openapi_package.models.option_history_trade_greeks_implied_volatility_rate_type import OptionHistoryTradeGreeksImpliedVolatilityRateType -from openapi_project.openapi_package.models.option_history_trade_greeks_implied_volatility_response_200 import OptionHistoryTradeGreeksImpliedVolatilityResponse200 +from openapi_project.openapi_package.models.option_history_trade_greeks_implied_volatility_response_200_item import OptionHistoryTradeGreeksImpliedVolatilityResponse200Item from openapi_project.openapi_package.models.option_history_trade_greeks_implied_volatility_right import OptionHistoryTradeGreeksImpliedVolatilityRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -83,12 +83,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryTradeGreeksImpliedVolatilityResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionHistoryTradeGreeksImpliedVolatilityResponse200Item] | None: if response.status_code == 200: - response_200 = OptionHistoryTradeGreeksImpliedVolatilityResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionHistoryTradeGreeksImpliedVolatilityResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -96,7 +101,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryTradeGreeksImpliedVolatilityResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionHistoryTradeGreeksImpliedVolatilityResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -120,7 +125,7 @@ def sync_detailed( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryTradeGreeksImpliedVolatilityFormat = OptionHistoryTradeGreeksImpliedVolatilityFormat.JSON, -) -> Response[OptionHistoryTradeGreeksImpliedVolatilityResponse200]: +) -> Response[list[OptionHistoryTradeGreeksImpliedVolatilityResponse200Item]]: """ Trade Implied Volatility - Returns implied volatilies calculated using the trade reported by [OPRA](/Articles/Data-And- @@ -150,7 +155,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryTradeGreeksImpliedVolatilityResponse200] + Response[list[OptionHistoryTradeGreeksImpliedVolatilityResponse200Item]] """ @@ -190,7 +195,7 @@ def sync( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryTradeGreeksImpliedVolatilityFormat = OptionHistoryTradeGreeksImpliedVolatilityFormat.JSON, -) -> OptionHistoryTradeGreeksImpliedVolatilityResponse200 | None: +) -> list[OptionHistoryTradeGreeksImpliedVolatilityResponse200Item] | None: """ Trade Implied Volatility - Returns implied volatilies calculated using the trade reported by [OPRA](/Articles/Data-And- @@ -220,7 +225,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryTradeGreeksImpliedVolatilityResponse200 + list[OptionHistoryTradeGreeksImpliedVolatilityResponse200Item] """ @@ -255,7 +260,7 @@ async def asyncio_detailed( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryTradeGreeksImpliedVolatilityFormat = OptionHistoryTradeGreeksImpliedVolatilityFormat.JSON, -) -> Response[OptionHistoryTradeGreeksImpliedVolatilityResponse200]: +) -> Response[list[OptionHistoryTradeGreeksImpliedVolatilityResponse200Item]]: """ Trade Implied Volatility - Returns implied volatilies calculated using the trade reported by [OPRA](/Articles/Data-And- @@ -285,7 +290,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryTradeGreeksImpliedVolatilityResponse200] + Response[list[OptionHistoryTradeGreeksImpliedVolatilityResponse200Item]] """ @@ -325,7 +330,7 @@ async def asyncio( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryTradeGreeksImpliedVolatilityFormat = OptionHistoryTradeGreeksImpliedVolatilityFormat.JSON, -) -> OptionHistoryTradeGreeksImpliedVolatilityResponse200 | None: +) -> list[OptionHistoryTradeGreeksImpliedVolatilityResponse200Item] | None: """ Trade Implied Volatility - Returns implied volatilies calculated using the trade reported by [OPRA](/Articles/Data-And- @@ -355,7 +360,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryTradeGreeksImpliedVolatilityResponse200 + list[OptionHistoryTradeGreeksImpliedVolatilityResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_history_trade_greeks_second_order.py b/openapi_project/openapi_package/api/option/option_history_trade_greeks_second_order.py index e11e000a2..b1f4fdcaf 100644 --- a/openapi_project/openapi_package/api/option/option_history_trade_greeks_second_order.py +++ b/openapi_project/openapi_package/api/option/option_history_trade_greeks_second_order.py @@ -9,7 +9,7 @@ from openapi_project.openapi_package.models.option_history_trade_greeks_second_order_format import OptionHistoryTradeGreeksSecondOrderFormat from openapi_project.openapi_package.models.option_history_trade_greeks_second_order_rate_type import OptionHistoryTradeGreeksSecondOrderRateType -from openapi_project.openapi_package.models.option_history_trade_greeks_second_order_response_200 import OptionHistoryTradeGreeksSecondOrderResponse200 +from openapi_project.openapi_package.models.option_history_trade_greeks_second_order_response_200_item import OptionHistoryTradeGreeksSecondOrderResponse200Item from openapi_project.openapi_package.models.option_history_trade_greeks_second_order_right import OptionHistoryTradeGreeksSecondOrderRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -83,12 +83,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryTradeGreeksSecondOrderResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionHistoryTradeGreeksSecondOrderResponse200Item] | None: if response.status_code == 200: - response_200 = OptionHistoryTradeGreeksSecondOrderResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionHistoryTradeGreeksSecondOrderResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -96,7 +101,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryTradeGreeksSecondOrderResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionHistoryTradeGreeksSecondOrderResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -120,7 +125,7 @@ def sync_detailed( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryTradeGreeksSecondOrderFormat = OptionHistoryTradeGreeksSecondOrderFormat.JSON, -) -> Response[OptionHistoryTradeGreeksSecondOrderResponse200]: +) -> Response[list[OptionHistoryTradeGreeksSecondOrderResponse200Item]]: """ Second Order Trade Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -150,7 +155,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryTradeGreeksSecondOrderResponse200] + Response[list[OptionHistoryTradeGreeksSecondOrderResponse200Item]] """ @@ -190,7 +195,7 @@ def sync( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryTradeGreeksSecondOrderFormat = OptionHistoryTradeGreeksSecondOrderFormat.JSON, -) -> OptionHistoryTradeGreeksSecondOrderResponse200 | None: +) -> list[OptionHistoryTradeGreeksSecondOrderResponse200Item] | None: """ Second Order Trade Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -220,7 +225,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryTradeGreeksSecondOrderResponse200 + list[OptionHistoryTradeGreeksSecondOrderResponse200Item] """ @@ -255,7 +260,7 @@ async def asyncio_detailed( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryTradeGreeksSecondOrderFormat = OptionHistoryTradeGreeksSecondOrderFormat.JSON, -) -> Response[OptionHistoryTradeGreeksSecondOrderResponse200]: +) -> Response[list[OptionHistoryTradeGreeksSecondOrderResponse200Item]]: """ Second Order Trade Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -285,7 +290,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryTradeGreeksSecondOrderResponse200] + Response[list[OptionHistoryTradeGreeksSecondOrderResponse200Item]] """ @@ -325,7 +330,7 @@ async def asyncio( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryTradeGreeksSecondOrderFormat = OptionHistoryTradeGreeksSecondOrderFormat.JSON, -) -> OptionHistoryTradeGreeksSecondOrderResponse200 | None: +) -> list[OptionHistoryTradeGreeksSecondOrderResponse200Item] | None: """ Second Order Trade Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -355,7 +360,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryTradeGreeksSecondOrderResponse200 + list[OptionHistoryTradeGreeksSecondOrderResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_history_trade_greeks_third_order.py b/openapi_project/openapi_package/api/option/option_history_trade_greeks_third_order.py index e6578860d..75676576f 100644 --- a/openapi_project/openapi_package/api/option/option_history_trade_greeks_third_order.py +++ b/openapi_project/openapi_package/api/option/option_history_trade_greeks_third_order.py @@ -9,7 +9,7 @@ from openapi_project.openapi_package.models.option_history_trade_greeks_third_order_format import OptionHistoryTradeGreeksThirdOrderFormat from openapi_project.openapi_package.models.option_history_trade_greeks_third_order_rate_type import OptionHistoryTradeGreeksThirdOrderRateType -from openapi_project.openapi_package.models.option_history_trade_greeks_third_order_response_200 import OptionHistoryTradeGreeksThirdOrderResponse200 +from openapi_project.openapi_package.models.option_history_trade_greeks_third_order_response_200_item import OptionHistoryTradeGreeksThirdOrderResponse200Item from openapi_project.openapi_package.models.option_history_trade_greeks_third_order_right import OptionHistoryTradeGreeksThirdOrderRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -83,12 +83,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryTradeGreeksThirdOrderResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionHistoryTradeGreeksThirdOrderResponse200Item] | None: if response.status_code == 200: - response_200 = OptionHistoryTradeGreeksThirdOrderResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionHistoryTradeGreeksThirdOrderResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -96,7 +101,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryTradeGreeksThirdOrderResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionHistoryTradeGreeksThirdOrderResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -120,7 +125,7 @@ def sync_detailed( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryTradeGreeksThirdOrderFormat = OptionHistoryTradeGreeksThirdOrderFormat.JSON, -) -> Response[OptionHistoryTradeGreeksThirdOrderResponse200]: +) -> Response[list[OptionHistoryTradeGreeksThirdOrderResponse200Item]]: """ Third Order Trade Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -150,7 +155,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryTradeGreeksThirdOrderResponse200] + Response[list[OptionHistoryTradeGreeksThirdOrderResponse200Item]] """ @@ -190,7 +195,7 @@ def sync( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryTradeGreeksThirdOrderFormat = OptionHistoryTradeGreeksThirdOrderFormat.JSON, -) -> OptionHistoryTradeGreeksThirdOrderResponse200 | None: +) -> list[OptionHistoryTradeGreeksThirdOrderResponse200Item] | None: """ Third Order Trade Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -220,7 +225,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryTradeGreeksThirdOrderResponse200 + list[OptionHistoryTradeGreeksThirdOrderResponse200Item] """ @@ -255,7 +260,7 @@ async def asyncio_detailed( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryTradeGreeksThirdOrderFormat = OptionHistoryTradeGreeksThirdOrderFormat.JSON, -) -> Response[OptionHistoryTradeGreeksThirdOrderResponse200]: +) -> Response[list[OptionHistoryTradeGreeksThirdOrderResponse200Item]]: """ Third Order Trade Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -285,7 +290,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryTradeGreeksThirdOrderResponse200] + Response[list[OptionHistoryTradeGreeksThirdOrderResponse200Item]] """ @@ -325,7 +330,7 @@ async def asyncio( rate_value: Unset | float = UNSET, format_: Unset | OptionHistoryTradeGreeksThirdOrderFormat = OptionHistoryTradeGreeksThirdOrderFormat.JSON, -) -> OptionHistoryTradeGreeksThirdOrderResponse200 | None: +) -> list[OptionHistoryTradeGreeksThirdOrderResponse200Item] | None: """ Third Order Trade Greeks - Returns the data for all contracts that share the same provided symbol and expiration. @@ -355,7 +360,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryTradeGreeksThirdOrderResponse200 + list[OptionHistoryTradeGreeksThirdOrderResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_history_trade_quote.py b/openapi_project/openapi_package/api/option/option_history_trade_quote.py index 0199e3212..a57a349d3 100644 --- a/openapi_project/openapi_package/api/option/option_history_trade_quote.py +++ b/openapi_project/openapi_package/api/option/option_history_trade_quote.py @@ -8,7 +8,7 @@ from openapi_project.openapi_package import errors from openapi_project.openapi_package.models.option_history_trade_quote_format import OptionHistoryTradeQuoteFormat -from openapi_project.openapi_package.models.option_history_trade_quote_response_200 import OptionHistoryTradeQuoteResponse200 +from openapi_project.openapi_package.models.option_history_trade_quote_response_200_item import OptionHistoryTradeQuoteResponse200Item from openapi_project.openapi_package.models.option_history_trade_quote_right import OptionHistoryTradeQuoteRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -74,12 +74,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionHistoryTradeQuoteResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionHistoryTradeQuoteResponse200Item] | None: if response.status_code == 200: - response_200 = OptionHistoryTradeQuoteResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionHistoryTradeQuoteResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -87,7 +92,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionHistoryTradeQuoteResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionHistoryTradeQuoteResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -109,7 +114,7 @@ def sync_detailed( exclusive: Unset | bool = True, format_: Unset | OptionHistoryTradeQuoteFormat = OptionHistoryTradeQuoteFormat.JSON, -) -> Response[OptionHistoryTradeQuoteResponse200]: +) -> Response[list[OptionHistoryTradeQuoteResponse200Item]]: """ Trade Quote - Returns every [trade](/operations/option_history_trade.html) reported by [OPRA](/Articles/Data- @@ -137,7 +142,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryTradeQuoteResponse200] + Response[list[OptionHistoryTradeQuoteResponse200Item]] """ @@ -173,7 +178,7 @@ def sync( exclusive: Unset | bool = True, format_: Unset | OptionHistoryTradeQuoteFormat = OptionHistoryTradeQuoteFormat.JSON, -) -> OptionHistoryTradeQuoteResponse200 | None: +) -> list[OptionHistoryTradeQuoteResponse200Item] | None: """ Trade Quote - Returns every [trade](/operations/option_history_trade.html) reported by [OPRA](/Articles/Data- @@ -201,7 +206,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryTradeQuoteResponse200 + list[OptionHistoryTradeQuoteResponse200Item] """ @@ -232,7 +237,7 @@ async def asyncio_detailed( exclusive: Unset | bool = True, format_: Unset | OptionHistoryTradeQuoteFormat = OptionHistoryTradeQuoteFormat.JSON, -) -> Response[OptionHistoryTradeQuoteResponse200]: +) -> Response[list[OptionHistoryTradeQuoteResponse200Item]]: """ Trade Quote - Returns every [trade](/operations/option_history_trade.html) reported by [OPRA](/Articles/Data- @@ -260,7 +265,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionHistoryTradeQuoteResponse200] + Response[list[OptionHistoryTradeQuoteResponse200Item]] """ @@ -296,7 +301,7 @@ async def asyncio( exclusive: Unset | bool = True, format_: Unset | OptionHistoryTradeQuoteFormat = OptionHistoryTradeQuoteFormat.JSON, -) -> OptionHistoryTradeQuoteResponse200 | None: +) -> list[OptionHistoryTradeQuoteResponse200Item] | None: """ Trade Quote - Returns every [trade](/operations/option_history_trade.html) reported by [OPRA](/Articles/Data- @@ -324,7 +329,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionHistoryTradeQuoteResponse200 + list[OptionHistoryTradeQuoteResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_list_contracts.py b/openapi_project/openapi_package/api/option/option_list_contracts.py index a1f5ddabc..a8ca6c498 100644 --- a/openapi_project/openapi_package/api/option/option_list_contracts.py +++ b/openapi_project/openapi_package/api/option/option_list_contracts.py @@ -9,7 +9,7 @@ from openapi_project.openapi_package.models.option_list_contracts_format import OptionListContractsFormat from openapi_project.openapi_package.models.option_list_contracts_request_type import OptionListContractsRequestType -from openapi_project.openapi_package.models.option_list_contracts_response_200 import OptionListContractsResponse200 +from openapi_project.openapi_package.models.option_list_contracts_response_200_item import OptionListContractsResponse200Item from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse from typing import cast @@ -59,12 +59,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionListContractsResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionListContractsResponse200Item] | None: if response.status_code == 200: - response_200 = OptionListContractsResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionListContractsResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -72,7 +77,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionListContractsResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionListContractsResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -89,7 +94,7 @@ def sync_detailed( date: datetime.date, format_: Unset | OptionListContractsFormat = OptionListContractsFormat.JSON, -) -> Response[OptionListContractsResponse200]: +) -> Response[list[OptionListContractsResponse200Item]]: """ Contracts Lists all contracts that were traded or quoted on a particular date. @@ -110,7 +115,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionListContractsResponse200] + Response[list[OptionListContractsResponse200Item]] """ @@ -136,7 +141,7 @@ def sync( date: datetime.date, format_: Unset | OptionListContractsFormat = OptionListContractsFormat.JSON, -) -> OptionListContractsResponse200 | None: +) -> list[OptionListContractsResponse200Item] | None: """ Contracts Lists all contracts that were traded or quoted on a particular date. @@ -157,7 +162,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionListContractsResponse200 + list[OptionListContractsResponse200Item] """ @@ -178,7 +183,7 @@ async def asyncio_detailed( date: datetime.date, format_: Unset | OptionListContractsFormat = OptionListContractsFormat.JSON, -) -> Response[OptionListContractsResponse200]: +) -> Response[list[OptionListContractsResponse200Item]]: """ Contracts Lists all contracts that were traded or quoted on a particular date. @@ -199,7 +204,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionListContractsResponse200] + Response[list[OptionListContractsResponse200Item]] """ @@ -225,7 +230,7 @@ async def asyncio( date: datetime.date, format_: Unset | OptionListContractsFormat = OptionListContractsFormat.JSON, -) -> OptionListContractsResponse200 | None: +) -> list[OptionListContractsResponse200Item] | None: """ Contracts Lists all contracts that were traded or quoted on a particular date. @@ -246,7 +251,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionListContractsResponse200 + list[OptionListContractsResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_list_dates.py b/openapi_project/openapi_package/api/option/option_list_dates.py index 9d4c3746f..b29cbe385 100644 --- a/openapi_project/openapi_package/api/option/option_list_dates.py +++ b/openapi_project/openapi_package/api/option/option_list_dates.py @@ -9,7 +9,7 @@ from openapi_project.openapi_package.models.option_list_dates_format import OptionListDatesFormat from openapi_project.openapi_package.models.option_list_dates_request_type import OptionListDatesRequestType -from openapi_project.openapi_package.models.option_list_dates_response_200 import OptionListDatesResponse200 +from openapi_project.openapi_package.models.option_list_dates_response_200_item import OptionListDatesResponse200Item from openapi_project.openapi_package.models.option_list_dates_right import OptionListDatesRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -63,12 +63,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionListDatesResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionListDatesResponse200Item] | None: if response.status_code == 200: - response_200 = OptionListDatesResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionListDatesResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -76,7 +81,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionListDatesResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionListDatesResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -95,7 +100,7 @@ def sync_detailed( right: Unset | OptionListDatesRight = OptionListDatesRight.BOTH, format_: Unset | OptionListDatesFormat = OptionListDatesFormat.JSON, -) -> Response[OptionListDatesResponse200]: +) -> Response[list[OptionListDatesResponse200Item]]: """ Dates Lists all dates of data that are available for an option with a given symbol, request type, and @@ -115,7 +120,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionListDatesResponse200] + Response[list[OptionListDatesResponse200Item]] """ @@ -145,7 +150,7 @@ def sync( right: Unset | OptionListDatesRight = OptionListDatesRight.BOTH, format_: Unset | OptionListDatesFormat = OptionListDatesFormat.JSON, -) -> OptionListDatesResponse200 | None: +) -> list[OptionListDatesResponse200Item] | None: """ Dates Lists all dates of data that are available for an option with a given symbol, request type, and @@ -165,7 +170,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionListDatesResponse200 + list[OptionListDatesResponse200Item] """ @@ -190,7 +195,7 @@ async def asyncio_detailed( right: Unset | OptionListDatesRight = OptionListDatesRight.BOTH, format_: Unset | OptionListDatesFormat = OptionListDatesFormat.JSON, -) -> Response[OptionListDatesResponse200]: +) -> Response[list[OptionListDatesResponse200Item]]: """ Dates Lists all dates of data that are available for an option with a given symbol, request type, and @@ -210,7 +215,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionListDatesResponse200] + Response[list[OptionListDatesResponse200Item]] """ @@ -240,7 +245,7 @@ async def asyncio( right: Unset | OptionListDatesRight = OptionListDatesRight.BOTH, format_: Unset | OptionListDatesFormat = OptionListDatesFormat.JSON, -) -> OptionListDatesResponse200 | None: +) -> list[OptionListDatesResponse200Item] | None: """ Dates Lists all dates of data that are available for an option with a given symbol, request type, and @@ -260,7 +265,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionListDatesResponse200 + list[OptionListDatesResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_list_expirations.py b/openapi_project/openapi_package/api/option/option_list_expirations.py index 9a7e7f6ae..ab67245d3 100644 --- a/openapi_project/openapi_package/api/option/option_list_expirations.py +++ b/openapi_project/openapi_package/api/option/option_list_expirations.py @@ -8,7 +8,7 @@ from openapi_project.openapi_package import errors from openapi_project.openapi_package.models.option_list_expirations_format import OptionListExpirationsFormat -from openapi_project.openapi_package.models.option_list_expirations_response_200 import OptionListExpirationsResponse200 +from openapi_project.openapi_package.models.option_list_expirations_response_200_item import OptionListExpirationsResponse200Item from openapi_project.openapi_package.types import UNSET, Unset from typing import cast @@ -49,12 +49,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionListExpirationsResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionListExpirationsResponse200Item] | None: if response.status_code == 200: - response_200 = OptionListExpirationsResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionListExpirationsResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -62,7 +67,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionListExpirationsResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionListExpirationsResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -77,7 +82,7 @@ def sync_detailed( symbol: list[str], format_: Unset | OptionListExpirationsFormat = OptionListExpirationsFormat.JSON, -) -> Response[OptionListExpirationsResponse200]: +) -> Response[list[OptionListExpirationsResponse200Item]]: """ Expirations Lists all dates of expirations that are available for an option with a given symbol. @@ -92,7 +97,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionListExpirationsResponse200] + Response[list[OptionListExpirationsResponse200Item]] """ @@ -114,7 +119,7 @@ def sync( symbol: list[str], format_: Unset | OptionListExpirationsFormat = OptionListExpirationsFormat.JSON, -) -> OptionListExpirationsResponse200 | None: +) -> list[OptionListExpirationsResponse200Item] | None: """ Expirations Lists all dates of expirations that are available for an option with a given symbol. @@ -129,7 +134,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionListExpirationsResponse200 + list[OptionListExpirationsResponse200Item] """ @@ -146,7 +151,7 @@ async def asyncio_detailed( symbol: list[str], format_: Unset | OptionListExpirationsFormat = OptionListExpirationsFormat.JSON, -) -> Response[OptionListExpirationsResponse200]: +) -> Response[list[OptionListExpirationsResponse200Item]]: """ Expirations Lists all dates of expirations that are available for an option with a given symbol. @@ -161,7 +166,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionListExpirationsResponse200] + Response[list[OptionListExpirationsResponse200Item]] """ @@ -183,7 +188,7 @@ async def asyncio( symbol: list[str], format_: Unset | OptionListExpirationsFormat = OptionListExpirationsFormat.JSON, -) -> OptionListExpirationsResponse200 | None: +) -> list[OptionListExpirationsResponse200Item] | None: """ Expirations Lists all dates of expirations that are available for an option with a given symbol. @@ -198,7 +203,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionListExpirationsResponse200 + list[OptionListExpirationsResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_list_strikes.py b/openapi_project/openapi_package/api/option/option_list_strikes.py index bdaa52455..fd0ccd1ae 100644 --- a/openapi_project/openapi_package/api/option/option_list_strikes.py +++ b/openapi_project/openapi_package/api/option/option_list_strikes.py @@ -8,7 +8,7 @@ from openapi_project.openapi_package import errors from openapi_project.openapi_package.models.option_list_strikes_format import OptionListStrikesFormat -from openapi_project.openapi_package.models.option_list_strikes_response_200 import OptionListStrikesResponse200 +from openapi_project.openapi_package.models.option_list_strikes_response_200_item import OptionListStrikesResponse200Item from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse from typing import cast @@ -55,12 +55,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionListStrikesResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionListStrikesResponse200Item] | None: if response.status_code == 200: - response_200 = OptionListStrikesResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionListStrikesResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -68,7 +73,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionListStrikesResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionListStrikesResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -84,7 +89,7 @@ def sync_detailed( expiration: datetime.date, format_: Unset | OptionListStrikesFormat = OptionListStrikesFormat.JSON, -) -> Response[OptionListStrikesResponse200]: +) -> Response[list[OptionListStrikesResponse200Item]]: """ Strikes Lists all strikes that are available for an option with a given symbol and expiration date. @@ -100,7 +105,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionListStrikesResponse200] + Response[list[OptionListStrikesResponse200Item]] """ @@ -124,7 +129,7 @@ def sync( expiration: datetime.date, format_: Unset | OptionListStrikesFormat = OptionListStrikesFormat.JSON, -) -> OptionListStrikesResponse200 | None: +) -> list[OptionListStrikesResponse200Item] | None: """ Strikes Lists all strikes that are available for an option with a given symbol and expiration date. @@ -140,7 +145,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionListStrikesResponse200 + list[OptionListStrikesResponse200Item] """ @@ -159,7 +164,7 @@ async def asyncio_detailed( expiration: datetime.date, format_: Unset | OptionListStrikesFormat = OptionListStrikesFormat.JSON, -) -> Response[OptionListStrikesResponse200]: +) -> Response[list[OptionListStrikesResponse200Item]]: """ Strikes Lists all strikes that are available for an option with a given symbol and expiration date. @@ -175,7 +180,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionListStrikesResponse200] + Response[list[OptionListStrikesResponse200Item]] """ @@ -199,7 +204,7 @@ async def asyncio( expiration: datetime.date, format_: Unset | OptionListStrikesFormat = OptionListStrikesFormat.JSON, -) -> OptionListStrikesResponse200 | None: +) -> list[OptionListStrikesResponse200Item] | None: """ Strikes Lists all strikes that are available for an option with a given symbol and expiration date. @@ -215,7 +220,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionListStrikesResponse200 + list[OptionListStrikesResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_list_symbols.py b/openapi_project/openapi_package/api/option/option_list_symbols.py index 95acca7d4..ca38b1699 100644 --- a/openapi_project/openapi_package/api/option/option_list_symbols.py +++ b/openapi_project/openapi_package/api/option/option_list_symbols.py @@ -8,7 +8,7 @@ from openapi_project.openapi_package import errors from openapi_project.openapi_package.models.option_list_symbols_format import OptionListSymbolsFormat -from openapi_project.openapi_package.models.option_list_symbols_response_200 import OptionListSymbolsResponse200 +from openapi_project.openapi_package.models.option_list_symbols_response_200_item import OptionListSymbolsResponse200Item from openapi_project.openapi_package.types import UNSET, Unset from typing import cast @@ -43,12 +43,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionListSymbolsResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionListSymbolsResponse200Item] | None: if response.status_code == 200: - response_200 = OptionListSymbolsResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionListSymbolsResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -56,7 +61,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionListSymbolsResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionListSymbolsResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,7 +75,7 @@ def sync_detailed( client: AuthenticatedClient | Client, format_: Unset | OptionListSymbolsFormat = OptionListSymbolsFormat.JSON, -) -> Response[OptionListSymbolsResponse200]: +) -> Response[list[OptionListSymbolsResponse200Item]]: """ Symbols A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also @@ -85,7 +90,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionListSymbolsResponse200] + Response[list[OptionListSymbolsResponse200Item]] """ @@ -105,7 +110,7 @@ def sync( client: AuthenticatedClient | Client, format_: Unset | OptionListSymbolsFormat = OptionListSymbolsFormat.JSON, -) -> OptionListSymbolsResponse200 | None: +) -> list[OptionListSymbolsResponse200Item] | None: """ Symbols A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also @@ -120,7 +125,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionListSymbolsResponse200 + list[OptionListSymbolsResponse200Item] """ @@ -135,7 +140,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, format_: Unset | OptionListSymbolsFormat = OptionListSymbolsFormat.JSON, -) -> Response[OptionListSymbolsResponse200]: +) -> Response[list[OptionListSymbolsResponse200Item]]: """ Symbols A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also @@ -150,7 +155,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionListSymbolsResponse200] + Response[list[OptionListSymbolsResponse200Item]] """ @@ -170,7 +175,7 @@ async def asyncio( client: AuthenticatedClient | Client, format_: Unset | OptionListSymbolsFormat = OptionListSymbolsFormat.JSON, -) -> OptionListSymbolsResponse200 | None: +) -> list[OptionListSymbolsResponse200Item] | None: """ Symbols A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also @@ -185,7 +190,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionListSymbolsResponse200 + list[OptionListSymbolsResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_snapshot_greeks_all.py b/openapi_project/openapi_package/api/option/option_snapshot_greeks_all.py index 1bd58fd7d..58ff27b7e 100644 --- a/openapi_project/openapi_package/api/option/option_snapshot_greeks_all.py +++ b/openapi_project/openapi_package/api/option/option_snapshot_greeks_all.py @@ -9,7 +9,7 @@ from openapi_project.openapi_package.models.option_snapshot_greeks_all_format import OptionSnapshotGreeksAllFormat from openapi_project.openapi_package.models.option_snapshot_greeks_all_rate_type import OptionSnapshotGreeksAllRateType -from openapi_project.openapi_package.models.option_snapshot_greeks_all_response_200 import OptionSnapshotGreeksAllResponse200 +from openapi_project.openapi_package.models.option_snapshot_greeks_all_response_200_item import OptionSnapshotGreeksAllResponse200Item from openapi_project.openapi_package.models.option_snapshot_greeks_all_right import OptionSnapshotGreeksAllRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -76,12 +76,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionSnapshotGreeksAllResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionSnapshotGreeksAllResponse200Item] | None: if response.status_code == 200: - response_200 = OptionSnapshotGreeksAllResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionSnapshotGreeksAllResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -89,7 +94,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionSnapshotGreeksAllResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionSnapshotGreeksAllResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -111,7 +116,7 @@ def sync_detailed( stock_price: Unset | float = UNSET, format_: Unset | OptionSnapshotGreeksAllFormat = OptionSnapshotGreeksAllFormat.JSON, -) -> Response[OptionSnapshotGreeksAllResponse200]: +) -> Response[list[OptionSnapshotGreeksAllResponse200Item]]: """ All Greeks - Retrieve a real-time last greeks calculation for all option contracts that lie on a provided @@ -140,7 +145,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionSnapshotGreeksAllResponse200] + Response[list[OptionSnapshotGreeksAllResponse200Item]] """ @@ -176,7 +181,7 @@ def sync( stock_price: Unset | float = UNSET, format_: Unset | OptionSnapshotGreeksAllFormat = OptionSnapshotGreeksAllFormat.JSON, -) -> OptionSnapshotGreeksAllResponse200 | None: +) -> list[OptionSnapshotGreeksAllResponse200Item] | None: """ All Greeks - Retrieve a real-time last greeks calculation for all option contracts that lie on a provided @@ -205,7 +210,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionSnapshotGreeksAllResponse200 + list[OptionSnapshotGreeksAllResponse200Item] """ @@ -236,7 +241,7 @@ async def asyncio_detailed( stock_price: Unset | float = UNSET, format_: Unset | OptionSnapshotGreeksAllFormat = OptionSnapshotGreeksAllFormat.JSON, -) -> Response[OptionSnapshotGreeksAllResponse200]: +) -> Response[list[OptionSnapshotGreeksAllResponse200Item]]: """ All Greeks - Retrieve a real-time last greeks calculation for all option contracts that lie on a provided @@ -265,7 +270,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionSnapshotGreeksAllResponse200] + Response[list[OptionSnapshotGreeksAllResponse200Item]] """ @@ -301,7 +306,7 @@ async def asyncio( stock_price: Unset | float = UNSET, format_: Unset | OptionSnapshotGreeksAllFormat = OptionSnapshotGreeksAllFormat.JSON, -) -> OptionSnapshotGreeksAllResponse200 | None: +) -> list[OptionSnapshotGreeksAllResponse200Item] | None: """ All Greeks - Retrieve a real-time last greeks calculation for all option contracts that lie on a provided @@ -330,7 +335,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionSnapshotGreeksAllResponse200 + list[OptionSnapshotGreeksAllResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_snapshot_greeks_first_order.py b/openapi_project/openapi_package/api/option/option_snapshot_greeks_first_order.py index 5d74cd9c6..573c2cf11 100644 --- a/openapi_project/openapi_package/api/option/option_snapshot_greeks_first_order.py +++ b/openapi_project/openapi_package/api/option/option_snapshot_greeks_first_order.py @@ -9,7 +9,7 @@ from openapi_project.openapi_package.models.option_snapshot_greeks_first_order_format import OptionSnapshotGreeksFirstOrderFormat from openapi_project.openapi_package.models.option_snapshot_greeks_first_order_rate_type import OptionSnapshotGreeksFirstOrderRateType -from openapi_project.openapi_package.models.option_snapshot_greeks_first_order_response_200 import OptionSnapshotGreeksFirstOrderResponse200 +from openapi_project.openapi_package.models.option_snapshot_greeks_first_order_response_200_item import OptionSnapshotGreeksFirstOrderResponse200Item from openapi_project.openapi_package.models.option_snapshot_greeks_first_order_right import OptionSnapshotGreeksFirstOrderRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -76,12 +76,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionSnapshotGreeksFirstOrderResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionSnapshotGreeksFirstOrderResponse200Item] | None: if response.status_code == 200: - response_200 = OptionSnapshotGreeksFirstOrderResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionSnapshotGreeksFirstOrderResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -89,7 +94,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionSnapshotGreeksFirstOrderResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionSnapshotGreeksFirstOrderResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -111,7 +116,7 @@ def sync_detailed( stock_price: Unset | float = UNSET, format_: Unset | OptionSnapshotGreeksFirstOrderFormat = OptionSnapshotGreeksFirstOrderFormat.JSON, -) -> Response[OptionSnapshotGreeksFirstOrderResponse200]: +) -> Response[list[OptionSnapshotGreeksFirstOrderResponse200Item]]: """ First Order Greeks - Retrieve a real-time last greeks calculation for all option contracts that lie on a provided @@ -141,7 +146,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionSnapshotGreeksFirstOrderResponse200] + Response[list[OptionSnapshotGreeksFirstOrderResponse200Item]] """ @@ -177,7 +182,7 @@ def sync( stock_price: Unset | float = UNSET, format_: Unset | OptionSnapshotGreeksFirstOrderFormat = OptionSnapshotGreeksFirstOrderFormat.JSON, -) -> OptionSnapshotGreeksFirstOrderResponse200 | None: +) -> list[OptionSnapshotGreeksFirstOrderResponse200Item] | None: """ First Order Greeks - Retrieve a real-time last greeks calculation for all option contracts that lie on a provided @@ -207,7 +212,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionSnapshotGreeksFirstOrderResponse200 + list[OptionSnapshotGreeksFirstOrderResponse200Item] """ @@ -238,7 +243,7 @@ async def asyncio_detailed( stock_price: Unset | float = UNSET, format_: Unset | OptionSnapshotGreeksFirstOrderFormat = OptionSnapshotGreeksFirstOrderFormat.JSON, -) -> Response[OptionSnapshotGreeksFirstOrderResponse200]: +) -> Response[list[OptionSnapshotGreeksFirstOrderResponse200Item]]: """ First Order Greeks - Retrieve a real-time last greeks calculation for all option contracts that lie on a provided @@ -268,7 +273,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionSnapshotGreeksFirstOrderResponse200] + Response[list[OptionSnapshotGreeksFirstOrderResponse200Item]] """ @@ -304,7 +309,7 @@ async def asyncio( stock_price: Unset | float = UNSET, format_: Unset | OptionSnapshotGreeksFirstOrderFormat = OptionSnapshotGreeksFirstOrderFormat.JSON, -) -> OptionSnapshotGreeksFirstOrderResponse200 | None: +) -> list[OptionSnapshotGreeksFirstOrderResponse200Item] | None: """ First Order Greeks - Retrieve a real-time last greeks calculation for all option contracts that lie on a provided @@ -334,7 +339,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionSnapshotGreeksFirstOrderResponse200 + list[OptionSnapshotGreeksFirstOrderResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_snapshot_greeks_implied_volatility.py b/openapi_project/openapi_package/api/option/option_snapshot_greeks_implied_volatility.py index d80fff35c..a860d41a6 100644 --- a/openapi_project/openapi_package/api/option/option_snapshot_greeks_implied_volatility.py +++ b/openapi_project/openapi_package/api/option/option_snapshot_greeks_implied_volatility.py @@ -9,7 +9,7 @@ from openapi_project.openapi_package.models.option_snapshot_greeks_implied_volatility_format import OptionSnapshotGreeksImpliedVolatilityFormat from openapi_project.openapi_package.models.option_snapshot_greeks_implied_volatility_rate_type import OptionSnapshotGreeksImpliedVolatilityRateType -from openapi_project.openapi_package.models.option_snapshot_greeks_implied_volatility_response_200 import OptionSnapshotGreeksImpliedVolatilityResponse200 +from openapi_project.openapi_package.models.option_snapshot_greeks_implied_volatility_response_200_item import OptionSnapshotGreeksImpliedVolatilityResponse200Item from openapi_project.openapi_package.models.option_snapshot_greeks_implied_volatility_right import OptionSnapshotGreeksImpliedVolatilityRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -76,12 +76,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionSnapshotGreeksImpliedVolatilityResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionSnapshotGreeksImpliedVolatilityResponse200Item] | None: if response.status_code == 200: - response_200 = OptionSnapshotGreeksImpliedVolatilityResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionSnapshotGreeksImpliedVolatilityResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -89,7 +94,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionSnapshotGreeksImpliedVolatilityResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionSnapshotGreeksImpliedVolatilityResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -111,7 +116,7 @@ def sync_detailed( stock_price: Unset | float = UNSET, format_: Unset | OptionSnapshotGreeksImpliedVolatilityFormat = OptionSnapshotGreeksImpliedVolatilityFormat.JSON, -) -> Response[OptionSnapshotGreeksImpliedVolatilityResponse200]: +) -> Response[list[OptionSnapshotGreeksImpliedVolatilityResponse200Item]]: """ Implied Volatility Returns implied volatilies calculated using the national best bid, mid, and ask price @@ -139,7 +144,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionSnapshotGreeksImpliedVolatilityResponse200] + Response[list[OptionSnapshotGreeksImpliedVolatilityResponse200Item]] """ @@ -175,7 +180,7 @@ def sync( stock_price: Unset | float = UNSET, format_: Unset | OptionSnapshotGreeksImpliedVolatilityFormat = OptionSnapshotGreeksImpliedVolatilityFormat.JSON, -) -> OptionSnapshotGreeksImpliedVolatilityResponse200 | None: +) -> list[OptionSnapshotGreeksImpliedVolatilityResponse200Item] | None: """ Implied Volatility Returns implied volatilies calculated using the national best bid, mid, and ask price @@ -203,7 +208,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionSnapshotGreeksImpliedVolatilityResponse200 + list[OptionSnapshotGreeksImpliedVolatilityResponse200Item] """ @@ -234,7 +239,7 @@ async def asyncio_detailed( stock_price: Unset | float = UNSET, format_: Unset | OptionSnapshotGreeksImpliedVolatilityFormat = OptionSnapshotGreeksImpliedVolatilityFormat.JSON, -) -> Response[OptionSnapshotGreeksImpliedVolatilityResponse200]: +) -> Response[list[OptionSnapshotGreeksImpliedVolatilityResponse200Item]]: """ Implied Volatility Returns implied volatilies calculated using the national best bid, mid, and ask price @@ -262,7 +267,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionSnapshotGreeksImpliedVolatilityResponse200] + Response[list[OptionSnapshotGreeksImpliedVolatilityResponse200Item]] """ @@ -298,7 +303,7 @@ async def asyncio( stock_price: Unset | float = UNSET, format_: Unset | OptionSnapshotGreeksImpliedVolatilityFormat = OptionSnapshotGreeksImpliedVolatilityFormat.JSON, -) -> OptionSnapshotGreeksImpliedVolatilityResponse200 | None: +) -> list[OptionSnapshotGreeksImpliedVolatilityResponse200Item] | None: """ Implied Volatility Returns implied volatilies calculated using the national best bid, mid, and ask price @@ -326,7 +331,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionSnapshotGreeksImpliedVolatilityResponse200 + list[OptionSnapshotGreeksImpliedVolatilityResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_snapshot_greeks_second_order.py b/openapi_project/openapi_package/api/option/option_snapshot_greeks_second_order.py index 0e70c7035..c52705d30 100644 --- a/openapi_project/openapi_package/api/option/option_snapshot_greeks_second_order.py +++ b/openapi_project/openapi_package/api/option/option_snapshot_greeks_second_order.py @@ -9,7 +9,7 @@ from openapi_project.openapi_package.models.option_snapshot_greeks_second_order_format import OptionSnapshotGreeksSecondOrderFormat from openapi_project.openapi_package.models.option_snapshot_greeks_second_order_rate_type import OptionSnapshotGreeksSecondOrderRateType -from openapi_project.openapi_package.models.option_snapshot_greeks_second_order_response_200 import OptionSnapshotGreeksSecondOrderResponse200 +from openapi_project.openapi_package.models.option_snapshot_greeks_second_order_response_200_item import OptionSnapshotGreeksSecondOrderResponse200Item from openapi_project.openapi_package.models.option_snapshot_greeks_second_order_right import OptionSnapshotGreeksSecondOrderRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -76,12 +76,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionSnapshotGreeksSecondOrderResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionSnapshotGreeksSecondOrderResponse200Item] | None: if response.status_code == 200: - response_200 = OptionSnapshotGreeksSecondOrderResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionSnapshotGreeksSecondOrderResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -89,7 +94,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionSnapshotGreeksSecondOrderResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionSnapshotGreeksSecondOrderResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -111,7 +116,7 @@ def sync_detailed( stock_price: Unset | float = UNSET, format_: Unset | OptionSnapshotGreeksSecondOrderFormat = OptionSnapshotGreeksSecondOrderFormat.JSON, -) -> Response[OptionSnapshotGreeksSecondOrderResponse200]: +) -> Response[list[OptionSnapshotGreeksSecondOrderResponse200Item]]: """ Second Order Greeks - Retrieve a real-time last second order greeks calculation for all option contracts that lie on a @@ -141,7 +146,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionSnapshotGreeksSecondOrderResponse200] + Response[list[OptionSnapshotGreeksSecondOrderResponse200Item]] """ @@ -177,7 +182,7 @@ def sync( stock_price: Unset | float = UNSET, format_: Unset | OptionSnapshotGreeksSecondOrderFormat = OptionSnapshotGreeksSecondOrderFormat.JSON, -) -> OptionSnapshotGreeksSecondOrderResponse200 | None: +) -> list[OptionSnapshotGreeksSecondOrderResponse200Item] | None: """ Second Order Greeks - Retrieve a real-time last second order greeks calculation for all option contracts that lie on a @@ -207,7 +212,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionSnapshotGreeksSecondOrderResponse200 + list[OptionSnapshotGreeksSecondOrderResponse200Item] """ @@ -238,7 +243,7 @@ async def asyncio_detailed( stock_price: Unset | float = UNSET, format_: Unset | OptionSnapshotGreeksSecondOrderFormat = OptionSnapshotGreeksSecondOrderFormat.JSON, -) -> Response[OptionSnapshotGreeksSecondOrderResponse200]: +) -> Response[list[OptionSnapshotGreeksSecondOrderResponse200Item]]: """ Second Order Greeks - Retrieve a real-time last second order greeks calculation for all option contracts that lie on a @@ -268,7 +273,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionSnapshotGreeksSecondOrderResponse200] + Response[list[OptionSnapshotGreeksSecondOrderResponse200Item]] """ @@ -304,7 +309,7 @@ async def asyncio( stock_price: Unset | float = UNSET, format_: Unset | OptionSnapshotGreeksSecondOrderFormat = OptionSnapshotGreeksSecondOrderFormat.JSON, -) -> OptionSnapshotGreeksSecondOrderResponse200 | None: +) -> list[OptionSnapshotGreeksSecondOrderResponse200Item] | None: """ Second Order Greeks - Retrieve a real-time last second order greeks calculation for all option contracts that lie on a @@ -334,7 +339,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionSnapshotGreeksSecondOrderResponse200 + list[OptionSnapshotGreeksSecondOrderResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_snapshot_greeks_third_order.py b/openapi_project/openapi_package/api/option/option_snapshot_greeks_third_order.py index 3eb34608d..b29894c51 100644 --- a/openapi_project/openapi_package/api/option/option_snapshot_greeks_third_order.py +++ b/openapi_project/openapi_package/api/option/option_snapshot_greeks_third_order.py @@ -9,7 +9,7 @@ from openapi_project.openapi_package.models.option_snapshot_greeks_third_order_format import OptionSnapshotGreeksThirdOrderFormat from openapi_project.openapi_package.models.option_snapshot_greeks_third_order_rate_type import OptionSnapshotGreeksThirdOrderRateType -from openapi_project.openapi_package.models.option_snapshot_greeks_third_order_response_200 import OptionSnapshotGreeksThirdOrderResponse200 +from openapi_project.openapi_package.models.option_snapshot_greeks_third_order_response_200_item import OptionSnapshotGreeksThirdOrderResponse200Item from openapi_project.openapi_package.models.option_snapshot_greeks_third_order_right import OptionSnapshotGreeksThirdOrderRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -76,12 +76,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionSnapshotGreeksThirdOrderResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionSnapshotGreeksThirdOrderResponse200Item] | None: if response.status_code == 200: - response_200 = OptionSnapshotGreeksThirdOrderResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionSnapshotGreeksThirdOrderResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -89,7 +94,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionSnapshotGreeksThirdOrderResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionSnapshotGreeksThirdOrderResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -111,7 +116,7 @@ def sync_detailed( stock_price: Unset | float = UNSET, format_: Unset | OptionSnapshotGreeksThirdOrderFormat = OptionSnapshotGreeksThirdOrderFormat.JSON, -) -> Response[OptionSnapshotGreeksThirdOrderResponse200]: +) -> Response[list[OptionSnapshotGreeksThirdOrderResponse200Item]]: """ Third Order Greeks - Retrieve a real-time last third order greeks calculation for all option contracts that lie on a @@ -141,7 +146,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionSnapshotGreeksThirdOrderResponse200] + Response[list[OptionSnapshotGreeksThirdOrderResponse200Item]] """ @@ -177,7 +182,7 @@ def sync( stock_price: Unset | float = UNSET, format_: Unset | OptionSnapshotGreeksThirdOrderFormat = OptionSnapshotGreeksThirdOrderFormat.JSON, -) -> OptionSnapshotGreeksThirdOrderResponse200 | None: +) -> list[OptionSnapshotGreeksThirdOrderResponse200Item] | None: """ Third Order Greeks - Retrieve a real-time last third order greeks calculation for all option contracts that lie on a @@ -207,7 +212,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionSnapshotGreeksThirdOrderResponse200 + list[OptionSnapshotGreeksThirdOrderResponse200Item] """ @@ -238,7 +243,7 @@ async def asyncio_detailed( stock_price: Unset | float = UNSET, format_: Unset | OptionSnapshotGreeksThirdOrderFormat = OptionSnapshotGreeksThirdOrderFormat.JSON, -) -> Response[OptionSnapshotGreeksThirdOrderResponse200]: +) -> Response[list[OptionSnapshotGreeksThirdOrderResponse200Item]]: """ Third Order Greeks - Retrieve a real-time last third order greeks calculation for all option contracts that lie on a @@ -268,7 +273,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionSnapshotGreeksThirdOrderResponse200] + Response[list[OptionSnapshotGreeksThirdOrderResponse200Item]] """ @@ -304,7 +309,7 @@ async def asyncio( stock_price: Unset | float = UNSET, format_: Unset | OptionSnapshotGreeksThirdOrderFormat = OptionSnapshotGreeksThirdOrderFormat.JSON, -) -> OptionSnapshotGreeksThirdOrderResponse200 | None: +) -> list[OptionSnapshotGreeksThirdOrderResponse200Item] | None: """ Third Order Greeks - Retrieve a real-time last third order greeks calculation for all option contracts that lie on a @@ -334,7 +339,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionSnapshotGreeksThirdOrderResponse200 + list[OptionSnapshotGreeksThirdOrderResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_snapshot_ohlc.py b/openapi_project/openapi_package/api/option/option_snapshot_ohlc.py index 82a7fdad9..ebd270d80 100644 --- a/openapi_project/openapi_package/api/option/option_snapshot_ohlc.py +++ b/openapi_project/openapi_package/api/option/option_snapshot_ohlc.py @@ -8,7 +8,7 @@ from openapi_project.openapi_package import errors from openapi_project.openapi_package.models.option_snapshot_ohlc_format import OptionSnapshotOhlcFormat -from openapi_project.openapi_package.models.option_snapshot_ohlc_response_200 import OptionSnapshotOhlcResponse200 +from openapi_project.openapi_package.models.option_snapshot_ohlc_response_200_item import OptionSnapshotOhlcResponse200Item from openapi_project.openapi_package.models.option_snapshot_ohlc_right import OptionSnapshotOhlcRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -61,12 +61,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionSnapshotOhlcResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionSnapshotOhlcResponse200Item] | None: if response.status_code == 200: - response_200 = OptionSnapshotOhlcResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionSnapshotOhlcResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -74,7 +79,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionSnapshotOhlcResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionSnapshotOhlcResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -92,7 +97,7 @@ def sync_detailed( right: Unset | OptionSnapshotOhlcRight = OptionSnapshotOhlcRight.BOTH, format_: Unset | OptionSnapshotOhlcFormat = OptionSnapshotOhlcFormat.JSON, -) -> Response[OptionSnapshotOhlcResponse200]: +) -> Response[list[OptionSnapshotOhlcResponse200Item]]: """ Open High Low Close - Retrieve a real-time last ohlc of an option contract for the trading day. @@ -111,7 +116,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionSnapshotOhlcResponse200] + Response[list[OptionSnapshotOhlcResponse200Item]] """ @@ -139,7 +144,7 @@ def sync( right: Unset | OptionSnapshotOhlcRight = OptionSnapshotOhlcRight.BOTH, format_: Unset | OptionSnapshotOhlcFormat = OptionSnapshotOhlcFormat.JSON, -) -> OptionSnapshotOhlcResponse200 | None: +) -> list[OptionSnapshotOhlcResponse200Item] | None: """ Open High Low Close - Retrieve a real-time last ohlc of an option contract for the trading day. @@ -158,7 +163,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionSnapshotOhlcResponse200 + list[OptionSnapshotOhlcResponse200Item] """ @@ -181,7 +186,7 @@ async def asyncio_detailed( right: Unset | OptionSnapshotOhlcRight = OptionSnapshotOhlcRight.BOTH, format_: Unset | OptionSnapshotOhlcFormat = OptionSnapshotOhlcFormat.JSON, -) -> Response[OptionSnapshotOhlcResponse200]: +) -> Response[list[OptionSnapshotOhlcResponse200Item]]: """ Open High Low Close - Retrieve a real-time last ohlc of an option contract for the trading day. @@ -200,7 +205,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionSnapshotOhlcResponse200] + Response[list[OptionSnapshotOhlcResponse200Item]] """ @@ -228,7 +233,7 @@ async def asyncio( right: Unset | OptionSnapshotOhlcRight = OptionSnapshotOhlcRight.BOTH, format_: Unset | OptionSnapshotOhlcFormat = OptionSnapshotOhlcFormat.JSON, -) -> OptionSnapshotOhlcResponse200 | None: +) -> list[OptionSnapshotOhlcResponse200Item] | None: """ Open High Low Close - Retrieve a real-time last ohlc of an option contract for the trading day. @@ -247,7 +252,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionSnapshotOhlcResponse200 + list[OptionSnapshotOhlcResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_snapshot_open_interest.py b/openapi_project/openapi_package/api/option/option_snapshot_open_interest.py index 419888c2a..66aad216a 100644 --- a/openapi_project/openapi_package/api/option/option_snapshot_open_interest.py +++ b/openapi_project/openapi_package/api/option/option_snapshot_open_interest.py @@ -8,7 +8,7 @@ from openapi_project.openapi_package import errors from openapi_project.openapi_package.models.option_snapshot_open_interest_format import OptionSnapshotOpenInterestFormat -from openapi_project.openapi_package.models.option_snapshot_open_interest_response_200 import OptionSnapshotOpenInterestResponse200 +from openapi_project.openapi_package.models.option_snapshot_open_interest_response_200_item import OptionSnapshotOpenInterestResponse200Item from openapi_project.openapi_package.models.option_snapshot_open_interest_right import OptionSnapshotOpenInterestRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -61,12 +61,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionSnapshotOpenInterestResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionSnapshotOpenInterestResponse200Item] | None: if response.status_code == 200: - response_200 = OptionSnapshotOpenInterestResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionSnapshotOpenInterestResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -74,7 +79,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionSnapshotOpenInterestResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionSnapshotOpenInterestResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -92,7 +97,7 @@ def sync_detailed( right: Unset | OptionSnapshotOpenInterestRight = OptionSnapshotOpenInterestRight.BOTH, format_: Unset | OptionSnapshotOpenInterestFormat = OptionSnapshotOpenInterestFormat.JSON, -) -> Response[OptionSnapshotOpenInterestResponse200]: +) -> Response[list[OptionSnapshotOpenInterestResponse200Item]]: """ Open Interest - Retrieve the last open interest message of an option contract. @@ -117,7 +122,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionSnapshotOpenInterestResponse200] + Response[list[OptionSnapshotOpenInterestResponse200Item]] """ @@ -145,7 +150,7 @@ def sync( right: Unset | OptionSnapshotOpenInterestRight = OptionSnapshotOpenInterestRight.BOTH, format_: Unset | OptionSnapshotOpenInterestFormat = OptionSnapshotOpenInterestFormat.JSON, -) -> OptionSnapshotOpenInterestResponse200 | None: +) -> list[OptionSnapshotOpenInterestResponse200Item] | None: """ Open Interest - Retrieve the last open interest message of an option contract. @@ -170,7 +175,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionSnapshotOpenInterestResponse200 + list[OptionSnapshotOpenInterestResponse200Item] """ @@ -193,7 +198,7 @@ async def asyncio_detailed( right: Unset | OptionSnapshotOpenInterestRight = OptionSnapshotOpenInterestRight.BOTH, format_: Unset | OptionSnapshotOpenInterestFormat = OptionSnapshotOpenInterestFormat.JSON, -) -> Response[OptionSnapshotOpenInterestResponse200]: +) -> Response[list[OptionSnapshotOpenInterestResponse200Item]]: """ Open Interest - Retrieve the last open interest message of an option contract. @@ -218,7 +223,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionSnapshotOpenInterestResponse200] + Response[list[OptionSnapshotOpenInterestResponse200Item]] """ @@ -246,7 +251,7 @@ async def asyncio( right: Unset | OptionSnapshotOpenInterestRight = OptionSnapshotOpenInterestRight.BOTH, format_: Unset | OptionSnapshotOpenInterestFormat = OptionSnapshotOpenInterestFormat.JSON, -) -> OptionSnapshotOpenInterestResponse200 | None: +) -> list[OptionSnapshotOpenInterestResponse200Item] | None: """ Open Interest - Retrieve the last open interest message of an option contract. @@ -271,7 +276,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionSnapshotOpenInterestResponse200 + list[OptionSnapshotOpenInterestResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_snapshot_quote.py b/openapi_project/openapi_package/api/option/option_snapshot_quote.py index cc36ad3ae..7ddec55de 100644 --- a/openapi_project/openapi_package/api/option/option_snapshot_quote.py +++ b/openapi_project/openapi_package/api/option/option_snapshot_quote.py @@ -8,7 +8,7 @@ from openapi_project.openapi_package import errors from openapi_project.openapi_package.models.option_snapshot_quote_format import OptionSnapshotQuoteFormat -from openapi_project.openapi_package.models.option_snapshot_quote_response_200 import OptionSnapshotQuoteResponse200 +from openapi_project.openapi_package.models.option_snapshot_quote_response_200_item import OptionSnapshotQuoteResponse200Item from openapi_project.openapi_package.models.option_snapshot_quote_right import OptionSnapshotQuoteRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -61,12 +61,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionSnapshotQuoteResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionSnapshotQuoteResponse200Item] | None: if response.status_code == 200: - response_200 = OptionSnapshotQuoteResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionSnapshotQuoteResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -74,7 +79,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionSnapshotQuoteResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionSnapshotQuoteResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -92,7 +97,7 @@ def sync_detailed( right: Unset | OptionSnapshotQuoteRight = OptionSnapshotQuoteRight.BOTH, format_: Unset | OptionSnapshotQuoteFormat = OptionSnapshotQuoteFormat.JSON, -) -> Response[OptionSnapshotQuoteResponse200]: +) -> Response[list[OptionSnapshotQuoteResponse200Item]]: """ Quote @@ -114,7 +119,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionSnapshotQuoteResponse200] + Response[list[OptionSnapshotQuoteResponse200Item]] """ @@ -142,7 +147,7 @@ def sync( right: Unset | OptionSnapshotQuoteRight = OptionSnapshotQuoteRight.BOTH, format_: Unset | OptionSnapshotQuoteFormat = OptionSnapshotQuoteFormat.JSON, -) -> OptionSnapshotQuoteResponse200 | None: +) -> list[OptionSnapshotQuoteResponse200Item] | None: """ Quote @@ -164,7 +169,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionSnapshotQuoteResponse200 + list[OptionSnapshotQuoteResponse200Item] """ @@ -187,7 +192,7 @@ async def asyncio_detailed( right: Unset | OptionSnapshotQuoteRight = OptionSnapshotQuoteRight.BOTH, format_: Unset | OptionSnapshotQuoteFormat = OptionSnapshotQuoteFormat.JSON, -) -> Response[OptionSnapshotQuoteResponse200]: +) -> Response[list[OptionSnapshotQuoteResponse200Item]]: """ Quote @@ -209,7 +214,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionSnapshotQuoteResponse200] + Response[list[OptionSnapshotQuoteResponse200Item]] """ @@ -237,7 +242,7 @@ async def asyncio( right: Unset | OptionSnapshotQuoteRight = OptionSnapshotQuoteRight.BOTH, format_: Unset | OptionSnapshotQuoteFormat = OptionSnapshotQuoteFormat.JSON, -) -> OptionSnapshotQuoteResponse200 | None: +) -> list[OptionSnapshotQuoteResponse200Item] | None: """ Quote @@ -259,7 +264,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionSnapshotQuoteResponse200 + list[OptionSnapshotQuoteResponse200Item] """ diff --git a/openapi_project/openapi_package/api/option/option_snapshot_trade.py b/openapi_project/openapi_package/api/option/option_snapshot_trade.py index 66eb9ff4d..06d252142 100644 --- a/openapi_project/openapi_package/api/option/option_snapshot_trade.py +++ b/openapi_project/openapi_package/api/option/option_snapshot_trade.py @@ -8,7 +8,7 @@ from openapi_project.openapi_package import errors from openapi_project.openapi_package.models.option_snapshot_trade_format import OptionSnapshotTradeFormat -from openapi_project.openapi_package.models.option_snapshot_trade_response_200 import OptionSnapshotTradeResponse200 +from openapi_project.openapi_package.models.option_snapshot_trade_response_200_item import OptionSnapshotTradeResponse200Item from openapi_project.openapi_package.models.option_snapshot_trade_right import OptionSnapshotTradeRight from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -61,12 +61,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionSnapshotTradeResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[OptionSnapshotTradeResponse200Item] | None: if response.status_code == 200: - response_200 = OptionSnapshotTradeResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = OptionSnapshotTradeResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -74,7 +79,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionSnapshotTradeResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[OptionSnapshotTradeResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -92,7 +97,7 @@ def sync_detailed( right: Unset | OptionSnapshotTradeRight = OptionSnapshotTradeRight.BOTH, format_: Unset | OptionSnapshotTradeFormat = OptionSnapshotTradeFormat.JSON, -) -> Response[OptionSnapshotTradeResponse200]: +) -> Response[list[OptionSnapshotTradeResponse200Item]]: """ Trade - Retrieve the real-time last trade of an option contract. @@ -113,7 +118,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionSnapshotTradeResponse200] + Response[list[OptionSnapshotTradeResponse200Item]] """ @@ -141,7 +146,7 @@ def sync( right: Unset | OptionSnapshotTradeRight = OptionSnapshotTradeRight.BOTH, format_: Unset | OptionSnapshotTradeFormat = OptionSnapshotTradeFormat.JSON, -) -> OptionSnapshotTradeResponse200 | None: +) -> list[OptionSnapshotTradeResponse200Item] | None: """ Trade - Retrieve the real-time last trade of an option contract. @@ -162,7 +167,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionSnapshotTradeResponse200 + list[OptionSnapshotTradeResponse200Item] """ @@ -185,7 +190,7 @@ async def asyncio_detailed( right: Unset | OptionSnapshotTradeRight = OptionSnapshotTradeRight.BOTH, format_: Unset | OptionSnapshotTradeFormat = OptionSnapshotTradeFormat.JSON, -) -> Response[OptionSnapshotTradeResponse200]: +) -> Response[list[OptionSnapshotTradeResponse200Item]]: """ Trade - Retrieve the real-time last trade of an option contract. @@ -206,7 +211,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OptionSnapshotTradeResponse200] + Response[list[OptionSnapshotTradeResponse200Item]] """ @@ -234,7 +239,7 @@ async def asyncio( right: Unset | OptionSnapshotTradeRight = OptionSnapshotTradeRight.BOTH, format_: Unset | OptionSnapshotTradeFormat = OptionSnapshotTradeFormat.JSON, -) -> OptionSnapshotTradeResponse200 | None: +) -> list[OptionSnapshotTradeResponse200Item] | None: """ Trade - Retrieve the real-time last trade of an option contract. @@ -255,7 +260,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OptionSnapshotTradeResponse200 + list[OptionSnapshotTradeResponse200Item] """ diff --git a/openapi_project/openapi_package/api/stock/stock_at_time_quote.py b/openapi_project/openapi_package/api/stock/stock_at_time_quote.py index 361d686f9..2faa2e313 100644 --- a/openapi_project/openapi_package/api/stock/stock_at_time_quote.py +++ b/openapi_project/openapi_package/api/stock/stock_at_time_quote.py @@ -8,7 +8,7 @@ from openapi_project.openapi_package import errors from openapi_project.openapi_package.models.stock_at_time_quote_format import StockAtTimeQuoteFormat -from openapi_project.openapi_package.models.stock_at_time_quote_response_200 import StockAtTimeQuoteResponse200 +from openapi_project.openapi_package.models.stock_at_time_quote_response_200_item import StockAtTimeQuoteResponse200Item from openapi_project.openapi_package.models.stock_at_time_quote_venue import StockAtTimeQuoteVenue from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -65,12 +65,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> StockAtTimeQuoteResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[StockAtTimeQuoteResponse200Item] | None: if response.status_code == 200: - response_200 = StockAtTimeQuoteResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = StockAtTimeQuoteResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -78,7 +83,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[StockAtTimeQuoteResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[StockAtTimeQuoteResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -97,7 +102,7 @@ def sync_detailed( venue: Unset | StockAtTimeQuoteVenue = StockAtTimeQuoteVenue.NQB, format_: Unset | StockAtTimeQuoteFormat = StockAtTimeQuoteFormat.JSON, -) -> Response[StockAtTimeQuoteResponse200]: +) -> Response[list[StockAtTimeQuoteResponse200Item]]: """ Quote #### Real-time request: @@ -126,7 +131,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[StockAtTimeQuoteResponse200] + Response[list[StockAtTimeQuoteResponse200Item]] """ @@ -156,7 +161,7 @@ def sync( venue: Unset | StockAtTimeQuoteVenue = StockAtTimeQuoteVenue.NQB, format_: Unset | StockAtTimeQuoteFormat = StockAtTimeQuoteFormat.JSON, -) -> StockAtTimeQuoteResponse200 | None: +) -> list[StockAtTimeQuoteResponse200Item] | None: """ Quote #### Real-time request: @@ -185,7 +190,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - StockAtTimeQuoteResponse200 + list[StockAtTimeQuoteResponse200Item] """ @@ -210,7 +215,7 @@ async def asyncio_detailed( venue: Unset | StockAtTimeQuoteVenue = StockAtTimeQuoteVenue.NQB, format_: Unset | StockAtTimeQuoteFormat = StockAtTimeQuoteFormat.JSON, -) -> Response[StockAtTimeQuoteResponse200]: +) -> Response[list[StockAtTimeQuoteResponse200Item]]: """ Quote #### Real-time request: @@ -239,7 +244,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[StockAtTimeQuoteResponse200] + Response[list[StockAtTimeQuoteResponse200Item]] """ @@ -269,7 +274,7 @@ async def asyncio( venue: Unset | StockAtTimeQuoteVenue = StockAtTimeQuoteVenue.NQB, format_: Unset | StockAtTimeQuoteFormat = StockAtTimeQuoteFormat.JSON, -) -> StockAtTimeQuoteResponse200 | None: +) -> list[StockAtTimeQuoteResponse200Item] | None: """ Quote #### Real-time request: @@ -298,7 +303,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - StockAtTimeQuoteResponse200 + list[StockAtTimeQuoteResponse200Item] """ diff --git a/openapi_project/openapi_package/api/stock/stock_at_time_trade.py b/openapi_project/openapi_package/api/stock/stock_at_time_trade.py index 99d70758f..bd6b47799 100644 --- a/openapi_project/openapi_package/api/stock/stock_at_time_trade.py +++ b/openapi_project/openapi_package/api/stock/stock_at_time_trade.py @@ -8,7 +8,7 @@ from openapi_project.openapi_package import errors from openapi_project.openapi_package.models.stock_at_time_trade_format import StockAtTimeTradeFormat -from openapi_project.openapi_package.models.stock_at_time_trade_response_200 import StockAtTimeTradeResponse200 +from openapi_project.openapi_package.models.stock_at_time_trade_response_200_item import StockAtTimeTradeResponse200Item from openapi_project.openapi_package.models.stock_at_time_trade_venue import StockAtTimeTradeVenue from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -65,12 +65,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> StockAtTimeTradeResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[StockAtTimeTradeResponse200Item] | None: if response.status_code == 200: - response_200 = StockAtTimeTradeResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = StockAtTimeTradeResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -78,7 +83,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[StockAtTimeTradeResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[StockAtTimeTradeResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -97,7 +102,7 @@ def sync_detailed( venue: Unset | StockAtTimeTradeVenue = StockAtTimeTradeVenue.NQB, format_: Unset | StockAtTimeTradeFormat = StockAtTimeTradeFormat.JSON, -) -> Response[StockAtTimeTradeResponse200]: +) -> Response[list[StockAtTimeTradeResponse200Item]]: """ Trade #### Real-time request: @@ -127,7 +132,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[StockAtTimeTradeResponse200] + Response[list[StockAtTimeTradeResponse200Item]] """ @@ -157,7 +162,7 @@ def sync( venue: Unset | StockAtTimeTradeVenue = StockAtTimeTradeVenue.NQB, format_: Unset | StockAtTimeTradeFormat = StockAtTimeTradeFormat.JSON, -) -> StockAtTimeTradeResponse200 | None: +) -> list[StockAtTimeTradeResponse200Item] | None: """ Trade #### Real-time request: @@ -187,7 +192,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - StockAtTimeTradeResponse200 + list[StockAtTimeTradeResponse200Item] """ @@ -212,7 +217,7 @@ async def asyncio_detailed( venue: Unset | StockAtTimeTradeVenue = StockAtTimeTradeVenue.NQB, format_: Unset | StockAtTimeTradeFormat = StockAtTimeTradeFormat.JSON, -) -> Response[StockAtTimeTradeResponse200]: +) -> Response[list[StockAtTimeTradeResponse200Item]]: """ Trade #### Real-time request: @@ -242,7 +247,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[StockAtTimeTradeResponse200] + Response[list[StockAtTimeTradeResponse200Item]] """ @@ -272,7 +277,7 @@ async def asyncio( venue: Unset | StockAtTimeTradeVenue = StockAtTimeTradeVenue.NQB, format_: Unset | StockAtTimeTradeFormat = StockAtTimeTradeFormat.JSON, -) -> StockAtTimeTradeResponse200 | None: +) -> list[StockAtTimeTradeResponse200Item] | None: """ Trade #### Real-time request: @@ -302,7 +307,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - StockAtTimeTradeResponse200 + list[StockAtTimeTradeResponse200Item] """ diff --git a/openapi_project/openapi_package/api/stock/stock_history_eod.py b/openapi_project/openapi_package/api/stock/stock_history_eod.py index 3fd295471..cce95d215 100644 --- a/openapi_project/openapi_package/api/stock/stock_history_eod.py +++ b/openapi_project/openapi_package/api/stock/stock_history_eod.py @@ -8,7 +8,7 @@ from openapi_project.openapi_package import errors from openapi_project.openapi_package.models.stock_history_eod_format import StockHistoryEodFormat -from openapi_project.openapi_package.models.stock_history_eod_response_200 import StockHistoryEodResponse200 +from openapi_project.openapi_package.models.stock_history_eod_response_200_item import StockHistoryEodResponse200Item from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse from typing import cast @@ -56,12 +56,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> StockHistoryEodResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[StockHistoryEodResponse200Item] | None: if response.status_code == 200: - response_200 = StockHistoryEodResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = StockHistoryEodResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -69,7 +74,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[StockHistoryEodResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[StockHistoryEodResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -86,7 +91,7 @@ def sync_detailed( end_date: datetime.date, format_: Unset | StockHistoryEodFormat = StockHistoryEodFormat.JSON, -) -> Response[StockHistoryEodResponse200]: +) -> Response[list[StockHistoryEodResponse200Item]]: """ End of Day @@ -109,7 +114,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[StockHistoryEodResponse200] + Response[list[StockHistoryEodResponse200Item]] """ @@ -135,7 +140,7 @@ def sync( end_date: datetime.date, format_: Unset | StockHistoryEodFormat = StockHistoryEodFormat.JSON, -) -> StockHistoryEodResponse200 | None: +) -> list[StockHistoryEodResponse200Item] | None: """ End of Day @@ -158,7 +163,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - StockHistoryEodResponse200 + list[StockHistoryEodResponse200Item] """ @@ -179,7 +184,7 @@ async def asyncio_detailed( end_date: datetime.date, format_: Unset | StockHistoryEodFormat = StockHistoryEodFormat.JSON, -) -> Response[StockHistoryEodResponse200]: +) -> Response[list[StockHistoryEodResponse200Item]]: """ End of Day @@ -202,7 +207,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[StockHistoryEodResponse200] + Response[list[StockHistoryEodResponse200Item]] """ @@ -228,7 +233,7 @@ async def asyncio( end_date: datetime.date, format_: Unset | StockHistoryEodFormat = StockHistoryEodFormat.JSON, -) -> StockHistoryEodResponse200 | None: +) -> list[StockHistoryEodResponse200Item] | None: """ End of Day @@ -251,7 +256,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - StockHistoryEodResponse200 + list[StockHistoryEodResponse200Item] """ diff --git a/openapi_project/openapi_package/api/stock/stock_history_ohlc.py b/openapi_project/openapi_package/api/stock/stock_history_ohlc.py index c3aed7df5..e52fc6c70 100644 --- a/openapi_project/openapi_package/api/stock/stock_history_ohlc.py +++ b/openapi_project/openapi_package/api/stock/stock_history_ohlc.py @@ -9,7 +9,7 @@ from openapi_project.openapi_package.models.stock_history_ohlc_format import StockHistoryOhlcFormat from openapi_project.openapi_package.models.stock_history_ohlc_interval import StockHistoryOhlcInterval -from openapi_project.openapi_package.models.stock_history_ohlc_response_200 import StockHistoryOhlcResponse200 +from openapi_project.openapi_package.models.stock_history_ohlc_response_200_item import StockHistoryOhlcResponse200Item from openapi_project.openapi_package.models.stock_history_ohlc_venue import StockHistoryOhlcVenue from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -69,12 +69,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> StockHistoryOhlcResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[StockHistoryOhlcResponse200Item] | None: if response.status_code == 200: - response_200 = StockHistoryOhlcResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = StockHistoryOhlcResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -82,7 +87,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[StockHistoryOhlcResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[StockHistoryOhlcResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -102,7 +107,7 @@ def sync_detailed( venue: Unset | StockHistoryOhlcVenue = StockHistoryOhlcVenue.NQB, format_: Unset | StockHistoryOhlcFormat = StockHistoryOhlcFormat.JSON, -) -> Response[StockHistoryOhlcResponse200]: +) -> Response[list[StockHistoryOhlcResponse200Item]]: """ Open High Low Close Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. @@ -126,7 +131,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[StockHistoryOhlcResponse200] + Response[list[StockHistoryOhlcResponse200Item]] """ @@ -158,7 +163,7 @@ def sync( venue: Unset | StockHistoryOhlcVenue = StockHistoryOhlcVenue.NQB, format_: Unset | StockHistoryOhlcFormat = StockHistoryOhlcFormat.JSON, -) -> StockHistoryOhlcResponse200 | None: +) -> list[StockHistoryOhlcResponse200Item] | None: """ Open High Low Close Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. @@ -182,7 +187,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - StockHistoryOhlcResponse200 + list[StockHistoryOhlcResponse200Item] """ @@ -209,7 +214,7 @@ async def asyncio_detailed( venue: Unset | StockHistoryOhlcVenue = StockHistoryOhlcVenue.NQB, format_: Unset | StockHistoryOhlcFormat = StockHistoryOhlcFormat.JSON, -) -> Response[StockHistoryOhlcResponse200]: +) -> Response[list[StockHistoryOhlcResponse200Item]]: """ Open High Low Close Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. @@ -233,7 +238,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[StockHistoryOhlcResponse200] + Response[list[StockHistoryOhlcResponse200Item]] """ @@ -265,7 +270,7 @@ async def asyncio( venue: Unset | StockHistoryOhlcVenue = StockHistoryOhlcVenue.NQB, format_: Unset | StockHistoryOhlcFormat = StockHistoryOhlcFormat.JSON, -) -> StockHistoryOhlcResponse200 | None: +) -> list[StockHistoryOhlcResponse200Item] | None: """ Open High Low Close Aggregated OHLC bars that use [SIP rules](/Articles/Data-And-Requests/OHLC-EOD.html) for each bar. @@ -289,7 +294,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - StockHistoryOhlcResponse200 + list[StockHistoryOhlcResponse200Item] """ diff --git a/openapi_project/openapi_package/api/stock/stock_history_quote.py b/openapi_project/openapi_package/api/stock/stock_history_quote.py index dd213c5e6..afa2234a4 100644 --- a/openapi_project/openapi_package/api/stock/stock_history_quote.py +++ b/openapi_project/openapi_package/api/stock/stock_history_quote.py @@ -9,7 +9,7 @@ from openapi_project.openapi_package.models.stock_history_quote_format import StockHistoryQuoteFormat from openapi_project.openapi_package.models.stock_history_quote_interval import StockHistoryQuoteInterval -from openapi_project.openapi_package.models.stock_history_quote_response_200 import StockHistoryQuoteResponse200 +from openapi_project.openapi_package.models.stock_history_quote_response_200_item import StockHistoryQuoteResponse200Item from openapi_project.openapi_package.models.stock_history_quote_venue import StockHistoryQuoteVenue from openapi_project.openapi_package.types import UNSET, Unset from dateutil.parser import isoparse @@ -69,12 +69,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> StockHistoryQuoteResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[StockHistoryQuoteResponse200Item] | None: if response.status_code == 200: - response_200 = StockHistoryQuoteResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = StockHistoryQuoteResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -82,7 +87,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[StockHistoryQuoteResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[StockHistoryQuoteResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -102,7 +107,7 @@ def sync_detailed( venue: Unset | StockHistoryQuoteVenue = StockHistoryQuoteVenue.NQB, format_: Unset | StockHistoryQuoteFormat = StockHistoryQuoteFormat.JSON, -) -> Response[StockHistoryQuoteResponse200]: +) -> Response[list[StockHistoryQuoteResponse200Item]]: """ Quote Returns every NBBO quote reported by [UTP and CTA](/Articles/Data-And-Requests/The-SIPs). If the @@ -125,7 +130,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[StockHistoryQuoteResponse200] + Response[list[StockHistoryQuoteResponse200Item]] """ @@ -157,7 +162,7 @@ def sync( venue: Unset | StockHistoryQuoteVenue = StockHistoryQuoteVenue.NQB, format_: Unset | StockHistoryQuoteFormat = StockHistoryQuoteFormat.JSON, -) -> StockHistoryQuoteResponse200 | None: +) -> list[StockHistoryQuoteResponse200Item] | None: """ Quote Returns every NBBO quote reported by [UTP and CTA](/Articles/Data-And-Requests/The-SIPs). If the @@ -180,7 +185,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - StockHistoryQuoteResponse200 + list[StockHistoryQuoteResponse200Item] """ @@ -207,7 +212,7 @@ async def asyncio_detailed( venue: Unset | StockHistoryQuoteVenue = StockHistoryQuoteVenue.NQB, format_: Unset | StockHistoryQuoteFormat = StockHistoryQuoteFormat.JSON, -) -> Response[StockHistoryQuoteResponse200]: +) -> Response[list[StockHistoryQuoteResponse200Item]]: """ Quote Returns every NBBO quote reported by [UTP and CTA](/Articles/Data-And-Requests/The-SIPs). If the @@ -230,7 +235,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[StockHistoryQuoteResponse200] + Response[list[StockHistoryQuoteResponse200Item]] """ @@ -262,7 +267,7 @@ async def asyncio( venue: Unset | StockHistoryQuoteVenue = StockHistoryQuoteVenue.NQB, format_: Unset | StockHistoryQuoteFormat = StockHistoryQuoteFormat.JSON, -) -> StockHistoryQuoteResponse200 | None: +) -> list[StockHistoryQuoteResponse200Item] | None: """ Quote Returns every NBBO quote reported by [UTP and CTA](/Articles/Data-And-Requests/The-SIPs). If the @@ -285,7 +290,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - StockHistoryQuoteResponse200 + list[StockHistoryQuoteResponse200Item] """ diff --git a/openapi_project/openapi_package/api/stock/stock_list_dates.py b/openapi_project/openapi_package/api/stock/stock_list_dates.py index 29da878da..93b4cff63 100644 --- a/openapi_project/openapi_package/api/stock/stock_list_dates.py +++ b/openapi_project/openapi_package/api/stock/stock_list_dates.py @@ -9,7 +9,7 @@ from openapi_project.openapi_package.models.stock_list_dates_format import StockListDatesFormat from openapi_project.openapi_package.models.stock_list_dates_request_type import StockListDatesRequestType -from openapi_project.openapi_package.models.stock_list_dates_response_200 import StockListDatesResponse200 +from openapi_project.openapi_package.models.stock_list_dates_response_200_item import StockListDatesResponse200Item from openapi_project.openapi_package.types import UNSET, Unset from typing import cast @@ -51,12 +51,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> StockListDatesResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[StockListDatesResponse200Item] | None: if response.status_code == 200: - response_200 = StockListDatesResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = StockListDatesResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -64,7 +69,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[StockListDatesResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[StockListDatesResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -80,7 +85,7 @@ def sync_detailed( symbol: list[str], format_: Unset | StockListDatesFormat = StockListDatesFormat.JSON, -) -> Response[StockListDatesResponse200]: +) -> Response[list[StockListDatesResponse200Item]]: """ Dates Lists all dates of data that are available for a stock with a given request type and symbol. This @@ -96,7 +101,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[StockListDatesResponse200] + Response[list[StockListDatesResponse200Item]] """ @@ -120,7 +125,7 @@ def sync( symbol: list[str], format_: Unset | StockListDatesFormat = StockListDatesFormat.JSON, -) -> StockListDatesResponse200 | None: +) -> list[StockListDatesResponse200Item] | None: """ Dates Lists all dates of data that are available for a stock with a given request type and symbol. This @@ -136,7 +141,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - StockListDatesResponse200 + list[StockListDatesResponse200Item] """ @@ -155,7 +160,7 @@ async def asyncio_detailed( symbol: list[str], format_: Unset | StockListDatesFormat = StockListDatesFormat.JSON, -) -> Response[StockListDatesResponse200]: +) -> Response[list[StockListDatesResponse200Item]]: """ Dates Lists all dates of data that are available for a stock with a given request type and symbol. This @@ -171,7 +176,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[StockListDatesResponse200] + Response[list[StockListDatesResponse200Item]] """ @@ -195,7 +200,7 @@ async def asyncio( symbol: list[str], format_: Unset | StockListDatesFormat = StockListDatesFormat.JSON, -) -> StockListDatesResponse200 | None: +) -> list[StockListDatesResponse200Item] | None: """ Dates Lists all dates of data that are available for a stock with a given request type and symbol. This @@ -211,7 +216,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - StockListDatesResponse200 + list[StockListDatesResponse200Item] """ diff --git a/openapi_project/openapi_package/api/stock/stock_list_symbols.py b/openapi_project/openapi_package/api/stock/stock_list_symbols.py index 239ead13a..761845d3a 100644 --- a/openapi_project/openapi_package/api/stock/stock_list_symbols.py +++ b/openapi_project/openapi_package/api/stock/stock_list_symbols.py @@ -8,7 +8,7 @@ from openapi_project.openapi_package import errors from openapi_project.openapi_package.models.stock_list_symbols_format import StockListSymbolsFormat -from openapi_project.openapi_package.models.stock_list_symbols_response_200 import StockListSymbolsResponse200 +from openapi_project.openapi_package.models.stock_list_symbols_response_200_item import StockListSymbolsResponse200Item from openapi_project.openapi_package.types import UNSET, Unset from typing import cast @@ -43,12 +43,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> StockListSymbolsResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[StockListSymbolsResponse200Item] | None: if response.status_code == 200: - response_200 = StockListSymbolsResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = StockListSymbolsResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -56,7 +61,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[StockListSymbolsResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[StockListSymbolsResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,7 +75,7 @@ def sync_detailed( client: AuthenticatedClient | Client, format_: Unset | StockListSymbolsFormat = StockListSymbolsFormat.JSON, -) -> Response[StockListSymbolsResponse200]: +) -> Response[list[StockListSymbolsResponse200Item]]: """ Symbols A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also @@ -85,7 +90,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[StockListSymbolsResponse200] + Response[list[StockListSymbolsResponse200Item]] """ @@ -105,7 +110,7 @@ def sync( client: AuthenticatedClient | Client, format_: Unset | StockListSymbolsFormat = StockListSymbolsFormat.JSON, -) -> StockListSymbolsResponse200 | None: +) -> list[StockListSymbolsResponse200Item] | None: """ Symbols A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also @@ -120,7 +125,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - StockListSymbolsResponse200 + list[StockListSymbolsResponse200Item] """ @@ -135,7 +140,7 @@ async def asyncio_detailed( client: AuthenticatedClient | Client, format_: Unset | StockListSymbolsFormat = StockListSymbolsFormat.JSON, -) -> Response[StockListSymbolsResponse200]: +) -> Response[list[StockListSymbolsResponse200Item]]: """ Symbols A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also @@ -150,7 +155,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[StockListSymbolsResponse200] + Response[list[StockListSymbolsResponse200Item]] """ @@ -170,7 +175,7 @@ async def asyncio( client: AuthenticatedClient | Client, format_: Unset | StockListSymbolsFormat = StockListSymbolsFormat.JSON, -) -> StockListSymbolsResponse200 | None: +) -> list[StockListSymbolsResponse200Item] | None: """ Symbols A symbol can be defined as a unique identifier for a stock / underlying asset. Common terms also @@ -185,7 +190,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - StockListSymbolsResponse200 + list[StockListSymbolsResponse200Item] """ diff --git a/openapi_project/openapi_package/api/stock/stock_snapshot_ohlc.py b/openapi_project/openapi_package/api/stock/stock_snapshot_ohlc.py index df483a90f..e00d08b9d 100644 --- a/openapi_project/openapi_package/api/stock/stock_snapshot_ohlc.py +++ b/openapi_project/openapi_package/api/stock/stock_snapshot_ohlc.py @@ -8,7 +8,7 @@ from openapi_project.openapi_package import errors from openapi_project.openapi_package.models.stock_snapshot_ohlc_format import StockSnapshotOhlcFormat -from openapi_project.openapi_package.models.stock_snapshot_ohlc_response_200 import StockSnapshotOhlcResponse200 +from openapi_project.openapi_package.models.stock_snapshot_ohlc_response_200_item import StockSnapshotOhlcResponse200Item from openapi_project.openapi_package.models.stock_snapshot_ohlc_venue import StockSnapshotOhlcVenue from openapi_project.openapi_package.types import UNSET, Unset from typing import cast @@ -55,12 +55,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> StockSnapshotOhlcResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[StockSnapshotOhlcResponse200Item] | None: if response.status_code == 200: - response_200 = StockSnapshotOhlcResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = StockSnapshotOhlcResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -68,7 +73,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[StockSnapshotOhlcResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[StockSnapshotOhlcResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -84,7 +89,7 @@ def sync_detailed( venue: Unset | StockSnapshotOhlcVenue = StockSnapshotOhlcVenue.NQB, format_: Unset | StockSnapshotOhlcFormat = StockSnapshotOhlcFormat.JSON, -) -> Response[StockSnapshotOhlcResponse200]: +) -> Response[list[StockSnapshotOhlcResponse200Item]]: """ Open High Low Close @@ -108,7 +113,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[StockSnapshotOhlcResponse200] + Response[list[StockSnapshotOhlcResponse200Item]] """ @@ -132,7 +137,7 @@ def sync( venue: Unset | StockSnapshotOhlcVenue = StockSnapshotOhlcVenue.NQB, format_: Unset | StockSnapshotOhlcFormat = StockSnapshotOhlcFormat.JSON, -) -> StockSnapshotOhlcResponse200 | None: +) -> list[StockSnapshotOhlcResponse200Item] | None: """ Open High Low Close @@ -156,7 +161,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - StockSnapshotOhlcResponse200 + list[StockSnapshotOhlcResponse200Item] """ @@ -175,7 +180,7 @@ async def asyncio_detailed( venue: Unset | StockSnapshotOhlcVenue = StockSnapshotOhlcVenue.NQB, format_: Unset | StockSnapshotOhlcFormat = StockSnapshotOhlcFormat.JSON, -) -> Response[StockSnapshotOhlcResponse200]: +) -> Response[list[StockSnapshotOhlcResponse200Item]]: """ Open High Low Close @@ -199,7 +204,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[StockSnapshotOhlcResponse200] + Response[list[StockSnapshotOhlcResponse200Item]] """ @@ -223,7 +228,7 @@ async def asyncio( venue: Unset | StockSnapshotOhlcVenue = StockSnapshotOhlcVenue.NQB, format_: Unset | StockSnapshotOhlcFormat = StockSnapshotOhlcFormat.JSON, -) -> StockSnapshotOhlcResponse200 | None: +) -> list[StockSnapshotOhlcResponse200Item] | None: """ Open High Low Close @@ -247,7 +252,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - StockSnapshotOhlcResponse200 + list[StockSnapshotOhlcResponse200Item] """ diff --git a/openapi_project/openapi_package/api/stock/stock_snapshot_quote.py b/openapi_project/openapi_package/api/stock/stock_snapshot_quote.py index faa3ee793..7bc429617 100644 --- a/openapi_project/openapi_package/api/stock/stock_snapshot_quote.py +++ b/openapi_project/openapi_package/api/stock/stock_snapshot_quote.py @@ -8,7 +8,7 @@ from openapi_project.openapi_package import errors from openapi_project.openapi_package.models.stock_snapshot_quote_format import StockSnapshotQuoteFormat -from openapi_project.openapi_package.models.stock_snapshot_quote_response_200 import StockSnapshotQuoteResponse200 +from openapi_project.openapi_package.models.stock_snapshot_quote_response_200_item import StockSnapshotQuoteResponse200Item from openapi_project.openapi_package.models.stock_snapshot_quote_venue import StockSnapshotQuoteVenue from openapi_project.openapi_package.types import UNSET, Unset from typing import cast @@ -55,12 +55,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> StockSnapshotQuoteResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[StockSnapshotQuoteResponse200Item] | None: if response.status_code == 200: - response_200 = StockSnapshotQuoteResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = StockSnapshotQuoteResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -68,7 +73,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[StockSnapshotQuoteResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[StockSnapshotQuoteResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -84,7 +89,7 @@ def sync_detailed( venue: Unset | StockSnapshotQuoteVenue = StockSnapshotQuoteVenue.NQB, format_: Unset | StockSnapshotQuoteFormat = StockSnapshotQuoteFormat.JSON, -) -> Response[StockSnapshotQuoteResponse200]: +) -> Response[list[StockSnapshotQuoteResponse200Item]]: """ Quote * Returns a real-time last BBO quote from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The- @@ -107,7 +112,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[StockSnapshotQuoteResponse200] + Response[list[StockSnapshotQuoteResponse200Item]] """ @@ -131,7 +136,7 @@ def sync( venue: Unset | StockSnapshotQuoteVenue = StockSnapshotQuoteVenue.NQB, format_: Unset | StockSnapshotQuoteFormat = StockSnapshotQuoteFormat.JSON, -) -> StockSnapshotQuoteResponse200 | None: +) -> list[StockSnapshotQuoteResponse200Item] | None: """ Quote * Returns a real-time last BBO quote from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The- @@ -154,7 +159,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - StockSnapshotQuoteResponse200 + list[StockSnapshotQuoteResponse200Item] """ @@ -173,7 +178,7 @@ async def asyncio_detailed( venue: Unset | StockSnapshotQuoteVenue = StockSnapshotQuoteVenue.NQB, format_: Unset | StockSnapshotQuoteFormat = StockSnapshotQuoteFormat.JSON, -) -> Response[StockSnapshotQuoteResponse200]: +) -> Response[list[StockSnapshotQuoteResponse200Item]]: """ Quote * Returns a real-time last BBO quote from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The- @@ -196,7 +201,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[StockSnapshotQuoteResponse200] + Response[list[StockSnapshotQuoteResponse200Item]] """ @@ -220,7 +225,7 @@ async def asyncio( venue: Unset | StockSnapshotQuoteVenue = StockSnapshotQuoteVenue.NQB, format_: Unset | StockSnapshotQuoteFormat = StockSnapshotQuoteFormat.JSON, -) -> StockSnapshotQuoteResponse200 | None: +) -> list[StockSnapshotQuoteResponse200Item] | None: """ Quote * Returns a real-time last BBO quote from the [Nasdaq Basic feed](/Articles/Data-And-Requests/The- @@ -243,7 +248,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - StockSnapshotQuoteResponse200 + list[StockSnapshotQuoteResponse200Item] """ diff --git a/openapi_project/openapi_package/api/stock/stock_snapshot_trade.py b/openapi_project/openapi_package/api/stock/stock_snapshot_trade.py index bf04836dc..01d454192 100644 --- a/openapi_project/openapi_package/api/stock/stock_snapshot_trade.py +++ b/openapi_project/openapi_package/api/stock/stock_snapshot_trade.py @@ -8,7 +8,7 @@ from openapi_project.openapi_package import errors from openapi_project.openapi_package.models.stock_snapshot_trade_format import StockSnapshotTradeFormat -from openapi_project.openapi_package.models.stock_snapshot_trade_response_200 import StockSnapshotTradeResponse200 +from openapi_project.openapi_package.models.stock_snapshot_trade_response_200_item import StockSnapshotTradeResponse200Item from openapi_project.openapi_package.models.stock_snapshot_trade_venue import StockSnapshotTradeVenue from openapi_project.openapi_package.types import UNSET, Unset from typing import cast @@ -55,12 +55,17 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> StockSnapshotTradeResponse200 | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[StockSnapshotTradeResponse200Item] | None: if response.status_code == 200: - response_200 = StockSnapshotTradeResponse200.from_dict(response.json()) + response_200 = [] + _response_200 = response.json() + for response_200_item_data in (_response_200): + response_200_item = StockSnapshotTradeResponse200Item.from_dict(response_200_item_data) + response_200.append(response_200_item) + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -68,7 +73,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[StockSnapshotTradeResponse200]: +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[StockSnapshotTradeResponse200Item]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -84,7 +89,7 @@ def sync_detailed( venue: Unset | StockSnapshotTradeVenue = StockSnapshotTradeVenue.NQB, format_: Unset | StockSnapshotTradeFormat = StockSnapshotTradeFormat.JSON, -) -> Response[StockSnapshotTradeResponse200]: +) -> Response[list[StockSnapshotTradeResponse200Item]]: """ Trade @@ -106,7 +111,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[StockSnapshotTradeResponse200] + Response[list[StockSnapshotTradeResponse200Item]] """ @@ -130,7 +135,7 @@ def sync( venue: Unset | StockSnapshotTradeVenue = StockSnapshotTradeVenue.NQB, format_: Unset | StockSnapshotTradeFormat = StockSnapshotTradeFormat.JSON, -) -> StockSnapshotTradeResponse200 | None: +) -> list[StockSnapshotTradeResponse200Item] | None: """ Trade @@ -152,7 +157,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - StockSnapshotTradeResponse200 + list[StockSnapshotTradeResponse200Item] """ @@ -171,7 +176,7 @@ async def asyncio_detailed( venue: Unset | StockSnapshotTradeVenue = StockSnapshotTradeVenue.NQB, format_: Unset | StockSnapshotTradeFormat = StockSnapshotTradeFormat.JSON, -) -> Response[StockSnapshotTradeResponse200]: +) -> Response[list[StockSnapshotTradeResponse200Item]]: """ Trade @@ -193,7 +198,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[StockSnapshotTradeResponse200] + Response[list[StockSnapshotTradeResponse200Item]] """ @@ -217,7 +222,7 @@ async def asyncio( venue: Unset | StockSnapshotTradeVenue = StockSnapshotTradeVenue.NQB, format_: Unset | StockSnapshotTradeFormat = StockSnapshotTradeFormat.JSON, -) -> StockSnapshotTradeResponse200 | None: +) -> list[StockSnapshotTradeResponse200Item] | None: """ Trade @@ -239,7 +244,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - StockSnapshotTradeResponse200 + list[StockSnapshotTradeResponse200Item] """ diff --git a/openapi_project/openapi_package/models/__init__.py b/openapi_project/openapi_package/models/__init__.py index 57555e6d5..b3aac17b2 100644 --- a/openapi_project/openapi_package/models/__init__.py +++ b/openapi_project/openapi_package/models/__init__.py @@ -1,158 +1,158 @@ """ Contains all the data models used in inputs/outputs """ from openapi_project.openapi_package.models.index_at_time_price_format import IndexAtTimePriceFormat -from openapi_project.openapi_package.models.index_at_time_price_response_200 import IndexAtTimePriceResponse200 +from openapi_project.openapi_package.models.index_at_time_price_response_200_item import IndexAtTimePriceResponse200Item from openapi_project.openapi_package.models.index_history_eod_format import IndexHistoryEodFormat -from openapi_project.openapi_package.models.index_history_eod_response_200 import IndexHistoryEodResponse200 +from openapi_project.openapi_package.models.index_history_eod_response_200_item import IndexHistoryEodResponse200Item from openapi_project.openapi_package.models.index_history_ohlc_format import IndexHistoryOhlcFormat from openapi_project.openapi_package.models.index_history_ohlc_interval import IndexHistoryOhlcInterval -from openapi_project.openapi_package.models.index_history_ohlc_response_200 import IndexHistoryOhlcResponse200 +from openapi_project.openapi_package.models.index_history_ohlc_response_200_item import IndexHistoryOhlcResponse200Item from openapi_project.openapi_package.models.index_history_price_format import IndexHistoryPriceFormat from openapi_project.openapi_package.models.index_history_price_interval import IndexHistoryPriceInterval -from openapi_project.openapi_package.models.index_history_price_response_200 import IndexHistoryPriceResponse200 +from openapi_project.openapi_package.models.index_history_price_response_200_item import IndexHistoryPriceResponse200Item from openapi_project.openapi_package.models.index_list_dates_format import IndexListDatesFormat -from openapi_project.openapi_package.models.index_list_dates_response_200 import IndexListDatesResponse200 +from openapi_project.openapi_package.models.index_list_dates_response_200_item import IndexListDatesResponse200Item from openapi_project.openapi_package.models.index_list_symbols_format import IndexListSymbolsFormat -from openapi_project.openapi_package.models.index_list_symbols_response_200 import IndexListSymbolsResponse200 +from openapi_project.openapi_package.models.index_list_symbols_response_200_item import IndexListSymbolsResponse200Item from openapi_project.openapi_package.models.index_snapshot_ohlc_format import IndexSnapshotOhlcFormat -from openapi_project.openapi_package.models.index_snapshot_ohlc_response_200 import IndexSnapshotOhlcResponse200 +from openapi_project.openapi_package.models.index_snapshot_ohlc_response_200_item import IndexSnapshotOhlcResponse200Item from openapi_project.openapi_package.models.index_snapshot_price_format import IndexSnapshotPriceFormat -from openapi_project.openapi_package.models.index_snapshot_price_response_200 import IndexSnapshotPriceResponse200 +from openapi_project.openapi_package.models.index_snapshot_price_response_200_item import IndexSnapshotPriceResponse200Item from openapi_project.openapi_package.models.option_at_time_quote_format import OptionAtTimeQuoteFormat -from openapi_project.openapi_package.models.option_at_time_quote_response_200 import OptionAtTimeQuoteResponse200 +from openapi_project.openapi_package.models.option_at_time_quote_response_200_item import OptionAtTimeQuoteResponse200Item from openapi_project.openapi_package.models.option_at_time_quote_right import OptionAtTimeQuoteRight from openapi_project.openapi_package.models.option_at_time_trade_format import OptionAtTimeTradeFormat -from openapi_project.openapi_package.models.option_at_time_trade_response_200 import OptionAtTimeTradeResponse200 +from openapi_project.openapi_package.models.option_at_time_trade_response_200_item import OptionAtTimeTradeResponse200Item from openapi_project.openapi_package.models.option_at_time_trade_right import OptionAtTimeTradeRight from openapi_project.openapi_package.models.option_history_eod_format import OptionHistoryEodFormat -from openapi_project.openapi_package.models.option_history_eod_response_200 import OptionHistoryEodResponse200 +from openapi_project.openapi_package.models.option_history_eod_response_200_item import OptionHistoryEodResponse200Item from openapi_project.openapi_package.models.option_history_eod_right import OptionHistoryEodRight from openapi_project.openapi_package.models.option_history_greeks_all_format import OptionHistoryGreeksAllFormat from openapi_project.openapi_package.models.option_history_greeks_all_interval import OptionHistoryGreeksAllInterval from openapi_project.openapi_package.models.option_history_greeks_all_rate_type import OptionHistoryGreeksAllRateType -from openapi_project.openapi_package.models.option_history_greeks_all_response_200 import OptionHistoryGreeksAllResponse200 +from openapi_project.openapi_package.models.option_history_greeks_all_response_200_item import OptionHistoryGreeksAllResponse200Item from openapi_project.openapi_package.models.option_history_greeks_all_right import OptionHistoryGreeksAllRight from openapi_project.openapi_package.models.option_history_greeks_eod_format import OptionHistoryGreeksEodFormat from openapi_project.openapi_package.models.option_history_greeks_eod_rate_type import OptionHistoryGreeksEodRateType -from openapi_project.openapi_package.models.option_history_greeks_eod_response_200 import OptionHistoryGreeksEodResponse200 +from openapi_project.openapi_package.models.option_history_greeks_eod_response_200_item import OptionHistoryGreeksEodResponse200Item from openapi_project.openapi_package.models.option_history_greeks_eod_right import OptionHistoryGreeksEodRight from openapi_project.openapi_package.models.option_history_greeks_first_order_format import OptionHistoryGreeksFirstOrderFormat from openapi_project.openapi_package.models.option_history_greeks_first_order_interval import OptionHistoryGreeksFirstOrderInterval from openapi_project.openapi_package.models.option_history_greeks_first_order_rate_type import OptionHistoryGreeksFirstOrderRateType -from openapi_project.openapi_package.models.option_history_greeks_first_order_response_200 import OptionHistoryGreeksFirstOrderResponse200 +from openapi_project.openapi_package.models.option_history_greeks_first_order_response_200_item import OptionHistoryGreeksFirstOrderResponse200Item from openapi_project.openapi_package.models.option_history_greeks_first_order_right import OptionHistoryGreeksFirstOrderRight from openapi_project.openapi_package.models.option_history_greeks_implied_volatility_format import OptionHistoryGreeksImpliedVolatilityFormat from openapi_project.openapi_package.models.option_history_greeks_implied_volatility_interval import OptionHistoryGreeksImpliedVolatilityInterval from openapi_project.openapi_package.models.option_history_greeks_implied_volatility_rate_type import OptionHistoryGreeksImpliedVolatilityRateType -from openapi_project.openapi_package.models.option_history_greeks_implied_volatility_response_200 import OptionHistoryGreeksImpliedVolatilityResponse200 +from openapi_project.openapi_package.models.option_history_greeks_implied_volatility_response_200_item import OptionHistoryGreeksImpliedVolatilityResponse200Item from openapi_project.openapi_package.models.option_history_greeks_implied_volatility_right import OptionHistoryGreeksImpliedVolatilityRight from openapi_project.openapi_package.models.option_history_greeks_second_order_format import OptionHistoryGreeksSecondOrderFormat from openapi_project.openapi_package.models.option_history_greeks_second_order_interval import OptionHistoryGreeksSecondOrderInterval from openapi_project.openapi_package.models.option_history_greeks_second_order_rate_type import OptionHistoryGreeksSecondOrderRateType -from openapi_project.openapi_package.models.option_history_greeks_second_order_response_200 import OptionHistoryGreeksSecondOrderResponse200 +from openapi_project.openapi_package.models.option_history_greeks_second_order_response_200_item import OptionHistoryGreeksSecondOrderResponse200Item from openapi_project.openapi_package.models.option_history_greeks_second_order_right import OptionHistoryGreeksSecondOrderRight from openapi_project.openapi_package.models.option_history_greeks_third_order_format import OptionHistoryGreeksThirdOrderFormat from openapi_project.openapi_package.models.option_history_greeks_third_order_interval import OptionHistoryGreeksThirdOrderInterval from openapi_project.openapi_package.models.option_history_greeks_third_order_rate_type import OptionHistoryGreeksThirdOrderRateType -from openapi_project.openapi_package.models.option_history_greeks_third_order_response_200 import OptionHistoryGreeksThirdOrderResponse200 +from openapi_project.openapi_package.models.option_history_greeks_third_order_response_200_item import OptionHistoryGreeksThirdOrderResponse200Item from openapi_project.openapi_package.models.option_history_greeks_third_order_right import OptionHistoryGreeksThirdOrderRight from openapi_project.openapi_package.models.option_history_ohlc_format import OptionHistoryOhlcFormat from openapi_project.openapi_package.models.option_history_ohlc_interval import OptionHistoryOhlcInterval -from openapi_project.openapi_package.models.option_history_ohlc_response_200 import OptionHistoryOhlcResponse200 +from openapi_project.openapi_package.models.option_history_ohlc_response_200_item import OptionHistoryOhlcResponse200Item from openapi_project.openapi_package.models.option_history_ohlc_right import OptionHistoryOhlcRight from openapi_project.openapi_package.models.option_history_open_interest_format import OptionHistoryOpenInterestFormat -from openapi_project.openapi_package.models.option_history_open_interest_response_200 import OptionHistoryOpenInterestResponse200 +from openapi_project.openapi_package.models.option_history_open_interest_response_200_item import OptionHistoryOpenInterestResponse200Item from openapi_project.openapi_package.models.option_history_open_interest_right import OptionHistoryOpenInterestRight from openapi_project.openapi_package.models.option_history_quote_format import OptionHistoryQuoteFormat from openapi_project.openapi_package.models.option_history_quote_interval import OptionHistoryQuoteInterval -from openapi_project.openapi_package.models.option_history_quote_response_200 import OptionHistoryQuoteResponse200 +from openapi_project.openapi_package.models.option_history_quote_response_200_item import OptionHistoryQuoteResponse200Item from openapi_project.openapi_package.models.option_history_quote_right import OptionHistoryQuoteRight from openapi_project.openapi_package.models.option_history_trade_format import OptionHistoryTradeFormat from openapi_project.openapi_package.models.option_history_trade_greeks_all_format import OptionHistoryTradeGreeksAllFormat from openapi_project.openapi_package.models.option_history_trade_greeks_all_rate_type import OptionHistoryTradeGreeksAllRateType -from openapi_project.openapi_package.models.option_history_trade_greeks_all_response_200 import OptionHistoryTradeGreeksAllResponse200 +from openapi_project.openapi_package.models.option_history_trade_greeks_all_response_200_item import OptionHistoryTradeGreeksAllResponse200Item from openapi_project.openapi_package.models.option_history_trade_greeks_all_right import OptionHistoryTradeGreeksAllRight from openapi_project.openapi_package.models.option_history_trade_greeks_first_order_format import OptionHistoryTradeGreeksFirstOrderFormat from openapi_project.openapi_package.models.option_history_trade_greeks_first_order_rate_type import OptionHistoryTradeGreeksFirstOrderRateType -from openapi_project.openapi_package.models.option_history_trade_greeks_first_order_response_200 import OptionHistoryTradeGreeksFirstOrderResponse200 +from openapi_project.openapi_package.models.option_history_trade_greeks_first_order_response_200_item import OptionHistoryTradeGreeksFirstOrderResponse200Item from openapi_project.openapi_package.models.option_history_trade_greeks_first_order_right import OptionHistoryTradeGreeksFirstOrderRight from openapi_project.openapi_package.models.option_history_trade_greeks_implied_volatility_format import OptionHistoryTradeGreeksImpliedVolatilityFormat from openapi_project.openapi_package.models.option_history_trade_greeks_implied_volatility_rate_type import OptionHistoryTradeGreeksImpliedVolatilityRateType -from openapi_project.openapi_package.models.option_history_trade_greeks_implied_volatility_response_200 import OptionHistoryTradeGreeksImpliedVolatilityResponse200 +from openapi_project.openapi_package.models.option_history_trade_greeks_implied_volatility_response_200_item import OptionHistoryTradeGreeksImpliedVolatilityResponse200Item from openapi_project.openapi_package.models.option_history_trade_greeks_implied_volatility_right import OptionHistoryTradeGreeksImpliedVolatilityRight from openapi_project.openapi_package.models.option_history_trade_greeks_second_order_format import OptionHistoryTradeGreeksSecondOrderFormat from openapi_project.openapi_package.models.option_history_trade_greeks_second_order_rate_type import OptionHistoryTradeGreeksSecondOrderRateType -from openapi_project.openapi_package.models.option_history_trade_greeks_second_order_response_200 import OptionHistoryTradeGreeksSecondOrderResponse200 +from openapi_project.openapi_package.models.option_history_trade_greeks_second_order_response_200_item import OptionHistoryTradeGreeksSecondOrderResponse200Item from openapi_project.openapi_package.models.option_history_trade_greeks_second_order_right import OptionHistoryTradeGreeksSecondOrderRight from openapi_project.openapi_package.models.option_history_trade_greeks_third_order_format import OptionHistoryTradeGreeksThirdOrderFormat from openapi_project.openapi_package.models.option_history_trade_greeks_third_order_rate_type import OptionHistoryTradeGreeksThirdOrderRateType -from openapi_project.openapi_package.models.option_history_trade_greeks_third_order_response_200 import OptionHistoryTradeGreeksThirdOrderResponse200 +from openapi_project.openapi_package.models.option_history_trade_greeks_third_order_response_200_item import OptionHistoryTradeGreeksThirdOrderResponse200Item from openapi_project.openapi_package.models.option_history_trade_greeks_third_order_right import OptionHistoryTradeGreeksThirdOrderRight from openapi_project.openapi_package.models.option_history_trade_quote_format import OptionHistoryTradeQuoteFormat -from openapi_project.openapi_package.models.option_history_trade_quote_response_200 import OptionHistoryTradeQuoteResponse200 +from openapi_project.openapi_package.models.option_history_trade_quote_response_200_item import OptionHistoryTradeQuoteResponse200Item from openapi_project.openapi_package.models.option_history_trade_quote_right import OptionHistoryTradeQuoteRight -from openapi_project.openapi_package.models.option_history_trade_response_200 import OptionHistoryTradeResponse200 +from openapi_project.openapi_package.models.option_history_trade_response_200_item import OptionHistoryTradeResponse200Item from openapi_project.openapi_package.models.option_history_trade_right import OptionHistoryTradeRight from openapi_project.openapi_package.models.option_list_contracts_format import OptionListContractsFormat from openapi_project.openapi_package.models.option_list_contracts_request_type import OptionListContractsRequestType -from openapi_project.openapi_package.models.option_list_contracts_response_200 import OptionListContractsResponse200 +from openapi_project.openapi_package.models.option_list_contracts_response_200_item import OptionListContractsResponse200Item from openapi_project.openapi_package.models.option_list_dates_format import OptionListDatesFormat from openapi_project.openapi_package.models.option_list_dates_request_type import OptionListDatesRequestType -from openapi_project.openapi_package.models.option_list_dates_response_200 import OptionListDatesResponse200 +from openapi_project.openapi_package.models.option_list_dates_response_200_item import OptionListDatesResponse200Item from openapi_project.openapi_package.models.option_list_dates_right import OptionListDatesRight from openapi_project.openapi_package.models.option_list_expirations_format import OptionListExpirationsFormat -from openapi_project.openapi_package.models.option_list_expirations_response_200 import OptionListExpirationsResponse200 +from openapi_project.openapi_package.models.option_list_expirations_response_200_item import OptionListExpirationsResponse200Item from openapi_project.openapi_package.models.option_list_strikes_format import OptionListStrikesFormat -from openapi_project.openapi_package.models.option_list_strikes_response_200 import OptionListStrikesResponse200 +from openapi_project.openapi_package.models.option_list_strikes_response_200_item import OptionListStrikesResponse200Item from openapi_project.openapi_package.models.option_list_symbols_format import OptionListSymbolsFormat -from openapi_project.openapi_package.models.option_list_symbols_response_200 import OptionListSymbolsResponse200 +from openapi_project.openapi_package.models.option_list_symbols_response_200_item import OptionListSymbolsResponse200Item from openapi_project.openapi_package.models.option_snapshot_greeks_all_format import OptionSnapshotGreeksAllFormat from openapi_project.openapi_package.models.option_snapshot_greeks_all_rate_type import OptionSnapshotGreeksAllRateType -from openapi_project.openapi_package.models.option_snapshot_greeks_all_response_200 import OptionSnapshotGreeksAllResponse200 +from openapi_project.openapi_package.models.option_snapshot_greeks_all_response_200_item import OptionSnapshotGreeksAllResponse200Item from openapi_project.openapi_package.models.option_snapshot_greeks_all_right import OptionSnapshotGreeksAllRight from openapi_project.openapi_package.models.option_snapshot_greeks_first_order_format import OptionSnapshotGreeksFirstOrderFormat from openapi_project.openapi_package.models.option_snapshot_greeks_first_order_rate_type import OptionSnapshotGreeksFirstOrderRateType -from openapi_project.openapi_package.models.option_snapshot_greeks_first_order_response_200 import OptionSnapshotGreeksFirstOrderResponse200 +from openapi_project.openapi_package.models.option_snapshot_greeks_first_order_response_200_item import OptionSnapshotGreeksFirstOrderResponse200Item from openapi_project.openapi_package.models.option_snapshot_greeks_first_order_right import OptionSnapshotGreeksFirstOrderRight from openapi_project.openapi_package.models.option_snapshot_greeks_implied_volatility_format import OptionSnapshotGreeksImpliedVolatilityFormat from openapi_project.openapi_package.models.option_snapshot_greeks_implied_volatility_rate_type import OptionSnapshotGreeksImpliedVolatilityRateType -from openapi_project.openapi_package.models.option_snapshot_greeks_implied_volatility_response_200 import OptionSnapshotGreeksImpliedVolatilityResponse200 +from openapi_project.openapi_package.models.option_snapshot_greeks_implied_volatility_response_200_item import OptionSnapshotGreeksImpliedVolatilityResponse200Item from openapi_project.openapi_package.models.option_snapshot_greeks_implied_volatility_right import OptionSnapshotGreeksImpliedVolatilityRight from openapi_project.openapi_package.models.option_snapshot_greeks_second_order_format import OptionSnapshotGreeksSecondOrderFormat from openapi_project.openapi_package.models.option_snapshot_greeks_second_order_rate_type import OptionSnapshotGreeksSecondOrderRateType -from openapi_project.openapi_package.models.option_snapshot_greeks_second_order_response_200 import OptionSnapshotGreeksSecondOrderResponse200 +from openapi_project.openapi_package.models.option_snapshot_greeks_second_order_response_200_item import OptionSnapshotGreeksSecondOrderResponse200Item from openapi_project.openapi_package.models.option_snapshot_greeks_second_order_right import OptionSnapshotGreeksSecondOrderRight from openapi_project.openapi_package.models.option_snapshot_greeks_third_order_format import OptionSnapshotGreeksThirdOrderFormat from openapi_project.openapi_package.models.option_snapshot_greeks_third_order_rate_type import OptionSnapshotGreeksThirdOrderRateType -from openapi_project.openapi_package.models.option_snapshot_greeks_third_order_response_200 import OptionSnapshotGreeksThirdOrderResponse200 +from openapi_project.openapi_package.models.option_snapshot_greeks_third_order_response_200_item import OptionSnapshotGreeksThirdOrderResponse200Item from openapi_project.openapi_package.models.option_snapshot_greeks_third_order_right import OptionSnapshotGreeksThirdOrderRight from openapi_project.openapi_package.models.option_snapshot_ohlc_format import OptionSnapshotOhlcFormat -from openapi_project.openapi_package.models.option_snapshot_ohlc_response_200 import OptionSnapshotOhlcResponse200 +from openapi_project.openapi_package.models.option_snapshot_ohlc_response_200_item import OptionSnapshotOhlcResponse200Item from openapi_project.openapi_package.models.option_snapshot_ohlc_right import OptionSnapshotOhlcRight from openapi_project.openapi_package.models.option_snapshot_open_interest_format import OptionSnapshotOpenInterestFormat -from openapi_project.openapi_package.models.option_snapshot_open_interest_response_200 import OptionSnapshotOpenInterestResponse200 +from openapi_project.openapi_package.models.option_snapshot_open_interest_response_200_item import OptionSnapshotOpenInterestResponse200Item from openapi_project.openapi_package.models.option_snapshot_open_interest_right import OptionSnapshotOpenInterestRight from openapi_project.openapi_package.models.option_snapshot_quote_format import OptionSnapshotQuoteFormat -from openapi_project.openapi_package.models.option_snapshot_quote_response_200 import OptionSnapshotQuoteResponse200 +from openapi_project.openapi_package.models.option_snapshot_quote_response_200_item import OptionSnapshotQuoteResponse200Item from openapi_project.openapi_package.models.option_snapshot_quote_right import OptionSnapshotQuoteRight from openapi_project.openapi_package.models.option_snapshot_trade_format import OptionSnapshotTradeFormat -from openapi_project.openapi_package.models.option_snapshot_trade_response_200 import OptionSnapshotTradeResponse200 +from openapi_project.openapi_package.models.option_snapshot_trade_response_200_item import OptionSnapshotTradeResponse200Item from openapi_project.openapi_package.models.option_snapshot_trade_right import OptionSnapshotTradeRight from openapi_project.openapi_package.models.stock_at_time_quote_format import StockAtTimeQuoteFormat -from openapi_project.openapi_package.models.stock_at_time_quote_response_200 import StockAtTimeQuoteResponse200 +from openapi_project.openapi_package.models.stock_at_time_quote_response_200_item import StockAtTimeQuoteResponse200Item from openapi_project.openapi_package.models.stock_at_time_quote_venue import StockAtTimeQuoteVenue from openapi_project.openapi_package.models.stock_at_time_trade_format import StockAtTimeTradeFormat -from openapi_project.openapi_package.models.stock_at_time_trade_response_200 import StockAtTimeTradeResponse200 +from openapi_project.openapi_package.models.stock_at_time_trade_response_200_item import StockAtTimeTradeResponse200Item from openapi_project.openapi_package.models.stock_at_time_trade_venue import StockAtTimeTradeVenue from openapi_project.openapi_package.models.stock_history_eod_format import StockHistoryEodFormat -from openapi_project.openapi_package.models.stock_history_eod_response_200 import StockHistoryEodResponse200 +from openapi_project.openapi_package.models.stock_history_eod_response_200_item import StockHistoryEodResponse200Item from openapi_project.openapi_package.models.stock_history_ohlc_format import StockHistoryOhlcFormat from openapi_project.openapi_package.models.stock_history_ohlc_interval import StockHistoryOhlcInterval -from openapi_project.openapi_package.models.stock_history_ohlc_response_200 import StockHistoryOhlcResponse200 +from openapi_project.openapi_package.models.stock_history_ohlc_response_200_item import StockHistoryOhlcResponse200Item from openapi_project.openapi_package.models.stock_history_ohlc_venue import StockHistoryOhlcVenue from openapi_project.openapi_package.models.stock_history_quote_format import StockHistoryQuoteFormat from openapi_project.openapi_package.models.stock_history_quote_interval import StockHistoryQuoteInterval -from openapi_project.openapi_package.models.stock_history_quote_response_200 import StockHistoryQuoteResponse200 +from openapi_project.openapi_package.models.stock_history_quote_response_200_item import StockHistoryQuoteResponse200Item from openapi_project.openapi_package.models.stock_history_quote_venue import StockHistoryQuoteVenue from openapi_project.openapi_package.models.stock_history_trade_format import StockHistoryTradeFormat from openapi_project.openapi_package.models.stock_history_trade_quote_format import StockHistoryTradeQuoteFormat @@ -160,173 +160,173 @@ from openapi_project.openapi_package.models.stock_history_trade_venue import StockHistoryTradeVenue from openapi_project.openapi_package.models.stock_list_dates_format import StockListDatesFormat from openapi_project.openapi_package.models.stock_list_dates_request_type import StockListDatesRequestType -from openapi_project.openapi_package.models.stock_list_dates_response_200 import StockListDatesResponse200 +from openapi_project.openapi_package.models.stock_list_dates_response_200_item import StockListDatesResponse200Item from openapi_project.openapi_package.models.stock_list_symbols_format import StockListSymbolsFormat -from openapi_project.openapi_package.models.stock_list_symbols_response_200 import StockListSymbolsResponse200 +from openapi_project.openapi_package.models.stock_list_symbols_response_200_item import StockListSymbolsResponse200Item from openapi_project.openapi_package.models.stock_snapshot_ohlc_format import StockSnapshotOhlcFormat -from openapi_project.openapi_package.models.stock_snapshot_ohlc_response_200 import StockSnapshotOhlcResponse200 +from openapi_project.openapi_package.models.stock_snapshot_ohlc_response_200_item import StockSnapshotOhlcResponse200Item from openapi_project.openapi_package.models.stock_snapshot_ohlc_venue import StockSnapshotOhlcVenue from openapi_project.openapi_package.models.stock_snapshot_quote_format import StockSnapshotQuoteFormat -from openapi_project.openapi_package.models.stock_snapshot_quote_response_200 import StockSnapshotQuoteResponse200 +from openapi_project.openapi_package.models.stock_snapshot_quote_response_200_item import StockSnapshotQuoteResponse200Item from openapi_project.openapi_package.models.stock_snapshot_quote_venue import StockSnapshotQuoteVenue from openapi_project.openapi_package.models.stock_snapshot_trade_format import StockSnapshotTradeFormat -from openapi_project.openapi_package.models.stock_snapshot_trade_response_200 import StockSnapshotTradeResponse200 +from openapi_project.openapi_package.models.stock_snapshot_trade_response_200_item import StockSnapshotTradeResponse200Item from openapi_project.openapi_package.models.stock_snapshot_trade_venue import StockSnapshotTradeVenue __all__ = ( "IndexAtTimePriceFormat", - "IndexAtTimePriceResponse200", + "IndexAtTimePriceResponse200Item", "IndexHistoryEodFormat", - "IndexHistoryEodResponse200", + "IndexHistoryEodResponse200Item", "IndexHistoryOhlcFormat", "IndexHistoryOhlcInterval", - "IndexHistoryOhlcResponse200", + "IndexHistoryOhlcResponse200Item", "IndexHistoryPriceFormat", "IndexHistoryPriceInterval", - "IndexHistoryPriceResponse200", + "IndexHistoryPriceResponse200Item", "IndexListDatesFormat", - "IndexListDatesResponse200", + "IndexListDatesResponse200Item", "IndexListSymbolsFormat", - "IndexListSymbolsResponse200", + "IndexListSymbolsResponse200Item", "IndexSnapshotOhlcFormat", - "IndexSnapshotOhlcResponse200", + "IndexSnapshotOhlcResponse200Item", "IndexSnapshotPriceFormat", - "IndexSnapshotPriceResponse200", + "IndexSnapshotPriceResponse200Item", "OptionAtTimeQuoteFormat", - "OptionAtTimeQuoteResponse200", + "OptionAtTimeQuoteResponse200Item", "OptionAtTimeQuoteRight", "OptionAtTimeTradeFormat", - "OptionAtTimeTradeResponse200", + "OptionAtTimeTradeResponse200Item", "OptionAtTimeTradeRight", "OptionHistoryEodFormat", - "OptionHistoryEodResponse200", + "OptionHistoryEodResponse200Item", "OptionHistoryEodRight", "OptionHistoryGreeksAllFormat", "OptionHistoryGreeksAllInterval", "OptionHistoryGreeksAllRateType", - "OptionHistoryGreeksAllResponse200", + "OptionHistoryGreeksAllResponse200Item", "OptionHistoryGreeksAllRight", "OptionHistoryGreeksEodFormat", "OptionHistoryGreeksEodRateType", - "OptionHistoryGreeksEodResponse200", + "OptionHistoryGreeksEodResponse200Item", "OptionHistoryGreeksEodRight", "OptionHistoryGreeksFirstOrderFormat", "OptionHistoryGreeksFirstOrderInterval", "OptionHistoryGreeksFirstOrderRateType", - "OptionHistoryGreeksFirstOrderResponse200", + "OptionHistoryGreeksFirstOrderResponse200Item", "OptionHistoryGreeksFirstOrderRight", "OptionHistoryGreeksImpliedVolatilityFormat", "OptionHistoryGreeksImpliedVolatilityInterval", "OptionHistoryGreeksImpliedVolatilityRateType", - "OptionHistoryGreeksImpliedVolatilityResponse200", + "OptionHistoryGreeksImpliedVolatilityResponse200Item", "OptionHistoryGreeksImpliedVolatilityRight", "OptionHistoryGreeksSecondOrderFormat", "OptionHistoryGreeksSecondOrderInterval", "OptionHistoryGreeksSecondOrderRateType", - "OptionHistoryGreeksSecondOrderResponse200", + "OptionHistoryGreeksSecondOrderResponse200Item", "OptionHistoryGreeksSecondOrderRight", "OptionHistoryGreeksThirdOrderFormat", "OptionHistoryGreeksThirdOrderInterval", "OptionHistoryGreeksThirdOrderRateType", - "OptionHistoryGreeksThirdOrderResponse200", + "OptionHistoryGreeksThirdOrderResponse200Item", "OptionHistoryGreeksThirdOrderRight", "OptionHistoryOhlcFormat", "OptionHistoryOhlcInterval", - "OptionHistoryOhlcResponse200", + "OptionHistoryOhlcResponse200Item", "OptionHistoryOhlcRight", "OptionHistoryOpenInterestFormat", - "OptionHistoryOpenInterestResponse200", + "OptionHistoryOpenInterestResponse200Item", "OptionHistoryOpenInterestRight", "OptionHistoryQuoteFormat", "OptionHistoryQuoteInterval", - "OptionHistoryQuoteResponse200", + "OptionHistoryQuoteResponse200Item", "OptionHistoryQuoteRight", "OptionHistoryTradeFormat", "OptionHistoryTradeGreeksAllFormat", "OptionHistoryTradeGreeksAllRateType", - "OptionHistoryTradeGreeksAllResponse200", + "OptionHistoryTradeGreeksAllResponse200Item", "OptionHistoryTradeGreeksAllRight", "OptionHistoryTradeGreeksFirstOrderFormat", "OptionHistoryTradeGreeksFirstOrderRateType", - "OptionHistoryTradeGreeksFirstOrderResponse200", + "OptionHistoryTradeGreeksFirstOrderResponse200Item", "OptionHistoryTradeGreeksFirstOrderRight", "OptionHistoryTradeGreeksImpliedVolatilityFormat", "OptionHistoryTradeGreeksImpliedVolatilityRateType", - "OptionHistoryTradeGreeksImpliedVolatilityResponse200", + "OptionHistoryTradeGreeksImpliedVolatilityResponse200Item", "OptionHistoryTradeGreeksImpliedVolatilityRight", "OptionHistoryTradeGreeksSecondOrderFormat", "OptionHistoryTradeGreeksSecondOrderRateType", - "OptionHistoryTradeGreeksSecondOrderResponse200", + "OptionHistoryTradeGreeksSecondOrderResponse200Item", "OptionHistoryTradeGreeksSecondOrderRight", "OptionHistoryTradeGreeksThirdOrderFormat", "OptionHistoryTradeGreeksThirdOrderRateType", - "OptionHistoryTradeGreeksThirdOrderResponse200", + "OptionHistoryTradeGreeksThirdOrderResponse200Item", "OptionHistoryTradeGreeksThirdOrderRight", "OptionHistoryTradeQuoteFormat", - "OptionHistoryTradeQuoteResponse200", + "OptionHistoryTradeQuoteResponse200Item", "OptionHistoryTradeQuoteRight", - "OptionHistoryTradeResponse200", + "OptionHistoryTradeResponse200Item", "OptionHistoryTradeRight", "OptionListContractsFormat", "OptionListContractsRequestType", - "OptionListContractsResponse200", + "OptionListContractsResponse200Item", "OptionListDatesFormat", "OptionListDatesRequestType", - "OptionListDatesResponse200", + "OptionListDatesResponse200Item", "OptionListDatesRight", "OptionListExpirationsFormat", - "OptionListExpirationsResponse200", + "OptionListExpirationsResponse200Item", "OptionListStrikesFormat", - "OptionListStrikesResponse200", + "OptionListStrikesResponse200Item", "OptionListSymbolsFormat", - "OptionListSymbolsResponse200", + "OptionListSymbolsResponse200Item", "OptionSnapshotGreeksAllFormat", "OptionSnapshotGreeksAllRateType", - "OptionSnapshotGreeksAllResponse200", + "OptionSnapshotGreeksAllResponse200Item", "OptionSnapshotGreeksAllRight", "OptionSnapshotGreeksFirstOrderFormat", "OptionSnapshotGreeksFirstOrderRateType", - "OptionSnapshotGreeksFirstOrderResponse200", + "OptionSnapshotGreeksFirstOrderResponse200Item", "OptionSnapshotGreeksFirstOrderRight", "OptionSnapshotGreeksImpliedVolatilityFormat", "OptionSnapshotGreeksImpliedVolatilityRateType", - "OptionSnapshotGreeksImpliedVolatilityResponse200", + "OptionSnapshotGreeksImpliedVolatilityResponse200Item", "OptionSnapshotGreeksImpliedVolatilityRight", "OptionSnapshotGreeksSecondOrderFormat", "OptionSnapshotGreeksSecondOrderRateType", - "OptionSnapshotGreeksSecondOrderResponse200", + "OptionSnapshotGreeksSecondOrderResponse200Item", "OptionSnapshotGreeksSecondOrderRight", "OptionSnapshotGreeksThirdOrderFormat", "OptionSnapshotGreeksThirdOrderRateType", - "OptionSnapshotGreeksThirdOrderResponse200", + "OptionSnapshotGreeksThirdOrderResponse200Item", "OptionSnapshotGreeksThirdOrderRight", "OptionSnapshotOhlcFormat", - "OptionSnapshotOhlcResponse200", + "OptionSnapshotOhlcResponse200Item", "OptionSnapshotOhlcRight", "OptionSnapshotOpenInterestFormat", - "OptionSnapshotOpenInterestResponse200", + "OptionSnapshotOpenInterestResponse200Item", "OptionSnapshotOpenInterestRight", "OptionSnapshotQuoteFormat", - "OptionSnapshotQuoteResponse200", + "OptionSnapshotQuoteResponse200Item", "OptionSnapshotQuoteRight", "OptionSnapshotTradeFormat", - "OptionSnapshotTradeResponse200", + "OptionSnapshotTradeResponse200Item", "OptionSnapshotTradeRight", "StockAtTimeQuoteFormat", - "StockAtTimeQuoteResponse200", + "StockAtTimeQuoteResponse200Item", "StockAtTimeQuoteVenue", "StockAtTimeTradeFormat", - "StockAtTimeTradeResponse200", + "StockAtTimeTradeResponse200Item", "StockAtTimeTradeVenue", "StockHistoryEodFormat", - "StockHistoryEodResponse200", + "StockHistoryEodResponse200Item", "StockHistoryOhlcFormat", "StockHistoryOhlcInterval", - "StockHistoryOhlcResponse200", + "StockHistoryOhlcResponse200Item", "StockHistoryOhlcVenue", "StockHistoryQuoteFormat", "StockHistoryQuoteInterval", - "StockHistoryQuoteResponse200", + "StockHistoryQuoteResponse200Item", "StockHistoryQuoteVenue", "StockHistoryTradeFormat", "StockHistoryTradeQuoteFormat", @@ -334,16 +334,16 @@ "StockHistoryTradeVenue", "StockListDatesFormat", "StockListDatesRequestType", - "StockListDatesResponse200", + "StockListDatesResponse200Item", "StockListSymbolsFormat", - "StockListSymbolsResponse200", + "StockListSymbolsResponse200Item", "StockSnapshotOhlcFormat", - "StockSnapshotOhlcResponse200", + "StockSnapshotOhlcResponse200Item", "StockSnapshotOhlcVenue", "StockSnapshotQuoteFormat", - "StockSnapshotQuoteResponse200", + "StockSnapshotQuoteResponse200Item", "StockSnapshotQuoteVenue", "StockSnapshotTradeFormat", - "StockSnapshotTradeResponse200", + "StockSnapshotTradeResponse200Item", "StockSnapshotTradeVenue", ) diff --git a/openapi_project/openapi_package/models/index_at_time_price_response_200.py b/openapi_project/openapi_package/models/index_at_time_price_response_200_item.py similarity index 59% rename from openapi_project/openapi_package/models/index_at_time_price_response_200.py rename to openapi_project/openapi_package/models/index_at_time_price_response_200_item.py index 7b748975e..f30bee935 100644 --- a/openapi_project/openapi_package/models/index_at_time_price_response_200.py +++ b/openapi_project/openapi_package/models/index_at_time_price_response_200_item.py @@ -8,43 +8,42 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="IndexAtTimePriceResponse200") +T = TypeVar("T", bound="IndexAtTimePriceResponse200Item") @_attrs_define -class IndexAtTimePriceResponse200: +class IndexAtTimePriceResponse200Item: """ Attributes: - sequence (list[int]): - condition (list[int]): - size (list[int]): - price (list[float]): - ext_condition2 (list[int]): - ext_condition1 (list[int]): - ext_condition4 (list[int]): - exchange (list[int]): - ext_condition3 (list[int]): - timestamp (list[str]): + sequence (int): + condition (int): + size (int): + price (float): + ext_condition2 (int): + ext_condition1 (int): + ext_condition4 (int): + exchange (int): + ext_condition3 (int): + timestamp (str): """ - sequence: list[int] - condition: list[int] - size: list[int] - price: list[float] - ext_condition2: list[int] - ext_condition1: list[int] - ext_condition4: list[int] - exchange: list[int] - ext_condition3: list[int] - timestamp: list[str] + sequence: int + condition: int + size: int + price: float + ext_condition2: int + ext_condition1: int + ext_condition4: int + exchange: int + ext_condition3: int + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -54,45 +53,25 @@ class IndexAtTimePriceResponse200: def to_dict(self) -> dict[str, Any]: sequence = self.sequence - - condition = self.condition - - size = self.size - - price = self.price - - ext_condition2 = self.ext_condition2 - - ext_condition1 = self.ext_condition1 - - ext_condition4 = self.ext_condition4 - - exchange = self.exchange - - ext_condition3 = self.ext_condition3 - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -118,37 +97,27 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - sequence = cast(list[int], d.pop("sequence")) - - - condition = cast(list[int], d.pop("condition")) - - - size = cast(list[int], d.pop("size")) - - - price = cast(list[float], d.pop("price")) - - - ext_condition2 = cast(list[int], d.pop("ext_condition2")) - - - ext_condition1 = cast(list[int], d.pop("ext_condition1")) + sequence = d.pop("sequence") + condition = d.pop("condition") - ext_condition4 = cast(list[int], d.pop("ext_condition4")) + size = d.pop("size") + price = d.pop("price") - exchange = cast(list[int], d.pop("exchange")) + ext_condition2 = d.pop("ext_condition2") + ext_condition1 = d.pop("ext_condition1") - ext_condition3 = cast(list[int], d.pop("ext_condition3")) + ext_condition4 = d.pop("ext_condition4") + exchange = d.pop("exchange") - timestamp = cast(list[str], d.pop("timestamp")) + ext_condition3 = d.pop("ext_condition3") + timestamp = d.pop("timestamp") - index_at_time_price_response_200 = cls( + index_at_time_price_response_200_item = cls( sequence=sequence, condition=condition, size=size, @@ -163,8 +132,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - index_at_time_price_response_200.additional_properties = d - return index_at_time_price_response_200 + index_at_time_price_response_200_item.additional_properties = d + return index_at_time_price_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/stock_history_eod_response_200.py b/openapi_project/openapi_package/models/index_history_eod_response_200_item.py similarity index 55% rename from openapi_project/openapi_package/models/stock_history_eod_response_200.py rename to openapi_project/openapi_package/models/index_history_eod_response_200_item.py index 94754c5fb..a9e98c48e 100644 --- a/openapi_project/openapi_package/models/stock_history_eod_response_200.py +++ b/openapi_project/openapi_package/models/index_history_eod_response_200_item.py @@ -8,55 +8,54 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="StockHistoryEodResponse200") +T = TypeVar("T", bound="IndexHistoryEodResponse200Item") @_attrs_define -class StockHistoryEodResponse200: +class IndexHistoryEodResponse200Item: """ Attributes: - ask_size (list[int]): - last_trade (list[str]): - created (list[str]): - ask_condition (list[int]): - count (list[int]): - volume (list[int]): - high (list[float]): - low (list[float]): - bid_size (list[int]): - ask_exchange (list[int]): - bid_exchange (list[int]): - ask (list[float]): - bid (list[float]): - bid_condition (list[int]): - close (list[float]): - open_ (list[float]): + ask_size (int): + last_trade (str): + created (str): + ask_condition (int): + count (int): + volume (int): + high (float): + low (float): + bid_size (int): + ask_exchange (int): + bid_exchange (int): + ask (float): + bid (float): + bid_condition (int): + close (float): + open_ (float): """ - ask_size: list[int] - last_trade: list[str] - created: list[str] - ask_condition: list[int] - count: list[int] - volume: list[int] - high: list[float] - low: list[float] - bid_size: list[int] - ask_exchange: list[int] - bid_exchange: list[int] - ask: list[float] - bid: list[float] - bid_condition: list[int] - close: list[float] - open_: list[float] + ask_size: int + last_trade: str + created: str + ask_condition: int + count: int + volume: int + high: float + low: float + bid_size: int + ask_exchange: int + bid_exchange: int + ask: float + bid: float + bid_condition: int + close: float + open_: float additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -66,69 +65,37 @@ class StockHistoryEodResponse200: def to_dict(self) -> dict[str, Any]: ask_size = self.ask_size - - last_trade = self.last_trade - - created = self.created - - ask_condition = self.ask_condition - - count = self.count - - volume = self.volume - - high = self.high - - low = self.low - - bid_size = self.bid_size - - ask_exchange = self.ask_exchange - - bid_exchange = self.bid_exchange - - ask = self.ask - - bid = self.bid - - bid_condition = self.bid_condition - - close = self.close - - open_ = self.open_ - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -160,55 +127,39 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - ask_size = cast(list[int], d.pop("ask_size")) - - - last_trade = cast(list[str], d.pop("last_trade")) - - - created = cast(list[str], d.pop("created")) - - - ask_condition = cast(list[int], d.pop("ask_condition")) - - - count = cast(list[int], d.pop("count")) - - - volume = cast(list[int], d.pop("volume")) - - - high = cast(list[float], d.pop("high")) - - - low = cast(list[float], d.pop("low")) - - - bid_size = cast(list[int], d.pop("bid_size")) + ask_size = d.pop("ask_size") + last_trade = d.pop("last_trade") - ask_exchange = cast(list[int], d.pop("ask_exchange")) + created = d.pop("created") + ask_condition = d.pop("ask_condition") - bid_exchange = cast(list[int], d.pop("bid_exchange")) + count = d.pop("count") + volume = d.pop("volume") - ask = cast(list[float], d.pop("ask")) + high = d.pop("high") + low = d.pop("low") - bid = cast(list[float], d.pop("bid")) + bid_size = d.pop("bid_size") + ask_exchange = d.pop("ask_exchange") - bid_condition = cast(list[int], d.pop("bid_condition")) + bid_exchange = d.pop("bid_exchange") + ask = d.pop("ask") - close = cast(list[float], d.pop("close")) + bid = d.pop("bid") + bid_condition = d.pop("bid_condition") - open_ = cast(list[float], d.pop("open")) + close = d.pop("close") + open_ = d.pop("open") - stock_history_eod_response_200 = cls( + index_history_eod_response_200_item = cls( ask_size=ask_size, last_trade=last_trade, created=created, @@ -229,8 +180,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - stock_history_eod_response_200.additional_properties = d - return stock_history_eod_response_200 + index_history_eod_response_200_item.additional_properties = d + return index_history_eod_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/index_history_ohlc_response_200.py b/openapi_project/openapi_package/models/index_history_ohlc_response_200_item.py similarity index 60% rename from openapi_project/openapi_package/models/index_history_ohlc_response_200.py rename to openapi_project/openapi_package/models/index_history_ohlc_response_200_item.py index 7da68be62..ac472bf0e 100644 --- a/openapi_project/openapi_package/models/index_history_ohlc_response_200.py +++ b/openapi_project/openapi_package/models/index_history_ohlc_response_200_item.py @@ -8,39 +8,38 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="IndexHistoryOhlcResponse200") +T = TypeVar("T", bound="IndexHistoryOhlcResponse200Item") @_attrs_define -class IndexHistoryOhlcResponse200: +class IndexHistoryOhlcResponse200Item: """ Attributes: - volume (list[int]): - high (list[float]): - low (list[float]): - vwap (list[float]): - count (list[int]): - close (list[float]): - open_ (list[float]): - timestamp (list[str]): + volume (int): + high (float): + low (float): + vwap (float): + count (int): + close (float): + open_ (float): + timestamp (str): """ - volume: list[int] - high: list[float] - low: list[float] - vwap: list[float] - count: list[int] - close: list[float] - open_: list[float] - timestamp: list[str] + volume: int + high: float + low: float + vwap: float + count: int + close: float + open_: float + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -50,37 +49,21 @@ class IndexHistoryOhlcResponse200: def to_dict(self) -> dict[str, Any]: volume = self.volume - - high = self.high - - low = self.low - - vwap = self.vwap - - count = self.count - - close = self.close - - open_ = self.open_ - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -104,31 +87,23 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - volume = cast(list[int], d.pop("volume")) - - - high = cast(list[float], d.pop("high")) - - - low = cast(list[float], d.pop("low")) - - - vwap = cast(list[float], d.pop("vwap")) - - - count = cast(list[int], d.pop("count")) + volume = d.pop("volume") + high = d.pop("high") - close = cast(list[float], d.pop("close")) + low = d.pop("low") + vwap = d.pop("vwap") - open_ = cast(list[float], d.pop("open")) + count = d.pop("count") + close = d.pop("close") - timestamp = cast(list[str], d.pop("timestamp")) + open_ = d.pop("open") + timestamp = d.pop("timestamp") - index_history_ohlc_response_200 = cls( + index_history_ohlc_response_200_item = cls( volume=volume, high=high, low=low, @@ -141,8 +116,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - index_history_ohlc_response_200.additional_properties = d - return index_history_ohlc_response_200 + index_history_ohlc_response_200_item.additional_properties = d + return index_history_ohlc_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/index_history_price_response_200.py b/openapi_project/openapi_package/models/index_history_price_response_200_item.py similarity index 71% rename from openapi_project/openapi_package/models/index_history_price_response_200.py rename to openapi_project/openapi_package/models/index_history_price_response_200_item.py index 78f0f2014..b60dd4543 100644 --- a/openapi_project/openapi_package/models/index_history_price_response_200.py +++ b/openapi_project/openapi_package/models/index_history_price_response_200_item.py @@ -8,27 +8,26 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="IndexHistoryPriceResponse200") +T = TypeVar("T", bound="IndexHistoryPriceResponse200Item") @_attrs_define -class IndexHistoryPriceResponse200: +class IndexHistoryPriceResponse200Item: """ Attributes: - price (list[float]): - timestamp (list[str]): + price (float): + timestamp (str): """ - price: list[float] - timestamp: list[str] + price: float + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -38,13 +37,9 @@ class IndexHistoryPriceResponse200: def to_dict(self) -> dict[str, Any]: price = self.price - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -62,21 +57,19 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - price = cast(list[float], d.pop("price")) - - - timestamp = cast(list[str], d.pop("timestamp")) + price = d.pop("price") + timestamp = d.pop("timestamp") - index_history_price_response_200 = cls( + index_history_price_response_200_item = cls( price=price, timestamp=timestamp, ) - index_history_price_response_200.additional_properties = d - return index_history_price_response_200 + index_history_price_response_200_item.additional_properties = d + return index_history_price_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/index_list_dates_response_200.py b/openapi_project/openapi_package/models/index_list_dates_response_200_item.py similarity index 72% rename from openapi_project/openapi_package/models/index_list_dates_response_200.py rename to openapi_project/openapi_package/models/index_list_dates_response_200_item.py index 962277a6f..77a4a8ec8 100644 --- a/openapi_project/openapi_package/models/index_list_dates_response_200.py +++ b/openapi_project/openapi_package/models/index_list_dates_response_200_item.py @@ -8,27 +8,26 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="IndexListDatesResponse200") +T = TypeVar("T", bound="IndexListDatesResponse200Item") @_attrs_define -class IndexListDatesResponse200: +class IndexListDatesResponse200Item: """ Attributes: - date (list[str]): - symbol (list[str]): + date (str): + symbol (str): """ - date: list[str] - symbol: list[str] + date: str + symbol: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -38,13 +37,9 @@ class IndexListDatesResponse200: def to_dict(self) -> dict[str, Any]: date = self.date - - symbol = self.symbol - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -62,21 +57,19 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - date = cast(list[str], d.pop("date")) - - - symbol = cast(list[str], d.pop("symbol")) + date = d.pop("date") + symbol = d.pop("symbol") - index_list_dates_response_200 = cls( + index_list_dates_response_200_item = cls( date=date, symbol=symbol, ) - index_list_dates_response_200.additional_properties = d - return index_list_dates_response_200 + index_list_dates_response_200_item.additional_properties = d + return index_list_dates_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/stock_list_symbols_response_200.py b/openapi_project/openapi_package/models/index_list_symbols_response_200_item.py similarity index 75% rename from openapi_project/openapi_package/models/stock_list_symbols_response_200.py rename to openapi_project/openapi_package/models/index_list_symbols_response_200_item.py index 6c6576ed8..e695b9657 100644 --- a/openapi_project/openapi_package/models/stock_list_symbols_response_200.py +++ b/openapi_project/openapi_package/models/index_list_symbols_response_200_item.py @@ -8,25 +8,24 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="StockListSymbolsResponse200") +T = TypeVar("T", bound="IndexListSymbolsResponse200Item") @_attrs_define -class StockListSymbolsResponse200: +class IndexListSymbolsResponse200Item: """ Attributes: - symbol (list[str]): + symbol (str): """ - symbol: list[str] + symbol: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -37,8 +36,6 @@ def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -55,17 +52,16 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - + symbol = d.pop("symbol") - stock_list_symbols_response_200 = cls( + index_list_symbols_response_200_item = cls( symbol=symbol, ) - stock_list_symbols_response_200.additional_properties = d - return stock_list_symbols_response_200 + index_list_symbols_response_200_item.additional_properties = d + return index_list_symbols_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/index_snapshot_ohlc_response_200.py b/openapi_project/openapi_package/models/index_snapshot_ohlc_response_200_item.py similarity index 60% rename from openapi_project/openapi_package/models/index_snapshot_ohlc_response_200.py rename to openapi_project/openapi_package/models/index_snapshot_ohlc_response_200_item.py index 1c0410962..ea63ae759 100644 --- a/openapi_project/openapi_package/models/index_snapshot_ohlc_response_200.py +++ b/openapi_project/openapi_package/models/index_snapshot_ohlc_response_200_item.py @@ -8,39 +8,38 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="IndexSnapshotOhlcResponse200") +T = TypeVar("T", bound="IndexSnapshotOhlcResponse200Item") @_attrs_define -class IndexSnapshotOhlcResponse200: +class IndexSnapshotOhlcResponse200Item: """ Attributes: - volume (list[int]): - symbol (list[str]): - high (list[float]): - low (list[float]): - count (list[int]): - close (list[float]): - open_ (list[float]): - timestamp (list[str]): + volume (int): + symbol (str): + high (float): + low (float): + count (int): + close (float): + open_ (float): + timestamp (str): """ - volume: list[int] - symbol: list[str] - high: list[float] - low: list[float] - count: list[int] - close: list[float] - open_: list[float] - timestamp: list[str] + volume: int + symbol: str + high: float + low: float + count: int + close: float + open_: float + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -50,37 +49,21 @@ class IndexSnapshotOhlcResponse200: def to_dict(self) -> dict[str, Any]: volume = self.volume - - symbol = self.symbol - - high = self.high - - low = self.low - - count = self.count - - close = self.close - - open_ = self.open_ - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -104,31 +87,23 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - volume = cast(list[int], d.pop("volume")) - - - symbol = cast(list[str], d.pop("symbol")) - - - high = cast(list[float], d.pop("high")) - - - low = cast(list[float], d.pop("low")) - - - count = cast(list[int], d.pop("count")) + volume = d.pop("volume") + symbol = d.pop("symbol") - close = cast(list[float], d.pop("close")) + high = d.pop("high") + low = d.pop("low") - open_ = cast(list[float], d.pop("open")) + count = d.pop("count") + close = d.pop("close") - timestamp = cast(list[str], d.pop("timestamp")) + open_ = d.pop("open") + timestamp = d.pop("timestamp") - index_snapshot_ohlc_response_200 = cls( + index_snapshot_ohlc_response_200_item = cls( volume=volume, symbol=symbol, high=high, @@ -141,8 +116,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - index_snapshot_ohlc_response_200.additional_properties = d - return index_snapshot_ohlc_response_200 + index_snapshot_ohlc_response_200_item.additional_properties = d + return index_snapshot_ohlc_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/index_snapshot_price_response_200.py b/openapi_project/openapi_package/models/index_snapshot_price_response_200_item.py similarity index 69% rename from openapi_project/openapi_package/models/index_snapshot_price_response_200.py rename to openapi_project/openapi_package/models/index_snapshot_price_response_200_item.py index 46c01cedf..d5e5728a3 100644 --- a/openapi_project/openapi_package/models/index_snapshot_price_response_200.py +++ b/openapi_project/openapi_package/models/index_snapshot_price_response_200_item.py @@ -8,29 +8,28 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="IndexSnapshotPriceResponse200") +T = TypeVar("T", bound="IndexSnapshotPriceResponse200Item") @_attrs_define -class IndexSnapshotPriceResponse200: +class IndexSnapshotPriceResponse200Item: """ Attributes: - symbol (list[str]): - price (list[float]): - timestamp (list[str]): + symbol (str): + price (float): + timestamp (str): """ - symbol: list[str] - price: list[float] - timestamp: list[str] + symbol: str + price: float + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -40,17 +39,11 @@ class IndexSnapshotPriceResponse200: def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - price = self.price - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -69,16 +62,13 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - price = cast(list[float], d.pop("price")) - + symbol = d.pop("symbol") - timestamp = cast(list[str], d.pop("timestamp")) + price = d.pop("price") + timestamp = d.pop("timestamp") - index_snapshot_price_response_200 = cls( + index_snapshot_price_response_200_item = cls( symbol=symbol, price=price, timestamp=timestamp, @@ -86,8 +76,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - index_snapshot_price_response_200.additional_properties = d - return index_snapshot_price_response_200 + index_snapshot_price_response_200_item.additional_properties = d + return index_snapshot_price_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_at_time_quote_response_200.py b/openapi_project/openapi_package/models/option_at_time_quote_response_200_item.py similarity index 56% rename from openapi_project/openapi_package/models/option_at_time_quote_response_200.py rename to openapi_project/openapi_package/models/option_at_time_quote_response_200_item.py index d6f4d277b..6078bacfd 100644 --- a/openapi_project/openapi_package/models/option_at_time_quote_response_200.py +++ b/openapi_project/openapi_package/models/option_at_time_quote_response_200_item.py @@ -8,49 +8,48 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionAtTimeQuoteResponse200") +T = TypeVar("T", bound="OptionAtTimeQuoteResponse200Item") @_attrs_define -class OptionAtTimeQuoteResponse200: +class OptionAtTimeQuoteResponse200Item: """ Attributes: - symbol (list[str]): - ask_size (list[int]): - ask_condition (list[int]): - strike (list[float]): - right (list[str]): - bid_size (list[int]): - ask_exchange (list[int]): - bid_exchange (list[int]): - ask (list[float]): - expiration (list[str]): - bid (list[float]): - bid_condition (list[int]): - timestamp (list[str]): + symbol (str): + ask_size (int): + ask_condition (int): + strike (float): + right (str): + bid_size (int): + ask_exchange (int): + bid_exchange (int): + ask (float): + expiration (str): + bid (float): + bid_condition (int): + timestamp (str): """ - symbol: list[str] - ask_size: list[int] - ask_condition: list[int] - strike: list[float] - right: list[str] - bid_size: list[int] - ask_exchange: list[int] - bid_exchange: list[int] - ask: list[float] - expiration: list[str] - bid: list[float] - bid_condition: list[int] - timestamp: list[str] + symbol: str + ask_size: int + ask_condition: int + strike: float + right: str + bid_size: int + ask_exchange: int + bid_exchange: int + ask: float + expiration: str + bid: float + bid_condition: int + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -60,57 +59,31 @@ class OptionAtTimeQuoteResponse200: def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - ask_size = self.ask_size - - ask_condition = self.ask_condition - - strike = self.strike - - right = self.right - - bid_size = self.bid_size - - ask_exchange = self.ask_exchange - - bid_exchange = self.bid_exchange - - ask = self.ask - - expiration = self.expiration - - bid = self.bid - - bid_condition = self.bid_condition - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -139,46 +112,33 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - ask_size = cast(list[int], d.pop("ask_size")) - - - ask_condition = cast(list[int], d.pop("ask_condition")) - - - strike = cast(list[float], d.pop("strike")) - - - right = cast(list[str], d.pop("right")) - - - bid_size = cast(list[int], d.pop("bid_size")) - - - ask_exchange = cast(list[int], d.pop("ask_exchange")) - + symbol = d.pop("symbol") - bid_exchange = cast(list[int], d.pop("bid_exchange")) + ask_size = d.pop("ask_size") + ask_condition = d.pop("ask_condition") - ask = cast(list[float], d.pop("ask")) + strike = d.pop("strike") + right = d.pop("right") - expiration = cast(list[str], d.pop("expiration")) + bid_size = d.pop("bid_size") + ask_exchange = d.pop("ask_exchange") - bid = cast(list[float], d.pop("bid")) + bid_exchange = d.pop("bid_exchange") + ask = d.pop("ask") - bid_condition = cast(list[int], d.pop("bid_condition")) + expiration = d.pop("expiration") + bid = d.pop("bid") - timestamp = cast(list[str], d.pop("timestamp")) + bid_condition = d.pop("bid_condition") + timestamp = d.pop("timestamp") - option_at_time_quote_response_200 = cls( + option_at_time_quote_response_200_item = cls( symbol=symbol, ask_size=ask_size, ask_condition=ask_condition, @@ -196,8 +156,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - option_at_time_quote_response_200.additional_properties = d - return option_at_time_quote_response_200 + option_at_time_quote_response_200_item.additional_properties = d + return option_at_time_quote_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_at_time_trade_response_200.py b/openapi_project/openapi_package/models/option_at_time_trade_response_200_item.py similarity index 56% rename from openapi_project/openapi_package/models/option_at_time_trade_response_200.py rename to openapi_project/openapi_package/models/option_at_time_trade_response_200_item.py index 99ce63425..1d627983d 100644 --- a/openapi_project/openapi_package/models/option_at_time_trade_response_200.py +++ b/openapi_project/openapi_package/models/option_at_time_trade_response_200_item.py @@ -8,51 +8,50 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionAtTimeTradeResponse200") +T = TypeVar("T", bound="OptionAtTimeTradeResponse200Item") @_attrs_define -class OptionAtTimeTradeResponse200: +class OptionAtTimeTradeResponse200Item: """ Attributes: - symbol (list[str]): - strike (list[float]): - right (list[str]): - sequence (list[int]): - condition (list[int]): - size (list[int]): - price (list[float]): - ext_condition2 (list[int]): - ext_condition1 (list[int]): - expiration (list[str]): - ext_condition4 (list[int]): - exchange (list[int]): - ext_condition3 (list[int]): - timestamp (list[str]): + symbol (str): + strike (float): + right (str): + sequence (int): + condition (int): + size (int): + price (float): + ext_condition2 (int): + ext_condition1 (int): + expiration (str): + ext_condition4 (int): + exchange (int): + ext_condition3 (int): + timestamp (str): """ - symbol: list[str] - strike: list[float] - right: list[str] - sequence: list[int] - condition: list[int] - size: list[int] - price: list[float] - ext_condition2: list[int] - ext_condition1: list[int] - expiration: list[str] - ext_condition4: list[int] - exchange: list[int] - ext_condition3: list[int] - timestamp: list[str] + symbol: str + strike: float + right: str + sequence: int + condition: int + size: int + price: float + ext_condition2: int + ext_condition1: int + expiration: str + ext_condition4: int + exchange: int + ext_condition3: int + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -62,61 +61,33 @@ class OptionAtTimeTradeResponse200: def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - strike = self.strike - - right = self.right - - sequence = self.sequence - - condition = self.condition - - size = self.size - - price = self.price - - ext_condition2 = self.ext_condition2 - - ext_condition1 = self.ext_condition1 - - expiration = self.expiration - - ext_condition4 = self.ext_condition4 - - exchange = self.exchange - - ext_condition3 = self.ext_condition3 - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -146,49 +117,35 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - strike = cast(list[float], d.pop("strike")) - - - right = cast(list[str], d.pop("right")) - - - sequence = cast(list[int], d.pop("sequence")) - - - condition = cast(list[int], d.pop("condition")) - - - size = cast(list[int], d.pop("size")) - - - price = cast(list[float], d.pop("price")) - - - ext_condition2 = cast(list[int], d.pop("ext_condition2")) + symbol = d.pop("symbol") + strike = d.pop("strike") - ext_condition1 = cast(list[int], d.pop("ext_condition1")) + right = d.pop("right") + sequence = d.pop("sequence") - expiration = cast(list[str], d.pop("expiration")) + condition = d.pop("condition") + size = d.pop("size") - ext_condition4 = cast(list[int], d.pop("ext_condition4")) + price = d.pop("price") + ext_condition2 = d.pop("ext_condition2") - exchange = cast(list[int], d.pop("exchange")) + ext_condition1 = d.pop("ext_condition1") + expiration = d.pop("expiration") - ext_condition3 = cast(list[int], d.pop("ext_condition3")) + ext_condition4 = d.pop("ext_condition4") + exchange = d.pop("exchange") - timestamp = cast(list[str], d.pop("timestamp")) + ext_condition3 = d.pop("ext_condition3") + timestamp = d.pop("timestamp") - option_at_time_trade_response_200 = cls( + option_at_time_trade_response_200_item = cls( symbol=symbol, strike=strike, right=right, @@ -207,8 +164,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - option_at_time_trade_response_200.additional_properties = d - return option_at_time_trade_response_200 + option_at_time_trade_response_200_item.additional_properties = d + return option_at_time_trade_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_history_eod_response_200.py b/openapi_project/openapi_package/models/option_history_eod_response_200_item.py similarity index 53% rename from openapi_project/openapi_package/models/option_history_eod_response_200.py rename to openapi_project/openapi_package/models/option_history_eod_response_200_item.py index 30db74b0d..7187d4cb1 100644 --- a/openapi_project/openapi_package/models/option_history_eod_response_200.py +++ b/openapi_project/openapi_package/models/option_history_eod_response_200_item.py @@ -8,63 +8,62 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionHistoryEodResponse200") +T = TypeVar("T", bound="OptionHistoryEodResponse200Item") @_attrs_define -class OptionHistoryEodResponse200: +class OptionHistoryEodResponse200Item: """ Attributes: - symbol (list[str]): - ask_size (list[int]): - last_trade (list[str]): - created (list[str]): - ask_condition (list[int]): - strike (list[float]): - count (list[int]): - right (list[str]): - volume (list[int]): - high (list[float]): - low (list[float]): - bid_size (list[int]): - ask_exchange (list[int]): - bid_exchange (list[int]): - ask (list[float]): - expiration (list[str]): - bid (list[float]): - bid_condition (list[int]): - close (list[float]): - open_ (list[float]): + symbol (str): + ask_size (int): + last_trade (str): + created (str): + ask_condition (int): + strike (float): + count (int): + right (str): + volume (int): + high (float): + low (float): + bid_size (int): + ask_exchange (int): + bid_exchange (int): + ask (float): + expiration (str): + bid (float): + bid_condition (int): + close (float): + open_ (float): """ - symbol: list[str] - ask_size: list[int] - last_trade: list[str] - created: list[str] - ask_condition: list[int] - strike: list[float] - count: list[int] - right: list[str] - volume: list[int] - high: list[float] - low: list[float] - bid_size: list[int] - ask_exchange: list[int] - bid_exchange: list[int] - ask: list[float] - expiration: list[str] - bid: list[float] - bid_condition: list[int] - close: list[float] - open_: list[float] + symbol: str + ask_size: int + last_trade: str + created: str + ask_condition: int + strike: float + count: int + right: str + volume: int + high: float + low: float + bid_size: int + ask_exchange: int + bid_exchange: int + ask: float + expiration: str + bid: float + bid_condition: int + close: float + open_: float additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -74,85 +73,45 @@ class OptionHistoryEodResponse200: def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - ask_size = self.ask_size - - last_trade = self.last_trade - - created = self.created - - ask_condition = self.ask_condition - - strike = self.strike - - count = self.count - - right = self.right - - volume = self.volume - - high = self.high - - low = self.low - - bid_size = self.bid_size - - ask_exchange = self.ask_exchange - - bid_exchange = self.bid_exchange - - ask = self.ask - - expiration = self.expiration - - bid = self.bid - - bid_condition = self.bid_condition - - close = self.close - - open_ = self.open_ - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -188,67 +147,47 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - ask_size = cast(list[int], d.pop("ask_size")) - - - last_trade = cast(list[str], d.pop("last_trade")) - - - created = cast(list[str], d.pop("created")) - - - ask_condition = cast(list[int], d.pop("ask_condition")) - - - strike = cast(list[float], d.pop("strike")) - - - count = cast(list[int], d.pop("count")) - - - right = cast(list[str], d.pop("right")) - - - volume = cast(list[int], d.pop("volume")) - - - high = cast(list[float], d.pop("high")) - - - low = cast(list[float], d.pop("low")) + symbol = d.pop("symbol") + ask_size = d.pop("ask_size") - bid_size = cast(list[int], d.pop("bid_size")) + last_trade = d.pop("last_trade") + created = d.pop("created") - ask_exchange = cast(list[int], d.pop("ask_exchange")) + ask_condition = d.pop("ask_condition") + strike = d.pop("strike") - bid_exchange = cast(list[int], d.pop("bid_exchange")) + count = d.pop("count") + right = d.pop("right") - ask = cast(list[float], d.pop("ask")) + volume = d.pop("volume") + high = d.pop("high") - expiration = cast(list[str], d.pop("expiration")) + low = d.pop("low") + bid_size = d.pop("bid_size") - bid = cast(list[float], d.pop("bid")) + ask_exchange = d.pop("ask_exchange") + bid_exchange = d.pop("bid_exchange") - bid_condition = cast(list[int], d.pop("bid_condition")) + ask = d.pop("ask") + expiration = d.pop("expiration") - close = cast(list[float], d.pop("close")) + bid = d.pop("bid") + bid_condition = d.pop("bid_condition") - open_ = cast(list[float], d.pop("open")) + close = d.pop("close") + open_ = d.pop("open") - option_history_eod_response_200 = cls( + option_history_eod_response_200_item = cls( symbol=symbol, ask_size=ask_size, last_trade=last_trade, @@ -273,8 +212,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - option_history_eod_response_200.additional_properties = d - return option_history_eod_response_200 + option_history_eod_response_200_item.additional_properties = d + return option_history_eod_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_history_greeks_all_response_200.py b/openapi_project/openapi_package/models/option_history_greeks_all_response_200.py deleted file mode 100644 index 050c12433..000000000 --- a/openapi_project/openapi_package/models/option_history_greeks_all_response_200.py +++ /dev/null @@ -1,414 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast - - - - - - -T = TypeVar("T", bound="OptionHistoryGreeksAllResponse200") - - - -@_attrs_define -class OptionHistoryGreeksAllResponse200: - """ - Attributes: - symbol (list[str]): - dual_delta (list[float]): - color (list[float]): - zomma (list[float]): - delta (list[float]): - implied_vol (list[float]): - theta (list[float]): - d1 (list[float]): - speed (list[float]): - d2 (list[float]): - epsilon (list[float]): - lambda_ (list[float]): - vomma (list[float]): - underlying_timestamp (list[str]): - timestamp (list[str]): - underlying_price (list[float]): - strike (list[float]): - vera (list[float]): - right (list[str]): - veta (list[float]): - iv_error (list[float]): - ultima (list[float]): - charm (list[float]): - ask (list[float]): - rho (list[float]): - expiration (list[str]): - vanna (list[float]): - dual_gamma (list[float]): - bid (list[float]): - vega (list[float]): - gamma (list[float]): - """ - - symbol: list[str] - dual_delta: list[float] - color: list[float] - zomma: list[float] - delta: list[float] - implied_vol: list[float] - theta: list[float] - d1: list[float] - speed: list[float] - d2: list[float] - epsilon: list[float] - lambda_: list[float] - vomma: list[float] - underlying_timestamp: list[str] - timestamp: list[str] - underlying_price: list[float] - strike: list[float] - vera: list[float] - right: list[str] - veta: list[float] - iv_error: list[float] - ultima: list[float] - charm: list[float] - ask: list[float] - rho: list[float] - expiration: list[str] - vanna: list[float] - dual_gamma: list[float] - bid: list[float] - vega: list[float] - gamma: list[float] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - - - - - def to_dict(self) -> dict[str, Any]: - symbol = self.symbol - - - - dual_delta = self.dual_delta - - - - color = self.color - - - - zomma = self.zomma - - - - delta = self.delta - - - - implied_vol = self.implied_vol - - - - theta = self.theta - - - - d1 = self.d1 - - - - speed = self.speed - - - - d2 = self.d2 - - - - epsilon = self.epsilon - - - - lambda_ = self.lambda_ - - - - vomma = self.vomma - - - - underlying_timestamp = self.underlying_timestamp - - - - timestamp = self.timestamp - - - - underlying_price = self.underlying_price - - - - strike = self.strike - - - - vera = self.vera - - - - right = self.right - - - - veta = self.veta - - - - iv_error = self.iv_error - - - - ultima = self.ultima - - - - charm = self.charm - - - - ask = self.ask - - - - rho = self.rho - - - - expiration = self.expiration - - - - vanna = self.vanna - - - - dual_gamma = self.dual_gamma - - - - bid = self.bid - - - - vega = self.vega - - - - gamma = self.gamma - - - - - field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: prop - for prop_name, prop in self.additional_properties.items() - }) - field_dict.update({ - "symbol": symbol, - "dual_delta": dual_delta, - "color": color, - "zomma": zomma, - "delta": delta, - "implied_vol": implied_vol, - "theta": theta, - "d1": d1, - "speed": speed, - "d2": d2, - "epsilon": epsilon, - "lambda": lambda_, - "vomma": vomma, - "underlying_timestamp": underlying_timestamp, - "timestamp": timestamp, - "underlying_price": underlying_price, - "strike": strike, - "vera": vera, - "right": right, - "veta": veta, - "iv_error": iv_error, - "ultima": ultima, - "charm": charm, - "ask": ask, - "rho": rho, - "expiration": expiration, - "vanna": vanna, - "dual_gamma": dual_gamma, - "bid": bid, - "vega": vega, - "gamma": gamma, - }) - - return field_dict - - - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - dual_delta = cast(list[float], d.pop("dual_delta")) - - - color = cast(list[float], d.pop("color")) - - - zomma = cast(list[float], d.pop("zomma")) - - - delta = cast(list[float], d.pop("delta")) - - - implied_vol = cast(list[float], d.pop("implied_vol")) - - - theta = cast(list[float], d.pop("theta")) - - - d1 = cast(list[float], d.pop("d1")) - - - speed = cast(list[float], d.pop("speed")) - - - d2 = cast(list[float], d.pop("d2")) - - - epsilon = cast(list[float], d.pop("epsilon")) - - - lambda_ = cast(list[float], d.pop("lambda")) - - - vomma = cast(list[float], d.pop("vomma")) - - - underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) - - - timestamp = cast(list[str], d.pop("timestamp")) - - - underlying_price = cast(list[float], d.pop("underlying_price")) - - - strike = cast(list[float], d.pop("strike")) - - - vera = cast(list[float], d.pop("vera")) - - - right = cast(list[str], d.pop("right")) - - - veta = cast(list[float], d.pop("veta")) - - - iv_error = cast(list[float], d.pop("iv_error")) - - - ultima = cast(list[float], d.pop("ultima")) - - - charm = cast(list[float], d.pop("charm")) - - - ask = cast(list[float], d.pop("ask")) - - - rho = cast(list[float], d.pop("rho")) - - - expiration = cast(list[str], d.pop("expiration")) - - - vanna = cast(list[float], d.pop("vanna")) - - - dual_gamma = cast(list[float], d.pop("dual_gamma")) - - - bid = cast(list[float], d.pop("bid")) - - - vega = cast(list[float], d.pop("vega")) - - - gamma = cast(list[float], d.pop("gamma")) - - - option_history_greeks_all_response_200 = cls( - symbol=symbol, - dual_delta=dual_delta, - color=color, - zomma=zomma, - delta=delta, - implied_vol=implied_vol, - theta=theta, - d1=d1, - speed=speed, - d2=d2, - epsilon=epsilon, - lambda_=lambda_, - vomma=vomma, - underlying_timestamp=underlying_timestamp, - timestamp=timestamp, - underlying_price=underlying_price, - strike=strike, - vera=vera, - right=right, - veta=veta, - iv_error=iv_error, - ultima=ultima, - charm=charm, - ask=ask, - rho=rho, - expiration=expiration, - vanna=vanna, - dual_gamma=dual_gamma, - bid=bid, - vega=vega, - gamma=gamma, - ) - - - - option_history_greeks_all_response_200.additional_properties = d - return option_history_greeks_all_response_200 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_history_greeks_all_response_200_item.py b/openapi_project/openapi_package/models/option_history_greeks_all_response_200_item.py new file mode 100644 index 000000000..a445936ba --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_all_response_200_item.py @@ -0,0 +1,320 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="OptionHistoryGreeksAllResponse200Item") + + + +@_attrs_define +class OptionHistoryGreeksAllResponse200Item: + """ + Attributes: + symbol (str): + dual_delta (float): + color (float): + zomma (float): + delta (float): + implied_vol (float): + theta (float): + d1 (float): + speed (float): + d2 (float): + epsilon (float): + lambda_ (float): + vomma (float): + underlying_timestamp (str): + timestamp (str): + underlying_price (float): + strike (float): + vera (float): + right (str): + veta (float): + iv_error (float): + ultima (float): + charm (float): + ask (float): + rho (float): + expiration (str): + vanna (float): + dual_gamma (float): + bid (float): + vega (float): + gamma (float): + """ + + symbol: str + dual_delta: float + color: float + zomma: float + delta: float + implied_vol: float + theta: float + d1: float + speed: float + d2: float + epsilon: float + lambda_: float + vomma: float + underlying_timestamp: str + timestamp: str + underlying_price: float + strike: float + vera: float + right: str + veta: float + iv_error: float + ultima: float + charm: float + ask: float + rho: float + expiration: str + vanna: float + dual_gamma: float + bid: float + vega: float + gamma: float + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + dual_delta = self.dual_delta + + color = self.color + + zomma = self.zomma + + delta = self.delta + + implied_vol = self.implied_vol + + theta = self.theta + + d1 = self.d1 + + speed = self.speed + + d2 = self.d2 + + epsilon = self.epsilon + + lambda_ = self.lambda_ + + vomma = self.vomma + + underlying_timestamp = self.underlying_timestamp + + timestamp = self.timestamp + + underlying_price = self.underlying_price + + strike = self.strike + + vera = self.vera + + right = self.right + + veta = self.veta + + iv_error = self.iv_error + + ultima = self.ultima + + charm = self.charm + + ask = self.ask + + rho = self.rho + + expiration = self.expiration + + vanna = self.vanna + + dual_gamma = self.dual_gamma + + bid = self.bid + + vega = self.vega + + gamma = self.gamma + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "dual_delta": dual_delta, + "color": color, + "zomma": zomma, + "delta": delta, + "implied_vol": implied_vol, + "theta": theta, + "d1": d1, + "speed": speed, + "d2": d2, + "epsilon": epsilon, + "lambda": lambda_, + "vomma": vomma, + "underlying_timestamp": underlying_timestamp, + "timestamp": timestamp, + "underlying_price": underlying_price, + "strike": strike, + "vera": vera, + "right": right, + "veta": veta, + "iv_error": iv_error, + "ultima": ultima, + "charm": charm, + "ask": ask, + "rho": rho, + "expiration": expiration, + "vanna": vanna, + "dual_gamma": dual_gamma, + "bid": bid, + "vega": vega, + "gamma": gamma, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = d.pop("symbol") + + dual_delta = d.pop("dual_delta") + + color = d.pop("color") + + zomma = d.pop("zomma") + + delta = d.pop("delta") + + implied_vol = d.pop("implied_vol") + + theta = d.pop("theta") + + d1 = d.pop("d1") + + speed = d.pop("speed") + + d2 = d.pop("d2") + + epsilon = d.pop("epsilon") + + lambda_ = d.pop("lambda") + + vomma = d.pop("vomma") + + underlying_timestamp = d.pop("underlying_timestamp") + + timestamp = d.pop("timestamp") + + underlying_price = d.pop("underlying_price") + + strike = d.pop("strike") + + vera = d.pop("vera") + + right = d.pop("right") + + veta = d.pop("veta") + + iv_error = d.pop("iv_error") + + ultima = d.pop("ultima") + + charm = d.pop("charm") + + ask = d.pop("ask") + + rho = d.pop("rho") + + expiration = d.pop("expiration") + + vanna = d.pop("vanna") + + dual_gamma = d.pop("dual_gamma") + + bid = d.pop("bid") + + vega = d.pop("vega") + + gamma = d.pop("gamma") + + option_history_greeks_all_response_200_item = cls( + symbol=symbol, + dual_delta=dual_delta, + color=color, + zomma=zomma, + delta=delta, + implied_vol=implied_vol, + theta=theta, + d1=d1, + speed=speed, + d2=d2, + epsilon=epsilon, + lambda_=lambda_, + vomma=vomma, + underlying_timestamp=underlying_timestamp, + timestamp=timestamp, + underlying_price=underlying_price, + strike=strike, + vera=vera, + right=right, + veta=veta, + iv_error=iv_error, + ultima=ultima, + charm=charm, + ask=ask, + rho=rho, + expiration=expiration, + vanna=vanna, + dual_gamma=dual_gamma, + bid=bid, + vega=vega, + gamma=gamma, + ) + + + + option_history_greeks_all_response_200_item.additional_properties = d + return option_history_greeks_all_response_200_item + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_history_greeks_eod_response_200.py b/openapi_project/openapi_package/models/option_history_greeks_eod_response_200.py deleted file mode 100644 index f6665a85f..000000000 --- a/openapi_project/openapi_package/models/option_history_greeks_eod_response_200.py +++ /dev/null @@ -1,546 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast - - - - - - -T = TypeVar("T", bound="OptionHistoryGreeksEodResponse200") - - - -@_attrs_define -class OptionHistoryGreeksEodResponse200: - """ - Attributes: - symbol (list[str]): - ask_size (list[int]): - dual_delta (list[float]): - color (list[float]): - zomma (list[float]): - delta (list[float]): - implied_vol (list[float]): - theta (list[float]): - d1 (list[float]): - speed (list[float]): - d2 (list[float]): - epsilon (list[float]): - high (list[float]): - lambda_ (list[float]): - low (list[float]): - ask_exchange (list[int]): - bid_exchange (list[int]): - vomma (list[float]): - bid_condition (list[int]): - underlying_timestamp (list[str]): - close (list[float]): - timestamp (list[str]): - underlying_price (list[float]): - ask_condition (list[int]): - strike (list[float]): - count (list[int]): - vera (list[float]): - right (list[str]): - veta (list[float]): - iv_error (list[float]): - ultima (list[float]): - volume (list[int]): - charm (list[float]): - bid_size (list[int]): - ask (list[float]): - rho (list[float]): - expiration (list[str]): - vanna (list[float]): - dual_gamma (list[float]): - bid (list[float]): - open_ (list[float]): - vega (list[float]): - gamma (list[float]): - """ - - symbol: list[str] - ask_size: list[int] - dual_delta: list[float] - color: list[float] - zomma: list[float] - delta: list[float] - implied_vol: list[float] - theta: list[float] - d1: list[float] - speed: list[float] - d2: list[float] - epsilon: list[float] - high: list[float] - lambda_: list[float] - low: list[float] - ask_exchange: list[int] - bid_exchange: list[int] - vomma: list[float] - bid_condition: list[int] - underlying_timestamp: list[str] - close: list[float] - timestamp: list[str] - underlying_price: list[float] - ask_condition: list[int] - strike: list[float] - count: list[int] - vera: list[float] - right: list[str] - veta: list[float] - iv_error: list[float] - ultima: list[float] - volume: list[int] - charm: list[float] - bid_size: list[int] - ask: list[float] - rho: list[float] - expiration: list[str] - vanna: list[float] - dual_gamma: list[float] - bid: list[float] - open_: list[float] - vega: list[float] - gamma: list[float] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - - - - - def to_dict(self) -> dict[str, Any]: - symbol = self.symbol - - - - ask_size = self.ask_size - - - - dual_delta = self.dual_delta - - - - color = self.color - - - - zomma = self.zomma - - - - delta = self.delta - - - - implied_vol = self.implied_vol - - - - theta = self.theta - - - - d1 = self.d1 - - - - speed = self.speed - - - - d2 = self.d2 - - - - epsilon = self.epsilon - - - - high = self.high - - - - lambda_ = self.lambda_ - - - - low = self.low - - - - ask_exchange = self.ask_exchange - - - - bid_exchange = self.bid_exchange - - - - vomma = self.vomma - - - - bid_condition = self.bid_condition - - - - underlying_timestamp = self.underlying_timestamp - - - - close = self.close - - - - timestamp = self.timestamp - - - - underlying_price = self.underlying_price - - - - ask_condition = self.ask_condition - - - - strike = self.strike - - - - count = self.count - - - - vera = self.vera - - - - right = self.right - - - - veta = self.veta - - - - iv_error = self.iv_error - - - - ultima = self.ultima - - - - volume = self.volume - - - - charm = self.charm - - - - bid_size = self.bid_size - - - - ask = self.ask - - - - rho = self.rho - - - - expiration = self.expiration - - - - vanna = self.vanna - - - - dual_gamma = self.dual_gamma - - - - bid = self.bid - - - - open_ = self.open_ - - - - vega = self.vega - - - - gamma = self.gamma - - - - - field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: prop - for prop_name, prop in self.additional_properties.items() - }) - field_dict.update({ - "symbol": symbol, - "ask_size": ask_size, - "dual_delta": dual_delta, - "color": color, - "zomma": zomma, - "delta": delta, - "implied_vol": implied_vol, - "theta": theta, - "d1": d1, - "speed": speed, - "d2": d2, - "epsilon": epsilon, - "high": high, - "lambda": lambda_, - "low": low, - "ask_exchange": ask_exchange, - "bid_exchange": bid_exchange, - "vomma": vomma, - "bid_condition": bid_condition, - "underlying_timestamp": underlying_timestamp, - "close": close, - "timestamp": timestamp, - "underlying_price": underlying_price, - "ask_condition": ask_condition, - "strike": strike, - "count": count, - "vera": vera, - "right": right, - "veta": veta, - "iv_error": iv_error, - "ultima": ultima, - "volume": volume, - "charm": charm, - "bid_size": bid_size, - "ask": ask, - "rho": rho, - "expiration": expiration, - "vanna": vanna, - "dual_gamma": dual_gamma, - "bid": bid, - "open": open_, - "vega": vega, - "gamma": gamma, - }) - - return field_dict - - - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - ask_size = cast(list[int], d.pop("ask_size")) - - - dual_delta = cast(list[float], d.pop("dual_delta")) - - - color = cast(list[float], d.pop("color")) - - - zomma = cast(list[float], d.pop("zomma")) - - - delta = cast(list[float], d.pop("delta")) - - - implied_vol = cast(list[float], d.pop("implied_vol")) - - - theta = cast(list[float], d.pop("theta")) - - - d1 = cast(list[float], d.pop("d1")) - - - speed = cast(list[float], d.pop("speed")) - - - d2 = cast(list[float], d.pop("d2")) - - - epsilon = cast(list[float], d.pop("epsilon")) - - - high = cast(list[float], d.pop("high")) - - - lambda_ = cast(list[float], d.pop("lambda")) - - - low = cast(list[float], d.pop("low")) - - - ask_exchange = cast(list[int], d.pop("ask_exchange")) - - - bid_exchange = cast(list[int], d.pop("bid_exchange")) - - - vomma = cast(list[float], d.pop("vomma")) - - - bid_condition = cast(list[int], d.pop("bid_condition")) - - - underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) - - - close = cast(list[float], d.pop("close")) - - - timestamp = cast(list[str], d.pop("timestamp")) - - - underlying_price = cast(list[float], d.pop("underlying_price")) - - - ask_condition = cast(list[int], d.pop("ask_condition")) - - - strike = cast(list[float], d.pop("strike")) - - - count = cast(list[int], d.pop("count")) - - - vera = cast(list[float], d.pop("vera")) - - - right = cast(list[str], d.pop("right")) - - - veta = cast(list[float], d.pop("veta")) - - - iv_error = cast(list[float], d.pop("iv_error")) - - - ultima = cast(list[float], d.pop("ultima")) - - - volume = cast(list[int], d.pop("volume")) - - - charm = cast(list[float], d.pop("charm")) - - - bid_size = cast(list[int], d.pop("bid_size")) - - - ask = cast(list[float], d.pop("ask")) - - - rho = cast(list[float], d.pop("rho")) - - - expiration = cast(list[str], d.pop("expiration")) - - - vanna = cast(list[float], d.pop("vanna")) - - - dual_gamma = cast(list[float], d.pop("dual_gamma")) - - - bid = cast(list[float], d.pop("bid")) - - - open_ = cast(list[float], d.pop("open")) - - - vega = cast(list[float], d.pop("vega")) - - - gamma = cast(list[float], d.pop("gamma")) - - - option_history_greeks_eod_response_200 = cls( - symbol=symbol, - ask_size=ask_size, - dual_delta=dual_delta, - color=color, - zomma=zomma, - delta=delta, - implied_vol=implied_vol, - theta=theta, - d1=d1, - speed=speed, - d2=d2, - epsilon=epsilon, - high=high, - lambda_=lambda_, - low=low, - ask_exchange=ask_exchange, - bid_exchange=bid_exchange, - vomma=vomma, - bid_condition=bid_condition, - underlying_timestamp=underlying_timestamp, - close=close, - timestamp=timestamp, - underlying_price=underlying_price, - ask_condition=ask_condition, - strike=strike, - count=count, - vera=vera, - right=right, - veta=veta, - iv_error=iv_error, - ultima=ultima, - volume=volume, - charm=charm, - bid_size=bid_size, - ask=ask, - rho=rho, - expiration=expiration, - vanna=vanna, - dual_gamma=dual_gamma, - bid=bid, - open_=open_, - vega=vega, - gamma=gamma, - ) - - - - option_history_greeks_eod_response_200.additional_properties = d - return option_history_greeks_eod_response_200 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_history_greeks_eod_response_200_item.py b/openapi_project/openapi_package/models/option_history_greeks_eod_response_200_item.py new file mode 100644 index 000000000..497409c16 --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_greeks_eod_response_200_item.py @@ -0,0 +1,416 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="OptionHistoryGreeksEodResponse200Item") + + + +@_attrs_define +class OptionHistoryGreeksEodResponse200Item: + """ + Attributes: + symbol (str): + ask_size (int): + dual_delta (float): + color (float): + zomma (float): + delta (float): + implied_vol (float): + theta (float): + d1 (float): + speed (float): + d2 (float): + epsilon (float): + high (float): + lambda_ (float): + low (float): + ask_exchange (int): + bid_exchange (int): + vomma (float): + bid_condition (int): + underlying_timestamp (str): + close (float): + timestamp (str): + underlying_price (float): + ask_condition (int): + strike (float): + count (int): + vera (float): + right (str): + veta (float): + iv_error (float): + ultima (float): + volume (int): + charm (float): + bid_size (int): + ask (float): + rho (float): + expiration (str): + vanna (float): + dual_gamma (float): + bid (float): + open_ (float): + vega (float): + gamma (float): + """ + + symbol: str + ask_size: int + dual_delta: float + color: float + zomma: float + delta: float + implied_vol: float + theta: float + d1: float + speed: float + d2: float + epsilon: float + high: float + lambda_: float + low: float + ask_exchange: int + bid_exchange: int + vomma: float + bid_condition: int + underlying_timestamp: str + close: float + timestamp: str + underlying_price: float + ask_condition: int + strike: float + count: int + vera: float + right: str + veta: float + iv_error: float + ultima: float + volume: int + charm: float + bid_size: int + ask: float + rho: float + expiration: str + vanna: float + dual_gamma: float + bid: float + open_: float + vega: float + gamma: float + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + ask_size = self.ask_size + + dual_delta = self.dual_delta + + color = self.color + + zomma = self.zomma + + delta = self.delta + + implied_vol = self.implied_vol + + theta = self.theta + + d1 = self.d1 + + speed = self.speed + + d2 = self.d2 + + epsilon = self.epsilon + + high = self.high + + lambda_ = self.lambda_ + + low = self.low + + ask_exchange = self.ask_exchange + + bid_exchange = self.bid_exchange + + vomma = self.vomma + + bid_condition = self.bid_condition + + underlying_timestamp = self.underlying_timestamp + + close = self.close + + timestamp = self.timestamp + + underlying_price = self.underlying_price + + ask_condition = self.ask_condition + + strike = self.strike + + count = self.count + + vera = self.vera + + right = self.right + + veta = self.veta + + iv_error = self.iv_error + + ultima = self.ultima + + volume = self.volume + + charm = self.charm + + bid_size = self.bid_size + + ask = self.ask + + rho = self.rho + + expiration = self.expiration + + vanna = self.vanna + + dual_gamma = self.dual_gamma + + bid = self.bid + + open_ = self.open_ + + vega = self.vega + + gamma = self.gamma + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "ask_size": ask_size, + "dual_delta": dual_delta, + "color": color, + "zomma": zomma, + "delta": delta, + "implied_vol": implied_vol, + "theta": theta, + "d1": d1, + "speed": speed, + "d2": d2, + "epsilon": epsilon, + "high": high, + "lambda": lambda_, + "low": low, + "ask_exchange": ask_exchange, + "bid_exchange": bid_exchange, + "vomma": vomma, + "bid_condition": bid_condition, + "underlying_timestamp": underlying_timestamp, + "close": close, + "timestamp": timestamp, + "underlying_price": underlying_price, + "ask_condition": ask_condition, + "strike": strike, + "count": count, + "vera": vera, + "right": right, + "veta": veta, + "iv_error": iv_error, + "ultima": ultima, + "volume": volume, + "charm": charm, + "bid_size": bid_size, + "ask": ask, + "rho": rho, + "expiration": expiration, + "vanna": vanna, + "dual_gamma": dual_gamma, + "bid": bid, + "open": open_, + "vega": vega, + "gamma": gamma, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = d.pop("symbol") + + ask_size = d.pop("ask_size") + + dual_delta = d.pop("dual_delta") + + color = d.pop("color") + + zomma = d.pop("zomma") + + delta = d.pop("delta") + + implied_vol = d.pop("implied_vol") + + theta = d.pop("theta") + + d1 = d.pop("d1") + + speed = d.pop("speed") + + d2 = d.pop("d2") + + epsilon = d.pop("epsilon") + + high = d.pop("high") + + lambda_ = d.pop("lambda") + + low = d.pop("low") + + ask_exchange = d.pop("ask_exchange") + + bid_exchange = d.pop("bid_exchange") + + vomma = d.pop("vomma") + + bid_condition = d.pop("bid_condition") + + underlying_timestamp = d.pop("underlying_timestamp") + + close = d.pop("close") + + timestamp = d.pop("timestamp") + + underlying_price = d.pop("underlying_price") + + ask_condition = d.pop("ask_condition") + + strike = d.pop("strike") + + count = d.pop("count") + + vera = d.pop("vera") + + right = d.pop("right") + + veta = d.pop("veta") + + iv_error = d.pop("iv_error") + + ultima = d.pop("ultima") + + volume = d.pop("volume") + + charm = d.pop("charm") + + bid_size = d.pop("bid_size") + + ask = d.pop("ask") + + rho = d.pop("rho") + + expiration = d.pop("expiration") + + vanna = d.pop("vanna") + + dual_gamma = d.pop("dual_gamma") + + bid = d.pop("bid") + + open_ = d.pop("open") + + vega = d.pop("vega") + + gamma = d.pop("gamma") + + option_history_greeks_eod_response_200_item = cls( + symbol=symbol, + ask_size=ask_size, + dual_delta=dual_delta, + color=color, + zomma=zomma, + delta=delta, + implied_vol=implied_vol, + theta=theta, + d1=d1, + speed=speed, + d2=d2, + epsilon=epsilon, + high=high, + lambda_=lambda_, + low=low, + ask_exchange=ask_exchange, + bid_exchange=bid_exchange, + vomma=vomma, + bid_condition=bid_condition, + underlying_timestamp=underlying_timestamp, + close=close, + timestamp=timestamp, + underlying_price=underlying_price, + ask_condition=ask_condition, + strike=strike, + count=count, + vera=vera, + right=right, + veta=veta, + iv_error=iv_error, + ultima=ultima, + volume=volume, + charm=charm, + bid_size=bid_size, + ask=ask, + rho=rho, + expiration=expiration, + vanna=vanna, + dual_gamma=dual_gamma, + bid=bid, + open_=open_, + vega=vega, + gamma=gamma, + ) + + + + option_history_greeks_eod_response_200_item.additional_properties = d + return option_history_greeks_eod_response_200_item + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_history_greeks_first_order_response_200.py b/openapi_project/openapi_package/models/option_history_greeks_first_order_response_200_item.py similarity index 54% rename from openapi_project/openapi_package/models/option_history_greeks_first_order_response_200.py rename to openapi_project/openapi_package/models/option_history_greeks_first_order_response_200_item.py index 1b30f6ca5..891937d94 100644 --- a/openapi_project/openapi_package/models/option_history_greeks_first_order_response_200.py +++ b/openapi_project/openapi_package/models/option_history_greeks_first_order_response_200_item.py @@ -8,57 +8,56 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionHistoryGreeksFirstOrderResponse200") +T = TypeVar("T", bound="OptionHistoryGreeksFirstOrderResponse200Item") @_attrs_define -class OptionHistoryGreeksFirstOrderResponse200: +class OptionHistoryGreeksFirstOrderResponse200Item: """ Attributes: - symbol (list[str]): - underlying_price (list[float]): - strike (list[float]): - delta (list[float]): - right (list[str]): - implied_vol (list[float]): - theta (list[float]): - iv_error (list[float]): - epsilon (list[float]): - lambda_ (list[float]): - ask (list[float]): - rho (list[float]): - expiration (list[str]): - bid (list[float]): - underlying_timestamp (list[str]): - vega (list[float]): - timestamp (list[str]): + symbol (str): + underlying_price (float): + strike (float): + delta (float): + right (str): + implied_vol (float): + theta (float): + iv_error (float): + epsilon (float): + lambda_ (float): + ask (float): + rho (float): + expiration (str): + bid (float): + underlying_timestamp (str): + vega (float): + timestamp (str): """ - symbol: list[str] - underlying_price: list[float] - strike: list[float] - delta: list[float] - right: list[str] - implied_vol: list[float] - theta: list[float] - iv_error: list[float] - epsilon: list[float] - lambda_: list[float] - ask: list[float] - rho: list[float] - expiration: list[str] - bid: list[float] - underlying_timestamp: list[str] - vega: list[float] - timestamp: list[str] + symbol: str + underlying_price: float + strike: float + delta: float + right: str + implied_vol: float + theta: float + iv_error: float + epsilon: float + lambda_: float + ask: float + rho: float + expiration: str + bid: float + underlying_timestamp: str + vega: float + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -68,73 +67,39 @@ class OptionHistoryGreeksFirstOrderResponse200: def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - underlying_price = self.underlying_price - - strike = self.strike - - delta = self.delta - - right = self.right - - implied_vol = self.implied_vol - - theta = self.theta - - iv_error = self.iv_error - - epsilon = self.epsilon - - lambda_ = self.lambda_ - - ask = self.ask - - rho = self.rho - - expiration = self.expiration - - bid = self.bid - - underlying_timestamp = self.underlying_timestamp - - vega = self.vega - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -167,58 +132,41 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - underlying_price = cast(list[float], d.pop("underlying_price")) - - - strike = cast(list[float], d.pop("strike")) - - - delta = cast(list[float], d.pop("delta")) - - - right = cast(list[str], d.pop("right")) - - - implied_vol = cast(list[float], d.pop("implied_vol")) - - - theta = cast(list[float], d.pop("theta")) - - - iv_error = cast(list[float], d.pop("iv_error")) - - - epsilon = cast(list[float], d.pop("epsilon")) - + symbol = d.pop("symbol") - lambda_ = cast(list[float], d.pop("lambda")) + underlying_price = d.pop("underlying_price") + strike = d.pop("strike") - ask = cast(list[float], d.pop("ask")) + delta = d.pop("delta") + right = d.pop("right") - rho = cast(list[float], d.pop("rho")) + implied_vol = d.pop("implied_vol") + theta = d.pop("theta") - expiration = cast(list[str], d.pop("expiration")) + iv_error = d.pop("iv_error") + epsilon = d.pop("epsilon") - bid = cast(list[float], d.pop("bid")) + lambda_ = d.pop("lambda") + ask = d.pop("ask") - underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) + rho = d.pop("rho") + expiration = d.pop("expiration") - vega = cast(list[float], d.pop("vega")) + bid = d.pop("bid") + underlying_timestamp = d.pop("underlying_timestamp") - timestamp = cast(list[str], d.pop("timestamp")) + vega = d.pop("vega") + timestamp = d.pop("timestamp") - option_history_greeks_first_order_response_200 = cls( + option_history_greeks_first_order_response_200_item = cls( symbol=symbol, underlying_price=underlying_price, strike=strike, @@ -240,8 +188,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - option_history_greeks_first_order_response_200.additional_properties = d - return option_history_greeks_first_order_response_200 + option_history_greeks_first_order_response_200_item.additional_properties = d + return option_history_greeks_first_order_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_history_greeks_implied_volatility_response_200.py b/openapi_project/openapi_package/models/option_history_greeks_implied_volatility_response_200_item.py similarity index 57% rename from openapi_project/openapi_package/models/option_history_greeks_implied_volatility_response_200.py rename to openapi_project/openapi_package/models/option_history_greeks_implied_volatility_response_200_item.py index 87845ba8b..049803635 100644 --- a/openapi_project/openapi_package/models/option_history_greeks_implied_volatility_response_200.py +++ b/openapi_project/openapi_package/models/option_history_greeks_implied_volatility_response_200_item.py @@ -8,51 +8,50 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionHistoryGreeksImpliedVolatilityResponse200") +T = TypeVar("T", bound="OptionHistoryGreeksImpliedVolatilityResponse200Item") @_attrs_define -class OptionHistoryGreeksImpliedVolatilityResponse200: +class OptionHistoryGreeksImpliedVolatilityResponse200Item: """ Attributes: - symbol (list[str]): - underlying_price (list[float]): - strike (list[float]): - right (list[str]): - implied_vol (list[float]): - iv_error (list[float]): - bid_implied_vol (list[float]): - ask (list[float]): - midpoint (list[float]): - expiration (list[str]): - ask_implied_vol (list[float]): - bid (list[float]): - underlying_timestamp (list[str]): - timestamp (list[str]): + symbol (str): + underlying_price (float): + strike (float): + right (str): + implied_vol (float): + iv_error (float): + bid_implied_vol (float): + ask (float): + midpoint (float): + expiration (str): + ask_implied_vol (float): + bid (float): + underlying_timestamp (str): + timestamp (str): """ - symbol: list[str] - underlying_price: list[float] - strike: list[float] - right: list[str] - implied_vol: list[float] - iv_error: list[float] - bid_implied_vol: list[float] - ask: list[float] - midpoint: list[float] - expiration: list[str] - ask_implied_vol: list[float] - bid: list[float] - underlying_timestamp: list[str] - timestamp: list[str] + symbol: str + underlying_price: float + strike: float + right: str + implied_vol: float + iv_error: float + bid_implied_vol: float + ask: float + midpoint: float + expiration: str + ask_implied_vol: float + bid: float + underlying_timestamp: str + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -62,61 +61,33 @@ class OptionHistoryGreeksImpliedVolatilityResponse200: def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - underlying_price = self.underlying_price - - strike = self.strike - - right = self.right - - implied_vol = self.implied_vol - - iv_error = self.iv_error - - bid_implied_vol = self.bid_implied_vol - - ask = self.ask - - midpoint = self.midpoint - - expiration = self.expiration - - ask_implied_vol = self.ask_implied_vol - - bid = self.bid - - underlying_timestamp = self.underlying_timestamp - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -146,49 +117,35 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - underlying_price = cast(list[float], d.pop("underlying_price")) - - - strike = cast(list[float], d.pop("strike")) - - - right = cast(list[str], d.pop("right")) - - - implied_vol = cast(list[float], d.pop("implied_vol")) - - - iv_error = cast(list[float], d.pop("iv_error")) - - - bid_implied_vol = cast(list[float], d.pop("bid_implied_vol")) - - - ask = cast(list[float], d.pop("ask")) + symbol = d.pop("symbol") + underlying_price = d.pop("underlying_price") - midpoint = cast(list[float], d.pop("midpoint")) + strike = d.pop("strike") + right = d.pop("right") - expiration = cast(list[str], d.pop("expiration")) + implied_vol = d.pop("implied_vol") + iv_error = d.pop("iv_error") - ask_implied_vol = cast(list[float], d.pop("ask_implied_vol")) + bid_implied_vol = d.pop("bid_implied_vol") + ask = d.pop("ask") - bid = cast(list[float], d.pop("bid")) + midpoint = d.pop("midpoint") + expiration = d.pop("expiration") - underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) + ask_implied_vol = d.pop("ask_implied_vol") + bid = d.pop("bid") - timestamp = cast(list[str], d.pop("timestamp")) + underlying_timestamp = d.pop("underlying_timestamp") + timestamp = d.pop("timestamp") - option_history_greeks_implied_volatility_response_200 = cls( + option_history_greeks_implied_volatility_response_200_item = cls( symbol=symbol, underlying_price=underlying_price, strike=strike, @@ -207,8 +164,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - option_history_greeks_implied_volatility_response_200.additional_properties = d - return option_history_greeks_implied_volatility_response_200 + option_history_greeks_implied_volatility_response_200_item.additional_properties = d + return option_history_greeks_implied_volatility_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_history_greeks_second_order_response_200.py b/openapi_project/openapi_package/models/option_history_greeks_second_order_response_200_item.py similarity index 55% rename from openapi_project/openapi_package/models/option_history_greeks_second_order_response_200.py rename to openapi_project/openapi_package/models/option_history_greeks_second_order_response_200_item.py index 0f4c0ace3..7629acdb0 100644 --- a/openapi_project/openapi_package/models/option_history_greeks_second_order_response_200.py +++ b/openapi_project/openapi_package/models/option_history_greeks_second_order_response_200_item.py @@ -8,55 +8,54 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionHistoryGreeksSecondOrderResponse200") +T = TypeVar("T", bound="OptionHistoryGreeksSecondOrderResponse200Item") @_attrs_define -class OptionHistoryGreeksSecondOrderResponse200: +class OptionHistoryGreeksSecondOrderResponse200Item: """ Attributes: - symbol (list[str]): - underlying_price (list[float]): - strike (list[float]): - right (list[str]): - veta (list[float]): - implied_vol (list[float]): - iv_error (list[float]): - charm (list[float]): - ask (list[float]): - expiration (list[str]): - vanna (list[float]): - vomma (list[float]): - bid (list[float]): - underlying_timestamp (list[str]): - gamma (list[float]): - timestamp (list[str]): + symbol (str): + underlying_price (float): + strike (float): + right (str): + veta (float): + implied_vol (float): + iv_error (float): + charm (float): + ask (float): + expiration (str): + vanna (float): + vomma (float): + bid (float): + underlying_timestamp (str): + gamma (float): + timestamp (str): """ - symbol: list[str] - underlying_price: list[float] - strike: list[float] - right: list[str] - veta: list[float] - implied_vol: list[float] - iv_error: list[float] - charm: list[float] - ask: list[float] - expiration: list[str] - vanna: list[float] - vomma: list[float] - bid: list[float] - underlying_timestamp: list[str] - gamma: list[float] - timestamp: list[str] + symbol: str + underlying_price: float + strike: float + right: str + veta: float + implied_vol: float + iv_error: float + charm: float + ask: float + expiration: str + vanna: float + vomma: float + bid: float + underlying_timestamp: str + gamma: float + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -66,69 +65,37 @@ class OptionHistoryGreeksSecondOrderResponse200: def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - underlying_price = self.underlying_price - - strike = self.strike - - right = self.right - - veta = self.veta - - implied_vol = self.implied_vol - - iv_error = self.iv_error - - charm = self.charm - - ask = self.ask - - expiration = self.expiration - - vanna = self.vanna - - vomma = self.vomma - - bid = self.bid - - underlying_timestamp = self.underlying_timestamp - - gamma = self.gamma - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -160,55 +127,39 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - underlying_price = cast(list[float], d.pop("underlying_price")) - - - strike = cast(list[float], d.pop("strike")) - - - right = cast(list[str], d.pop("right")) - - - veta = cast(list[float], d.pop("veta")) - - - implied_vol = cast(list[float], d.pop("implied_vol")) - - - iv_error = cast(list[float], d.pop("iv_error")) - - - charm = cast(list[float], d.pop("charm")) - - - ask = cast(list[float], d.pop("ask")) + symbol = d.pop("symbol") + underlying_price = d.pop("underlying_price") - expiration = cast(list[str], d.pop("expiration")) + strike = d.pop("strike") + right = d.pop("right") - vanna = cast(list[float], d.pop("vanna")) + veta = d.pop("veta") + implied_vol = d.pop("implied_vol") - vomma = cast(list[float], d.pop("vomma")) + iv_error = d.pop("iv_error") + charm = d.pop("charm") - bid = cast(list[float], d.pop("bid")) + ask = d.pop("ask") + expiration = d.pop("expiration") - underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) + vanna = d.pop("vanna") + vomma = d.pop("vomma") - gamma = cast(list[float], d.pop("gamma")) + bid = d.pop("bid") + underlying_timestamp = d.pop("underlying_timestamp") - timestamp = cast(list[str], d.pop("timestamp")) + gamma = d.pop("gamma") + timestamp = d.pop("timestamp") - option_history_greeks_second_order_response_200 = cls( + option_history_greeks_second_order_response_200_item = cls( symbol=symbol, underlying_price=underlying_price, strike=strike, @@ -229,8 +180,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - option_history_greeks_second_order_response_200.additional_properties = d - return option_history_greeks_second_order_response_200 + option_history_greeks_second_order_response_200_item.additional_properties = d + return option_history_greeks_second_order_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_history_greeks_third_order_response_200.py b/openapi_project/openapi_package/models/option_history_greeks_third_order_response_200_item.py similarity index 55% rename from openapi_project/openapi_package/models/option_history_greeks_third_order_response_200.py rename to openapi_project/openapi_package/models/option_history_greeks_third_order_response_200_item.py index 1f14a1ce2..d2d6b0847 100644 --- a/openapi_project/openapi_package/models/option_history_greeks_third_order_response_200.py +++ b/openapi_project/openapi_package/models/option_history_greeks_third_order_response_200_item.py @@ -8,53 +8,52 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionHistoryGreeksThirdOrderResponse200") +T = TypeVar("T", bound="OptionHistoryGreeksThirdOrderResponse200Item") @_attrs_define -class OptionHistoryGreeksThirdOrderResponse200: +class OptionHistoryGreeksThirdOrderResponse200Item: """ Attributes: - symbol (list[str]): - underlying_price (list[float]): - color (list[float]): - strike (list[float]): - zomma (list[float]): - right (list[str]): - implied_vol (list[float]): - iv_error (list[float]): - speed (list[float]): - ultima (list[float]): - ask (list[float]): - expiration (list[str]): - bid (list[float]): - underlying_timestamp (list[str]): - timestamp (list[str]): + symbol (str): + underlying_price (float): + color (float): + strike (float): + zomma (float): + right (str): + implied_vol (float): + iv_error (float): + speed (float): + ultima (float): + ask (float): + expiration (str): + bid (float): + underlying_timestamp (str): + timestamp (str): """ - symbol: list[str] - underlying_price: list[float] - color: list[float] - strike: list[float] - zomma: list[float] - right: list[str] - implied_vol: list[float] - iv_error: list[float] - speed: list[float] - ultima: list[float] - ask: list[float] - expiration: list[str] - bid: list[float] - underlying_timestamp: list[str] - timestamp: list[str] + symbol: str + underlying_price: float + color: float + strike: float + zomma: float + right: str + implied_vol: float + iv_error: float + speed: float + ultima: float + ask: float + expiration: str + bid: float + underlying_timestamp: str + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -64,65 +63,35 @@ class OptionHistoryGreeksThirdOrderResponse200: def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - underlying_price = self.underlying_price - - color = self.color - - strike = self.strike - - zomma = self.zomma - - right = self.right - - implied_vol = self.implied_vol - - iv_error = self.iv_error - - speed = self.speed - - ultima = self.ultima - - ask = self.ask - - expiration = self.expiration - - bid = self.bid - - underlying_timestamp = self.underlying_timestamp - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -153,52 +122,37 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - underlying_price = cast(list[float], d.pop("underlying_price")) - - - color = cast(list[float], d.pop("color")) - - - strike = cast(list[float], d.pop("strike")) - - - zomma = cast(list[float], d.pop("zomma")) - - - right = cast(list[str], d.pop("right")) - - - implied_vol = cast(list[float], d.pop("implied_vol")) - - - iv_error = cast(list[float], d.pop("iv_error")) - + symbol = d.pop("symbol") - speed = cast(list[float], d.pop("speed")) + underlying_price = d.pop("underlying_price") + color = d.pop("color") - ultima = cast(list[float], d.pop("ultima")) + strike = d.pop("strike") + zomma = d.pop("zomma") - ask = cast(list[float], d.pop("ask")) + right = d.pop("right") + implied_vol = d.pop("implied_vol") - expiration = cast(list[str], d.pop("expiration")) + iv_error = d.pop("iv_error") + speed = d.pop("speed") - bid = cast(list[float], d.pop("bid")) + ultima = d.pop("ultima") + ask = d.pop("ask") - underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) + expiration = d.pop("expiration") + bid = d.pop("bid") - timestamp = cast(list[str], d.pop("timestamp")) + underlying_timestamp = d.pop("underlying_timestamp") + timestamp = d.pop("timestamp") - option_history_greeks_third_order_response_200 = cls( + option_history_greeks_third_order_response_200_item = cls( symbol=symbol, underlying_price=underlying_price, color=color, @@ -218,8 +172,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - option_history_greeks_third_order_response_200.additional_properties = d - return option_history_greeks_third_order_response_200 + option_history_greeks_third_order_response_200_item.additional_properties = d + return option_history_greeks_third_order_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_snapshot_ohlc_response_200.py b/openapi_project/openapi_package/models/option_history_ohlc_response_200_item.py similarity index 58% rename from openapi_project/openapi_package/models/option_snapshot_ohlc_response_200.py rename to openapi_project/openapi_package/models/option_history_ohlc_response_200_item.py index 3023f862d..b867c3d9d 100644 --- a/openapi_project/openapi_package/models/option_snapshot_ohlc_response_200.py +++ b/openapi_project/openapi_package/models/option_history_ohlc_response_200_item.py @@ -8,45 +8,46 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionSnapshotOhlcResponse200") +T = TypeVar("T", bound="OptionHistoryOhlcResponse200Item") @_attrs_define -class OptionSnapshotOhlcResponse200: +class OptionHistoryOhlcResponse200Item: """ Attributes: - volume (list[int]): - symbol (list[str]): - high (list[float]): - low (list[float]): - strike (list[float]): - count (list[int]): - expiration (list[str]): - right (list[str]): - close (list[float]): - open_ (list[float]): - timestamp (list[str]): + volume (int): + symbol (str): + high (float): + low (float): + strike (float): + vwap (float): + count (int): + expiration (str): + right (str): + close (float): + open_ (float): + timestamp (str): """ - volume: list[int] - symbol: list[str] - high: list[float] - low: list[float] - strike: list[float] - count: list[int] - expiration: list[str] - right: list[str] - close: list[float] - open_: list[float] - timestamp: list[str] + volume: int + symbol: str + high: float + low: float + strike: float + vwap: float + count: int + expiration: str + right: str + close: float + open_: float + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -56,49 +57,29 @@ class OptionSnapshotOhlcResponse200: def to_dict(self) -> dict[str, Any]: volume = self.volume - - symbol = self.symbol - - high = self.high - - low = self.low - - strike = self.strike - + vwap = self.vwap count = self.count - - expiration = self.expiration - - right = self.right - - close = self.close - - open_ = self.open_ - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -110,6 +91,7 @@ def to_dict(self) -> dict[str, Any]: "high": high, "low": low, "strike": strike, + "vwap": vwap, "count": count, "expiration": expiration, "right": right, @@ -125,45 +107,37 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - volume = cast(list[int], d.pop("volume")) - - - symbol = cast(list[str], d.pop("symbol")) - - - high = cast(list[float], d.pop("high")) - - - low = cast(list[float], d.pop("low")) - - - strike = cast(list[float], d.pop("strike")) - - - count = cast(list[int], d.pop("count")) + volume = d.pop("volume") + symbol = d.pop("symbol") - expiration = cast(list[str], d.pop("expiration")) + high = d.pop("high") + low = d.pop("low") - right = cast(list[str], d.pop("right")) + strike = d.pop("strike") + vwap = d.pop("vwap") - close = cast(list[float], d.pop("close")) + count = d.pop("count") + expiration = d.pop("expiration") - open_ = cast(list[float], d.pop("open")) + right = d.pop("right") + close = d.pop("close") - timestamp = cast(list[str], d.pop("timestamp")) + open_ = d.pop("open") + timestamp = d.pop("timestamp") - option_snapshot_ohlc_response_200 = cls( + option_history_ohlc_response_200_item = cls( volume=volume, symbol=symbol, high=high, low=low, strike=strike, + vwap=vwap, count=count, expiration=expiration, right=right, @@ -174,8 +148,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - option_snapshot_ohlc_response_200.additional_properties = d - return option_snapshot_ohlc_response_200 + option_history_ohlc_response_200_item.additional_properties = d + return option_history_ohlc_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_history_open_interest_response_200.py b/openapi_project/openapi_package/models/option_history_open_interest_response_200_item.py similarity index 62% rename from openapi_project/openapi_package/models/option_history_open_interest_response_200.py rename to openapi_project/openapi_package/models/option_history_open_interest_response_200_item.py index 457231650..338796933 100644 --- a/openapi_project/openapi_package/models/option_history_open_interest_response_200.py +++ b/openapi_project/openapi_package/models/option_history_open_interest_response_200_item.py @@ -8,35 +8,34 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionHistoryOpenInterestResponse200") +T = TypeVar("T", bound="OptionHistoryOpenInterestResponse200Item") @_attrs_define -class OptionHistoryOpenInterestResponse200: +class OptionHistoryOpenInterestResponse200Item: """ Attributes: - symbol (list[str]): - strike (list[float]): - open_interest (list[int]): - expiration (list[str]): - right (list[str]): - timestamp (list[str]): + symbol (str): + strike (float): + open_interest (int): + expiration (str): + right (str): + timestamp (str): """ - symbol: list[str] - strike: list[float] - open_interest: list[int] - expiration: list[str] - right: list[str] - timestamp: list[str] + symbol: str + strike: float + open_interest: int + expiration: str + right: str + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -46,29 +45,17 @@ class OptionHistoryOpenInterestResponse200: def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - strike = self.strike - - open_interest = self.open_interest - - expiration = self.expiration - - right = self.right - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -90,25 +77,19 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - strike = cast(list[float], d.pop("strike")) - - - open_interest = cast(list[int], d.pop("open_interest")) - - - expiration = cast(list[str], d.pop("expiration")) + symbol = d.pop("symbol") + strike = d.pop("strike") - right = cast(list[str], d.pop("right")) + open_interest = d.pop("open_interest") + expiration = d.pop("expiration") - timestamp = cast(list[str], d.pop("timestamp")) + right = d.pop("right") + timestamp = d.pop("timestamp") - option_history_open_interest_response_200 = cls( + option_history_open_interest_response_200_item = cls( symbol=symbol, strike=strike, open_interest=open_interest, @@ -119,8 +100,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - option_history_open_interest_response_200.additional_properties = d - return option_history_open_interest_response_200 + option_history_open_interest_response_200_item.additional_properties = d + return option_history_open_interest_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_history_quote_response_200.py b/openapi_project/openapi_package/models/option_history_quote_response_200_item.py similarity index 56% rename from openapi_project/openapi_package/models/option_history_quote_response_200.py rename to openapi_project/openapi_package/models/option_history_quote_response_200_item.py index 5d622601e..9cf69fefc 100644 --- a/openapi_project/openapi_package/models/option_history_quote_response_200.py +++ b/openapi_project/openapi_package/models/option_history_quote_response_200_item.py @@ -8,49 +8,48 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionHistoryQuoteResponse200") +T = TypeVar("T", bound="OptionHistoryQuoteResponse200Item") @_attrs_define -class OptionHistoryQuoteResponse200: +class OptionHistoryQuoteResponse200Item: """ Attributes: - symbol (list[str]): - ask_size (list[int]): - ask_condition (list[int]): - strike (list[float]): - right (list[str]): - bid_size (list[int]): - ask_exchange (list[int]): - bid_exchange (list[int]): - ask (list[float]): - expiration (list[str]): - bid (list[float]): - bid_condition (list[int]): - timestamp (list[str]): + symbol (str): + ask_size (int): + ask_condition (int): + strike (float): + right (str): + bid_size (int): + ask_exchange (int): + bid_exchange (int): + ask (float): + expiration (str): + bid (float): + bid_condition (int): + timestamp (str): """ - symbol: list[str] - ask_size: list[int] - ask_condition: list[int] - strike: list[float] - right: list[str] - bid_size: list[int] - ask_exchange: list[int] - bid_exchange: list[int] - ask: list[float] - expiration: list[str] - bid: list[float] - bid_condition: list[int] - timestamp: list[str] + symbol: str + ask_size: int + ask_condition: int + strike: float + right: str + bid_size: int + ask_exchange: int + bid_exchange: int + ask: float + expiration: str + bid: float + bid_condition: int + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -60,57 +59,31 @@ class OptionHistoryQuoteResponse200: def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - ask_size = self.ask_size - - ask_condition = self.ask_condition - - strike = self.strike - - right = self.right - - bid_size = self.bid_size - - ask_exchange = self.ask_exchange - - bid_exchange = self.bid_exchange - - ask = self.ask - - expiration = self.expiration - - bid = self.bid - - bid_condition = self.bid_condition - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -139,46 +112,33 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - ask_size = cast(list[int], d.pop("ask_size")) - - - ask_condition = cast(list[int], d.pop("ask_condition")) - - - strike = cast(list[float], d.pop("strike")) - - - right = cast(list[str], d.pop("right")) - - - bid_size = cast(list[int], d.pop("bid_size")) - - - ask_exchange = cast(list[int], d.pop("ask_exchange")) - + symbol = d.pop("symbol") - bid_exchange = cast(list[int], d.pop("bid_exchange")) + ask_size = d.pop("ask_size") + ask_condition = d.pop("ask_condition") - ask = cast(list[float], d.pop("ask")) + strike = d.pop("strike") + right = d.pop("right") - expiration = cast(list[str], d.pop("expiration")) + bid_size = d.pop("bid_size") + ask_exchange = d.pop("ask_exchange") - bid = cast(list[float], d.pop("bid")) + bid_exchange = d.pop("bid_exchange") + ask = d.pop("ask") - bid_condition = cast(list[int], d.pop("bid_condition")) + expiration = d.pop("expiration") + bid = d.pop("bid") - timestamp = cast(list[str], d.pop("timestamp")) + bid_condition = d.pop("bid_condition") + timestamp = d.pop("timestamp") - option_history_quote_response_200 = cls( + option_history_quote_response_200_item = cls( symbol=symbol, ask_size=ask_size, ask_condition=ask_condition, @@ -196,8 +156,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - option_history_quote_response_200.additional_properties = d - return option_history_quote_response_200 + option_history_quote_response_200_item.additional_properties = d + return option_history_quote_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_all_response_200.py b/openapi_project/openapi_package/models/option_history_trade_greeks_all_response_200.py deleted file mode 100644 index 8ab9b954f..000000000 --- a/openapi_project/openapi_package/models/option_history_trade_greeks_all_response_200.py +++ /dev/null @@ -1,491 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast - - - - - - -T = TypeVar("T", bound="OptionHistoryTradeGreeksAllResponse200") - - - -@_attrs_define -class OptionHistoryTradeGreeksAllResponse200: - """ - Attributes: - symbol (list[str]): - dual_delta (list[float]): - color (list[float]): - zomma (list[float]): - delta (list[float]): - implied_vol (list[float]): - theta (list[float]): - d1 (list[float]): - speed (list[float]): - d2 (list[float]): - epsilon (list[float]): - lambda_ (list[float]): - price (list[float]): - ext_condition2 (list[int]): - ext_condition1 (list[int]): - ext_condition4 (list[int]): - vomma (list[float]): - ext_condition3 (list[int]): - underlying_timestamp (list[str]): - timestamp (list[str]): - underlying_price (list[float]): - strike (list[float]): - vera (list[float]): - right (list[str]): - veta (list[float]): - iv_error (list[float]): - ultima (list[float]): - sequence (list[int]): - condition (list[int]): - size (list[int]): - charm (list[float]): - rho (list[float]): - expiration (list[str]): - exchange (list[int]): - vanna (list[float]): - dual_gamma (list[float]): - vega (list[float]): - gamma (list[float]): - """ - - symbol: list[str] - dual_delta: list[float] - color: list[float] - zomma: list[float] - delta: list[float] - implied_vol: list[float] - theta: list[float] - d1: list[float] - speed: list[float] - d2: list[float] - epsilon: list[float] - lambda_: list[float] - price: list[float] - ext_condition2: list[int] - ext_condition1: list[int] - ext_condition4: list[int] - vomma: list[float] - ext_condition3: list[int] - underlying_timestamp: list[str] - timestamp: list[str] - underlying_price: list[float] - strike: list[float] - vera: list[float] - right: list[str] - veta: list[float] - iv_error: list[float] - ultima: list[float] - sequence: list[int] - condition: list[int] - size: list[int] - charm: list[float] - rho: list[float] - expiration: list[str] - exchange: list[int] - vanna: list[float] - dual_gamma: list[float] - vega: list[float] - gamma: list[float] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - - - - - def to_dict(self) -> dict[str, Any]: - symbol = self.symbol - - - - dual_delta = self.dual_delta - - - - color = self.color - - - - zomma = self.zomma - - - - delta = self.delta - - - - implied_vol = self.implied_vol - - - - theta = self.theta - - - - d1 = self.d1 - - - - speed = self.speed - - - - d2 = self.d2 - - - - epsilon = self.epsilon - - - - lambda_ = self.lambda_ - - - - price = self.price - - - - ext_condition2 = self.ext_condition2 - - - - ext_condition1 = self.ext_condition1 - - - - ext_condition4 = self.ext_condition4 - - - - vomma = self.vomma - - - - ext_condition3 = self.ext_condition3 - - - - underlying_timestamp = self.underlying_timestamp - - - - timestamp = self.timestamp - - - - underlying_price = self.underlying_price - - - - strike = self.strike - - - - vera = self.vera - - - - right = self.right - - - - veta = self.veta - - - - iv_error = self.iv_error - - - - ultima = self.ultima - - - - sequence = self.sequence - - - - condition = self.condition - - - - size = self.size - - - - charm = self.charm - - - - rho = self.rho - - - - expiration = self.expiration - - - - exchange = self.exchange - - - - vanna = self.vanna - - - - dual_gamma = self.dual_gamma - - - - vega = self.vega - - - - gamma = self.gamma - - - - - field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: prop - for prop_name, prop in self.additional_properties.items() - }) - field_dict.update({ - "symbol": symbol, - "dual_delta": dual_delta, - "color": color, - "zomma": zomma, - "delta": delta, - "implied_vol": implied_vol, - "theta": theta, - "d1": d1, - "speed": speed, - "d2": d2, - "epsilon": epsilon, - "lambda": lambda_, - "price": price, - "ext_condition2": ext_condition2, - "ext_condition1": ext_condition1, - "ext_condition4": ext_condition4, - "vomma": vomma, - "ext_condition3": ext_condition3, - "underlying_timestamp": underlying_timestamp, - "timestamp": timestamp, - "underlying_price": underlying_price, - "strike": strike, - "vera": vera, - "right": right, - "veta": veta, - "iv_error": iv_error, - "ultima": ultima, - "sequence": sequence, - "condition": condition, - "size": size, - "charm": charm, - "rho": rho, - "expiration": expiration, - "exchange": exchange, - "vanna": vanna, - "dual_gamma": dual_gamma, - "vega": vega, - "gamma": gamma, - }) - - return field_dict - - - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - dual_delta = cast(list[float], d.pop("dual_delta")) - - - color = cast(list[float], d.pop("color")) - - - zomma = cast(list[float], d.pop("zomma")) - - - delta = cast(list[float], d.pop("delta")) - - - implied_vol = cast(list[float], d.pop("implied_vol")) - - - theta = cast(list[float], d.pop("theta")) - - - d1 = cast(list[float], d.pop("d1")) - - - speed = cast(list[float], d.pop("speed")) - - - d2 = cast(list[float], d.pop("d2")) - - - epsilon = cast(list[float], d.pop("epsilon")) - - - lambda_ = cast(list[float], d.pop("lambda")) - - - price = cast(list[float], d.pop("price")) - - - ext_condition2 = cast(list[int], d.pop("ext_condition2")) - - - ext_condition1 = cast(list[int], d.pop("ext_condition1")) - - - ext_condition4 = cast(list[int], d.pop("ext_condition4")) - - - vomma = cast(list[float], d.pop("vomma")) - - - ext_condition3 = cast(list[int], d.pop("ext_condition3")) - - - underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) - - - timestamp = cast(list[str], d.pop("timestamp")) - - - underlying_price = cast(list[float], d.pop("underlying_price")) - - - strike = cast(list[float], d.pop("strike")) - - - vera = cast(list[float], d.pop("vera")) - - - right = cast(list[str], d.pop("right")) - - - veta = cast(list[float], d.pop("veta")) - - - iv_error = cast(list[float], d.pop("iv_error")) - - - ultima = cast(list[float], d.pop("ultima")) - - - sequence = cast(list[int], d.pop("sequence")) - - - condition = cast(list[int], d.pop("condition")) - - - size = cast(list[int], d.pop("size")) - - - charm = cast(list[float], d.pop("charm")) - - - rho = cast(list[float], d.pop("rho")) - - - expiration = cast(list[str], d.pop("expiration")) - - - exchange = cast(list[int], d.pop("exchange")) - - - vanna = cast(list[float], d.pop("vanna")) - - - dual_gamma = cast(list[float], d.pop("dual_gamma")) - - - vega = cast(list[float], d.pop("vega")) - - - gamma = cast(list[float], d.pop("gamma")) - - - option_history_trade_greeks_all_response_200 = cls( - symbol=symbol, - dual_delta=dual_delta, - color=color, - zomma=zomma, - delta=delta, - implied_vol=implied_vol, - theta=theta, - d1=d1, - speed=speed, - d2=d2, - epsilon=epsilon, - lambda_=lambda_, - price=price, - ext_condition2=ext_condition2, - ext_condition1=ext_condition1, - ext_condition4=ext_condition4, - vomma=vomma, - ext_condition3=ext_condition3, - underlying_timestamp=underlying_timestamp, - timestamp=timestamp, - underlying_price=underlying_price, - strike=strike, - vera=vera, - right=right, - veta=veta, - iv_error=iv_error, - ultima=ultima, - sequence=sequence, - condition=condition, - size=size, - charm=charm, - rho=rho, - expiration=expiration, - exchange=exchange, - vanna=vanna, - dual_gamma=dual_gamma, - vega=vega, - gamma=gamma, - ) - - - - option_history_trade_greeks_all_response_200.additional_properties = d - return option_history_trade_greeks_all_response_200 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_all_response_200_item.py b/openapi_project/openapi_package/models/option_history_trade_greeks_all_response_200_item.py new file mode 100644 index 000000000..1dcffa24a --- /dev/null +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_all_response_200_item.py @@ -0,0 +1,376 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="OptionHistoryTradeGreeksAllResponse200Item") + + + +@_attrs_define +class OptionHistoryTradeGreeksAllResponse200Item: + """ + Attributes: + symbol (str): + dual_delta (float): + color (float): + zomma (float): + delta (float): + implied_vol (float): + theta (float): + d1 (float): + speed (float): + d2 (float): + epsilon (float): + lambda_ (float): + price (float): + ext_condition2 (int): + ext_condition1 (int): + ext_condition4 (int): + vomma (float): + ext_condition3 (int): + underlying_timestamp (str): + timestamp (str): + underlying_price (float): + strike (float): + vera (float): + right (str): + veta (float): + iv_error (float): + ultima (float): + sequence (int): + condition (int): + size (int): + charm (float): + rho (float): + expiration (str): + exchange (int): + vanna (float): + dual_gamma (float): + vega (float): + gamma (float): + """ + + symbol: str + dual_delta: float + color: float + zomma: float + delta: float + implied_vol: float + theta: float + d1: float + speed: float + d2: float + epsilon: float + lambda_: float + price: float + ext_condition2: int + ext_condition1: int + ext_condition4: int + vomma: float + ext_condition3: int + underlying_timestamp: str + timestamp: str + underlying_price: float + strike: float + vera: float + right: str + veta: float + iv_error: float + ultima: float + sequence: int + condition: int + size: int + charm: float + rho: float + expiration: str + exchange: int + vanna: float + dual_gamma: float + vega: float + gamma: float + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + dual_delta = self.dual_delta + + color = self.color + + zomma = self.zomma + + delta = self.delta + + implied_vol = self.implied_vol + + theta = self.theta + + d1 = self.d1 + + speed = self.speed + + d2 = self.d2 + + epsilon = self.epsilon + + lambda_ = self.lambda_ + + price = self.price + + ext_condition2 = self.ext_condition2 + + ext_condition1 = self.ext_condition1 + + ext_condition4 = self.ext_condition4 + + vomma = self.vomma + + ext_condition3 = self.ext_condition3 + + underlying_timestamp = self.underlying_timestamp + + timestamp = self.timestamp + + underlying_price = self.underlying_price + + strike = self.strike + + vera = self.vera + + right = self.right + + veta = self.veta + + iv_error = self.iv_error + + ultima = self.ultima + + sequence = self.sequence + + condition = self.condition + + size = self.size + + charm = self.charm + + rho = self.rho + + expiration = self.expiration + + exchange = self.exchange + + vanna = self.vanna + + dual_gamma = self.dual_gamma + + vega = self.vega + + gamma = self.gamma + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "dual_delta": dual_delta, + "color": color, + "zomma": zomma, + "delta": delta, + "implied_vol": implied_vol, + "theta": theta, + "d1": d1, + "speed": speed, + "d2": d2, + "epsilon": epsilon, + "lambda": lambda_, + "price": price, + "ext_condition2": ext_condition2, + "ext_condition1": ext_condition1, + "ext_condition4": ext_condition4, + "vomma": vomma, + "ext_condition3": ext_condition3, + "underlying_timestamp": underlying_timestamp, + "timestamp": timestamp, + "underlying_price": underlying_price, + "strike": strike, + "vera": vera, + "right": right, + "veta": veta, + "iv_error": iv_error, + "ultima": ultima, + "sequence": sequence, + "condition": condition, + "size": size, + "charm": charm, + "rho": rho, + "expiration": expiration, + "exchange": exchange, + "vanna": vanna, + "dual_gamma": dual_gamma, + "vega": vega, + "gamma": gamma, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = d.pop("symbol") + + dual_delta = d.pop("dual_delta") + + color = d.pop("color") + + zomma = d.pop("zomma") + + delta = d.pop("delta") + + implied_vol = d.pop("implied_vol") + + theta = d.pop("theta") + + d1 = d.pop("d1") + + speed = d.pop("speed") + + d2 = d.pop("d2") + + epsilon = d.pop("epsilon") + + lambda_ = d.pop("lambda") + + price = d.pop("price") + + ext_condition2 = d.pop("ext_condition2") + + ext_condition1 = d.pop("ext_condition1") + + ext_condition4 = d.pop("ext_condition4") + + vomma = d.pop("vomma") + + ext_condition3 = d.pop("ext_condition3") + + underlying_timestamp = d.pop("underlying_timestamp") + + timestamp = d.pop("timestamp") + + underlying_price = d.pop("underlying_price") + + strike = d.pop("strike") + + vera = d.pop("vera") + + right = d.pop("right") + + veta = d.pop("veta") + + iv_error = d.pop("iv_error") + + ultima = d.pop("ultima") + + sequence = d.pop("sequence") + + condition = d.pop("condition") + + size = d.pop("size") + + charm = d.pop("charm") + + rho = d.pop("rho") + + expiration = d.pop("expiration") + + exchange = d.pop("exchange") + + vanna = d.pop("vanna") + + dual_gamma = d.pop("dual_gamma") + + vega = d.pop("vega") + + gamma = d.pop("gamma") + + option_history_trade_greeks_all_response_200_item = cls( + symbol=symbol, + dual_delta=dual_delta, + color=color, + zomma=zomma, + delta=delta, + implied_vol=implied_vol, + theta=theta, + d1=d1, + speed=speed, + d2=d2, + epsilon=epsilon, + lambda_=lambda_, + price=price, + ext_condition2=ext_condition2, + ext_condition1=ext_condition1, + ext_condition4=ext_condition4, + vomma=vomma, + ext_condition3=ext_condition3, + underlying_timestamp=underlying_timestamp, + timestamp=timestamp, + underlying_price=underlying_price, + strike=strike, + vera=vera, + right=right, + veta=veta, + iv_error=iv_error, + ultima=ultima, + sequence=sequence, + condition=condition, + size=size, + charm=charm, + rho=rho, + expiration=expiration, + exchange=exchange, + vanna=vanna, + dual_gamma=dual_gamma, + vega=vega, + gamma=gamma, + ) + + + + option_history_trade_greeks_all_response_200_item.additional_properties = d + return option_history_trade_greeks_all_response_200_item + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_first_order_response_200.py b/openapi_project/openapi_package/models/option_history_trade_greeks_first_order_response_200_item.py similarity index 53% rename from openapi_project/openapi_package/models/option_history_trade_greeks_first_order_response_200.py rename to openapi_project/openapi_package/models/option_history_trade_greeks_first_order_response_200_item.py index ee4fd3da8..fc18dd81c 100644 --- a/openapi_project/openapi_package/models/option_history_trade_greeks_first_order_response_200.py +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_first_order_response_200_item.py @@ -8,71 +8,70 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionHistoryTradeGreeksFirstOrderResponse200") +T = TypeVar("T", bound="OptionHistoryTradeGreeksFirstOrderResponse200Item") @_attrs_define -class OptionHistoryTradeGreeksFirstOrderResponse200: +class OptionHistoryTradeGreeksFirstOrderResponse200Item: """ Attributes: - symbol (list[str]): - underlying_price (list[float]): - strike (list[float]): - delta (list[float]): - right (list[str]): - implied_vol (list[float]): - theta (list[float]): - iv_error (list[float]): - epsilon (list[float]): - sequence (list[int]): - condition (list[int]): - lambda_ (list[float]): - size (list[int]): - price (list[float]): - ext_condition2 (list[int]): - rho (list[float]): - ext_condition1 (list[int]): - expiration (list[str]): - ext_condition4 (list[int]): - exchange (list[int]): - ext_condition3 (list[int]): - underlying_timestamp (list[str]): - vega (list[float]): - timestamp (list[str]): + symbol (str): + underlying_price (float): + strike (float): + delta (float): + right (str): + implied_vol (float): + theta (float): + iv_error (float): + epsilon (float): + sequence (int): + condition (int): + lambda_ (float): + size (int): + price (float): + ext_condition2 (int): + rho (float): + ext_condition1 (int): + expiration (str): + ext_condition4 (int): + exchange (int): + ext_condition3 (int): + underlying_timestamp (str): + vega (float): + timestamp (str): """ - symbol: list[str] - underlying_price: list[float] - strike: list[float] - delta: list[float] - right: list[str] - implied_vol: list[float] - theta: list[float] - iv_error: list[float] - epsilon: list[float] - sequence: list[int] - condition: list[int] - lambda_: list[float] - size: list[int] - price: list[float] - ext_condition2: list[int] - rho: list[float] - ext_condition1: list[int] - expiration: list[str] - ext_condition4: list[int] - exchange: list[int] - ext_condition3: list[int] - underlying_timestamp: list[str] - vega: list[float] - timestamp: list[str] + symbol: str + underlying_price: float + strike: float + delta: float + right: str + implied_vol: float + theta: float + iv_error: float + epsilon: float + sequence: int + condition: int + lambda_: float + size: int + price: float + ext_condition2: int + rho: float + ext_condition1: int + expiration: str + ext_condition4: int + exchange: int + ext_condition3: int + underlying_timestamp: str + vega: float + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -82,101 +81,53 @@ class OptionHistoryTradeGreeksFirstOrderResponse200: def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - underlying_price = self.underlying_price - - strike = self.strike - - delta = self.delta - - right = self.right - - implied_vol = self.implied_vol - - theta = self.theta - - iv_error = self.iv_error - - epsilon = self.epsilon - - sequence = self.sequence - - condition = self.condition - - lambda_ = self.lambda_ - - size = self.size - - price = self.price - - ext_condition2 = self.ext_condition2 - - rho = self.rho - - ext_condition1 = self.ext_condition1 - - expiration = self.expiration - - ext_condition4 = self.ext_condition4 - - exchange = self.exchange - - ext_condition3 = self.ext_condition3 - - underlying_timestamp = self.underlying_timestamp - - vega = self.vega - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -216,79 +167,55 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - underlying_price = cast(list[float], d.pop("underlying_price")) - - - strike = cast(list[float], d.pop("strike")) - - - delta = cast(list[float], d.pop("delta")) - - - right = cast(list[str], d.pop("right")) - - - implied_vol = cast(list[float], d.pop("implied_vol")) - - - theta = cast(list[float], d.pop("theta")) - - - iv_error = cast(list[float], d.pop("iv_error")) - - - epsilon = cast(list[float], d.pop("epsilon")) - - - sequence = cast(list[int], d.pop("sequence")) - - - condition = cast(list[int], d.pop("condition")) - - - lambda_ = cast(list[float], d.pop("lambda")) - - - size = cast(list[int], d.pop("size")) + symbol = d.pop("symbol") + underlying_price = d.pop("underlying_price") - price = cast(list[float], d.pop("price")) + strike = d.pop("strike") + delta = d.pop("delta") - ext_condition2 = cast(list[int], d.pop("ext_condition2")) + right = d.pop("right") + implied_vol = d.pop("implied_vol") - rho = cast(list[float], d.pop("rho")) + theta = d.pop("theta") + iv_error = d.pop("iv_error") - ext_condition1 = cast(list[int], d.pop("ext_condition1")) + epsilon = d.pop("epsilon") + sequence = d.pop("sequence") - expiration = cast(list[str], d.pop("expiration")) + condition = d.pop("condition") + lambda_ = d.pop("lambda") - ext_condition4 = cast(list[int], d.pop("ext_condition4")) + size = d.pop("size") + price = d.pop("price") - exchange = cast(list[int], d.pop("exchange")) + ext_condition2 = d.pop("ext_condition2") + rho = d.pop("rho") - ext_condition3 = cast(list[int], d.pop("ext_condition3")) + ext_condition1 = d.pop("ext_condition1") + expiration = d.pop("expiration") - underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) + ext_condition4 = d.pop("ext_condition4") + exchange = d.pop("exchange") - vega = cast(list[float], d.pop("vega")) + ext_condition3 = d.pop("ext_condition3") + underlying_timestamp = d.pop("underlying_timestamp") - timestamp = cast(list[str], d.pop("timestamp")) + vega = d.pop("vega") + timestamp = d.pop("timestamp") - option_history_trade_greeks_first_order_response_200 = cls( + option_history_trade_greeks_first_order_response_200_item = cls( symbol=symbol, underlying_price=underlying_price, strike=strike, @@ -317,8 +244,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - option_history_trade_greeks_first_order_response_200.additional_properties = d - return option_history_trade_greeks_first_order_response_200 + option_history_trade_greeks_first_order_response_200_item.additional_properties = d + return option_history_trade_greeks_first_order_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_implied_volatility_response_200.py b/openapi_project/openapi_package/models/option_history_trade_greeks_implied_volatility_response_200_item.py similarity index 57% rename from openapi_project/openapi_package/models/option_history_trade_greeks_implied_volatility_response_200.py rename to openapi_project/openapi_package/models/option_history_trade_greeks_implied_volatility_response_200_item.py index 600d70261..2005355eb 100644 --- a/openapi_project/openapi_package/models/option_history_trade_greeks_implied_volatility_response_200.py +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_implied_volatility_response_200_item.py @@ -8,59 +8,58 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionHistoryTradeGreeksImpliedVolatilityResponse200") +T = TypeVar("T", bound="OptionHistoryTradeGreeksImpliedVolatilityResponse200Item") @_attrs_define -class OptionHistoryTradeGreeksImpliedVolatilityResponse200: +class OptionHistoryTradeGreeksImpliedVolatilityResponse200Item: """ Attributes: - symbol (list[str]): - underlying_price (list[float]): - strike (list[float]): - right (list[str]): - implied_vol (list[float]): - iv_error (list[float]): - sequence (list[int]): - condition (list[int]): - size (list[int]): - price (list[float]): - ext_condition2 (list[int]): - ext_condition1 (list[int]): - expiration (list[str]): - ext_condition4 (list[int]): - exchange (list[int]): - ext_condition3 (list[int]): - underlying_timestamp (list[str]): - timestamp (list[str]): + symbol (str): + underlying_price (float): + strike (float): + right (str): + implied_vol (float): + iv_error (float): + sequence (int): + condition (int): + size (int): + price (float): + ext_condition2 (int): + ext_condition1 (int): + expiration (str): + ext_condition4 (int): + exchange (int): + ext_condition3 (int): + underlying_timestamp (str): + timestamp (str): """ - symbol: list[str] - underlying_price: list[float] - strike: list[float] - right: list[str] - implied_vol: list[float] - iv_error: list[float] - sequence: list[int] - condition: list[int] - size: list[int] - price: list[float] - ext_condition2: list[int] - ext_condition1: list[int] - expiration: list[str] - ext_condition4: list[int] - exchange: list[int] - ext_condition3: list[int] - underlying_timestamp: list[str] - timestamp: list[str] + symbol: str + underlying_price: float + strike: float + right: str + implied_vol: float + iv_error: float + sequence: int + condition: int + size: int + price: float + ext_condition2: int + ext_condition1: int + expiration: str + ext_condition4: int + exchange: int + ext_condition3: int + underlying_timestamp: str + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -70,77 +69,41 @@ class OptionHistoryTradeGreeksImpliedVolatilityResponse200: def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - underlying_price = self.underlying_price - - strike = self.strike - - right = self.right - - implied_vol = self.implied_vol - - iv_error = self.iv_error - - sequence = self.sequence - - condition = self.condition - - size = self.size - - price = self.price - - ext_condition2 = self.ext_condition2 - - ext_condition1 = self.ext_condition1 - - expiration = self.expiration - - ext_condition4 = self.ext_condition4 - - exchange = self.exchange - - ext_condition3 = self.ext_condition3 - - underlying_timestamp = self.underlying_timestamp - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -174,61 +137,43 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - underlying_price = cast(list[float], d.pop("underlying_price")) - - - strike = cast(list[float], d.pop("strike")) - - - right = cast(list[str], d.pop("right")) - - - implied_vol = cast(list[float], d.pop("implied_vol")) - - - iv_error = cast(list[float], d.pop("iv_error")) - - - sequence = cast(list[int], d.pop("sequence")) - - - condition = cast(list[int], d.pop("condition")) - - - size = cast(list[int], d.pop("size")) - - - price = cast(list[float], d.pop("price")) + symbol = d.pop("symbol") + underlying_price = d.pop("underlying_price") - ext_condition2 = cast(list[int], d.pop("ext_condition2")) + strike = d.pop("strike") + right = d.pop("right") - ext_condition1 = cast(list[int], d.pop("ext_condition1")) + implied_vol = d.pop("implied_vol") + iv_error = d.pop("iv_error") - expiration = cast(list[str], d.pop("expiration")) + sequence = d.pop("sequence") + condition = d.pop("condition") - ext_condition4 = cast(list[int], d.pop("ext_condition4")) + size = d.pop("size") + price = d.pop("price") - exchange = cast(list[int], d.pop("exchange")) + ext_condition2 = d.pop("ext_condition2") + ext_condition1 = d.pop("ext_condition1") - ext_condition3 = cast(list[int], d.pop("ext_condition3")) + expiration = d.pop("expiration") + ext_condition4 = d.pop("ext_condition4") - underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) + exchange = d.pop("exchange") + ext_condition3 = d.pop("ext_condition3") - timestamp = cast(list[str], d.pop("timestamp")) + underlying_timestamp = d.pop("underlying_timestamp") + timestamp = d.pop("timestamp") - option_history_trade_greeks_implied_volatility_response_200 = cls( + option_history_trade_greeks_implied_volatility_response_200_item = cls( symbol=symbol, underlying_price=underlying_price, strike=strike, @@ -251,8 +196,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - option_history_trade_greeks_implied_volatility_response_200.additional_properties = d - return option_history_trade_greeks_implied_volatility_response_200 + option_history_trade_greeks_implied_volatility_response_200_item.additional_properties = d + return option_history_trade_greeks_implied_volatility_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_second_order_response_200.py b/openapi_project/openapi_package/models/option_history_trade_greeks_second_order_response_200_item.py similarity index 53% rename from openapi_project/openapi_package/models/option_history_trade_greeks_second_order_response_200.py rename to openapi_project/openapi_package/models/option_history_trade_greeks_second_order_response_200_item.py index ea7cda42a..c9c97a338 100644 --- a/openapi_project/openapi_package/models/option_history_trade_greeks_second_order_response_200.py +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_second_order_response_200_item.py @@ -8,69 +8,68 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionHistoryTradeGreeksSecondOrderResponse200") +T = TypeVar("T", bound="OptionHistoryTradeGreeksSecondOrderResponse200Item") @_attrs_define -class OptionHistoryTradeGreeksSecondOrderResponse200: +class OptionHistoryTradeGreeksSecondOrderResponse200Item: """ Attributes: - symbol (list[str]): - underlying_price (list[float]): - strike (list[float]): - right (list[str]): - veta (list[float]): - implied_vol (list[float]): - iv_error (list[float]): - sequence (list[int]): - condition (list[int]): - size (list[int]): - charm (list[float]): - price (list[float]): - ext_condition2 (list[int]): - ext_condition1 (list[int]): - expiration (list[str]): - ext_condition4 (list[int]): - exchange (list[int]): - vanna (list[float]): - vomma (list[float]): - ext_condition3 (list[int]): - underlying_timestamp (list[str]): - gamma (list[float]): - timestamp (list[str]): + symbol (str): + underlying_price (float): + strike (float): + right (str): + veta (float): + implied_vol (float): + iv_error (float): + sequence (int): + condition (int): + size (int): + charm (float): + price (float): + ext_condition2 (int): + ext_condition1 (int): + expiration (str): + ext_condition4 (int): + exchange (int): + vanna (float): + vomma (float): + ext_condition3 (int): + underlying_timestamp (str): + gamma (float): + timestamp (str): """ - symbol: list[str] - underlying_price: list[float] - strike: list[float] - right: list[str] - veta: list[float] - implied_vol: list[float] - iv_error: list[float] - sequence: list[int] - condition: list[int] - size: list[int] - charm: list[float] - price: list[float] - ext_condition2: list[int] - ext_condition1: list[int] - expiration: list[str] - ext_condition4: list[int] - exchange: list[int] - vanna: list[float] - vomma: list[float] - ext_condition3: list[int] - underlying_timestamp: list[str] - gamma: list[float] - timestamp: list[str] + symbol: str + underlying_price: float + strike: float + right: str + veta: float + implied_vol: float + iv_error: float + sequence: int + condition: int + size: int + charm: float + price: float + ext_condition2: int + ext_condition1: int + expiration: str + ext_condition4: int + exchange: int + vanna: float + vomma: float + ext_condition3: int + underlying_timestamp: str + gamma: float + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -80,97 +79,51 @@ class OptionHistoryTradeGreeksSecondOrderResponse200: def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - underlying_price = self.underlying_price - - strike = self.strike - - right = self.right - - veta = self.veta - - implied_vol = self.implied_vol - - iv_error = self.iv_error - - sequence = self.sequence - - condition = self.condition - - size = self.size - - charm = self.charm - - price = self.price - - ext_condition2 = self.ext_condition2 - - ext_condition1 = self.ext_condition1 - - expiration = self.expiration - - ext_condition4 = self.ext_condition4 - - exchange = self.exchange - - vanna = self.vanna - - vomma = self.vomma - - ext_condition3 = self.ext_condition3 - - underlying_timestamp = self.underlying_timestamp - - gamma = self.gamma - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -209,76 +162,53 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - underlying_price = cast(list[float], d.pop("underlying_price")) - - - strike = cast(list[float], d.pop("strike")) - - - right = cast(list[str], d.pop("right")) - - - veta = cast(list[float], d.pop("veta")) - - - implied_vol = cast(list[float], d.pop("implied_vol")) - - - iv_error = cast(list[float], d.pop("iv_error")) - - - sequence = cast(list[int], d.pop("sequence")) - - - condition = cast(list[int], d.pop("condition")) - - - size = cast(list[int], d.pop("size")) - - - charm = cast(list[float], d.pop("charm")) - - - price = cast(list[float], d.pop("price")) - + symbol = d.pop("symbol") - ext_condition2 = cast(list[int], d.pop("ext_condition2")) + underlying_price = d.pop("underlying_price") + strike = d.pop("strike") - ext_condition1 = cast(list[int], d.pop("ext_condition1")) + right = d.pop("right") + veta = d.pop("veta") - expiration = cast(list[str], d.pop("expiration")) + implied_vol = d.pop("implied_vol") + iv_error = d.pop("iv_error") - ext_condition4 = cast(list[int], d.pop("ext_condition4")) + sequence = d.pop("sequence") + condition = d.pop("condition") - exchange = cast(list[int], d.pop("exchange")) + size = d.pop("size") + charm = d.pop("charm") - vanna = cast(list[float], d.pop("vanna")) + price = d.pop("price") + ext_condition2 = d.pop("ext_condition2") - vomma = cast(list[float], d.pop("vomma")) + ext_condition1 = d.pop("ext_condition1") + expiration = d.pop("expiration") - ext_condition3 = cast(list[int], d.pop("ext_condition3")) + ext_condition4 = d.pop("ext_condition4") + exchange = d.pop("exchange") - underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) + vanna = d.pop("vanna") + vomma = d.pop("vomma") - gamma = cast(list[float], d.pop("gamma")) + ext_condition3 = d.pop("ext_condition3") + underlying_timestamp = d.pop("underlying_timestamp") - timestamp = cast(list[str], d.pop("timestamp")) + gamma = d.pop("gamma") + timestamp = d.pop("timestamp") - option_history_trade_greeks_second_order_response_200 = cls( + option_history_trade_greeks_second_order_response_200_item = cls( symbol=symbol, underlying_price=underlying_price, strike=strike, @@ -306,8 +236,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - option_history_trade_greeks_second_order_response_200.additional_properties = d - return option_history_trade_greeks_second_order_response_200 + option_history_trade_greeks_second_order_response_200_item.additional_properties = d + return option_history_trade_greeks_second_order_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_history_trade_greeks_third_order_response_200.py b/openapi_project/openapi_package/models/option_history_trade_greeks_third_order_response_200_item.py similarity index 54% rename from openapi_project/openapi_package/models/option_history_trade_greeks_third_order_response_200.py rename to openapi_project/openapi_package/models/option_history_trade_greeks_third_order_response_200_item.py index 10064cf07..557c64244 100644 --- a/openapi_project/openapi_package/models/option_history_trade_greeks_third_order_response_200.py +++ b/openapi_project/openapi_package/models/option_history_trade_greeks_third_order_response_200_item.py @@ -8,67 +8,66 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionHistoryTradeGreeksThirdOrderResponse200") +T = TypeVar("T", bound="OptionHistoryTradeGreeksThirdOrderResponse200Item") @_attrs_define -class OptionHistoryTradeGreeksThirdOrderResponse200: +class OptionHistoryTradeGreeksThirdOrderResponse200Item: """ Attributes: - symbol (list[str]): - underlying_price (list[float]): - color (list[float]): - strike (list[float]): - zomma (list[float]): - right (list[str]): - implied_vol (list[float]): - iv_error (list[float]): - speed (list[float]): - ultima (list[float]): - sequence (list[int]): - condition (list[int]): - size (list[int]): - price (list[float]): - ext_condition2 (list[int]): - ext_condition1 (list[int]): - expiration (list[str]): - ext_condition4 (list[int]): - exchange (list[int]): - ext_condition3 (list[int]): - underlying_timestamp (list[str]): - timestamp (list[str]): + symbol (str): + underlying_price (float): + color (float): + strike (float): + zomma (float): + right (str): + implied_vol (float): + iv_error (float): + speed (float): + ultima (float): + sequence (int): + condition (int): + size (int): + price (float): + ext_condition2 (int): + ext_condition1 (int): + expiration (str): + ext_condition4 (int): + exchange (int): + ext_condition3 (int): + underlying_timestamp (str): + timestamp (str): """ - symbol: list[str] - underlying_price: list[float] - color: list[float] - strike: list[float] - zomma: list[float] - right: list[str] - implied_vol: list[float] - iv_error: list[float] - speed: list[float] - ultima: list[float] - sequence: list[int] - condition: list[int] - size: list[int] - price: list[float] - ext_condition2: list[int] - ext_condition1: list[int] - expiration: list[str] - ext_condition4: list[int] - exchange: list[int] - ext_condition3: list[int] - underlying_timestamp: list[str] - timestamp: list[str] + symbol: str + underlying_price: float + color: float + strike: float + zomma: float + right: str + implied_vol: float + iv_error: float + speed: float + ultima: float + sequence: int + condition: int + size: int + price: float + ext_condition2: int + ext_condition1: int + expiration: str + ext_condition4: int + exchange: int + ext_condition3: int + underlying_timestamp: str + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -78,93 +77,49 @@ class OptionHistoryTradeGreeksThirdOrderResponse200: def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - underlying_price = self.underlying_price - - color = self.color - - strike = self.strike - - zomma = self.zomma - - right = self.right - - implied_vol = self.implied_vol - - iv_error = self.iv_error - - speed = self.speed - - ultima = self.ultima - - sequence = self.sequence - - condition = self.condition - - size = self.size - - price = self.price - - ext_condition2 = self.ext_condition2 - - ext_condition1 = self.ext_condition1 - - expiration = self.expiration - - ext_condition4 = self.ext_condition4 - - exchange = self.exchange - - ext_condition3 = self.ext_condition3 - - underlying_timestamp = self.underlying_timestamp - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -202,73 +157,51 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - underlying_price = cast(list[float], d.pop("underlying_price")) - - - color = cast(list[float], d.pop("color")) - - - strike = cast(list[float], d.pop("strike")) - - - zomma = cast(list[float], d.pop("zomma")) - - - right = cast(list[str], d.pop("right")) - - - implied_vol = cast(list[float], d.pop("implied_vol")) - - - iv_error = cast(list[float], d.pop("iv_error")) - - - speed = cast(list[float], d.pop("speed")) - - - ultima = cast(list[float], d.pop("ultima")) - - - sequence = cast(list[int], d.pop("sequence")) - - - condition = cast(list[int], d.pop("condition")) + symbol = d.pop("symbol") + underlying_price = d.pop("underlying_price") - size = cast(list[int], d.pop("size")) + color = d.pop("color") + strike = d.pop("strike") - price = cast(list[float], d.pop("price")) + zomma = d.pop("zomma") + right = d.pop("right") - ext_condition2 = cast(list[int], d.pop("ext_condition2")) + implied_vol = d.pop("implied_vol") + iv_error = d.pop("iv_error") - ext_condition1 = cast(list[int], d.pop("ext_condition1")) + speed = d.pop("speed") + ultima = d.pop("ultima") - expiration = cast(list[str], d.pop("expiration")) + sequence = d.pop("sequence") + condition = d.pop("condition") - ext_condition4 = cast(list[int], d.pop("ext_condition4")) + size = d.pop("size") + price = d.pop("price") - exchange = cast(list[int], d.pop("exchange")) + ext_condition2 = d.pop("ext_condition2") + ext_condition1 = d.pop("ext_condition1") - ext_condition3 = cast(list[int], d.pop("ext_condition3")) + expiration = d.pop("expiration") + ext_condition4 = d.pop("ext_condition4") - underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) + exchange = d.pop("exchange") + ext_condition3 = d.pop("ext_condition3") - timestamp = cast(list[str], d.pop("timestamp")) + underlying_timestamp = d.pop("underlying_timestamp") + timestamp = d.pop("timestamp") - option_history_trade_greeks_third_order_response_200 = cls( + option_history_trade_greeks_third_order_response_200_item = cls( symbol=symbol, underlying_price=underlying_price, color=color, @@ -295,8 +228,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - option_history_trade_greeks_third_order_response_200.additional_properties = d - return option_history_trade_greeks_third_order_response_200 + option_history_trade_greeks_third_order_response_200_item.additional_properties = d + return option_history_trade_greeks_third_order_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_history_trade_quote_response_200.py b/openapi_project/openapi_package/models/option_history_trade_quote_response_200_item.py similarity index 52% rename from openapi_project/openapi_package/models/option_history_trade_quote_response_200.py rename to openapi_project/openapi_package/models/option_history_trade_quote_response_200_item.py index bf4bb26f8..912f6ebf9 100644 --- a/openapi_project/openapi_package/models/option_history_trade_quote_response_200.py +++ b/openapi_project/openapi_package/models/option_history_trade_quote_response_200_item.py @@ -8,69 +8,68 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionHistoryTradeQuoteResponse200") +T = TypeVar("T", bound="OptionHistoryTradeQuoteResponse200Item") @_attrs_define -class OptionHistoryTradeQuoteResponse200: +class OptionHistoryTradeQuoteResponse200Item: """ Attributes: - symbol (list[str]): - ask_size (list[int]): - trade_timestamp (list[str]): - ask_condition (list[int]): - strike (list[float]): - right (list[str]): - sequence (list[int]): - condition (list[int]): - size (list[int]): - bid_size (list[int]): - ask_exchange (list[int]): - price (list[float]): - ext_condition2 (list[int]): - bid_exchange (list[int]): - ask (list[float]): - quote_timestamp (list[str]): - ext_condition1 (list[int]): - expiration (list[str]): - ext_condition4 (list[int]): - exchange (list[int]): - ext_condition3 (list[int]): - bid (list[float]): - bid_condition (list[int]): + symbol (str): + ask_size (int): + trade_timestamp (str): + ask_condition (int): + strike (float): + right (str): + sequence (int): + condition (int): + size (int): + bid_size (int): + ask_exchange (int): + price (float): + ext_condition2 (int): + bid_exchange (int): + ask (float): + quote_timestamp (str): + ext_condition1 (int): + expiration (str): + ext_condition4 (int): + exchange (int): + ext_condition3 (int): + bid (float): + bid_condition (int): """ - symbol: list[str] - ask_size: list[int] - trade_timestamp: list[str] - ask_condition: list[int] - strike: list[float] - right: list[str] - sequence: list[int] - condition: list[int] - size: list[int] - bid_size: list[int] - ask_exchange: list[int] - price: list[float] - ext_condition2: list[int] - bid_exchange: list[int] - ask: list[float] - quote_timestamp: list[str] - ext_condition1: list[int] - expiration: list[str] - ext_condition4: list[int] - exchange: list[int] - ext_condition3: list[int] - bid: list[float] - bid_condition: list[int] + symbol: str + ask_size: int + trade_timestamp: str + ask_condition: int + strike: float + right: str + sequence: int + condition: int + size: int + bid_size: int + ask_exchange: int + price: float + ext_condition2: int + bid_exchange: int + ask: float + quote_timestamp: str + ext_condition1: int + expiration: str + ext_condition4: int + exchange: int + ext_condition3: int + bid: float + bid_condition: int additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -80,97 +79,51 @@ class OptionHistoryTradeQuoteResponse200: def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - ask_size = self.ask_size - - trade_timestamp = self.trade_timestamp - - ask_condition = self.ask_condition - - strike = self.strike - - right = self.right - - sequence = self.sequence - - condition = self.condition - - size = self.size - - bid_size = self.bid_size - - ask_exchange = self.ask_exchange - - price = self.price - - ext_condition2 = self.ext_condition2 - - bid_exchange = self.bid_exchange - - ask = self.ask - - quote_timestamp = self.quote_timestamp - - ext_condition1 = self.ext_condition1 - - expiration = self.expiration - - ext_condition4 = self.ext_condition4 - - exchange = self.exchange - - ext_condition3 = self.ext_condition3 - - bid = self.bid - - bid_condition = self.bid_condition - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -209,76 +162,53 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - ask_size = cast(list[int], d.pop("ask_size")) - - - trade_timestamp = cast(list[str], d.pop("trade_timestamp")) - - - ask_condition = cast(list[int], d.pop("ask_condition")) - - - strike = cast(list[float], d.pop("strike")) - - - right = cast(list[str], d.pop("right")) - - - sequence = cast(list[int], d.pop("sequence")) - - - condition = cast(list[int], d.pop("condition")) - - - size = cast(list[int], d.pop("size")) - - - bid_size = cast(list[int], d.pop("bid_size")) - - - ask_exchange = cast(list[int], d.pop("ask_exchange")) - - - price = cast(list[float], d.pop("price")) - + symbol = d.pop("symbol") - ext_condition2 = cast(list[int], d.pop("ext_condition2")) + ask_size = d.pop("ask_size") + trade_timestamp = d.pop("trade_timestamp") - bid_exchange = cast(list[int], d.pop("bid_exchange")) + ask_condition = d.pop("ask_condition") + strike = d.pop("strike") - ask = cast(list[float], d.pop("ask")) + right = d.pop("right") + sequence = d.pop("sequence") - quote_timestamp = cast(list[str], d.pop("quote_timestamp")) + condition = d.pop("condition") + size = d.pop("size") - ext_condition1 = cast(list[int], d.pop("ext_condition1")) + bid_size = d.pop("bid_size") + ask_exchange = d.pop("ask_exchange") - expiration = cast(list[str], d.pop("expiration")) + price = d.pop("price") + ext_condition2 = d.pop("ext_condition2") - ext_condition4 = cast(list[int], d.pop("ext_condition4")) + bid_exchange = d.pop("bid_exchange") + ask = d.pop("ask") - exchange = cast(list[int], d.pop("exchange")) + quote_timestamp = d.pop("quote_timestamp") + ext_condition1 = d.pop("ext_condition1") - ext_condition3 = cast(list[int], d.pop("ext_condition3")) + expiration = d.pop("expiration") + ext_condition4 = d.pop("ext_condition4") - bid = cast(list[float], d.pop("bid")) + exchange = d.pop("exchange") + ext_condition3 = d.pop("ext_condition3") - bid_condition = cast(list[int], d.pop("bid_condition")) + bid = d.pop("bid") + bid_condition = d.pop("bid_condition") - option_history_trade_quote_response_200 = cls( + option_history_trade_quote_response_200_item = cls( symbol=symbol, ask_size=ask_size, trade_timestamp=trade_timestamp, @@ -306,8 +236,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - option_history_trade_quote_response_200.additional_properties = d - return option_history_trade_quote_response_200 + option_history_trade_quote_response_200_item.additional_properties = d + return option_history_trade_quote_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_history_trade_response_200.py b/openapi_project/openapi_package/models/option_history_trade_response_200_item.py similarity index 56% rename from openapi_project/openapi_package/models/option_history_trade_response_200.py rename to openapi_project/openapi_package/models/option_history_trade_response_200_item.py index 71fe29215..6eb9786ae 100644 --- a/openapi_project/openapi_package/models/option_history_trade_response_200.py +++ b/openapi_project/openapi_package/models/option_history_trade_response_200_item.py @@ -8,51 +8,50 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionHistoryTradeResponse200") +T = TypeVar("T", bound="OptionHistoryTradeResponse200Item") @_attrs_define -class OptionHistoryTradeResponse200: +class OptionHistoryTradeResponse200Item: """ Attributes: - symbol (list[str]): - strike (list[float]): - right (list[str]): - sequence (list[int]): - condition (list[int]): - size (list[int]): - price (list[float]): - ext_condition2 (list[int]): - ext_condition1 (list[int]): - expiration (list[str]): - ext_condition4 (list[int]): - exchange (list[int]): - ext_condition3 (list[int]): - timestamp (list[str]): + symbol (str): + strike (float): + right (str): + sequence (int): + condition (int): + size (int): + price (float): + ext_condition2 (int): + ext_condition1 (int): + expiration (str): + ext_condition4 (int): + exchange (int): + ext_condition3 (int): + timestamp (str): """ - symbol: list[str] - strike: list[float] - right: list[str] - sequence: list[int] - condition: list[int] - size: list[int] - price: list[float] - ext_condition2: list[int] - ext_condition1: list[int] - expiration: list[str] - ext_condition4: list[int] - exchange: list[int] - ext_condition3: list[int] - timestamp: list[str] + symbol: str + strike: float + right: str + sequence: int + condition: int + size: int + price: float + ext_condition2: int + ext_condition1: int + expiration: str + ext_condition4: int + exchange: int + ext_condition3: int + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -62,61 +61,33 @@ class OptionHistoryTradeResponse200: def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - strike = self.strike - - right = self.right - - sequence = self.sequence - - condition = self.condition - - size = self.size - - price = self.price - - ext_condition2 = self.ext_condition2 - - ext_condition1 = self.ext_condition1 - - expiration = self.expiration - - ext_condition4 = self.ext_condition4 - - exchange = self.exchange - - ext_condition3 = self.ext_condition3 - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -146,49 +117,35 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - strike = cast(list[float], d.pop("strike")) - - - right = cast(list[str], d.pop("right")) - - - sequence = cast(list[int], d.pop("sequence")) - - - condition = cast(list[int], d.pop("condition")) - - - size = cast(list[int], d.pop("size")) - - - price = cast(list[float], d.pop("price")) - - - ext_condition2 = cast(list[int], d.pop("ext_condition2")) + symbol = d.pop("symbol") + strike = d.pop("strike") - ext_condition1 = cast(list[int], d.pop("ext_condition1")) + right = d.pop("right") + sequence = d.pop("sequence") - expiration = cast(list[str], d.pop("expiration")) + condition = d.pop("condition") + size = d.pop("size") - ext_condition4 = cast(list[int], d.pop("ext_condition4")) + price = d.pop("price") + ext_condition2 = d.pop("ext_condition2") - exchange = cast(list[int], d.pop("exchange")) + ext_condition1 = d.pop("ext_condition1") + expiration = d.pop("expiration") - ext_condition3 = cast(list[int], d.pop("ext_condition3")) + ext_condition4 = d.pop("ext_condition4") + exchange = d.pop("exchange") - timestamp = cast(list[str], d.pop("timestamp")) + ext_condition3 = d.pop("ext_condition3") + timestamp = d.pop("timestamp") - option_history_trade_response_200 = cls( + option_history_trade_response_200_item = cls( symbol=symbol, strike=strike, right=right, @@ -207,8 +164,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - option_history_trade_response_200.additional_properties = d - return option_history_trade_response_200 + option_history_trade_response_200_item.additional_properties = d + return option_history_trade_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_list_dates_response_200.py b/openapi_project/openapi_package/models/option_list_contracts_response_200_item.py similarity index 62% rename from openapi_project/openapi_package/models/option_list_dates_response_200.py rename to openapi_project/openapi_package/models/option_list_contracts_response_200_item.py index 165e2aacb..667b8917c 100644 --- a/openapi_project/openapi_package/models/option_list_dates_response_200.py +++ b/openapi_project/openapi_package/models/option_list_contracts_response_200_item.py @@ -8,33 +8,30 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionListDatesResponse200") +T = TypeVar("T", bound="OptionListContractsResponse200Item") @_attrs_define -class OptionListDatesResponse200: +class OptionListContractsResponse200Item: """ Attributes: - date (list[str]): - symbol (list[str]): - strike (list[float]): - expiration (list[str]): - right (list[str]): + symbol (str): + strike (float): + expiration (str): + right (str): """ - date: list[str] - symbol: list[str] - strike: list[float] - expiration: list[str] - right: list[str] + symbol: str + strike: float + expiration: str + right: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -42,34 +39,21 @@ class OptionListDatesResponse200: def to_dict(self) -> dict[str, Any]: - date = self.date - - - symbol = self.symbol - - strike = self.strike - - expiration = self.expiration - - right = self.right - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop for prop_name, prop in self.additional_properties.items() }) field_dict.update({ - "date": date, "symbol": symbol, "strike": strike, "expiration": expiration, @@ -83,23 +67,15 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - date = cast(list[str], d.pop("date")) - - - symbol = cast(list[str], d.pop("symbol")) - - - strike = cast(list[float], d.pop("strike")) - - - expiration = cast(list[str], d.pop("expiration")) + symbol = d.pop("symbol") + strike = d.pop("strike") - right = cast(list[str], d.pop("right")) + expiration = d.pop("expiration") + right = d.pop("right") - option_list_dates_response_200 = cls( - date=date, + option_list_contracts_response_200_item = cls( symbol=symbol, strike=strike, expiration=expiration, @@ -108,8 +84,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - option_list_dates_response_200.additional_properties = d - return option_list_dates_response_200 + option_list_contracts_response_200_item.additional_properties = d + return option_list_contracts_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_list_contracts_response_200.py b/openapi_project/openapi_package/models/option_list_dates_response_200_item.py similarity index 67% rename from openapi_project/openapi_package/models/option_list_contracts_response_200.py rename to openapi_project/openapi_package/models/option_list_dates_response_200_item.py index 55266c1ba..871783faa 100644 --- a/openapi_project/openapi_package/models/option_list_contracts_response_200.py +++ b/openapi_project/openapi_package/models/option_list_dates_response_200_item.py @@ -8,31 +8,32 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionListContractsResponse200") +T = TypeVar("T", bound="OptionListDatesResponse200Item") @_attrs_define -class OptionListContractsResponse200: +class OptionListDatesResponse200Item: """ Attributes: - symbol (list[str]): - strike (list[float]): - expiration (list[str]): - right (list[str]): + date (str): + symbol (str): + strike (float): + expiration (str): + right (str): """ - symbol: list[str] - strike: list[float] - expiration: list[str] - right: list[str] + date: str + symbol: str + strike: float + expiration: str + right: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -40,29 +41,24 @@ class OptionListContractsResponse200: def to_dict(self) -> dict[str, Any]: - symbol = self.symbol - + date = self.date + symbol = self.symbol strike = self.strike - - expiration = self.expiration - - right = self.right - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop for prop_name, prop in self.additional_properties.items() }) field_dict.update({ + "date": date, "symbol": symbol, "strike": strike, "expiration": expiration, @@ -76,19 +72,18 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - strike = cast(list[float], d.pop("strike")) - + date = d.pop("date") - expiration = cast(list[str], d.pop("expiration")) + symbol = d.pop("symbol") + strike = d.pop("strike") - right = cast(list[str], d.pop("right")) + expiration = d.pop("expiration") + right = d.pop("right") - option_list_contracts_response_200 = cls( + option_list_dates_response_200_item = cls( + date=date, symbol=symbol, strike=strike, expiration=expiration, @@ -97,8 +92,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - option_list_contracts_response_200.additional_properties = d - return option_list_contracts_response_200 + option_list_dates_response_200_item.additional_properties = d + return option_list_dates_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_list_expirations_response_200.py b/openapi_project/openapi_package/models/option_list_expirations_response_200_item.py similarity index 71% rename from openapi_project/openapi_package/models/option_list_expirations_response_200.py rename to openapi_project/openapi_package/models/option_list_expirations_response_200_item.py index b739557f4..25e9264cb 100644 --- a/openapi_project/openapi_package/models/option_list_expirations_response_200.py +++ b/openapi_project/openapi_package/models/option_list_expirations_response_200_item.py @@ -8,27 +8,26 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionListExpirationsResponse200") +T = TypeVar("T", bound="OptionListExpirationsResponse200Item") @_attrs_define -class OptionListExpirationsResponse200: +class OptionListExpirationsResponse200Item: """ Attributes: - symbol (list[str]): - expiration (list[str]): + symbol (str): + expiration (str): """ - symbol: list[str] - expiration: list[str] + symbol: str + expiration: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -38,13 +37,9 @@ class OptionListExpirationsResponse200: def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - expiration = self.expiration - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -62,21 +57,19 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - expiration = cast(list[str], d.pop("expiration")) + symbol = d.pop("symbol") + expiration = d.pop("expiration") - option_list_expirations_response_200 = cls( + option_list_expirations_response_200_item = cls( symbol=symbol, expiration=expiration, ) - option_list_expirations_response_200.additional_properties = d - return option_list_expirations_response_200 + option_list_expirations_response_200_item.additional_properties = d + return option_list_expirations_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_list_strikes_response_200.py b/openapi_project/openapi_package/models/option_list_strikes_response_200_item.py similarity index 72% rename from openapi_project/openapi_package/models/option_list_strikes_response_200.py rename to openapi_project/openapi_package/models/option_list_strikes_response_200_item.py index a1e107a8b..b42d23370 100644 --- a/openapi_project/openapi_package/models/option_list_strikes_response_200.py +++ b/openapi_project/openapi_package/models/option_list_strikes_response_200_item.py @@ -8,27 +8,26 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionListStrikesResponse200") +T = TypeVar("T", bound="OptionListStrikesResponse200Item") @_attrs_define -class OptionListStrikesResponse200: +class OptionListStrikesResponse200Item: """ Attributes: - symbol (list[str]): - strike (list[float]): + symbol (str): + strike (float): """ - symbol: list[str] - strike: list[float] + symbol: str + strike: float additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -38,13 +37,9 @@ class OptionListStrikesResponse200: def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - strike = self.strike - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -62,21 +57,19 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - strike = cast(list[float], d.pop("strike")) + symbol = d.pop("symbol") + strike = d.pop("strike") - option_list_strikes_response_200 = cls( + option_list_strikes_response_200_item = cls( symbol=symbol, strike=strike, ) - option_list_strikes_response_200.additional_properties = d - return option_list_strikes_response_200 + option_list_strikes_response_200_item.additional_properties = d + return option_list_strikes_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/index_list_symbols_response_200.py b/openapi_project/openapi_package/models/option_list_symbols_response_200_item.py similarity index 75% rename from openapi_project/openapi_package/models/index_list_symbols_response_200.py rename to openapi_project/openapi_package/models/option_list_symbols_response_200_item.py index dd9d247d1..6a839ed27 100644 --- a/openapi_project/openapi_package/models/index_list_symbols_response_200.py +++ b/openapi_project/openapi_package/models/option_list_symbols_response_200_item.py @@ -8,25 +8,24 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="IndexListSymbolsResponse200") +T = TypeVar("T", bound="OptionListSymbolsResponse200Item") @_attrs_define -class IndexListSymbolsResponse200: +class OptionListSymbolsResponse200Item: """ Attributes: - symbol (list[str]): + symbol (str): """ - symbol: list[str] + symbol: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -37,8 +36,6 @@ def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -55,17 +52,16 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - + symbol = d.pop("symbol") - index_list_symbols_response_200 = cls( + option_list_symbols_response_200_item = cls( symbol=symbol, ) - index_list_symbols_response_200.additional_properties = d - return index_list_symbols_response_200 + option_list_symbols_response_200_item.additional_properties = d + return option_list_symbols_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_all_response_200.py b/openapi_project/openapi_package/models/option_snapshot_greeks_all_response_200.py deleted file mode 100644 index 4d98e2223..000000000 --- a/openapi_project/openapi_package/models/option_snapshot_greeks_all_response_200.py +++ /dev/null @@ -1,414 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from openapi_project.openapi_package.types import UNSET, Unset - -from typing import cast - - - - - - -T = TypeVar("T", bound="OptionSnapshotGreeksAllResponse200") - - - -@_attrs_define -class OptionSnapshotGreeksAllResponse200: - """ - Attributes: - symbol (list[str]): - dual_delta (list[float]): - color (list[float]): - zomma (list[float]): - delta (list[float]): - implied_vol (list[float]): - theta (list[float]): - d1 (list[float]): - speed (list[float]): - d2 (list[float]): - epsilon (list[float]): - lambda_ (list[float]): - vomma (list[float]): - underlying_timestamp (list[str]): - timestamp (list[str]): - underlying_price (list[float]): - strike (list[float]): - vera (list[float]): - right (list[str]): - veta (list[float]): - iv_error (list[float]): - ultima (list[float]): - charm (list[float]): - ask (list[float]): - rho (list[float]): - expiration (list[str]): - vanna (list[float]): - dual_gamma (list[float]): - bid (list[float]): - vega (list[float]): - gamma (list[float]): - """ - - symbol: list[str] - dual_delta: list[float] - color: list[float] - zomma: list[float] - delta: list[float] - implied_vol: list[float] - theta: list[float] - d1: list[float] - speed: list[float] - d2: list[float] - epsilon: list[float] - lambda_: list[float] - vomma: list[float] - underlying_timestamp: list[str] - timestamp: list[str] - underlying_price: list[float] - strike: list[float] - vera: list[float] - right: list[str] - veta: list[float] - iv_error: list[float] - ultima: list[float] - charm: list[float] - ask: list[float] - rho: list[float] - expiration: list[str] - vanna: list[float] - dual_gamma: list[float] - bid: list[float] - vega: list[float] - gamma: list[float] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - - - - - def to_dict(self) -> dict[str, Any]: - symbol = self.symbol - - - - dual_delta = self.dual_delta - - - - color = self.color - - - - zomma = self.zomma - - - - delta = self.delta - - - - implied_vol = self.implied_vol - - - - theta = self.theta - - - - d1 = self.d1 - - - - speed = self.speed - - - - d2 = self.d2 - - - - epsilon = self.epsilon - - - - lambda_ = self.lambda_ - - - - vomma = self.vomma - - - - underlying_timestamp = self.underlying_timestamp - - - - timestamp = self.timestamp - - - - underlying_price = self.underlying_price - - - - strike = self.strike - - - - vera = self.vera - - - - right = self.right - - - - veta = self.veta - - - - iv_error = self.iv_error - - - - ultima = self.ultima - - - - charm = self.charm - - - - ask = self.ask - - - - rho = self.rho - - - - expiration = self.expiration - - - - vanna = self.vanna - - - - dual_gamma = self.dual_gamma - - - - bid = self.bid - - - - vega = self.vega - - - - gamma = self.gamma - - - - - field_dict: dict[str, Any] = {} - field_dict.update({ - prop_name: prop - for prop_name, prop in self.additional_properties.items() - }) - field_dict.update({ - "symbol": symbol, - "dual_delta": dual_delta, - "color": color, - "zomma": zomma, - "delta": delta, - "implied_vol": implied_vol, - "theta": theta, - "d1": d1, - "speed": speed, - "d2": d2, - "epsilon": epsilon, - "lambda": lambda_, - "vomma": vomma, - "underlying_timestamp": underlying_timestamp, - "timestamp": timestamp, - "underlying_price": underlying_price, - "strike": strike, - "vera": vera, - "right": right, - "veta": veta, - "iv_error": iv_error, - "ultima": ultima, - "charm": charm, - "ask": ask, - "rho": rho, - "expiration": expiration, - "vanna": vanna, - "dual_gamma": dual_gamma, - "bid": bid, - "vega": vega, - "gamma": gamma, - }) - - return field_dict - - - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - dual_delta = cast(list[float], d.pop("dual_delta")) - - - color = cast(list[float], d.pop("color")) - - - zomma = cast(list[float], d.pop("zomma")) - - - delta = cast(list[float], d.pop("delta")) - - - implied_vol = cast(list[float], d.pop("implied_vol")) - - - theta = cast(list[float], d.pop("theta")) - - - d1 = cast(list[float], d.pop("d1")) - - - speed = cast(list[float], d.pop("speed")) - - - d2 = cast(list[float], d.pop("d2")) - - - epsilon = cast(list[float], d.pop("epsilon")) - - - lambda_ = cast(list[float], d.pop("lambda")) - - - vomma = cast(list[float], d.pop("vomma")) - - - underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) - - - timestamp = cast(list[str], d.pop("timestamp")) - - - underlying_price = cast(list[float], d.pop("underlying_price")) - - - strike = cast(list[float], d.pop("strike")) - - - vera = cast(list[float], d.pop("vera")) - - - right = cast(list[str], d.pop("right")) - - - veta = cast(list[float], d.pop("veta")) - - - iv_error = cast(list[float], d.pop("iv_error")) - - - ultima = cast(list[float], d.pop("ultima")) - - - charm = cast(list[float], d.pop("charm")) - - - ask = cast(list[float], d.pop("ask")) - - - rho = cast(list[float], d.pop("rho")) - - - expiration = cast(list[str], d.pop("expiration")) - - - vanna = cast(list[float], d.pop("vanna")) - - - dual_gamma = cast(list[float], d.pop("dual_gamma")) - - - bid = cast(list[float], d.pop("bid")) - - - vega = cast(list[float], d.pop("vega")) - - - gamma = cast(list[float], d.pop("gamma")) - - - option_snapshot_greeks_all_response_200 = cls( - symbol=symbol, - dual_delta=dual_delta, - color=color, - zomma=zomma, - delta=delta, - implied_vol=implied_vol, - theta=theta, - d1=d1, - speed=speed, - d2=d2, - epsilon=epsilon, - lambda_=lambda_, - vomma=vomma, - underlying_timestamp=underlying_timestamp, - timestamp=timestamp, - underlying_price=underlying_price, - strike=strike, - vera=vera, - right=right, - veta=veta, - iv_error=iv_error, - ultima=ultima, - charm=charm, - ask=ask, - rho=rho, - expiration=expiration, - vanna=vanna, - dual_gamma=dual_gamma, - bid=bid, - vega=vega, - gamma=gamma, - ) - - - - option_snapshot_greeks_all_response_200.additional_properties = d - return option_snapshot_greeks_all_response_200 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_all_response_200_item.py b/openapi_project/openapi_package/models/option_snapshot_greeks_all_response_200_item.py new file mode 100644 index 000000000..47fb4f715 --- /dev/null +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_all_response_200_item.py @@ -0,0 +1,320 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from openapi_project.openapi_package.types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="OptionSnapshotGreeksAllResponse200Item") + + + +@_attrs_define +class OptionSnapshotGreeksAllResponse200Item: + """ + Attributes: + symbol (str): + dual_delta (float): + color (float): + zomma (float): + delta (float): + implied_vol (float): + theta (float): + d1 (float): + speed (float): + d2 (float): + epsilon (float): + lambda_ (float): + vomma (float): + underlying_timestamp (str): + timestamp (str): + underlying_price (float): + strike (float): + vera (float): + right (str): + veta (float): + iv_error (float): + ultima (float): + charm (float): + ask (float): + rho (float): + expiration (str): + vanna (float): + dual_gamma (float): + bid (float): + vega (float): + gamma (float): + """ + + symbol: str + dual_delta: float + color: float + zomma: float + delta: float + implied_vol: float + theta: float + d1: float + speed: float + d2: float + epsilon: float + lambda_: float + vomma: float + underlying_timestamp: str + timestamp: str + underlying_price: float + strike: float + vera: float + right: str + veta: float + iv_error: float + ultima: float + charm: float + ask: float + rho: float + expiration: str + vanna: float + dual_gamma: float + bid: float + vega: float + gamma: float + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + symbol = self.symbol + + dual_delta = self.dual_delta + + color = self.color + + zomma = self.zomma + + delta = self.delta + + implied_vol = self.implied_vol + + theta = self.theta + + d1 = self.d1 + + speed = self.speed + + d2 = self.d2 + + epsilon = self.epsilon + + lambda_ = self.lambda_ + + vomma = self.vomma + + underlying_timestamp = self.underlying_timestamp + + timestamp = self.timestamp + + underlying_price = self.underlying_price + + strike = self.strike + + vera = self.vera + + right = self.right + + veta = self.veta + + iv_error = self.iv_error + + ultima = self.ultima + + charm = self.charm + + ask = self.ask + + rho = self.rho + + expiration = self.expiration + + vanna = self.vanna + + dual_gamma = self.dual_gamma + + bid = self.bid + + vega = self.vega + + gamma = self.gamma + + + field_dict: dict[str, Any] = {} + field_dict.update({ + prop_name: prop + for prop_name, prop in self.additional_properties.items() + }) + field_dict.update({ + "symbol": symbol, + "dual_delta": dual_delta, + "color": color, + "zomma": zomma, + "delta": delta, + "implied_vol": implied_vol, + "theta": theta, + "d1": d1, + "speed": speed, + "d2": d2, + "epsilon": epsilon, + "lambda": lambda_, + "vomma": vomma, + "underlying_timestamp": underlying_timestamp, + "timestamp": timestamp, + "underlying_price": underlying_price, + "strike": strike, + "vera": vera, + "right": right, + "veta": veta, + "iv_error": iv_error, + "ultima": ultima, + "charm": charm, + "ask": ask, + "rho": rho, + "expiration": expiration, + "vanna": vanna, + "dual_gamma": dual_gamma, + "bid": bid, + "vega": vega, + "gamma": gamma, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + symbol = d.pop("symbol") + + dual_delta = d.pop("dual_delta") + + color = d.pop("color") + + zomma = d.pop("zomma") + + delta = d.pop("delta") + + implied_vol = d.pop("implied_vol") + + theta = d.pop("theta") + + d1 = d.pop("d1") + + speed = d.pop("speed") + + d2 = d.pop("d2") + + epsilon = d.pop("epsilon") + + lambda_ = d.pop("lambda") + + vomma = d.pop("vomma") + + underlying_timestamp = d.pop("underlying_timestamp") + + timestamp = d.pop("timestamp") + + underlying_price = d.pop("underlying_price") + + strike = d.pop("strike") + + vera = d.pop("vera") + + right = d.pop("right") + + veta = d.pop("veta") + + iv_error = d.pop("iv_error") + + ultima = d.pop("ultima") + + charm = d.pop("charm") + + ask = d.pop("ask") + + rho = d.pop("rho") + + expiration = d.pop("expiration") + + vanna = d.pop("vanna") + + dual_gamma = d.pop("dual_gamma") + + bid = d.pop("bid") + + vega = d.pop("vega") + + gamma = d.pop("gamma") + + option_snapshot_greeks_all_response_200_item = cls( + symbol=symbol, + dual_delta=dual_delta, + color=color, + zomma=zomma, + delta=delta, + implied_vol=implied_vol, + theta=theta, + d1=d1, + speed=speed, + d2=d2, + epsilon=epsilon, + lambda_=lambda_, + vomma=vomma, + underlying_timestamp=underlying_timestamp, + timestamp=timestamp, + underlying_price=underlying_price, + strike=strike, + vera=vera, + right=right, + veta=veta, + iv_error=iv_error, + ultima=ultima, + charm=charm, + ask=ask, + rho=rho, + expiration=expiration, + vanna=vanna, + dual_gamma=dual_gamma, + bid=bid, + vega=vega, + gamma=gamma, + ) + + + + option_snapshot_greeks_all_response_200_item.additional_properties = d + return option_snapshot_greeks_all_response_200_item + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_first_order_response_200.py b/openapi_project/openapi_package/models/option_snapshot_greeks_first_order_response_200_item.py similarity index 54% rename from openapi_project/openapi_package/models/option_snapshot_greeks_first_order_response_200.py rename to openapi_project/openapi_package/models/option_snapshot_greeks_first_order_response_200_item.py index fa6a4bafb..9df1c8f24 100644 --- a/openapi_project/openapi_package/models/option_snapshot_greeks_first_order_response_200.py +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_first_order_response_200_item.py @@ -8,57 +8,56 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionSnapshotGreeksFirstOrderResponse200") +T = TypeVar("T", bound="OptionSnapshotGreeksFirstOrderResponse200Item") @_attrs_define -class OptionSnapshotGreeksFirstOrderResponse200: +class OptionSnapshotGreeksFirstOrderResponse200Item: """ Attributes: - symbol (list[str]): - underlying_price (list[float]): - strike (list[float]): - delta (list[float]): - right (list[str]): - implied_vol (list[float]): - theta (list[float]): - iv_error (list[float]): - epsilon (list[float]): - lambda_ (list[float]): - ask (list[float]): - rho (list[float]): - expiration (list[str]): - bid (list[float]): - underlying_timestamp (list[str]): - vega (list[float]): - timestamp (list[str]): + symbol (str): + underlying_price (float): + strike (float): + delta (float): + right (str): + implied_vol (float): + theta (float): + iv_error (float): + epsilon (float): + lambda_ (float): + ask (float): + rho (float): + expiration (str): + bid (float): + underlying_timestamp (str): + vega (float): + timestamp (str): """ - symbol: list[str] - underlying_price: list[float] - strike: list[float] - delta: list[float] - right: list[str] - implied_vol: list[float] - theta: list[float] - iv_error: list[float] - epsilon: list[float] - lambda_: list[float] - ask: list[float] - rho: list[float] - expiration: list[str] - bid: list[float] - underlying_timestamp: list[str] - vega: list[float] - timestamp: list[str] + symbol: str + underlying_price: float + strike: float + delta: float + right: str + implied_vol: float + theta: float + iv_error: float + epsilon: float + lambda_: float + ask: float + rho: float + expiration: str + bid: float + underlying_timestamp: str + vega: float + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -68,73 +67,39 @@ class OptionSnapshotGreeksFirstOrderResponse200: def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - underlying_price = self.underlying_price - - strike = self.strike - - delta = self.delta - - right = self.right - - implied_vol = self.implied_vol - - theta = self.theta - - iv_error = self.iv_error - - epsilon = self.epsilon - - lambda_ = self.lambda_ - - ask = self.ask - - rho = self.rho - - expiration = self.expiration - - bid = self.bid - - underlying_timestamp = self.underlying_timestamp - - vega = self.vega - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -167,58 +132,41 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - underlying_price = cast(list[float], d.pop("underlying_price")) - - - strike = cast(list[float], d.pop("strike")) - - - delta = cast(list[float], d.pop("delta")) - - - right = cast(list[str], d.pop("right")) - - - implied_vol = cast(list[float], d.pop("implied_vol")) - - - theta = cast(list[float], d.pop("theta")) - - - iv_error = cast(list[float], d.pop("iv_error")) - - - epsilon = cast(list[float], d.pop("epsilon")) - + symbol = d.pop("symbol") - lambda_ = cast(list[float], d.pop("lambda")) + underlying_price = d.pop("underlying_price") + strike = d.pop("strike") - ask = cast(list[float], d.pop("ask")) + delta = d.pop("delta") + right = d.pop("right") - rho = cast(list[float], d.pop("rho")) + implied_vol = d.pop("implied_vol") + theta = d.pop("theta") - expiration = cast(list[str], d.pop("expiration")) + iv_error = d.pop("iv_error") + epsilon = d.pop("epsilon") - bid = cast(list[float], d.pop("bid")) + lambda_ = d.pop("lambda") + ask = d.pop("ask") - underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) + rho = d.pop("rho") + expiration = d.pop("expiration") - vega = cast(list[float], d.pop("vega")) + bid = d.pop("bid") + underlying_timestamp = d.pop("underlying_timestamp") - timestamp = cast(list[str], d.pop("timestamp")) + vega = d.pop("vega") + timestamp = d.pop("timestamp") - option_snapshot_greeks_first_order_response_200 = cls( + option_snapshot_greeks_first_order_response_200_item = cls( symbol=symbol, underlying_price=underlying_price, strike=strike, @@ -240,8 +188,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - option_snapshot_greeks_first_order_response_200.additional_properties = d - return option_snapshot_greeks_first_order_response_200 + option_snapshot_greeks_first_order_response_200_item.additional_properties = d + return option_snapshot_greeks_first_order_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_implied_volatility_response_200.py b/openapi_project/openapi_package/models/option_snapshot_greeks_implied_volatility_response_200_item.py similarity index 59% rename from openapi_project/openapi_package/models/option_snapshot_greeks_implied_volatility_response_200.py rename to openapi_project/openapi_package/models/option_snapshot_greeks_implied_volatility_response_200_item.py index 14acc1f2f..1cccd1d9c 100644 --- a/openapi_project/openapi_package/models/option_snapshot_greeks_implied_volatility_response_200.py +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_implied_volatility_response_200_item.py @@ -8,45 +8,44 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionSnapshotGreeksImpliedVolatilityResponse200") +T = TypeVar("T", bound="OptionSnapshotGreeksImpliedVolatilityResponse200Item") @_attrs_define -class OptionSnapshotGreeksImpliedVolatilityResponse200: +class OptionSnapshotGreeksImpliedVolatilityResponse200Item: """ Attributes: - symbol (list[str]): - underlying_price (list[float]): - strike (list[float]): - ask (list[float]): - expiration (list[str]): - right (list[str]): - implied_vol (list[float]): - bid (list[float]): - underlying_timestamp (list[str]): - iv_error (list[float]): - timestamp (list[str]): + symbol (str): + underlying_price (float): + strike (float): + ask (float): + expiration (str): + right (str): + implied_vol (float): + bid (float): + underlying_timestamp (str): + iv_error (float): + timestamp (str): """ - symbol: list[str] - underlying_price: list[float] - strike: list[float] - ask: list[float] - expiration: list[str] - right: list[str] - implied_vol: list[float] - bid: list[float] - underlying_timestamp: list[str] - iv_error: list[float] - timestamp: list[str] + symbol: str + underlying_price: float + strike: float + ask: float + expiration: str + right: str + implied_vol: float + bid: float + underlying_timestamp: str + iv_error: float + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -56,49 +55,27 @@ class OptionSnapshotGreeksImpliedVolatilityResponse200: def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - underlying_price = self.underlying_price - - strike = self.strike - - ask = self.ask - - expiration = self.expiration - - right = self.right - - implied_vol = self.implied_vol - - bid = self.bid - - underlying_timestamp = self.underlying_timestamp - - iv_error = self.iv_error - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -125,40 +102,29 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - underlying_price = cast(list[float], d.pop("underlying_price")) - - - strike = cast(list[float], d.pop("strike")) - - - ask = cast(list[float], d.pop("ask")) - - - expiration = cast(list[str], d.pop("expiration")) - - - right = cast(list[str], d.pop("right")) - + symbol = d.pop("symbol") - implied_vol = cast(list[float], d.pop("implied_vol")) + underlying_price = d.pop("underlying_price") + strike = d.pop("strike") - bid = cast(list[float], d.pop("bid")) + ask = d.pop("ask") + expiration = d.pop("expiration") - underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) + right = d.pop("right") + implied_vol = d.pop("implied_vol") - iv_error = cast(list[float], d.pop("iv_error")) + bid = d.pop("bid") + underlying_timestamp = d.pop("underlying_timestamp") - timestamp = cast(list[str], d.pop("timestamp")) + iv_error = d.pop("iv_error") + timestamp = d.pop("timestamp") - option_snapshot_greeks_implied_volatility_response_200 = cls( + option_snapshot_greeks_implied_volatility_response_200_item = cls( symbol=symbol, underlying_price=underlying_price, strike=strike, @@ -174,8 +140,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - option_snapshot_greeks_implied_volatility_response_200.additional_properties = d - return option_snapshot_greeks_implied_volatility_response_200 + option_snapshot_greeks_implied_volatility_response_200_item.additional_properties = d + return option_snapshot_greeks_implied_volatility_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_second_order_response_200.py b/openapi_project/openapi_package/models/option_snapshot_greeks_second_order_response_200_item.py similarity index 55% rename from openapi_project/openapi_package/models/option_snapshot_greeks_second_order_response_200.py rename to openapi_project/openapi_package/models/option_snapshot_greeks_second_order_response_200_item.py index 8005c1460..947a358b5 100644 --- a/openapi_project/openapi_package/models/option_snapshot_greeks_second_order_response_200.py +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_second_order_response_200_item.py @@ -8,55 +8,54 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionSnapshotGreeksSecondOrderResponse200") +T = TypeVar("T", bound="OptionSnapshotGreeksSecondOrderResponse200Item") @_attrs_define -class OptionSnapshotGreeksSecondOrderResponse200: +class OptionSnapshotGreeksSecondOrderResponse200Item: """ Attributes: - symbol (list[str]): - underlying_price (list[float]): - strike (list[float]): - right (list[str]): - veta (list[float]): - implied_vol (list[float]): - iv_error (list[float]): - charm (list[float]): - ask (list[float]): - expiration (list[str]): - vanna (list[float]): - vomma (list[float]): - bid (list[float]): - underlying_timestamp (list[str]): - gamma (list[float]): - timestamp (list[str]): + symbol (str): + underlying_price (float): + strike (float): + right (str): + veta (float): + implied_vol (float): + iv_error (float): + charm (float): + ask (float): + expiration (str): + vanna (float): + vomma (float): + bid (float): + underlying_timestamp (str): + gamma (float): + timestamp (str): """ - symbol: list[str] - underlying_price: list[float] - strike: list[float] - right: list[str] - veta: list[float] - implied_vol: list[float] - iv_error: list[float] - charm: list[float] - ask: list[float] - expiration: list[str] - vanna: list[float] - vomma: list[float] - bid: list[float] - underlying_timestamp: list[str] - gamma: list[float] - timestamp: list[str] + symbol: str + underlying_price: float + strike: float + right: str + veta: float + implied_vol: float + iv_error: float + charm: float + ask: float + expiration: str + vanna: float + vomma: float + bid: float + underlying_timestamp: str + gamma: float + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -66,69 +65,37 @@ class OptionSnapshotGreeksSecondOrderResponse200: def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - underlying_price = self.underlying_price - - strike = self.strike - - right = self.right - - veta = self.veta - - implied_vol = self.implied_vol - - iv_error = self.iv_error - - charm = self.charm - - ask = self.ask - - expiration = self.expiration - - vanna = self.vanna - - vomma = self.vomma - - bid = self.bid - - underlying_timestamp = self.underlying_timestamp - - gamma = self.gamma - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -160,55 +127,39 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - underlying_price = cast(list[float], d.pop("underlying_price")) - - - strike = cast(list[float], d.pop("strike")) - - - right = cast(list[str], d.pop("right")) - - - veta = cast(list[float], d.pop("veta")) - - - implied_vol = cast(list[float], d.pop("implied_vol")) - - - iv_error = cast(list[float], d.pop("iv_error")) - - - charm = cast(list[float], d.pop("charm")) - - - ask = cast(list[float], d.pop("ask")) + symbol = d.pop("symbol") + underlying_price = d.pop("underlying_price") - expiration = cast(list[str], d.pop("expiration")) + strike = d.pop("strike") + right = d.pop("right") - vanna = cast(list[float], d.pop("vanna")) + veta = d.pop("veta") + implied_vol = d.pop("implied_vol") - vomma = cast(list[float], d.pop("vomma")) + iv_error = d.pop("iv_error") + charm = d.pop("charm") - bid = cast(list[float], d.pop("bid")) + ask = d.pop("ask") + expiration = d.pop("expiration") - underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) + vanna = d.pop("vanna") + vomma = d.pop("vomma") - gamma = cast(list[float], d.pop("gamma")) + bid = d.pop("bid") + underlying_timestamp = d.pop("underlying_timestamp") - timestamp = cast(list[str], d.pop("timestamp")) + gamma = d.pop("gamma") + timestamp = d.pop("timestamp") - option_snapshot_greeks_second_order_response_200 = cls( + option_snapshot_greeks_second_order_response_200_item = cls( symbol=symbol, underlying_price=underlying_price, strike=strike, @@ -229,8 +180,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - option_snapshot_greeks_second_order_response_200.additional_properties = d - return option_snapshot_greeks_second_order_response_200 + option_snapshot_greeks_second_order_response_200_item.additional_properties = d + return option_snapshot_greeks_second_order_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_snapshot_greeks_third_order_response_200.py b/openapi_project/openapi_package/models/option_snapshot_greeks_third_order_response_200_item.py similarity index 55% rename from openapi_project/openapi_package/models/option_snapshot_greeks_third_order_response_200.py rename to openapi_project/openapi_package/models/option_snapshot_greeks_third_order_response_200_item.py index f704b1b2a..15f756bb9 100644 --- a/openapi_project/openapi_package/models/option_snapshot_greeks_third_order_response_200.py +++ b/openapi_project/openapi_package/models/option_snapshot_greeks_third_order_response_200_item.py @@ -8,53 +8,52 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionSnapshotGreeksThirdOrderResponse200") +T = TypeVar("T", bound="OptionSnapshotGreeksThirdOrderResponse200Item") @_attrs_define -class OptionSnapshotGreeksThirdOrderResponse200: +class OptionSnapshotGreeksThirdOrderResponse200Item: """ Attributes: - symbol (list[str]): - underlying_price (list[float]): - color (list[float]): - strike (list[float]): - zomma (list[float]): - right (list[str]): - implied_vol (list[float]): - iv_error (list[float]): - speed (list[float]): - ultima (list[float]): - ask (list[float]): - expiration (list[str]): - bid (list[float]): - underlying_timestamp (list[str]): - timestamp (list[str]): + symbol (str): + underlying_price (float): + color (float): + strike (float): + zomma (float): + right (str): + implied_vol (float): + iv_error (float): + speed (float): + ultima (float): + ask (float): + expiration (str): + bid (float): + underlying_timestamp (str): + timestamp (str): """ - symbol: list[str] - underlying_price: list[float] - color: list[float] - strike: list[float] - zomma: list[float] - right: list[str] - implied_vol: list[float] - iv_error: list[float] - speed: list[float] - ultima: list[float] - ask: list[float] - expiration: list[str] - bid: list[float] - underlying_timestamp: list[str] - timestamp: list[str] + symbol: str + underlying_price: float + color: float + strike: float + zomma: float + right: str + implied_vol: float + iv_error: float + speed: float + ultima: float + ask: float + expiration: str + bid: float + underlying_timestamp: str + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -64,65 +63,35 @@ class OptionSnapshotGreeksThirdOrderResponse200: def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - underlying_price = self.underlying_price - - color = self.color - - strike = self.strike - - zomma = self.zomma - - right = self.right - - implied_vol = self.implied_vol - - iv_error = self.iv_error - - speed = self.speed - - ultima = self.ultima - - ask = self.ask - - expiration = self.expiration - - bid = self.bid - - underlying_timestamp = self.underlying_timestamp - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -153,52 +122,37 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - underlying_price = cast(list[float], d.pop("underlying_price")) - - - color = cast(list[float], d.pop("color")) - - - strike = cast(list[float], d.pop("strike")) - - - zomma = cast(list[float], d.pop("zomma")) - - - right = cast(list[str], d.pop("right")) - - - implied_vol = cast(list[float], d.pop("implied_vol")) - - - iv_error = cast(list[float], d.pop("iv_error")) - + symbol = d.pop("symbol") - speed = cast(list[float], d.pop("speed")) + underlying_price = d.pop("underlying_price") + color = d.pop("color") - ultima = cast(list[float], d.pop("ultima")) + strike = d.pop("strike") + zomma = d.pop("zomma") - ask = cast(list[float], d.pop("ask")) + right = d.pop("right") + implied_vol = d.pop("implied_vol") - expiration = cast(list[str], d.pop("expiration")) + iv_error = d.pop("iv_error") + speed = d.pop("speed") - bid = cast(list[float], d.pop("bid")) + ultima = d.pop("ultima") + ask = d.pop("ask") - underlying_timestamp = cast(list[str], d.pop("underlying_timestamp")) + expiration = d.pop("expiration") + bid = d.pop("bid") - timestamp = cast(list[str], d.pop("timestamp")) + underlying_timestamp = d.pop("underlying_timestamp") + timestamp = d.pop("timestamp") - option_snapshot_greeks_third_order_response_200 = cls( + option_snapshot_greeks_third_order_response_200_item = cls( symbol=symbol, underlying_price=underlying_price, color=color, @@ -218,8 +172,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - option_snapshot_greeks_third_order_response_200.additional_properties = d - return option_snapshot_greeks_third_order_response_200 + option_snapshot_greeks_third_order_response_200_item.additional_properties = d + return option_snapshot_greeks_third_order_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_history_ohlc_response_200.py b/openapi_project/openapi_package/models/option_snapshot_ohlc_response_200_item.py similarity index 55% rename from openapi_project/openapi_package/models/option_history_ohlc_response_200.py rename to openapi_project/openapi_package/models/option_snapshot_ohlc_response_200_item.py index e092d9b9e..d2a956c7f 100644 --- a/openapi_project/openapi_package/models/option_history_ohlc_response_200.py +++ b/openapi_project/openapi_package/models/option_snapshot_ohlc_response_200_item.py @@ -8,47 +8,44 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionHistoryOhlcResponse200") +T = TypeVar("T", bound="OptionSnapshotOhlcResponse200Item") @_attrs_define -class OptionHistoryOhlcResponse200: +class OptionSnapshotOhlcResponse200Item: """ Attributes: - volume (list[int]): - symbol (list[str]): - high (list[float]): - low (list[float]): - strike (list[float]): - vwap (list[float]): - count (list[int]): - expiration (list[str]): - right (list[str]): - close (list[float]): - open_ (list[float]): - timestamp (list[str]): + volume (int): + symbol (str): + high (float): + low (float): + strike (float): + count (int): + expiration (str): + right (str): + close (float): + open_ (float): + timestamp (str): """ - volume: list[int] - symbol: list[str] - high: list[float] - low: list[float] - strike: list[float] - vwap: list[float] - count: list[int] - expiration: list[str] - right: list[str] - close: list[float] - open_: list[float] - timestamp: list[str] + volume: int + symbol: str + high: float + low: float + strike: float + count: int + expiration: str + right: str + close: float + open_: float + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -58,53 +55,27 @@ class OptionHistoryOhlcResponse200: def to_dict(self) -> dict[str, Any]: volume = self.volume - - symbol = self.symbol - - high = self.high - - low = self.low - - strike = self.strike - - - vwap = self.vwap - - - count = self.count - - expiration = self.expiration - - right = self.right - - close = self.close - - open_ = self.open_ - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -116,7 +87,6 @@ def to_dict(self) -> dict[str, Any]: "high": high, "low": low, "strike": strike, - "vwap": vwap, "count": count, "expiration": expiration, "right": right, @@ -132,49 +102,34 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - volume = cast(list[int], d.pop("volume")) - - - symbol = cast(list[str], d.pop("symbol")) - - - high = cast(list[float], d.pop("high")) - - - low = cast(list[float], d.pop("low")) - - - strike = cast(list[float], d.pop("strike")) - - - vwap = cast(list[float], d.pop("vwap")) - - - count = cast(list[int], d.pop("count")) - + volume = d.pop("volume") - expiration = cast(list[str], d.pop("expiration")) + symbol = d.pop("symbol") + high = d.pop("high") - right = cast(list[str], d.pop("right")) + low = d.pop("low") + strike = d.pop("strike") - close = cast(list[float], d.pop("close")) + count = d.pop("count") + expiration = d.pop("expiration") - open_ = cast(list[float], d.pop("open")) + right = d.pop("right") + close = d.pop("close") - timestamp = cast(list[str], d.pop("timestamp")) + open_ = d.pop("open") + timestamp = d.pop("timestamp") - option_history_ohlc_response_200 = cls( + option_snapshot_ohlc_response_200_item = cls( volume=volume, symbol=symbol, high=high, low=low, strike=strike, - vwap=vwap, count=count, expiration=expiration, right=right, @@ -185,8 +140,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - option_history_ohlc_response_200.additional_properties = d - return option_history_ohlc_response_200 + option_snapshot_ohlc_response_200_item.additional_properties = d + return option_snapshot_ohlc_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_snapshot_open_interest_response_200.py b/openapi_project/openapi_package/models/option_snapshot_open_interest_response_200_item.py similarity index 62% rename from openapi_project/openapi_package/models/option_snapshot_open_interest_response_200.py rename to openapi_project/openapi_package/models/option_snapshot_open_interest_response_200_item.py index 20e2c9be6..380977b66 100644 --- a/openapi_project/openapi_package/models/option_snapshot_open_interest_response_200.py +++ b/openapi_project/openapi_package/models/option_snapshot_open_interest_response_200_item.py @@ -8,35 +8,34 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionSnapshotOpenInterestResponse200") +T = TypeVar("T", bound="OptionSnapshotOpenInterestResponse200Item") @_attrs_define -class OptionSnapshotOpenInterestResponse200: +class OptionSnapshotOpenInterestResponse200Item: """ Attributes: - symbol (list[str]): - strike (list[float]): - open_interest (list[int]): - expiration (list[str]): - right (list[str]): - timestamp (list[str]): + symbol (str): + strike (float): + open_interest (int): + expiration (str): + right (str): + timestamp (str): """ - symbol: list[str] - strike: list[float] - open_interest: list[int] - expiration: list[str] - right: list[str] - timestamp: list[str] + symbol: str + strike: float + open_interest: int + expiration: str + right: str + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -46,29 +45,17 @@ class OptionSnapshotOpenInterestResponse200: def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - strike = self.strike - - open_interest = self.open_interest - - expiration = self.expiration - - right = self.right - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -90,25 +77,19 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - strike = cast(list[float], d.pop("strike")) - - - open_interest = cast(list[int], d.pop("open_interest")) - - - expiration = cast(list[str], d.pop("expiration")) + symbol = d.pop("symbol") + strike = d.pop("strike") - right = cast(list[str], d.pop("right")) + open_interest = d.pop("open_interest") + expiration = d.pop("expiration") - timestamp = cast(list[str], d.pop("timestamp")) + right = d.pop("right") + timestamp = d.pop("timestamp") - option_snapshot_open_interest_response_200 = cls( + option_snapshot_open_interest_response_200_item = cls( symbol=symbol, strike=strike, open_interest=open_interest, @@ -119,8 +100,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - option_snapshot_open_interest_response_200.additional_properties = d - return option_snapshot_open_interest_response_200 + option_snapshot_open_interest_response_200_item.additional_properties = d + return option_snapshot_open_interest_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_snapshot_quote_response_200.py b/openapi_project/openapi_package/models/option_snapshot_quote_response_200_item.py similarity index 56% rename from openapi_project/openapi_package/models/option_snapshot_quote_response_200.py rename to openapi_project/openapi_package/models/option_snapshot_quote_response_200_item.py index f564f014f..40489df2d 100644 --- a/openapi_project/openapi_package/models/option_snapshot_quote_response_200.py +++ b/openapi_project/openapi_package/models/option_snapshot_quote_response_200_item.py @@ -8,49 +8,48 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionSnapshotQuoteResponse200") +T = TypeVar("T", bound="OptionSnapshotQuoteResponse200Item") @_attrs_define -class OptionSnapshotQuoteResponse200: +class OptionSnapshotQuoteResponse200Item: """ Attributes: - symbol (list[str]): - ask_size (list[int]): - ask_condition (list[int]): - strike (list[float]): - right (list[str]): - bid_size (list[int]): - ask_exchange (list[int]): - bid_exchange (list[int]): - ask (list[float]): - expiration (list[str]): - bid (list[float]): - bid_condition (list[int]): - timestamp (list[str]): + symbol (str): + ask_size (int): + ask_condition (int): + strike (float): + right (str): + bid_size (int): + ask_exchange (int): + bid_exchange (int): + ask (float): + expiration (str): + bid (float): + bid_condition (int): + timestamp (str): """ - symbol: list[str] - ask_size: list[int] - ask_condition: list[int] - strike: list[float] - right: list[str] - bid_size: list[int] - ask_exchange: list[int] - bid_exchange: list[int] - ask: list[float] - expiration: list[str] - bid: list[float] - bid_condition: list[int] - timestamp: list[str] + symbol: str + ask_size: int + ask_condition: int + strike: float + right: str + bid_size: int + ask_exchange: int + bid_exchange: int + ask: float + expiration: str + bid: float + bid_condition: int + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -60,57 +59,31 @@ class OptionSnapshotQuoteResponse200: def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - ask_size = self.ask_size - - ask_condition = self.ask_condition - - strike = self.strike - - right = self.right - - bid_size = self.bid_size - - ask_exchange = self.ask_exchange - - bid_exchange = self.bid_exchange - - ask = self.ask - - expiration = self.expiration - - bid = self.bid - - bid_condition = self.bid_condition - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -139,46 +112,33 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - ask_size = cast(list[int], d.pop("ask_size")) - - - ask_condition = cast(list[int], d.pop("ask_condition")) - - - strike = cast(list[float], d.pop("strike")) - - - right = cast(list[str], d.pop("right")) - - - bid_size = cast(list[int], d.pop("bid_size")) - - - ask_exchange = cast(list[int], d.pop("ask_exchange")) - + symbol = d.pop("symbol") - bid_exchange = cast(list[int], d.pop("bid_exchange")) + ask_size = d.pop("ask_size") + ask_condition = d.pop("ask_condition") - ask = cast(list[float], d.pop("ask")) + strike = d.pop("strike") + right = d.pop("right") - expiration = cast(list[str], d.pop("expiration")) + bid_size = d.pop("bid_size") + ask_exchange = d.pop("ask_exchange") - bid = cast(list[float], d.pop("bid")) + bid_exchange = d.pop("bid_exchange") + ask = d.pop("ask") - bid_condition = cast(list[int], d.pop("bid_condition")) + expiration = d.pop("expiration") + bid = d.pop("bid") - timestamp = cast(list[str], d.pop("timestamp")) + bid_condition = d.pop("bid_condition") + timestamp = d.pop("timestamp") - option_snapshot_quote_response_200 = cls( + option_snapshot_quote_response_200_item = cls( symbol=symbol, ask_size=ask_size, ask_condition=ask_condition, @@ -196,8 +156,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - option_snapshot_quote_response_200.additional_properties = d - return option_snapshot_quote_response_200 + option_snapshot_quote_response_200_item.additional_properties = d + return option_snapshot_quote_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_snapshot_trade_response_200.py b/openapi_project/openapi_package/models/option_snapshot_trade_response_200_item.py similarity index 56% rename from openapi_project/openapi_package/models/option_snapshot_trade_response_200.py rename to openapi_project/openapi_package/models/option_snapshot_trade_response_200_item.py index 0f6a2910f..8f810262b 100644 --- a/openapi_project/openapi_package/models/option_snapshot_trade_response_200.py +++ b/openapi_project/openapi_package/models/option_snapshot_trade_response_200_item.py @@ -8,51 +8,50 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionSnapshotTradeResponse200") +T = TypeVar("T", bound="OptionSnapshotTradeResponse200Item") @_attrs_define -class OptionSnapshotTradeResponse200: +class OptionSnapshotTradeResponse200Item: """ Attributes: - symbol (list[str]): - strike (list[float]): - right (list[str]): - sequence (list[int]): - condition (list[int]): - size (list[int]): - price (list[float]): - ext_condition2 (list[int]): - ext_condition1 (list[int]): - expiration (list[str]): - ext_condition4 (list[int]): - exchange (list[int]): - ext_condition3 (list[int]): - timestamp (list[str]): + symbol (str): + strike (float): + right (str): + sequence (int): + condition (int): + size (int): + price (float): + ext_condition2 (int): + ext_condition1 (int): + expiration (str): + ext_condition4 (int): + exchange (int): + ext_condition3 (int): + timestamp (str): """ - symbol: list[str] - strike: list[float] - right: list[str] - sequence: list[int] - condition: list[int] - size: list[int] - price: list[float] - ext_condition2: list[int] - ext_condition1: list[int] - expiration: list[str] - ext_condition4: list[int] - exchange: list[int] - ext_condition3: list[int] - timestamp: list[str] + symbol: str + strike: float + right: str + sequence: int + condition: int + size: int + price: float + ext_condition2: int + ext_condition1: int + expiration: str + ext_condition4: int + exchange: int + ext_condition3: int + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -62,61 +61,33 @@ class OptionSnapshotTradeResponse200: def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - strike = self.strike - - right = self.right - - sequence = self.sequence - - condition = self.condition - - size = self.size - - price = self.price - - ext_condition2 = self.ext_condition2 - - ext_condition1 = self.ext_condition1 - - expiration = self.expiration - - ext_condition4 = self.ext_condition4 - - exchange = self.exchange - - ext_condition3 = self.ext_condition3 - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -146,49 +117,35 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - strike = cast(list[float], d.pop("strike")) - - - right = cast(list[str], d.pop("right")) - - - sequence = cast(list[int], d.pop("sequence")) - - - condition = cast(list[int], d.pop("condition")) - - - size = cast(list[int], d.pop("size")) - - - price = cast(list[float], d.pop("price")) - - - ext_condition2 = cast(list[int], d.pop("ext_condition2")) + symbol = d.pop("symbol") + strike = d.pop("strike") - ext_condition1 = cast(list[int], d.pop("ext_condition1")) + right = d.pop("right") + sequence = d.pop("sequence") - expiration = cast(list[str], d.pop("expiration")) + condition = d.pop("condition") + size = d.pop("size") - ext_condition4 = cast(list[int], d.pop("ext_condition4")) + price = d.pop("price") + ext_condition2 = d.pop("ext_condition2") - exchange = cast(list[int], d.pop("exchange")) + ext_condition1 = d.pop("ext_condition1") + expiration = d.pop("expiration") - ext_condition3 = cast(list[int], d.pop("ext_condition3")) + ext_condition4 = d.pop("ext_condition4") + exchange = d.pop("exchange") - timestamp = cast(list[str], d.pop("timestamp")) + ext_condition3 = d.pop("ext_condition3") + timestamp = d.pop("timestamp") - option_snapshot_trade_response_200 = cls( + option_snapshot_trade_response_200_item = cls( symbol=symbol, strike=strike, right=right, @@ -207,8 +164,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - option_snapshot_trade_response_200.additional_properties = d - return option_snapshot_trade_response_200 + option_snapshot_trade_response_200_item.additional_properties = d + return option_snapshot_trade_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/stock_history_quote_response_200.py b/openapi_project/openapi_package/models/stock_at_time_quote_response_200_item.py similarity index 60% rename from openapi_project/openapi_package/models/stock_history_quote_response_200.py rename to openapi_project/openapi_package/models/stock_at_time_quote_response_200_item.py index d6631eef2..94a4ebb2c 100644 --- a/openapi_project/openapi_package/models/stock_history_quote_response_200.py +++ b/openapi_project/openapi_package/models/stock_at_time_quote_response_200_item.py @@ -8,41 +8,40 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="StockHistoryQuoteResponse200") +T = TypeVar("T", bound="StockAtTimeQuoteResponse200Item") @_attrs_define -class StockHistoryQuoteResponse200: +class StockAtTimeQuoteResponse200Item: """ Attributes: - ask_size (list[int]): - bid_size (list[int]): - ask_exchange (list[int]): - ask_condition (list[int]): - bid_exchange (list[int]): - ask (list[float]): - bid (list[float]): - bid_condition (list[int]): - timestamp (list[str]): + ask_size (int): + bid_size (int): + ask_exchange (int): + ask_condition (int): + bid_exchange (int): + ask (float): + bid (float): + bid_condition (int): + timestamp (str): """ - ask_size: list[int] - bid_size: list[int] - ask_exchange: list[int] - ask_condition: list[int] - bid_exchange: list[int] - ask: list[float] - bid: list[float] - bid_condition: list[int] - timestamp: list[str] + ask_size: int + bid_size: int + ask_exchange: int + ask_condition: int + bid_exchange: int + ask: float + bid: float + bid_condition: int + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -52,41 +51,23 @@ class StockHistoryQuoteResponse200: def to_dict(self) -> dict[str, Any]: ask_size = self.ask_size - - bid_size = self.bid_size - - ask_exchange = self.ask_exchange - - ask_condition = self.ask_condition - - bid_exchange = self.bid_exchange - - ask = self.ask - - bid = self.bid - - bid_condition = self.bid_condition - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -111,34 +92,25 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - ask_size = cast(list[int], d.pop("ask_size")) - - - bid_size = cast(list[int], d.pop("bid_size")) - - - ask_exchange = cast(list[int], d.pop("ask_exchange")) - - - ask_condition = cast(list[int], d.pop("ask_condition")) - - - bid_exchange = cast(list[int], d.pop("bid_exchange")) - + ask_size = d.pop("ask_size") - ask = cast(list[float], d.pop("ask")) + bid_size = d.pop("bid_size") + ask_exchange = d.pop("ask_exchange") - bid = cast(list[float], d.pop("bid")) + ask_condition = d.pop("ask_condition") + bid_exchange = d.pop("bid_exchange") - bid_condition = cast(list[int], d.pop("bid_condition")) + ask = d.pop("ask") + bid = d.pop("bid") - timestamp = cast(list[str], d.pop("timestamp")) + bid_condition = d.pop("bid_condition") + timestamp = d.pop("timestamp") - stock_history_quote_response_200 = cls( + stock_at_time_quote_response_200_item = cls( ask_size=ask_size, bid_size=bid_size, ask_exchange=ask_exchange, @@ -152,8 +124,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - stock_history_quote_response_200.additional_properties = d - return stock_history_quote_response_200 + stock_at_time_quote_response_200_item.additional_properties = d + return stock_at_time_quote_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/stock_at_time_trade_response_200.py b/openapi_project/openapi_package/models/stock_at_time_trade_response_200_item.py similarity index 59% rename from openapi_project/openapi_package/models/stock_at_time_trade_response_200.py rename to openapi_project/openapi_package/models/stock_at_time_trade_response_200_item.py index 3318d2bb8..d3b365f87 100644 --- a/openapi_project/openapi_package/models/stock_at_time_trade_response_200.py +++ b/openapi_project/openapi_package/models/stock_at_time_trade_response_200_item.py @@ -8,43 +8,42 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="StockAtTimeTradeResponse200") +T = TypeVar("T", bound="StockAtTimeTradeResponse200Item") @_attrs_define -class StockAtTimeTradeResponse200: +class StockAtTimeTradeResponse200Item: """ Attributes: - sequence (list[int]): - condition (list[int]): - size (list[int]): - price (list[float]): - ext_condition2 (list[int]): - ext_condition1 (list[int]): - ext_condition4 (list[int]): - exchange (list[int]): - ext_condition3 (list[int]): - timestamp (list[str]): + sequence (int): + condition (int): + size (int): + price (float): + ext_condition2 (int): + ext_condition1 (int): + ext_condition4 (int): + exchange (int): + ext_condition3 (int): + timestamp (str): """ - sequence: list[int] - condition: list[int] - size: list[int] - price: list[float] - ext_condition2: list[int] - ext_condition1: list[int] - ext_condition4: list[int] - exchange: list[int] - ext_condition3: list[int] - timestamp: list[str] + sequence: int + condition: int + size: int + price: float + ext_condition2: int + ext_condition1: int + ext_condition4: int + exchange: int + ext_condition3: int + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -54,45 +53,25 @@ class StockAtTimeTradeResponse200: def to_dict(self) -> dict[str, Any]: sequence = self.sequence - - condition = self.condition - - size = self.size - - price = self.price - - ext_condition2 = self.ext_condition2 - - ext_condition1 = self.ext_condition1 - - ext_condition4 = self.ext_condition4 - - exchange = self.exchange - - ext_condition3 = self.ext_condition3 - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -118,37 +97,27 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - sequence = cast(list[int], d.pop("sequence")) - - - condition = cast(list[int], d.pop("condition")) - - - size = cast(list[int], d.pop("size")) - - - price = cast(list[float], d.pop("price")) - - - ext_condition2 = cast(list[int], d.pop("ext_condition2")) - - - ext_condition1 = cast(list[int], d.pop("ext_condition1")) + sequence = d.pop("sequence") + condition = d.pop("condition") - ext_condition4 = cast(list[int], d.pop("ext_condition4")) + size = d.pop("size") + price = d.pop("price") - exchange = cast(list[int], d.pop("exchange")) + ext_condition2 = d.pop("ext_condition2") + ext_condition1 = d.pop("ext_condition1") - ext_condition3 = cast(list[int], d.pop("ext_condition3")) + ext_condition4 = d.pop("ext_condition4") + exchange = d.pop("exchange") - timestamp = cast(list[str], d.pop("timestamp")) + ext_condition3 = d.pop("ext_condition3") + timestamp = d.pop("timestamp") - stock_at_time_trade_response_200 = cls( + stock_at_time_trade_response_200_item = cls( sequence=sequence, condition=condition, size=size, @@ -163,8 +132,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - stock_at_time_trade_response_200.additional_properties = d - return stock_at_time_trade_response_200 + stock_at_time_trade_response_200_item.additional_properties = d + return stock_at_time_trade_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/index_history_eod_response_200.py b/openapi_project/openapi_package/models/stock_history_eod_response_200_item.py similarity index 55% rename from openapi_project/openapi_package/models/index_history_eod_response_200.py rename to openapi_project/openapi_package/models/stock_history_eod_response_200_item.py index a24d59586..7d4b41a19 100644 --- a/openapi_project/openapi_package/models/index_history_eod_response_200.py +++ b/openapi_project/openapi_package/models/stock_history_eod_response_200_item.py @@ -8,55 +8,54 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="IndexHistoryEodResponse200") +T = TypeVar("T", bound="StockHistoryEodResponse200Item") @_attrs_define -class IndexHistoryEodResponse200: +class StockHistoryEodResponse200Item: """ Attributes: - ask_size (list[int]): - last_trade (list[str]): - created (list[str]): - ask_condition (list[int]): - count (list[int]): - volume (list[int]): - high (list[float]): - low (list[float]): - bid_size (list[int]): - ask_exchange (list[int]): - bid_exchange (list[int]): - ask (list[float]): - bid (list[float]): - bid_condition (list[int]): - close (list[float]): - open_ (list[float]): + ask_size (int): + last_trade (str): + created (str): + ask_condition (int): + count (int): + volume (int): + high (float): + low (float): + bid_size (int): + ask_exchange (int): + bid_exchange (int): + ask (float): + bid (float): + bid_condition (int): + close (float): + open_ (float): """ - ask_size: list[int] - last_trade: list[str] - created: list[str] - ask_condition: list[int] - count: list[int] - volume: list[int] - high: list[float] - low: list[float] - bid_size: list[int] - ask_exchange: list[int] - bid_exchange: list[int] - ask: list[float] - bid: list[float] - bid_condition: list[int] - close: list[float] - open_: list[float] + ask_size: int + last_trade: str + created: str + ask_condition: int + count: int + volume: int + high: float + low: float + bid_size: int + ask_exchange: int + bid_exchange: int + ask: float + bid: float + bid_condition: int + close: float + open_: float additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -66,69 +65,37 @@ class IndexHistoryEodResponse200: def to_dict(self) -> dict[str, Any]: ask_size = self.ask_size - - last_trade = self.last_trade - - created = self.created - - ask_condition = self.ask_condition - - count = self.count - - volume = self.volume - - high = self.high - - low = self.low - - bid_size = self.bid_size - - ask_exchange = self.ask_exchange - - bid_exchange = self.bid_exchange - - ask = self.ask - - bid = self.bid - - bid_condition = self.bid_condition - - close = self.close - - open_ = self.open_ - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -160,55 +127,39 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - ask_size = cast(list[int], d.pop("ask_size")) - - - last_trade = cast(list[str], d.pop("last_trade")) - - - created = cast(list[str], d.pop("created")) - - - ask_condition = cast(list[int], d.pop("ask_condition")) - - - count = cast(list[int], d.pop("count")) - - - volume = cast(list[int], d.pop("volume")) - - - high = cast(list[float], d.pop("high")) - - - low = cast(list[float], d.pop("low")) - - - bid_size = cast(list[int], d.pop("bid_size")) + ask_size = d.pop("ask_size") + last_trade = d.pop("last_trade") - ask_exchange = cast(list[int], d.pop("ask_exchange")) + created = d.pop("created") + ask_condition = d.pop("ask_condition") - bid_exchange = cast(list[int], d.pop("bid_exchange")) + count = d.pop("count") + volume = d.pop("volume") - ask = cast(list[float], d.pop("ask")) + high = d.pop("high") + low = d.pop("low") - bid = cast(list[float], d.pop("bid")) + bid_size = d.pop("bid_size") + ask_exchange = d.pop("ask_exchange") - bid_condition = cast(list[int], d.pop("bid_condition")) + bid_exchange = d.pop("bid_exchange") + ask = d.pop("ask") - close = cast(list[float], d.pop("close")) + bid = d.pop("bid") + bid_condition = d.pop("bid_condition") - open_ = cast(list[float], d.pop("open")) + close = d.pop("close") + open_ = d.pop("open") - index_history_eod_response_200 = cls( + stock_history_eod_response_200_item = cls( ask_size=ask_size, last_trade=last_trade, created=created, @@ -229,8 +180,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - index_history_eod_response_200.additional_properties = d - return index_history_eod_response_200 + stock_history_eod_response_200_item.additional_properties = d + return stock_history_eod_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/stock_history_ohlc_response_200.py b/openapi_project/openapi_package/models/stock_history_ohlc_response_200_item.py similarity index 60% rename from openapi_project/openapi_package/models/stock_history_ohlc_response_200.py rename to openapi_project/openapi_package/models/stock_history_ohlc_response_200_item.py index 8e7da1373..a6eef1fb5 100644 --- a/openapi_project/openapi_package/models/stock_history_ohlc_response_200.py +++ b/openapi_project/openapi_package/models/stock_history_ohlc_response_200_item.py @@ -8,39 +8,38 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="StockHistoryOhlcResponse200") +T = TypeVar("T", bound="StockHistoryOhlcResponse200Item") @_attrs_define -class StockHistoryOhlcResponse200: +class StockHistoryOhlcResponse200Item: """ Attributes: - volume (list[int]): - high (list[float]): - low (list[float]): - vwap (list[float]): - count (list[int]): - close (list[float]): - open_ (list[float]): - timestamp (list[str]): + volume (int): + high (float): + low (float): + vwap (float): + count (int): + close (float): + open_ (float): + timestamp (str): """ - volume: list[int] - high: list[float] - low: list[float] - vwap: list[float] - count: list[int] - close: list[float] - open_: list[float] - timestamp: list[str] + volume: int + high: float + low: float + vwap: float + count: int + close: float + open_: float + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -50,37 +49,21 @@ class StockHistoryOhlcResponse200: def to_dict(self) -> dict[str, Any]: volume = self.volume - - high = self.high - - low = self.low - - vwap = self.vwap - - count = self.count - - close = self.close - - open_ = self.open_ - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -104,31 +87,23 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - volume = cast(list[int], d.pop("volume")) - - - high = cast(list[float], d.pop("high")) - - - low = cast(list[float], d.pop("low")) - - - vwap = cast(list[float], d.pop("vwap")) - - - count = cast(list[int], d.pop("count")) + volume = d.pop("volume") + high = d.pop("high") - close = cast(list[float], d.pop("close")) + low = d.pop("low") + vwap = d.pop("vwap") - open_ = cast(list[float], d.pop("open")) + count = d.pop("count") + close = d.pop("close") - timestamp = cast(list[str], d.pop("timestamp")) + open_ = d.pop("open") + timestamp = d.pop("timestamp") - stock_history_ohlc_response_200 = cls( + stock_history_ohlc_response_200_item = cls( volume=volume, high=high, low=low, @@ -141,8 +116,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - stock_history_ohlc_response_200.additional_properties = d - return stock_history_ohlc_response_200 + stock_history_ohlc_response_200_item.additional_properties = d + return stock_history_ohlc_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/stock_snapshot_quote_response_200.py b/openapi_project/openapi_package/models/stock_history_quote_response_200_item.py similarity index 56% rename from openapi_project/openapi_package/models/stock_snapshot_quote_response_200.py rename to openapi_project/openapi_package/models/stock_history_quote_response_200_item.py index afce33477..e2f5fe36f 100644 --- a/openapi_project/openapi_package/models/stock_snapshot_quote_response_200.py +++ b/openapi_project/openapi_package/models/stock_history_quote_response_200_item.py @@ -8,43 +8,40 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="StockSnapshotQuoteResponse200") +T = TypeVar("T", bound="StockHistoryQuoteResponse200Item") @_attrs_define -class StockSnapshotQuoteResponse200: +class StockHistoryQuoteResponse200Item: """ Attributes: - symbol (list[str]): - ask_size (list[int]): - bid_size (list[int]): - ask_exchange (list[int]): - ask_condition (list[int]): - bid_exchange (list[int]): - ask (list[float]): - bid (list[float]): - bid_condition (list[int]): - timestamp (list[str]): + ask_size (int): + bid_size (int): + ask_exchange (int): + ask_condition (int): + bid_exchange (int): + ask (float): + bid (float): + bid_condition (int): + timestamp (str): """ - symbol: list[str] - ask_size: list[int] - bid_size: list[int] - ask_exchange: list[int] - ask_condition: list[int] - bid_exchange: list[int] - ask: list[float] - bid: list[float] - bid_condition: list[int] - timestamp: list[str] + ask_size: int + bid_size: int + ask_exchange: int + ask_condition: int + bid_exchange: int + ask: float + bid: float + bid_condition: int + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -52,54 +49,31 @@ class StockSnapshotQuoteResponse200: def to_dict(self) -> dict[str, Any]: - symbol = self.symbol - - - ask_size = self.ask_size - - bid_size = self.bid_size - - ask_exchange = self.ask_exchange - - ask_condition = self.ask_condition - - bid_exchange = self.bid_exchange - - ask = self.ask - - bid = self.bid - - bid_condition = self.bid_condition - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop for prop_name, prop in self.additional_properties.items() }) field_dict.update({ - "symbol": symbol, "ask_size": ask_size, "bid_size": bid_size, "ask_exchange": ask_exchange, @@ -118,38 +92,25 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - ask_size = cast(list[int], d.pop("ask_size")) - - - bid_size = cast(list[int], d.pop("bid_size")) - - - ask_exchange = cast(list[int], d.pop("ask_exchange")) - - - ask_condition = cast(list[int], d.pop("ask_condition")) - - - bid_exchange = cast(list[int], d.pop("bid_exchange")) - + ask_size = d.pop("ask_size") - ask = cast(list[float], d.pop("ask")) + bid_size = d.pop("bid_size") + ask_exchange = d.pop("ask_exchange") - bid = cast(list[float], d.pop("bid")) + ask_condition = d.pop("ask_condition") + bid_exchange = d.pop("bid_exchange") - bid_condition = cast(list[int], d.pop("bid_condition")) + ask = d.pop("ask") + bid = d.pop("bid") - timestamp = cast(list[str], d.pop("timestamp")) + bid_condition = d.pop("bid_condition") + timestamp = d.pop("timestamp") - stock_snapshot_quote_response_200 = cls( - symbol=symbol, + stock_history_quote_response_200_item = cls( ask_size=ask_size, bid_size=bid_size, ask_exchange=ask_exchange, @@ -163,8 +124,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - stock_snapshot_quote_response_200.additional_properties = d - return stock_snapshot_quote_response_200 + stock_history_quote_response_200_item.additional_properties = d + return stock_history_quote_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/stock_list_dates_response_200.py b/openapi_project/openapi_package/models/stock_list_dates_response_200_item.py similarity index 72% rename from openapi_project/openapi_package/models/stock_list_dates_response_200.py rename to openapi_project/openapi_package/models/stock_list_dates_response_200_item.py index 63f96bcdd..3509e1463 100644 --- a/openapi_project/openapi_package/models/stock_list_dates_response_200.py +++ b/openapi_project/openapi_package/models/stock_list_dates_response_200_item.py @@ -8,27 +8,26 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="StockListDatesResponse200") +T = TypeVar("T", bound="StockListDatesResponse200Item") @_attrs_define -class StockListDatesResponse200: +class StockListDatesResponse200Item: """ Attributes: - date (list[str]): - symbol (list[str]): + date (str): + symbol (str): """ - date: list[str] - symbol: list[str] + date: str + symbol: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -38,13 +37,9 @@ class StockListDatesResponse200: def to_dict(self) -> dict[str, Any]: date = self.date - - symbol = self.symbol - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -62,21 +57,19 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - date = cast(list[str], d.pop("date")) - - - symbol = cast(list[str], d.pop("symbol")) + date = d.pop("date") + symbol = d.pop("symbol") - stock_list_dates_response_200 = cls( + stock_list_dates_response_200_item = cls( date=date, symbol=symbol, ) - stock_list_dates_response_200.additional_properties = d - return stock_list_dates_response_200 + stock_list_dates_response_200_item.additional_properties = d + return stock_list_dates_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/option_list_symbols_response_200.py b/openapi_project/openapi_package/models/stock_list_symbols_response_200_item.py similarity index 75% rename from openapi_project/openapi_package/models/option_list_symbols_response_200.py rename to openapi_project/openapi_package/models/stock_list_symbols_response_200_item.py index ef5f510e0..aad393270 100644 --- a/openapi_project/openapi_package/models/option_list_symbols_response_200.py +++ b/openapi_project/openapi_package/models/stock_list_symbols_response_200_item.py @@ -8,25 +8,24 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="OptionListSymbolsResponse200") +T = TypeVar("T", bound="StockListSymbolsResponse200Item") @_attrs_define -class OptionListSymbolsResponse200: +class StockListSymbolsResponse200Item: """ Attributes: - symbol (list[str]): + symbol (str): """ - symbol: list[str] + symbol: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -37,8 +36,6 @@ def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -55,17 +52,16 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - + symbol = d.pop("symbol") - option_list_symbols_response_200 = cls( + stock_list_symbols_response_200_item = cls( symbol=symbol, ) - option_list_symbols_response_200.additional_properties = d - return option_list_symbols_response_200 + stock_list_symbols_response_200_item.additional_properties = d + return stock_list_symbols_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/stock_snapshot_ohlc_response_200.py b/openapi_project/openapi_package/models/stock_snapshot_ohlc_response_200_item.py similarity index 60% rename from openapi_project/openapi_package/models/stock_snapshot_ohlc_response_200.py rename to openapi_project/openapi_package/models/stock_snapshot_ohlc_response_200_item.py index 0ae4ce883..1c334e179 100644 --- a/openapi_project/openapi_package/models/stock_snapshot_ohlc_response_200.py +++ b/openapi_project/openapi_package/models/stock_snapshot_ohlc_response_200_item.py @@ -8,39 +8,38 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="StockSnapshotOhlcResponse200") +T = TypeVar("T", bound="StockSnapshotOhlcResponse200Item") @_attrs_define -class StockSnapshotOhlcResponse200: +class StockSnapshotOhlcResponse200Item: """ Attributes: - volume (list[int]): - symbol (list[str]): - high (list[float]): - low (list[float]): - count (list[int]): - close (list[float]): - open_ (list[float]): - timestamp (list[str]): + volume (int): + symbol (str): + high (float): + low (float): + count (int): + close (float): + open_ (float): + timestamp (str): """ - volume: list[int] - symbol: list[str] - high: list[float] - low: list[float] - count: list[int] - close: list[float] - open_: list[float] - timestamp: list[str] + volume: int + symbol: str + high: float + low: float + count: int + close: float + open_: float + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -50,37 +49,21 @@ class StockSnapshotOhlcResponse200: def to_dict(self) -> dict[str, Any]: volume = self.volume - - symbol = self.symbol - - high = self.high - - low = self.low - - count = self.count - - close = self.close - - open_ = self.open_ - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -104,31 +87,23 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - volume = cast(list[int], d.pop("volume")) - - - symbol = cast(list[str], d.pop("symbol")) - - - high = cast(list[float], d.pop("high")) - - - low = cast(list[float], d.pop("low")) - - - count = cast(list[int], d.pop("count")) + volume = d.pop("volume") + symbol = d.pop("symbol") - close = cast(list[float], d.pop("close")) + high = d.pop("high") + low = d.pop("low") - open_ = cast(list[float], d.pop("open")) + count = d.pop("count") + close = d.pop("close") - timestamp = cast(list[str], d.pop("timestamp")) + open_ = d.pop("open") + timestamp = d.pop("timestamp") - stock_snapshot_ohlc_response_200 = cls( + stock_snapshot_ohlc_response_200_item = cls( volume=volume, symbol=symbol, high=high, @@ -141,8 +116,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - stock_snapshot_ohlc_response_200.additional_properties = d - return stock_snapshot_ohlc_response_200 + stock_snapshot_ohlc_response_200_item.additional_properties = d + return stock_snapshot_ohlc_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/stock_at_time_quote_response_200.py b/openapi_project/openapi_package/models/stock_snapshot_quote_response_200_item.py similarity index 60% rename from openapi_project/openapi_package/models/stock_at_time_quote_response_200.py rename to openapi_project/openapi_package/models/stock_snapshot_quote_response_200_item.py index 4c6dde99c..100ab0ec7 100644 --- a/openapi_project/openapi_package/models/stock_at_time_quote_response_200.py +++ b/openapi_project/openapi_package/models/stock_snapshot_quote_response_200_item.py @@ -8,41 +8,42 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="StockAtTimeQuoteResponse200") +T = TypeVar("T", bound="StockSnapshotQuoteResponse200Item") @_attrs_define -class StockAtTimeQuoteResponse200: +class StockSnapshotQuoteResponse200Item: """ Attributes: - ask_size (list[int]): - bid_size (list[int]): - ask_exchange (list[int]): - ask_condition (list[int]): - bid_exchange (list[int]): - ask (list[float]): - bid (list[float]): - bid_condition (list[int]): - timestamp (list[str]): + symbol (str): + ask_size (int): + bid_size (int): + ask_exchange (int): + ask_condition (int): + bid_exchange (int): + ask (float): + bid (float): + bid_condition (int): + timestamp (str): """ - ask_size: list[int] - bid_size: list[int] - ask_exchange: list[int] - ask_condition: list[int] - bid_exchange: list[int] - ask: list[float] - bid: list[float] - bid_condition: list[int] - timestamp: list[str] + symbol: str + ask_size: int + bid_size: int + ask_exchange: int + ask_condition: int + bid_exchange: int + ask: float + bid: float + bid_condition: int + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -50,49 +51,34 @@ class StockAtTimeQuoteResponse200: def to_dict(self) -> dict[str, Any]: - ask_size = self.ask_size - + symbol = self.symbol + ask_size = self.ask_size bid_size = self.bid_size - - ask_exchange = self.ask_exchange - - ask_condition = self.ask_condition - - bid_exchange = self.bid_exchange - - ask = self.ask - - bid = self.bid - - bid_condition = self.bid_condition - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop for prop_name, prop in self.additional_properties.items() }) field_dict.update({ + "symbol": symbol, "ask_size": ask_size, "bid_size": bid_size, "ask_exchange": ask_exchange, @@ -111,34 +97,28 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - ask_size = cast(list[int], d.pop("ask_size")) - - - bid_size = cast(list[int], d.pop("bid_size")) - - - ask_exchange = cast(list[int], d.pop("ask_exchange")) - - - ask_condition = cast(list[int], d.pop("ask_condition")) - - - bid_exchange = cast(list[int], d.pop("bid_exchange")) + symbol = d.pop("symbol") + ask_size = d.pop("ask_size") - ask = cast(list[float], d.pop("ask")) + bid_size = d.pop("bid_size") + ask_exchange = d.pop("ask_exchange") - bid = cast(list[float], d.pop("bid")) + ask_condition = d.pop("ask_condition") + bid_exchange = d.pop("bid_exchange") - bid_condition = cast(list[int], d.pop("bid_condition")) + ask = d.pop("ask") + bid = d.pop("bid") - timestamp = cast(list[str], d.pop("timestamp")) + bid_condition = d.pop("bid_condition") + timestamp = d.pop("timestamp") - stock_at_time_quote_response_200 = cls( + stock_snapshot_quote_response_200_item = cls( + symbol=symbol, ask_size=ask_size, bid_size=bid_size, ask_exchange=ask_exchange, @@ -152,8 +132,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - stock_at_time_quote_response_200.additional_properties = d - return stock_at_time_quote_response_200 + stock_snapshot_quote_response_200_item.additional_properties = d + return stock_snapshot_quote_response_200_item @property def additional_keys(self) -> list[str]: diff --git a/openapi_project/openapi_package/models/stock_snapshot_trade_response_200.py b/openapi_project/openapi_package/models/stock_snapshot_trade_response_200_item.py similarity index 63% rename from openapi_project/openapi_package/models/stock_snapshot_trade_response_200.py rename to openapi_project/openapi_package/models/stock_snapshot_trade_response_200_item.py index 510f47fbb..3742d0fc8 100644 --- a/openapi_project/openapi_package/models/stock_snapshot_trade_response_200.py +++ b/openapi_project/openapi_package/models/stock_snapshot_trade_response_200_item.py @@ -8,35 +8,34 @@ from openapi_project.openapi_package.types import UNSET, Unset -from typing import cast -T = TypeVar("T", bound="StockSnapshotTradeResponse200") +T = TypeVar("T", bound="StockSnapshotTradeResponse200Item") @_attrs_define -class StockSnapshotTradeResponse200: +class StockSnapshotTradeResponse200Item: """ Attributes: - symbol (list[str]): - sequence (list[int]): - condition (list[int]): - size (list[int]): - price (list[float]): - timestamp (list[str]): + symbol (str): + sequence (int): + condition (int): + size (int): + price (float): + timestamp (str): """ - symbol: list[str] - sequence: list[int] - condition: list[int] - size: list[int] - price: list[float] - timestamp: list[str] + symbol: str + sequence: int + condition: int + size: int + price: float + timestamp: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -46,29 +45,17 @@ class StockSnapshotTradeResponse200: def to_dict(self) -> dict[str, Any]: symbol = self.symbol - - sequence = self.sequence - - condition = self.condition - - size = self.size - - price = self.price - - timestamp = self.timestamp - - field_dict: dict[str, Any] = {} field_dict.update({ prop_name: prop @@ -90,25 +77,19 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - symbol = cast(list[str], d.pop("symbol")) - - - sequence = cast(list[int], d.pop("sequence")) - - - condition = cast(list[int], d.pop("condition")) - - - size = cast(list[int], d.pop("size")) + symbol = d.pop("symbol") + sequence = d.pop("sequence") - price = cast(list[float], d.pop("price")) + condition = d.pop("condition") + size = d.pop("size") - timestamp = cast(list[str], d.pop("timestamp")) + price = d.pop("price") + timestamp = d.pop("timestamp") - stock_snapshot_trade_response_200 = cls( + stock_snapshot_trade_response_200_item = cls( symbol=symbol, sequence=sequence, condition=condition, @@ -119,8 +100,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - stock_snapshot_trade_response_200.additional_properties = d - return stock_snapshot_trade_response_200 + stock_snapshot_trade_response_200_item.additional_properties = d + return stock_snapshot_trade_response_200_item @property def additional_keys(self) -> list[str]: